From af42ae4f8190c5c0257703b04671f35e66dfaa05 Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Mon, 13 Aug 2012 08:15:42 -0400
Subject: [PATCH 1/7] Watcom: Simplify compiler version detection (#11866)

Since commit c198730b (Detect Watcom compiler version with its id,
2011-12-07) the CMAKE_(C|CXX)_COMPILER_VERSION variables are set for the
Watcom compiler.  Use these in Windows-wcl386.cmake to set the old
WATCOM1* version variables.  This avoids using the old EXECUTE_PROCESS
command which failed due to extra quotes anyway.
---
 Modules/Platform/Windows-wcl386.cmake | 61 +++++++++++----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/Modules/Platform/Windows-wcl386.cmake b/Modules/Platform/Windows-wcl386.cmake
index 14b3b81d5..21c4a6907 100644
--- a/Modules/Platform/Windows-wcl386.cmake
+++ b/Modules/Platform/Windows-wcl386.cmake
@@ -83,40 +83,27 @@ SET(CMAKE_CXX_CREATE_STATIC_LIBRARY  "wlib ${CMAKE_LIB_QUIET} -c -n -b '<TARGET_
 # create a C static library
 SET(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY})
 
-IF(NOT CMAKE_WATCOM_COMPILER_TESTS_RUN)
-  SET(CMAKE_WATCOM_COMPILER_TESTS_RUN 1)
-  SET(testWatcomVersionFile
-    "${CMAKE_ROOT}/Modules/CMakeTestWatcomVersion.c")
-  STRING(REGEX REPLACE "/" "\\\\" testWatcomVersionFile "${testWatcomVersionFile}")
-  MESSAGE(STATUS "Check for Watcom compiler version")
-  SET(CMAKE_TEST_COMPILER ${CMAKE_C_COMPILER})
-  IF (NOT CMAKE_C_COMPILER)
-    SET(CMAKE_TEST_COMPILER ${CMAKE_CXX_COMPILER})
-  ENDIF()
-  EXECUTE_PROCESS(COMMAND ${CMAKE_TEST_COMPILER}
-    -q -pc \"${testWatcomVersionFile}\"
-    OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT
-    RESULT_VARIABLE CMAKE_COMPILER_RETURN
-    )
-  STRING(REGEX REPLACE "\n" " " compilerVersion "${CMAKE_COMPILER_OUTPUT}")
-  STRING(REGEX REPLACE ".*VERSION=(.*)" "\\1"
-    compilerVersion "${compilerVersion}")
-  IF("${CMAKE_COMPILER_RETURN}" STREQUAL "0")
-    SET(WATCOM16)
-    SET(WATCOM17)
-    SET(WATCOM18)
-    SET(WATCOM19)
-    IF("${compilerVersion}" LESS 1270)
-      SET(WATCOM16 1)
-    ENDIF()
-    IF("${compilerVersion}" EQUAL 1270)
-      SET(WATCOM17 1)
-    ENDIF()
-    IF("${compilerVersion}" EQUAL 1280)
-      SET(WATCOM18 1)
-    ENDIF()
-    IF("${compilerVersion}" EQUAL 1290)
-      SET(WATCOM19 1)
-    ENDIF()
-  ENDIF()
-ENDIF()
+if(NOT _CMAKE_WATCOM_VERSION)
+  set(_CMAKE_WATCOM_VERSION 1)
+  if(CMAKE_C_COMPILER_VERSION)
+    set(_compiler_version ${CMAKE_C_COMPILER_VERSION})
+  else()
+    set(_compiler_version ${CMAKE_CXX_COMPILER_VERSION})
+  endif()
+  set(WATCOM16)
+  set(WATCOM17)
+  set(WATCOM18)
+  set(WATCOM19)
+  if("${_compiler_version}" LESS 12.70)
+    set(WATCOM16 1)
+  endif()
+  if("${_compiler_version}" EQUAL 12.70)
+    set(WATCOM17 1)
+  endif()
+  if("${_compiler_version}" EQUAL 12.80)
+    set(WATCOM18 1)
+  endif()
+  if("${_compiler_version}" EQUAL 12.90)
+    set(WATCOM19 1)
+  endif()
+endif()

From 7bbaa4283de26864b2e55e819db0884771585467 Mon Sep 17 00:00:00 2001
From: Kitware Robot <kwrobot@kitware.com>
Date: Mon, 13 Aug 2012 13:42:58 -0400
Subject: [PATCH 2/7] Remove trailing whitespace from most CMake and C/C++ code

Our Git commit hooks disallow modification or addition of lines with
trailing whitespace.  Wipe out all remnants of trailing whitespace
everywhere except third-party code.

Run the following shell code:

git ls-files -z -- \
 bootstrap doxygen.config '*.readme' \
 '*.c' '*.cmake' '*.cpp' '*.cxx' \
 '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \
 '*.mm' '*.pike' '*.py' '*.txt' '*.vim' |
egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' |
egrep -z -v '^(Modules/CPack\..*\.in)' |
xargs -0 sed -i 's/ \+$//'
---
 CMakeCPack.cmake                              |   8 +-
 CMakeCPackOptions.cmake.in                    |   8 +-
 CMakeLists.txt                                |  48 +-
 CTestConfig.cmake                             |   4 +-
 CompileFlags.cmake                            |   6 +-
 Docs/cmake-indent.vim                         |   4 +-
 Docs/cmake-mode.el                            |  12 +-
 Docs/cmake-syntax.vim                         |  10 +-
 Example/Demo/demo.cxx                         |   2 +-
 Modules/CMakeAddNewLanguage.txt               |   2 +-
 Modules/CMakeBackwardCompatibilityC.cmake     |   4 +-
 Modules/CMakeBackwardCompatibilityCXX.cmake   |   4 +-
 Modules/CMakeCInformation.cmake               |  12 +-
 Modules/CMakeCXXInformation.cmake             |  12 +-
 Modules/CMakeCommonLanguageInclude.cmake      |  16 +-
 Modules/CMakeDetermineFortranCompiler.cmake   |  18 +-
 Modules/CMakeDetermineJavaCompiler.cmake      |  16 +-
 Modules/CMakeDetermineRCCompiler.cmake        |  12 +-
 Modules/CMakeDetermineSystem.cmake            |  52 +-
 Modules/CMakeFindBinUtils.cmake               |  12 +-
 Modules/CMakeFortranInformation.cmake         |   8 +-
 Modules/CMakeJavaInformation.cmake            |   2 +-
 Modules/CMakeMSYSFindMake.cmake               |   4 +-
 Modules/CMakeMinGWFindMake.cmake              |   2 +-
 Modules/CMakePlatformId.h.in                  |   4 +-
 Modules/CMakeSystemSpecificInformation.cmake  |   2 +-
 Modules/CMakeTestCCompiler.cmake              |   2 +-
 Modules/CMakeTestCXXCompiler.cmake            |   4 +-
 Modules/CMakeTestFortranCompiler.cmake        |   2 +-
 Modules/CMakeVS6BackwardCompatibility.cmake   |   2 +-
 Modules/CMakeVS7BackwardCompatibility.cmake   |   2 +-
 Modules/CMakeVerifyManifest.cmake             |   8 +-
 Modules/CPack.cmake                           |  18 +-
 Modules/CPackZIP.cmake                        |   2 +-
 Modules/CTest.cmake                           |  18 +-
 Modules/CTestScriptMode.cmake                 |   2 +-
 Modules/CheckForPthreads.c                    |   2 +-
 Modules/CheckIncludeFile.cmake                |  12 +-
 Modules/CheckIncludeFileCXX.cmake             |  12 +-
 Modules/CheckIncludeFiles.cmake               |   6 +-
 Modules/Dart.cmake                            |  18 +-
 Modules/Documentation.cmake                   |   6 +-
 Modules/FindALSA.cmake                        |   2 +-
 Modules/FindAVIFile.cmake                     |   2 +-
 Modules/FindBZip2.cmake                       |   2 +-
 Modules/FindBullet.cmake                      |   4 +-
 Modules/FindCURL.cmake                        |   4 +-
 Modules/FindCVS.cmake                         |  12 +-
 Modules/FindCoin3D.cmake                      |   8 +-
 Modules/FindCups.cmake                        |   4 +-
 Modules/FindCurses.cmake                      |  28 +-
 Modules/FindCxxTest.cmake                     |   8 +-
 Modules/FindDart.cmake                        |  12 +-
 Modules/FindDevIL.cmake                       |   6 +-
 Modules/FindDoxygen.cmake                     |  16 +-
 Modules/FindEXPAT.cmake                       |   2 +-
 Modules/FindFLTK.cmake                        |   8 +-
 Modules/FindFLTK2.cmake                       |  10 +-
 Modules/FindGDAL.cmake                        |   6 +-
 Modules/FindGLUT.cmake                        |  20 +-
 Modules/FindGTK.cmake                         |  10 +-
 Modules/FindGTK2.cmake                        |  14 +-
 Modules/FindGnuTLS.cmake                      |   2 +-
 Modules/FindGnuplot.cmake                     |   4 +-
 Modules/FindHDF5.cmake                        |  62 +-
 Modules/FindHSPELL.cmake                      |   2 +-
 Modules/FindHTMLHelp.cmake                    |  10 +-
 Modules/FindITK.cmake                         |  14 +-
 Modules/FindJNI.cmake                         |  18 +-
 Modules/FindJPEG.cmake                        |   2 +-
 Modules/FindJasper.cmake                      |   2 +-
 Modules/FindJava.cmake                        |   4 +-
 Modules/FindKDE3.cmake                        |   2 +-
 Modules/FindKDE4.cmake                        |   4 +-
 Modules/FindLATEX.cmake                       |   6 +-
 Modules/FindLibXml2.cmake                     |   2 +-
 Modules/FindLua50.cmake                       |   8 +-
 Modules/FindLua51.cmake                       |   6 +-
 Modules/FindMPEG.cmake                        |   2 +-
 Modules/FindMPEG2.cmake                       |   6 +-
 Modules/FindMotif.cmake                       |   2 +-
 Modules/FindOpenAL.cmake                      |  30 +-
 Modules/FindOpenGL.cmake                      |  12 +-
 Modules/FindOpenMP.cmake                      |   6 +-
 Modules/FindOpenSceneGraph.cmake              |  12 +-
 Modules/FindOpenThreads.cmake                 |  16 +-
 Modules/FindPHP4.cmake                        |   4 +-
 Modules/FindPerl.cmake                        |   8 +-
 Modules/FindPerlLibs.cmake                    |   2 +-
 Modules/FindPhysFS.cmake                      |   4 +-
 Modules/FindPkgConfig.cmake                   |  16 +-
 Modules/FindProducer.cmake                    |  14 +-
 Modules/FindProtobuf.cmake                    |   2 +-
 Modules/FindQt.cmake                          |  10 +-
 Modules/FindQt4.cmake                         | 112 +--
 Modules/FindQuickTime.cmake                   |   4 +-
 Modules/FindSDL.cmake                         |  38 +-
 Modules/FindSDL_image.cmake                   |   8 +-
 Modules/FindSDL_mixer.cmake                   |   8 +-
 Modules/FindSDL_net.cmake                     |   8 +-
 Modules/FindSDL_sound.cmake                   |  88 +--
 Modules/FindSDL_ttf.cmake                     |   8 +-
 Modules/FindSWIG.cmake                        |   2 +-
 Modules/FindSelfPackers.cmake                 |  12 +-
 Modules/FindSquish.cmake                      |  12 +-
 Modules/FindTCL.cmake                         |  56 +-
 Modules/FindTIFF.cmake                        |   2 +-
 Modules/FindTclStub.cmake                     |  56 +-
 Modules/FindTclsh.cmake                       |  12 +-
 Modules/FindThreads.cmake                     |   8 +-
 Modules/FindUnixCommands.cmake                |  16 +-
 Modules/FindVTK.cmake                         |  14 +-
 Modules/FindWget.cmake                        |   4 +-
 Modules/FindWish.cmake                        |  20 +-
 Modules/FindZLIB.cmake                        |   2 +-
 Modules/Findosg.cmake                         |   8 +-
 Modules/FindosgAnimation.cmake                |   8 +-
 Modules/FindosgDB.cmake                       |   8 +-
 Modules/FindosgFX.cmake                       |   8 +-
 Modules/FindosgGA.cmake                       |   8 +-
 Modules/FindosgIntrospection.cmake            |   8 +-
 Modules/FindosgManipulator.cmake              |   8 +-
 Modules/FindosgParticle.cmake                 |   8 +-
 Modules/FindosgProducer.cmake                 |   8 +-
 Modules/FindosgShadow.cmake                   |   8 +-
 Modules/FindosgSim.cmake                      |   8 +-
 Modules/FindosgTerrain.cmake                  |   8 +-
 Modules/FindosgText.cmake                     |   8 +-
 Modules/FindosgUtil.cmake                     |   8 +-
 Modules/FindosgViewer.cmake                   |   8 +-
 Modules/FindosgVolume.cmake                   |   8 +-
 Modules/FindosgWidget.cmake                   |   8 +-
 Modules/Findosg_functions.cmake               |   2 +-
 Modules/FindwxWidgets.cmake                   |  32 +-
 Modules/MacroAddFileDependencies.cmake        |   2 +-
 Modules/NSIS.template.in                      | 146 ++--
 Modules/Platform/BlueGeneL.cmake              |   4 +-
 Modules/Platform/Catamount.cmake              |   4 +-
 Modules/Platform/Darwin-icc.cmake             |   2 +-
 Modules/Platform/Generic-ADSP-C.cmake         |   2 +-
 Modules/Platform/Generic-ADSP-CXX.cmake       |   2 +-
 Modules/Platform/Generic-ADSP-Common.cmake    |   2 +-
 Modules/Platform/Generic-SDCC-C.cmake         |   4 +-
 Modules/Platform/Generic.cmake                |   2 +-
 Modules/Platform/IRIX64.cmake                 |   6 +-
 Modules/Platform/OSF1.cmake                   |   8 +-
 Modules/Platform/SunOS.cmake                  |   2 +-
 Modules/Platform/ULTRIX.cmake                 |   2 +-
 Modules/Platform/UnixPaths.cmake              |   4 +-
 Modules/Platform/Windows-Intel.cmake          |   4 +-
 Modules/Platform/Windows-cl.cmake             |  22 +-
 Modules/Platform/gas.cmake                    |   2 +-
 Modules/Qt4ConfigDependentSettings.cmake      |   2 +-
 Modules/Qt4Macros.cmake                       |   8 +-
 Modules/SelectLibraryConfigurations.cmake     |   6 +-
 Modules/SystemInformation.cmake               |  32 +-
 Modules/TestBigEndian.cmake                   |  18 +-
 Modules/TestCXXAcceptsFlag.cmake              |   2 +-
 Modules/TestForANSIForScope.cmake             |   6 +-
 Modules/TestForANSIStreamHeaders.cmake        |   6 +-
 Modules/TestForAnsiForScope.cxx               |   2 +-
 Modules/TestForSSTREAM.cmake                  |   6 +-
 Modules/TestForSSTREAM.cxx                    |   2 +-
 Modules/TestForSTDNamespace.cmake             |   6 +-
 Modules/TestForSTDNamespace.cxx               |   2 +-
 Modules/UseQt4.cmake                          |   2 +-
 Modules/UseSWIG.cmake                         |  10 +-
 Source/CPack/OSXScriptLauncher.cxx            |   8 +-
 Source/CPack/bills-comments.txt               |  22 +-
 Source/CPack/cmCPackArchiveGenerator.h        |   2 +-
 Source/CPack/cmCPackBundleGenerator.cxx       |   4 +-
 Source/CPack/cmCPackComponentGroup.cxx        |   2 +-
 Source/CPack/cmCPackComponentGroup.h          |   4 +-
 Source/CPack/cmCPackCygwinBinaryGenerator.cxx |  10 +-
 Source/CPack/cmCPackCygwinSourceGenerator.cxx |  16 +-
 Source/CPack/cmCPackDebGenerator.cxx          |  22 +-
 Source/CPack/cmCPackDragNDropGenerator.cxx    |  34 +-
 Source/CPack/cmCPackGenerator.cxx             |  84 +--
 Source/CPack/cmCPackGenerator.h               |   2 +-
 Source/CPack/cmCPackNSISGenerator.cxx         |  80 +--
 Source/CPack/cmCPackOSXX11Generator.cxx       |  24 +-
 Source/CPack/cmCPackPackageMakerGenerator.cxx |  92 +--
 Source/CPack/cmCPackPackageMakerGenerator.h   |  10 +-
 Source/CPack/cmCPackRPMGenerator.cxx          |   2 +-
 Source/CPack/cmCPackSTGZGenerator.cxx         |   4 +-
 Source/CPack/cmCPackTarBZip2Generator.cxx     |   2 +-
 Source/CPack/cmCPackTarCompressGenerator.cxx  |   2 +-
 Source/CPack/cygwin.readme                    |   6 +-
 Source/CTest/cmCTestBatchTestHandler.cxx      |   2 +-
 Source/CTest/cmCTestBatchTestHandler.h        |   2 +-
 Source/CTest/cmCTestBuildAndTestHandler.cxx   |  26 +-
 Source/CTest/cmCTestBuildAndTestHandler.h     |   6 +-
 Source/CTest/cmCTestBuildCommand.cxx          |   2 +-
 Source/CTest/cmCTestBuildHandler.cxx          |  12 +-
 Source/CTest/cmCTestConfigureHandler.cxx      |   2 +-
 Source/CTest/cmCTestCoverageHandler.cxx       |  78 +--
 .../cmCTestEmptyBinaryDirectoryCommand.cxx    |   4 +-
 Source/CTest/cmCTestGenericHandler.cxx        |   6 +-
 Source/CTest/cmCTestGenericHandler.h          |   2 +-
 Source/CTest/cmCTestHandlerCommand.cxx        |   2 +-
 Source/CTest/cmCTestMemCheckCommand.h         |   2 +-
 Source/CTest/cmCTestMemCheckHandler.cxx       |  40 +-
 Source/CTest/cmCTestMemCheckHandler.h         |  10 +-
 Source/CTest/cmCTestMultiProcessHandler.cxx   |  14 +-
 Source/CTest/cmCTestMultiProcessHandler.h     |   6 +-
 Source/CTest/cmCTestReadCustomFilesCommand.h  |   6 +-
 Source/CTest/cmCTestRunScriptCommand.h        |   6 +-
 Source/CTest/cmCTestRunTest.cxx               |  52 +-
 Source/CTest/cmCTestRunTest.h                 |   2 +-
 Source/CTest/cmCTestScriptHandler.h           |   2 +-
 Source/CTest/cmCTestSleepCommand.cxx          |   2 +-
 Source/CTest/cmCTestSleepCommand.h            |   6 +-
 Source/CTest/cmCTestTestCommand.cxx           |   4 +-
 Source/CTest/cmCTestTestCommand.h             |   2 +-
 Source/CTest/cmProcess.cxx                    |  10 +-
 Source/CTest/cmProcess.h                      |   4 +-
 Source/CursesDialog/cmCursesBoolWidget.cxx    |  12 +-
 Source/CursesDialog/cmCursesBoolWidget.h      |   2 +-
 .../cmCursesCacheEntryComposite.cxx           |  10 +-
 .../cmCursesCacheEntryComposite.h             |   2 +-
 Source/CursesDialog/cmCursesDummyWidget.cxx   |   2 +-
 Source/CursesDialog/cmCursesDummyWidget.h     |   2 +-
 .../CursesDialog/cmCursesFilePathWidget.cxx   |   2 +-
 Source/CursesDialog/cmCursesForm.h            |   4 +-
 Source/CursesDialog/cmCursesLabelWidget.cxx   |   2 +-
 Source/CursesDialog/cmCursesLabelWidget.h     |   2 +-
 .../CursesDialog/cmCursesLongMessageForm.cxx  |  18 +-
 Source/CursesDialog/cmCursesLongMessageForm.h |   4 +-
 Source/CursesDialog/cmCursesMainForm.h        |  10 +-
 Source/CursesDialog/cmCursesPathWidget.cxx    |   6 +-
 Source/CursesDialog/cmCursesStringWidget.cxx  |  30 +-
 Source/CursesDialog/cmCursesStringWidget.h    |   2 +-
 Source/CursesDialog/cmCursesWidget.h          |   2 +-
 Source/QtDialog/CMakeSetup.cxx                |  18 +-
 Source/QtDialog/Compilers.h                   |   2 +-
 Source/QtDialog/FirstConfigure.cxx            |  16 +-
 Source/QtDialog/FirstConfigure.h              |  26 +-
 Source/QtDialog/QCMake.cxx                    |  24 +-
 Source/QtDialog/QCMake.h                      |  12 +-
 Source/QtDialog/QCMakeCacheView.cxx           |  70 +-
 Source/QtDialog/QCMakeCacheView.h             |  18 +-
 Source/QtDialog/QCMakeWidgets.cxx             |   2 +-
 Source/QtDialog/QMacInstallDialog.cxx         |  18 +-
 Source/QtDialog/QtDialogCPack.cmake.in        |   2 +-
 Source/cmAddCustomCommandCommand.h            |  10 +-
 Source/cmAddCustomTargetCommand.h             |  10 +-
 Source/cmAddDependenciesCommand.h             |   6 +-
 Source/cmAddLibraryCommand.h                  |   6 +-
 Source/cmAddSubDirectoryCommand.cxx           |   4 +-
 Source/cmAddSubDirectoryCommand.h             |   6 +-
 Source/cmAddTestCommand.h                     |   6 +-
 Source/cmAuxSourceDirectoryCommand.cxx        |  10 +-
 Source/cmAuxSourceDirectoryCommand.h          |   8 +-
 Source/cmBreakCommand.h                       |   8 +-
 Source/cmBuildCommand.h                       |   2 +-
 Source/cmBuildNameCommand.cxx                 |   6 +-
 Source/cmCMakeMinimumRequired.cxx             |   2 +-
 Source/cmCMakeMinimumRequired.h               |   8 +-
 Source/cmCMakePolicyCommand.h                 |  12 +-
 Source/cmCPluginAPI.cxx                       |   6 +-
 Source/cmCPluginAPI.h                         |   4 +-
 Source/cmCTest.cxx                            |  78 +--
 Source/cmCTest.h                              |  10 +-
 Source/cmCacheManager.cxx                     |  18 +-
 Source/cmCacheManager.h                       |  36 +-
 Source/cmCommand.h                            |  22 +-
 Source/cmCommandArgumentLexer.h               |   6 +-
 Source/cmCommandArgumentLexer.in.l            |  48 +-
 Source/cmCommandArgumentParserHelper.cxx      |  10 +-
 Source/cmCommandArgumentParserHelper.h        |   6 +-
 Source/cmCommandArgumentsHelper.cxx           |  46 +-
 Source/cmCommandArgumentsHelper.h             |  38 +-
 Source/cmComputeLinkInformation.cxx           |   2 +-
 Source/cmConfigureFileCommand.cxx             |   4 +-
 Source/cmConfigureFileCommand.h               |   6 +-
 Source/cmCreateTestSourceList.h               |  10 +-
 Source/cmDefinePropertyCommand.h              |   6 +-
 Source/cmDepends.cxx                          |   2 +-
 Source/cmDepends.h                            |   6 +-
 Source/cmDependsFortran.cxx                   |   2 +-
 Source/cmDependsJavaLexer.h                   |   4 +-
 Source/cmDependsJavaLexer.in.l                |  16 +-
 Source/cmDependsJavaParserHelper.cxx          |  26 +-
 Source/cmDependsJavaParserHelper.h            |  12 +-
 Source/cmDocumentationFormatter.cxx           |   2 +-
 Source/cmDocumentationFormatterDocbook.cxx    |  20 +-
 Source/cmDocumentationFormatterHTML.cxx       |  16 +-
 Source/cmDocumentationFormatterHTML.h         |   2 +-
 Source/cmDocumentationFormatterText.cxx       |  20 +-
 Source/cmDocumentationFormatterUsage.cxx      |   4 +-
 Source/cmDocumentationSection.h               |  14 +-
 Source/cmElseCommand.h                        |   6 +-
 Source/cmElseIfCommand.h                      |   6 +-
 Source/cmEnableLanguageCommand.cxx            |   2 +-
 Source/cmEnableLanguageCommand.h              |   8 +-
 Source/cmEnableTestingCommand.cxx             |   2 +-
 Source/cmEnableTestingCommand.h               |  10 +-
 Source/cmEndForEachCommand.cxx                |   2 +-
 Source/cmEndForEachCommand.h                  |   8 +-
 Source/cmEndFunctionCommand.h                 |   8 +-
 Source/cmEndIfCommand.cxx                     |   2 +-
 Source/cmEndIfCommand.h                       |   6 +-
 Source/cmEndMacroCommand.h                    |   8 +-
 Source/cmEndWhileCommand.h                    |   8 +-
 Source/cmExecProgramCommand.cxx               |  14 +-
 Source/cmExecProgramCommand.h                 |  12 +-
 Source/cmExecuteProcessCommand.cxx            |   8 +-
 Source/cmExecutionStatus.h                    |  14 +-
 Source/cmExportLibraryDependencies.cxx        |   2 +-
 Source/cmExportLibraryDependencies.h          |  10 +-
 Source/cmExprLexer.h                          |   4 +-
 Source/cmExprLexer.in.l                       |  22 +-
 Source/cmExprParserHelper.cxx                 |   4 +-
 Source/cmExprParserHelper.h                   |   2 +-
 Source/cmExternalMakefileProjectGenerator.cxx |   2 +-
 Source/cmExternalMakefileProjectGenerator.h   |  12 +-
 Source/cmFLTKWrapUICommand.cxx                |  26 +-
 Source/cmFLTKWrapUICommand.h                  |  10 +-
 Source/cmFileCommand.cxx                      |  10 +-
 Source/cmFileTimeComparison.cxx               |   4 +-
 Source/cmFileTimeComparison.h                 |   4 +-
 Source/cmFindBase.cxx                         |  22 +-
 Source/cmFindBase.h                           |   4 +-
 Source/cmFindFileCommand.h                    |   6 +-
 Source/cmFindLibraryCommand.cxx               |   2 +-
 Source/cmFindLibraryCommand.h                 |   4 +-
 Source/cmFindPathCommand.cxx                  |   8 +-
 Source/cmFindPathCommand.h                    |   2 +-
 Source/cmFindProgramCommand.cxx               |  40 +-
 Source/cmFindProgramCommand.h                 |   6 +-
 Source/cmForEachCommand.cxx                   |  14 +-
 Source/cmForEachCommand.h                     |   8 +-
 Source/cmFunctionBlocker.h                    |   2 +-
 Source/cmFunctionCommand.cxx                  |  20 +-
 Source/cmFunctionCommand.h                    |   4 +-
 Source/cmGeneratedFileStream.cxx              |   6 +-
 Source/cmGetCMakePropertyCommand.h            |   6 +-
 Source/cmGetDirectoryPropertyCommand.cxx      |   8 +-
 Source/cmGetDirectoryPropertyCommand.h        |   6 +-
 Source/cmGetFilenameComponentCommand.cxx      |   8 +-
 Source/cmGetFilenameComponentCommand.h        |   8 +-
 Source/cmGetPropertyCommand.h                 |   6 +-
 Source/cmGetSourceFilePropertyCommand.h       |   6 +-
 Source/cmGetTargetPropertyCommand.h           |   6 +-
 Source/cmGetTestPropertyCommand.h             |   2 +-
 Source/cmGlobalBorlandMakefileGenerator.cxx   |   6 +-
 Source/cmGlobalBorlandMakefileGenerator.h     |   8 +-
 Source/cmGlobalJOMMakefileGenerator.cxx       |  10 +-
 Source/cmGlobalJOMMakefileGenerator.h         |   4 +-
 Source/cmGlobalKdevelopGenerator.cxx          |  70 +-
 Source/cmGlobalMSYSMakefileGenerator.cxx      |   6 +-
 Source/cmGlobalMSYSMakefileGenerator.h        |   6 +-
 Source/cmGlobalMinGWMakefileGenerator.cxx     |   6 +-
 Source/cmGlobalMinGWMakefileGenerator.h       |   6 +-
 Source/cmGlobalNMakeMakefileGenerator.cxx     |  10 +-
 Source/cmGlobalNMakeMakefileGenerator.h       |   4 +-
 Source/cmGlobalVisualStudio10Generator.cxx    |   8 +-
 Source/cmGlobalVisualStudio10Generator.h      |  18 +-
 Source/cmGlobalVisualStudio6Generator.cxx     |  36 +-
 Source/cmGlobalVisualStudio6Generator.h       |  20 +-
 Source/cmGlobalVisualStudio71Generator.cxx    |  32 +-
 Source/cmGlobalVisualStudio71Generator.h      |  12 +-
 Source/cmGlobalVisualStudio7Generator.cxx     |  64 +-
 Source/cmGlobalVisualStudio8Generator.cxx     |   4 +-
 Source/cmGlobalVisualStudio8Generator.h       |   6 +-
 Source/cmGlobalVisualStudio8Win64Generator.h  |   8 +-
 Source/cmGlobalVisualStudio9Generator.cxx     |   2 +-
 Source/cmGlobalVisualStudio9Generator.h       |  12 +-
 Source/cmGlobalVisualStudio9Win64Generator.h  |   8 +-
 Source/cmGlobalVisualStudioGenerator.cxx      |   2 +-
 Source/cmGlobalVisualStudioGenerator.h        |   2 +-
 Source/cmGlobalWatcomWMakeGenerator.cxx       |   6 +-
 Source/cmGlobalWatcomWMakeGenerator.h         |   6 +-
 Source/cmGlobalXCodeGenerator.h               |  36 +-
 Source/cmHexFileConverter.cxx                 |  12 +-
 Source/cmHexFileConverter.h                   |   2 +-
 Source/cmIfCommand.h                          |  18 +-
 Source/cmIncludeDirectoryCommand.cxx          |   6 +-
 Source/cmIncludeDirectoryCommand.h            |   6 +-
 Source/cmIncludeExternalMSProjectCommand.cxx  |   4 +-
 Source/cmIncludeExternalMSProjectCommand.h    |   8 +-
 Source/cmIncludeRegularExpressionCommand.cxx  |   4 +-
 Source/cmIncludeRegularExpressionCommand.h    |   8 +-
 Source/cmInstallFilesCommand.h                |  10 +-
 Source/cmInstallProgramsCommand.h             |   8 +-
 Source/cmInstallTargetGenerator.h             |   4 +-
 Source/cmInstallTargetsCommand.h              |   8 +-
 Source/cmLinkDirectoriesCommand.h             |  10 +-
 Source/cmLinkLibrariesCommand.cxx             |   6 +-
 Source/cmLinkLibrariesCommand.h               |   8 +-
 Source/cmListCommand.cxx                      |   8 +-
 Source/cmListFileCache.cxx                    |  20 +-
 Source/cmListFileCache.h                      |   8 +-
 Source/cmListFileLexer.c                      |  44 +-
 Source/cmLoadCacheCommand.cxx                 |  18 +-
 Source/cmLoadCacheCommand.h                   |  10 +-
 Source/cmLoadCommandCommand.cxx               |  32 +-
 Source/cmLoadCommandCommand.h                 |   8 +-
 Source/cmLocalVisualStudio10Generator.cxx     |  12 +-
 Source/cmLocalVisualStudio10Generator.h       |   2 +-
 Source/cmLocalVisualStudio6Generator.cxx      | 186 ++---
 Source/cmLocalVisualStudio6Generator.h        |  10 +-
 Source/cmLocalVisualStudio7Generator.cxx      |  84 +--
 Source/cmLocalVisualStudio7Generator.h        |  16 +-
 Source/cmMacroCommand.cxx                     |  12 +-
 Source/cmMacroCommand.h                       |   4 +-
 Source/cmMakeDepend.cxx                       |  14 +-
 Source/cmMakeDepend.h                         |  34 +-
 Source/cmMakeDirectoryCommand.h               |   8 +-
 Source/cmMarkAsAdvancedCommand.cxx            |   2 +-
 Source/cmMarkAsAdvancedCommand.h              |   6 +-
 Source/cmMathCommand.cxx                      |   2 +-
 Source/cmMathCommand.h                        |   8 +-
 Source/cmMessageCommand.h                     |   6 +-
 Source/cmObject.h                             |   4 +-
 Source/cmOptionCommand.cxx                    |   4 +-
 Source/cmOptionCommand.h                      |   6 +-
 Source/cmOutputRequiredFilesCommand.cxx       |  18 +-
 Source/cmOutputRequiredFilesCommand.h         |   6 +-
 Source/cmProjectCommand.cxx                   |   6 +-
 Source/cmProjectCommand.h                     |   8 +-
 Source/cmProperty.h                           |   2 +-
 Source/cmPropertyDefinition.h                 |   6 +-
 Source/cmPropertyDefinitionMap.cxx            |   8 +-
 Source/cmPropertyDefinitionMap.h              |   2 +-
 Source/cmPropertyMap.cxx                      |  10 +-
 Source/cmPropertyMap.h                        |   4 +-
 Source/cmQTWrapCPPCommand.cxx                 |   2 +-
 Source/cmQTWrapCPPCommand.h                   |   4 +-
 Source/cmQTWrapUICommand.cxx                  |   2 +-
 Source/cmQTWrapUICommand.h                    |   4 +-
 Source/cmRemoveCommand.cxx                    |  10 +-
 Source/cmRemoveCommand.h                      |  10 +-
 Source/cmRemoveDefinitionsCommand.h           |  12 +-
 Source/cmReturnCommand.h                      |   8 +-
 Source/cmSeparateArgumentsCommand.h           |  10 +-
 Source/cmSetCommand.cxx                       |  20 +-
 Source/cmSetCommand.h                         |  10 +-
 Source/cmSetDirectoryPropertiesCommand.cxx    |  14 +-
 Source/cmSetDirectoryPropertiesCommand.h      |   6 +-
 Source/cmSetSourceFilesPropertiesCommand.cxx  |   8 +-
 Source/cmSetSourceFilesPropertiesCommand.h    |   6 +-
 Source/cmSetTargetPropertiesCommand.cxx       |   8 +-
 Source/cmSetTargetPropertiesCommand.h         |  10 +-
 Source/cmSetTestsPropertiesCommand.cxx        |  12 +-
 Source/cmSetTestsPropertiesCommand.h          |   4 +-
 Source/cmSiteNameCommand.cxx                  |  10 +-
 Source/cmSiteNameCommand.h                    |   8 +-
 Source/cmSourceFile.cxx                       |  30 +-
 Source/cmSourceFile.h                         |   2 +-
 Source/cmSourceGroup.cxx                      |  10 +-
 Source/cmSourceGroup.h                        |  22 +-
 Source/cmSourceGroupCommand.cxx               |   8 +-
 Source/cmSourceGroupCommand.h                 |   8 +-
 Source/cmStandardIncludes.h                   |  16 +-
 Source/cmStringCommand.cxx                    |  72 +-
 Source/cmStringCommand.h                      |   6 +-
 Source/cmSubdirCommand.cxx                    |  14 +-
 Source/cmSubdirCommand.h                      |   8 +-
 Source/cmSubdirDependsCommand.h               |   6 +-
 Source/cmTest.cxx                             |  10 +-
 Source/cmTest.h                               |   2 +-
 Source/cmTryRunCommand.h                      |  10 +-
 Source/cmUseMangledMesaCommand.cxx            |  12 +-
 Source/cmUtilitySourceCommand.cxx             |  22 +-
 Source/cmUtilitySourceCommand.h               |   4 +-
 Source/cmVariableRequiresCommand.cxx          |  10 +-
 Source/cmVariableRequiresCommand.h            |  10 +-
 Source/cmVariableWatch.cxx                    |   8 +-
 Source/cmVariableWatch.h                      |   4 +-
 Source/cmVariableWatchCommand.cxx             |   2 +-
 Source/cmVariableWatchCommand.h               |   6 +-
 Source/cmVisualStudio10TargetGenerator.cxx    | 112 +--
 Source/cmVisualStudio10TargetGenerator.h      |  10 +-
 Source/cmVisualStudioGeneratorOptions.cxx     |   4 +-
 Source/cmWhileCommand.h                       |  10 +-
 Source/cmWin32ProcessExecution.cxx            | 228 +++----
 Source/cmWin32ProcessExecution.h              |  18 +-
 Source/cmWriteFileCommand.cxx                 |   2 +-
 Source/cmWriteFileCommand.h                   |   6 +-
 Source/cmXCode21Object.cxx                    |   8 +-
 Source/cmXCodeObject.cxx                      |  24 +-
 Source/cmXCodeObject.h                        |  28 +-
 Source/cmXMLParser.cxx                        |  10 +-
 Source/cmXMLParser.h                          |  24 +-
 Source/cmakewizard.cxx                        |   2 +-
 Source/cmakewizard.h                          |  12 +-
 Source/cmakexbuild.cxx                        |   4 +-
 Source/cmparseMSBuildXML.py                   |  22 +-
 Source/cmw9xcom.cxx                           |   4 +-
 .../CMakeVisualStudio6Configurations.cmake    |   2 +-
 Templates/TestDriver.cxx.in                   |   8 +-
 Templates/cygwin-package.sh.in                |  12 +-
 Tests/BuildDepends/CMakeLists.txt             |  38 +-
 Tests/CMakeBuildTest.cmake.in                 |  14 +-
 Tests/CMakeTests/ToolchainTest.cmake.in       |   2 +-
 Tests/COnly/libc2.h                           |   2 +-
 Tests/CPackComponents/CMakeLists.txt          |   2 +-
 .../CTestTestScriptMode.cmake.in              |   2 +-
 Tests/CTestTest/test.cmake.in                 |   6 +-
 Tests/Complex/CMakeLists.txt                  |  34 +-
 Tests/Complex/Executable/CMakeLists.txt       |   4 +-
 Tests/Complex/Executable/Temp/CMakeLists.txt  |   4 +-
 Tests/Complex/Executable/complex.cxx          | 132 ++--
 Tests/Complex/Executable/testcflags.c         |   2 +-
 Tests/Complex/Library/CMakeLists.txt          |  16 +-
 Tests/Complex/Library/create_file.cxx         |   4 +-
 Tests/Complex/Library/testConly.c             |   4 +-
 Tests/Complex/Library/testConly.h             |   2 +-
 Tests/ComplexOneConfig/CMakeLists.txt         |  34 +-
 .../Executable/CMakeLists.txt                 |   4 +-
 .../Executable/Temp/CMakeLists.txt            |   4 +-
 Tests/ComplexOneConfig/Executable/complex.cxx | 132 ++--
 .../ComplexOneConfig/Executable/testcflags.c  |   2 +-
 Tests/ComplexOneConfig/Library/CMakeLists.txt |  16 +-
 .../ComplexOneConfig/Library/create_file.cxx  |   4 +-
 Tests/ComplexOneConfig/Library/testConly.c    |   4 +-
 Tests/ComplexOneConfig/Library/testConly.h    |   2 +-
 Tests/CrossCompile/CMakeLists.txt             |   2 +-
 Tests/CustComDepend/CMakeLists.txt            |   2 +-
 Tests/CustComDepend/bar.h                     |   2 +-
 Tests/CustComDepend/foo.cxx                   |   2 +-
 Tests/CustomCommand/CMakeLists.txt            |  20 +-
 .../GeneratedHeader/CMakeLists.txt            |  12 +-
 Tests/CustomCommand/foo.in                    |   2 +-
 .../CMakeLists.txt                            |   2 +-
 Tests/Dependency/Exec2/CMakeLists.txt         |   2 +-
 Tests/DocTest/DocTest.cxx                     |   4 +-
 Tests/Fortran/CMakeLists.txt                  |   6 +-
 Tests/Fortran/foo.f                           |   2 +-
 .../Fortran/test_use_in_comment_freeform.f90  |   6 +-
 Tests/Framework/foo.cxx                       |   2 +-
 Tests/JCTest/CMakeLists.txt                   |   2 +-
 Tests/Java/A.java                             |   6 +-
 Tests/Java/HelloWorld.java                    |   2 +-
 Tests/KDE4StableBranchTest/test_kde4.sh.in    |   4 +-
 Tests/LibName/CMakeLists.txt                  |   2 +-
 Tests/LibName/bar.c                           |   4 +-
 Tests/LibName/foo.c                           |   4 +-
 Tests/LibName/foobar.c                        |   2 +-
 .../LoadCommand/CMakeCommands/cmTestCommand.c |  40 +-
 Tests/LoadCommand/CMakeLists.txt              |  16 +-
 .../CMakeCommands/cmTestCommand.c             |  40 +-
 Tests/LoadCommandOneConfig/CMakeLists.txt     |  16 +-
 Tests/NewlineArgs/CMakeLists.txt              |   4 +-
 Tests/ObjC++/objc++.mm                        |   2 +-
 Tests/OutOfSource/OutOfSourceSubdir/testlib.h |   2 +-
 Tests/Plugin/src/example_exe.cxx              |   2 +-
 Tests/Properties/CMakeLists.txt               |  20 +-
 Tests/Simple/CMakeLists.txt                   |   6 +-
 Tests/Simple/simpleWe.cpp                     |   2 +-
 Tests/SimpleCOnly/main.c                      |   2 +-
 Tests/SimpleInstall/CMakeLists.txt            |  18 +-
 Tests/SimpleInstall/PackageScript.cmake       |   2 +-
 Tests/SimpleInstall/lib2.h                    |   2 +-
 Tests/SimpleInstall/lib3.h                    |   2 +-
 Tests/SimpleInstall/lib4.h                    |   2 +-
 Tests/SimpleInstallS2/CMakeLists.txt          |  18 +-
 Tests/SimpleInstallS2/PackageScript.cmake     |   2 +-
 Tests/SimpleInstallS2/lib2.h                  |   2 +-
 Tests/SimpleInstallS2/lib3.h                  |   2 +-
 Tests/SimpleInstallS2/lib4.h                  |   2 +-
 Tests/SourceGroups/CMakeLists.txt             |   6 +-
 Tests/SourceGroups/README.txt                 |   2 +-
 Tests/StringFileTest/CMakeLists.txt           |   4 +-
 Tests/StringFileTest/InputFile.h.in           |   4 +-
 Tests/StringFileTest/StringFile.cxx           |   2 +-
 Tests/SubDir/CMakeLists.txt                   |  10 +-
 Tests/SubDirSpaces/CMakeLists.txt             |  10 +-
 Tests/SwigTest/CMakeLists.txt                 |   2 +-
 Tests/SwigTest/example.h                      |   4 +-
 Tests/SwigTest/runme.pike                     |   6 +-
 Tests/SwigTest/runme.py                       |   2 +-
 Tests/SystemInformation/CMakeLists.txt        |  10 +-
 Tests/SystemInformation/DumpInformation.cxx   |   8 +-
 Tests/TargetName/scripts/CMakeLists.txt       |   2 +-
 Tests/TestDriver/CMakeLists.txt               |  10 +-
 Tests/TestDriver/test1.cxx                    |   2 +-
 Tests/Testing/CMakeLists.txt                  |   8 +-
 Tests/Testing/DartConfig.cmake                |   2 +-
 Tests/TryCompile/CMakeLists.txt               |  22 +-
 Tests/TryCompile/expect_arg.c                 |   2 +-
 Tests/TryCompile/pass.c                       |   2 +-
 Tests/Tutorial/Step2/MathFunctions/mysqrt.cxx |   4 +-
 Tests/Tutorial/Step3/CMakeLists.txt           |   6 +-
 Tests/Tutorial/Step3/MathFunctions/mysqrt.cxx |   4 +-
 Tests/Tutorial/Step4/CMakeLists.txt           |   4 +-
 Tests/Tutorial/Step4/MathFunctions/mysqrt.cxx |   4 +-
 Tests/Tutorial/Step5/CMakeLists.txt           |   4 +-
 .../Step5/MathFunctions/MakeTable.cxx         |   6 +-
 Tests/Tutorial/Step5/MathFunctions/mysqrt.cxx |   4 +-
 Tests/Tutorial/Step6/CMakeLists.txt           |   4 +-
 .../Step6/MathFunctions/CMakeLists.txt        |   2 +-
 .../Step6/MathFunctions/MakeTable.cxx         |   6 +-
 Tests/Tutorial/Step6/MathFunctions/mysqrt.cxx |   4 +-
 Tests/Tutorial/Step7/CMakeLists.txt           |   4 +-
 .../Step7/MathFunctions/CMakeLists.txt        |   2 +-
 .../Step7/MathFunctions/MakeTable.cxx         |   6 +-
 Tests/Tutorial/Step7/MathFunctions/mysqrt.cxx |   4 +-
 Tests/VSExternalInclude/CMakeLists.txt        |   4 +-
 Tests/Wrapping/CMakeLists.txt                 |   8 +-
 Tests/Wrapping/qtnoqtmain.cxx                 |   2 +-
 Tests/X11/CMakeLists.txt                      |   4 +-
 Tests/X11/HelloWorldX11.cxx                   |  22 +-
 Utilities/CMakeLists.txt                      |   2 +-
 Utilities/Doxygen/doc_makeall.sh.in           |  36 +-
 Utilities/KWStyle/CMakeLists.txt              |   2 +-
 Utilities/KWStyle/CMakeMoreChecks.kws.xml.in  |   2 +-
 Utilities/Release/Cygwin/CMakeLists.txt       |   2 +-
 Utilities/Release/Cygwin/cygwin-package.sh.in |  12 +-
 Utilities/Release/release_cmake.cmake         |  14 +-
 Utilities/Release/release_cmake.sh.in         |  14 +-
 Utilities/Release/upload_release.cmake        |   2 +-
 doxygen.config                                | 642 +++++++++---------
 614 files changed, 3951 insertions(+), 3951 deletions(-)

diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake
index c3c25f560..9ee56af57 100644
--- a/CMakeCPack.cmake
+++ b/CMakeCPack.cmake
@@ -70,12 +70,12 @@ IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
 
   IF(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
     # if the CPACK_PACKAGE_FILE_NAME is not defined by the cache
-    # default to source package - system, on cygwin system is not 
+    # default to source package - system, on cygwin system is not
     # needed
     IF(CYGWIN)
       SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
     ELSE(CYGWIN)
-      SET(CPACK_PACKAGE_FILE_NAME 
+      SET(CPACK_PACKAGE_FILE_NAME
         "${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
     ENDIF(CYGWIN)
   ENDIF(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
@@ -102,9 +102,9 @@ IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
     SET(CPACK_CYGWIN_PATCH_NUMBER 1)
     # These files are required by the cmCPackCygwinSourceGenerator and the files
     # put into the release tar files.
-    SET(CPACK_CYGWIN_BUILD_SCRIPT 
+    SET(CPACK_CYGWIN_BUILD_SCRIPT
       "${CMake_BINARY_DIR}/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.sh")
-    SET(CPACK_CYGWIN_PATCH_FILE 
+    SET(CPACK_CYGWIN_PATCH_FILE
       "${CMake_BINARY_DIR}/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.patch")
     # include the sub directory cmake file for cygwin that
     # configures some files and adds some install targets
diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in
index 69a150851..28b6ec046 100644
--- a/CMakeCPackOptions.cmake.in
+++ b/CMakeCPackOptions.cmake.in
@@ -1,6 +1,6 @@
 # This file is configured at cmake time, and loaded at cpack time.
 # To pass variables to cpack from cmake, they must be configured
-# in this file.  
+# in this file.
 
 if(CPACK_GENERATOR MATCHES "NSIS")
   SET(CPACK_NSIS_INSTALL_ROOT "@CPACK_NSIS_INSTALL_ROOT@")
@@ -45,9 +45,9 @@ if(CPACK_GENERATOR MATCHES "CygwinSource")
 endif(CPACK_GENERATOR MATCHES "CygwinSource")
 
 if("${CPACK_GENERATOR}" STREQUAL "PackageMaker")
-  if(CMAKE_PACKAGE_QTGUI)                       
+  if(CMAKE_PACKAGE_QTGUI)
     set(CPACK_PACKAGE_DEFAULT_LOCATION "/Applications")
-  else(CMAKE_PACKAGE_QTGUI)                     
+  else(CMAKE_PACKAGE_QTGUI)
     set(CPACK_PACKAGE_DEFAULT_LOCATION "/usr")
-  endif(CMAKE_PACKAGE_QTGUI)                    
+  endif(CMAKE_PACKAGE_QTGUI)
 endif("${CPACK_GENERATOR}" STREQUAL "PackageMaker")
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8522cad28..f8d17580d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -114,11 +114,11 @@ MACRO(CMAKE_SETUP_TESTING)
   IF (NOT DART_ROOT)
     SET(MAKEPROGRAM ${CMAKE_MAKE_PROGRAM})
   ENDIF (NOT DART_ROOT)
-  
+
   IF(BUILD_TESTING)
-    SET(CMAKE_TEST_GENERATOR "" CACHE STRING 
+    SET(CMAKE_TEST_GENERATOR "" CACHE STRING
       "Generator used when running tests")
-    SET(CMAKE_TEST_MAKEPROGRAM "" CACHE FILEPATH 
+    SET(CMAKE_TEST_MAKEPROGRAM "" CACHE FILEPATH
       "Generator used when running tests")
     IF(NOT CMAKE_TEST_GENERATOR)
       SET(CMAKE_TEST_GENERATOR "${CMAKE_GENERATOR}")
@@ -126,7 +126,7 @@ MACRO(CMAKE_SETUP_TESTING)
     ELSE(NOT CMAKE_TEST_GENERATOR)
       SET(CMAKE_TEST_DIFFERENT_GENERATOR TRUE)
     ENDIF(NOT CMAKE_TEST_GENERATOR)
-    
+
     # Are we testing with the MSVC compiler?
     SET(CMAKE_TEST_MSVC 0)
     IF(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
@@ -138,14 +138,14 @@ MACRO(CMAKE_SETUP_TESTING)
       ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
         "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio")
     ENDIF(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
-    
+
     SET(CMAKE_TEST_SYSTEM_LIBRARIES 0)
     FOREACH(util CURL EXPAT XMLRPC ZLIB)
       IF(CMAKE_USE_SYSTEM_${util})
         SET(CMAKE_TEST_SYSTEM_LIBRARIES 1)
       ENDIF(CMAKE_USE_SYSTEM_${util})
     ENDFOREACH(util)
-    
+
     # This variable is set by cmake, however to
     # test cmake we want to make sure that
     # the ctest from this cmake is used for testing
@@ -169,7 +169,7 @@ MACRO(CMAKE_SETUP_TESTING)
   CONFIGURE_FILE(${CMake_SOURCE_DIR}/CTestCustom.ctest.in
     ${CMake_BINARY_DIR}/CTestCustom.ctest @ONLY)
   IF(BUILD_TESTING AND DART_ROOT)
-    CONFIGURE_FILE(${CMake_SOURCE_DIR}/CMakeLogo.gif 
+    CONFIGURE_FILE(${CMake_SOURCE_DIR}/CMakeLogo.gif
       ${CMake_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY)
   ENDIF(BUILD_TESTING AND DART_ROOT)
   MARK_AS_ADVANCED(DART_ROOT)
@@ -253,18 +253,18 @@ MACRO (CMAKE_BUILD_UTILITIES)
     ${CMake_BINARY_DIR}/Utilities
     ${CMake_SOURCE_DIR}/Utilities
     )
-  
+
   # check for the use of system libraries versus builtin ones
   # (a macro defined in this file)
   CMAKE_HANDLE_SYSTEM_LIBRARIES()
-  
+
   #---------------------------------------------------------------------
   # Build zlib library for Curl, CMake, and CTest.
   SET(CMAKE_ZLIB_HEADER "cm_zlib.h")
   IF(CMAKE_USE_SYSTEM_ZLIB)
     FIND_PACKAGE(ZLIB)
     IF(NOT ZLIB_FOUND)
-      MESSAGE(FATAL_ERROR 
+      MESSAGE(FATAL_ERROR
         "CMAKE_USE_SYSTEM_ZLIB is ON but a zlib is not found!")
     ENDIF(NOT ZLIB_FOUND)
     SET(CMAKE_ZLIB_INCLUDES ${ZLIB_INCLUDE_DIR})
@@ -275,13 +275,13 @@ MACRO (CMAKE_BUILD_UTILITIES)
     ADD_SUBDIRECTORY(Utilities/cmzlib)
     CMAKE_SET_TARGET_FOLDER(cmzlib "Utilities/3rdParty")
   ENDIF(CMAKE_USE_SYSTEM_ZLIB)
-  
+
   #---------------------------------------------------------------------
   # Build Curl library for CTest.
   IF(CMAKE_USE_SYSTEM_CURL)
     FIND_PACKAGE(CURL)
     IF(NOT CURL_FOUND)
-      MESSAGE(FATAL_ERROR 
+      MESSAGE(FATAL_ERROR
         "CMAKE_USE_SYSTEM_CURL is ON but a curl is not found!")
     ENDIF(NOT CURL_FOUND)
     SET(CMAKE_CURL_INCLUDES ${CURL_INCLUDE_DIRS})
@@ -306,7 +306,7 @@ MACRO (CMAKE_BUILD_UTILITIES)
 
   #---------------------------------------------------------------------
   # Build Compress library for CTest.
-  SET(CMAKE_COMPRESS_INCLUDES 
+  SET(CMAKE_COMPRESS_INCLUDES
     "${CMAKE_CURRENT_BINARY_DIR}/Utilities/cmcompress")
   SET(CMAKE_COMPRESS_LIBRARIES "cmcompress")
   ADD_SUBDIRECTORY(Utilities/cmcompress)
@@ -314,7 +314,7 @@ MACRO (CMAKE_BUILD_UTILITIES)
   IF(CMAKE_USE_SYSTEM_BZIP2)
     FIND_PACKAGE(BZip2)
   ELSE()
-    SET(BZIP2_INCLUDE_DIR 
+    SET(BZIP2_INCLUDE_DIR
       "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmbzip2")
     SET(BZIP2_LIBRARIES cmbzip2)
     ADD_SUBDIRECTORY(Utilities/cmbzip2)
@@ -364,7 +364,7 @@ MACRO (CMAKE_BUILD_UTILITIES)
     ADD_SUBDIRECTORY(Utilities/cmexpat)
     CMAKE_SET_TARGET_FOLDER(cmexpat "Utilities/3rdParty")
   ENDIF(CMAKE_USE_SYSTEM_EXPAT)
-  
+
   #---------------------------------------------------------------------
   # Build XMLRPC library for CMake and CTest.
   IF(CTEST_USE_XMLRPC)
@@ -376,7 +376,7 @@ MACRO (CMAKE_BUILD_UTILITIES)
     SET(CMAKE_XMLRPC_INCLUDES ${XMLRPC_INCLUDE_DIRS})
     SET(CMAKE_XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES})
   ENDIF(CTEST_USE_XMLRPC)
-  
+
   #---------------------------------------------------------------------
   # Use curses?
   IF (UNIX)
@@ -454,7 +454,7 @@ SET_DIRECTORY_PROPERTIES(PROPERTIES
 # where to write the resulting executables and libraries
 SET(BUILD_SHARED_LIBS OFF)
 SET(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL "No configurable exe dir.")
-SET(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL 
+SET(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL
   "Where to put the libraries for CMake")
 
 # The CMake executables usually do not need any rpath to run in the build or
@@ -511,12 +511,12 @@ IF("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x")
   SET(CMAKE_TESTS_CDASH_SERVER "http://www.cdash.org/CDash")
 ENDIF("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x")
 
-# build the utilities (a macro defined in this file) 
+# build the utilities (a macro defined in this file)
 CMAKE_BUILD_UTILITIES()
 
 # On NetBSD ncurses is required, since curses doesn't have the wsyncup()
 # function. ncurses is installed via pkgsrc, so the library is in /usr/pkg/lib,
-# which isn't in the default linker search path. So without RPATH ccmake 
+# which isn't in the default linker search path. So without RPATH ccmake
 # doesn't run and the build doesn't succeed since ccmake is executed for
 # generating the documentation.
 IF(BUILD_CursesDialog)
@@ -539,10 +539,10 @@ IF(BUILD_QtDialog)
     IF(NOT "${ENDCH}" STREQUAL "/")
       SET(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
     ENDIF(NOT "${ENDCH}" STREQUAL "/")
-    SET(CMAKE_INSTALL_PREFIX 
+    SET(CMAKE_INSTALL_PREFIX
       "${CMAKE_INSTALL_PREFIX}${CMAKE_BUNDLE_NAME}.app/Contents")
   ENDIF(APPLE)
-  
+
   SET(QT_NEED_RPATH FALSE)
   IF(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64")
     SET(QT_NEED_RPATH TRUE)
@@ -551,7 +551,7 @@ ENDIF(BUILD_QtDialog)
 
 
 # The same might be true on other systems for other libraries.
-# Then only enable RPATH if we have are building at least with cmake 2.4, 
+# Then only enable RPATH if we have are building at least with cmake 2.4,
 # since this one has much better RPATH features than cmake 2.2.
 # The executables are then built with the RPATH for the libraries outside
 # the build tree, which is both the build and the install RPATH.
@@ -583,7 +583,7 @@ CONFIGURE_FILE(
   "${CMAKE_CURRENT_BINARY_DIR}/DartLocal.conf"
   COPYONLY)
 
-OPTION(CMAKE_STRICT   
+OPTION(CMAKE_STRICT
   "Perform strict testing to record property and variable access. Can be used to report any undefined properties or variables" OFF)
 MARK_AS_ADVANCED(CMAKE_STRICT)
 
@@ -600,7 +600,7 @@ CMAKE_SET_TARGET_FOLDER(cmw9xcom "Utilities/Win9xCompat")
 CMAKE_SET_TARGET_FOLDER(documentation "Documentation")
 
 # add a test
-ADD_TEST(SystemInformationNew "${CMAKE_CMAKE_COMMAND}" 
+ADD_TEST(SystemInformationNew "${CMAKE_CMAKE_COMMAND}"
   --system-information  -G "${CMAKE_TEST_GENERATOR}" )
 
 # Install license file as it requires.
diff --git a/CTestConfig.cmake b/CTestConfig.cmake
index 39032220e..aaf551a85 100644
--- a/CTestConfig.cmake
+++ b/CTestConfig.cmake
@@ -19,7 +19,7 @@ set(CTEST_DROP_SITE_CDASH TRUE)
 set(CTEST_CDASH_VERSION "1.6")
 set(CTEST_CDASH_QUERY_VERSION TRUE)
 
-# use old trigger stuff so that cmake 2.4 and below will not 
+# use old trigger stuff so that cmake 2.4 and below will not
 # get errors on trigger
-SET (TRIGGER_SITE 
+SET (TRIGGER_SITE
   "http://public.kitware.com/cgi-bin/Submit-CMake-TestingResults.cgi")
diff --git a/CompileFlags.cmake b/CompileFlags.cmake
index 3b455b96f..65f4c693c 100644
--- a/CompileFlags.cmake
+++ b/CompileFlags.cmake
@@ -27,7 +27,7 @@ ENDIF()
 
 # Disable deprecation warnings for standard C functions.
 # really only needed for newer versions of VS, but should
-# not hurt other versions, and this will work into the 
+# not hurt other versions, and this will work into the
 # future
 IF(MSVC OR _INTEL_WINDOWS)
   ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
@@ -56,9 +56,9 @@ ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
 
 # use the ansi CXX compile flag for building cmake
 IF (CMAKE_ANSI_CXXFLAGS)
-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")  
+  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
 ENDIF (CMAKE_ANSI_CXXFLAGS)
 
 IF (CMAKE_ANSI_CFLAGS)
-  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")  
+  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
 ENDIF (CMAKE_ANSI_CFLAGS)
diff --git a/Docs/cmake-indent.vim b/Docs/cmake-indent.vim
index f149873ed..a26dd06a2 100644
--- a/Docs/cmake-indent.vim
+++ b/Docs/cmake-indent.vim
@@ -1,11 +1,11 @@
 " =============================================================================
-" 
+"
 "   Program:   CMake - Cross-Platform Makefile Generator
 "   Module:    $RCSfile$
 "   Language:  VIM
 "   Date:      $Date$
 "   Version:   $Revision$
-" 
+"
 " =============================================================================
 
 " Vim indent file
diff --git a/Docs/cmake-mode.el b/Docs/cmake-mode.el
index 951745515..478bc7abe 100644
--- a/Docs/cmake-mode.el
+++ b/Docs/cmake-mode.el
@@ -34,7 +34,7 @@
 ;; cmake executable variable used to run cmake --help-command
 ;; on commands in cmake-mode
 ;;
-;; cmake-command-help Written by James Bigler 
+;; cmake-command-help Written by James Bigler
 ;;
 
 (defcustom cmake-mode-cmake-executable "cmake"
@@ -191,11 +191,11 @@ the indentation.  Otherwise it retains the same position on the line"
   (setq save-point (point))
   (goto-char (point-min))
   (while (re-search-forward "^\\([ \t]*\\)\\(\\w+\\)\\([ \t]*(\\)" nil t)
-    (replace-match 
-     (concat 
-      (match-string 1) 
-      (downcase (match-string 2)) 
-      (match-string 3)) 
+    (replace-match
+     (concat
+      (match-string 1)
+      (downcase (match-string 2))
+      (match-string 3))
      t))
   (goto-char save-point)
   )
diff --git a/Docs/cmake-syntax.vim b/Docs/cmake-syntax.vim
index 80b348eef..80395ab1a 100644
--- a/Docs/cmake-syntax.vim
+++ b/Docs/cmake-syntax.vim
@@ -36,9 +36,9 @@ syn region cmakeVariableValue start=/\${/ end=/}/
             \ contained oneline contains=CONTAINED,cmakeTodo
 syn region cmakeEnvironment start=/\$ENV{/ end=/}/
             \ contained oneline contains=CONTAINED,cmakeTodo
-syn region cmakeString start=/"/ end=/"/ 
+syn region cmakeString start=/"/ end=/"/
             \ contains=CONTAINED,cmakeTodo,cmakeOperators
-syn region cmakeArguments start=/(/ end=/)/ 
+syn region cmakeArguments start=/(/ end=/)/
             \ contains=ALLBUT,cmakeArguments,cmakeTodo
 syn keyword cmakeSystemVariables
             \ WIN32 UNIX APPLE CYGWIN BORLAND MINGW MSVC MSVC_IDE MSVC60 MSVC70 MSVC71 MSVC80 MSVC90
@@ -49,11 +49,11 @@ syn keyword cmakeDeprecated ABSTRACT_FILES BUILD_NAME SOURCE_FILES SOURCE_FILES_
            \ nextgroup=cmakeArguments
 
 " The keywords are generated as:  cmake --help-command-list | tr "\n" " "
-syn keyword cmakeStatement 
+syn keyword cmakeStatement
       \ ADD_CUSTOM_COMMAND ADD_CUSTOM_TARGET ADD_DEFINITIONS ADD_DEPENDENCIES ADD_EXECUTABLE ADD_LIBRARY ADD_SUBDIRECTORY ADD_TEST AUX_SOURCE_DIRECTORY BUILD_COMMAND BUILD_NAME CMAKE_MINIMUM_REQUIRED CONFIGURE_FILE CREATE_TEST_SOURCELIST ELSE ELSEIF ENABLE_LANGUAGE ENABLE_TESTING ENDFOREACH ENDFUNCTION ENDIF ENDMACRO ENDWHILE EXEC_PROGRAM EXECUTE_PROCESS EXPORT_LIBRARY_DEPENDENCIES FILE FIND_FILE FIND_LIBRARY FIND_PACKAGE FIND_PATH FIND_PROGRAM FLTK_WRAP_UI FOREACH FUNCTION GET_CMAKE_PROPERTY GET_DIRECTORY_PROPERTY GET_FILENAME_COMPONENT GET_SOURCE_FILE_PROPERTY GET_TARGET_PROPERTY GET_TEST_PROPERTY IF INCLUDE INCLUDE_DIRECTORIES INCLUDE_EXTERNAL_MSPROJECT INCLUDE_REGULAR_EXPRESSION INSTALL INSTALL_FILES INSTALL_PROGRAMS INSTALL_TARGETS LINK_DIRECTORIES LINK_LIBRARIES LIST LOAD_CACHE LOAD_COMMAND MACRO MAKE_DIRECTORY MARK_AS_ADVANCED MATH MESSAGE OPTION OUTPUT_REQUIRED_FILES PROJECT QT_WRAP_CPP QT_WRAP_UI REMOVE REMOVE_DEFINITIONS SEPARATE_ARGUMENTS SET SET_DIRECTORY_PROPERTIES SET_SOURCE_FILES_PROPERTIES SET_TARGET_PROPERTIES SET_TESTS_PROPERTIES SITE_NAME SOURCE_GROUP STRING SUBDIR_DEPENDS SUBDIRS TARGET_LINK_LIBRARIES TRY_COMPILE TRY_RUN UNSET USE_MANGLED_MESA UTILITY_SOURCE VARIABLE_REQUIRES VTK_MAKE_INSTANTIATOR VTK_WRAP_JAVA VTK_WRAP_PYTHON VTK_WRAP_TCL WHILE WRITE_FILE
             \ nextgroup=cmakeArguments
-syn keyword cmakeTodo 
-            \ TODO FIXME XXX 
+syn keyword cmakeTodo
+            \ TODO FIXME XXX
             \ contained
 
 " Define the default highlighting.
diff --git a/Example/Demo/demo.cxx b/Example/Demo/demo.cxx
index 31de0386c..815c8149e 100644
--- a/Example/Demo/demo.cxx
+++ b/Example/Demo/demo.cxx
@@ -5,6 +5,6 @@ extern Hello hello;
 int main()
 {
   hello.Print();
-  
+
   return 0;
 }
diff --git a/Modules/CMakeAddNewLanguage.txt b/Modules/CMakeAddNewLanguage.txt
index 203c39dfe..6a30dd88b 100644
--- a/Modules/CMakeAddNewLanguage.txt
+++ b/Modules/CMakeAddNewLanguage.txt
@@ -1,7 +1,7 @@
 CMakeDetermine(LANG)Compiler.cmake  -> this should find the compiler for LANG and configure CMake(LANG)Compiler.cmake.in
 
 CMake(LANG)Compiler.cmake.in  -> used by CMakeDetermine(LANG)Compiler.cmake
-    This file is used to store compiler information and is copied down into try 
+    This file is used to store compiler information and is copied down into try
     compile directories so that try compiles do not need to re-determine and test the LANG
 
 CMakeTest(LANG)Compiler.cmake -> test the compiler and set:
diff --git a/Modules/CMakeBackwardCompatibilityC.cmake b/Modules/CMakeBackwardCompatibilityC.cmake
index 00e568830..60dcb6c08 100644
--- a/Modules/CMakeBackwardCompatibilityC.cmake
+++ b/Modules/CMakeBackwardCompatibilityC.cmake
@@ -67,7 +67,7 @@ IF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
 
   INCLUDE (FindThreads)
 
-  SET (CMAKE_THREAD_LIBS        "${CMAKE_THREAD_LIBS_INIT}" CACHE STRING 
+  SET (CMAKE_THREAD_LIBS        "${CMAKE_THREAD_LIBS_INIT}" CACHE STRING
     "Thread library used.")
 
   SET (CMAKE_USE_PTHREADS       "${CMAKE_USE_PTHREADS_INIT}" CACHE BOOL
@@ -79,7 +79,7 @@ IF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
   SET (CMAKE_HP_PTHREADS        ${CMAKE_HP_PTHREADS_INIT} CACHE BOOL
      "Use HP pthreads.")
 
-  SET (CMAKE_USE_SPROC          ${CMAKE_USE_SPROC_INIT} CACHE BOOL 
+  SET (CMAKE_USE_SPROC          ${CMAKE_USE_SPROC_INIT} CACHE BOOL
      "Use sproc libs.")
 
   IF(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
diff --git a/Modules/CMakeBackwardCompatibilityCXX.cmake b/Modules/CMakeBackwardCompatibilityCXX.cmake
index 707bbde50..839c21d5a 100644
--- a/Modules/CMakeBackwardCompatibilityCXX.cmake
+++ b/Modules/CMakeBackwardCompatibilityCXX.cmake
@@ -1,5 +1,5 @@
 # - define a bunch of backwards compatibility variables
-#  CMAKE_ANSI_CXXFLAGS - flag for ansi c++ 
+#  CMAKE_ANSI_CXXFLAGS - flag for ansi c++
 #  CMAKE_HAS_ANSI_STRING_STREAM - has <strstream>
 #  INCLUDE(TestForANSIStreamHeaders)
 #  INCLUDE(CheckIncludeFileCXX)
@@ -37,7 +37,7 @@ IF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
       # if the compiler liked the flag then set CMAKE_ANSI_CXXFLAGS
       # to the flag
       IF(CMAKE_CXX_ACCEPTS_FLAGS)
-        SET(CMAKE_ANSI_CXXFLAGS ${CMAKE_TRY_ANSI_CXX_FLAGS} CACHE INTERNAL 
+        SET(CMAKE_ANSI_CXXFLAGS ${CMAKE_TRY_ANSI_CXX_FLAGS} CACHE INTERNAL
         "What flags are required by the c++ compiler to make it ansi." )
       ENDIF(CMAKE_CXX_ACCEPTS_FLAGS)
     ENDIF( CMAKE_TRY_ANSI_CXX_FLAGS MATCHES ".+")
diff --git a/Modules/CMakeCInformation.cmake b/Modules/CMakeCInformation.cmake
index afac7a452..fab580731 100644
--- a/Modules/CMakeCInformation.cmake
+++ b/Modules/CMakeCInformation.cmake
@@ -57,7 +57,7 @@ IF(CMAKE_C_COMPILER_ID)
     OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
 ENDIF(CMAKE_C_COMPILER_ID)
 IF (NOT _INCLUDED_FILE)
-  INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} 
+  INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}
     OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
 ENDIF (NOT _INCLUDED_FILE)
 # We specify the compiler information in the system file for some
@@ -76,7 +76,7 @@ IF(CMAKE_C_SIZEOF_DATA_PTR)
 ENDIF()
 
 # This should be included before the _INIT variables are
-# used to initialize the cache.  Since the rule variables 
+# used to initialize the cache.  Since the rule variables
 # have if blocks on them, users can still define them here.
 # But, it should still be after the platform file so changes can
 # be made to those values.
@@ -103,7 +103,7 @@ IF(NOT CMAKE_MODULE_EXISTS)
 ENDIF(NOT CMAKE_MODULE_EXISTS)
 
 SET(CMAKE_C_FLAGS_INIT "$ENV{CFLAGS} ${CMAKE_C_FLAGS_INIT}")
-# avoid just having a space as the initial value for the cache 
+# avoid just having a space as the initial value for the cache
 IF(CMAKE_C_FLAGS_INIT STREQUAL " ")
   SET(CMAKE_C_FLAGS_INIT)
 ENDIF(CMAKE_C_FLAGS_INIT STREQUAL " ")
@@ -113,7 +113,7 @@ SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT}" CACHE STRING
 IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
 # default build type is none
   IF(NOT CMAKE_NO_BUILD_TYPE)
-    SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING 
+    SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
       "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
   ENDIF(NOT CMAKE_NO_BUILD_TYPE)
   SET (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG_INIT}" CACHE STRING
@@ -151,13 +151,13 @@ INCLUDE(CMakeCommonLanguageInclude)
 # <LINK_FLAGS>
 
 # C compiler information
-# <CMAKE_C_COMPILER>  
+# <CMAKE_C_COMPILER>
 # <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS>
 # <CMAKE_SHARED_MODULE_CREATE_C_FLAGS>
 # <CMAKE_C_LINK_FLAGS>
 
 # Static library tools
-# <CMAKE_AR> 
+# <CMAKE_AR>
 # <CMAKE_RANLIB>
 
 
diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake
index 9dc9cbd30..7d38c64b8 100644
--- a/Modules/CMakeCXXInformation.cmake
+++ b/Modules/CMakeCXXInformation.cmake
@@ -75,7 +75,7 @@ IF(CMAKE_CXX_SIZEOF_DATA_PTR)
 ENDIF()
 
 # This should be included before the _INIT variables are
-# used to initialize the cache.  Since the rule variables 
+# used to initialize the cache.  Since the rule variables
 # have if blocks on them, users can still define them here.
 # But, it should still be after the platform file so changes can
 # be made to those values.
@@ -121,7 +121,7 @@ IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
 ENDIF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
 
 IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG)
-  SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG}) 
+  SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
 ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG)
 
 IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP)
@@ -198,7 +198,7 @@ ENDFOREACH(type)
 # use _INIT variables so that this only happens the first time
 # and you can set these flags in the cmake cache
 SET(CMAKE_CXX_FLAGS_INIT "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_INIT}")
-# avoid just having a space as the initial value for the cache 
+# avoid just having a space as the initial value for the cache
 IF(CMAKE_CXX_FLAGS_INIT STREQUAL " ")
   SET(CMAKE_CXX_FLAGS_INIT)
 ENDIF(CMAKE_CXX_FLAGS_INIT STREQUAL " ")
@@ -241,13 +241,13 @@ INCLUDE(CMakeCommonLanguageInclude)
 # <LINK_FLAGS>
 
 # CXX compiler information
-# <CMAKE_CXX_COMPILER>  
+# <CMAKE_CXX_COMPILER>
 # <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS>
 # <CMAKE_CXX_SHARED_MODULE_CREATE_FLAGS>
 # <CMAKE_CXX_LINK_FLAGS>
 
 # Static library tools
-# <CMAKE_AR> 
+# <CMAKE_AR>
 # <CMAKE_RANLIB>
 
 
@@ -288,7 +288,7 @@ ENDIF(NOT CMAKE_CXX_LINK_EXECUTABLE)
 
 MARK_AS_ADVANCED(
 CMAKE_BUILD_TOOL
-CMAKE_VERBOSE_MAKEFILE 
+CMAKE_VERBOSE_MAKEFILE
 CMAKE_CXX_FLAGS
 CMAKE_CXX_FLAGS_RELEASE
 CMAKE_CXX_FLAGS_RELWITHDEBINFO
diff --git a/Modules/CMakeCommonLanguageInclude.cmake b/Modules/CMakeCommonLanguageInclude.cmake
index a2929f1ea..aa129de68 100644
--- a/Modules/CMakeCommonLanguageInclude.cmake
+++ b/Modules/CMakeCommonLanguageInclude.cmake
@@ -23,10 +23,10 @@ SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
 IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
 # default build type is none
   IF(NOT CMAKE_NO_BUILD_TYPE)
-    SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING 
+    SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
       "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
   ENDIF(NOT CMAKE_NO_BUILD_TYPE)
-  
+
   SET (CMAKE_EXE_LINKER_FLAGS_DEBUG ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
      "Flags used by the linker during debug builds.")
 
@@ -36,10 +36,10 @@ IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
   SET (CMAKE_EXE_LINKER_FLAGS_RELEASE ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
      "Flags used by the linker during release builds.")
 
-  SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO 
+  SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
      ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
      "Flags used by the linker during Release with Debug Info builds.")
-  
+
   SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
      "Flags used by the linker during debug builds.")
 
@@ -50,7 +50,7 @@ IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
   SET (CMAKE_SHARED_LINKER_FLAGS_RELEASE ${CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
      "Flags used by the linker during release builds.")
 
-  SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO 
+  SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
      ${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
      "Flags used by the linker during Release with Debug Info builds.")
 
@@ -64,7 +64,7 @@ IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
   SET (CMAKE_MODULE_LINKER_FLAGS_RELEASE ${CMAKE_MODULE_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
      "Flags used by the linker during release builds.")
 
-  SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO 
+  SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
      ${CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
      "Flags used by the linker during Release with Debug Info builds.")
 
@@ -77,13 +77,13 @@ SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
 SET (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
      CACHE STRING "Flags used by the linker during the creation of modules.")
 
-SET(CMAKE_BUILD_TOOL ${CMAKE_MAKE_PROGRAM} CACHE INTERNAL 
+SET(CMAKE_BUILD_TOOL ${CMAKE_MAKE_PROGRAM} CACHE INTERNAL
      "What is the target build tool cmake is generating for.")
 
 
 MARK_AS_ADVANCED(
 CMAKE_BUILD_TOOL
-CMAKE_VERBOSE_MAKEFILE 
+CMAKE_VERBOSE_MAKEFILE
 
 CMAKE_EXE_LINKER_FLAGS
 CMAKE_EXE_LINKER_FLAGS_DEBUG
diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake
index 45033c2a3..766289ec3 100644
--- a/Modules/CMakeDetermineFortranCompiler.cmake
+++ b/Modules/CMakeDetermineFortranCompiler.cmake
@@ -15,7 +15,7 @@
 # determine the compiler to use for Fortran programs
 # NOTE, a generator may set CMAKE_Fortran_COMPILER before
 # loading this file to force a compiler.
-# use environment variable FC first if defined by user, next use 
+# use environment variable FC first if defined by user, next use
 # the cmake variable CMAKE_GENERATOR_FC which can be defined by a generator
 # as a default compiler
 
@@ -34,12 +34,12 @@ IF(NOT CMAKE_Fortran_COMPILER)
     ENDIF(CMAKE_Fortran_FLAGS_ENV_INIT)
     IF(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
     ELSE(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
-      MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable FC:\n$ENV{FC}.") 
+      MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable FC:\n$ENV{FC}.")
     ENDIF(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
   ENDIF($ENV{FC} MATCHES ".+")
-  
+
   # next try prefer the compiler specified by the generator
-  IF(CMAKE_GENERATOR_FC) 
+  IF(CMAKE_GENERATOR_FC)
     IF(NOT CMAKE_Fortran_COMPILER_INIT)
       SET(CMAKE_Fortran_COMPILER_INIT ${CMAKE_GENERATOR_FC})
     ENDIF(NOT CMAKE_Fortran_COMPILER_INIT)
@@ -64,7 +64,7 @@ IF(NOT CMAKE_Fortran_COMPILER)
     #  ifc: Intel Fortran 95 compiler for Linux/x86
     #  efc: Intel Fortran 95 compiler for IA64
     #
-    #  The order is 95 or newer compilers first, then 90, 
+    #  The order is 95 or newer compilers first, then 90,
     #  then 77 or older compilers, gnu is always last in the group,
     #  so if you paid for a compiler it is picked by default.
     SET(CMAKE_Fortran_COMPILER_LIST
@@ -88,7 +88,7 @@ IF(NOT CMAKE_Fortran_COMPILER)
 ELSE(NOT CMAKE_Fortran_COMPILER)
    # we only get here if CMAKE_Fortran_COMPILER was specified using -D or a pre-made CMakeCache.txt
   # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
-  # if CMAKE_Fortran_COMPILER is a list of length 2, use the first item as 
+  # if CMAKE_Fortran_COMPILER is a list of length 2, use the first item as
   # CMAKE_Fortran_COMPILER and the 2nd one as CMAKE_Fortran_COMPILER_ARG1
 
   LIST(LENGTH CMAKE_Fortran_COMPILER _CMAKE_Fortran_COMPILER_LIST_LENGTH)
@@ -97,9 +97,9 @@ ELSE(NOT CMAKE_Fortran_COMPILER)
     LIST(GET CMAKE_Fortran_COMPILER 0 CMAKE_Fortran_COMPILER)
   ENDIF("${_CMAKE_Fortran_COMPILER_LIST_LENGTH}" EQUAL 2)
 
-  # if a compiler was specified by the user but without path, 
+  # if a compiler was specified by the user but without path,
   # now try to find it with the full path
-  # if it is found, force it into the cache, 
+  # if it is found, force it into the cache,
   # if not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
   # if the C compiler already had a path, reuse it for searching the CXX compiler
   GET_FILENAME_COMPONENT(_CMAKE_USER_Fortran_COMPILER_PATH "${CMAKE_Fortran_COMPILER}" PATH)
@@ -113,7 +113,7 @@ ELSE(NOT CMAKE_Fortran_COMPILER)
   ENDIF(NOT _CMAKE_USER_Fortran_COMPILER_PATH)
 ENDIF(NOT CMAKE_Fortran_COMPILER)
 
-MARK_AS_ADVANCED(CMAKE_Fortran_COMPILER)  
+MARK_AS_ADVANCED(CMAKE_Fortran_COMPILER)
 
 # Build a small source file to identify the compiler.
 IF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
diff --git a/Modules/CMakeDetermineJavaCompiler.cmake b/Modules/CMakeDetermineJavaCompiler.cmake
index aefcaba36..e899a1e60 100644
--- a/Modules/CMakeDetermineJavaCompiler.cmake
+++ b/Modules/CMakeDetermineJavaCompiler.cmake
@@ -24,21 +24,21 @@ IF(NOT CMAKE_Java_COMPILER)
       SET(CMAKE_Java_COMPILER_ARG1 "${CMAKE_Java_FLAGS_ENV_INIT}" CACHE STRING "First argument to Java compiler")
     ENDIF(CMAKE_Java_FLAGS_ENV_INIT)
     IF(NOT EXISTS ${CMAKE_Java_COMPILER_INIT})
-      MESSAGE(SEND_ERROR "Could not find compiler set in environment variable JAVA_COMPILER:\n$ENV{JAVA_COMPILER}.") 
+      MESSAGE(SEND_ERROR "Could not find compiler set in environment variable JAVA_COMPILER:\n$ENV{JAVA_COMPILER}.")
     ENDIF(NOT EXISTS ${CMAKE_Java_COMPILER_INIT})
   ENDIF($ENV{JAVA_COMPILER} MATCHES ".+")
 
   IF($ENV{JAVA_RUNTIME} MATCHES ".+")
     GET_FILENAME_COMPONENT(CMAKE_Java_RUNTIME_INIT $ENV{JAVA_RUNTIME} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
     IF(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT})
-      MESSAGE(SEND_ERROR "Could not find compiler set in environment variable JAVA_RUNTIME:\n$ENV{JAVA_RUNTIME}.") 
+      MESSAGE(SEND_ERROR "Could not find compiler set in environment variable JAVA_RUNTIME:\n$ENV{JAVA_RUNTIME}.")
     ENDIF(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT})
   ENDIF($ENV{JAVA_RUNTIME} MATCHES ".+")
 
   IF($ENV{JAVA_ARCHIVE} MATCHES ".+")
     GET_FILENAME_COMPONENT(CMAKE_Java_ARCHIVE_INIT $ENV{JAVA_ARCHIVE} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
     IF(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT})
-      MESSAGE(SEND_ERROR "Could not find compiler set in environment variable JAVA_ARCHIVE:\n$ENV{JAVA_ARCHIVE}.") 
+      MESSAGE(SEND_ERROR "Could not find compiler set in environment variable JAVA_ARCHIVE:\n$ENV{JAVA_ARCHIVE}.")
     ENDIF(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT})
   ENDIF($ENV{JAVA_ARCHIVE} MATCHES ".+")
 
@@ -71,7 +71,7 @@ IF(NOT CMAKE_Java_COMPILER)
     FIND_PROGRAM(CMAKE_Java_COMPILER
       NAMES javac
       PATHS ${Java_BIN_PATH}
-    )    
+    )
   ENDIF(CMAKE_Java_COMPILER_INIT)
 
   # if no runtime has been specified yet, then look for one
@@ -81,7 +81,7 @@ IF(NOT CMAKE_Java_COMPILER)
     FIND_PROGRAM(CMAKE_Java_RUNTIME
       NAMES java
       PATHS ${Java_BIN_PATH}
-    )    
+    )
   ENDIF(CMAKE_Java_RUNTIME_INIT)
 
   # if no archive has been specified yet, then look for one
@@ -91,12 +91,12 @@ IF(NOT CMAKE_Java_COMPILER)
     FIND_PROGRAM(CMAKE_Java_ARCHIVE
       NAMES jar
       PATHS ${Java_BIN_PATH}
-    )    
+    )
   ENDIF(CMAKE_Java_ARCHIVE_INIT)
 ENDIF(NOT CMAKE_Java_COMPILER)
-MARK_AS_ADVANCED(CMAKE_Java_COMPILER)  
+MARK_AS_ADVANCED(CMAKE_Java_COMPILER)
 
 # configure variables set in this file for fast reload later on
-CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeJavaCompiler.cmake.in 
+CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeJavaCompiler.cmake.in
   ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeJavaCompiler.cmake IMMEDIATE @ONLY)
 SET(CMAKE_Java_COMPILER_ENV_VAR "JAVA_COMPILER")
diff --git a/Modules/CMakeDetermineRCCompiler.cmake b/Modules/CMakeDetermineRCCompiler.cmake
index 8e085af7a..4662e3ad2 100644
--- a/Modules/CMakeDetermineRCCompiler.cmake
+++ b/Modules/CMakeDetermineRCCompiler.cmake
@@ -15,7 +15,7 @@
 # determine the compiler to use for C programs
 # NOTE, a generator may set CMAKE_C_COMPILER before
 # loading this file to force a compiler.
-# use environment variable CCC first if defined by user, next use 
+# use environment variable CCC first if defined by user, next use
 # the cmake variable CMAKE_GENERATOR_CC which can be defined by a generator
 # as a default compiler
 IF(NOT CMAKE_RC_COMPILER)
@@ -27,12 +27,12 @@ IF(NOT CMAKE_RC_COMPILER)
     ENDIF(CMAKE_RC_FLAGS_ENV_INIT)
     IF(EXISTS ${CMAKE_RC_COMPILER_INIT})
     ELSE(EXISTS ${CMAKE_RC_COMPILER_INIT})
-      MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable RC:\n$ENV{RC}.") 
+      MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable RC:\n$ENV{RC}.")
     ENDIF(EXISTS ${CMAKE_RC_COMPILER_INIT})
   ENDIF($ENV{RC} MATCHES ".+")
-  
+
   # next try prefer the compiler specified by the generator
-  IF(CMAKE_GENERATOR_RC) 
+  IF(CMAKE_GENERATOR_RC)
     IF(NOT CMAKE_RC_COMPILER_INIT)
       SET(CMAKE_RC_COMPILER_INIT ${CMAKE_GENERATOR_RC})
     ENDIF(NOT CMAKE_RC_COMPILER_INIT)
@@ -52,7 +52,7 @@ IF(NOT CMAKE_RC_COMPILER)
   ENDIF(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER)
 ENDIF(NOT CMAKE_RC_COMPILER)
 
-MARK_AS_ADVANCED(CMAKE_RC_COMPILER)  
+MARK_AS_ADVANCED(CMAKE_RC_COMPILER)
 
 GET_FILENAME_COMPONENT(_CMAKE_RC_COMPILER_NAME_WE ${CMAKE_RC_COMPILER} NAME_WE)
 IF(_CMAKE_RC_COMPILER_NAME_WE STREQUAL "windres")
@@ -62,6 +62,6 @@ ELSE()
 ENDIF()
 
 # configure variables set in this file for fast reload later on
-CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeRCCompiler.cmake.in 
+CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeRCCompiler.cmake.in
                ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeRCCompiler.cmake IMMEDIATE)
 SET(CMAKE_RC_COMPILER_ENV_VAR "RC")
diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake
index 7ae377517..c89ccd17d 100644
--- a/Modules/CMakeDetermineSystem.cmake
+++ b/Modules/CMakeDetermineSystem.cmake
@@ -19,24 +19,24 @@
 #
 #  Expected uname -s output:
 #
-# AIX                           AIX  
-# BSD/OS                        BSD/OS  
-# FreeBSD                       FreeBSD  
-# HP-UX                         HP-UX  
-# IRIX                          IRIX  
-# Linux                         Linux  
+# AIX                           AIX
+# BSD/OS                        BSD/OS
+# FreeBSD                       FreeBSD
+# HP-UX                         HP-UX
+# IRIX                          IRIX
+# Linux                         Linux
 # GNU/kFreeBSD                  GNU/kFreeBSD
-# NetBSD                        NetBSD  
-# OpenBSD                       OpenBSD  
-# OFS/1 (Digital Unix)          OSF1  
-# SCO OpenServer 5              SCO_SV  
-# SCO UnixWare 7                UnixWare  
-# SCO UnixWare (pre release 7)  UNIX_SV  
-# SCO XENIX                     Xenix  
-# Solaris                       SunOS  
-# SunOS                         SunOS  
-# Tru64                         Tru64  
-# Ultrix                        ULTRIX  
+# NetBSD                        NetBSD
+# OpenBSD                       OpenBSD
+# OFS/1 (Digital Unix)          OSF1
+# SCO OpenServer 5              SCO_SV
+# SCO UnixWare 7                UnixWare
+# SCO UnixWare (pre release 7)  UNIX_SV
+# SCO XENIX                     Xenix
+# Solaris                       SunOS
+# SunOS                         SunOS
+# Tru64                         Tru64
+# Ultrix                        ULTRIX
 # cygwin                        CYGWIN_NT-5.1
 # MacOSX                        Darwin
 
@@ -61,7 +61,7 @@ IF(CMAKE_HOST_UNIX)
           RETURN_VALUE val)
       ENDIF("${val}" GREATER 0)
     ENDIF()
-    # check the return of the last uname -m or -p 
+    # check the return of the last uname -m or -p
     IF("${val}" GREATER 0)
         SET(CMAKE_HOST_SYSTEM_PROCESSOR "unknown")
     ENDIF("${val}" GREATER 0)
@@ -79,7 +79,7 @@ ENDIF(CMAKE_HOST_UNIX)
 
 # if a toolchain file is used, the user wants to cross compile.
 # in this case read the toolchain file and keep the CMAKE_HOST_SYSTEM_*
-# variables around so they can be used in CMakeLists.txt. 
+# variables around so they can be used in CMakeLists.txt.
 # In all other cases, the host and target platform are the same.
 IF(CMAKE_TOOLCHAIN_FILE)
   # at first try to load it as path relative to the directory from which cmake has been run
@@ -92,7 +92,7 @@ IF(CMAKE_TOOLCHAIN_FILE)
   IF(_INCLUDED_TOOLCHAIN_FILE)
     SET(CMAKE_TOOLCHAIN_FILE "${_INCLUDED_TOOLCHAIN_FILE}" CACHE FILEPATH "The CMake toolchain file" FORCE)
   ELSE(_INCLUDED_TOOLCHAIN_FILE)
-    MESSAGE(FATAL_ERROR "Could not find toolchain file: ${CMAKE_TOOLCHAIN_FILE}") 
+    MESSAGE(FATAL_ERROR "Could not find toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
     SET(CMAKE_TOOLCHAIN_FILE "NOTFOUND" CACHE FILEPATH "The CMake toolchain file" FORCE)
   ENDIF(_INCLUDED_TOOLCHAIN_FILE)
 ENDIF(CMAKE_TOOLCHAIN_FILE)
@@ -130,7 +130,7 @@ MACRO(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX)
     SET(${_PREFIX}_NAME kFreeBSD)
   ENDIF(${_PREFIX}_NAME MATCHES kFreeBSD)
 
-  # fix for CYGWIN which has windows version in it 
+  # fix for CYGWIN which has windows version in it
   IF(${_PREFIX}_NAME MATCHES CYGWIN)
     SET(${_PREFIX}_NAME CYGWIN)
   ENDIF(${_PREFIX}_NAME MATCHES CYGWIN)
@@ -147,17 +147,17 @@ ENDMACRO(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX)
 ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_SYSTEM)
 ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_HOST_SYSTEM)
 
-# this file is also executed from cpack, then we don't need to generate these files 
+# this file is also executed from cpack, then we don't need to generate these files
 # in this case there is no CMAKE_BINARY_DIR
 IF(CMAKE_BINARY_DIR)
   # write entry to the log file
   IF(PRESET_CMAKE_SYSTEM_NAME)
-    FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
+    FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
                 "The target system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n")
-    FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
+    FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
                 "The host system is: ${CMAKE_HOST_SYSTEM_NAME} - ${CMAKE_HOST_SYSTEM_VERSION} - ${CMAKE_HOST_SYSTEM_PROCESSOR}\n")
   ELSE(PRESET_CMAKE_SYSTEM_NAME)
-    FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
+    FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
                 "The system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n")
   ENDIF(PRESET_CMAKE_SYSTEM_NAME)
 
@@ -170,7 +170,7 @@ IF(CMAKE_BINARY_DIR)
 
   # configure variables set in this file for fast reload, the template file is defined at the top of this file
   CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeSystem.cmake.in
-                ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake 
+                ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake
                 IMMEDIATE @ONLY)
 
 ENDIF(CMAKE_BINARY_DIR)
diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake
index 64ec403ad..a5202f402 100644
--- a/Modules/CMakeFindBinUtils.cmake
+++ b/Modules/CMakeFindBinUtils.cmake
@@ -1,13 +1,13 @@
 
 # search for additional tools required for C/C++ (and other languages ?)
 #
-# If the internal cmake variable _CMAKE_TOOLCHAIN_PREFIX is set, this is used 
+# If the internal cmake variable _CMAKE_TOOLCHAIN_PREFIX is set, this is used
 # as prefix for the tools (e.g. arm-elf-gcc etc.)
 # If the cmake variable _CMAKE_TOOLCHAIN_LOCATION is set, the compiler is
-# searched only there. The other tools are at first searched there, then 
+# searched only there. The other tools are at first searched there, then
 # also in the default locations.
 #
-# Sets the following variables: 
+# Sets the following variables:
 #   CMAKE_AR
 #   CMAKE_RANLIB
 #   CMAKE_LINKER
@@ -30,7 +30,7 @@
 #  License text for the above reference.)
 
 # if it's the MS C/CXX compiler, search for link
-IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" 
+IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
    OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
    OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
 
@@ -39,7 +39,7 @@ IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
   MARK_AS_ADVANCED(CMAKE_LINKER)
 
 # in all other cases search for ar, ranlib, etc.
-ELSE("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" 
+ELSE("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
    OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
    OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
 
@@ -58,7 +58,7 @@ ELSE("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
 
   MARK_AS_ADVANCED(CMAKE_AR CMAKE_RANLIB CMAKE_STRIP CMAKE_LINKER CMAKE_NM CMAKE_OBJDUMP CMAKE_OBJCOPY)
 
-ENDIF("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" 
+ENDIF("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
    OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
    OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
 
diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake
index d962f4cb5..b965e8368 100644
--- a/Modules/CMakeFortranInformation.cmake
+++ b/Modules/CMakeFortranInformation.cmake
@@ -52,7 +52,7 @@ IF(CMAKE_Fortran_SIZEOF_DATA_PTR)
 ENDIF()
 
 # This should be included before the _INIT variables are
-# used to initialize the cache.  Since the rule variables 
+# used to initialize the cache.  Since the rule variables
 # have if blocks on them, users can still define them here.
 # But, it should still be after the platform file so changes can
 # be made to those values.
@@ -70,7 +70,7 @@ IF(CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran)
 ENDIF()
 
 
-# Fortran needs cmake to do a requires step during its build process to 
+# Fortran needs cmake to do a requires step during its build process to
 # catch any modules
 SET(CMAKE_NEEDS_REQUIRES_STEP_Fortran_FLAG 1)
 
@@ -102,7 +102,7 @@ IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS)
 ENDIF()
 
 IF(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG)
-  SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG}) 
+  SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
 ENDIF()
 
 IF(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP)
@@ -165,7 +165,7 @@ ENDIF(NOT CMAKE_INCLUDE_FLAG_SEP_Fortran)
 SET(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make.  This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")
 
 SET(CMAKE_Fortran_FLAGS_INIT "$ENV{FFLAGS} ${CMAKE_Fortran_FLAGS_INIT}")
-# avoid just having a space as the initial value for the cache 
+# avoid just having a space as the initial value for the cache
 IF(CMAKE_Fortran_FLAGS_INIT STREQUAL " ")
   SET(CMAKE_Fortran_FLAGS_INIT)
 ENDIF(CMAKE_Fortran_FLAGS_INIT STREQUAL " ")
diff --git a/Modules/CMakeJavaInformation.cmake b/Modules/CMakeJavaInformation.cmake
index e192db100..7f812bd32 100644
--- a/Modules/CMakeJavaInformation.cmake
+++ b/Modules/CMakeJavaInformation.cmake
@@ -13,7 +13,7 @@
 #  License text for the above reference.)
 
 # This should be included before the _INIT variables are
-# used to initialize the cache.  Since the rule variables 
+# used to initialize the cache.  Since the rule variables
 # have if blocks on them, users can still define them here.
 # But, it should still be after the platform file so changes can
 # be made to those values.
diff --git a/Modules/CMakeMSYSFindMake.cmake b/Modules/CMakeMSYSFindMake.cmake
index 95492a0b0..29dc2c025 100644
--- a/Modules/CMakeMSYSFindMake.cmake
+++ b/Modules/CMakeMSYSFindMake.cmake
@@ -12,8 +12,8 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PROGRAM(CMAKE_MAKE_PROGRAM make 
-  PATHS 
+FIND_PROGRAM(CMAKE_MAKE_PROGRAM make
+  PATHS
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MSYS-1.0_is1;Inno Setup: App Path]/bin"
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin"
   c:/msys/1.0/bin /msys/1.0/bin)
diff --git a/Modules/CMakeMinGWFindMake.cmake b/Modules/CMakeMinGWFindMake.cmake
index f760d74d4..61ddb8c6c 100644
--- a/Modules/CMakeMinGWFindMake.cmake
+++ b/Modules/CMakeMinGWFindMake.cmake
@@ -13,7 +13,7 @@
 #  License text for the above reference.)
 
 FIND_PROGRAM(CMAKE_MAKE_PROGRAM mingw32-make.exe PATHS
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin" 
+  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin"
   c:/MinGW/bin /MinGW/bin)
 FIND_PROGRAM(CMAKE_SH sh.exe )
 IF(CMAKE_SH)
diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in
index 6341dca9a..4b360f776 100644
--- a/Modules/CMakePlatformId.h.in
+++ b/Modules/CMakePlatformId.h.in
@@ -37,7 +37,7 @@
 
 #elif defined(__HAIKU) || defined(__HAIKU__) || defined(_HAIKU)
 # define PLATFORM_ID "Haiku"
-/* Haiku also defines __BEOS__ so we must 
+/* Haiku also defines __BEOS__ so we must
    put it prior to the check for __BEOS__
 */
 
@@ -92,7 +92,7 @@
 #  define ARCHITECTURE_ID "IA64"
 
 # elif defined(_M_X64) || defined(_M_AMD64)
-#  define ARCHITECTURE_ID "x64" 
+#  define ARCHITECTURE_ID "x64"
 
 # elif defined(_M_IX86)
 #  define ARCHITECTURE_ID "X86"
diff --git a/Modules/CMakeSystemSpecificInformation.cmake b/Modules/CMakeSystemSpecificInformation.cmake
index faa9e3625..88b77489b 100644
--- a/Modules/CMakeSystemSpecificInformation.cmake
+++ b/Modules/CMakeSystemSpecificInformation.cmake
@@ -42,7 +42,7 @@ IF(NOT _INCLUDED_SYSTEM_INFO_FILE)
   IF(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
     CONFIGURE_FILE(${CMAKE_BINARY_DIR}/CMakeCache.txt
                    ${CMAKE_BINARY_DIR}/CopyOfCMakeCache.txt COPYONLY)
-    MESSAGE("Your CMakeCache.txt file was copied to CopyOfCMakeCache.txt. " 
+    MESSAGE("Your CMakeCache.txt file was copied to CopyOfCMakeCache.txt. "
             "Please send that file to cmake@www.cmake.org.")
    ENDIF(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
 ENDIF(NOT _INCLUDED_SYSTEM_INFO_FILE)
diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake
index 779b2f007..5a86eb917 100644
--- a/Modules/CMakeTestCCompiler.cmake
+++ b/Modules/CMakeTestCCompiler.cmake
@@ -33,7 +33,7 @@ IF(NOT CMAKE_C_COMPILER_WORKS)
     "int main(int argc, char* argv[])\n"
     "#endif\n"
     "{ (void)argv; return argc-1;}\n")
-  TRY_COMPILE(CMAKE_C_COMPILER_WORKS ${CMAKE_BINARY_DIR} 
+  TRY_COMPILE(CMAKE_C_COMPILER_WORKS ${CMAKE_BINARY_DIR}
     ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c
     OUTPUT_VARIABLE __CMAKE_C_COMPILER_OUTPUT)
   SET(C_TEST_WAS_RUN 1)
diff --git a/Modules/CMakeTestCXXCompiler.cmake b/Modules/CMakeTestCXXCompiler.cmake
index 87022e9f9..dadec1a65 100644
--- a/Modules/CMakeTestCXXCompiler.cmake
+++ b/Modules/CMakeTestCXXCompiler.cmake
@@ -21,12 +21,12 @@ INCLUDE(CMakeTestCompilerCommon)
 # any makefiles or projects.
 IF(NOT CMAKE_CXX_COMPILER_WORKS)
   PrintTestCompilerStatus("CXX" "")
-  FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx 
+  FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx
     "#ifndef __cplusplus\n"
     "# error \"The CMAKE_CXX_COMPILER is set to a C compiler\"\n"
     "#endif\n"
     "int main(){return 0;}\n")
-  TRY_COMPILE(CMAKE_CXX_COMPILER_WORKS ${CMAKE_BINARY_DIR} 
+  TRY_COMPILE(CMAKE_CXX_COMPILER_WORKS ${CMAKE_BINARY_DIR}
     ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx
     OUTPUT_VARIABLE __CMAKE_CXX_COMPILER_OUTPUT)
   SET(CXX_TEST_WAS_RUN 1)
diff --git a/Modules/CMakeTestFortranCompiler.cmake b/Modules/CMakeTestFortranCompiler.cmake
index b4dcea634..b2fa16aef 100644
--- a/Modules/CMakeTestFortranCompiler.cmake
+++ b/Modules/CMakeTestFortranCompiler.cmake
@@ -26,7 +26,7 @@ IF(NOT CMAKE_Fortran_COMPILER_WORKS)
         PRINT *, 'Hello'
         END
   ")
-  TRY_COMPILE(CMAKE_Fortran_COMPILER_WORKS ${CMAKE_BINARY_DIR} 
+  TRY_COMPILE(CMAKE_Fortran_COMPILER_WORKS ${CMAKE_BINARY_DIR}
     ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f
     OUTPUT_VARIABLE OUTPUT)
   SET(FORTRAN_TEST_WAS_RUN 1)
diff --git a/Modules/CMakeVS6BackwardCompatibility.cmake b/Modules/CMakeVS6BackwardCompatibility.cmake
index 438f64f6c..c948ff4a0 100644
--- a/Modules/CMakeVS6BackwardCompatibility.cmake
+++ b/Modules/CMakeVS6BackwardCompatibility.cmake
@@ -20,7 +20,7 @@ SET (CMAKE_SIZEOF_CHAR      1   CACHE INTERNAL "Size of char data type")
 SET (CMAKE_SIZEOF_SHORT     2   CACHE INTERNAL "Size of short data type")
 SET (CMAKE_SIZEOF_FLOAT     4   CACHE INTERNAL "Size of float data type")
 SET (CMAKE_SIZEOF_DOUBLE    8   CACHE INTERNAL "Size of double data type")
-SET (CMAKE_NO_ANSI_FOR_SCOPE 1 CACHE INTERNAL 
+SET (CMAKE_NO_ANSI_FOR_SCOPE 1 CACHE INTERNAL
          "Does the compiler support ansi for scope.")
 SET (CMAKE_USE_WIN32_THREADS  TRUE CACHE BOOL    "Use the win32 thread library.")
 SET (CMAKE_WORDS_BIGENDIAN 0 CACHE INTERNAL "endianness of bytes")
diff --git a/Modules/CMakeVS7BackwardCompatibility.cmake b/Modules/CMakeVS7BackwardCompatibility.cmake
index df0b3bb97..9743c2705 100644
--- a/Modules/CMakeVS7BackwardCompatibility.cmake
+++ b/Modules/CMakeVS7BackwardCompatibility.cmake
@@ -20,7 +20,7 @@ SET (CMAKE_SIZEOF_CHAR      1   CACHE INTERNAL "Size of char data type")
 SET (CMAKE_SIZEOF_SHORT     2   CACHE INTERNAL "Size of short data type")
 SET (CMAKE_SIZEOF_FLOAT     4   CACHE INTERNAL "Size of float data type")
 SET (CMAKE_SIZEOF_DOUBLE    8   CACHE INTERNAL "Size of double data type")
-SET (CMAKE_NO_ANSI_FOR_SCOPE 0 CACHE INTERNAL 
+SET (CMAKE_NO_ANSI_FOR_SCOPE 0 CACHE INTERNAL
          "Does the compiler support ansi for scope.")
 SET (CMAKE_USE_WIN32_THREADS  TRUE CACHE BOOL    "Use the win32 thread library.")
 SET (CMAKE_WORDS_BIGENDIAN 0 CACHE INTERNAL "endianness of bytes")
diff --git a/Modules/CMakeVerifyManifest.cmake b/Modules/CMakeVerifyManifest.cmake
index 75783691f..1d16e1881 100644
--- a/Modules/CMakeVerifyManifest.cmake
+++ b/Modules/CMakeVerifyManifest.cmake
@@ -4,7 +4,7 @@
 # side by side manifests for a project match.  To run this
 # script, cd to a directory and run the script with cmake -P.
 # On the command line you can pass in versions that are OK even
-# if not found in the .manifest files. For example, 
+# if not found in the .manifest files. For example,
 # cmake -Dallow_versions=8.0.50608.0 -PCmakeVerifyManifest.cmake
 # could be used to allow an embeded manifest of 8.0.50608.0
 # to be used in a project even if that version was not found
@@ -40,7 +40,7 @@ function(crt_version file list_var)
   foreach(s ${strings})
     set(has_match 1)
     string(REGEX
-      REPLACE ".*<assembly.*\"Microsoft.VC...CRT\".*version=\"([^\"]*)\".*</assembly>.*$" "\\1" 
+      REPLACE ".*<assembly.*\"Microsoft.VC...CRT\".*version=\"([^\"]*)\".*</assembly>.*$" "\\1"
       version "${s}")
     if(NOT "${version}" STREQUAL "")
       list(APPEND version_list ${version})
@@ -61,14 +61,14 @@ endfunction(crt_version)
 set(fatal_error FALSE)
 
 # check_version:
-# 
+#
 # test a file against the shipped manifest versions
 # for a directory
 function(check_version file manifest_versions)
   set(manifest_versions ${manifest_versions} ${allow_versions})
   # collect versions for a given file
   crt_version(${file} file_versions)
-  # see if the versions 
+  # see if the versions
   foreach(ver ${file_versions})
     list(FIND manifest_versions "${ver}" found_version)
     if("${found_version}" EQUAL -1)
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index 657595731..b79960e02 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -187,7 +187,7 @@
 #  in CMake, so this change is compatible).
 ##end
 #
-# The following CPack variables are specific to source packages, and 
+# The following CPack variables are specific to source packages, and
 # will not affect binary packages:
 #
 ##variable
@@ -321,7 +321,7 @@ MACRO(cpack_encode_variables)
   SET(_CPACK_OTHER_VARIABLES_)
   GET_CMAKE_PROPERTY(res VARIABLES)
   FOREACH(var ${res})
-    IF("xxx${var}" MATCHES "xxxCPACK")  
+    IF("xxx${var}" MATCHES "xxxCPACK")
       SET(_CPACK_OTHER_VARIABLES_
         "${_CPACK_OTHER_VARIABLES_}\nSET(${var} \"${${var}}\")")
       ENDIF("xxx${var}" MATCHES "xxxCPACK")
@@ -440,7 +440,7 @@ if(NOT CPACK_GENERATOR)
     option(CPACK_BINARY_NSIS "Enable to build NSIS packages" ON)
     option(CPACK_BINARY_ZIP  "Enable to build ZIP packages" OFF)
   endif(UNIX)
-  
+
   cpack_optional_append(CPACK_GENERATOR  CPACK_BINARY_BUNDLE       Bundle)
   cpack_optional_append(CPACK_GENERATOR  CPACK_BINARY_DRAGNDROP    DragNDrop)
   cpack_optional_append(CPACK_GENERATOR  CPACK_BINARY_PACKAGEMAKER PackageMaker)
@@ -454,7 +454,7 @@ if(NOT CPACK_GENERATOR)
   cpack_optional_append(CPACK_GENERATOR  CPACK_BINARY_TBZ2         TBZ2)
   cpack_optional_append(CPACK_GENERATOR  CPACK_BINARY_TZ           TZ)
   cpack_optional_append(CPACK_GENERATOR  CPACK_BINARY_ZIP          ZIP)
-  
+
 endif(NOT CPACK_GENERATOR)
 
 # Provide options to choose source generators
@@ -481,10 +481,10 @@ endif(NOT CPACK_SOURCE_GENERATOR)
 
 # mark the above options as advanced
 mark_as_advanced(CPACK_BINARY_CYGWIN CPACK_BINARY_PACKAGEMAKER CPACK_BINARY_OSXX11
-                 CPACK_BINARY_STGZ   CPACK_BINARY_TGZ          CPACK_BINARY_TBZ2 
-                 CPACK_BINARY_DEB    CPACK_BINARY_RPM          CPACK_BINARY_TZ     
+                 CPACK_BINARY_STGZ   CPACK_BINARY_TGZ          CPACK_BINARY_TBZ2
+                 CPACK_BINARY_DEB    CPACK_BINARY_RPM          CPACK_BINARY_TZ
                  CPACK_BINARY_NSIS CPACK_BINARY_ZIP CPACK_BINARY_BUNDLE
-                 CPACK_SOURCE_CYGWIN CPACK_SOURCE_TBZ2 CPACK_SOURCE_TGZ 
+                 CPACK_SOURCE_CYGWIN CPACK_SOURCE_TBZ2 CPACK_SOURCE_TGZ
                  CPACK_SOURCE_TZ CPACK_SOURCE_ZIP CPACK_BINARY_DRAGNDROP)
 
 # Set some other variables
@@ -499,11 +499,11 @@ endif()
 # if the user has set CPACK_NSIS_DISPLAY
 # explicitly, then use that as the default
 # value of CPACK_NSIS_PACKAGE_NAME  instead
-# of CPACK_PACKAGE_INSTALL_DIRECTORY 
+# of CPACK_PACKAGE_INSTALL_DIRECTORY
 cpack_set_if_not_set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
 
 if(CPACK_NSIS_DISPLAY_NAME_SET)
-  string(REPLACE "\\" "\\\\" 
+  string(REPLACE "\\" "\\\\"
     _NSIS_DISPLAY_NAME_TMP  "${CPACK_NSIS_DISPLAY_NAME}")
   cpack_set_if_not_set(CPACK_NSIS_PACKAGE_NAME "${_NSIS_DISPLAY_NAME_TMP}")
 else()
diff --git a/Modules/CPackZIP.cmake b/Modules/CPackZIP.cmake
index 99963cf91..f80b43903 100644
--- a/Modules/CPackZIP.cmake
+++ b/Modules/CPackZIP.cmake
@@ -23,7 +23,7 @@ IF(ZIP_EXECUTABLE)
 ENDIF(ZIP_EXECUTABLE)
 
 IF(NOT ZIP_EXECUTABLE)
-  FIND_PROGRAM(ZIP_EXECUTABLE 7z PATHS "$ENV{ProgramFiles}/7-Zip") 
+  FIND_PROGRAM(ZIP_EXECUTABLE 7z PATHS "$ENV{ProgramFiles}/7-Zip")
   IF(ZIP_EXECUTABLE)
     SET(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" a -tzip \"<ARCHIVE>\" @<FILELIST>")
   SET(CPACK_ZIP_NEED_QUOTES TRUE)
diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake
index ec9dbeb79..a32baa223 100644
--- a/Modules/CTest.cmake
+++ b/Modules/CTest.cmake
@@ -61,7 +61,7 @@
 OPTION(BUILD_TESTING "Build the testing tree." ON)
 
 # function to turn generator name into a version string
-# like vs7 vs71 vs8 vs9 
+# like vs7 vs71 vs8 vs9
 FUNCTION(GET_VS_VERSION_STRING generator var)
   STRING(REGEX REPLACE "Visual Studio ([0-9][0-9]?)($|.*)" "\\1"
     NUMBER "${generator}")
@@ -122,7 +122,7 @@ IF(BUILD_TESTING)
   SET_IF_NOT_SET (NIGHTLY_START_TIME "00:00:00 EDT")
 
   FIND_PROGRAM(CVSCOMMAND cvs )
-  SET(CVS_UPDATE_OPTIONS "-d -A -P" CACHE STRING 
+  SET(CVS_UPDATE_OPTIONS "-d -A -P" CACHE STRING
     "Options passed to the cvs update command.")
   FIND_PROGRAM(SVNCOMMAND svn)
   FIND_PROGRAM(BZRCOMMAND bzr)
@@ -161,7 +161,7 @@ IF(BUILD_TESTING)
     SET(UPDATE_OPTIONS "${GIT_UPDATE_OPTIONS}")
   ENDIF()
 
-  SET(DART_TESTING_TIMEOUT 1500 CACHE STRING 
+  SET(DART_TESTING_TIMEOUT 1500 CACHE STRING
     "Maximum time allowed before CTest will kill the test.")
 
   SET(CTEST_SUBMIT_RETRY_DELAY 5 CACHE STRING
@@ -181,12 +181,12 @@ IF(BUILD_TESTING)
   FIND_PROGRAM(SLURM_SRUN_COMMAND srun DOC
     "Path to the SLURM srun executable"
     )
-  SET(MEMORYCHECK_SUPPRESSIONS_FILE "" CACHE FILEPATH 
+  SET(MEMORYCHECK_SUPPRESSIONS_FILE "" CACHE FILEPATH
     "File that contains suppressions for the memory checker")
-  FIND_PROGRAM(SCPCOMMAND scp DOC 
+  FIND_PROGRAM(SCPCOMMAND scp DOC
     "Path to scp command, used by CTest for submitting results to a Dart server"
     )
-  FIND_PROGRAM(COVERAGE_COMMAND gcov DOC 
+  FIND_PROGRAM(COVERAGE_COMMAND gcov DOC
     "Path to the coverage program that CTest uses for performing coverage inspection"
     )
   SET(COVERAGE_EXTRA_FLAGS "-l" CACHE STRING
@@ -215,10 +215,10 @@ IF(BUILD_TESTING)
       SET(BUILD_NAME_SYSTEM_NAME "Win32")
     ENDIF(WIN32)
     IF(UNIX OR BORLAND)
-      GET_FILENAME_COMPONENT(DART_CXX_NAME 
+      GET_FILENAME_COMPONENT(DART_CXX_NAME
         "${CMAKE_CXX_COMPILER}" ${DART_NAME_COMPONENT})
     ELSE(UNIX OR BORLAND)
-      GET_FILENAME_COMPONENT(DART_CXX_NAME 
+      GET_FILENAME_COMPONENT(DART_CXX_NAME
         "${CMAKE_BUILD_TOOL}" ${DART_NAME_COMPONENT})
     ENDIF(UNIX OR BORLAND)
     IF(DART_CXX_NAME MATCHES "msdev")
@@ -267,7 +267,7 @@ IF(BUILD_TESTING)
     DART_TESTING_TIMEOUT
     GITCOMMAND
     HGCOMMAND
-    MAKECOMMAND 
+    MAKECOMMAND
     MEMORYCHECK_COMMAND
     MEMORYCHECK_SUPPRESSIONS_FILE
     PURIFYCOMMAND
diff --git a/Modules/CTestScriptMode.cmake b/Modules/CTestScriptMode.cmake
index e459c1d59..42d3764cb 100644
--- a/Modules/CTestScriptMode.cmake
+++ b/Modules/CTestScriptMode.cmake
@@ -14,7 +14,7 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-# Determine the current system, so this information can be used 
+# Determine the current system, so this information can be used
 # in ctest scripts
 include(CMakeDetermineSystem)
 
diff --git a/Modules/CheckForPthreads.c b/Modules/CheckForPthreads.c
index d83107851..882dc21b7 100644
--- a/Modules/CheckForPthreads.c
+++ b/Modules/CheckForPthreads.c
@@ -15,7 +15,7 @@ int main(int ac, char*av[]){
   pthread_t tid[2];
   pthread_create(&tid[0], 0, runner, (void*)1);
   pthread_create(&tid[1], 0, runner, (void*)2);
-  
+
 #if defined(__BEOS__) && !defined(__ZETA__)  && !defined(__HAIKU__) // (no usleep on BeOS 5.)
   usleep(1); // for strange behavior on single-processor sun
 #endif
diff --git a/Modules/CheckIncludeFile.cmake b/Modules/CheckIncludeFile.cmake
index eb732d28b..07a5ef82d 100644
--- a/Modules/CheckIncludeFile.cmake
+++ b/Modules/CheckIncludeFile.cmake
@@ -3,8 +3,8 @@
 # - macro which checks the include file exists.
 #  INCLUDE  - name of include file
 #  VARIABLE - variable to return result
-#   
-# an optional third argument is the CFlags to add to the compile line 
+#
+# an optional third argument is the CFlags to add to the compile line
 # or you can use CMAKE_REQUIRED_FLAGS
 #
 # The following variables may be set before calling this macro to
@@ -49,10 +49,10 @@ MACRO(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
       ${CMAKE_BINARY_DIR}
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.c
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
-      CMAKE_FLAGS 
+      CMAKE_FLAGS
       -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILE_FLAGS}
       "${CHECK_INCLUDE_FILE_C_INCLUDE_DIRS}"
-      OUTPUT_VARIABLE OUTPUT) 
+      OUTPUT_VARIABLE OUTPUT)
 
     IF(${ARGC} EQUAL 3)
       SET(CMAKE_C_FLAGS ${CMAKE_C_FLAGS_SAVE})
@@ -61,14 +61,14 @@ MACRO(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
     IF(${VARIABLE})
       MESSAGE(STATUS "Looking for ${INCLUDE} - found")
       SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
+      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if the include file ${INCLUDE} "
         "exists passed with the following output:\n"
         "${OUTPUT}\n\n")
     ELSE(${VARIABLE})
       MESSAGE(STATUS "Looking for ${INCLUDE} - not found")
       SET(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
+      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if the include file ${INCLUDE} "
         "exists failed with the following output:\n"
         "${OUTPUT}\n\n")
diff --git a/Modules/CheckIncludeFileCXX.cmake b/Modules/CheckIncludeFileCXX.cmake
index c5d8f9aa2..f27d25340 100644
--- a/Modules/CheckIncludeFileCXX.cmake
+++ b/Modules/CheckIncludeFileCXX.cmake
@@ -3,8 +3,8 @@
 #
 #  INCLUDE  - name of include file
 #  VARIABLE - variable to return result
-#  
-# An optional third argument is the CFlags to add to the compile line 
+#
+# An optional third argument is the CFlags to add to the compile line
 # or you can use CMAKE_REQUIRED_FLAGS.
 #
 # The following variables may be set before calling this macro to
@@ -49,10 +49,10 @@ MACRO(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
       ${CMAKE_BINARY_DIR}
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
-      CMAKE_FLAGS 
+      CMAKE_FLAGS
       -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILE_FLAGS}
       "${CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS}"
-      OUTPUT_VARIABLE OUTPUT) 
+      OUTPUT_VARIABLE OUTPUT)
 
     IF(${ARGC} EQUAL 3)
       SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_SAVE})
@@ -61,14 +61,14 @@ MACRO(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
     IF(${VARIABLE})
       MESSAGE(STATUS "Looking for C++ include ${INCLUDE} - found")
       SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
+      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if the include file ${INCLUDE} "
         "exists passed with the following output:\n"
         "${OUTPUT}\n\n")
     ELSE(${VARIABLE})
       MESSAGE(STATUS "Looking for C++ include ${INCLUDE} - not found")
       SET(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
+      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if the include file ${INCLUDE} "
         "exists failed with the following output:\n"
         "${OUTPUT}\n\n")
diff --git a/Modules/CheckIncludeFiles.cmake b/Modules/CheckIncludeFiles.cmake
index a94644e6a..6901fbc5d 100644
--- a/Modules/CheckIncludeFiles.cmake
+++ b/Modules/CheckIncludeFiles.cmake
@@ -59,21 +59,21 @@ MACRO(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
       ${CMAKE_BINARY_DIR}
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.c
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
-      CMAKE_FLAGS 
+      CMAKE_FLAGS
       -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILES_FLAGS}
       "${CHECK_INCLUDE_FILES_INCLUDE_DIRS}"
       OUTPUT_VARIABLE OUTPUT)
     IF(${VARIABLE})
       MESSAGE(STATUS "Looking for ${_description} - found")
       SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
+      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if files ${INCLUDE} "
         "exist passed with the following output:\n"
         "${OUTPUT}\n\n")
     ELSE(${VARIABLE})
       MESSAGE(STATUS "Looking for ${_description} - not found.")
       SET(${VARIABLE} "" CACHE INTERNAL "Have includes ${INCLUDE}")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
+      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if files ${INCLUDE} "
         "exist failed with the following output:\n"
         "${OUTPUT}\nSource:\n${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
diff --git a/Modules/Dart.cmake b/Modules/Dart.cmake
index 870545471..e85f093ce 100644
--- a/Modules/Dart.cmake
+++ b/Modules/Dart.cmake
@@ -48,14 +48,14 @@ IF(BUILD_TESTING)
   INCLUDE(CTest)
   SET(RUN_FROM_DART)
 
-  FIND_PROGRAM(COMPRESSIONCOMMAND NAMES gzip compress zip 
+  FIND_PROGRAM(COMPRESSIONCOMMAND NAMES gzip compress zip
     DOC "Path to program used to compress files for transfer to the dart server")
   FIND_PROGRAM(GUNZIPCOMMAND gunzip DOC "Path to gunzip executable")
   FIND_PROGRAM(JAVACOMMAND java DOC "Path to java command, used by the Dart server to create html.")
-  OPTION(DART_VERBOSE_BUILD "Show the actual output of the build, or if off show a . for each 1024 bytes." 
+  OPTION(DART_VERBOSE_BUILD "Show the actual output of the build, or if off show a . for each 1024 bytes."
     OFF)
-  OPTION(DART_BUILD_ERROR_REPORT_LIMIT "Limit of reported errors, -1 reports all." -1 )  
-  OPTION(DART_BUILD_WARNING_REPORT_LIMIT "Limit of reported warnings, -1 reports all." -1 )  
+  OPTION(DART_BUILD_ERROR_REPORT_LIMIT "Limit of reported errors, -1 reports all." -1 )
+  OPTION(DART_BUILD_WARNING_REPORT_LIMIT "Limit of reported warnings, -1 reports all." -1 )
 
   SET(VERBOSE_BUILD ${DART_VERBOSE_BUILD})
   SET(BUILD_ERROR_REPORT_LIMIT ${DART_BUILD_ERROR_REPORT_LIMIT})
@@ -64,13 +64,13 @@ IF(BUILD_TESTING)
 
   MARK_AS_ADVANCED(
     COMPRESSIONCOMMAND
-    DART_BUILD_ERROR_REPORT_LIMIT     
-    DART_BUILD_WARNING_REPORT_LIMIT 
+    DART_BUILD_ERROR_REPORT_LIMIT
+    DART_BUILD_WARNING_REPORT_LIMIT
     DART_TESTING_TIMEOUT
     DART_VERBOSE_BUILD
     DELIVER_CONTINUOUS_EMAIL
     GUNZIPCOMMAND
-    JAVACOMMAND 
+    JAVACOMMAND
     )
 
   SET(HAVE_DART)
@@ -80,7 +80,7 @@ IF(BUILD_TESTING)
 
   #
   # Section #2:
-  # 
+  #
   # Make necessary directories and configure testing scripts
   #
   # find a tcl shell command
@@ -112,7 +112,7 @@ IF(BUILD_TESTING)
       SET(DART_EXPERIMENTAL_NAME "${DART_EXPERIMENTAL_NAME}${PROJECT_NAME}")
     ENDIF(DART_EXPERIMENTAL_USE_PROJECT_NAME)
   ENDIF (HAVE_DART)
-  
+
   SET(RUN_FROM_CTEST_OR_DART 1)
   INCLUDE(CTestTargets)
   SET(RUN_FROM_CTEST_OR_DART)
diff --git a/Modules/Documentation.cmake b/Modules/Documentation.cmake
index ffeb371cc..aff78c94f 100644
--- a/Modules/Documentation.cmake
+++ b/Modules/Documentation.cmake
@@ -33,10 +33,10 @@ IF (BUILD_DOCUMENTATION)
   FIND_PACKAGE(Perl)
   FIND_PACKAGE(Wget)
 
-  OPTION(DOCUMENTATION_HTML_HELP 
+  OPTION(DOCUMENTATION_HTML_HELP
     "Build the HTML Help file (CHM)." OFF)
 
-  OPTION(DOCUMENTATION_HTML_TARZ 
+  OPTION(DOCUMENTATION_HTML_TARZ
     "Build a compressed tar archive of the HTML doc." OFF)
 
   MARK_AS_ADVANCED(
@@ -44,7 +44,7 @@ IF (BUILD_DOCUMENTATION)
     DOCUMENTATION_HTML_TARZ
     )
 
-  # 
+  #
   # The documentation process is controled by a batch file.
   # We will probably need bash to create the custom target
   #
diff --git a/Modules/FindALSA.cmake b/Modules/FindALSA.cmake
index 4a0b69303..60b0f56e6 100644
--- a/Modules/FindALSA.cmake
+++ b/Modules/FindALSA.cmake
@@ -40,7 +40,7 @@ if(ALSA_INCLUDE_DIR AND EXISTS "${ALSA_INCLUDE_DIR}/alsa/version.h")
   unset(alsa_version_str)
 endif()
 
-# handle the QUIETLY and REQUIRED arguments and set ALSA_FOUND to TRUE if 
+# handle the QUIETLY and REQUIRED arguments and set ALSA_FOUND to TRUE if
 # all listed variables are TRUE
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALSA
diff --git a/Modules/FindAVIFile.cmake b/Modules/FindAVIFile.cmake
index 8b5b05ae3..a45ebf8b9 100644
--- a/Modules/FindAVIFile.cmake
+++ b/Modules/FindAVIFile.cmake
@@ -1,5 +1,5 @@
 # - Locate AVIFILE library and include paths
-# AVIFILE (http://avifile.sourceforge.net/)is a set of libraries for 
+# AVIFILE (http://avifile.sourceforge.net/)is a set of libraries for
 # i386 machines
 # to use various AVI codecs. Support is limited beyond Linux. Windows
 # provides native AVI support, and so doesn't need this library.
diff --git a/Modules/FindBZip2.cmake b/Modules/FindBZip2.cmake
index ce7f2555d..75ab50004 100644
--- a/Modules/FindBZip2.cmake
+++ b/Modules/FindBZip2.cmake
@@ -41,7 +41,7 @@ IF (BZIP2_INCLUDE_DIR AND EXISTS "${BZIP2_INCLUDE_DIR}/bzlib.h")
     STRING(REGEX REPLACE ".* bzip2/libbzip2 version ([0-9]+\\.[^ ]+) of [0-9]+ .*" "\\1" BZIP2_VERSION_STRING "${BZLIB_H}")
 ENDIF (BZIP2_INCLUDE_DIR AND EXISTS "${BZIP2_INCLUDE_DIR}/bzlib.h")
 
-# handle the QUIETLY and REQUIRED arguments and set BZip2_FOUND to TRUE if 
+# handle the QUIETLY and REQUIRED arguments and set BZip2_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(BZip2
diff --git a/Modules/FindBullet.cmake b/Modules/FindBullet.cmake
index c96755fa4..1c4a9dec4 100644
--- a/Modules/FindBullet.cmake
+++ b/Modules/FindBullet.cmake
@@ -29,7 +29,7 @@
 
 macro(_FIND_BULLET_LIBRARY _var)
   find_library(${_var}
-     NAMES 
+     NAMES
         ${ARGN}
      HINTS
         ${BULLET_ROOT}
@@ -68,7 +68,7 @@ _FIND_BULLET_LIBRARY(BULLET_SOFTBODY_LIBRARY        BulletSoftBody)
 _FIND_BULLET_LIBRARY(BULLET_SOFTBODY_LIBRARY_DEBUG  BulletSoftBody_Debug BulletSoftBody_d)
 
 
-# handle the QUIETLY and REQUIRED arguments and set BULLET_FOUND to TRUE if 
+# handle the QUIETLY and REQUIRED arguments and set BULLET_FOUND to TRUE if
 # all listed variables are TRUE
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Bullet DEFAULT_MSG
diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake
index cc00d53f4..5f2181a99 100644
--- a/Modules/FindCURL.cmake
+++ b/Modules/FindCURL.cmake
@@ -25,7 +25,7 @@ FIND_PATH(CURL_INCLUDE_DIR NAMES curl/curl.h)
 MARK_AS_ADVANCED(CURL_INCLUDE_DIR)
 
 # Look for the library.
-FIND_LIBRARY(CURL_LIBRARY NAMES 
+FIND_LIBRARY(CURL_LIBRARY NAMES
     curl
   # Windows MSVC prebuilts:
     curllib
@@ -46,7 +46,7 @@ IF(CURL_INCLUDE_DIR)
   ENDFOREACH(_curl_version_header)
 ENDIF()
 
-# handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if 
+# handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL
diff --git a/Modules/FindCVS.cmake b/Modules/FindCVS.cmake
index 57680bd97..84bcaa19c 100644
--- a/Modules/FindCVS.cmake
+++ b/Modules/FindCVS.cmake
@@ -24,31 +24,31 @@
 
 get_filename_component(
   CVSNT_TypeLib_Win32
-  "[HKEY_CLASSES_ROOT\\TypeLib\\{2BDF7A65-0BFE-4B1A-9205-9AB900C7D0DA}\\1.0\\0\\win32]" 
+  "[HKEY_CLASSES_ROOT\\TypeLib\\{2BDF7A65-0BFE-4B1A-9205-9AB900C7D0DA}\\1.0\\0\\win32]"
   PATH)
 
 get_filename_component(
   CVSNT_Services_EventMessagePath
-  "[HKEY_LOCAL_MACHINE\\SYSTEM\\ControlSet001\\Services\\Eventlog\\Application\\cvsnt;EventMessageFile]" 
+  "[HKEY_LOCAL_MACHINE\\SYSTEM\\ControlSet001\\Services\\Eventlog\\Application\\cvsnt;EventMessageFile]"
   PATH)
 
 # WinCVS (in case CVSNT was installed in the same directory)
 
 get_filename_component(
   WinCVS_Folder_Command
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\Folder\\shell\\wincvs\\command]" 
+  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\Folder\\shell\\wincvs\\command]"
   PATH)
 
 # TortoiseCVS (in case CVSNT was installed in the same directory)
 
 get_filename_component(
   TortoiseCVS_Folder_Command
-  "[HKEY_CLASSES_ROOT\\CVS\\shell\\open\\command]" 
+  "[HKEY_CLASSES_ROOT\\CVS\\shell\\open\\command]"
   PATH)
 
 get_filename_component(
   TortoiseCVS_DefaultIcon
-  "[HKEY_CLASSES_ROOT\\CVS\\DefaultIcon]" 
+  "[HKEY_CLASSES_ROOT\\CVS\\DefaultIcon]"
   PATH)
 
 find_program(CVS_EXECUTABLE cvs
@@ -62,7 +62,7 @@ find_program(CVS_EXECUTABLE cvs
   )
 mark_as_advanced(CVS_EXECUTABLE)
 
-# Handle the QUIETLY and REQUIRED arguments and set CVS_FOUND to TRUE if 
+# Handle the QUIETLY and REQUIRED arguments and set CVS_FOUND to TRUE if
 # all listed variables are TRUE
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
diff --git a/Modules/FindCoin3D.cmake b/Modules/FindCoin3D.cmake
index 8bfe97acc..2b4c914f4 100644
--- a/Modules/FindCoin3D.cmake
+++ b/Modules/FindCoin3D.cmake
@@ -59,22 +59,22 @@ IF (WIN32)
 ELSE (WIN32)
   IF(APPLE)
     FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h
-     /Library/Frameworks/Inventor.framework/Headers 
+     /Library/Frameworks/Inventor.framework/Headers
     )
     FIND_LIBRARY(COIN3D_LIBRARIES Coin
       /Library/Frameworks/Inventor.framework/Libraries
-    )   
+    )
     SET(COIN3D_LIBRARIES "-framework Coin3d" CACHE STRING "Coin3D library for OSX")
   ELSE(APPLE)
 
     FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h)
-    FIND_LIBRARY(COIN3D_LIBRARIES Coin)   
+    FIND_LIBRARY(COIN3D_LIBRARIES Coin)
 
   ENDIF(APPLE)
 
 ENDIF (WIN32)
 
-# handle the QUIETLY and REQUIRED arguments and set COIN3D_FOUND to TRUE if 
+# handle the QUIETLY and REQUIRED arguments and set COIN3D_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Coin3D DEFAULT_MSG COIN3D_LIBRARIES COIN3D_INCLUDE_DIRS)
diff --git a/Modules/FindCups.cmake b/Modules/FindCups.cmake
index 3862f7ddf..05d2c270b 100644
--- a/Modules/FindCups.cmake
+++ b/Modules/FindCups.cmake
@@ -5,7 +5,7 @@
 #  CUPS_INCLUDE_DIR - the Cups include directory
 #  CUPS_LIBRARIES - Libraries needed to use Cups
 #  CUPS_VERSION_STRING - version of Cups found (since CMake 2.8.8)
-#  Set CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE to TRUE if you need a version which 
+#  Set CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE to TRUE if you need a version which
 #  features this function (i.e. at least 1.1.19)
 
 #=============================================================================
@@ -65,5 +65,5 @@ else (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE)
                                       REQUIRED_VARS CUPS_LIBRARIES CUPS_INCLUDE_DIR
                                       VERSION_VAR CUPS_VERSION_STRING)
 endif (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE)
-  
+
 mark_as_advanced(CUPS_INCLUDE_DIR CUPS_LIBRARIES)
diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake
index d1e13116d..0ea5166d2 100644
--- a/Modules/FindCurses.cmake
+++ b/Modules/FindCurses.cmake
@@ -9,7 +9,7 @@
 #  CURSES_HAVE_NCURSES_CURSES_H - true if ncurses/curses.h is available
 #  CURSES_LIBRARY - set for backwards compatibility with 2.4 CMake
 #
-# Set CURSES_NEED_NCURSES to TRUE before the FIND_PACKAGE() command if NCurses 
+# Set CURSES_NEED_NCURSES to TRUE before the FIND_PACKAGE() command if NCurses
 # functionality is required.
 
 #=============================================================================
@@ -53,15 +53,15 @@ ENDIF()
 # some web pages also say that even with ncurses there is not always a ncurses.h:
 # http://osdir.com/ml/gnome.apps.mc.devel/2002-06/msg00029.html
 # So at first try ncurses.h, if not found, try to find curses.h under the same
-# prefix as the library was found, if still not found, try curses.h with the 
+# prefix as the library was found, if still not found, try curses.h with the
 # default search paths.
 IF(CURSES_CURSES_LIBRARY  AND  CURSES_NEED_NCURSES)
   INCLUDE(CheckLibraryExists)
-  CHECK_LIBRARY_EXISTS("${CURSES_CURSES_LIBRARY}" 
+  CHECK_LIBRARY_EXISTS("${CURSES_CURSES_LIBRARY}"
     wsyncup "" CURSES_CURSES_HAS_WSYNCUP)
 
   IF(CURSES_NCURSES_LIBRARY  AND NOT  CURSES_CURSES_HAS_WSYNCUP)
-    CHECK_LIBRARY_EXISTS("${CURSES_NCURSES_LIBRARY}" 
+    CHECK_LIBRARY_EXISTS("${CURSES_NCURSES_LIBRARY}"
       wsyncup "" CURSES_NCURSES_HAS_WSYNCUP)
     IF( CURSES_NCURSES_HAS_WSYNCUP)
       SET(CURSES_USE_NCURSES TRUE)
@@ -79,7 +79,7 @@ IF(NOT CURSES_USE_NCURSES)
 
   # for compatibility with older FindCurses.cmake this has to be in the cache
   # FORCE must not be used since this would break builds which preload a cache wqith these variables set
-  SET(CURSES_INCLUDE_PATH "${CURSES_CURSES_H_PATH}" 
+  SET(CURSES_INCLUDE_PATH "${CURSES_CURSES_H_PATH}"
     CACHE FILEPATH "The curses include path")
   SET(CURSES_LIBRARY "${CURSES_CURSES_LIBRARY}"
     CACHE FILEPATH "The curses library")
@@ -91,23 +91,23 @@ ELSE(NOT CURSES_USE_NCURSES)
   FIND_FILE(CURSES_HAVE_NCURSES_H         ncurses.h)
   FIND_FILE(CURSES_HAVE_NCURSES_NCURSES_H ncurses/ncurses.h)
   FIND_FILE(CURSES_HAVE_NCURSES_CURSES_H  ncurses/curses.h)
-  FIND_FILE(CURSES_HAVE_CURSES_H          curses.h 
+  FIND_FILE(CURSES_HAVE_CURSES_H          curses.h
     HINTS "${_cursesParentDir}/include")
 
-  FIND_PATH(CURSES_NCURSES_INCLUDE_PATH ncurses.h ncurses/ncurses.h 
+  FIND_PATH(CURSES_NCURSES_INCLUDE_PATH ncurses.h ncurses/ncurses.h
     ncurses/curses.h)
   FIND_PATH(CURSES_NCURSES_INCLUDE_PATH curses.h
     HINTS "${_cursesParentDir}/include")
 
   # for compatibility with older FindCurses.cmake this has to be in the cache
   # FORCE must not be used since this would break builds which preload
-  # however if the value of the variable has NOTFOUND in it, then 
+  # however if the value of the variable has NOTFOUND in it, then
   # it is OK to force, and we need to force in order to have it work.
   # a cache wqith these variables set
-  # only put ncurses include and library into 
+  # only put ncurses include and library into
   # variables if they are found
   IF(NOT CURSES_NCURSES_INCLUDE_PATH AND CURSES_HAVE_NCURSES_NCURSES_H)
-    GET_FILENAME_COMPONENT(CURSES_NCURSES_INCLUDE_PATH 
+    GET_FILENAME_COMPONENT(CURSES_NCURSES_INCLUDE_PATH
       "${CURSES_HAVE_NCURSES_NCURSES_H}" PATH)
   ENDIF(NOT CURSES_NCURSES_INCLUDE_PATH AND CURSES_HAVE_NCURSES_NCURSES_H)
   IF(CURSES_NCURSES_INCLUDE_PATH AND CURSES_NCURSES_LIBRARY)
@@ -115,13 +115,13 @@ ELSE(NOT CURSES_USE_NCURSES)
     IF(CURSES_INCLUDE_PATH MATCHES NOTFOUND)
       SET(FORCE_IT FORCE)
     ENDIF(CURSES_INCLUDE_PATH MATCHES NOTFOUND)
-    SET(CURSES_INCLUDE_PATH "${CURSES_NCURSES_INCLUDE_PATH}" 
+    SET(CURSES_INCLUDE_PATH "${CURSES_NCURSES_INCLUDE_PATH}"
       CACHE FILEPATH "The curses include path" ${FORCE_IT})
     SET( FORCE_IT)
     IF(CURSES_LIBRARY MATCHES NOTFOUND)
       SET(FORCE_IT FORCE)
     ENDIF(CURSES_LIBRARY MATCHES NOTFOUND)
-    SET(CURSES_LIBRARY "${CURSES_NCURSES_LIBRARY}" 
+    SET(CURSES_LIBRARY "${CURSES_NCURSES_LIBRARY}"
       CACHE FILEPATH "The curses library" ${FORCE_IT})
   ENDIF(CURSES_NCURSES_INCLUDE_PATH AND CURSES_NCURSES_LIBRARY)
 
@@ -136,7 +136,7 @@ FIND_LIBRARY(CURSES_FORM_LIBRARY form )
 # for compatibility with older FindCurses.cmake this has to be in the cache
 # FORCE must not be used since this would break builds which preload a cache
 # qith these variables set
-SET(FORM_LIBRARY "${CURSES_FORM_LIBRARY}"         
+SET(FORM_LIBRARY "${CURSES_FORM_LIBRARY}"
   CACHE FILEPATH "The curses form library")
 
 # Need to provide the *_LIBRARIES
@@ -153,7 +153,7 @@ ENDIF(CURSES_FORM_LIBRARY)
 # Proper name is *_INCLUDE_DIR
 SET(CURSES_INCLUDE_DIR ${CURSES_INCLUDE_PATH})
 
-# handle the QUIETLY and REQUIRED arguments and set CURSES_FOUND to TRUE if 
+# handle the QUIETLY and REQUIRED arguments and set CURSES_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Curses DEFAULT_MSG
diff --git a/Modules/FindCxxTest.cmake b/Modules/FindCxxTest.cmake
index a4d150493..4207961d0 100644
--- a/Modules/FindCxxTest.cmake
+++ b/Modules/FindCxxTest.cmake
@@ -49,7 +49,7 @@
 #           input_files_to_testgen  The list of header files containing the
 #                                   CxxTest::TestSuite's to be included in
 #                                   this runner
-#           
+#
 #       #==============
 #       Example Usage:
 #
@@ -67,13 +67,13 @@
 #              1. Invoke the testgen executable to autogenerate foo_test.cc in the
 #                 binary tree from "foo_test.h" in the current source directory.
 #              2. Create an executable and test called unittest_foo.
-#               
+#
 #      #=============
 #      Example foo_test.h:
 #
 #          #include <cxxtest/TestSuite.h>
-#          
-#          class MyTestSuite : public CxxTest::TestSuite 
+#
+#          class MyTestSuite : public CxxTest::TestSuite
 #          {
 #          public:
 #             void testAddition( void )
diff --git a/Modules/FindDart.cmake b/Modules/FindDart.cmake
index f7c54df43..caca4b868 100644
--- a/Modules/FindDart.cmake
+++ b/Modules/FindDart.cmake
@@ -16,14 +16,14 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PATH(DART_ROOT README.INSTALL 
+FIND_PATH(DART_ROOT README.INSTALL
     $ENV{DART_ROOT}
-    ${PROJECT_SOURCE_DIR}/Dart 
-     /usr/share/Dart 
-    C:/Dart  
+    ${PROJECT_SOURCE_DIR}/Dart
+     /usr/share/Dart
+    C:/Dart
     "$ENV{ProgramFiles}/Dart"
-    "C:/Program Files/Dart" 
-    ${PROJECT_SOURCE_DIR}/../Dart 
+    "C:/Program Files/Dart"
+    ${PROJECT_SOURCE_DIR}/../Dart
     [HKEY_LOCAL_MACHINE\\SOFTWARE\\Dart\\InstallPath]
     DOC "If you have Dart installed, where is it located?"
     )
diff --git a/Modules/FindDevIL.cmake b/Modules/FindDevIL.cmake
index 4a0fbe064..ebfe29898 100644
--- a/Modules/FindDevIL.cmake
+++ b/Modules/FindDevIL.cmake
@@ -38,7 +38,7 @@
 
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 
-FIND_PATH(IL_INCLUDE_DIR il.h 
+FIND_PATH(IL_INCLUDE_DIR il.h
   PATH_SUFFIXES include IL
   DOC "The path the the directory that contains il.h"
 )
@@ -69,6 +69,6 @@ FIND_LIBRARY(ILU_LIBRARIES
 
 #MESSAGE("ILU_LIBRARIES is ${ILU_LIBRARIES}")
 
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(IL DEFAULT_MSG 
-                                  IL_LIBRARIES ILU_LIBRARIES 
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(IL DEFAULT_MSG
+                                  IL_LIBRARIES ILU_LIBRARIES
                                   ILUT_LIBRARIES IL_INCLUDE_DIR)
diff --git a/Modules/FindDoxygen.cmake b/Modules/FindDoxygen.cmake
index 6cc9efb18..a004d7b65 100644
--- a/Modules/FindDoxygen.cmake
+++ b/Modules/FindDoxygen.cmake
@@ -39,13 +39,13 @@ ENDIF(Doxygen_FIND_QUIETLY)
 
 # ===== Rationale for OS X AppBundle mods below =====
 #     With the OS X GUI version, Doxygen likes to be installed to /Applications and
-#     it contains the doxygen executable in the bundle. In the versions I've 
-#     seen, it is located in Resources, but in general, more often binaries are 
+#     it contains the doxygen executable in the bundle. In the versions I've
+#     seen, it is located in Resources, but in general, more often binaries are
 #     located in MacOS.
 #
-#     NOTE: The official Doxygen.app that is distributed for OS X uses non-standard 
+#     NOTE: The official Doxygen.app that is distributed for OS X uses non-standard
 #     conventions.  Instead of the command-line "doxygen" tool being placed in
-#     Doxygen.app/Contents/MacOS, "Doxywizard" is placed there instead and 
+#     Doxygen.app/Contents/MacOS, "Doxywizard" is placed there instead and
 #     "doxygen" is placed in Contents/Resources.  This is most likely done
 #     so that something happens when people double-click on the Doxygen.app
 #     package.  Unfortunately, CMake gets confused by this as when it sees the
@@ -59,7 +59,7 @@ if(APPLE)
     SET(CMAKE_FIND_APPBUNDLE "NEVER")
 endif()
 #     FYI:
-#     In the older versions of OS X Doxygen, dot was included with the 
+#     In the older versions of OS X Doxygen, dot was included with the
 #     Doxygen bundle. But the new versions require you to download
 #     Graphviz.app which contains "dot" in it's bundle.
 # ============== End OSX stuff ================
@@ -91,7 +91,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Doxygen REQUIRED_VARS DOXYGEN_EXECUTABLE VERSI
 IF(NOT DOXYGEN_SKIP_DOT)
   FIND_PROGRAM(DOXYGEN_DOT_EXECUTABLE
     NAMES dot
-    PATHS 
+    PATHS
       "$ENV{ProgramFiles}/Graphviz 2.21/bin"
       "C:/Program Files/Graphviz 2.21/bin"
       "$ENV{ProgramFiles}/ATT/Graphviz/bin"
@@ -102,13 +102,13 @@ IF(NOT DOXYGEN_SKIP_DOT)
       /Applications/Doxygen.app/Contents/MacOS
     DOC "Graphviz Dot tool for using Doxygen"
   )
-  
+
   if(DOXYGEN_DOT_EXECUTABLE)
     set(DOXYGEN_DOT_FOUND TRUE)
     # The Doxyfile wants the path to Dot, not the entire path and executable
     get_filename_component(DOXYGEN_DOT_PATH "${DOXYGEN_DOT_EXECUTABLE}" PATH CACHE)
   endif()
-  
+
 endif(NOT DOXYGEN_SKIP_DOT)
 
 #
diff --git a/Modules/FindEXPAT.cmake b/Modules/FindEXPAT.cmake
index 1bf074357..7a6dbbbd9 100644
--- a/Modules/FindEXPAT.cmake
+++ b/Modules/FindEXPAT.cmake
@@ -44,7 +44,7 @@ if (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h")
     endforeach(VPART)
 endif (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h")
 
-# handle the QUIETLY and REQUIRED arguments and set EXPAT_FOUND to TRUE if 
+# handle the QUIETLY and REQUIRED arguments and set EXPAT_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(EXPAT
diff --git a/Modules/FindFLTK.cmake b/Modules/FindFLTK.cmake
index bdea95bdc..8a656f627 100644
--- a/Modules/FindFLTK.cmake
+++ b/Modules/FindFLTK.cmake
@@ -136,8 +136,8 @@ ENDIF(NOT FLTK_DIR)
     # Fluid
     IF(FLUID_COMMAND)
       SET(FLTK_FLUID_EXECUTABLE ${FLUID_COMMAND} CACHE FILEPATH "Fluid executable")
-    ELSE(FLUID_COMMAND) 
-      FIND_PROGRAM(FLTK_FLUID_EXECUTABLE fluid PATHS 
+    ELSE(FLUID_COMMAND)
+      FIND_PROGRAM(FLTK_FLUID_EXECUTABLE fluid PATHS
         ${FLTK_EXECUTABLE_DIRS}
         ${FLTK_EXECUTABLE_DIRS}/RelWithDebInfo
         ${FLTK_EXECUTABLE_DIRS}/Debug
@@ -220,10 +220,10 @@ ENDIF(NOT FLTK_DIR)
       ${_FLTK_POSSIBLE_INCLUDE_DIRS}
       )
 
-    FIND_PATH(FLTK_INCLUDE_DIR 
+    FIND_PATH(FLTK_INCLUDE_DIR
         NAMES FL/Fl.h FL/Fl.H    # fltk 1.1.9 has Fl.H (#8376)
         PATHS ${FLTK_INCLUDE_SEARCH_PATH})
-    
+
     #
     # Try to find FLTK library
     IF(UNIX)
diff --git a/Modules/FindFLTK2.cmake b/Modules/FindFLTK2.cmake
index 916474579..c6a978807 100644
--- a/Modules/FindFLTK2.cmake
+++ b/Modules/FindFLTK2.cmake
@@ -122,10 +122,10 @@ IF(FLTK2_DIR)
     INCLUDE(${FLTK2_DIR}/FLTK2Config.cmake)
 
     # Fluid
-    IF(FLUID_COMMAND) 
+    IF(FLUID_COMMAND)
       SET(FLTK2_FLUID_EXECUTABLE ${FLUID_COMMAND} CACHE FILEPATH "Fluid executable")
-    ELSE(FLUID_COMMAND) 
-      FIND_PROGRAM(FLTK2_FLUID_EXECUTABLE fluid2 PATHS 
+    ELSE(FLUID_COMMAND)
+      FIND_PROGRAM(FLTK2_FLUID_EXECUTABLE fluid2 PATHS
         ${FLTK2_EXECUTABLE_DIRS}
         ${FLTK2_EXECUTABLE_DIRS}/RelWithDebInfo
         ${FLTK2_EXECUTABLE_DIRS}/Debug
@@ -136,7 +136,7 @@ IF(FLTK2_DIR)
     MARK_AS_ADVANCED(FLTK2_FLUID_EXECUTABLE)
     SET( FLTK_FLUID_EXECUTABLE ${FLTK2_FLUID_EXECUTABLE} )
 
-    
+
 
 
     SET(FLTK2_INCLUDE_DIR ${FLTK2_DIR})
@@ -201,7 +201,7 @@ IF(FLTK2_DIR)
 
     FIND_LIBRARY(FLTK2_BASE_LIBRARY NAMES fltk2
       PATHS ${FLTK2_LIBRARY_SEARCH_PATH})
-    FIND_LIBRARY(FLTK2_GL_LIBRARY NAMES fltk2_gl 
+    FIND_LIBRARY(FLTK2_GL_LIBRARY NAMES fltk2_gl
       PATHS ${FLTK2_LIBRARY_SEARCH_PATH})
     FIND_LIBRARY(FLTK2_IMAGES_LIBRARY NAMES fltk2_images
       PATHS ${FLTK2_LIBRARY_SEARCH_PATH})
diff --git a/Modules/FindGDAL.cmake b/Modules/FindGDAL.cmake
index c31bef5ca..3b42a33d4 100644
--- a/Modules/FindGDAL.cmake
+++ b/Modules/FindGDAL.cmake
@@ -28,12 +28,12 @@
 # correspond to the ./configure --prefix=$GDAL_DIR
 # used in building gdal.
 #
-# Created by Eric Wing. I'm not a gdal user, but OpenSceneGraph uses it 
+# Created by Eric Wing. I'm not a gdal user, but OpenSceneGraph uses it
 # for osgTerrain so I whipped this module together for completeness.
 # I actually don't know the conventions or where files are typically
 # placed in distros.
 # Any real gdal users are encouraged to correct this (but please don't
-# break the OS X framework stuff when doing so which is what usually seems 
+# break the OS X framework stuff when doing so which is what usually seems
 # to happen).
 
 # This makes the presumption that you are include gdal.h like
@@ -85,7 +85,7 @@ IF(UNIX)
     endif()
 endif()
 
-FIND_LIBRARY(GDAL_LIBRARY 
+FIND_LIBRARY(GDAL_LIBRARY
   NAMES ${_gdal_lib} gdal gdal_i gdal1.5.0 gdal1.4.0 gdal1.3.2 GDAL
   HINTS
      $ENV{GDAL_DIR}
diff --git a/Modules/FindGLUT.cmake b/Modules/FindGLUT.cmake
index 82057792d..cfa137516 100644
--- a/Modules/FindGLUT.cmake
+++ b/Modules/FindGLUT.cmake
@@ -21,7 +21,7 @@
 #  License text for the above reference.)
 
 IF (WIN32)
-  FIND_PATH( GLUT_INCLUDE_DIR NAMES GL/glut.h 
+  FIND_PATH( GLUT_INCLUDE_DIR NAMES GL/glut.h
     PATHS  ${GLUT_ROOT_PATH}/include )
   FIND_LIBRARY( GLUT_glut_LIBRARY NAMES glut glut32 freeglut
     PATHS
@@ -29,17 +29,17 @@ IF (WIN32)
     ${GLUT_ROOT_PATH}/Release
     )
 ELSE (WIN32)
-  
+
   IF (APPLE)
     # These values for Apple could probably do with improvement.
     FIND_PATH( GLUT_INCLUDE_DIR glut.h
       /System/Library/Frameworks/GLUT.framework/Versions/A/Headers
       ${OPENGL_LIBRARY_DIR}
       )
-    SET(GLUT_glut_LIBRARY "-framework GLUT" CACHE STRING "GLUT library for OSX") 
+    SET(GLUT_glut_LIBRARY "-framework GLUT" CACHE STRING "GLUT library for OSX")
     SET(GLUT_cocoa_LIBRARY "-framework Cocoa" CACHE STRING "Cocoa framework for OSX")
   ELSE (APPLE)
-    
+
     FIND_PATH( GLUT_INCLUDE_DIR GL/glut.h
       /usr/include/GL
       /usr/openwin/share/include
@@ -47,21 +47,21 @@ ELSE (WIN32)
       /opt/graphics/OpenGL/include
       /opt/graphics/OpenGL/contrib/libglut
       )
-  
+
     FIND_LIBRARY( GLUT_glut_LIBRARY glut
       /usr/openwin/lib
       )
-    
+
     FIND_LIBRARY( GLUT_Xi_LIBRARY Xi
       /usr/openwin/lib
       )
-    
+
     FIND_LIBRARY( GLUT_Xmu_LIBRARY Xmu
       /usr/openwin/lib
       )
-    
+
   ENDIF (APPLE)
-  
+
 ENDIF (WIN32)
 
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
@@ -76,7 +76,7 @@ IF (GLUT_FOUND)
     ${GLUT_Xi_LIBRARY}
     ${GLUT_cocoa_LIBRARY}
     )
-    
+
   #The following deprecated settings are for backwards compatibility with CMake1.4
   SET (GLUT_LIBRARY ${GLUT_LIBRARIES})
   SET (GLUT_INCLUDE_PATH ${GLUT_INCLUDE_DIR})
diff --git a/Modules/FindGTK.cmake b/Modules/FindGTK.cmake
index e9cc62f20..3fa75a640 100644
--- a/Modules/FindGTK.cmake
+++ b/Modules/FindGTK.cmake
@@ -89,11 +89,11 @@ IF(UNIX)
            /opt/gnome/lib
   )
 
-  FIND_LIBRARY( GTK_Xi_LIBRARY 
-    NAMES Xi 
-    PATHS /usr/openwin/lib 
-          /opt/gnome/lib 
-    ) 
+  FIND_LIBRARY( GTK_Xi_LIBRARY
+    NAMES Xi
+    PATHS /usr/openwin/lib
+          /opt/gnome/lib
+    )
 
   FIND_LIBRARY( GTK_gthread_LIBRARY
     NAMES  gthread gthread12
diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake
index 5fe52134a..f734b3b59 100644
--- a/Modules/FindGTK2.cmake
+++ b/Modules/FindGTK2.cmake
@@ -119,7 +119,7 @@ function(_GTK2_GET_VERSION _OUT_major _OUT_minor _OUT_micro _gtkversion_hdr)
         string(REGEX REPLACE ".*#define GTK_MAJOR_VERSION[ \t]+\\(([0-9]+)\\).*" "\\1" ${_OUT_major} "${_contents}")
         string(REGEX REPLACE ".*#define GTK_MINOR_VERSION[ \t]+\\(([0-9]+)\\).*" "\\1" ${_OUT_minor} "${_contents}")
         string(REGEX REPLACE ".*#define GTK_MICRO_VERSION[ \t]+\\(([0-9]+)\\).*" "\\1" ${_OUT_micro} "${_contents}")
-        
+
         if(NOT ${_OUT_major} MATCHES "[0-9]+")
             message(FATAL_ERROR "Version parsing failed for GTK2_MAJOR_VERSION!")
         endif()
@@ -269,7 +269,7 @@ function(_GTK2_FIND_LIBRARY _var _lib _expand_vc _append_version)
         set(_lib_list ${_library})
         set(_libd_list ${_library_d})
     endif()
-    
+
     if(GTK2_DEBUG)
         message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}]     "
                        "library list = ${_lib_list} and library debug list = ${_libd_list}")
@@ -301,7 +301,7 @@ function(_GTK2_FIND_LIBRARY _var _lib _expand_vc _append_version)
                        "While searching for ${_var}, our proposed library list is ${_lib_list}")
     endif()
 
-    find_library(${_var} 
+    find_library(${_var}
         NAMES ${_lib_list}
         PATHS
             /opt/gnome/lib
@@ -403,8 +403,8 @@ if(GTK2_FIND_VERSION)
             else()
                 message(FATAL_ERROR "GTK2 version check failed.  Version ${GTK2_VERSION} was found, at least version ${GTK2_FIND_VERSION} is required")
             endif()
-        endif()    
-        
+        endif()
+
         # If the version check fails, exit out of the module here
         return()
     endif()
@@ -423,7 +423,7 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
         _GTK2_FIND_INCLUDE_DIR(GTK2_GLIB_INCLUDE_DIR glib.h)
         _GTK2_FIND_INCLUDE_DIR(GTK2_GLIBCONFIG_INCLUDE_DIR glibconfig.h)
         _GTK2_FIND_LIBRARY    (GTK2_GLIB_LIBRARY glib false true)
-        
+
         _GTK2_FIND_INCLUDE_DIR(GTK2_GOBJECT_INCLUDE_DIR gobject/gobject.h)
         _GTK2_FIND_LIBRARY    (GTK2_GOBJECT_LIBRARY gobject false true)
 
@@ -490,7 +490,7 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
 
         _GTK2_FIND_INCLUDE_DIR(GTK2_GLADE_INCLUDE_DIR glade/glade.h)
         _GTK2_FIND_LIBRARY    (GTK2_GLADE_LIBRARY glade false true)
-    
+
     elseif(_GTK2_component STREQUAL "glademm")
 
         _GTK2_FIND_INCLUDE_DIR(GTK2_GLADEMM_INCLUDE_DIR libglademm.h)
diff --git a/Modules/FindGnuTLS.cmake b/Modules/FindGnuTLS.cmake
index 02f29648a..617f58f26 100644
--- a/Modules/FindGnuTLS.cmake
+++ b/Modules/FindGnuTLS.cmake
@@ -55,7 +55,7 @@ FIND_LIBRARY(GNUTLS_LIBRARY NAMES gnutls libgnutls
 
 MARK_AS_ADVANCED(GNUTLS_INCLUDE_DIR GNUTLS_LIBRARY)
 
-# handle the QUIETLY and REQUIRED arguments and set GNUTLS_FOUND to TRUE if 
+# handle the QUIETLY and REQUIRED arguments and set GNUTLS_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(GnuTLS
diff --git a/Modules/FindGnuplot.cmake b/Modules/FindGnuplot.cmake
index b8dc3f49a..d5730476d 100644
--- a/Modules/FindGnuplot.cmake
+++ b/Modules/FindGnuplot.cmake
@@ -24,7 +24,7 @@
 INCLUDE(FindCygwin)
 
 FIND_PROGRAM(GNUPLOT_EXECUTABLE
-  NAMES 
+  NAMES
   gnuplot
   pgnuplot
   wgnupl32
@@ -46,7 +46,7 @@ ENDIF()
 # for compatibility
 SET(GNUPLOT ${GNUPLOT_EXECUTABLE})
 
-# handle the QUIETLY and REQUIRED arguments and set GNUPLOT_FOUND to TRUE if 
+# handle the QUIETLY and REQUIRED arguments and set GNUPLOT_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gnuplot
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index bc606389b..33599becf 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -25,7 +25,7 @@
 # In addition to finding the includes and libraries required to compile an HDF5
 # client application, this module also makes an effort to find tools that come
 # with the HDF5 distribution that may be useful for regression testing.
-# 
+#
 # This module will define the following variables:
 #  HDF5_INCLUDE_DIRS - Location of the hdf5 includes
 #  HDF5_INCLUDE_DIR - Location of the hdf5 includes (deprecated)
@@ -64,7 +64,7 @@ include(SelectLibraryConfigurations)
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 
 # List of the valid HDF5 components
-set( HDF5_VALID_COMPONENTS 
+set( HDF5_VALID_COMPONENTS
     C
     CXX
     Fortran
@@ -110,10 +110,10 @@ find_program( HDF5_Fortran_COMPILER_EXECUTABLE
     DOC "HDF5 Fortran Wrapper compiler.  Used only to detect HDF5 compile flags." )
 mark_as_advanced( HDF5_Fortran_COMPILER_EXECUTABLE )
 
-find_program( HDF5_DIFF_EXECUTABLE 
+find_program( HDF5_DIFF_EXECUTABLE
     NAMES h5diff
     HINTS ENV HDF5_ROOT
-    PATH_SUFFIXES bin Bin 
+    PATH_SUFFIXES bin Bin
     DOC "HDF5 file differencing tool." )
 mark_as_advanced( HDF5_DIFF_EXECUTABLE )
 
@@ -121,7 +121,7 @@ mark_as_advanced( HDF5_DIFF_EXECUTABLE )
 # return_value argument, the text output is stored to the output variable.
 macro( _HDF5_invoke_compiler language output return_value )
     if( HDF5_${language}_COMPILER_EXECUTABLE )
-        exec_program( ${HDF5_${language}_COMPILER_EXECUTABLE} 
+        exec_program( ${HDF5_${language}_COMPILER_EXECUTABLE}
             ARGS -show
             OUTPUT_VARIABLE ${output}
             RETURN_VALUE ${return_value}
@@ -129,14 +129,14 @@ macro( _HDF5_invoke_compiler language output return_value )
         if( ${${return_value}} EQUAL 0 )
             # do nothing
         else()
-            message( STATUS 
+            message( STATUS
               "Unable to determine HDF5 ${language} flags from HDF5 wrapper." )
         endif()
     endif()
 endmacro()
 
 # Parse a compile line for definitions, includes, library paths, and libraries.
-macro( _HDF5_parse_compile_line 
+macro( _HDF5_parse_compile_line
     compile_line_var
     include_paths
     definitions
@@ -144,7 +144,7 @@ macro( _HDF5_parse_compile_line
     libraries )
 
     # Match the include paths
-    string( REGEX MATCHALL "-I([^\" ]+)" include_path_flags 
+    string( REGEX MATCHALL "-I([^\" ]+)" include_path_flags
         "${${compile_line_var}}"
     )
     foreach( IPATH ${include_path_flags} )
@@ -163,7 +163,7 @@ macro( _HDF5_parse_compile_line
     string( REGEX MATCHALL "-L([^\" ]+|\"[^\"]+\")" library_path_flags
         "${${compile_line_var}}"
     )
-    
+
     foreach( LPATH ${library_path_flags} )
         string( REGEX REPLACE "^-L" "" LPATH ${LPATH} )
         string( REGEX REPLACE "//" "/" LPATH ${LPATH} )
@@ -219,7 +219,7 @@ if( NOT HDF5_FOUND )
         ${HDF5_C_LIBRARY_NAMES_INIT} )
     set( HDF5_Fortran_HL_LIBRARY_NAMES_INIT hdf5hl_fortran
         ${HDF5_Fortran_LIBRARY_NAMES_INIT} )
-    
+
     foreach( LANGUAGE ${HDF5_LANGUAGE_BINDINGS} )
         if( HDF5_${LANGUAGE}_COMPILE_LINE )
             _HDF5_parse_compile_line( HDF5_${LANGUAGE}_COMPILE_LINE
@@ -228,7 +228,7 @@ if( NOT HDF5_FOUND )
                 HDF5_${LANGUAGE}_LIBRARY_DIRS
                 HDF5_${LANGUAGE}_LIBRARY_NAMES
             )
-        
+
             # take a guess that the includes may be in the 'include' sibling
             # directory of a library directory.
             foreach( dir ${HDF5_${LANGUAGE}_LIBRARY_DIRS} )
@@ -238,7 +238,7 @@ if( NOT HDF5_FOUND )
 
         # set the definitions for the language bindings.
         list( APPEND HDF5_DEFINITIONS ${HDF5_${LANGUAGE}_DEFINITIONS} )
-    
+
         # find the HDF5 include directories
         if(${LANGUAGE} MATCHES "Fortran.*")
             set(HDF5_INCLUDE_FILENAME hdf5.mod)
@@ -251,7 +251,7 @@ if( NOT HDF5_FOUND )
                 ${HDF5_${LANGUAGE}_INCLUDE_FLAGS}
                 ENV
                     HDF5_ROOT
-            PATHS 
+            PATHS
                 $ENV{HOME}/.local/include
             PATH_SUFFIXES
                 include
@@ -259,11 +259,11 @@ if( NOT HDF5_FOUND )
         )
         mark_as_advanced( HDF5_${LANGUAGE}_INCLUDE_DIR )
         list( APPEND HDF5_INCLUDE_DIRS ${HDF5_${LANGUAGE}_INCLUDE_DIR} )
-        
-        set( HDF5_${LANGUAGE}_LIBRARY_NAMES 
-            ${HDF5_${LANGUAGE}_LIBRARY_NAMES_INIT} 
+
+        set( HDF5_${LANGUAGE}_LIBRARY_NAMES
+            ${HDF5_${LANGUAGE}_LIBRARY_NAMES_INIT}
             ${HDF5_${LANGUAGE}_LIBRARY_NAMES} )
-        
+
         # find the HDF5 libraries
         foreach( LIB ${HDF5_${LANGUAGE}_LIBRARY_NAMES} )
             if( UNIX AND HDF5_USE_STATIC_LIBRARIES )
@@ -278,15 +278,15 @@ if( NOT HDF5_FOUND )
                 set( THIS_LIBRARY_SEARCH_DEBUG ${LIB}d )
                 set( THIS_LIBRARY_SEARCH_RELEASE ${LIB} )
             endif()
-            find_library( HDF5_${LIB}_LIBRARY_DEBUG 
-                NAMES ${THIS_LIBRARY_SEARCH_DEBUG} 
-                HINTS ${HDF5_${LANGUAGE}_LIBRARY_DIRS} 
-                ENV HDF5_ROOT 
+            find_library( HDF5_${LIB}_LIBRARY_DEBUG
+                NAMES ${THIS_LIBRARY_SEARCH_DEBUG}
+                HINTS ${HDF5_${LANGUAGE}_LIBRARY_DIRS}
+                ENV HDF5_ROOT
                 PATH_SUFFIXES lib Lib )
             find_library( HDF5_${LIB}_LIBRARY_RELEASE
-                NAMES ${THIS_LIBRARY_SEARCH_RELEASE} 
-                HINTS ${HDF5_${LANGUAGE}_LIBRARY_DIRS} 
-                ENV HDF5_ROOT 
+                NAMES ${THIS_LIBRARY_SEARCH_RELEASE}
+                HINTS ${HDF5_${LANGUAGE}_LIBRARY_DIRS}
+                ENV HDF5_ROOT
                 PATH_SUFFIXES lib Lib )
             select_library_configurations( HDF5_${LIB} )
             # even though we adjusted the individual library names in
@@ -297,16 +297,16 @@ if( NOT HDF5_FOUND )
             # up by the selection macro above) because it may specify debug and
             # optimized variants for a particular library, but a list of
             # libraries is allowed to specify debug and optimized only once.
-            list( APPEND HDF5_${LANGUAGE}_LIBRARIES_DEBUG 
+            list( APPEND HDF5_${LANGUAGE}_LIBRARIES_DEBUG
                 ${HDF5_${LIB}_LIBRARY_DEBUG} )
-            list( APPEND HDF5_${LANGUAGE}_LIBRARIES_RELEASE 
+            list( APPEND HDF5_${LANGUAGE}_LIBRARIES_RELEASE
                 ${HDF5_${LIB}_LIBRARY_RELEASE} )
         endforeach()
         list( APPEND HDF5_LIBRARY_DIRS ${HDF5_${LANGUAGE}_LIBRARY_DIRS} )
-        
+
         # Append the libraries for this language binding to the list of all
         # required libraries.
-        list( APPEND HDF5_LIBRARIES_DEBUG 
+        list( APPEND HDF5_LIBRARIES_DEBUG
             ${HDF5_${LANGUAGE}_LIBRARIES_DEBUG} )
         list( APPEND HDF5_LIBRARIES_RELEASE
             ${HDF5_${LANGUAGE}_LIBRARIES_RELEASE} )
@@ -358,7 +358,7 @@ if( NOT HDF5_FOUND )
     set( HDF5_IS_PARALLEL FALSE )
     foreach( _dir IN LISTS HDF5_INCLUDE_DIRS )
         if( EXISTS "${_dir}/H5pubconf.h" )
-            file( STRINGS "${_dir}/H5pubconf.h" 
+            file( STRINGS "${_dir}/H5pubconf.h"
                 HDF5_HAVE_PARALLEL_DEFINE
                 REGEX "HAVE_PARALLEL 1" )
             if( HDF5_HAVE_PARALLEL_DEFINE )
@@ -378,8 +378,8 @@ if( NOT HDF5_FOUND )
 
 endif()
 
-find_package_handle_standard_args( HDF5 DEFAULT_MSG 
-    HDF5_LIBRARIES 
+find_package_handle_standard_args( HDF5 DEFAULT_MSG
+    HDF5_LIBRARIES
     HDF5_INCLUDE_DIRS
 )
 
diff --git a/Modules/FindHSPELL.cmake b/Modules/FindHSPELL.cmake
index ca5709b62..79bfc81bb 100644
--- a/Modules/FindHSPELL.cmake
+++ b/Modules/FindHSPELL.cmake
@@ -35,7 +35,7 @@ IF (HSPELL_INCLUDE_DIR)
     SET(HSPELL_VERSION_STRING "${HSPELL_VERSION_MAJOR}.${HSPELL_VERSION_MINOR}")
 ENDIF()
 
-# handle the QUIETLY and REQUIRED arguments and set HSPELL_FOUND to TRUE if 
+# handle the QUIETLY and REQUIRED arguments and set HSPELL_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(HSPELL
diff --git a/Modules/FindHTMLHelp.cmake b/Modules/FindHTMLHelp.cmake
index 4455b0797..00de82afd 100644
--- a/Modules/FindHTMLHelp.cmake
+++ b/Modules/FindHTMLHelp.cmake
@@ -24,20 +24,20 @@ IF(WIN32)
     hhc
     "[HKEY_CURRENT_USER\\Software\\Microsoft\\HTML Help Workshop;InstallDir]"
     "$ENV{ProgramFiles}/HTML Help Workshop"
-    "C:/Program Files/HTML Help Workshop" 
+    "C:/Program Files/HTML Help Workshop"
     )
 
   GET_FILENAME_COMPONENT(HTML_HELP_COMPILER_PATH "${HTML_HELP_COMPILER}" PATH)
 
-  FIND_PATH(HTML_HELP_INCLUDE_PATH 
-    htmlhelp.h 
+  FIND_PATH(HTML_HELP_INCLUDE_PATH
+    htmlhelp.h
     "${HTML_HELP_COMPILER_PATH}/include"
     "[HKEY_CURRENT_USER\\Software\\Microsoft\\HTML Help Workshop;InstallDir]/include"
     "$ENV{ProgramFiles}/HTML Help Workshop/include"
-    "C:/Program Files/HTML Help Workshop/include" 
+    "C:/Program Files/HTML Help Workshop/include"
     )
 
-  FIND_LIBRARY(HTML_HELP_LIBRARY 
+  FIND_LIBRARY(HTML_HELP_LIBRARY
     htmlhelp
     "${HTML_HELP_COMPILER_PATH}/lib"
     "[HKEY_CURRENT_USER\\Software\\Microsoft\\HTML Help Workshop;InstallDir]/lib"
diff --git a/Modules/FindITK.cmake b/Modules/FindITK.cmake
index a3ca99899..5b598d230 100644
--- a/Modules/FindITK.cmake
+++ b/Modules/FindITK.cmake
@@ -7,16 +7,16 @@
 # that can be included to set the include directories, library directories,
 # and preprocessor macros.  In addition to the variables read from
 # ITKConfig.cmake, this find module also defines
-#  ITK_DIR  - The directory containing ITKConfig.cmake.  
-#             This is either the root of the build tree, 
-#             or the lib/InsightToolkit directory.  
+#  ITK_DIR  - The directory containing ITKConfig.cmake.
+#             This is either the root of the build tree,
+#             or the lib/InsightToolkit directory.
 #             This is the only cache entry.
-#   
-#  ITK_FOUND - Whether ITK was found.  If this is true, 
+#
+#  ITK_FOUND - Whether ITK was found.  If this is true,
 #              ITK_DIR is okay.
 #
-#  USE_ITK_FILE - The full path to the UseITK.cmake file.  
-#                 This is provided for backward 
+#  USE_ITK_FILE - The full path to the UseITK.cmake file.
+#                 This is provided for backward
 #                 compatability.  Use ITK_USE_FILE
 #                 instead.
 
diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake
index d49b44a55..f93b454a4 100644
--- a/Modules/FindJNI.cmake
+++ b/Modules/FindJNI.cmake
@@ -2,7 +2,7 @@
 # This module finds if Java is installed and determines where the
 # include files and libraries are. It also determines what the name of
 # the library is. This code sets the following variables:
-#   
+#
 #  JNI_INCLUDE_DIRS      = the include dirs to use
 #  JNI_LIBRARIES         = the libraries to use
 #  JNI_FOUND             = TRUE if JNI headers and libraries were found.
@@ -138,7 +138,7 @@ SET(JAVA_AWT_INCLUDE_DIRECTORIES
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/include"
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/include"
   ${_JAVA_HOME}/include
-  /usr/include 
+  /usr/include
   /usr/local/include
   /usr/lib/java/include
   /usr/local/lib/java/include
@@ -162,9 +162,9 @@ FOREACH(JAVA_PROG "${JAVA_RUNTIME}" "${JAVA_COMPILE}" "${JAVA_ARCHIVE}")
       SET(JAVA_AWT_INCLUDE_DIRECTORIES ${JAVA_AWT_INCLUDE_DIRECTORIES} "${jpath}/${JAVA_INC_PATH}")
     ENDIF(EXISTS ${jpath}/${JAVA_INC_PATH})
   ENDFOREACH(JAVA_INC_PATH)
-  FOREACH(JAVA_LIB_PATH 
-    ../lib ../jre/lib ../jre/lib/i386 
-    ../java/lib ../java/jre/lib ../java/jre/lib/i386 
+  FOREACH(JAVA_LIB_PATH
+    ../lib ../jre/lib ../jre/lib/i386
+    ../java/lib ../java/jre/lib ../java/jre/lib/i386
     ../share/java/lib ../share/java/jre/lib ../share/java/jre/lib/i386)
     IF(EXISTS ${jpath}/${JAVA_LIB_PATH})
       SET(JAVA_AWT_LIBRARY_DIRECTORIES ${JAVA_AWT_LIBRARY_DIRECTORIES} "${jpath}/${JAVA_LIB_PATH}")
@@ -209,7 +209,7 @@ IF(APPLE)
       )
   ENDIF(JAVA_HAVE_FRAMEWORK)
 ELSE(APPLE)
-  FIND_LIBRARY(JAVA_AWT_LIBRARY jawt 
+  FIND_LIBRARY(JAVA_AWT_LIBRARY jawt
     PATHS ${JAVA_AWT_LIBRARY_DIRECTORIES}
   )
   FIND_LIBRARY(JAVA_JVM_LIBRARY NAMES jvm JavaVM
@@ -217,12 +217,12 @@ ELSE(APPLE)
   )
 ENDIF(APPLE)
 
-# add in the include path    
-FIND_PATH(JAVA_INCLUDE_PATH jni.h 
+# add in the include path
+FIND_PATH(JAVA_INCLUDE_PATH jni.h
   ${JAVA_AWT_INCLUDE_DIRECTORIES}
 )
 
-FIND_PATH(JAVA_INCLUDE_PATH2 jni_md.h 
+FIND_PATH(JAVA_INCLUDE_PATH2 jni_md.h
   ${JAVA_INCLUDE_PATH}
   ${JAVA_INCLUDE_PATH}/win32
   ${JAVA_INCLUDE_PATH}/linux
diff --git a/Modules/FindJPEG.cmake b/Modules/FindJPEG.cmake
index 349e7e175..0b5db4089 100644
--- a/Modules/FindJPEG.cmake
+++ b/Modules/FindJPEG.cmake
@@ -25,7 +25,7 @@ FIND_PATH(JPEG_INCLUDE_DIR jpeglib.h)
 SET(JPEG_NAMES ${JPEG_NAMES} jpeg)
 FIND_LIBRARY(JPEG_LIBRARY NAMES ${JPEG_NAMES} )
 
-# handle the QUIETLY and REQUIRED arguments and set JPEG_FOUND to TRUE if 
+# handle the QUIETLY and REQUIRED arguments and set JPEG_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(JPEG DEFAULT_MSG JPEG_LIBRARY JPEG_INCLUDE_DIR)
diff --git a/Modules/FindJasper.cmake b/Modules/FindJasper.cmake
index 6dc7e4db7..b6178449b 100644
--- a/Modules/FindJasper.cmake
+++ b/Modules/FindJasper.cmake
@@ -39,7 +39,7 @@ IF (JASPER_INCLUDE_DIR AND EXISTS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h")
     STRING(REGEX REPLACE "^#define[\t ]+JAS_VERSION[\t ]+\"([^\"]+)\".*" "\\1" JASPER_VERSION_STRING "${jasper_version_str}")
 ENDIF (JASPER_INCLUDE_DIR AND EXISTS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h")
 
-# handle the QUIETLY and REQUIRED arguments and set JASPER_FOUND to TRUE if 
+# handle the QUIETLY and REQUIRED arguments and set JASPER_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Jasper
diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake
index 345702122..2e50ecac2 100644
--- a/Modules/FindJava.cmake
+++ b/Modules/FindJava.cmake
@@ -23,7 +23,7 @@
 # Java_VERSION_STRING = 1.5.0_17
 # and
 # Java_VERSION        = 1.5.0.17
-# 
+#
 # another example is the Java OEM, with:
 # Java_VERSION_STRING = 1.6.0-oem
 # and
@@ -102,7 +102,7 @@ IF(Java_JAVA_EXECUTABLE)
       ENDIF()
     ELSE()
       # extract major/minor version and patch level from "java -version" output
-      # Tested on linux using 
+      # Tested on linux using
       # 1. Sun / Sun OEM
       # 2. OpenJDK 1.6
       # 3. GCJ 1.5
diff --git a/Modules/FindKDE3.cmake b/Modules/FindKDE3.cmake
index ca3dae646..65a559fa7 100644
--- a/Modules/FindKDE3.cmake
+++ b/Modules/FindKDE3.cmake
@@ -101,7 +101,7 @@ SET(QT_MT_REQUIRED TRUE)
 IF(KDE3_FIND_REQUIRED)
   SET(_REQ_STRING_KDE3 "REQUIRED")
 ENDIF(KDE3_FIND_REQUIRED)
-  
+
 FIND_PACKAGE(Qt3 ${_REQ_STRING_KDE3})
 FIND_PACKAGE(X11 ${_REQ_STRING_KDE3})
 
diff --git a/Modules/FindKDE4.cmake b/Modules/FindKDE4.cmake
index ed4f270b0..fb9332828 100644
--- a/Modules/FindKDE4.cmake
+++ b/Modules/FindKDE4.cmake
@@ -38,14 +38,14 @@ ENDIF(QT_QT_LIBRARY)
 FILE(TO_CMAKE_PATH "$ENV{KDEDIRS}" _KDEDIRS)
 
 # when cross compiling, searching kde4-config in order to run it later on
-# doesn't make a lot of sense. We'll have to do something about this. 
+# doesn't make a lot of sense. We'll have to do something about this.
 # Searching always in the target environment ? Then we get at least the correct one,
 # still it can't be used to run it. Alex
 
 # For KDE4 kde-config has been renamed to kde4-config
 FIND_PROGRAM(KDE4_KDECONFIG_EXECUTABLE NAMES kde4-config
    # the suffix must be used since KDEDIRS can be a list of directories which don't have bin/ appended
-   PATH_SUFFIXES bin               
+   PATH_SUFFIXES bin
    HINTS
    ${CMAKE_INSTALL_PREFIX}
    ${_KDEDIRS}
diff --git a/Modules/FindLATEX.cmake b/Modules/FindLATEX.cmake
index 950daca5a..7997ae9c8 100644
--- a/Modules/FindLATEX.cmake
+++ b/Modules/FindLATEX.cmake
@@ -1,14 +1,14 @@
 # - Find Latex
 # This module finds if Latex is installed and determines where the
 # executables are. This code sets the following variables:
-#  
+#
 #  LATEX_COMPILER:       path to the LaTeX compiler
 #  PDFLATEX_COMPILER:    path to the PdfLaTeX compiler
 #  BIBTEX_COMPILER:      path to the BibTeX compiler
 #  MAKEINDEX_COMPILER:   path to the MakeIndex compiler
 #  DVIPS_CONVERTER:      path to the DVIPS converter
 #  PS2PDF_CONVERTER:     path to the PS2PDF converter
-#  LATEX2HTML_CONVERTER: path to the LaTeX2Html converter 
+#  LATEX2HTML_CONVERTER: path to the LaTeX2Html converter
 #
 
 #=============================================================================
@@ -30,7 +30,7 @@ IF (WIN32)
 
   FIND_PATH(MIKTEX_BINARY_PATH mpm.exe
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MiK\\MiKTeX\\CurrentVersion\\MiKTeX;Install Root]/miktex/bin"
-    DOC 
+    DOC
     "Path to the MikTex binary directory."
   )
   MARK_AS_ADVANCED(MIKTEX_BINARY_PATH)
diff --git a/Modules/FindLibXml2.cmake b/Modules/FindLibXml2.cmake
index 48a549806..4fc5d88b1 100644
--- a/Modules/FindLibXml2.cmake
+++ b/Modules/FindLibXml2.cmake
@@ -56,7 +56,7 @@ ELSEIF(LIBXML2_INCLUDE_DIR AND EXISTS "${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.
     UNSET(libxml2_version_str)
 ENDIF()
 
-# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if 
+# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2
diff --git a/Modules/FindLua50.cmake b/Modules/FindLua50.cmake
index 9a5cc1703..5196cf758 100644
--- a/Modules/FindLua50.cmake
+++ b/Modules/FindLua50.cmake
@@ -1,6 +1,6 @@
 # Locate Lua library
 # This module defines
-#  LUA50_FOUND, if false, do not try to link to Lua 
+#  LUA50_FOUND, if false, do not try to link to Lua
 #  LUA_LIBRARIES, both lua and lualib
 #  LUA_INCLUDE_DIR, where to find lua.h and lualib.h (and probably lauxlib.h)
 #
@@ -37,7 +37,7 @@ FIND_PATH(LUA_INCLUDE_DIR lua.h
   /opt
 )
 
-FIND_LIBRARY(LUA_LIBRARY_lua 
+FIND_LIBRARY(LUA_LIBRARY_lua
   NAMES lua50 lua5.0 lua-5.0 lua5 lua
   HINTS
   $ENV{LUA_DIR}
@@ -56,7 +56,7 @@ FIND_LIBRARY(LUA_LIBRARY_lua
 IF(${LUA_LIBRARY_lua} MATCHES "framework")
   SET( LUA_LIBRARIES "${LUA_LIBRARY_lua}" CACHE STRING "Lua framework")
 ELSE(${LUA_LIBRARY_lua} MATCHES "framework")
-  FIND_LIBRARY(LUA_LIBRARY_lualib 
+  FIND_LIBRARY(LUA_LIBRARY_lualib
     NAMES lualib50 lualib5.0 lualib5 lualib
     HINTS
     $ENV{LUALIB_DIR}
@@ -82,7 +82,7 @@ ENDIF(${LUA_LIBRARY_lua} MATCHES "framework")
 
 
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if 
+# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
 # all listed variables are TRUE
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua50  DEFAULT_MSG  LUA_LIBRARIES LUA_INCLUDE_DIR)
 
diff --git a/Modules/FindLua51.cmake b/Modules/FindLua51.cmake
index e111d3624..468b5d4fc 100644
--- a/Modules/FindLua51.cmake
+++ b/Modules/FindLua51.cmake
@@ -1,6 +1,6 @@
 # Locate Lua library
 # This module defines
-#  LUA51_FOUND, if false, do not try to link to Lua 
+#  LUA51_FOUND, if false, do not try to link to Lua
 #  LUA_LIBRARIES
 #  LUA_INCLUDE_DIR, where to find lua.h
 #  LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
@@ -38,7 +38,7 @@ FIND_PATH(LUA_INCLUDE_DIR lua.h
   /opt
 )
 
-FIND_LIBRARY(LUA_LIBRARY 
+FIND_LIBRARY(LUA_LIBRARY
   NAMES lua51 lua5.1 lua-5.1 lua
   HINTS
   $ENV{LUA_DIR}
@@ -71,7 +71,7 @@ IF(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
 ENDIF()
 
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if 
+# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
 # all listed variables are TRUE
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua51
                                   REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
diff --git a/Modules/FindMPEG.cmake b/Modules/FindMPEG.cmake
index cf4ef58f8..545e0490c 100644
--- a/Modules/FindMPEG.cmake
+++ b/Modules/FindMPEG.cmake
@@ -32,7 +32,7 @@ FIND_LIBRARY( MPEG_vo_LIBRARY vo
   /usr/local/livid/mpeg2dec/libvo/.libs
 )
 
-# handle the QUIETLY and REQUIRED arguments and set MPEG2_FOUND to TRUE if 
+# handle the QUIETLY and REQUIRED arguments and set MPEG2_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(MPEG DEFAULT_MSG MPEG_INCLUDE_DIR MPEG_mpeg2_LIBRARY MPEG_vo_LIBRARY)
diff --git a/Modules/FindMPEG2.cmake b/Modules/FindMPEG2.cmake
index fab37cf54..5456e20b6 100644
--- a/Modules/FindMPEG2.cmake
+++ b/Modules/FindMPEG2.cmake
@@ -20,7 +20,7 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PATH(MPEG2_INCLUDE_DIR 
+FIND_PATH(MPEG2_INCLUDE_DIR
   NAMES mpeg2.h mpeg2dec/mpeg2.h
   PATHS /usr/local/livid
 )
@@ -34,13 +34,13 @@ FIND_LIBRARY( MPEG2_vo_LIBRARY vo
 )
 
 
-# handle the QUIETLY and REQUIRED arguments and set MPEG2_FOUND to TRUE if 
+# handle the QUIETLY and REQUIRED arguments and set MPEG2_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(MPEG2 DEFAULT_MSG MPEG2_mpeg2_LIBRARY MPEG2_INCLUDE_DIR)
 
 IF(MPEG2_FOUND)
-  SET( MPEG2_LIBRARIES ${MPEG2_mpeg2_LIBRARY} 
+  SET( MPEG2_LIBRARIES ${MPEG2_mpeg2_LIBRARY}
                         ${MPEG2_vo_LIBRARY})
 
   #some native mpeg2 installations will depend
diff --git a/Modules/FindMotif.cmake b/Modules/FindMotif.cmake
index e35411272..57da1c1e9 100644
--- a/Modules/FindMotif.cmake
+++ b/Modules/FindMotif.cmake
@@ -32,7 +32,7 @@ IF(UNIX)
 
 ENDIF(UNIX)
 
-# handle the QUIETLY and REQUIRED arguments and set MOTIF_FOUND to TRUE if 
+# handle the QUIETLY and REQUIRED arguments and set MOTIF_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Motif DEFAULT_MSG MOTIF_LIBRARIES MOTIF_INCLUDE_DIR)
diff --git a/Modules/FindOpenAL.cmake b/Modules/FindOpenAL.cmake
index cb3ce4813..fdac45518 100644
--- a/Modules/FindOpenAL.cmake
+++ b/Modules/FindOpenAL.cmake
@@ -1,7 +1,7 @@
 # Locate OpenAL
 # This module defines
 # OPENAL_LIBRARY
-# OPENAL_FOUND, if false, do not try to link to OpenAL 
+# OPENAL_FOUND, if false, do not try to link to OpenAL
 # OPENAL_INCLUDE_DIR, where to find the headers
 #
 # $OPENALDIR is an environment variable that would
@@ -25,31 +25,31 @@
 
 # This makes the presumption that you are include al.h like
 # #include "al.h"
-# and not 
+# and not
 # #include <AL/al.h>
 # The reason for this is that the latter is not entirely portable.
-# Windows/Creative Labs does not by default put their headers in AL/ and 
+# Windows/Creative Labs does not by default put their headers in AL/ and
 # OS X uses the convention <OpenAL/al.h>.
-# 
-# For Windows, Creative Labs seems to have added a registry key for their 
+#
+# For Windows, Creative Labs seems to have added a registry key for their
 # OpenAL 1.1 installer. I have added that key to the list of search paths,
-# however, the key looks like it could be a little fragile depending on 
+# however, the key looks like it could be a little fragile depending on
 # if they decide to change the 1.00.0000 number for bug fix releases.
 # Also, they seem to have laid down groundwork for multiple library platforms
 # which puts the library in an extra subdirectory. Currently there is only
-# Win32 and I have hardcoded that here. This may need to be adjusted as 
+# Win32 and I have hardcoded that here. This may need to be adjusted as
 # platforms are introduced.
 # The OpenAL 1.0 installer doesn't seem to have a useful key I can use.
 # I do not know if the Nvidia OpenAL SDK has a registry key.
-# 
-# For OS X, remember that OpenAL was added by Apple in 10.4 (Tiger). 
-# To support the framework, I originally wrote special framework detection 
+#
+# For OS X, remember that OpenAL was added by Apple in 10.4 (Tiger).
+# To support the framework, I originally wrote special framework detection
 # code in this module which I have now removed with CMake's introduction
 # of native support for frameworks.
-# In addition, OpenAL is open source, and it is possible to compile on Panther. 
-# Furthermore, due to bugs in the initial OpenAL release, and the 
+# In addition, OpenAL is open source, and it is possible to compile on Panther.
+# Furthermore, due to bugs in the initial OpenAL release, and the
 # transition to OpenAL 1.1, it is common to need to override the built-in
-# framework. 
+# framework.
 # Per my request, CMake should search for frameworks first in
 # the following order:
 # ~/Library/Frameworks/OpenAL.framework/Headers
@@ -57,7 +57,7 @@
 # /System/Library/Frameworks/OpenAL.framework/Headers
 #
 # On OS X, this will prefer the Framework version (if found) over others.
-# People will have to manually change the cache values of 
+# People will have to manually change the cache values of
 # OPENAL_LIBRARY to override this selection or set the CMake environment
 # CMAKE_INCLUDE_PATH to modify the search paths.
 
@@ -75,7 +75,7 @@ FIND_PATH(OPENAL_INCLUDE_DIR al.h
   [HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]
 )
 
-FIND_LIBRARY(OPENAL_LIBRARY 
+FIND_LIBRARY(OPENAL_LIBRARY
   NAMES OpenAL al openal OpenAL32
   HINTS
   $ENV{OPENALDIR}
diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake
index 98d8808c0..322972a59 100644
--- a/Modules/FindOpenGL.cmake
+++ b/Modules/FindOpenGL.cmake
@@ -1,18 +1,18 @@
 # - Try to find OpenGL
 # Once done this will define
-#  
+#
 #  OPENGL_FOUND        - system has OpenGL
 #  OPENGL_XMESA_FOUND  - system has XMESA
 #  OPENGL_GLU_FOUND    - system has GLU
 #  OPENGL_INCLUDE_DIR  - the GL include directory
 #  OPENGL_LIBRARIES    - Link these to use OpenGL and GLU
-#   
+#
 # If you want to use just GL you can use these values
 #  OPENGL_gl_LIBRARY   - Path to OpenGL Library
 #  OPENGL_glu_LIBRARY  - Path to GLU Library
-#  
+#
 # On OSX default to using the framework version of opengl
-# People will have to change the cache values of OPENGL_glu_LIBRARY 
+# People will have to change the cache values of OPENGL_glu_LIBRARY
 # and OPENGL_gl_LIBRARY to use OpenGL with X11 on OSX
 
 #=============================================================================
@@ -63,7 +63,7 @@ ELSE (WIN32)
     IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
       SET(HPUX_IA_OPENGL_LIB_PATH /opt/graphics/OpenGL/lib/hpux32/)
     ELSE(CMAKE_SIZEOF_VOID_P EQUAL 4)
-      SET(HPUX_IA_OPENGL_LIB_PATH 
+      SET(HPUX_IA_OPENGL_LIB_PATH
         /opt/graphics/OpenGL/lib/hpux64/
         /opt/graphics/OpenGL/lib/pa20_64)
     ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 4)
@@ -97,7 +97,7 @@ ELSE (WIN32)
     )
 
     # On Unix OpenGL most certainly always requires X11.
-    # Feel free to tighten up these conditions if you don't 
+    # Feel free to tighten up these conditions if you don't
     # think this is always true.
     # It's not true on OSX.
 
diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake
index b96a2ecfb..87c9d032d 100644
--- a/Modules/FindOpenMP.cmake
+++ b/Modules/FindOpenMP.cmake
@@ -75,12 +75,12 @@ function(_OPENMP_FLAG_CANDIDATES LANG)
 endfunction(_OPENMP_FLAG_CANDIDATES)
 
 # sample openmp source code to test
-set(OpenMP_C_TEST_SOURCE 
+set(OpenMP_C_TEST_SOURCE
 "
 #include <omp.h>
-int main() { 
+int main() {
 #ifdef _OPENMP
-  return 0; 
+  return 0;
 #else
   breaks_on_purpose
 #endif
diff --git a/Modules/FindOpenSceneGraph.cmake b/Modules/FindOpenSceneGraph.cmake
index 52f931689..9dd2c28f0 100644
--- a/Modules/FindOpenSceneGraph.cmake
+++ b/Modules/FindOpenSceneGraph.cmake
@@ -14,7 +14,7 @@
 #
 #    OpenSceneGraph_DEBUG - Enable debugging output
 #
-#    OpenSceneGraph_MARK_AS_ADVANCED - Mark cache variables as advanced 
+#    OpenSceneGraph_MARK_AS_ADVANCED - Mark cache variables as advanced
 #                                      automatically
 #
 # The following environment variables are also respected for finding the OSG
@@ -96,12 +96,12 @@ if(OSG_INCLUDE_DIR)
         message(STATUS "[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] "
             "Detected OSG_INCLUDE_DIR = ${OSG_INCLUDE_DIR}")
     endif()
-    
+
     set(_osg_Version_file "${OSG_INCLUDE_DIR}/osg/Version")
     if("${OSG_INCLUDE_DIR}" MATCHES "\\.framework$" AND NOT EXISTS "${_osg_Version_file}")
         set(_osg_Version_file "${OSG_INCLUDE_DIR}/Headers/Version")
     endif()
-    
+
     if(EXISTS "${_osg_Version_file}")
       file(READ "${_osg_Version_file}" _osg_Version_contents)
     else()
@@ -149,7 +149,7 @@ if(OpenSceneGraph_FIND_VERSION AND OPENSCENEGRAPH_VERSION)
         endif()
     else()
         # version is too low
-        if(NOT OPENSCENEGRAPH_VERSION VERSION_EQUAL ${OpenSceneGraph_FIND_VERSION} AND 
+        if(NOT OPENSCENEGRAPH_VERSION VERSION_EQUAL ${OpenSceneGraph_FIND_VERSION} AND
                 NOT OPENSCENEGRAPH_VERSION VERSION_GREATER ${OpenSceneGraph_FIND_VERSION})
             set(_osg_version_not_high_enough TRUE)
         endif()
@@ -182,7 +182,7 @@ endforeach()
 if(OPENSCENEGRAPH_INCLUDE_DIR)
     list(REMOVE_DUPLICATES OPENSCENEGRAPH_INCLUDE_DIR)
 endif()
-        
+
 #
 # Inform the users with an error message based on
 # what version they have vs. what version was
@@ -221,7 +221,7 @@ else()
                 set(_osg_missing_message "${_osg_missing_message} ${_osg_module}")
             endif()
         endforeach()
-    
+
         if(_osg_missing_nodekit_fail)
             message(FATAL_ERROR "ERROR: Missing the following osg "
                 "libraries: ${_osg_missing_message}.\n"
diff --git a/Modules/FindOpenThreads.cmake b/Modules/FindOpenThreads.cmake
index 6b81fbe3a..4f6e920c2 100644
--- a/Modules/FindOpenThreads.cmake
+++ b/Modules/FindOpenThreads.cmake
@@ -1,10 +1,10 @@
-# OpenThreads is a C++ based threading library. Its largest userbase 
+# OpenThreads is a C++ based threading library. Its largest userbase
 # seems to OpenSceneGraph so you might notice I accept OSGDIR as an
 # environment path.
-# I consider this part of the Findosg* suite used to find OpenSceneGraph 
+# I consider this part of the Findosg* suite used to find OpenSceneGraph
 # components.
 # Each component is separate and you must opt in to each module.
-# 
+#
 # Locate OpenThreads
 # This module defines
 # OPENTHREADS_LIBRARY
@@ -34,8 +34,8 @@
 # #include <OpenThreads/Thread>
 
 # To make it easier for one-step automated configuration/builds,
-# we leverage environmental paths. This is preferable 
-# to the -DVAR=value switches because it insulates the 
+# we leverage environmental paths. This is preferable
+# to the -DVAR=value switches because it insulates the
 # users from changes we may make in this script.
 # It also offers a little more flexibility than setting
 # the CMAKE_*_PATH since we can target specific components.
@@ -71,8 +71,8 @@ find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
 )
 
 
-find_library(OPENTHREADS_LIBRARY 
-    NAMES OpenThreads OpenThreadsWin32 
+find_library(OPENTHREADS_LIBRARY
+    NAMES OpenThreads OpenThreadsWin32
     HINTS
         $ENV{OPENTHREADS_LIBRARY_DIR}
         $ENV{OPENTHREADS_DIR}
@@ -90,7 +90,7 @@ find_library(OPENTHREADS_LIBRARY
     PATH_SUFFIXES lib64 lib
 )
 
-find_library(OPENTHREADS_LIBRARY_DEBUG 
+find_library(OPENTHREADS_LIBRARY_DEBUG
     NAMES OpenThreadsd OpenThreadsWin32d
     HINTS
         $ENV{OPENTHREADS_DEBUG_LIBRARY_DIR}
diff --git a/Modules/FindPHP4.cmake b/Modules/FindPHP4.cmake
index 6c2965a7a..abdabe144 100644
--- a/Modules/FindPHP4.cmake
+++ b/Modules/FindPHP4.cmake
@@ -52,7 +52,7 @@ MARK_AS_ADVANCED(
 
 IF(APPLE)
 # this is a hack for now
-  SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS 
+  SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
    "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -Wl,-flat_namespace")
   FOREACH(symbol
     __efree
@@ -76,7 +76,7 @@ IF(APPLE)
     _zend_wrong_param_count
     _zval_used_for_init
     )
-    SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS 
+    SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
       "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS},-U,${symbol}")
   ENDFOREACH(symbol)
 ENDIF(APPLE)
diff --git a/Modules/FindPerl.cmake b/Modules/FindPerl.cmake
index ae686df75..bedb839d1 100644
--- a/Modules/FindPerl.cmake
+++ b/Modules/FindPerl.cmake
@@ -26,11 +26,11 @@ SET(PERL_POSSIBLE_BIN_PATHS
 
 IF(WIN32)
   GET_FILENAME_COMPONENT(
-    ActivePerl_CurrentVersion 
-    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActivePerl;CurrentVersion]" 
+    ActivePerl_CurrentVersion
+    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActivePerl;CurrentVersion]"
     NAME)
   SET(PERL_POSSIBLE_BIN_PATHS ${PERL_POSSIBLE_BIN_PATHS}
-    "C:/Perl/bin" 
+    "C:/Perl/bin"
     [HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActivePerl\\${ActivePerl_CurrentVersion}]/bin
     )
 ENDIF(WIN32)
@@ -73,7 +73,7 @@ ENDIF(PERL_EXECUTABLE)
 # Deprecated settings for compatibility with CMake1.4
 SET(PERL ${PERL_EXECUTABLE})
 
-# handle the QUIETLY and REQUIRED arguments and set PERL_FOUND to TRUE if 
+# handle the QUIETLY and REQUIRED arguments and set PERL_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Perl
diff --git a/Modules/FindPerlLibs.cmake b/Modules/FindPerlLibs.cmake
index b2ffd3cf6..3db67acc4 100644
--- a/Modules/FindPerlLibs.cmake
+++ b/Modules/FindPerlLibs.cmake
@@ -236,7 +236,7 @@ if (PERL_EXECUTABLE)
 
 endif (PERL_EXECUTABLE)
 
-# handle the QUIETLY and REQUIRED arguments and set PERLLIBS_FOUND to TRUE if 
+# handle the QUIETLY and REQUIRED arguments and set PERLLIBS_FOUND to TRUE if
 # all listed variables are TRUE
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 find_package_handle_standard_args(PerlLibs REQUIRED_VARS PERL_LIBRARY PERL_INCLUDE_PATH
diff --git a/Modules/FindPhysFS.cmake b/Modules/FindPhysFS.cmake
index 2e3ac1400..45f9d2e6f 100644
--- a/Modules/FindPhysFS.cmake
+++ b/Modules/FindPhysFS.cmake
@@ -8,7 +8,7 @@
 # correspond to the ./configure --prefix=$PHYSFSDIR
 # used in building PHYSFS.
 #
-# Created by Eric Wing. 
+# Created by Eric Wing.
 
 #=============================================================================
 # Copyright 2005-2009 Kitware, Inc.
@@ -36,7 +36,7 @@ FIND_PATH(PHYSFS_INCLUDE_DIR physfs.h
   /opt
 )
 
-FIND_LIBRARY(PHYSFS_LIBRARY 
+FIND_LIBRARY(PHYSFS_LIBRARY
   NAMES physfs
   HINTS
   $ENV{PHYSFSDIR}
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
index 39d3a76ab..99b2c1fe2 100644
--- a/Modules/FindPkgConfig.cmake
+++ b/Modules/FindPkgConfig.cmake
@@ -156,7 +156,7 @@ endmacro(_pkgconfig_invoke_dyn)
 macro(_pkgconfig_parse_options _result _is_req _is_silent)
   set(${_is_req} 0)
   set(${_is_silent} 0)
-  
+
   foreach(_pkg ${ARGN})
     if (_pkg STREQUAL "REQUIRED")
       set(${_is_req} 1)
@@ -207,7 +207,7 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
         message(STATUS "checking for modules '${_pkg_check_modules_list}'")
       endif(_pkg_check_modules_cnt EQUAL 1)
     endif(NOT ${_is_silent})
-    
+
     set(_pkg_check_modules_packages)
     set(_pkg_check_modules_failed)
 
@@ -234,14 +234,14 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
       if (_pkg_check_modules_pkg_op STREQUAL "=")
         list(APPEND _pkg_check_modules_exist_query --exact-version)
       endif(_pkg_check_modules_pkg_op STREQUAL "=")
-      
+
       if (_pkg_check_modules_pkg_op STREQUAL "<=")
         list(APPEND _pkg_check_modules_exist_query --max-version)
       endif(_pkg_check_modules_pkg_op STREQUAL "<=")
 
       # create the final query which is of the format:
       # * --atleast-version <version> <pkg-name>
-      # * --exact-version <version> <pkg-name>      
+      # * --exact-version <version> <pkg-name>
       # * --max-version <version> <pkg-name>
       # * --exists <pkg-name>
       if (_pkg_check_modules_pkg_op)
@@ -281,7 +281,7 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
     else(_pkg_check_modules_failed)
       # when we are here, we checked whether requested modules
       # exist. Now, go through them and set variables
-      
+
       _pkgconfig_set(${_prefix}_FOUND 1)
       list(LENGTH _pkg_check_modules_packages pkg_count)
 
@@ -293,7 +293,7 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
         else(pkg_count EQUAL 1)
           set(_pkg_check_prefix "${_prefix}_${_pkg_check_modules_pkg}")
         endif(pkg_count EQUAL 1)
-        
+
         _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" VERSION    ""   --modversion )
         _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" PREFIX     ""   --variable=prefix )
         _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" INCLUDEDIR ""   --variable=includedir )
@@ -363,9 +363,9 @@ macro(pkg_search_module _prefix _module0)
         message(SEND_ERROR "None of the required '${_pkg_modules_alt}' found")
       endif(${_pkg_is_required})
     endif(NOT ${_prefix}_FOUND)
-    
+
     _pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION})
-  endif(NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND)  
+  endif(NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND)
 endmacro(pkg_search_module)
 
 ### Local Variables:
diff --git a/Modules/FindProducer.cmake b/Modules/FindProducer.cmake
index 26c804ac1..f7840c5d1 100644
--- a/Modules/FindProducer.cmake
+++ b/Modules/FindProducer.cmake
@@ -1,18 +1,18 @@
 # Though Producer isn't directly part of OpenSceneGraph, its primary user
-# is OSG so I consider this part of the Findosg* suite used to find 
+# is OSG so I consider this part of the Findosg* suite used to find
 # OpenSceneGraph components. You'll notice that I accept OSGDIR as an
 # environment path.
-# 
-# Each component is separate and you must opt in to each module. You must 
-# also opt into OpenGL (and OpenThreads?) as these 
-# modules won't do it for you. This is to allow you control over your own 
+#
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL (and OpenThreads?) as these
+# modules won't do it for you. This is to allow you control over your own
 # system piece by piece in case you need to opt out of certain components
 # or change the Find behavior for a particular module (perhaps because the
 # default FindOpenGL.cmake module doesn't work with your system as an
 # example).
 # If you want to use a more convenient module that includes everything,
 # use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-# 
+#
 # Locate Producer
 # This module defines
 # PRODUCER_LIBRARY
@@ -59,7 +59,7 @@ FIND_PATH(PRODUCER_INCLUDE_DIR Producer/CameraGroup
     [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
 )
 
-FIND_LIBRARY(PRODUCER_LIBRARY 
+FIND_LIBRARY(PRODUCER_LIBRARY
   NAMES Producer
   HINTS
   $ENV{PRODUCER_DIR}
diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake
index 1e1e49301..c8616cc51 100644
--- a/Modules/FindProtobuf.cmake
+++ b/Modules/FindProtobuf.cmake
@@ -109,7 +109,7 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS)
   foreach(FIL ${ARGN})
     get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
     get_filename_component(FIL_WE ${FIL} NAME_WE)
-    
+
     list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc")
     list(APPEND ${HDRS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h")
 
diff --git a/Modules/FindQt.cmake b/Modules/FindQt.cmake
index 2b8dfd7fb..5a1f6fc38 100644
--- a/Modules/FindQt.cmake
+++ b/Modules/FindQt.cmake
@@ -4,13 +4,13 @@
 # If multiple versions of QT are found on the machine, then
 # The user must set the option DESIRED_QT_VERSION to the version
 # they want to use.  If only one version of qt is found on the machine,
-# then the DESIRED_QT_VERSION is set to that version and the 
+# then the DESIRED_QT_VERSION is set to that version and the
 # matching FindQt3 or FindQt4 module is included.
 # Once the user sets DESIRED_QT_VERSION, then the FindQt3 or FindQt4 module
 # is included.
 #
-#  QT_REQUIRED if this is set to TRUE then if CMake can 
-#              not find QT4 or QT3 an error is raised 
+#  QT_REQUIRED if this is set to TRUE then if CMake can
+#              not find QT4 or QT3 an error is raised
 #              and a message is sent to the user.
 #
 #  DESIRED_QT_VERSION OPTION is created
@@ -72,7 +72,7 @@ ENDIF(QT_QMAKE_EXECUTABLE_FINDQT)
 
 IF(QT_QMAKE_EXECUTABLE_FINDQT)
   EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE_FINDQT}
-    ARGS "-query QT_INSTALL_HEADERS" 
+    ARGS "-query QT_INSTALL_HEADERS"
     OUTPUT_VARIABLE qt_headers )
 ENDIF(QT_QMAKE_EXECUTABLE_FINDQT)
 
@@ -94,7 +94,7 @@ IF(QT4_QGLOBAL_H_FILE)
 ENDIF(QT4_QGLOBAL_H_FILE)
 
 FIND_FILE( QT3_QGLOBAL_H_FILE qglobal.h
-  "${QT_SEARCH_PATH}/Qt/include" 
+  "${QT_SEARCH_PATH}/Qt/include"
  "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/include/Qt"
   "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/include/Qt"
   "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/include/Qt"
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index d157dabaa..e3eb1e69b 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -2,8 +2,8 @@
 # This module can be used to find Qt4.
 # The most important issue is that the Qt4 qmake is available via the system path.
 # This qmake is then used to detect basically everything else.
-# This module defines a number of key variables and macros. 
-# The variable QT_USE_FILE is set which is the path to a CMake file that can be included 
+# This module defines a number of key variables and macros.
+# The variable QT_USE_FILE is set which is the path to a CMake file that can be included
 # to compile Qt 4 applications and libraries.  It sets up the compilation
 # environment for include directories, preprocessor defines and populates a
 # QT_LIBRARIES variable.
@@ -15,10 +15,10 @@
 #   target_link_libraries(myexe ${QT_LIBRARIES})
 #
 # The minimum required version can be specified using the standard find_package()-syntax
-# (see example above). 
+# (see example above).
 # For compatibility with older versions of FindQt4.cmake it is also possible to
-# set the variable QT_MIN_VERSION to the minimum required version of Qt4 before the 
-# find_package(Qt4) command. 
+# set the variable QT_MIN_VERSION to the minimum required version of Qt4 before the
+# find_package(Qt4) command.
 # If both are used, the version used in the find_package() command overrides the
 # one from QT_MIN_VERSION.
 #
@@ -53,26 +53,26 @@
 #                    QT_USE_QTSCRIPTTOOLS
 #                    QT_USE_QTDECLARATIVE
 #
-#  QT_USE_IMPORTED_TARGETS 
+#  QT_USE_IMPORTED_TARGETS
 #        If this variable is set to TRUE, FindQt4.cmake will create imported
-#        library targets for the various Qt libraries and set the 
+#        library targets for the various Qt libraries and set the
 #        library variables like QT_QTCORE_LIBRARY to point at these imported
-#        targets instead of the library file on disk. This provides much better 
-#        handling of the release and debug versions of the Qt libraries and is 
+#        targets instead of the library file on disk. This provides much better
+#        handling of the release and debug versions of the Qt libraries and is
 #       also always backwards compatible, except for the case that dependencies
-#       of libraries are exported, these will then also list the names of the 
+#       of libraries are exported, these will then also list the names of the
 #       imported targets as dependency and not the file location on disk. This
 #       is much more flexible, but requires that FindQt4.cmake is executed before
 #       such an exported dependency file is processed.
 #
 # There are also some files that need processing by some Qt tools such as moc
 # and uic.  Listed below are macros that may be used to process those files.
-#  
+#
 #  macro QT4_WRAP_CPP(outfiles inputfile ... OPTIONS ...)
 #        create moc code from a list of files containing Qt class with
 #        the Q_OBJECT declaration.  Per-directory preprocessor definitions
 #        are also added.  Options may be given to moc, such as those found
-#        when executing "moc -help".  
+#        when executing "moc -help".
 #
 #  macro QT4_WRAP_UI(outfiles inputfile ... OPTIONS ...)
 #        create code from a list of Qt designer ui files.
@@ -92,13 +92,13 @@
 #  macro QT4_AUTOMOC(sourcefile1 sourcefile2 ... )
 #        This macro is still experimental.
 #        It can be used to have moc automatically handled.
-#        So if you have the files foo.h and foo.cpp, and in foo.h a 
+#        So if you have the files foo.h and foo.cpp, and in foo.h a
 #        a class uses the Q_OBJECT macro, moc has to run on it. If you don't
 #        want to use QT4_WRAP_CPP() (which is reliable and mature), you can insert
 #        #include "foo.moc"
 #        in foo.cpp and then give foo.cpp as argument to QT4_AUTOMOC(). This will the
 #        scan all listed files at cmake-time for such included moc files and if it finds
-#        them cause a rule to be generated to run moc at build time on the 
+#        them cause a rule to be generated to run moc at build time on the
 #        accompanying header file foo.h.
 #        If a source file has the SKIP_AUTOMOC property set it will be ignored by this macro.
 #
@@ -106,7 +106,7 @@
 #
 #  macro QT4_ADD_DBUS_INTERFACE(outfiles interface basename)
 #        Create a the interface header and implementation files with the
-#        given basename from the given interface xml file and add it to 
+#        given basename from the given interface xml file and add it to
 #        the list of sources.
 #
 #        You can pass additional parameters to the qdbusxml2cpp call by setting
@@ -136,19 +136,19 @@
 #
 #  macro QT4_GENERATE_DBUS_INTERFACE( header [interfacename] OPTIONS ...)
 #        generate the xml interface file from the given header.
-#        If the optional argument interfacename is omitted, the name of the 
+#        If the optional argument interfacename is omitted, the name of the
 #        interface file is constructed from the basename of the header with
 #        the suffix .xml appended.
 #        Options may be given to qdbuscpp2xml, such as those found when executing "qdbuscpp2xml --help"
 #
-#  macro QT4_CREATE_TRANSLATION( qm_files directories ... sources ... 
+#  macro QT4_CREATE_TRANSLATION( qm_files directories ... sources ...
 #                                ts_files ... OPTIONS ...)
 #        out: qm_files
 #        in:  directories sources ts_files
 #        options: flags to pass to lupdate, such as -extensions to specify
 #        extensions for a directory scan.
 #        generates commands to create .ts (vie lupdate) and .qm
-#        (via lrelease) - files from directories and/or sources. The ts files are 
+#        (via lrelease) - files from directories and/or sources. The ts files are
 #        created and/or updated in the source tree (unless given with full paths).
 #        The qm files are generated in the build tree.
 #        Updating the translations can be done by adding the qm_files
@@ -211,41 +211,41 @@
 #                   The QT_USE_FILE will also define QT_DEBUG and QT_NO_DEBUG
 #                   to fit your current build type.  Those are not contained
 #                   in QT_DEFINITIONS.
-#                  
-#  QT_INCLUDES      List of paths to all include directories of 
+#
+#  QT_INCLUDES      List of paths to all include directories of
 #                   Qt4 QT_INCLUDE_DIR and QT_QTCORE_INCLUDE_DIR are
 #                   always in this variable even if NOTFOUND,
 #                   all other INCLUDE_DIRS are
 #                   only added if they are found.
 #                   You do not need to use this if you include QT_USE_FILE.
-#   
+#
 #
 #  Include directories for the Qt modules are listed here.
 #  You do not need to use these variables if you include QT_USE_FILE.
 #
 #  QT_INCLUDE_DIR              Path to "include" of Qt4
-#  QT_QT3SUPPORT_INCLUDE_DIR   Path to "include/Qt3Support" 
-#  QT_QTASSISTANT_INCLUDE_DIR  Path to "include/QtAssistant" 
+#  QT_QT3SUPPORT_INCLUDE_DIR   Path to "include/Qt3Support"
+#  QT_QTASSISTANT_INCLUDE_DIR  Path to "include/QtAssistant"
 #  QT_QTASSISTANTCLIENT_INCLUDE_DIR       Path to "include/QtAssistant"
 #  QT_QAXCONTAINER_INCLUDE_DIR Path to "include/ActiveQt" (Windows only)
 #  QT_QAXSERVER_INCLUDE_DIR    Path to "include/ActiveQt" (Windows only)
-#  QT_QTCORE_INCLUDE_DIR       Path to "include/QtCore"         
+#  QT_QTCORE_INCLUDE_DIR       Path to "include/QtCore"
 #  QT_QTDBUS_INCLUDE_DIR       Path to "include/QtDBus"
-#  QT_QTDESIGNER_INCLUDE_DIR   Path to "include/QtDesigner" 
+#  QT_QTDESIGNER_INCLUDE_DIR   Path to "include/QtDesigner"
 #  QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR   Path to "include/QtDesigner"
-#  QT_QTGUI_INCLUDE_DIR        Path to "include/QtGui" 
+#  QT_QTGUI_INCLUDE_DIR        Path to "include/QtGui"
 #  QT_QTHELP_INCLUDE_DIR       Path to "include/QtHelp"
-#  QT_QTMOTIF_INCLUDE_DIR      Path to "include/QtMotif" 
-#  QT_QTMULTIMEDIA_INCLUDE_DIR Path to "include/QtMultimedia" 
-#  QT_QTNETWORK_INCLUDE_DIR    Path to "include/QtNetwork" 
-#  QT_QTNSPLUGIN_INCLUDE_DIR   Path to "include/QtNsPlugin" 
-#  QT_QTOPENGL_INCLUDE_DIR     Path to "include/QtOpenGL" 
+#  QT_QTMOTIF_INCLUDE_DIR      Path to "include/QtMotif"
+#  QT_QTMULTIMEDIA_INCLUDE_DIR Path to "include/QtMultimedia"
+#  QT_QTNETWORK_INCLUDE_DIR    Path to "include/QtNetwork"
+#  QT_QTNSPLUGIN_INCLUDE_DIR   Path to "include/QtNsPlugin"
+#  QT_QTOPENGL_INCLUDE_DIR     Path to "include/QtOpenGL"
 #  QT_QTSCRIPT_INCLUDE_DIR     Path to "include/QtScript"
-#  QT_QTSQL_INCLUDE_DIR        Path to "include/QtSql" 
+#  QT_QTSQL_INCLUDE_DIR        Path to "include/QtSql"
 #  QT_QTSVG_INCLUDE_DIR        Path to "include/QtSvg"
 #  QT_QTTEST_INCLUDE_DIR       Path to "include/QtTest"
 #  QT_QTWEBKIT_INCLUDE_DIR     Path to "include/QtWebKit"
-#  QT_QTXML_INCLUDE_DIR        Path to "include/QtXml" 
+#  QT_QTXML_INCLUDE_DIR        Path to "include/QtXml"
 #  QT_QTXMLPATTERNS_INCLUDE_DIR  Path to "include/QtXmlPatterns"
 #  QT_PHONON_INCLUDE_DIR       Path to "include/phonon"
 #  QT_QTSCRIPTTOOLS_INCLUDE_DIR       Path to "include/QtScriptTools"
@@ -292,7 +292,7 @@
 #  QT_QTMAIN_LIBRARY                The qtmain library for Windows
 #  QT_PHONON_LIBRARY                The phonon library
 #  QT_QTSCRIPTTOOLS_LIBRARY         The QtScriptTools library
-#  
+#
 # The QtDeclarative library:             QT_QTDECLARATIVE_LIBRARY
 #
 # also defined, but NOT for general use are
@@ -307,17 +307,17 @@
 #  QT_QCOLLECTIONGENERATOR_EXECUTABLE  Where to find the qcollectiongenerator tool.
 #  QT_DESIGNER_EXECUTABLE              Where to find the Qt designer tool.
 #  QT_LINGUIST_EXECUTABLE              Where to find the Qt linguist tool.
-#  
 #
-# These are around for backwards compatibility 
+#
+# These are around for backwards compatibility
 # they will be set
 #  QT_WRAP_CPP  Set true if QT_MOC_EXECUTABLE is found
 #  QT_WRAP_UI   Set true if QT_UIC_EXECUTABLE is found
-#  
+#
 # These variables do _NOT_ have any effect anymore (compared to FindQt.cmake)
 #  QT_MT_REQUIRED         Qt4 is now always multithreaded
-#  
-# These variables are set to "" Because Qt structure changed 
+#
+# These variables are set to "" Because Qt structure changed
 # (They make no sense in Qt4)
 #  QT_QT_LIBRARY        Qt-Library is now split
 
@@ -340,12 +340,12 @@ IF( Qt4_FIND_COMPONENTS )
     STRING( TOUPPER ${component} _COMPONENT )
     SET( QT_USE_${_COMPONENT} 1 )
   ENDFOREACH( component )
-  
+
   # To make sure we don't use QtCore or QtGui when not in COMPONENTS
   IF(NOT QT_USE_QTCORE)
     SET( QT_DONT_USE_QTCORE 1 )
   ENDIF(NOT QT_USE_QTCORE)
-  
+
   IF(NOT QT_USE_QTGUI)
     SET( QT_DONT_USE_QTGUI 1 )
   ENDIF(NOT QT_USE_QTGUI)
@@ -765,7 +765,7 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
                  QtHelp QtWebKit QtXmlPatterns phonon QtNetwork QtMultimedia
                  QtNsPlugin QtOpenGL QtSql QtXml QtDesigner QtDBus QtScriptTools
                  QtDeclarative)
-  
+
   IF(Q_WS_X11)
     SET(QT_MODULES ${QT_MODULES} QtMotif)
   ENDIF(Q_WS_X11)
@@ -840,7 +840,7 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
     ${QT_LIBRARY_DIR}/QtDesigner.framework/Headers
     NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
     )
-  
+
   # Set QT_QTASSISTANT_INCLUDE_DIR
   FIND_PATH(QT_QTASSISTANT_INCLUDE_DIR QtAssistant
     PATHS
@@ -848,7 +848,7 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
     ${QT_LIBRARY_DIR}/QtAssistant.framework/Headers
     NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
     )
-  
+
   # Set QT_QTASSISTANTCLIENT_INCLUDE_DIR
   FIND_PATH(QT_QTASSISTANTCLIENT_INCLUDE_DIR QAssistantClient
     PATHS
@@ -866,11 +866,11 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
   # find the libraries
   FOREACH(QT_MODULE ${QT_MODULES})
     STRING(TOUPPER ${QT_MODULE} _upper_qt_module)
-    FIND_LIBRARY(QT_${_upper_qt_module}_LIBRARY_RELEASE 
+    FIND_LIBRARY(QT_${_upper_qt_module}_LIBRARY_RELEASE
                  NAMES ${QT_MODULE}${QT_LIBINFIX} ${QT_MODULE}${QT_LIBINFIX}4
                  PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
         )
-    FIND_LIBRARY(QT_${_upper_qt_module}_LIBRARY_DEBUG 
+    FIND_LIBRARY(QT_${_upper_qt_module}_LIBRARY_DEBUG
                  NAMES ${QT_MODULE}${QT_LIBINFIX}_debug ${QT_MODULE}${QT_LIBINFIX}d ${QT_MODULE}${QT_LIBINFIX}d4
                  PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
         )
@@ -891,11 +891,11 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
     FIND_LIBRARY(QT_QTMAIN_LIBRARY_RELEASE NAMES qtmain${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
     FIND_LIBRARY(QT_QTMAIN_LIBRARY_DEBUG NAMES qtmain${QT_LIBINFIX}d PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
   ENDIF(Q_WS_WIN)
-  
+
   # Set QT_QTASSISTANTCLIENT_LIBRARY
   FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
   FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_DEBUG   NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR}  NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
-  
+
   # Set QT_QTASSISTANT_LIBRARY
   FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 QtAssistant${QT_LIBINFIX} QtAssistant${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
   FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_DEBUG   NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 QtAssistant${QT_LIBINFIX}_debug QtAssistant${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
@@ -915,7 +915,7 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
   ############################################
 
 
-  # Set QT_xyz_LIBRARY variable and add 
+  # Set QT_xyz_LIBRARY variable and add
   # library include path to QT_INCLUDES
   _QT4_ADJUST_LIB_VARS(QtCore)
 
@@ -938,7 +938,7 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
 
   #######################################
   #
-  #       Check the executables of Qt 
+  #       Check the executables of Qt
   #          ( moc, uic, rcc )
   #
   #######################################
@@ -957,7 +957,7 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
     SET(QT_DESIGNER_EXECUTABLE NOTFOUND)
     SET(QT_LINGUIST_EXECUTABLE NOTFOUND)
   ENDIF(QT_QMAKE_CHANGED)
-  
+
   FIND_PROGRAM(QT_MOC_EXECUTABLE
     NAMES moc-qt4 moc
     PATHS ${QT_BINARY_DIR}
@@ -976,19 +976,19 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
     NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
     )
 
-  FIND_PROGRAM(QT_RCC_EXECUTABLE 
+  FIND_PROGRAM(QT_RCC_EXECUTABLE
     NAMES rcc
     PATHS ${QT_BINARY_DIR}
     NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
     )
 
-  FIND_PROGRAM(QT_DBUSCPP2XML_EXECUTABLE 
+  FIND_PROGRAM(QT_DBUSCPP2XML_EXECUTABLE
     NAMES qdbuscpp2xml
     PATHS ${QT_BINARY_DIR}
     NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
     )
 
-  FIND_PROGRAM(QT_DBUSXML2CPP_EXECUTABLE 
+  FIND_PROGRAM(QT_DBUSXML2CPP_EXECUTABLE
     NAMES qdbusxml2cpp
     PATHS ${QT_BINARY_DIR}
     NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
@@ -1043,10 +1043,10 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
   # get the directory of the current file, used later on in the file
   GET_FILENAME_COMPONENT( _qt4_current_dir  "${CMAKE_CURRENT_LIST_FILE}" PATH)
 
-  
+
   ###############################################
   #
-  #       configuration/system dependent settings  
+  #       configuration/system dependent settings
   #
   ###############################################
 
diff --git a/Modules/FindQuickTime.cmake b/Modules/FindQuickTime.cmake
index 038c2dd65..ccbcb3187 100644
--- a/Modules/FindQuickTime.cmake
+++ b/Modules/FindQuickTime.cmake
@@ -1,13 +1,13 @@
 # Locate QuickTime
 # This module defines
 # QUICKTIME_LIBRARY
-# QUICKTIME_FOUND, if false, do not try to link to gdal 
+# QUICKTIME_FOUND, if false, do not try to link to gdal
 # QUICKTIME_INCLUDE_DIR, where to find the headers
 #
 # $QUICKTIME_DIR is an environment variable that would
 # correspond to the ./configure --prefix=$QUICKTIME_DIR
 #
-# Created by Eric Wing. 
+# Created by Eric Wing.
 
 #=============================================================================
 # Copyright 2007-2009 Kitware, Inc.
diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake
index 1c04726ea..363591f0c 100644
--- a/Modules/FindSDL.cmake
+++ b/Modules/FindSDL.cmake
@@ -6,22 +6,22 @@
 #
 # This module responds to the the flag:
 # SDL_BUILDING_LIBRARY
-# If this is defined, then no SDL_main will be linked in because 
+# If this is defined, then no SDL_main will be linked in because
 # only applications need main().
 # Otherwise, it is assumed you are building an application and this
 # module will attempt to locate and set the the proper link flags
 # as part of the returned SDL_LIBRARY variable.
 #
-# Don't forget to include SDLmain.h and SDLmain.m your project for the 
+# Don't forget to include SDLmain.h and SDLmain.m your project for the
 # OS X framework based version. (Other versions link to -lSDLmain which
-# this module will try to find on your behalf.) Also for OS X, this 
+# this module will try to find on your behalf.) Also for OS X, this
 # module will automatically add the -framework Cocoa on your behalf.
 #
 #
 # Additional Note: If you see an empty SDL_LIBRARY_TEMP in your configuration
-# and no SDL_LIBRARY, it means CMake did not find your SDL library 
-# (SDL.dll, libsdl.so, SDL.framework, etc). 
-# Set SDL_LIBRARY_TEMP to point to your SDL library, and configure again. 
+# and no SDL_LIBRARY, it means CMake did not find your SDL library
+# (SDL.dll, libsdl.so, SDL.framework, etc).
+# Set SDL_LIBRARY_TEMP to point to your SDL library, and configure again.
 # Similarly, if you see an empty SDLMAIN_LIBRARY, you should set this value
 # as appropriate. These values are used to generate the final SDL_LIBRARY
 # variable, but when these values are unset, SDL_LIBRARY does not get created.
@@ -32,18 +32,18 @@
 # used in building SDL.
 # l.e.galup  9-20-02
 #
-# Modified by Eric Wing. 
+# Modified by Eric Wing.
 # Added code to assist with automated building by using environmental variables
 # and providing a more controlled/consistent search behavior.
-# Added new modifications to recognize OS X frameworks and 
-# additional Unix paths (FreeBSD, etc). 
+# Added new modifications to recognize OS X frameworks and
+# additional Unix paths (FreeBSD, etc).
 # Also corrected the header search path to follow "proper" SDL guidelines.
 # Added a search for SDLmain which is needed by some platforms.
 # Added a search for threads which is needed by some platforms.
 # Added needed compile switches for MinGW.
 #
 # On OSX, this will prefer the Framework version (if found) over others.
-# People will have to manually change the cache values of 
+# People will have to manually change the cache values of
 # SDL_LIBRARY to override this selection or set the CMake environment
 # CMAKE_INCLUDE_PATH to modify the search paths.
 #
@@ -84,7 +84,7 @@ FIND_PATH(SDL_INCLUDE_DIR SDL.h
 
 # SDL-1.1 is the name used by FreeBSD ports...
 # don't confuse it for the version number.
-FIND_LIBRARY(SDL_LIBRARY_TEMP 
+FIND_LIBRARY(SDL_LIBRARY_TEMP
   NAMES SDL SDL-1.1
   HINTS
   $ENV{SDLDIR}
@@ -98,11 +98,11 @@ FIND_LIBRARY(SDL_LIBRARY_TEMP
 
 IF(NOT SDL_BUILDING_LIBRARY)
   IF(NOT ${SDL_INCLUDE_DIR} MATCHES ".framework")
-    # Non-OS X framework versions expect you to also dynamically link to 
-    # SDLmain. This is mainly for Windows and OS X. Other (Unix) platforms 
+    # Non-OS X framework versions expect you to also dynamically link to
+    # SDLmain. This is mainly for Windows and OS X. Other (Unix) platforms
     # seem to provide SDLmain for compatibility even though they don't
     # necessarily need it.
-    FIND_LIBRARY(SDLMAIN_LIBRARY 
+    FIND_LIBRARY(SDLMAIN_LIBRARY
       NAMES SDLmain SDLmain-1.1
       HINTS
       $ENV{SDLDIR}
@@ -117,8 +117,8 @@ IF(NOT SDL_BUILDING_LIBRARY)
 ENDIF(NOT SDL_BUILDING_LIBRARY)
 
 # SDL may require threads on your system.
-# The Apple build may not need an explicit flag because one of the 
-# frameworks may already provide it. 
+# The Apple build may not need an explicit flag because one of the
+# frameworks may already provide it.
 # But for non-OSX systems, I will use the CMake Threads package.
 IF(NOT APPLE)
   FIND_PACKAGE(Threads)
@@ -140,15 +140,15 @@ IF(SDL_LIBRARY_TEMP)
   ENDIF(NOT SDL_BUILDING_LIBRARY)
 
   # For OS X, SDL uses Cocoa as a backend so it must link to Cocoa.
-  # CMake doesn't display the -framework Cocoa string in the UI even 
+  # CMake doesn't display the -framework Cocoa string in the UI even
   # though it actually is there if I modify a pre-used variable.
   # I think it has something to do with the CACHE STRING.
-  # So I use a temporary variable until the end so I can set the 
+  # So I use a temporary variable until the end so I can set the
   # "real" variable in one-shot.
   IF(APPLE)
     SET(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} "-framework Cocoa")
   ENDIF(APPLE)
-    
+
   # For threads, as mentioned Apple doesn't need this.
   # In fact, there seems to be a problem if I used the Threads package
   # and try using this line, so I'm just skipping it entirely for OS X.
diff --git a/Modules/FindSDL_image.cmake b/Modules/FindSDL_image.cmake
index f215bda47..7128f67fb 100644
--- a/Modules/FindSDL_image.cmake
+++ b/Modules/FindSDL_image.cmake
@@ -8,8 +8,8 @@
 # correspond to the ./configure --prefix=$SDLDIR
 # used in building SDL.
 #
-# Created by Eric Wing. This was influenced by the FindSDL.cmake 
-# module, but with modifications to recognize OS X frameworks and 
+# Created by Eric Wing. This was influenced by the FindSDL.cmake
+# module, but with modifications to recognize OS X frameworks and
 # additional Unix paths (FreeBSD, etc).
 
 #=============================================================================
@@ -44,12 +44,12 @@ FIND_PATH(SDLIMAGE_INCLUDE_DIR SDL_image.h
   /opt/local/include/SDL # DarwinPorts
   /opt/local/include
   /opt/csw/include/SDL # Blastwave
-  /opt/csw/include 
+  /opt/csw/include
   /opt/include/SDL
   /opt/include
 )
 
-FIND_LIBRARY(SDLIMAGE_LIBRARY 
+FIND_LIBRARY(SDLIMAGE_LIBRARY
   NAMES SDL_image
   HINTS
   $ENV{SDLIMAGEDIR}
diff --git a/Modules/FindSDL_mixer.cmake b/Modules/FindSDL_mixer.cmake
index 7cc1a6b09..e8da6407a 100644
--- a/Modules/FindSDL_mixer.cmake
+++ b/Modules/FindSDL_mixer.cmake
@@ -8,8 +8,8 @@
 # correspond to the ./configure --prefix=$SDLDIR
 # used in building SDL.
 #
-# Created by Eric Wing. This was influenced by the FindSDL.cmake 
-# module, but with modifications to recognize OS X frameworks and 
+# Created by Eric Wing. This was influenced by the FindSDL.cmake
+# module, but with modifications to recognize OS X frameworks and
 # additional Unix paths (FreeBSD, etc).
 
 #=============================================================================
@@ -44,12 +44,12 @@ FIND_PATH(SDLMIXER_INCLUDE_DIR SDL_mixer.h
   /opt/local/include/SDL # DarwinPorts
   /opt/local/include
   /opt/csw/include/SDL # Blastwave
-  /opt/csw/include 
+  /opt/csw/include
   /opt/include/SDL
   /opt/include
 )
 
-FIND_LIBRARY(SDLMIXER_LIBRARY 
+FIND_LIBRARY(SDLMIXER_LIBRARY
   NAMES SDL_mixer
   HINTS
   $ENV{SDLMIXERDIR}
diff --git a/Modules/FindSDL_net.cmake b/Modules/FindSDL_net.cmake
index ca1de7977..f1bd0919e 100644
--- a/Modules/FindSDL_net.cmake
+++ b/Modules/FindSDL_net.cmake
@@ -8,8 +8,8 @@
 # correspond to the ./configure --prefix=$SDLDIR
 # used in building SDL.
 #
-# Created by Eric Wing. This was influenced by the FindSDL.cmake 
-# module, but with modifications to recognize OS X frameworks and 
+# Created by Eric Wing. This was influenced by the FindSDL.cmake
+# module, but with modifications to recognize OS X frameworks and
 # additional Unix paths (FreeBSD, etc).
 
 #=============================================================================
@@ -44,11 +44,11 @@ FIND_PATH(SDLNET_INCLUDE_DIR SDL_net.h
   /opt/local/include/SDL # DarwinPorts
   /opt/local/include
   /opt/csw/include/SDL # Blastwave
-  /opt/csw/include 
+  /opt/csw/include
   /opt/include/SDL
   /opt/include
 )
-FIND_LIBRARY(SDLNET_LIBRARY 
+FIND_LIBRARY(SDLNET_LIBRARY
   NAMES SDL_net
   HINTS
   $ENV{SDLNETDIR}
diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake
index 35294a5e4..963a811f5 100644
--- a/Modules/FindSDL_sound.cmake
+++ b/Modules/FindSDL_sound.cmake
@@ -1,18 +1,18 @@
 # Locates the SDL_sound library
 
-# This module depends on SDL being found and 
+# This module depends on SDL being found and
 # must be called AFTER FindSDL.cmake is called.
 
 # This module defines
 # SDL_SOUND_INCLUDE_DIR, where to find SDL_sound.h
 # SDL_SOUND_FOUND, if false, do not try to link to SDL
-# SDL_SOUND_LIBRARIES, this contains the list of libraries that you need 
+# SDL_SOUND_LIBRARIES, this contains the list of libraries that you need
 # to link against. This is a read-only variable and is marked INTERNAL.
 # SDL_SOUND_EXTRAS, this is an optional variable for you to add your own
 # flags to SDL_SOUND_LIBRARIES. This is prepended to SDL_SOUND_LIBRARIES.
 # This is available mostly for cases this module failed to anticipate for
 # and you must add additional flags. This is marked as ADVANCED.
- 
+
 #
 # This module also defines (but you shouldn't need to use directly)
 # SDL_SOUND_LIBRARY, the name of just the SDL_sound library you would link
@@ -26,32 +26,32 @@
 # FLAC_LIBRARY
 # SPEEX_LIBRARY
 #
-# Typically, you should not use these variables directly, and you should use 
-# SDL_SOUND_LIBRARIES which contains SDL_SOUND_LIBRARY and the other audio libraries 
-# (if needed) to successfully compile on your system . 
+# Typically, you should not use these variables directly, and you should use
+# SDL_SOUND_LIBRARIES which contains SDL_SOUND_LIBRARY and the other audio libraries
+# (if needed) to successfully compile on your system .
 #
-# Created by Eric Wing. 
+# Created by Eric Wing.
 # This module is a bit more complicated than the other FindSDL* family modules.
 # The reason is that SDL_sound can be compiled in a large variety of different ways
 # which are independent of platform. SDL_sound may dynamically link against other 3rd
 # party libraries to get additional codec support, such as Ogg Vorbis, SMPEG, ModPlug,
-# MikMod, FLAC, Speex, and potentially others. 
-# Under some circumstances which I don't fully understand, 
+# MikMod, FLAC, Speex, and potentially others.
+# Under some circumstances which I don't fully understand,
 # there seems to be a requirement
-# that dependent libraries of libraries you use must also be explicitly 
-# linked against in order to successfully compile. SDL_sound does not currently 
+# that dependent libraries of libraries you use must also be explicitly
+# linked against in order to successfully compile. SDL_sound does not currently
 # have any system in place to know how it was compiled.
-# So this CMake module does the hard work in trying to discover which 3rd party 
+# So this CMake module does the hard work in trying to discover which 3rd party
 # libraries are required for building (if any).
 # This module uses a brute force approach to create a test program that uses SDL_sound,
-# and then tries to build it. If the build fails, it parses the error output for 
+# and then tries to build it. If the build fails, it parses the error output for
 # known symbol names to figure out which libraries are needed.
 #
 # Responds to the $SDLDIR and $SDLSOUNDDIR environmental variable that would
 # correspond to the ./configure --prefix=$SDLDIR used in building SDL.
 #
 # On OSX, this will prefer the Framework version (if found) over others.
-# People will have to manually change the cache values of 
+# People will have to manually change the cache values of
 # SDL_LIBRARY to override this selectionor set the CMake environment
 # CMAKE_INCLUDE_PATH to modify the search paths.
 #
@@ -91,12 +91,12 @@ FIND_PATH(SDL_SOUND_INCLUDE_DIR SDL_sound.h
   /opt/local/include/SDL # DarwinPorts
   /opt/local/include
   /opt/csw/include/SDL # Blastwave
-  /opt/csw/include 
+  /opt/csw/include
   /opt/include/SDL
   /opt/include
   )
 
-FIND_LIBRARY(SDL_SOUND_LIBRARY 
+FIND_LIBRARY(SDL_SOUND_LIBRARY
   NAMES SDL_sound
   HINTS
   $ENV{SDLSOUNDDIR}/lib
@@ -116,7 +116,7 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
   # for the :STRING syntax if I have multiple values contained in a
   # single variable. This is a problem for the SDL_LIBRARY variable
   # because it does just that. When I feed this variable to the command,
-  # only the first value gets the appropriate modifier (e.g. -I) and 
+  # only the first value gets the appropriate modifier (e.g. -I) and
   # the rest get dropped.
   # To get multiple single variables to work, I must separate them with a "\;"
   # I could go back and modify the FindSDL.cmake module, but that's kind of painful.
@@ -125,12 +125,12 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
   # Instead, it was suggested on the mailing list to write a temporary CMakeLists.txt
   # with a temporary test project and invoke that with TRY_COMPILE.
   # See message thread "Figuring out dependencies for a library in order to build"
-  # 2005-07-16  
-  #     TRY_COMPILE( 
+  # 2005-07-16
+  #     TRY_COMPILE(
   #             MY_RESULT
   #             ${CMAKE_BINARY_DIR}
   #             ${PROJECT_SOURCE_DIR}/DetermineSoundLibs.c
-  #             CMAKE_FLAGS 
+  #             CMAKE_FLAGS
   #                     -DINCLUDE_DIRECTORIES:STRING=${SDL_INCLUDE_DIR}\;${SDL_SOUND_INCLUDE_DIR}
   #                     -DLINK_LIBRARIES:STRING=${SDL_SOUND_LIBRARY}\;${SDL_LIBRARY}
   #             OUTPUT_VARIABLE MY_OUTPUT
@@ -149,25 +149,25 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
 
         SDL_Init(0);
         Sound_Init();
-        
+
         /* This doesn't actually have to work, but Init() is a no-op
          * for some of the decoders, so this should force more symbols
          * to be pulled in.
          */
         sample = Sound_NewSampleFromFile(argv[1], &desired, 4096);
-        
+
         Sound_Quit();
         SDL_Quit();
         return 0;
      }"
      )
 
-   # Calling 
+   # Calling
    # TARGET_LINK_LIBRARIES(DetermineSoundLibs "${SDL_SOUND_LIBRARY} ${SDL_LIBRARY})
    # causes problems when SDL_LIBRARY looks like
    # /Library/Frameworks/SDL.framework;-framework Cocoa
    # The ;-framework Cocoa seems to be confusing CMake once the OS X
-   # framework support was added. I was told that breaking up the list 
+   # framework support was added. I was told that breaking up the list
    # would fix the problem.
    SET(TMP_TRY_LIBS)
    FOREACH(lib ${SDL_SOUND_LIBRARY} ${SDL_LIBRARY})
@@ -175,10 +175,10 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
    ENDFOREACH(lib)
 
    # MESSAGE("TMP_TRY_LIBS ${TMP_TRY_LIBS}")
-   
+
    # Write the CMakeLists.txt and test project
    # Weird, this is still sketchy. If I don't quote the variables
-   # in the TARGET_LINK_LIBRARIES, I seem to loose everything 
+   # in the TARGET_LINK_LIBRARIES, I seem to loose everything
    # in the SDL_LIBRARY string after the "-framework".
    # But if I quote the stuff in INCLUDE_DIRECTORIES, it doesn't work.
    FILE(WRITE ${PROJECT_BINARY_DIR}/CMakeTmp/CMakeLists.txt
@@ -188,25 +188,25 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
         TARGET_LINK_LIBRARIES(DetermineSoundLibs ${TMP_TRY_LIBS})"
      )
 
-   TRY_COMPILE( 
+   TRY_COMPILE(
      MY_RESULT
      ${PROJECT_BINARY_DIR}/CMakeTmp
      ${PROJECT_BINARY_DIR}/CMakeTmp
      DetermineSoundLibs
      OUTPUT_VARIABLE MY_OUTPUT
      )
-   
+
    # MESSAGE("${MY_RESULT}")
    # MESSAGE(${MY_OUTPUT})
-   
+
    IF(NOT MY_RESULT)
-     
+
      # I expect that MPGLIB, VOC, WAV, AIFF, and SHN are compiled in statically.
      # I think Timidity is also compiled in statically.
      # I've never had to explcitly link against Quicktime, so I'll skip that for now.
-     
+
      SET(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARY})
-     
+
      # Find MikMod
      IF("${MY_OUTPUT}" MATCHES "MikMod_")
      FIND_LIBRARY(MIKMOD_LIBRARY
@@ -222,12 +222,12 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
          /opt/local/lib
          /opt/csw/lib
        /opt/lib
-       ) 
+       )
        IF(MIKMOD_LIBRARY)
          SET(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${MIKMOD_LIBRARY})
        ENDIF(MIKMOD_LIBRARY)
      ENDIF("${MY_OUTPUT}" MATCHES "MikMod_")
-     
+
      # Find ModPlug
      IF("${MY_OUTPUT}" MATCHES "MODPLUG_")
        FIND_LIBRARY(MODPLUG_LIBRARY
@@ -249,7 +249,7 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
        ENDIF(MODPLUG_LIBRARY)
      ENDIF("${MY_OUTPUT}" MATCHES "MODPLUG_")
 
-     
+
      # Find Ogg and Vorbis
      IF("${MY_OUTPUT}" MATCHES "ov_")
        FIND_LIBRARY(VORBIS_LIBRARY
@@ -271,7 +271,7 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
        IF(VORBIS_LIBRARY)
          SET(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${VORBIS_LIBRARY})
        ENDIF(VORBIS_LIBRARY)
-       
+
        FIND_LIBRARY(OGG_LIBRARY
          NAMES ogg Ogg OGG
          PATHS
@@ -292,8 +292,8 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
          SET(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${OGG_LIBRARY})
        ENDIF(OGG_LIBRARY)
      ENDIF("${MY_OUTPUT}" MATCHES "ov_")
-     
-     
+
+
      # Find SMPEG
      IF("${MY_OUTPUT}" MATCHES "SMPEG_")
        FIND_LIBRARY(SMPEG_LIBRARY
@@ -314,8 +314,8 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
          SET(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${SMPEG_LIBRARY})
        ENDIF(SMPEG_LIBRARY)
      ENDIF("${MY_OUTPUT}" MATCHES "SMPEG_")
-     
-     
+
+
      # Find FLAC
      IF("${MY_OUTPUT}" MATCHES "FLAC_")
        FIND_LIBRARY(FLAC_LIBRARY
@@ -336,8 +336,8 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
          SET(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${FLAC_LIBRARY})
        ENDIF(FLAC_LIBRARY)
      ENDIF("${MY_OUTPUT}" MATCHES "FLAC_")
-     
-     
+
+
      # Hmmm...Speex seems to depend on Ogg. This might be a problem if
      # the TRY_COMPILE attempt gets blocked at SPEEX before it can pull
      # in the Ogg symbols. I'm not sure if I should duplicate the ogg stuff
@@ -360,7 +360,7 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
        IF(SPEEX_LIBRARY)
          SET(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${SPEEX_LIBRARY})
        ENDIF(SPEEX_LIBRARY)
-       
+
        # Find OGG (needed for Speex)
      # We might have already found Ogg for Vorbis, so skip it if so.
        IF(NOT OGG_LIBRARY)
@@ -387,7 +387,7 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
          ENDIF(OGG_LIBRARY)
        ENDIF(NOT OGG_LIBRARY)
      ENDIF("${MY_OUTPUT}" MATCHES "speex_")
-     
+
    ELSE(NOT MY_RESULT)
      SET(SDL_SOUND_LIBRARIES "${SDL_SOUND_EXTRAS} ${SDL_SOUND_LIBRARY}" CACHE INTERNAL "SDL_sound and dependent libraries")
    ENDIF(NOT MY_RESULT)
diff --git a/Modules/FindSDL_ttf.cmake b/Modules/FindSDL_ttf.cmake
index 184b6c3f5..8bba2130f 100644
--- a/Modules/FindSDL_ttf.cmake
+++ b/Modules/FindSDL_ttf.cmake
@@ -8,8 +8,8 @@
 # correspond to the ./configure --prefix=$SDLDIR
 # used in building SDL.
 #
-# Created by Eric Wing. This was influenced by the FindSDL.cmake 
-# module, but with modifications to recognize OS X frameworks and 
+# Created by Eric Wing. This was influenced by the FindSDL.cmake
+# module, but with modifications to recognize OS X frameworks and
 # additional Unix paths (FreeBSD, etc).
 
 #=============================================================================
@@ -44,12 +44,12 @@ FIND_PATH(SDLTTF_INCLUDE_DIR SDL_ttf.h
   /opt/local/include/SDL # DarwinPorts
   /opt/local/include
   /opt/csw/include/SDL # Blastwave
-  /opt/csw/include 
+  /opt/csw/include
   /opt/include/SDL
   /opt/include
 )
 
-FIND_LIBRARY(SDLTTF_LIBRARY 
+FIND_LIBRARY(SDLTTF_LIBRARY
   NAMES SDL_ttf
   HINTS
   $ENV{SDLTTFDIR}
diff --git a/Modules/FindSWIG.cmake b/Modules/FindSWIG.cmake
index 2e34eb1b4..d11d1e47b 100644
--- a/Modules/FindSWIG.cmake
+++ b/Modules/FindSWIG.cmake
@@ -35,7 +35,7 @@ IF(SWIG_EXECUTABLE)
     ERROR_VARIABLE SWIG_swiglib_error
     RESULT_VARIABLE SWIG_swiglib_result)
 
-  IF(SWIG_swiglib_result) 
+  IF(SWIG_swiglib_result)
     IF(SWIG_FIND_REQUIRED)
       MESSAGE(SEND_ERROR "Command \"${SWIG_EXECUTABLE} -swiglib\" failed with output:\n${SWIG_swiglib_error}")
     ELSE(SWIG_FIND_REQUIRED)
diff --git a/Modules/FindSelfPackers.cmake b/Modules/FindSelfPackers.cmake
index d9dc25c26..d13b0c4dd 100644
--- a/Modules/FindSelfPackers.cmake
+++ b/Modules/FindSelfPackers.cmake
@@ -24,7 +24,7 @@ FIND_PROGRAM(SELF_PACKER_FOR_EXECUTABLE
   upx
   ${CYGWIN_INSTALL_PATH}/bin
   /bin
-  /usr/bin 
+  /usr/bin
   /usr/local/bin
   /sbin
 )
@@ -33,7 +33,7 @@ FIND_PROGRAM(SELF_PACKER_FOR_SHARED_LIB
   upx
   ${CYGWIN_INSTALL_PATH}/bin
   /bin
-  /usr/bin 
+  /usr/bin
   /usr/local/bin
   /sbin
 )
@@ -47,18 +47,18 @@ MARK_AS_ADVANCED(
 # Set flags
 #
 IF (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx")
-  SET (SELF_PACKER_FOR_EXECUTABLE_FLAGS "-q" CACHE STRING 
+  SET (SELF_PACKER_FOR_EXECUTABLE_FLAGS "-q" CACHE STRING
        "Flags for the executable self-packer.")
 ELSE (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx")
-  SET (SELF_PACKER_FOR_EXECUTABLE_FLAGS "" CACHE STRING 
+  SET (SELF_PACKER_FOR_EXECUTABLE_FLAGS "" CACHE STRING
        "Flags for the executable self-packer.")
 ENDIF (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx")
 
 IF (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx")
-  SET (SELF_PACKER_FOR_SHARED_LIB_FLAGS "-q" CACHE STRING 
+  SET (SELF_PACKER_FOR_SHARED_LIB_FLAGS "-q" CACHE STRING
        "Flags for the shared lib self-packer.")
 ELSE (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx")
-  SET (SELF_PACKER_FOR_SHARED_LIB_FLAGS "" CACHE STRING 
+  SET (SELF_PACKER_FOR_SHARED_LIB_FLAGS "" CACHE STRING
        "Flags for the shared lib self-packer.")
 ENDIF (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx")
 
diff --git a/Modules/FindSquish.cmake b/Modules/FindSquish.cmake
index 48d195a1e..3b69b07f7 100644
--- a/Modules/FindSquish.cmake
+++ b/Modules/FindSquish.cmake
@@ -79,7 +79,7 @@ IF(SQUISH_INSTALL_DIR)
   # find the server program
   IF(NOT SQUISH_SERVER_EXECUTABLE)
     FIND_PROGRAM(SQUISH_SERVER_EXECUTABLE ${SQUISH_INSTALL_DIR}/bin/squishserver DOC "The ${SQUISH_SERVER_EXECUTABLE_STRING}")
-  ENDIF(NOT SQUISH_SERVER_EXECUTABLE)  
+  ENDIF(NOT SQUISH_SERVER_EXECUTABLE)
 
 ELSE(SQUISH_INSTALL_DIR)
   SET(SQUISH_INSTALL_DIR_FOUND 0)
@@ -88,14 +88,14 @@ ENDIF(SQUISH_INSTALL_DIR)
 # record if executables are set
 IF(SQUISH_CLIENT_EXECUTABLE)
   SET(SQUISH_CLIENT_EXECUTABLE_FOUND 1)
-ELSE(SQUISH_CLIENT_EXECUTABLE)    
-  SET(SQUISH_CLIENT_EXECUTABLE_FOUND 0)    
+ELSE(SQUISH_CLIENT_EXECUTABLE)
+  SET(SQUISH_CLIENT_EXECUTABLE_FOUND 0)
 ENDIF(SQUISH_CLIENT_EXECUTABLE)
 
 IF(SQUISH_SERVER_EXECUTABLE)
   SET(SQUISH_SERVER_EXECUTABLE_FOUND 1)
-ELSE(SQUISH_SERVER_EXECUTABLE)    
-  SET(SQUISH_SERVER_EXECUTABLE_FOUND 0)    
+ELSE(SQUISH_SERVER_EXECUTABLE)
+  SET(SQUISH_SERVER_EXECUTABLE_FOUND 0)
 ENDIF(SQUISH_SERVER_EXECUTABLE)
 
 # record if Squish was found
@@ -122,4 +122,4 @@ MACRO(SQUISH_ADD_TEST testName testAUT testCase envVars testWraper)
     PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED;ERROR;FATAL"
     )
 ENDMACRO(SQUISH_ADD_TEST)
-  
+
diff --git a/Modules/FindTCL.cmake b/Modules/FindTCL.cmake
index 7f6d3a7ee..763b5ef54 100644
--- a/Modules/FindTCL.cmake
+++ b/Modules/FindTCL.cmake
@@ -18,11 +18,11 @@
 # - The stub libraries are now found in FindTclStub.cmake
 #   => they were only useful for people writing Tcl/Tk extensions.
 # - TCL_LIBRARY_DEBUG and TK_LIBRARY_DEBUG were removed.
-#   => these libs are not packaged by default with Tcl/Tk distributions. 
+#   => these libs are not packaged by default with Tcl/Tk distributions.
 #      Even when Tcl/Tk is built from source, several flavors of debug libs
 #      are created and there is no real reason to pick a single one
-#      specifically (say, amongst tcl84g, tcl84gs, or tcl84sgx). 
-#      Let's leave that choice to the user by allowing him to assign 
+#      specifically (say, amongst tcl84g, tcl84gs, or tcl84sgx).
+#      Let's leave that choice to the user by allowing him to assign
 #      TCL_LIBRARY to any Tcl library, debug or not.
 # - TK_INTERNAL_PATH was removed.
 #   => this ended up being only a Win32 variable, and there is a lot of
@@ -59,7 +59,7 @@ ENDIF(TCLSH_VERSION_STRING)
 
 GET_FILENAME_COMPONENT(TK_WISH_PATH "${TK_WISH}" PATH)
 GET_FILENAME_COMPONENT(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH)
-STRING(REGEX REPLACE 
+STRING(REGEX REPLACE
   "^.*wish([0-9]\\.*[0-9]).*$" "\\1" TK_WISH_VERSION "${TK_WISH}")
 
 GET_FILENAME_COMPONENT(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
@@ -67,12 +67,12 @@ GET_FILENAME_COMPONENT(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH)
 
 GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
 GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH)
-STRING(REGEX REPLACE 
+STRING(REGEX REPLACE
   "^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_LIBRARY_VERSION "${TCL_LIBRARY}")
 
 GET_FILENAME_COMPONENT(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH)
 GET_FILENAME_COMPONENT(TK_LIBRARY_PATH_PARENT "${TK_LIBRARY_PATH}" PATH)
-STRING(REGEX REPLACE 
+STRING(REGEX REPLACE
   "^.*tk([0-9]\\.*[0-9]).*$" "\\1" TK_LIBRARY_VERSION "${TK_LIBRARY}")
 
 SET(TCLTK_POSSIBLE_LIB_PATHS
@@ -86,8 +86,8 @@ SET(TCLTK_POSSIBLE_LIB_PATHS
 
 IF(WIN32)
   GET_FILENAME_COMPONENT(
-    ActiveTcl_CurrentVersion 
-    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]" 
+    ActiveTcl_CurrentVersion
+    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
     NAME)
   SET(TCLTK_POSSIBLE_LIB_PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/lib"
@@ -98,33 +98,33 @@ IF(WIN32)
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/lib"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/lib"
     "$ENV{ProgramFiles}/Tcl/Lib"
-    "C:/Program Files/Tcl/lib" 
-    "C:/Tcl/lib" 
+    "C:/Program Files/Tcl/lib"
+    "C:/Tcl/lib"
     )
 ENDIF(WIN32)
 
 FIND_LIBRARY(TCL_LIBRARY
-  NAMES 
-  tcl   
+  NAMES
+  tcl
   tcl${TCL_LIBRARY_VERSION} tcl${TCL_TCLSH_VERSION} tcl${TK_WISH_VERSION}
-  tcl86 tcl8.6 
-  tcl85 tcl8.5 
-  tcl84 tcl8.4 
-  tcl83 tcl8.3 
-  tcl82 tcl8.2 
+  tcl86 tcl8.6
+  tcl85 tcl8.5
+  tcl84 tcl8.4
+  tcl83 tcl8.3
+  tcl82 tcl8.2
   tcl80 tcl8.0
   PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
   )
 
-FIND_LIBRARY(TK_LIBRARY 
-  NAMES 
+FIND_LIBRARY(TK_LIBRARY
+  NAMES
   tk
   tk${TK_LIBRARY_VERSION} tk${TCL_TCLSH_VERSION} tk${TK_WISH_VERSION}
   tk86 tk8.6
-  tk85 tk8.5 
-  tk84 tk8.4 
-  tk83 tk8.3 
-  tk82 tk8.2 
+  tk85 tk8.5
+  tk84 tk8.4
+  tk83 tk8.3
+  tk82 tk8.2
   tk80 tk8.0
   PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
   )
@@ -156,8 +156,8 @@ SET(TCLTK_POSSIBLE_INCLUDE_PATHS
   "${TK_LIBRARY_PATH_PARENT}/include"
   "${TCL_INCLUDE_PATH}"
   "${TK_INCLUDE_PATH}"
-  ${TCL_FRAMEWORK_INCLUDES} 
-  ${TK_FRAMEWORK_INCLUDES} 
+  ${TCL_FRAMEWORK_INCLUDES}
+  ${TK_FRAMEWORK_INCLUDES}
   "${TCL_TCLSH_PATH_PARENT}/include"
   "${TK_WISH_PATH_PARENT}/include"
   /usr/include/tcl${TK_LIBRARY_VERSION}
@@ -185,17 +185,17 @@ IF(WIN32)
     )
 ENDIF(WIN32)
 
-FIND_PATH(TCL_INCLUDE_PATH 
+FIND_PATH(TCL_INCLUDE_PATH
   NAMES tcl.h
   HINTS ${TCLTK_POSSIBLE_INCLUDE_PATHS}
   )
 
-FIND_PATH(TK_INCLUDE_PATH 
+FIND_PATH(TK_INCLUDE_PATH
   NAMES tk.h
   HINTS ${TCLTK_POSSIBLE_INCLUDE_PATHS}
   )
 
-# handle the QUIETLY and REQUIRED arguments and set TCL_FOUND to TRUE if 
+# handle the QUIETLY and REQUIRED arguments and set TCL_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 
diff --git a/Modules/FindTIFF.cmake b/Modules/FindTIFF.cmake
index 16f9e238a..be410fd03 100644
--- a/Modules/FindTIFF.cmake
+++ b/Modules/FindTIFF.cmake
@@ -34,7 +34,7 @@ IF(TIFF_INCLUDE_DIR AND EXISTS "${TIFF_INCLUDE_DIR}/tiffvers.h")
     UNSET(tiff_version_str)
 ENDIF()
 
-# handle the QUIETLY and REQUIRED arguments and set TIFF_FOUND to TRUE if 
+# handle the QUIETLY and REQUIRED arguments and set TIFF_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(TIFF
diff --git a/Modules/FindTclStub.cmake b/Modules/FindTclStub.cmake
index 79d14aeb4..1e8350811 100644
--- a/Modules/FindTclStub.cmake
+++ b/Modules/FindTclStub.cmake
@@ -14,11 +14,11 @@
 # who are not necessarily Tcl/Tk gurus/developpers, some variables were
 # moved or removed. Changes compared to CMake 2.4 are:
 # - TCL_STUB_LIBRARY_DEBUG and TK_STUB_LIBRARY_DEBUG were removed.
-#   => these libs are not packaged by default with Tcl/Tk distributions. 
+#   => these libs are not packaged by default with Tcl/Tk distributions.
 #      Even when Tcl/Tk is built from source, several flavors of debug libs
 #      are created and there is no real reason to pick a single one
-#      specifically (say, amongst tclstub84g, tclstub84gs, or tclstub84sgx). 
-#      Let's leave that choice to the user by allowing him to assign 
+#      specifically (say, amongst tclstub84g, tclstub84gs, or tclstub84sgx).
+#      Let's leave that choice to the user by allowing him to assign
 #      TCL_STUB_LIBRARY to any Tcl library, debug or not.
 
 #=============================================================================
@@ -38,12 +38,12 @@ INCLUDE(FindTCL)
 
 GET_FILENAME_COMPONENT(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
 GET_FILENAME_COMPONENT(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH)
-STRING(REGEX REPLACE 
+STRING(REGEX REPLACE
   "^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}")
 
 GET_FILENAME_COMPONENT(TK_WISH_PATH "${TK_WISH}" PATH)
 GET_FILENAME_COMPONENT(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH)
-STRING(REGEX REPLACE 
+STRING(REGEX REPLACE
   "^.*wish([0-9]\\.*[0-9]).*$" "\\1" TK_WISH_VERSION "${TK_WISH}")
 
 GET_FILENAME_COMPONENT(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
@@ -51,12 +51,12 @@ GET_FILENAME_COMPONENT(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH)
 
 GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
 GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH)
-STRING(REGEX REPLACE 
+STRING(REGEX REPLACE
   "^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_LIBRARY_VERSION "${TCL_LIBRARY}")
 
 GET_FILENAME_COMPONENT(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH)
 GET_FILENAME_COMPONENT(TK_LIBRARY_PATH_PARENT "${TK_LIBRARY_PATH}" PATH)
-STRING(REGEX REPLACE 
+STRING(REGEX REPLACE
   "^.*tk([0-9]\\.*[0-9]).*$" "\\1" TK_LIBRARY_VERSION "${TK_LIBRARY}")
 
 SET(TCLTK_POSSIBLE_LIB_PATHS
@@ -70,8 +70,8 @@ SET(TCLTK_POSSIBLE_LIB_PATHS
 
 IF(WIN32)
   GET_FILENAME_COMPONENT(
-    ActiveTcl_CurrentVersion 
-    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]" 
+    ActiveTcl_CurrentVersion
+    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
     NAME)
   SET(TCLTK_POSSIBLE_LIB_PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/lib"
@@ -82,45 +82,45 @@ IF(WIN32)
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/lib"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/lib"
     "$ENV{ProgramFiles}/Tcl/Lib"
-    "C:/Program Files/Tcl/lib" 
-    "C:/Tcl/lib" 
+    "C:/Program Files/Tcl/lib"
+    "C:/Tcl/lib"
     )
 ENDIF(WIN32)
 
 FIND_LIBRARY(TCL_STUB_LIBRARY
-  NAMES 
-  tclstub 
+  NAMES
+  tclstub
   tclstub${TK_LIBRARY_VERSION} tclstub${TCL_TCLSH_VERSION} tclstub${TK_WISH_VERSION}
   tclstub86 tclstub8.6
-  tclstub85 tclstub8.5 
-  tclstub84 tclstub8.4 
-  tclstub83 tclstub8.3 
-  tclstub82 tclstub8.2 
+  tclstub85 tclstub8.5
+  tclstub84 tclstub8.4
+  tclstub83 tclstub8.3
+  tclstub82 tclstub8.2
   tclstub80 tclstub8.0
   PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
 )
 
-FIND_LIBRARY(TK_STUB_LIBRARY 
-  NAMES 
-  tkstub 
+FIND_LIBRARY(TK_STUB_LIBRARY
+  NAMES
+  tkstub
   tkstub${TCL_LIBRARY_VERSION} tkstub${TCL_TCLSH_VERSION} tkstub${TK_WISH_VERSION}
   tkstub86 tkstub8.6
-  tkstub85 tkstub8.5 
-  tkstub84 tkstub8.4 
-  tkstub83 tkstub8.3 
-  tkstub82 tkstub8.2 
+  tkstub85 tkstub8.5
+  tkstub84 tkstub8.4
+  tkstub83 tkstub8.3
+  tkstub82 tkstub8.2
   tkstub80 tkstub8.0
   PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
 )
 
-FIND_LIBRARY(TTK_STUB_LIBRARY 
-  NAMES 
-  ttkstub 
+FIND_LIBRARY(TTK_STUB_LIBRARY
+  NAMES
+  ttkstub
   ttkstub${TCL_LIBRARY_VERSION} ttkstub${TCL_TCLSH_VERSION} ttkstub${TK_WISH_VERSION}
   ttkstub88 ttkstub8.8
   ttkstub87 ttkstub8.7
   ttkstub86 ttkstub8.6
-  ttkstub85 ttkstub8.5 
+  ttkstub85 ttkstub8.5
   PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
 )
 
diff --git a/Modules/FindTclsh.cmake b/Modules/FindTclsh.cmake
index a45f28528..fdeafffaf 100644
--- a/Modules/FindTclsh.cmake
+++ b/Modules/FindTclsh.cmake
@@ -26,7 +26,7 @@ ENDIF(CYGWIN)
 
 GET_FILENAME_COMPONENT(TK_WISH_PATH "${TK_WISH}" PATH)
 GET_FILENAME_COMPONENT(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH)
-STRING(REGEX REPLACE 
+STRING(REGEX REPLACE
   "^.*wish([0-9]\\.*[0-9]).*$" "\\1" TK_WISH_VERSION "${TK_WISH}")
 
 GET_FILENAME_COMPONENT(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
@@ -34,12 +34,12 @@ GET_FILENAME_COMPONENT(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH)
 
 GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
 GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH)
-STRING(REGEX REPLACE 
+STRING(REGEX REPLACE
   "^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_LIBRARY_VERSION "${TCL_LIBRARY}")
 
 GET_FILENAME_COMPONENT(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH)
 GET_FILENAME_COMPONENT(TK_LIBRARY_PATH_PARENT "${TK_LIBRARY_PATH}" PATH)
-STRING(REGEX REPLACE 
+STRING(REGEX REPLACE
   "^.*tk([0-9]\\.*[0-9]).*$" "\\1" TK_LIBRARY_VERSION "${TK_LIBRARY}")
 
 SET(TCLTK_POSSIBLE_BIN_PATHS
@@ -52,8 +52,8 @@ SET(TCLTK_POSSIBLE_BIN_PATHS
 
 IF(WIN32)
   GET_FILENAME_COMPONENT(
-    ActiveTcl_CurrentVersion 
-    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]" 
+    ActiveTcl_CurrentVersion
+    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
     NAME)
   SET(TCLTK_POSSIBLE_BIN_PATHS ${TCLTK_POSSIBLE_BIN_PATHS}
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/bin"
@@ -90,7 +90,7 @@ IF(TCL_TCLSH)
                    OUTPUT_STRIP_TRAILING_WHITESPACE)
 ENDIF(TCL_TCLSH)
 
-# handle the QUIETLY and REQUIRED arguments and set TIFF_FOUND to TRUE if 
+# handle the QUIETLY and REQUIRED arguments and set TIFF_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Tclsh
diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake
index 21614fb66..bb1ba3c9f 100644
--- a/Modules/FindThreads.cmake
+++ b/Modules/FindThreads.cmake
@@ -98,14 +98,14 @@ ELSE()
             MESSAGE(STATUS "Check if compiler accepts -pthread - yes")
           ELSE()
             MESSAGE(STATUS "Check if compiler accepts -pthread - no")
-            FILE(APPEND 
-              ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
+            FILE(APPEND
+              ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
               "Determining if compiler accepts -pthread returned ${THREADS_PTHREAD_ARG} instead of 2. The compiler had the following output:\n${OUTPUT}\n\n")
           ENDIF()
         ELSE()
           MESSAGE(STATUS "Check if compiler accepts -pthread - no")
-          FILE(APPEND 
-            ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
+          FILE(APPEND
+            ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
             "Determining if compiler accepts -pthread failed with the following output:\n${OUTPUT}\n\n")
         ENDIF()
 
diff --git a/Modules/FindUnixCommands.cmake b/Modules/FindUnixCommands.cmake
index 9c0264d22..4ada05c47 100644
--- a/Modules/FindUnixCommands.cmake
+++ b/Modules/FindUnixCommands.cmake
@@ -21,7 +21,7 @@ FIND_PROGRAM(BASH
   bash
   ${CYGWIN_INSTALL_PATH}/bin
   /bin
-  /usr/bin 
+  /usr/bin
   /usr/local/bin
   /sbin
 )
@@ -33,7 +33,7 @@ FIND_PROGRAM(CP
   cp
   ${CYGWIN_INSTALL_PATH}/bin
   /bin
-  /usr/bin 
+  /usr/bin
   /usr/local/bin
   /sbin
 )
@@ -45,7 +45,7 @@ FIND_PROGRAM(GZIP
   gzip
   ${CYGWIN_INSTALL_PATH}/bin
   /bin
-  /usr/bin 
+  /usr/bin
   /usr/local/bin
   /sbin
 )
@@ -57,7 +57,7 @@ FIND_PROGRAM(MV
   mv
   ${CYGWIN_INSTALL_PATH}/bin
   /bin
-  /usr/bin 
+  /usr/bin
   /usr/local/bin
   /sbin
 )
@@ -69,7 +69,7 @@ FIND_PROGRAM(RM
   rm
   ${CYGWIN_INSTALL_PATH}/bin
   /bin
-  /usr/bin 
+  /usr/bin
   /usr/local/bin
   /sbin
 )
@@ -78,13 +78,13 @@ MARK_AS_ADVANCED(
 )
 
 FIND_PROGRAM(TAR
-  NAMES 
-  tar 
+  NAMES
+  tar
   gtar
   PATH
   ${CYGWIN_INSTALL_PATH}/bin
   /bin
-  /usr/bin 
+  /usr/bin
   /usr/local/bin
   /sbin
 )
diff --git a/Modules/FindVTK.cmake b/Modules/FindVTK.cmake
index 6b1772fa4..fbdac7f8f 100644
--- a/Modules/FindVTK.cmake
+++ b/Modules/FindVTK.cmake
@@ -4,26 +4,26 @@
 #  VTK_FOUND         - Set to true when VTK is found.
 #  VTK_USE_FILE      - CMake file to use VTK.
 #  VTK_MAJOR_VERSION - The VTK major version number.
-#  VTK_MINOR_VERSION - The VTK minor version number 
+#  VTK_MINOR_VERSION - The VTK minor version number
 #                       (odd non-release).
-#  VTK_BUILD_VERSION - The VTK patch level 
+#  VTK_BUILD_VERSION - The VTK patch level
 #                       (meaningless for odd minor).
 #  VTK_INCLUDE_DIRS  - Include directories for VTK
 #  VTK_LIBRARY_DIRS  - Link directories for VTK libraries
-#  VTK_KITS          - List of VTK kits, in CAPS 
+#  VTK_KITS          - List of VTK kits, in CAPS
 #                      (COMMON,IO,) etc.
 #  VTK_LANGUAGES     - List of wrapped languages, in CAPS
 #                      (TCL, PYHTON,) etc.
 # The following cache entries must be set by the user to locate VTK:
-#  VTK_DIR  - The directory containing VTKConfig.cmake.  
+#  VTK_DIR  - The directory containing VTKConfig.cmake.
 #             This is either the root of the build tree,
-#             or the lib/vtk directory.  This is the 
+#             or the lib/vtk directory.  This is the
 #             only cache entry.
 # The following variables are set for backward compatibility and
 # should not be used in new code:
 #  USE_VTK_FILE - The full path to the UseVTK.cmake file.
-#                 This is provided for backward 
-#                 compatibility.  Use VTK_USE_FILE 
+#                 This is provided for backward
+#                 compatibility.  Use VTK_USE_FILE
 #                 instead.
 #
 
diff --git a/Modules/FindWget.cmake b/Modules/FindWget.cmake
index c94132c27..ee4057dfd 100644
--- a/Modules/FindWget.cmake
+++ b/Modules/FindWget.cmake
@@ -1,5 +1,5 @@
 # - Find wget
-# This module looks for wget. This module defines the 
+# This module looks for wget. This module defines the
 # following values:
 #  WGET_EXECUTABLE: the full path to the wget tool.
 #  WGET_FOUND: True if wget has been found.
@@ -24,7 +24,7 @@ FIND_PROGRAM(WGET_EXECUTABLE
   ${CYGWIN_INSTALL_PATH}/bin
 )
 
-# handle the QUIETLY and REQUIRED arguments and set WGET_FOUND to TRUE if 
+# handle the QUIETLY and REQUIRED arguments and set WGET_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Wget DEFAULT_MSG WGET_EXECUTABLE)
diff --git a/Modules/FindWish.cmake b/Modules/FindWish.cmake
index a4960cd17..8a1cd8d36 100644
--- a/Modules/FindWish.cmake
+++ b/Modules/FindWish.cmake
@@ -26,7 +26,7 @@ ENDIF(UNIX)
 
 GET_FILENAME_COMPONENT(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
 GET_FILENAME_COMPONENT(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH)
-STRING(REGEX REPLACE 
+STRING(REGEX REPLACE
   "^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}")
 
 GET_FILENAME_COMPONENT(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
@@ -34,12 +34,12 @@ GET_FILENAME_COMPONENT(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH)
 
 GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
 GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH)
-STRING(REGEX REPLACE 
+STRING(REGEX REPLACE
   "^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_LIBRARY_VERSION "${TCL_LIBRARY}")
 
 GET_FILENAME_COMPONENT(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH)
 GET_FILENAME_COMPONENT(TK_LIBRARY_PATH_PARENT "${TK_LIBRARY_PATH}" PATH)
-STRING(REGEX REPLACE 
+STRING(REGEX REPLACE
   "^.*tk([0-9]\\.*[0-9]).*$" "\\1" TK_LIBRARY_VERSION "${TK_LIBRARY}")
 
 SET(TCLTK_POSSIBLE_BIN_PATHS
@@ -52,8 +52,8 @@ SET(TCLTK_POSSIBLE_BIN_PATHS
 
 IF(WIN32)
   GET_FILENAME_COMPONENT(
-    ActiveTcl_CurrentVersion 
-    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]" 
+    ActiveTcl_CurrentVersion
+    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
     NAME)
   SET(TCLTK_POSSIBLE_BIN_PATHS ${TCLTK_POSSIBLE_BIN_PATHS}
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/bin"
@@ -67,13 +67,13 @@ IF(WIN32)
 ENDIF(WIN32)
 
 SET(TK_WISH_NAMES
-  wish 
+  wish
   wish${TCL_LIBRARY_VERSION} wish${TK_LIBRARY_VERSION} wish${TCL_TCLSH_VERSION}
   wish86 wish8.6
-  wish85 wish8.5 
-  wish84 wish8.4 
-  wish83 wish8.3 
-  wish82 wish8.2 
+  wish85 wish8.5
+  wish84 wish8.4
+  wish83 wish8.3
+  wish82 wish8.2
   wish80 wish8.0
   )
 
diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake
index 166e29181..e42b5a416 100644
--- a/Modules/FindZLIB.cmake
+++ b/Modules/FindZLIB.cmake
@@ -79,7 +79,7 @@ IF(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
     SET(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}")
 ENDIF()
 
-# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if 
+# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_DIR
diff --git a/Modules/Findosg.cmake b/Modules/Findosg.cmake
index 0106372e3..fb7421e85 100644
--- a/Modules/Findosg.cmake
+++ b/Modules/Findosg.cmake
@@ -3,16 +3,16 @@
 # introduced in CMake 2.6.3 and not use this Find module directly.
 #
 # This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must 
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these 
-# modules won't do it for you. This is to allow you control over your own 
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
 # system piece by piece in case you need to opt out of certain components
 # or change the Find behavior for a particular module (perhaps because the
 # default FindOpenGL.cmake module doesn't work with your system as an
 # example).
 # If you want to use a more convenient module that includes everything,
 # use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-# 
+#
 # Locate osg
 # This module defines
 #
diff --git a/Modules/FindosgAnimation.cmake b/Modules/FindosgAnimation.cmake
index b9b44a081..1c8eb5068 100644
--- a/Modules/FindosgAnimation.cmake
+++ b/Modules/FindosgAnimation.cmake
@@ -1,14 +1,14 @@
 # This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must 
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these 
-# modules won't do it for you. This is to allow you control over your own 
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
 # system piece by piece in case you need to opt out of certain components
 # or change the Find behavior for a particular module (perhaps because the
 # default FindOpenGL.cmake module doesn't work with your system as an
 # example).
 # If you want to use a more convenient module that includes everything,
 # use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-# 
+#
 # Locate osgAnimation
 # This module defines
 #
diff --git a/Modules/FindosgDB.cmake b/Modules/FindosgDB.cmake
index eabdde72d..76272aa67 100644
--- a/Modules/FindosgDB.cmake
+++ b/Modules/FindosgDB.cmake
@@ -1,14 +1,14 @@
 # This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must 
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these 
-# modules won't do it for you. This is to allow you control over your own 
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
 # system piece by piece in case you need to opt out of certain components
 # or change the Find behavior for a particular module (perhaps because the
 # default FindOpenGL.cmake module doesn't work with your system as an
 # example).
 # If you want to use a more convenient module that includes everything,
 # use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-# 
+#
 # Locate osgDB
 # This module defines
 #
diff --git a/Modules/FindosgFX.cmake b/Modules/FindosgFX.cmake
index 81d5af5a2..331475093 100644
--- a/Modules/FindosgFX.cmake
+++ b/Modules/FindosgFX.cmake
@@ -1,14 +1,14 @@
 # This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must 
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these 
-# modules won't do it for you. This is to allow you control over your own 
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
 # system piece by piece in case you need to opt out of certain components
 # or change the Find behavior for a particular module (perhaps because the
 # default FindOpenGL.cmake module doesn't work with your system as an
 # example).
 # If you want to use a more convenient module that includes everything,
 # use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-# 
+#
 # Locate osgFX
 # This module defines
 #
diff --git a/Modules/FindosgGA.cmake b/Modules/FindosgGA.cmake
index a4fe79b0d..fd9317d5e 100644
--- a/Modules/FindosgGA.cmake
+++ b/Modules/FindosgGA.cmake
@@ -1,14 +1,14 @@
 # This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must 
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these 
-# modules won't do it for you. This is to allow you control over your own 
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
 # system piece by piece in case you need to opt out of certain components
 # or change the Find behavior for a particular module (perhaps because the
 # default FindOpenGL.cmake module doesn't work with your system as an
 # example).
 # If you want to use a more convenient module that includes everything,
 # use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-# 
+#
 # Locate osgGA
 # This module defines
 #
diff --git a/Modules/FindosgIntrospection.cmake b/Modules/FindosgIntrospection.cmake
index 24e6ed585..2394c0592 100644
--- a/Modules/FindosgIntrospection.cmake
+++ b/Modules/FindosgIntrospection.cmake
@@ -1,14 +1,14 @@
 # This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must 
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these 
-# modules won't do it for you. This is to allow you control over your own 
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
 # system piece by piece in case you need to opt out of certain components
 # or change the Find behavior for a particular module (perhaps because the
 # default FindOpenGL.cmake module doesn't work with your system as an
 # example).
 # If you want to use a more convenient module that includes everything,
 # use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-# 
+#
 # Locate osgINTROSPECTION
 # This module defines
 #
diff --git a/Modules/FindosgManipulator.cmake b/Modules/FindosgManipulator.cmake
index f71b5fd5c..9e5857083 100644
--- a/Modules/FindosgManipulator.cmake
+++ b/Modules/FindosgManipulator.cmake
@@ -1,14 +1,14 @@
 # This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must 
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these 
-# modules won't do it for you. This is to allow you control over your own 
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
 # system piece by piece in case you need to opt out of certain components
 # or change the Find behavior for a particular module (perhaps because the
 # default FindOpenGL.cmake module doesn't work with your system as an
 # example).
 # If you want to use a more convenient module that includes everything,
 # use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-# 
+#
 # Locate osgManipulator
 # This module defines
 #
diff --git a/Modules/FindosgParticle.cmake b/Modules/FindosgParticle.cmake
index f23a83fdd..2f93389ff 100644
--- a/Modules/FindosgParticle.cmake
+++ b/Modules/FindosgParticle.cmake
@@ -1,14 +1,14 @@
 # This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must 
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these 
-# modules won't do it for you. This is to allow you control over your own 
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
 # system piece by piece in case you need to opt out of certain components
 # or change the Find behavior for a particular module (perhaps because the
 # default FindOpenGL.cmake module doesn't work with your system as an
 # example).
 # If you want to use a more convenient module that includes everything,
 # use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-# 
+#
 # Locate osgParticle
 # This module defines
 #
diff --git a/Modules/FindosgProducer.cmake b/Modules/FindosgProducer.cmake
index 51f609064..2c3800b54 100644
--- a/Modules/FindosgProducer.cmake
+++ b/Modules/FindosgProducer.cmake
@@ -1,14 +1,14 @@
 # This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must 
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these 
-# modules won't do it for you. This is to allow you control over your own 
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
 # system piece by piece in case you need to opt out of certain components
 # or change the Find behavior for a particular module (perhaps because the
 # default FindOpenGL.cmake module doesn't work with your system as an
 # example).
 # If you want to use a more convenient module that includes everything,
 # use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-# 
+#
 # Locate osgProducer
 # This module defines
 #
diff --git a/Modules/FindosgShadow.cmake b/Modules/FindosgShadow.cmake
index 278f8ae9e..ca87b5611 100644
--- a/Modules/FindosgShadow.cmake
+++ b/Modules/FindosgShadow.cmake
@@ -1,14 +1,14 @@
 # This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must 
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these 
-# modules won't do it for you. This is to allow you control over your own 
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
 # system piece by piece in case you need to opt out of certain components
 # or change the Find behavior for a particular module (perhaps because the
 # default FindOpenGL.cmake module doesn't work with your system as an
 # example).
 # If you want to use a more convenient module that includes everything,
 # use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-# 
+#
 # Locate osgShadow
 # This module defines
 #
diff --git a/Modules/FindosgSim.cmake b/Modules/FindosgSim.cmake
index 15daf64fe..2fc5105d1 100644
--- a/Modules/FindosgSim.cmake
+++ b/Modules/FindosgSim.cmake
@@ -1,14 +1,14 @@
 # This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must 
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these 
-# modules won't do it for you. This is to allow you control over your own 
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
 # system piece by piece in case you need to opt out of certain components
 # or change the Find behavior for a particular module (perhaps because the
 # default FindOpenGL.cmake module doesn't work with your system as an
 # example).
 # If you want to use a more convenient module that includes everything,
 # use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-# 
+#
 # Locate osgSim
 # This module defines
 #
diff --git a/Modules/FindosgTerrain.cmake b/Modules/FindosgTerrain.cmake
index fbf373e59..eafd8fbc0 100644
--- a/Modules/FindosgTerrain.cmake
+++ b/Modules/FindosgTerrain.cmake
@@ -1,14 +1,14 @@
 # This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must 
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these 
-# modules won't do it for you. This is to allow you control over your own 
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
 # system piece by piece in case you need to opt out of certain components
 # or change the Find behavior for a particular module (perhaps because the
 # default FindOpenGL.cmake module doesn't work with your system as an
 # example).
 # If you want to use a more convenient module that includes everything,
 # use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-# 
+#
 # Locate osgTerrain
 # This module defines
 #
diff --git a/Modules/FindosgText.cmake b/Modules/FindosgText.cmake
index 22f825f54..57655b196 100644
--- a/Modules/FindosgText.cmake
+++ b/Modules/FindosgText.cmake
@@ -1,14 +1,14 @@
 # This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must 
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these 
-# modules won't do it for you. This is to allow you control over your own 
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
 # system piece by piece in case you need to opt out of certain components
 # or change the Find behavior for a particular module (perhaps because the
 # default FindOpenGL.cmake module doesn't work with your system as an
 # example).
 # If you want to use a more convenient module that includes everything,
 # use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-# 
+#
 # Locate osgText
 # This module defines
 #
diff --git a/Modules/FindosgUtil.cmake b/Modules/FindosgUtil.cmake
index 05a74df84..eeabc34af 100644
--- a/Modules/FindosgUtil.cmake
+++ b/Modules/FindosgUtil.cmake
@@ -1,14 +1,14 @@
 # This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must 
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these 
-# modules won't do it for you. This is to allow you control over your own 
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
 # system piece by piece in case you need to opt out of certain components
 # or change the Find behavior for a particular module (perhaps because the
 # default FindOpenGL.cmake module doesn't work with your system as an
 # example).
 # If you want to use a more convenient module that includes everything,
 # use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-# 
+#
 # Locate osgUtil
 # This module defines
 #
diff --git a/Modules/FindosgViewer.cmake b/Modules/FindosgViewer.cmake
index 650dbd7ef..2afd76195 100644
--- a/Modules/FindosgViewer.cmake
+++ b/Modules/FindosgViewer.cmake
@@ -1,14 +1,14 @@
 # This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must 
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these 
-# modules won't do it for you. This is to allow you control over your own 
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
 # system piece by piece in case you need to opt out of certain components
 # or change the Find behavior for a particular module (perhaps because the
 # default FindOpenGL.cmake module doesn't work with your system as an
 # example).
 # If you want to use a more convenient module that includes everything,
 # use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-# 
+#
 # Locate osgViewer
 # This module defines
 #
diff --git a/Modules/FindosgVolume.cmake b/Modules/FindosgVolume.cmake
index 3ad7edc24..1fa6764a7 100644
--- a/Modules/FindosgVolume.cmake
+++ b/Modules/FindosgVolume.cmake
@@ -1,14 +1,14 @@
 # This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must 
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these 
-# modules won't do it for you. This is to allow you control over your own 
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
 # system piece by piece in case you need to opt out of certain components
 # or change the Find behavior for a particular module (perhaps because the
 # default FindOpenGL.cmake module doesn't work with your system as an
 # example).
 # If you want to use a more convenient module that includes everything,
 # use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-# 
+#
 # Locate osgVolume
 # This module defines
 #
diff --git a/Modules/FindosgWidget.cmake b/Modules/FindosgWidget.cmake
index 206a8b7f5..1a51e6014 100644
--- a/Modules/FindosgWidget.cmake
+++ b/Modules/FindosgWidget.cmake
@@ -1,14 +1,14 @@
 # This is part of the Findosg* suite used to find OpenSceneGraph components.
-# Each component is separate and you must opt in to each module. You must 
-# also opt into OpenGL and OpenThreads (and Producer if needed) as these 
-# modules won't do it for you. This is to allow you control over your own 
+# Each component is separate and you must opt in to each module. You must
+# also opt into OpenGL and OpenThreads (and Producer if needed) as these
+# modules won't do it for you. This is to allow you control over your own
 # system piece by piece in case you need to opt out of certain components
 # or change the Find behavior for a particular module (perhaps because the
 # default FindOpenGL.cmake module doesn't work with your system as an
 # example).
 # If you want to use a more convenient module that includes everything,
 # use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-# 
+#
 # Locate osgWidget
 # This module defines
 #
diff --git a/Modules/Findosg_functions.cmake b/Modules/Findosg_functions.cmake
index ab836ff9f..3a40a0997 100644
--- a/Modules/Findosg_functions.cmake
+++ b/Modules/Findosg_functions.cmake
@@ -85,7 +85,7 @@ function(OSG_FIND_LIBRARY module library)
       set(${module_uc}_LIBRARIES ${${module_uc}_LIBRARY} PARENT_SCOPE)
    else()
       # They really have a FOO_LIBRARY_DEBUG
-      set(${module_uc}_LIBRARIES 
+      set(${module_uc}_LIBRARIES
           optimized ${${module_uc}_LIBRARY}
           debug ${${module_uc}_LIBRARY_DEBUG}
           PARENT_SCOPE
diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake
index 865a6c5d1..bf45dc616 100644
--- a/Modules/FindwxWidgets.cmake
+++ b/Modules/FindwxWidgets.cmake
@@ -3,9 +3,9 @@
 # configuration to use. wxWidgets is a modular library. To specify the
 # modules that you will use, you need to name them as components to
 # the package:
-# 
+#
 # FIND_PACKAGE(wxWidgets COMPONENTS core base ...)
-# 
+#
 # There are two search branches: a windows style and a unix style. For
 # windows, the following variables are searched for and set to
 # defaults in case of multiple choices. Change them if the defaults
@@ -22,7 +22,7 @@
 #                          - Set to TRUE to exclude linking of
 #                            commonly required libs (e.g., png tiff
 #                            jpeg zlib regex expat).
-# 
+#
 # For unix style it uses the wx-config utility. You can select between
 # debug/release, unicode/ansi, universal/non-universal, and
 # static/shared in the QtDialog or ccmake interfaces by turning ON/OFF
@@ -140,7 +140,7 @@
 
 # FIXME: This and all the DBG_MSG calls should be removed after the
 # module stabilizes.
-# 
+#
 # Helper macro to control the debugging output globally. There are
 # two versions for controlling how verbose your output should be.
 MACRO(DBG_MSG _MSG)
@@ -418,7 +418,7 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
   #-------------------------------------------------------------------
 
   # Look for an installation tree.
-  FIND_PATH(wxWidgets_ROOT_DIR 
+  FIND_PATH(wxWidgets_ROOT_DIR
     NAMES include/wx/wx.h
     PATHS
       $ENV{wxWidgets_ROOT_DIR}
@@ -427,7 +427,7 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
       C:/
       D:/
       $ENV{ProgramFiles}
-    PATH_SUFFIXES 
+    PATH_SUFFIXES
       wxWidgets-2.9.4
       wxWidgets-2.9.3
       wxWidgets-2.9.2
@@ -680,7 +680,7 @@ ELSE(wxWidgets_FIND_STYLE STREQUAL "win32")
       ENDIF(_wx_result_yes EQUAL 0 AND _wx_result_no EQUAL 0)
     ENDMACRO(WX_CONFIG_SELECT_QUERY_BOOL)
 
-    # 
+    #
     # Set wxWidgets_SELECT_OPTIONS to wx-config options for selecting
     # among multiple builds.
     #
@@ -845,12 +845,12 @@ FIND_PROGRAM(wxWidgets_wxrc_EXECUTABLE wxrc
   ${wxWidgets_ROOT_DIR}/utils/wxrc/vc_msw
   )
 
-# 
+#
 # WX_SPLIT_ARGUMENTS_ON(<keyword> <left> <right> <arg1> <arg2> ...)
-# 
+#
 # Sets <left> and <right> to contain arguments to the left and right,
 # respectively, of <keyword>.
-# 
+#
 # Example usage:
 #  FUNCTION(WXWIDGETS_ADD_RESOURCES outfiles)
 #    WX_SPLIT_ARGUMENTS_ON(OPTIONS wxrc_files wxrc_options ${ARGN})
@@ -858,7 +858,7 @@ FIND_PROGRAM(wxWidgets_wxrc_EXECUTABLE wxrc
 #  ENDFUNCTION(WXWIDGETS_ADD_RESOURCES)
 #
 #  WXWIDGETS_ADD_RESOURCES(sources ${xrc_files} OPTIONS -e -o file.C)
-# 
+#
 # NOTE: This is a generic piece of code that should be renamed to
 # SPLIT_ARGUMENTS_ON and put in a file serving the same purpose as
 # FindPackageStandardArgs.cmake. At the time of this writing
@@ -929,13 +929,13 @@ FUNCTION(WX_GET_DEPENDENCIES_FROM_XML
   SET(${_depends} ${${_depends}} PARENT_SCOPE)
 ENDFUNCTION(WX_GET_DEPENDENCIES_FROM_XML)
 
-# 
+#
 # WXWIDGETS_ADD_RESOURCES(<sources> <xrc_files>
 #                         OPTIONS <options> [NO_CPP_CODE])
-# 
+#
 # Adds a custom command for resource file compilation of the
 # <xrc_files> and appends the output files to <sources>.
-# 
+#
 # Example usages:
 #   WXWIDGETS_ADD_RESOURCES(sources xrc/main_frame.xrc)
 #   WXWIDGETS_ADD_RESOURCES(sources ${xrc_files} OPTIONS -e -o altname.cxx)
@@ -986,7 +986,7 @@ FUNCTION(WXWIDGETS_ADD_RESOURCES _outfiles)
 
   #
   # Parse options.
-  # 
+  #
   # If NO_CPP_CODE option specified, then produce .xrs file rather
   # than a .cpp file (i.e., don't add the default --cpp-code option).
   LIST(FIND rc_options NO_CPP_CODE index)
@@ -1015,7 +1015,7 @@ FUNCTION(WXWIDGETS_ADD_RESOURCES _outfiles)
   ENDIF(outfile_opt)
   #STRING(REGEX REPLACE "--output=[^;]*;?" "" rc_options "${rc_options}")
   #STRING(REGEX REPLACE ";$" "" rc_options "${rc_options}")
-  
+
   IF(NOT IS_ABSOLUTE "${outfile}")
     SET(outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}")
   ENDIF(NOT IS_ABSOLUTE "${outfile}")
diff --git a/Modules/MacroAddFileDependencies.cmake b/Modules/MacroAddFileDependencies.cmake
index 527447b80..36a217a2b 100644
--- a/Modules/MacroAddFileDependencies.cmake
+++ b/Modules/MacroAddFileDependencies.cmake
@@ -2,7 +2,7 @@
 # Using the macro MACRO_ADD_FILE_DEPENDENCIES() is discouraged. There are usually
 # better ways to specify the correct dependencies.
 #
-# MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...) is just a convenience 
+# MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...) is just a convenience
 # wrapper around the OBJECT_DEPENDS source file property. You can just
 # use SET_PROPERTY(SOURCE <file> APPEND PROPERTY OBJECT_DEPENDS depend_files) instead.
 
diff --git a/Modules/NSIS.template.in b/Modules/NSIS.template.in
index 43f72f6aa..7adfe1481 100644
--- a/Modules/NSIS.template.in
+++ b/Modules/NSIS.template.in
@@ -37,7 +37,7 @@
   ;Set compression
   SetCompressor @CPACK_NSIS_COMPRESSOR@
 
-@CPACK_NSIS_DEFINES@   
+@CPACK_NSIS_DEFINES@
 
   !include Sections.nsh
 
@@ -71,7 +71,7 @@ Var AR_RegFlags
   ;  This macro reads component installed flag from the registry and
   ;changes checked state of the section on the components page.
   ;Input: section index constant name specified in Section command.
-   
+
   ClearErrors
   ;Reading component status from registry
   ReadRegDWORD $AR_RegFlags HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@\Components\${SecName}" "Installed"
@@ -86,20 +86,20 @@ Var AR_RegFlags
   ; Note whether this component was installed before
   !insertmacro StoreVar ${SecName}_was_installed $AR_RegFlags
   IntOp $R0 $AR_RegFlags & $AR_RegFlags
-  
+
   ;Writing modified flags
   SectionSetFlags ${${SecName}} $AR_SecFlags
-  
+
  "default_${SecName}:"
  !insertmacro LoadSectionSelectedIntoVar ${SecName} ${SecName}_selected
 !macroend
- 
+
 !macro FinishSection SecName
   ;  This macro reads section flag set by user and removes the section
   ;if it is not selected.
   ;Then it writes component installed flag to registry
   ;Input: section index constant name specified in Section command.
- 
+
   SectionGetFlags ${${SecName}} $AR_SecFlags  ;Reading section flags
   ;Checking lowest bit:
   IntOp $AR_SecFlags $AR_SecFlags & ${SF_SELECTED}
@@ -110,20 +110,20 @@ Var AR_RegFlags
     WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@\Components\${SecName}" \
   "Installed" 0
     Goto "exit_${SecName}"
- 
+
  "leave_${SecName}:"
     ;Section is selected:
     WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@\Components\${SecName}" \
   "Installed" 1
- 
+
  "exit_${SecName}:"
 !macroend
- 
+
 !macro RemoveSection SecName
   ;  This macro is used to call section's Remove_... macro
   ;from the uninstaller.
   ;Input: section index constant name specified in Section command.
- 
+
   !insertmacro "Remove_${${SecName}}"
 !macroend
 
@@ -132,18 +132,18 @@ Var AR_RegFlags
   !insertmacro LoadVar ${SecName}_selected
   SectionGetFlags ${${SecName}} $R1
   IntOp $R1 $R1 & ${SF_SELECTED} ;Turn off all other bits
-  
+
   ; See if the status has changed:
   IntCmp $R0 $R1 "${SecName}_unchanged"
   !insertmacro LoadSectionSelectedIntoVar ${SecName} ${SecName}_selected
-  
+
   IntCmp $R1 ${SF_SELECTED} "${SecName}_was_selected"
   !insertmacro "Deselect_required_by_${SecName}"
   goto "${SecName}_unchanged"
-  
+
   "${SecName}_was_selected:"
   !insertmacro "Select_${SecName}_depends"
-  
+
   "${SecName}_unchanged:"
 !macroend
 ;--- End of Add/Remove macros ---
@@ -153,7 +153,7 @@ Var AR_RegFlags
 
   !define MUI_HEADERIMAGE
   !define MUI_ABORTWARNING
-    
+
 ;--------------------------------
 ; path functions
 
@@ -168,7 +168,7 @@ Var AR_RegFlags
 !include "WinMessages.NSH"
 !verbose 4
 ;====================================================
-; get_NT_environment 
+; get_NT_environment
 ;     Returns: the selected environment
 ;     Output : head of the stack
 ;====================================================
@@ -198,22 +198,22 @@ FunctionEnd
     !define WriteEnvStr_RegKey 'HKCU "Environment"'
   !endif
 !endif
- 
+
 ; AddToPath - Adds the given dir to the search path.
 ;        Input - head of the stack
 ;        Note - Win9x systems requires reboot
- 
+
 Function AddToPath
   Exch $0
   Push $1
   Push $2
   Push $3
- 
+
   # don't add if the path doesn't exist
   IfFileExists "$0\*.*" "" AddToPath_done
- 
+
   ReadEnvStr $1 PATH
-  ; if the path is too long for a NSIS variable NSIS will return a 0 
+  ; if the path is too long for a NSIS variable NSIS will return a 0
   ; length string.  If we find that, then warn and skip any path
   ; modification as it will trash the existing path.
   StrLen $2 $1
@@ -243,7 +243,7 @@ Function AddToPath
   Call StrStr
   Pop $2
   StrCmp $2 "" "" AddToPath_done
- 
+
   Call IsNT
   Pop $1
   StrCmp $1 1 AddToPath_NT
@@ -258,7 +258,7 @@ Function AddToPath
     FileClose $1
     SetRebootFlag true
     Goto AddToPath_done
- 
+
   AddToPath_NT:
     StrCmp $ADD_TO_PATH_ALL_USERS "1" ReadAllKey
       ReadRegStr $1 ${NT_current_env} "PATH"
@@ -279,7 +279,7 @@ Function AddToPath
         WriteRegExpandStr ${NT_all_env} "PATH" $0
       DoSend:
       SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
- 
+
   AddToPath_done:
     Pop $3
     Pop $2
@@ -287,10 +287,10 @@ Function AddToPath
     Pop $0
 FunctionEnd
 
- 
+
 ; RemoveFromPath - Remove a given dir from the path
 ;     Input: head of the stack
- 
+
 Function un.RemoveFromPath
   Exch $0
   Push $1
@@ -299,9 +299,9 @@ Function un.RemoveFromPath
   Push $4
   Push $5
   Push $6
- 
+
   IntFmt $6 "%c" 26 # DOS EOF
- 
+
   Call un.IsNT
   Pop $1
   StrCmp $1 1 unRemoveFromPath_NT
@@ -313,7 +313,7 @@ Function un.RemoveFromPath
     GetFullPathName /SHORT $0 $0
     StrCpy $0 "SET PATH=%PATH%;$0"
     Goto unRemoveFromPath_dosLoop
- 
+
     unRemoveFromPath_dosLoop:
       FileRead $1 $3
       StrCpy $5 $3 1 -1 # read last char
@@ -328,7 +328,7 @@ Function un.RemoveFromPath
       unRemoveFromPath_dosLoopRemoveLine:
         SetRebootFlag true
         Goto unRemoveFromPath_dosLoop
- 
+
     unRemoveFromPath_dosLoopEnd:
       FileClose $2
       FileClose $1
@@ -337,7 +337,7 @@ Function un.RemoveFromPath
       CopyFiles /SILENT $4 "$1\autoexec.bat"
       Delete $4
       Goto unRemoveFromPath_done
- 
+
   unRemoveFromPath_NT:
     StrCmp $ADD_TO_PATH_ALL_USERS "1" unReadAllKey
       ReadRegStr $1 ${NT_current_env} "PATH"
@@ -361,11 +361,11 @@ Function un.RemoveFromPath
       StrCpy $5 $1 -$4 # $5 is now the part before the path to remove
       StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove
       StrCpy $3 $5$6
- 
+
       StrCpy $5 $3 1 -1 # copy last char
       StrCmp $5 ";" 0 +2 # if last char == ;
         StrCpy $3 $3 -1 # remove last char
- 
+
       StrCmp $ADD_TO_PATH_ALL_USERS "1" unWriteAllKey
         WriteRegExpandStr ${NT_current_env} "PATH" $3
         Goto unDoSend
@@ -373,7 +373,7 @@ Function un.RemoveFromPath
         WriteRegExpandStr ${NT_all_env} "PATH" $3
       unDoSend:
       SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
- 
+
   unRemoveFromPath_done:
     Pop $6
     Pop $5
@@ -383,7 +383,7 @@ Function un.RemoveFromPath
     Pop $1
     Pop $0
 FunctionEnd
- 
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ; Uninstall sutff
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -391,7 +391,7 @@ FunctionEnd
 ###########################################
 #            Utility Functions            #
 ###########################################
- 
+
 ;====================================================
 ; IsNT - Returns 1 if the current system is NT, 0
 ;        otherwise.
@@ -405,7 +405,7 @@ FunctionEnd
 ;   Call IsNT
 ;   Pop $R0
 ;  ($R0 at this point is 1 or 0)
- 
+
 !macro IsNT un
 Function ${un}IsNT
   Push $0
@@ -415,7 +415,7 @@ Function ${un}IsNT
   Pop $0
   Push 0
   Return
- 
+
   IsNT_yes:
     ; NT!!!
     Pop $0
@@ -424,7 +424,7 @@ FunctionEnd
 !macroend
 !insertmacro IsNT ""
 !insertmacro IsNT "un."
- 
+
 ; StrStr
 ; input, top of stack = string to search for
 ;        top of stack-1 = string to search in
@@ -437,7 +437,7 @@ FunctionEnd
 ;   Call StrStr
 ;   Pop $R0
 ;  ($R0 at this point is "ass string")
- 
+
 !macro StrStr un
 Function ${un}StrStr
 Exch $R1 ; st=haystack,old$R1, $R1=needle
@@ -516,7 +516,7 @@ Function DownloadFile
 
   try_again:
     NSISdl::download "$1/$0" "$INSTDIR\$0"
-    
+
     Pop $1
     StrCmp $1 "success" success
     StrCmp $1 "Cancelled" cancel
@@ -549,10 +549,10 @@ FunctionEnd
   !insertmacro MUI_PAGE_LICENSE "@CPACK_RESOURCE_FILE_LICENSE@"
   Page custom InstallOptionsPage
   !insertmacro MUI_PAGE_DIRECTORY
-  
+
   ;Start Menu Folder Page Configuration
-  !define MUI_STARTMENUPAGE_REGISTRY_ROOT "SHCTX" 
-  !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" 
+  !define MUI_STARTMENUPAGE_REGISTRY_ROOT "SHCTX"
+  !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@"
   !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
   !insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER
 
@@ -639,10 +639,10 @@ Section "-Core installation"
   SetOutPath "$INSTDIR"
   @CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS@
   @CPACK_NSIS_FULL_INSTALL@
-  
+
   ;Store installation folder
   WriteRegStr SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "" $INSTDIR
-  
+
   ;Create uninstaller
   WriteUninstaller "$INSTDIR\Uninstall.exe"
   Push "DisplayName"
@@ -660,7 +660,7 @@ Section "-Core installation"
   Push "NoRepair"
   Push "1"
   Call ConditionalAddToRegisty
-  
+
   !ifdef CPACK_NSIS_ADD_REMOVE
   ;Create add/remove functionality
   Push "ModifyPath"
@@ -671,7 +671,7 @@ Section "-Core installation"
   Push "1"
   Call ConditionalAddToRegisty
   !endif
-  
+
   ; Optional registration
   Push "DisplayIcon"
   Push "$INSTDIR\@CPACK_NSIS_INSTALLED_ICON_NAME@"
@@ -687,7 +687,7 @@ Section "-Core installation"
   Call ConditionalAddToRegisty
   !insertmacro MUI_INSTALLOPTIONS_READ $INSTALL_DESKTOP "NSIS.InstallOptions.ini" "Field 5" "State"
   !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
-  
+
   ;Create shortcuts
   CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
 @CPACK_NSIS_CREATE_ICONS@
@@ -725,7 +725,7 @@ SectionEnd
 Section "-Add to path"
   Push $INSTDIR\bin
   StrCmp "@CPACK_NSIS_MODIFY_PATH@" "ON" 0 doNotAddToPath
-  StrCmp $DO_NOT_ADD_TO_PATH "1" doNotAddToPath 0  
+  StrCmp $DO_NOT_ADD_TO_PATH "1" doNotAddToPath 0
     Call AddToPath
   doNotAddToPath:
 SectionEnd
@@ -756,12 +756,12 @@ Function un.onInit
     SetShellVarContext all
     ;MessageBox MB_OK 'User "$0" is in the Power Users group'
     Goto done
-    
+
   noLM:
     ;Get installation folder from registry if available
 
   done:
-    
+
 FunctionEnd
 
 ;--- Add/Remove callback functions: ---
@@ -770,25 +770,25 @@ FunctionEnd
   ;List all of your components in following manner here.
 @CPACK_NSIS_COMPONENT_SECTION_LIST@
 !macroend
- 
+
 Section -FinishComponents
   ;Removes unselected components and writes component status to registry
   !insertmacro SectionList "FinishSection"
-  
-!ifdef CPACK_NSIS_ADD_REMOVE  
+
+!ifdef CPACK_NSIS_ADD_REMOVE
   ; Get the name of the installer executable
   System::Call 'kernel32::GetModuleFileNameA(i 0, t .R0, i 1024) i r1'
   StrCpy $R3 $R0
-  
+
   ; Strip off the last 13 characters, to see if we have AddRemove.exe
   StrLen $R1 $R0
   IntOp $R1 $R0 - 13
   StrCpy $R2 $R0 13 $R1
   StrCmp $R2 "AddRemove.exe" addremove_installed
-  
+
   ; We're not running AddRemove.exe, so install it
   CopyFiles $R3 $INSTDIR\AddRemove.exe
-  
+
   addremove_installed:
 !endif
 SectionEnd
@@ -825,7 +825,7 @@ Section "Uninstall"
 @CPACK_NSIS_DELETE_FILES@
 @CPACK_NSIS_DELETE_DIRECTORIES@
 
-!ifdef CPACK_NSIS_ADD_REMOVE  
+!ifdef CPACK_NSIS_ADD_REMOVE
   ;Remove the add/remove program
   Delete "$INSTDIR\AddRemove.exe"
 !endif
@@ -842,23 +842,23 @@ Section "Uninstall"
 
   ; Removes all optional components
   !insertmacro SectionList "RemoveSection"
-  
+
   !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
-    
+
   Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
 @CPACK_NSIS_DELETE_ICONS@
 @CPACK_NSIS_DELETE_ICONS_EXTRA@
-  
+
   ;Delete empty start menu parent diretories
   StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
- 
+
   startMenuDeleteLoop:
     ClearErrors
     RMDir $MUI_TEMP
     GetFullPathName $MUI_TEMP "$MUI_TEMP\.."
-    
+
     IfErrors startMenuDeleteLoopDone
-  
+
     StrCmp "$MUI_TEMP" "$SMPROGRAMS" startMenuDeleteLoopDone startMenuDeleteLoop
   startMenuDeleteLoopDone:
 
@@ -867,17 +867,17 @@ Section "Uninstall"
   StrCpy $MUI_TEMP "$START_MENU"
   Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
 @CPACK_NSIS_DELETE_ICONS_EXTRA@
-  
+
   ;Delete empty start menu parent diretories
   StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
- 
+
   secondStartMenuDeleteLoop:
     ClearErrors
     RMDir $MUI_TEMP
     GetFullPathName $MUI_TEMP "$MUI_TEMP\.."
-    
+
     IfErrors secondStartMenuDeleteLoopDone
-  
+
     StrCmp "$MUI_TEMP" "$SMPROGRAMS" secondStartMenuDeleteLoopDone secondStartMenuDeleteLoop
   secondStartMenuDeleteLoopDone:
 
@@ -925,14 +925,14 @@ inst:
   ; Reads components status for registry
   !insertmacro SectionList "InitSection"
 
-  ; check to see if /D has been used to change 
-  ; the install directory by comparing it to the 
+  ; check to see if /D has been used to change
+  ; the install directory by comparing it to the
   ; install directory that is expected to be the
   ; default
   StrCpy $IS_DEFAULT_INSTALLDIR 0
   StrCmp "$INSTDIR" "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_INSTALL_DIRECTORY@" 0 +2
     StrCpy $IS_DEFAULT_INSTALLDIR 1
-  
+
   StrCpy $SV_ALLUSERS "JustMe"
   ; if default install dir then change the default
   ; if it is installed for JustMe
@@ -955,7 +955,7 @@ inst:
     ;MessageBox MB_OK 'User "$0" is in the Power Users group'
     StrCpy $SV_ALLUSERS "AllUsers"
     Goto done
-    
+
   noLM:
     StrCpy $SV_ALLUSERS "AllUsers"
     ;Get installation folder from registry if available
diff --git a/Modules/Platform/BlueGeneL.cmake b/Modules/Platform/BlueGeneL.cmake
index 7794a26cf..4021147e7 100644
--- a/Modules/Platform/BlueGeneL.cmake
+++ b/Modules/Platform/BlueGeneL.cmake
@@ -1,7 +1,7 @@
-#the compute nodes on BlueGene/L don't support shared libs 
+#the compute nodes on BlueGene/L don't support shared libs
 SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
 
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "")            # -pic 
+SET(CMAKE_SHARED_LIBRARY_C_FLAGS "")            # -pic
 SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "")       # -shared
 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")         # +s, flag for exe link to use shared lib
 SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "")       # -rpath
diff --git a/Modules/Platform/Catamount.cmake b/Modules/Platform/Catamount.cmake
index 01493fc21..cf672c9ce 100644
--- a/Modules/Platform/Catamount.cmake
+++ b/Modules/Platform/Catamount.cmake
@@ -1,7 +1,7 @@
-#Catamount, which runs on the compute nodes of Cray machines, e.g. RedStorm, doesn't support shared libs 
+#Catamount, which runs on the compute nodes of Cray machines, e.g. RedStorm, doesn't support shared libs
 SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
 
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "")            # -pic 
+SET(CMAKE_SHARED_LIBRARY_C_FLAGS "")            # -pic
 SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "")       # -shared
 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")         # +s, flag for exe link to use shared lib
 SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "")       # -rpath
diff --git a/Modules/Platform/Darwin-icc.cmake b/Modules/Platform/Darwin-icc.cmake
index b592e5f55..621905c41 100644
--- a/Modules/Platform/Darwin-icc.cmake
+++ b/Modules/Platform/Darwin-icc.cmake
@@ -100,7 +100,7 @@ SET(CMAKE_Fortran_CREATE_SHARED_MODULE
       "<CMAKE_Fortran_COMPILER>  <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
 
 
-#  We can use $ENV{INTEL_LICENSE_FILE} to try and get at the installation location for ICC. 
+#  We can use $ENV{INTEL_LICENSE_FILE} to try and get at the installation location for ICC.
 # We also need to consider to use cce (which is the 64bit compiler) and not JUST the 32bit compiler.
 # I have no idea what the best way to do that would be.
 
diff --git a/Modules/Platform/Generic-ADSP-C.cmake b/Modules/Platform/Generic-ADSP-C.cmake
index f0644687f..d35307bc7 100644
--- a/Modules/Platform/Generic-ADSP-C.cmake
+++ b/Modules/Platform/Generic-ADSP-C.cmake
@@ -9,7 +9,7 @@ SET(CMAKE_C_FLAGS_MINSIZEREL_INIT "")
 SET(CMAKE_C_FLAGS_RELEASE_INIT "")
 SET(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "")
 
-SET(CMAKE_C_CREATE_STATIC_LIBRARY 
+SET(CMAKE_C_CREATE_STATIC_LIBRARY
     "<CMAKE_C_COMPILER> -build-lib -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -o <TARGET> <CMAKE_C_LINK_FLAGS> <OBJECTS>")
 
 SET(CMAKE_C_LINK_EXECUTABLE
diff --git a/Modules/Platform/Generic-ADSP-CXX.cmake b/Modules/Platform/Generic-ADSP-CXX.cmake
index 21daa81c9..42d3d56ac 100644
--- a/Modules/Platform/Generic-ADSP-CXX.cmake
+++ b/Modules/Platform/Generic-ADSP-CXX.cmake
@@ -7,7 +7,7 @@ SET(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "")
 SET(CMAKE_CXX_FLAGS_RELEASE_INIT "")
 SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "")
 
-SET(CMAKE_CXX_CREATE_STATIC_LIBRARY 
+SET(CMAKE_CXX_CREATE_STATIC_LIBRARY
      "<CMAKE_CXX_COMPILER> -build-lib -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -o <TARGET> <CMAKE_CXX_LINK_FLAGS> <OBJECTS>")
 
 SET(CMAKE_CXX_LINK_EXECUTABLE
diff --git a/Modules/Platform/Generic-ADSP-Common.cmake b/Modules/Platform/Generic-ADSP-Common.cmake
index 10fb34e00..14b92e95a 100644
--- a/Modules/Platform/Generic-ADSP-Common.cmake
+++ b/Modules/Platform/Generic-ADSP-Common.cmake
@@ -14,7 +14,7 @@ IF(NOT ADSP)
   SET(CMAKE_SHARED_LIBRARY_SUFFIX "")
   SET(CMAKE_EXECUTABLE_SUFFIX ".dxe")
 
-  # if ADSP_PROCESSOR has not been set, but CMAKE_SYSTEM_PROCESSOR has, 
+  # if ADSP_PROCESSOR has not been set, but CMAKE_SYSTEM_PROCESSOR has,
   # assume that this is the processor name to use for the compiler
   IF(CMAKE_SYSTEM_PROCESSOR AND NOT ADSP_PROCESSOR)
     SET(ADSP_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR})
diff --git a/Modules/Platform/Generic-SDCC-C.cmake b/Modules/Platform/Generic-SDCC-C.cmake
index ac81c3560..6c36445d7 100644
--- a/Modules/Platform/Generic-SDCC-C.cmake
+++ b/Modules/Platform/Generic-SDCC-C.cmake
@@ -20,8 +20,8 @@ SET(CMAKE_DL_LIBS "")
 SET(CMAKE_C_OUTPUT_EXTENSION ".rel")
 
 # find sdcclib as CMAKE_AR
-# since cmake may already have searched for "ar", sdcclib has to 
-# be searched with a different variable name (SDCCLIB_EXECUTABLE) 
+# since cmake may already have searched for "ar", sdcclib has to
+# be searched with a different variable name (SDCCLIB_EXECUTABLE)
 # and must then be forced into the cache
 GET_FILENAME_COMPONENT(SDCC_LOCATION "${CMAKE_C_COMPILER}" PATH)
 FIND_PROGRAM(SDCCLIB_EXECUTABLE sdcclib PATHS "${SDCC_LOCATION}" NO_DEFAULT_PATH)
diff --git a/Modules/Platform/Generic.cmake b/Modules/Platform/Generic.cmake
index a4e2ec6c1..e6f8b2b1e 100644
--- a/Modules/Platform/Generic.cmake
+++ b/Modules/Platform/Generic.cmake
@@ -2,7 +2,7 @@
 # operating system, typically embedded platforms.
 # It is used when CMAKE_SYSTEM_NAME is set to "Generic"
 #
-# It is intentionally empty, since nothing is known 
+# It is intentionally empty, since nothing is known
 # about the platform. So everything has to be specified
 # in the system/compiler files ${CMAKE_SYSTEM_NAME}-<compiler_basename>.cmake
 # and/or ${CMAKE_SYSTEM_NAME}-<compiler_basename>-${CMAKE_SYSTEM_PROCESSOR}.cmake
diff --git a/Modules/Platform/IRIX64.cmake b/Modules/Platform/IRIX64.cmake
index b60a7f297..09fa99884 100644
--- a/Modules/Platform/IRIX64.cmake
+++ b/Modules/Platform/IRIX64.cmake
@@ -11,7 +11,7 @@ IF(NOT CMAKE_COMPILER_IS_GNUCC)
   SET(CMAKE_EXE_LINKER_FLAGS_INIT "")
   SET(CMAKE_SHARED_LINKER_FLAGS_INIT "")
   SET(CMAKE_MODULE_LINKER_FLAGS_INIT "")
-  
+
   # If no -o32, -n32, or -64 flag is given, set a reasonable default.
   IF("$ENV{CFLAGS} $ENV{CXXFLAGS} $ENV{LDFLAGS}" MATCHES "-([no]32|64)")
   ELSE("$ENV{CFLAGS} $ENV{CXXFLAGS} $ENV{LDFLAGS}" MATCHES "-([no]32|64)")
@@ -21,7 +21,7 @@ IF(NOT CMAKE_COMPILER_IS_GNUCC)
       SET(CMAKE_FILE_SELF "${CMAKE_FILE_SELF}" CACHE INTERNAL
         "Output of file command on ${CMAKE_COMMAND}.")
     ENDIF(CMAKE_FILE_SELF MATCHES "^CMAKE_FILE_SELF$")
-    
+
     # Set initial flags to match cmake executable.
     IF(CMAKE_FILE_SELF MATCHES " 64-bit ")
       SET(CMAKE_C_FLAGS_INIT "-64")
@@ -32,7 +32,7 @@ IF(NOT CMAKE_COMPILER_IS_GNUCC)
       SET(CMAKE_MODULE_LINKER_FLAGS_INIT "-64")
     ENDIF(CMAKE_FILE_SELF MATCHES " 64-bit ")
   ENDIF("$ENV{CFLAGS} $ENV{CXXFLAGS} $ENV{LDFLAGS}" MATCHES "-([no]32|64)")
-  
+
   # Set remaining defaults.
   SET(CMAKE_CXX_CREATE_STATIC_LIBRARY
       "<CMAKE_CXX_COMPILER> -ar -o <TARGET> <OBJECTS>")
diff --git a/Modules/Platform/OSF1.cmake b/Modules/Platform/OSF1.cmake
index 49a30e971..3017a07c8 100644
--- a/Modules/Platform/OSF1.cmake
+++ b/Modules/Platform/OSF1.cmake
@@ -2,7 +2,7 @@ SET(CMAKE_DL_LIBS "")
 
 IF(CMAKE_SYSTEM MATCHES "OSF1-1.[012]")
 ENDIF(CMAKE_SYSTEM MATCHES "OSF1-1.[012]")
-IF(CMAKE_SYSTEM MATCHES "OSF1-1.*")  
+IF(CMAKE_SYSTEM MATCHES "OSF1-1.*")
   # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
   SET(CMAKE_C_COMPILE_OPTIONS_PIC "-fpic")
   SET(CMAKE_C_COMPILE_OPTIONS_PIE "-fpie")
@@ -15,12 +15,12 @@ ENDIF(CMAKE_SYSTEM MATCHES "OSF1-1.*")
 IF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
   SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-expect_unresolved,\\*")       # -shared
   IF(CMAKE_COMPILER_IS_GNUCXX)
-    SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-Wl,-rpath,")  
+    SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-Wl,-rpath,")
   ELSE(CMAKE_COMPILER_IS_GNUCXX)
     SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-rpath ")
   ENDIF(CMAKE_COMPILER_IS_GNUCXX)
   IF(CMAKE_COMPILER_IS_GNUCC)
-    SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")  
+    SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
   ELSE(CMAKE_COMPILER_IS_GNUCC)
     SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-rpath ")
   ENDIF(CMAKE_COMPILER_IS_GNUCC)
@@ -30,7 +30,7 @@ ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
 SET(CMAKE_MAKE_INCLUDE_FROM_ROOT 1) # include $(CMAKE_BINARY_DIR)/...
 
 IF(CMAKE_COMPILER_IS_GNUCXX)
-  # include the gcc flags 
+  # include the gcc flags
 ELSE (CMAKE_COMPILER_IS_GNUCXX)
   # use default OSF compiler flags
   SET (CMAKE_C_FLAGS_INIT "")
diff --git a/Modules/Platform/SunOS.cmake b/Modules/Platform/SunOS.cmake
index de287aa70..39cb48cd7 100644
--- a/Modules/Platform/SunOS.cmake
+++ b/Modules/Platform/SunOS.cmake
@@ -4,7 +4,7 @@ IF(CMAKE_SYSTEM MATCHES "SunOS-4.*")
    SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-PIC")
    SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-r")
    SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-R")
-   SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")  
+   SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
 ENDIF(CMAKE_SYSTEM MATCHES "SunOS-4.*")
 
 IF(CMAKE_COMPILER_IS_GNUCXX)
diff --git a/Modules/Platform/ULTRIX.cmake b/Modules/Platform/ULTRIX.cmake
index 4d0cf755d..154d7e6ac 100644
--- a/Modules/Platform/ULTRIX.cmake
+++ b/Modules/Platform/ULTRIX.cmake
@@ -1,5 +1,5 @@
 SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-G 0")
-SET(CMAKE_SHARED_LIBRARY_SUFFIX "..o") 
+SET(CMAKE_SHARED_LIBRARY_SUFFIX "..o")
 SET(CMAKE_DL_LIBS "")
 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-D,08000000")
 INCLUDE(Platform/UnixPaths)
diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake
index 5ee7ddbd6..6aef11180 100644
--- a/Modules/Platform/UnixPaths.cmake
+++ b/Modules/Platform/UnixPaths.cmake
@@ -52,7 +52,7 @@ LIST(APPEND CMAKE_SYSTEM_INCLUDE_PATH
 
   # Other
   /usr/pkg/include
-  /opt/csw/include /opt/include  
+  /opt/csw/include /opt/include
   /usr/openwin/include
   )
 
@@ -65,7 +65,7 @@ LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH
 
   # Other
   /usr/pkg/lib
-  /opt/csw/lib /opt/lib 
+  /opt/csw/lib /opt/lib
   /usr/openwin/lib
   )
 
diff --git a/Modules/Platform/Windows-Intel.cmake b/Modules/Platform/Windows-Intel.cmake
index 2a54a981b..16b3c814b 100644
--- a/Modules/Platform/Windows-Intel.cmake
+++ b/Modules/Platform/Windows-Intel.cmake
@@ -64,14 +64,14 @@ SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELW
 INCLUDE("${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake" OPTIONAL)
 
 IF(NOT _INTEL_XILINK_TEST_RUN)
-  EXECUTE_PROCESS(COMMAND xilink /? 
+  EXECUTE_PROCESS(COMMAND xilink /?
     ERROR_VARIABLE _XILINK_ERR
     OUTPUT_VARIABLE _XILINK_HELP)
   IF(_XILINK_HELP MATCHES MANIFEST)
     SET(_INTEL_COMPILER_SUPPORTS_MANIFEST 1)
   ENDIF(_XILINK_HELP MATCHES MANIFEST)
   IF(NOT  EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake")
-    FILE(WRITE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake 
+    FILE(WRITE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake
       "
 SET(_INTEL_XILINK_TEST_RUN 1)
 SET(_INTEL_COMPILER_SUPPORTS_MANIFEST ${_INTEL_COMPILER_SUPPORTS_MANIFEST})
diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake
index be6abb690..34b11253e 100644
--- a/Modules/Platform/Windows-cl.cmake
+++ b/Modules/Platform/Windows-cl.cmake
@@ -15,7 +15,7 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
 ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
 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 
+  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(NOT CMAKE_NO_BUILD_TYPE AND CMAKE_GENERATOR MATCHES "Visual Studio")
@@ -49,13 +49,13 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles" OR CMAKE_GENERATOR MATCHES "Ninja")
     IF (NOT CMAKE_C_COMPILER)
       SET(CMAKE_TEST_COMPILER ${CMAKE_CXX_COMPILER})
     ENDIF(NOT CMAKE_C_COMPILER)
-    EXEC_PROGRAM(${CMAKE_TEST_COMPILER} 
-      ARGS /nologo -EP \"${testNmakeCLVersionFile}\" 
-      OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT 
+    EXEC_PROGRAM(${CMAKE_TEST_COMPILER}
+      ARGS /nologo -EP \"${testNmakeCLVersionFile}\"
+      OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT
       RETURN_VALUE CMAKE_COMPILER_RETURN
       )
     IF(NOT CMAKE_COMPILER_RETURN)
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
+      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining the version of compiler passed with the following output:\n"
         "${CMAKE_COMPILER_OUTPUT}\n\n")
       STRING(REGEX REPLACE "\n" " " compilerVersion "${CMAKE_COMPILER_OUTPUT}")
@@ -92,7 +92,7 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles" OR CMAKE_GENERATOR MATCHES "Ninja")
       SET(MSVC_VERSION "${compilerVersion}")
     ELSE(NOT CMAKE_COMPILER_RETURN)
       MESSAGE(STATUS "Check for CL compiler version - failed")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
+      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining the version of compiler failed with the following output:\n"
         "${CMAKE_COMPILER_OUTPUT}\n\n")
     ENDIF(NOT CMAKE_COMPILER_RETURN)
@@ -107,17 +107,17 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles" OR CMAKE_GENERATOR MATCHES "Ninja")
     EXEC_PROGRAM(${CMAKE_TEST_COMPILER} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp2
       ARGS /nologo /MD /EHsc
       \"${testForFreeVCFile}\"
-      OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT 
+      OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT
       RETURN_VALUE CMAKE_COMPILER_RETURN
       )
     IF(CMAKE_COMPILER_RETURN)
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
+      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if this is a free VC compiler failed with the following output:\n"
         "${CMAKE_COMPILER_OUTPUT}\n\n")
       MESSAGE(STATUS "Check if this is a free VC compiler - yes")
       SET(CMAKE_USING_VC_FREE_TOOLS 1)
     ELSE(CMAKE_COMPILER_RETURN)
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
+      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if this is a free VC compiler passed with the following output:\n"
         "${CMAKE_COMPILER_OUTPUT}\n\n")
       MESSAGE(STATUS "Check if this is a free VC compiler - no")
@@ -243,11 +243,11 @@ SET (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT ${CMAKE_EXE_LINKER_FLAGS_MINSIZER
 
 # save computed information for this platform
 IF(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake")
-  CONFIGURE_FILE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake.in 
+  CONFIGURE_FILE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake.in
     ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCPlatform.cmake IMMEDIATE)
 ENDIF(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake")
 
 IF(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake")
-  CONFIGURE_FILE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake.in 
+  CONFIGURE_FILE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake.in
                ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXPlatform.cmake IMMEDIATE)
 ENDIF(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake")
diff --git a/Modules/Platform/gas.cmake b/Modules/Platform/gas.cmake
index c34aef17a..b9d2a6582 100644
--- a/Modules/Platform/gas.cmake
+++ b/Modules/Platform/gas.cmake
@@ -6,7 +6,7 @@ ENDIF(UNIX)
 
 SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> -o <OBJECT> <SOURCE>")
 
-SET(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY 
+SET(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY
       "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> "
       "<CMAKE_RANLIB> <TARGET> ")
 
diff --git a/Modules/Qt4ConfigDependentSettings.cmake b/Modules/Qt4ConfigDependentSettings.cmake
index 10af3bc95..665d2747e 100644
--- a/Modules/Qt4ConfigDependentSettings.cmake
+++ b/Modules/Qt4ConfigDependentSettings.cmake
@@ -16,7 +16,7 @@
 
 ###############################################
 #
-#       configuration/system dependent settings  
+#       configuration/system dependent settings
 #
 ###############################################
 
diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake
index 68f3c8085..27a8ee878 100644
--- a/Modules/Qt4Macros.cmake
+++ b/Modules/Qt4Macros.cmake
@@ -29,13 +29,13 @@ MACRO (QT4_EXTRACT_OPTIONS _qt4_files _qt4_options)
     IF ("${_currentArg}" STREQUAL "OPTIONS")
       SET(_QT4_DOING_OPTIONS TRUE)
     ELSE ("${_currentArg}" STREQUAL "OPTIONS")
-      IF(_QT4_DOING_OPTIONS) 
+      IF(_QT4_DOING_OPTIONS)
         LIST(APPEND ${_qt4_options} "${_currentArg}")
       ELSE(_QT4_DOING_OPTIONS)
         LIST(APPEND ${_qt4_files} "${_currentArg}")
       ENDIF(_QT4_DOING_OPTIONS)
     ENDIF ("${_currentArg}" STREQUAL "OPTIONS")
-  ENDFOREACH(_currentArg) 
+  ENDFOREACH(_currentArg)
 ENDMACRO (QT4_EXTRACT_OPTIONS)
 
 
@@ -54,9 +54,9 @@ MACRO (QT4_MAKE_OUTPUT_FILE infile prefix ext outfile )
   ELSE(_infileLength GREATER _binlength)
     FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
   ENDIF(_infileLength GREATER _binlength)
-  IF(WIN32 AND rel MATCHES "^[a-zA-Z]:") # absolute path 
+  IF(WIN32 AND rel MATCHES "^[a-zA-Z]:") # absolute path
     STRING(REGEX REPLACE "^([a-zA-Z]):(.*)$" "\\1_\\2" rel "${rel}")
-  ENDIF(WIN32 AND rel MATCHES "^[a-zA-Z]:") 
+  ENDIF(WIN32 AND rel MATCHES "^[a-zA-Z]:")
   SET(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}")
   STRING(REPLACE ".." "__" _outfile ${_outfile})
   GET_FILENAME_COMPONENT(outpath ${_outfile} PATH)
diff --git a/Modules/SelectLibraryConfigurations.cmake b/Modules/SelectLibraryConfigurations.cmake
index dbff4876b..e4df3eb97 100644
--- a/Modules/SelectLibraryConfigurations.cmake
+++ b/Modules/SelectLibraryConfigurations.cmake
@@ -6,7 +6,7 @@
 # basename_LIBRARY_RELEASE is defined, basename_LIBRARY, basename_LIBRARY_DEBUG,
 # and basename_LIBRARY_RELEASE will be set to the release value.  If only
 # basename_LIBRARY_DEBUG is defined, then basename_LIBRARY,
-# basename_LIBRARY_DEBUG and basename_LIBRARY_RELEASE will take the debug value.  
+# basename_LIBRARY_DEBUG and basename_LIBRARY_RELEASE will take the debug value.
 #
 # If the generator supports configuration types, then basename_LIBRARY and
 # basename_LIBRARIES will be set with debug and optimized flags specifying the
@@ -69,14 +69,14 @@ macro( select_library_configurations basename )
         endif( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
     endif()
 
-    set( ${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH 
+    set( ${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH
         "The ${basename} library" )
 
     if( ${basename}_LIBRARY )
         set( ${basename}_FOUND TRUE )
     endif( ${basename}_LIBRARY )
 
-    mark_as_advanced( ${basename}_LIBRARY 
+    mark_as_advanced( ${basename}_LIBRARY
         ${basename}_LIBRARY_RELEASE
         ${basename}_LIBRARY_DEBUG
     )
diff --git a/Modules/SystemInformation.cmake b/Modules/SystemInformation.cmake
index d4f22331d..443c7aa84 100644
--- a/Modules/SystemInformation.cmake
+++ b/Modules/SystemInformation.cmake
@@ -23,33 +23,33 @@ SET_DIRECTORY_PROPERTIES(PROPERTIES INCLUDE_DIRECTORIES "${DumpInformation_BINAR
 CONFIGURE_FILE("${CMAKE_ROOT}/Modules/SystemInformation.in" "${RESULT_FILE}")
 
 
-FILE(APPEND "${RESULT_FILE}" 
+FILE(APPEND "${RESULT_FILE}"
   "\n=================================================================\n")
-FILE(APPEND "${RESULT_FILE}" 
+FILE(APPEND "${RESULT_FILE}"
   "=== VARIABLES\n")
-FILE(APPEND "${RESULT_FILE}" 
+FILE(APPEND "${RESULT_FILE}"
   "=================================================================\n")
 GET_CMAKE_PROPERTY(res VARIABLES)
 FOREACH(var ${res})
   FILE(APPEND "${RESULT_FILE}" "${var} \"${${var}}\"\n")
 ENDFOREACH(var ${res})
 
-FILE(APPEND "${RESULT_FILE}" 
+FILE(APPEND "${RESULT_FILE}"
   "\n=================================================================\n")
-FILE(APPEND "${RESULT_FILE}" 
+FILE(APPEND "${RESULT_FILE}"
   "=== COMMANDS\n")
-FILE(APPEND "${RESULT_FILE}" 
+FILE(APPEND "${RESULT_FILE}"
   "=================================================================\n")
 GET_CMAKE_PROPERTY(res COMMANDS)
 FOREACH(var ${res})
   FILE(APPEND "${RESULT_FILE}" "${var}\n")
 ENDFOREACH(var ${res})
 
-FILE(APPEND "${RESULT_FILE}" 
+FILE(APPEND "${RESULT_FILE}"
   "\n=================================================================\n")
-FILE(APPEND "${RESULT_FILE}" 
+FILE(APPEND "${RESULT_FILE}"
   "=== MACROS\n")
-FILE(APPEND "${RESULT_FILE}" 
+FILE(APPEND "${RESULT_FILE}"
   "=================================================================\n")
 FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt "")
 GET_CMAKE_PROPERTY(res MACROS)
@@ -57,11 +57,11 @@ FOREACH(var ${res})
   FILE(APPEND "${RESULT_FILE}" "${var}\n")
 ENDFOREACH(var ${res})
 
-FILE(APPEND "${RESULT_FILE}" 
+FILE(APPEND "${RESULT_FILE}"
   "\n=================================================================\n")
-FILE(APPEND "${RESULT_FILE}" 
+FILE(APPEND "${RESULT_FILE}"
   "=== OTHER\n")
-FILE(APPEND "${RESULT_FILE}" 
+FILE(APPEND "${RESULT_FILE}"
   "=================================================================\n")
 GET_DIRECTORY_PROPERTY(res INCLUDE_DIRECTORIES)
 FOREACH(var ${res})
@@ -80,13 +80,13 @@ FILE(APPEND "${RESULT_FILE}" "INCLUDE_REGULAR_EXPRESSION: ${res}\n")
 # binary tree
 MACRO(DUMP_FILE THE_FILE)
   IF (EXISTS "${THE_FILE}")
-    FILE(APPEND "${RESULT_FILE}" 
+    FILE(APPEND "${RESULT_FILE}"
       "\n=================================================================\n")
-    FILE(APPEND "${RESULT_FILE}" 
+    FILE(APPEND "${RESULT_FILE}"
       "=== ${THE_FILE}\n")
-    FILE(APPEND "${RESULT_FILE}" 
+    FILE(APPEND "${RESULT_FILE}"
       "=================================================================\n")
-  
+
     FILE(READ "${THE_FILE}" FILE_CONTENTS LIMIT 50000)
     FILE(APPEND "${RESULT_FILE}" "${FILE_CONTENTS}")
   ENDIF (EXISTS "${THE_FILE}")
diff --git a/Modules/TestBigEndian.cmake b/Modules/TestBigEndian.cmake
index 996060210..bca7979df 100644
--- a/Modules/TestBigEndian.cmake
+++ b/Modules/TestBigEndian.cmake
@@ -21,7 +21,7 @@ MACRO(TEST_BIG_ENDIAN VARIABLE)
   IF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
     MESSAGE(STATUS "Check if the system is big endian")
     MESSAGE(STATUS "Searching 16 bit integer")
-  
+
     INCLUDE(CheckTypeSize)
 
     CHECK_TYPE_SIZE("unsigned short" CMAKE_SIZEOF_UNSIGNED_SHORT)
@@ -35,7 +35,7 @@ MACRO(TEST_BIG_ENDIAN VARIABLE)
         SET(CMAKE_16BIT_TYPE "unsigned int")
 
       ELSE(CMAKE_SIZEOF_UNSIGNED_INT)
-  
+
         CHECK_TYPE_SIZE("unsigned long"  CMAKE_SIZEOF_UNSIGNED_LONG)
         IF(CMAKE_SIZEOF_UNSIGNED_LONG)
           MESSAGE(STATUS "Using unsigned long")
@@ -43,16 +43,16 @@ MACRO(TEST_BIG_ENDIAN VARIABLE)
         ELSE(CMAKE_SIZEOF_UNSIGNED_LONG)
           MESSAGE(FATAL_ERROR "no suitable type found")
         ENDIF(CMAKE_SIZEOF_UNSIGNED_LONG)
-    
+
       ENDIF(CMAKE_SIZEOF_UNSIGNED_INT)
-    
+
     ENDIF(CMAKE_SIZEOF_UNSIGNED_SHORT EQUAL 2)
 
-  
-    CONFIGURE_FILE("${CMAKE_ROOT}/Modules/TestEndianess.c.in" 
+
+    CONFIGURE_FILE("${CMAKE_ROOT}/Modules/TestEndianess.c.in"
                    "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/TestEndianess.c"
                     IMMEDIATE @ONLY)
-  
+
      FILE(READ "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/TestEndianess.c"
           TEST_ENDIANESS_FILE_CONTENT)
 
@@ -96,10 +96,10 @@ MACRO(TEST_BIG_ENDIAN VARIABLE)
         IF(NOT CMAKE_TEST_ENDIANESS_STRINGS_BE  AND  NOT CMAKE_TEST_ENDIANESS_STRINGS_LE)
           MESSAGE(SEND_ERROR "TEST_BIG_ENDIAN found no result!")
         ENDIF(NOT CMAKE_TEST_ENDIANESS_STRINGS_BE  AND  NOT CMAKE_TEST_ENDIANESS_STRINGS_LE)
- 
+
         FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
           "Determining if the system is big endian passed with the following output:\n${OUTPUT}\nTestEndianess.c:\n${TEST_ENDIANESS_FILE_CONTENT}\n\n")
- 
+
       ELSE(HAVE_${VARIABLE})
         MESSAGE(STATUS "Check if the system is big endian - failed")
         FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
diff --git a/Modules/TestCXXAcceptsFlag.cmake b/Modules/TestCXXAcceptsFlag.cmake
index 52d0cf3e6..0d945bbdc 100644
--- a/Modules/TestCXXAcceptsFlag.cmake
+++ b/Modules/TestCXXAcceptsFlag.cmake
@@ -27,7 +27,7 @@ MACRO(CHECK_CXX_ACCEPTS_FLAG FLAGS  VARIABLE)
       ${CMAKE_BINARY_DIR}
       ${CMAKE_ROOT}/Modules/DummyCXXFile.cxx
       CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${FLAGS}
-      OUTPUT_VARIABLE OUTPUT) 
+      OUTPUT_VARIABLE OUTPUT)
     IF(${VARIABLE})
       MESSAGE(STATUS "Checking to see if CXX compiler accepts flag ${FLAGS} - yes")
       FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
diff --git a/Modules/TestForANSIForScope.cmake b/Modules/TestForANSIForScope.cmake
index ae2acef7e..a60719e1a 100644
--- a/Modules/TestForANSIForScope.cmake
+++ b/Modules/TestForANSIForScope.cmake
@@ -18,19 +18,19 @@
 
 IF("CMAKE_ANSI_FOR_SCOPE" MATCHES "^CMAKE_ANSI_FOR_SCOPE$")
   MESSAGE(STATUS "Check for ANSI scope")
-  TRY_COMPILE(CMAKE_ANSI_FOR_SCOPE  ${CMAKE_BINARY_DIR} 
+  TRY_COMPILE(CMAKE_ANSI_FOR_SCOPE  ${CMAKE_BINARY_DIR}
     ${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx
     OUTPUT_VARIABLE OUTPUT)
   IF (CMAKE_ANSI_FOR_SCOPE)
     MESSAGE(STATUS "Check for ANSI scope - found")
-    SET (CMAKE_NO_ANSI_FOR_SCOPE 0 CACHE INTERNAL 
+    SET (CMAKE_NO_ANSI_FOR_SCOPE 0 CACHE INTERNAL
       "Does the compiler support ansi for scope.")
     FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining if the CXX compiler understands ansi for scopes passed with "
       "the following output:\n${OUTPUT}\n\n")
   ELSE (CMAKE_ANSI_FOR_SCOPE)
     MESSAGE(STATUS "Check for ANSI scope - not found")
-    SET (CMAKE_NO_ANSI_FOR_SCOPE 1 CACHE INTERNAL 
+    SET (CMAKE_NO_ANSI_FOR_SCOPE 1 CACHE INTERNAL
       "Does the compiler support ansi for scope.")
     FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
       "Determining if the CXX compiler understands ansi for scopes failed with "
diff --git a/Modules/TestForANSIStreamHeaders.cmake b/Modules/TestForANSIStreamHeaders.cmake
index 19c1ab2f2..b542b7481 100644
--- a/Modules/TestForANSIStreamHeaders.cmake
+++ b/Modules/TestForANSIStreamHeaders.cmake
@@ -21,10 +21,10 @@ INCLUDE(CheckIncludeFileCXX)
 IF(NOT CMAKE_NO_ANSI_STREAM_HEADERS)
   CHECK_INCLUDE_FILE_CXX(iostream CMAKE_ANSI_STREAM_HEADERS)
   IF (CMAKE_ANSI_STREAM_HEADERS)
-    SET (CMAKE_NO_ANSI_STREAM_HEADERS 0 CACHE INTERNAL 
+    SET (CMAKE_NO_ANSI_STREAM_HEADERS 0 CACHE INTERNAL
          "Does the compiler support headers like iostream.")
-  ELSE (CMAKE_ANSI_STREAM_HEADERS)   
-    SET (CMAKE_NO_ANSI_STREAM_HEADERS 1 CACHE INTERNAL 
+  ELSE (CMAKE_ANSI_STREAM_HEADERS)
+    SET (CMAKE_NO_ANSI_STREAM_HEADERS 1 CACHE INTERNAL
        "Does the compiler support headers like iostream.")
   ENDIF (CMAKE_ANSI_STREAM_HEADERS)
 
diff --git a/Modules/TestForAnsiForScope.cxx b/Modules/TestForAnsiForScope.cxx
index f2ec76077..e8807ab4a 100644
--- a/Modules/TestForAnsiForScope.cxx
+++ b/Modules/TestForAnsiForScope.cxx
@@ -1,5 +1,5 @@
 int main(int, char*[])
-{ 
+{
   int i;
   for(int i=0; i < 1; ++i);
   (void)i;
diff --git a/Modules/TestForSSTREAM.cmake b/Modules/TestForSSTREAM.cmake
index 8dd53e744..30ff3bcb9 100644
--- a/Modules/TestForSSTREAM.cmake
+++ b/Modules/TestForSSTREAM.cmake
@@ -18,19 +18,19 @@
 
 IF("CMAKE_HAS_ANSI_STRING_STREAM" MATCHES "^CMAKE_HAS_ANSI_STRING_STREAM$")
   MESSAGE(STATUS "Check for sstream")
-  TRY_COMPILE(CMAKE_HAS_ANSI_STRING_STREAM  ${CMAKE_BINARY_DIR} 
+  TRY_COMPILE(CMAKE_HAS_ANSI_STRING_STREAM  ${CMAKE_BINARY_DIR}
     ${CMAKE_ROOT}/Modules/TestForSSTREAM.cxx
     OUTPUT_VARIABLE OUTPUT)
   IF (CMAKE_HAS_ANSI_STRING_STREAM)
     MESSAGE(STATUS "Check for sstream - found")
-    SET (CMAKE_NO_ANSI_STRING_STREAM 0 CACHE INTERNAL 
+    SET (CMAKE_NO_ANSI_STRING_STREAM 0 CACHE INTERNAL
          "Does the compiler support sstream")
     FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining if the CXX compiler has sstream passed with "
       "the following output:\n${OUTPUT}\n\n")
   ELSE (CMAKE_HAS_ANSI_STRING_STREAM)
     MESSAGE(STATUS "Check for sstream - not found")
-    SET (CMAKE_NO_ANSI_STRING_STREAM 1 CACHE INTERNAL 
+    SET (CMAKE_NO_ANSI_STRING_STREAM 1 CACHE INTERNAL
        "Does the compiler support sstream")
     FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
       "Determining if the CXX compiler has sstream failed with "
diff --git a/Modules/TestForSSTREAM.cxx b/Modules/TestForSSTREAM.cxx
index af4a4bbef..1c939da23 100644
--- a/Modules/TestForSSTREAM.cxx
+++ b/Modules/TestForSSTREAM.cxx
@@ -1,6 +1,6 @@
 #include <sstream>
 int main(int, char*[])
-{ 
+{
   std::ostringstream os;
   os << "12345";
   if(os.str().size() == 5)
diff --git a/Modules/TestForSTDNamespace.cmake b/Modules/TestForSTDNamespace.cmake
index 932d6e994..65e0de044 100644
--- a/Modules/TestForSTDNamespace.cmake
+++ b/Modules/TestForSTDNamespace.cmake
@@ -18,19 +18,19 @@
 
 IF("CMAKE_STD_NAMESPACE" MATCHES "^CMAKE_STD_NAMESPACE$")
   MESSAGE(STATUS "Check for STD namespace")
-  TRY_COMPILE(CMAKE_STD_NAMESPACE  ${CMAKE_BINARY_DIR} 
+  TRY_COMPILE(CMAKE_STD_NAMESPACE  ${CMAKE_BINARY_DIR}
     ${CMAKE_ROOT}/Modules/TestForSTDNamespace.cxx
     OUTPUT_VARIABLE OUTPUT)
   IF (CMAKE_STD_NAMESPACE)
     MESSAGE(STATUS "Check for STD namespace - found")
-    SET (CMAKE_NO_STD_NAMESPACE 0 CACHE INTERNAL 
+    SET (CMAKE_NO_STD_NAMESPACE 0 CACHE INTERNAL
          "Does the compiler support std::.")
     FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining if the CXX compiler has std namespace passed with "
       "the following output:\n${OUTPUT}\n\n")
   ELSE (CMAKE_STD_NAMESPACE)
     MESSAGE(STATUS "Check for STD namespace - not found")
-    SET (CMAKE_NO_STD_NAMESPACE 1 CACHE INTERNAL 
+    SET (CMAKE_NO_STD_NAMESPACE 1 CACHE INTERNAL
        "Does the compiler support std::.")
     FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
       "Determining if the CXX compiler has std namespace failed with "
diff --git a/Modules/TestForSTDNamespace.cxx b/Modules/TestForSTDNamespace.cxx
index fc3ac5911..b537d44a9 100644
--- a/Modules/TestForSTDNamespace.cxx
+++ b/Modules/TestForSTDNamespace.cxx
@@ -1,6 +1,6 @@
 #include <list>
 int main(int, char*[])
-{ 
+{
   std::list<int>();
   return 0;
 }
diff --git a/Modules/UseQt4.cmake b/Modules/UseQt4.cmake
index 027504fc5..d4852a083 100644
--- a/Modules/UseQt4.cmake
+++ b/Modules/UseQt4.cmake
@@ -103,6 +103,6 @@ FOREACH(module QT3SUPPORT QTOPENGL QTASSISTANT QTDESIGNER QTMOTIF QTNSPLUGIN
       MESSAGE("Qt ${module} library not found.")
     ENDIF (QT_${module}_FOUND)
   ENDIF (QT_USE_${module} OR QT_USE_${module}_DEPENDS)
-  
+
 ENDFOREACH(module)
 
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index ef7672440..a7085ee31 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -10,7 +10,7 @@
 # Set Source files properties such as CPLUSPLUS and SWIG_FLAGS to specify
 # special behavior of SWIG. Also global CMAKE_SWIG_FLAGS can be used to add
 # special flags to all swig calls.
-# Another special variable is CMAKE_SWIG_OUTDIR, it allows one to specify 
+# Another special variable is CMAKE_SWIG_OUTDIR, it allows one to specify
 # where to write all the swig generated module (swig -outdir option)
 # The name-specific variable SWIG_MODULE_<name>_EXTRA_DEPS may be used
 # to specify extra dependencies for the generated modules.
@@ -52,7 +52,7 @@ MACRO(SWIG_MODULE_INITIALIZE name language)
     MESSAGE(FATAL_ERROR "SWIG Error: Language \"${language}\" not found")
   ELSEIF("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "PYTHON")
     # when swig is used without the -interface it will produce in the module.py
-    # a 'import _modulename' statement, which implies having a corresponding 
+    # a 'import _modulename' statement, which implies having a corresponding
     # _modulename.so (*NIX), _modulename.pyd (Win32).
     SET(SWIG_MODULE_${name}_REAL_NAME "_${name}")
   ELSEIF("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "PERL")
@@ -93,13 +93,13 @@ MACRO(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
   ENDIF("${swig_source_file_flags}" STREQUAL "NOTFOUND")
   SET(swig_source_file_fullname "${infile}")
   IF(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}")
-    STRING(REGEX REPLACE 
+    STRING(REGEX REPLACE
       "^${CMAKE_CURRENT_SOURCE_DIR}" ""
       swig_source_file_relative_path
       "${swig_source_file_path}")
   ELSE(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}")
     IF(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_BINARY_DIR}")
-      STRING(REGEX REPLACE 
+      STRING(REGEX REPLACE
         "^${CMAKE_CURRENT_BINARY_DIR}" ""
         swig_source_file_relative_path
         "${swig_source_file_path}")
@@ -178,7 +178,7 @@ MACRO(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
     "${swig_source_file_fullname}"
     MAIN_DEPENDENCY "${swig_source_file_fullname}"
     DEPENDS ${SWIG_MODULE_${name}_EXTRA_DEPS}
-    COMMENT "Swig source") 
+    COMMENT "Swig source")
   SET_SOURCE_FILES_PROPERTIES("${swig_generated_file_fullname}" ${swig_extra_generated_files}
     PROPERTIES GENERATED 1)
   SET(${outfiles} "${swig_generated_file_fullname}" ${swig_extra_generated_files})
diff --git a/Source/CPack/OSXScriptLauncher.cxx b/Source/CPack/OSXScriptLauncher.cxx
index e0fbe9b75..a9842c1df 100644
--- a/Source/CPack/OSXScriptLauncher.cxx
+++ b/Source/CPack/OSXScriptLauncher.cxx
@@ -93,7 +93,7 @@ int main(int argc, char* argv[])
   cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1);
   cmsysProcess_SetTimeout(cp, 0);
   cmsysProcess_Execute(cp);
-  
+
   std::vector<char> tempOutput;
   char* data;
   int length;
@@ -111,9 +111,9 @@ int main(int argc, char* argv[])
       }
     cmsys_ios::cout.write(data, length);
     }
-  
+
   cmsysProcess_WaitForExit(cp, 0);
-  
+
   bool result = true;
   if(cmsysProcess_GetState(cp) == cmsysProcess_State_Exited)
     {
@@ -140,7 +140,7 @@ int main(int argc, char* argv[])
     std::cerr << error_str << std::endl;
     result = false;
     }
-  
+
   cmsysProcess_Delete(cp);
 
   return 0;
diff --git a/Source/CPack/bills-comments.txt b/Source/CPack/bills-comments.txt
index f73499d01..c3b4ee8e7 100644
--- a/Source/CPack/bills-comments.txt
+++ b/Source/CPack/bills-comments.txt
@@ -1,18 +1,18 @@
 cpack.cxx
-   
-cmCPackGenerators  -- creates cmCPackGenericGenerator's via NewGenerator 
+
+cmCPackGenerators  -- creates cmCPackGenericGenerator's via NewGenerator
   - a cmCPackGenericGenerator factory
 
 
 cmCPackGenericGenerator::Initialize
    this->InitializeInternal
-     CPACK_INCLUDE_TOPLEVEL_DIRECTORY = 0 turns off 
+     CPACK_INCLUDE_TOPLEVEL_DIRECTORY = 0 turns off
 
 
 // binary package run
 cmCPackGenericGenerator::ProcessGenerator   // DoPackage
   cmCPackGenericGenerator::PrepareNames  -- sets a bunch of CPACK_vars
-  cmCPackGenericGenerator::InstallProject  
+  cmCPackGenericGenerator::InstallProject
      run preinstall  (make preinstall/fast)
      call ReadListFile(cmake_install.cmake)
   glob recurse in install directory to get list of files
@@ -22,9 +22,9 @@ cmCPackGenericGenerator::ProcessGenerator   // DoPackage
 // source package run
 cmCPackGenericGenerator::ProcessGenerator   // DoPackage
   cmCPackGenericGenerator::PrepareNames  -- sets a bunch of CPACK_vars
-  cmCPackGenericGenerator::InstallProject  --> 
+  cmCPackGenericGenerator::InstallProject  -->
      if set CPACK_INSTALLED_DIRECTORIES
-        glob the files in that directory 
+        glob the files in that directory
         copy those files to the tmp install directory _CPack something
   glob recurse in install directory to get list of files
      this->CompressFiles with the list of files
@@ -35,12 +35,12 @@ packages.  It is controled based on values set in CPACK_ variables.
 
 
 InstallProject
-   1. CPACK_INSTALL_COMMANDS       - a list of commands used to install the package 
+   1. CPACK_INSTALL_COMMANDS       - a list of commands used to install the package
 
    2. CPACK_INSTALLED_DIRECTORIES  - copy this directory to CPACK_TEMPORARY_DIRECTORY
 
    3. CPACK_INSTALL_CMAKE_PROJECTS - a cmake install script
-         - run make preinstall 
+         - run make preinstall
          - run cmake_install.cmake
              - set CMAKE_INSTALL_PREFIX to the temp directory
              - CPACK_BUILD_CONFIG check this and set the BUILD_TYPE to it
@@ -59,10 +59,10 @@ rename cmCPackGenericGenerator::ProcessGenerator  -> cmCPackGenerator::DoPackage
 break up cmCPackGenerator::InstallProject so it calls the following:
 
 // run user provided install commands
-  cmCPackGenerator::RunInstallCommands(); 
+  cmCPackGenerator::RunInstallCommands();
 // copy entire directories that need no processing like source trees
-  cmCPackGenerator::CopyPreInstalledDirectories();  
+  cmCPackGenerator::CopyPreInstalledDirectories();
 // run the cmake install scripts if provided
-  cmCPackGenerator::RunCMakeInstallScripts()  
+  cmCPackGenerator::RunCMakeInstallScripts()
 
 -
diff --git a/Source/CPack/cmCPackArchiveGenerator.h b/Source/CPack/cmCPackArchiveGenerator.h
index b1bbb8363..6411b1ebf 100644
--- a/Source/CPack/cmCPackArchiveGenerator.h
+++ b/Source/CPack/cmCPackArchiveGenerator.h
@@ -33,7 +33,7 @@ public:
    */
   cmCPackArchiveGenerator(cmArchiveWrite::Compress, cmArchiveWrite::Type);
   virtual ~cmCPackArchiveGenerator();
-  // Used to add a header to the archive 
+  // Used to add a header to the archive
   virtual int GenerateHeader(std::ostream* os);
   // component support
   virtual bool SupportsComponentInstallation() const;
diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx
index af78e7822..6c994f13f 100644
--- a/Source/CPack/cmCPackBundleGenerator.cxx
+++ b/Source/CPack/cmCPackBundleGenerator.cxx
@@ -91,8 +91,8 @@ int cmCPackBundleGenerator::PackageFiles()
     }
 
   // Get optional arguments ...
-  const std::string cpack_bundle_startup_command = 
-    this->GetOption("CPACK_BUNDLE_STARTUP_COMMAND") 
+  const std::string cpack_bundle_startup_command =
+    this->GetOption("CPACK_BUNDLE_STARTUP_COMMAND")
     ? this->GetOption("CPACK_BUNDLE_STARTUP_COMMAND") : "";
 
   // The staging directory contains everything that will end-up inside the
diff --git a/Source/CPack/cmCPackComponentGroup.cxx b/Source/CPack/cmCPackComponentGroup.cxx
index 1d21fb11c..f93eca823 100644
--- a/Source/CPack/cmCPackComponentGroup.cxx
+++ b/Source/CPack/cmCPackComponentGroup.cxx
@@ -36,7 +36,7 @@ unsigned long cmCPackComponent::GetInstalledSize(const char* installDir) const
 }
 
 //----------------------------------------------------------------------
-unsigned long 
+unsigned long
 cmCPackComponent::GetInstalledSizeInKbytes(const char* installDir) const
 {
   unsigned long result = (GetInstalledSize(installDir) + 512) / 1024;
diff --git a/Source/CPack/cmCPackComponentGroup.h b/Source/CPack/cmCPackComponentGroup.h
index cebdd6d20..48d935cbe 100644
--- a/Source/CPack/cmCPackComponentGroup.h
+++ b/Source/CPack/cmCPackComponentGroup.h
@@ -18,7 +18,7 @@
 class cmCPackComponentGroup;
 
 /** \class cmCPackInstallationType
- * \brief A certain type of installation, which encompasses a 
+ * \brief A certain type of installation, which encompasses a
  * set of components.
  */
 class cmCPackInstallationType
@@ -90,7 +90,7 @@ public:
   std::vector<std::string> Directories;
 
   /// Get the total installed size of all of the files in this
-  /// component, in bytes. installDir is the directory into which the 
+  /// component, in bytes. installDir is the directory into which the
   /// component was installed.
   unsigned long GetInstalledSize(const char* installDir) const;
 
diff --git a/Source/CPack/cmCPackCygwinBinaryGenerator.cxx b/Source/CPack/cmCPackCygwinBinaryGenerator.cxx
index 6c8fc54e0..6605f16e0 100644
--- a/Source/CPack/cmCPackCygwinBinaryGenerator.cxx
+++ b/Source/CPack/cmCPackCygwinBinaryGenerator.cxx
@@ -50,7 +50,7 @@ int cmCPackCygwinBinaryGenerator::PackageFiles()
   std::string manifest = "/usr/share/doc/";
   manifest += packageName;
   manifest += "/MANIFEST";
-  std::string manifestFile 
+  std::string manifestFile
     = this->GetOption("CPACK_TEMPORARY_DIRECTORY");
   // Create a MANIFEST file that contains all of the files in
   // the tar file
@@ -70,8 +70,8 @@ int cmCPackCygwinBinaryGenerator::PackageFiles()
   }
   // add the manifest file to the list of all files
   files.push_back(manifestFile);
-  
-  // create the bzip2 tar file 
+
+  // create the bzip2 tar file
   return this->Superclass::PackageFiles();
 }
 
@@ -81,8 +81,8 @@ const char* cmCPackCygwinBinaryGenerator::GetOutputExtension()
   const char* patchNumber =this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
   if(!patchNumber)
     {
-    patchNumber = "1";  
-    cmCPackLogger(cmCPackLog::LOG_WARNING, 
+    patchNumber = "1";
+    cmCPackLogger(cmCPackLog::LOG_WARNING,
                   "CPACK_CYGWIN_PATCH_NUMBER not specified using 1"
                   << std::endl);
     }
diff --git a/Source/CPack/cmCPackCygwinSourceGenerator.cxx b/Source/CPack/cmCPackCygwinSourceGenerator.cxx
index 597972992..f1e8539b9 100644
--- a/Source/CPack/cmCPackCygwinSourceGenerator.cxx
+++ b/Source/CPack/cmCPackCygwinSourceGenerator.cxx
@@ -68,18 +68,18 @@ int cmCPackCygwinSourceGenerator::PackageFiles()
   // and the CPACK_CYGWIN_PATCH_FILE and CPACK_TOPLEVEL_DIRECTORY
   // files
   std::string compressOutFile = packageDirFileName;
-  // at this point compressOutFile is the full path to 
+  // at this point compressOutFile is the full path to
   // _CPack_Package/.../package-2.5.0.tar.bz2
   // we want to create a tar _CPack_Package/.../package-2.5.0-1-src.tar.bz2
-  // with these 
-  //   _CPack_Package/.../package-2.5.0-1.patch 
+  // with these
+  //   _CPack_Package/.../package-2.5.0-1.patch
   //   _CPack_Package/.../package-2.5.0-1.sh
   //   _CPack_Package/.../package-2.5.0.tar.bz2
   // the -1 is CPACK_CYGWIN_PATCH_NUMBER
-  
+
   // first copy the patch file and the .sh file
   // to the toplevel cpack temp dir
-  
+
   // copy the patch file into place
   if(!this->GetOption("CPACK_CYGWIN_PATCH_FILE"))
     {
@@ -98,7 +98,7 @@ int cmCPackCygwinSourceGenerator::PackageFiles()
     }
   if(!this->GetOption("CPACK_CYGWIN_BUILD_SCRIPT"))
     {
-    cmCPackLogger(cmCPackLog::LOG_ERROR, 
+    cmCPackLogger(cmCPackLog::LOG_ERROR,
                   "No build script specified for cygwin sources.");
     return 0;
     }
@@ -168,7 +168,7 @@ const char* cmCPackCygwinSourceGenerator::GetPackagingInstallPrefix()
 const char* cmCPackCygwinSourceGenerator::GetOutputExtension()
 {
   this->OutputExtension = "-";
-  const char* patch = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER"); 
+  const char* patch = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
   if(!patch)
     {
     cmCPackLogger(cmCPackLog::LOG_WARNING, "CPACK_CYGWIN_PATCH_NUMBER"
@@ -179,4 +179,4 @@ const char* cmCPackCygwinSourceGenerator::GetOutputExtension()
   this->OutputExtension += "-src.tar.bz2";
   return this->OutputExtension.c_str();
 }
-  
+
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index fa456deff..4bd5d5c2f 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -293,15 +293,15 @@ int cmCPackDebGenerator::createDeb()
 
   // debian policy enforce lower case for package name
   // mandatory entries:
-  std::string debian_pkg_name = cmsys::SystemTools::LowerCase( 
+  std::string debian_pkg_name = cmsys::SystemTools::LowerCase(
                                 this->GetOption("CPACK_DEBIAN_PACKAGE_NAME") );
-  const char* debian_pkg_version = 
+  const char* debian_pkg_version =
                                this->GetOption("CPACK_DEBIAN_PACKAGE_VERSION");
-  const char* debian_pkg_section = 
+  const char* debian_pkg_section =
                                this->GetOption("CPACK_DEBIAN_PACKAGE_SECTION");
-  const char* debian_pkg_priority = 
+  const char* debian_pkg_priority =
                               this->GetOption("CPACK_DEBIAN_PACKAGE_PRIORITY");
-  const char* debian_pkg_arch = 
+  const char* debian_pkg_arch =
                           this->GetOption("CPACK_DEBIAN_PACKAGE_ARCHITECTURE");
   const char* maintainer =  this->GetOption("CPACK_DEBIAN_PACKAGE_MAINTAINER");
   const char* desc =       this->GetOption("CPACK_DEBIAN_PACKAGE_DESCRIPTION");
@@ -719,8 +719,8 @@ static int copy_ar(CF *cfp, off_t size)
 
   FILE* from = cfp->rFile;
   FILE* to = cfp->wFile;
-  while (sz && 
-        (nr = fread(buf, 1, sz < static_cast<off_t>(sizeof(buf)) 
+  while (sz &&
+        (nr = fread(buf, 1, sz < static_cast<off_t>(sizeof(buf))
                     ? static_cast<size_t>(sz) : sizeof(buf), from ))
                > 0) {
     sz -= nr;
@@ -731,7 +731,7 @@ static int copy_ar(CF *cfp, off_t size)
   if (sz)
     return -2;
 
-  if (cfp->flags & WPAD && (size + ar_already_written) & 1 
+  if (cfp->flags & WPAD && (size + ar_already_written) & 1
       && fwrite(&pad, 1, 1, to) != 1)
     return -4;
 
@@ -767,8 +767,8 @@ static int put_arobj(CF *cfp, struct stat *sb)
                   (long long)sb->st_size + lname, ARFMAG);
     else {
       lname = 0;
-      (void)sprintf(ar_hb, HDR2, name, 
-                    (long int)sb->st_mtime, uid, gid, sb->st_mode, 
+      (void)sprintf(ar_hb, HDR2, name,
+                    (long int)sb->st_mtime, uid, gid, sb->st_mode,
                     (long long)sb->st_size, ARFMAG);
       }
     off_t size = sb->st_size;
@@ -790,7 +790,7 @@ static int put_arobj(CF *cfp, struct stat *sb)
 
 /* append --
  *      Append files to the archive - modifies original archive or creates
- *      a new archive if named archive does not exist. 
+ *      a new archive if named archive does not exist.
  */
 static int ar_append(const char* archive,const std::vector<std::string>& files)
 {
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 6aee401ff..78cb1b61c 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -17,7 +17,7 @@
 
 #include <cmsys/RegularExpression.hxx>
 
-static const char* SLAHeader = 
+static const char* SLAHeader =
 "data 'LPic' (5000) {\n"
 "    $\"0002 0011 0003 0001 0000 0000 0002 0000\"\n"
 "    $\"0008 0003 0000 0001 0004 0000 0004 0005\"\n"
@@ -29,7 +29,7 @@ static const char* SLAHeader =
 "};\n"
 "\n";
 
-static const char* SLASTREnglish = 
+static const char* SLASTREnglish =
 "resource 'STR#' (5002, \"English\") {\n"
 "    {\n"
 "        \"English\",\n"
@@ -90,7 +90,7 @@ int cmCPackDragNDropGenerator::InitializeInternal()
     return 0;
     }
   this->SetOptionIfNotSet("CPACK_COMMAND_SETFILE", setfile_path.c_str());
-  
+
   const std::string rez_path = cmSystemTools::FindProgram("Rez",
     paths, false);
   if(rez_path.empty())
@@ -222,7 +222,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
   // Get optional arguments ...
   const std::string cpack_package_icon = this->GetOption("CPACK_PACKAGE_ICON")
     ? this->GetOption("CPACK_PACKAGE_ICON") : "";
-  
+
   const std::string cpack_dmg_volume_name =
     this->GetOption("CPACK_DMG_VOLUME_NAME")
     ? this->GetOption("CPACK_DMG_VOLUME_NAME")
@@ -233,8 +233,8 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
     ? this->GetOption("CPACK_DMG_FORMAT") : "UDZO";
 
   // Get optional arguments ...
-  std::string cpack_license_file = 
-    this->GetOption("CPACK_RESOURCE_FILE_LICENSE") ? 
+  std::string cpack_license_file =
+    this->GetOption("CPACK_RESOURCE_FILE_LICENSE") ?
     this->GetOption("CPACK_RESOURCE_FILE_LICENSE") : "";
 
   const std::string cpack_dmg_background_image =
@@ -405,7 +405,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
     cmOStringStream detach_command;
     detach_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
     detach_command << " detach";
-    detach_command << " \"" << temp_mount.str() << "\""; 
+    detach_command << " \"" << temp_mount.str() << "\"";
 
     if(!this->RunCommand(detach_command))
       {
@@ -416,7 +416,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
       return 0;
       }
     }
-  
+
   if(!cpack_license_file.empty())
   {
     std::string sla_r = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
@@ -460,7 +460,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
     udco_image_command << " convert \"" << temp_image << "\"";
     udco_image_command << " -format UDCO";
     udco_image_command << " -o \"" << temp_udco << "\"";
-    
+
     std::string error;
     if(!this->RunCommand(udco_image_command, &error))
       {
@@ -476,17 +476,17 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
     unflatten_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
     unflatten_command << " unflatten ";
     unflatten_command << "\"" << temp_udco << "\"";
-    
+
     if(!this->RunCommand(unflatten_command, &error))
       {
       cmCPackLogger(cmCPackLog::LOG_ERROR,
         "Error unflattening dmg for adding SLA." << std::endl
-        << error 
+        << error
         << std::endl);
       return 0;
       }
- 
-    // Rez the SLA 
+
+    // Rez the SLA
     cmOStringStream embed_sla_command;
     embed_sla_command << this->GetOption("CPACK_COMMAND_REZ");
     embed_sla_command << " \"" << sla_r << "\"";
@@ -496,8 +496,8 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
     if(!this->RunCommand(embed_sla_command, &error))
       {
       cmCPackLogger(cmCPackLog::LOG_ERROR,
-        "Error adding SLA." << std::endl 
-        << error 
+        "Error adding SLA." << std::endl
+        << error
         << std::endl);
       return 0;
       }
@@ -507,7 +507,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
     flatten_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
     flatten_command << " flatten ";
     flatten_command << "\"" << temp_udco << "\"";
-    
+
     if(!this->RunCommand(flatten_command, &error))
       {
       cmCPackLogger(cmCPackLog::LOG_ERROR,
@@ -530,7 +530,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
   final_image_command << " -imagekey";
   final_image_command << " zlib-level=9";
   final_image_command << " -o \"" << output_file << "\"";
-  
+
   if(!this->RunCommand(final_image_command))
     {
     cmCPackLogger(cmCPackLog::LOG_ERROR,
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 0177653f5..f11340046 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -105,7 +105,7 @@ int cmCPackGenerator::PrepareNames()
                   "CPACK_PACKAGE_FILE_NAME not specified" << std::endl);
     return 0;
     }
-  std::string outName = pfname; 
+  std::string outName = pfname;
   tempDirectory += "/" + outName;
   if(!this->GetOutputExtension())
     {
@@ -149,7 +149,7 @@ int cmCPackGenerator::PrepareNames()
     if ( !cmSystemTools::FileExists(descFileName) )
       {
       cmCPackLogger(cmCPackLog::LOG_ERROR,
-                    "Cannot find description file name: [" 
+                    "Cannot find description file name: ["
                     << descFileName << "]" << std::endl);
       return 0;
       }
@@ -207,7 +207,7 @@ int cmCPackGenerator::InstallProject()
   if ( !cmsys::SystemTools::MakeDirectory(bareTempInstallDirectory.c_str()))
     {
     cmCPackLogger(cmCPackLog::LOG_ERROR,
-      "Problem creating temporary directory: " 
+      "Problem creating temporary directory: "
                   << (tempInstallDirectory ? tempInstallDirectory : "(NULL}")
                   << std::endl);
     return 0;
@@ -584,7 +584,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
           !(this->IsSet("CPACK_MONOLITHIC_INSTALL")))
         {
         // Determine the installation types for this project (if provided).
-        std::string installTypesVar = "CPACK_" 
+        std::string installTypesVar = "CPACK_"
           + cmSystemTools::UpperCase(installComponent) + "_INSTALL_TYPES";
         const char *installTypes = this->GetOption(installTypesVar.c_str());
         if (installTypes && *installTypes)
@@ -596,16 +596,16 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
                installTypeIt != installTypesVector.end();
                ++installTypeIt)
             {
-            this->GetInstallationType(installProjectName.c_str(), 
+            this->GetInstallationType(installProjectName.c_str(),
                                       installTypeIt->c_str());
             }
           }
 
         // Determine the set of components that will be used in this project
-        std::string componentsVar 
+        std::string componentsVar
           = "CPACK_COMPONENTS_" + cmSystemTools::UpperCase(installComponent);
         const char *components = this->GetOption(componentsVar.c_str());
-        if (components && *components) 
+        if (components && *components)
           {
           cmSystemTools::ExpandListArgument(components, componentsVector);
           std::vector<std::string>::iterator compIt;
@@ -688,10 +688,10 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
         if (componentInstall)
           {
           cmCPackLogger(cmCPackLog::LOG_OUTPUT,
-                        "-   Install component: " << installComponent 
+                        "-   Install component: " << installComponent
                         << std::endl);
           }
-        
+
         cmake cm;
         cm.AddCMakePaths();
         cm.SetProgressCallback(cmCPackGeneratorProgress, this);
@@ -758,7 +758,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
             "- Using DESTDIR + CPACK_INSTALL_PREFIX... (mf->AddDefinition)"
             << std::endl);
           cmCPackLogger(cmCPackLog::LOG_DEBUG,
-                        "- Setting CMAKE_INSTALL_PREFIX to '" << dir << "'" 
+                        "- Setting CMAKE_INSTALL_PREFIX to '" << dir << "'"
                         << std::endl);
 
           // Make sure that DESTDIR + CPACK_INSTALL_PREFIX directory
@@ -792,7 +792,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
           if ( !cmsys::SystemTools::MakeDirectory(dir.c_str()))
             {
             cmCPackLogger(cmCPackLog::LOG_ERROR,
-                          "Problem creating temporary directory: " 
+                          "Problem creating temporary directory: "
                           << dir << std::endl);
             return 0;
             }
@@ -806,7 +806,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
                  tempInstallDirectory.c_str()))
             {
             cmCPackLogger(cmCPackLog::LOG_ERROR,
-                          "Problem creating temporary directory: " 
+                          "Problem creating temporary directory: "
                           << tempInstallDirectory << std::endl);
             return 0;
             }
@@ -832,7 +832,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
                             installComponent.c_str());
           }
 
-        // strip on TRUE, ON, 1, one or several file names, but not on 
+        // strip on TRUE, ON, 1, one or several file names, but not on
         // FALSE, OFF, 0 and an empty string
         if (!cmSystemTools::IsOff(this->GetOption("CPACK_STRIP_FILES")))
           {
@@ -1024,7 +1024,7 @@ int cmCPackGenerator::DoPackage()
       = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
     if ( cmSystemTools::FileExists(toplevelDirectory) )
       {
-      cmCPackLogger(cmCPackLog::LOG_VERBOSE, 
+      cmCPackLogger(cmCPackLog::LOG_VERBOSE,
                     "Remove toplevel directory: "
         << toplevelDirectory << std::endl);
       if ( !cmSystemTools::RepeatedRemoveDirectory(toplevelDirectory) )
@@ -1153,10 +1153,10 @@ int cmCPackGenerator::Initialize(const char* name, cmMakefile* mf)
   // set the running generator name
   this->SetOption("CPACK_GENERATOR", this->Name.c_str());
   // Load the project specific config file
-  const char* config = 
+  const char* config =
     this->GetOption("CPACK_PROJECT_CONFIG_FILE");
   if(config)
-    { 
+    {
     mf->ReadListFile(config);
     }
   int result = this->InitializeInternal();
@@ -1193,13 +1193,13 @@ bool cmCPackGenerator::IsOn(const char* name) const
 
 //----------------------------------------------------------------------
 const char* cmCPackGenerator::GetOption(const char* op) const
-{ 
+{
   const char* ret = this->MakefileMap->GetDefinition(op);
   if(!ret)
-    { 
-    cmCPackLogger(cmCPackLog::LOG_DEBUG, 
+    {
+    cmCPackLogger(cmCPackLog::LOG_DEBUG,
                   "Warning, GetOption return NULL for: "
-                  << op 
+                  << op
                   << std::endl);
     }
   return ret;
@@ -1222,7 +1222,7 @@ int cmCPackGenerator::SetCMakeRoot()
       return 1;
     }
   cmCPackLogger(cmCPackLog::LOG_ERROR,
-                "Could not find CMAKE_ROOT !!!" 
+                "Could not find CMAKE_ROOT !!!"
                 << std::endl
                 << "CMake has most likely not been installed correctly."
                 << std::endl
@@ -1516,14 +1516,14 @@ cmCPackGenerator::GetInstallationType(const char *projectName,
   (void) projectName;
   bool hasInstallationType = this->InstallationTypes.count(name) != 0;
   cmCPackInstallationType *installType = &this->InstallationTypes[name];
-  if (!hasInstallationType) 
+  if (!hasInstallationType)
     {
     // Define the installation type
-    std::string macroPrefix = "CPACK_INSTALL_TYPE_" 
+    std::string macroPrefix = "CPACK_INSTALL_TYPE_"
       + cmsys::SystemTools::UpperCase(name);
     installType->Name = name;
 
-    const char* displayName 
+    const char* displayName
       = this->GetOption((macroPrefix + "_DISPLAY_NAME").c_str());
     if (displayName && *displayName)
       {
@@ -1546,13 +1546,13 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name)
 {
   bool hasComponent = this->Components.count(name) != 0;
   cmCPackComponent *component = &this->Components[name];
-  if (!hasComponent) 
+  if (!hasComponent)
     {
     // Define the component
-    std::string macroPrefix = "CPACK_COMPONENT_" 
+    std::string macroPrefix = "CPACK_COMPONENT_"
       + cmsys::SystemTools::UpperCase(name);
     component->Name = name;
-    const char* displayName 
+    const char* displayName
       = this->GetOption((macroPrefix + "_DISPLAY_NAME").c_str());
     if (displayName && *displayName)
       {
@@ -1562,7 +1562,7 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name)
       {
       component->DisplayName = component->Name;
       }
-    component->IsHidden 
+    component->IsHidden
       = this->IsSet((macroPrefix + "_HIDDEN").c_str());
     component->IsRequired
       = this->IsSet((macroPrefix + "_REQUIRED").c_str());
@@ -1572,7 +1572,7 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name)
       = this->IsSet((macroPrefix + "_DOWNLOADED").c_str())
         || cmSystemTools::IsOn(this->GetOption("CPACK_DOWNLOAD_ALL"));
 
-    const char* archiveFile = this->GetOption((macroPrefix + 
+    const char* archiveFile = this->GetOption((macroPrefix +
                                                "_ARCHIVE_FILE").c_str());
     if (archiveFile && *archiveFile)
       {
@@ -1580,7 +1580,7 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name)
       }
 
     const char* groupName = this->GetOption((macroPrefix + "_GROUP").c_str());
-    if (groupName && *groupName) 
+    if (groupName && *groupName)
       {
       component->Group = GetComponentGroup(projectName, groupName);
       component->Group->Components.push_back(component);
@@ -1598,15 +1598,15 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name)
       }
 
     // Determine the installation types.
-    const char *installTypes 
+    const char *installTypes
       = this->GetOption((macroPrefix + "_INSTALL_TYPES").c_str());
-    if (installTypes && *installTypes) 
+    if (installTypes && *installTypes)
       {
       std::vector<std::string> installTypesVector;
       cmSystemTools::ExpandListArgument(installTypes, installTypesVector);
       std::vector<std::string>::iterator installTypesIt;
-      for (installTypesIt = installTypesVector.begin(); 
-           installTypesIt != installTypesVector.end(); 
+      for (installTypesIt = installTypesVector.begin();
+           installTypesIt != installTypesVector.end();
            ++installTypesIt)
         {
         component->InstallationTypes.push_back(
@@ -1616,16 +1616,16 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name)
 
     // Determine the component dependencies.
     const char *depends = this->GetOption((macroPrefix + "_DEPENDS").c_str());
-    if (depends && *depends) 
+    if (depends && *depends)
       {
       std::vector<std::string> dependsVector;
       cmSystemTools::ExpandListArgument(depends, dependsVector);
       std::vector<std::string>::iterator dependIt;
-      for (dependIt = dependsVector.begin(); 
-           dependIt != dependsVector.end(); 
+      for (dependIt = dependsVector.begin();
+           dependIt != dependsVector.end();
            ++dependIt)
         {
-        cmCPackComponent *child = GetComponent(projectName, 
+        cmCPackComponent *child = GetComponent(projectName,
                                                dependIt->c_str());
         component->Dependencies.push_back(child);
         child->ReverseDependencies.push_back(component);
@@ -1640,15 +1640,15 @@ cmCPackComponentGroup*
 cmCPackGenerator::GetComponentGroup(const char *projectName, const char *name)
 {
   (void) projectName;
-  std::string macroPrefix = "CPACK_COMPONENT_GROUP_" 
+  std::string macroPrefix = "CPACK_COMPONENT_GROUP_"
         + cmsys::SystemTools::UpperCase(name);
   bool hasGroup = this->ComponentGroups.count(name) != 0;
   cmCPackComponentGroup *group = &this->ComponentGroups[name];
-  if (!hasGroup) 
+  if (!hasGroup)
     {
     // Define the group
     group->Name = name;
-    const char* displayName 
+    const char* displayName
       = this->GetOption((macroPrefix + "_DISPLAY_NAME").c_str());
     if (displayName && *displayName)
       {
@@ -1669,7 +1669,7 @@ cmCPackGenerator::GetComponentGroup(const char *projectName, const char *name)
       = this->IsSet((macroPrefix + "_BOLD_TITLE").c_str());
     group->IsExpandedByDefault
       = this->IsSet((macroPrefix + "_EXPANDED").c_str());
-    const char* parentGroupName 
+    const char* parentGroupName
       = this->GetOption((macroPrefix + "_PARENT_GROUP").c_str());
     if (parentGroupName && *parentGroupName)
       {
diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h
index 6748512d2..8fafef93d 100644
--- a/Source/CPack/cmCPackGenerator.h
+++ b/Source/CPack/cmCPackGenerator.h
@@ -113,7 +113,7 @@ public:
 
   //! Display verbose information via logger
   void DisplayVerboseOutput(const char* msg, float progress);
-  
+
   bool ReadListFile(const char* moduleName);
 
 protected:
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index 7b5251148..b2e57a2b8 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -102,7 +102,7 @@ int cmCPackNSISGenerator::PackageFiles()
       }
     if (!Components.empty())
       {
-      // If this is a component installation, strip off the component 
+      // If this is a component installation, strip off the component
       // part of the path.
       std::string::size_type slash = fileN.find('/');
       if (slash != std::string::npos)
@@ -124,12 +124,12 @@ int cmCPackNSISGenerator::PackageFiles()
     }
   cmCPackLogger(cmCPackLog::LOG_DEBUG, "Uninstall Dirs: "
     << dstr.str().c_str() << std::endl);
-  this->SetOptionIfNotSet("CPACK_NSIS_DELETE_DIRECTORIES", 
+  this->SetOptionIfNotSet("CPACK_NSIS_DELETE_DIRECTORIES",
                           dstr.str().c_str());
 
   cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " << nsisInFileName
     << " to " << nsisFileName << std::endl);
-  if(this->IsSet("CPACK_NSIS_MUI_ICON") 
+  if(this->IsSet("CPACK_NSIS_MUI_ICON")
      || this->IsSet("CPACK_NSIS_MUI_UNIICON"))
     {
     std::string installerIconCode;
@@ -174,7 +174,7 @@ int cmCPackNSISGenerator::PackageFiles()
     this->SetOptionIfNotSet("CPACK_NSIS_INSTALLATION_TYPES", "");
     this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC", "");
     this->SetOptionIfNotSet("CPACK_NSIS_PAGE_COMPONENTS", "");
-    this->SetOptionIfNotSet("CPACK_NSIS_FULL_INSTALL", 
+    this->SetOptionIfNotSet("CPACK_NSIS_FULL_INSTALL",
                             "File /r \"${INST_DIR}\\*.*\"");
     this->SetOptionIfNotSet("CPACK_NSIS_COMPONENT_SECTIONS", "");
     this->SetOptionIfNotSet("CPACK_NSIS_COMPONENT_SECTION_LIST", "");
@@ -194,7 +194,7 @@ int cmCPackNSISGenerator::PackageFiles()
 
     // Create installation types. The order is significant, so we first fill
     // in a vector based on the indices, and print them in that order.
-    std::vector<cmCPackInstallationType *> 
+    std::vector<cmCPackInstallationType *>
       installTypes(this->InstallationTypes.size());
     std::map<std::string, cmCPackInstallationType>::iterator installTypeIt;
     for (installTypeIt = this->InstallationTypes.begin();
@@ -221,15 +221,15 @@ int cmCPackNSISGenerator::PackageFiles()
       {
       if (groupIt->second.ParentGroup == 0)
         {
-        componentCode += 
+        componentCode +=
           this->CreateComponentGroupDescription(&groupIt->second, macrosOut);
         }
 
       // Add the group description, if any.
       if (!groupIt->second.Description.empty())
         {
-        groupDescriptions += "  !insertmacro MUI_DESCRIPTION_TEXT ${" 
-          + groupIt->first + "} \"" 
+        groupDescriptions += "  !insertmacro MUI_DESCRIPTION_TEXT ${"
+          + groupIt->first + "} \""
           + this->TranslateNewlines(groupIt->second.Description) + "\"\n";
         }
       }
@@ -251,7 +251,7 @@ int cmCPackNSISGenerator::PackageFiles()
 
       if (!compIt->second.Group)
         {
-        componentCode 
+        componentCode
           += this->CreateComponentDescription(&compIt->second, macrosOut);
         }
 
@@ -265,8 +265,8 @@ int cmCPackNSISGenerator::PackageFiles()
       // Add the component description, if any.
       if (!compIt->second.Description.empty())
         {
-        componentDescriptions += "  !insertmacro MUI_DESCRIPTION_TEXT ${" 
-          + compIt->first + "} \"" 
+        componentDescriptions += "  !insertmacro MUI_DESCRIPTION_TEXT ${"
+          + compIt->first + "} \""
           + this->TranslateNewlines(compIt->second.Description) + "\"\n";
         }
       }
@@ -276,17 +276,17 @@ int cmCPackNSISGenerator::PackageFiles()
     if (componentDescriptions.empty() && groupDescriptions.empty())
       {
       // Turn off the "Description" box
-      this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC", 
+      this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC",
                               "!define MUI_COMPONENTSPAGE_NODESC");
       }
     else
       {
-      componentDescriptions = 
+      componentDescriptions =
         "!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n"
         + componentDescriptions
         + groupDescriptions
         + "!insertmacro MUI_FUNCTION_DESCRIPTION_END\n";
-      this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC", 
+      this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC",
                               componentDescriptions.c_str());
       }
 
@@ -308,12 +308,12 @@ int cmCPackNSISGenerator::PackageFiles()
                             componentCode.c_str());
     this->SetOptionIfNotSet("CPACK_NSIS_COMPONENT_SECTION_LIST",
                             sectionList.c_str());
-    this->SetOptionIfNotSet("CPACK_NSIS_SECTION_SELECTED_VARS", 
+    this->SetOptionIfNotSet("CPACK_NSIS_SECTION_SELECTED_VARS",
                             selectedVarsList.c_str());
     this->SetOption("CPACK_NSIS_DEFINES", defines.c_str());
     }
 
-  this->ConfigureFile(nsisInInstallOptions.c_str(), 
+  this->ConfigureFile(nsisInInstallOptions.c_str(),
                       nsisInstallOptions.c_str());
   this->ConfigureFile(nsisInFileName.c_str(), nsisFileName.c_str());
   std::string nsisCmd = "\"";
@@ -445,11 +445,11 @@ int cmCPackNSISGenerator::InitializeInternal()
     {
     cmCPackLogger(cmCPackLog::LOG_DEBUG, "CPACK_CREATE_DESKTOP_LINKS: "
                 << cpackPackageDeskTopLinks << std::endl);
-    
+
     cmSystemTools::
       ExpandListArgument(cpackPackageDeskTopLinks,
                          cpackPackageDesktopLinksVector);
-    for(std::vector<std::string>::iterator i = 
+    for(std::vector<std::string>::iterator i =
           cpackPackageDesktopLinksVector.begin(); i !=
           cpackPackageDesktopLinksVector.end(); ++i)
       {
@@ -499,7 +499,7 @@ int cmCPackNSISGenerator::InitializeInternal()
       if(cpackPackageDesktopLinksVector.size() &&
          std::find(cpackPackageDesktopLinksVector.begin(),
                    cpackPackageDesktopLinksVector.end(),
-                   execName) 
+                   execName)
          != cpackPackageDesktopLinksVector.end())
         {
         str << "  StrCmp \"$INSTALL_DESKTOP\" \"1\" 0 +2\n";
@@ -579,7 +579,7 @@ void cmCPackNSISGenerator::CreateMenuLinks( cmOStringStream& str,
     else
       {
       str << "  WriteINIStr \"$SMPROGRAMS\\$STARTMENU_FOLDER\\"
-          << linkName << ".url\" \"InternetShortcut\" \"URL\" \"" 
+          << linkName << ".url\" \"InternetShortcut\" \"URL\" \""
           << sourceName << "\""
           << std::endl;
       deleteStr << "  Delete \"$SMPROGRAMS\\$MUI_TEMP\\" << linkName
@@ -651,9 +651,9 @@ bool cmCPackNSISGenerator::SupportsComponentInstallation() const
 }
 
 //----------------------------------------------------------------------
-std::string 
+std::string
 cmCPackNSISGenerator::
-CreateComponentDescription(cmCPackComponent *component, 
+CreateComponentDescription(cmCPackComponent *component,
                            cmOStringStream& macrosOut)
 {
   // Basic description of the component
@@ -668,7 +668,7 @@ CreateComponentDescription(cmCPackComponent *component,
     componentCode += "-";
     }
   componentCode += component->DisplayName + "\" " + component->Name + "\n";
-  if (component->IsRequired) 
+  if (component->IsRequired)
     {
     componentCode += "  SectionIn RO\n";
     }
@@ -701,7 +701,7 @@ CreateComponentDescription(cmCPackComponent *component,
       }
 
     // Create the directory for the upload area
-    const char* userUploadDirectory = 
+    const char* userUploadDirectory =
       this->GetOption("CPACK_UPLOAD_DIRECTORY");
     std::string uploadDirectory;
     if (userUploadDirectory && *userUploadDirectory)
@@ -727,7 +727,7 @@ CreateComponentDescription(cmCPackComponent *component,
     // Remove the old archive, if one exists
     std::string archiveFile = uploadDirectory + '/' + component->ArchiveFile;
     cmCPackLogger(cmCPackLog::LOG_OUTPUT,
-                  "-   Building downloaded component archive: " 
+                  "-   Building downloaded component archive: "
                   << archiveFile << std::endl);
     if (cmSystemTools::FileExists(archiveFile.c_str(), true))
       {
@@ -760,18 +760,18 @@ CreateComponentDescription(cmCPackComponent *component,
     dirName += component->Name;
     dirName += '/';
 
-    // Build the list of files to go into this archive, and determine the 
+    // Build the list of files to go into this archive, and determine the
     // size of the installed component.
     std::string zipListFileName = this->GetOption("CPACK_TEMPORARY_DIRECTORY");
     zipListFileName += "/winZip.filelist";
-    bool needQuotesInFile 
+    bool needQuotesInFile
       = cmSystemTools::IsOn(this->GetOption("CPACK_ZIP_NEED_QUOTES"));
     unsigned long totalSize = 0;
     { // the scope is needed for cmGeneratedFileStream
       cmGeneratedFileStream out(zipListFileName.c_str());
       std::vector<std::string>::iterator fileIt;
-      for (fileIt = component->Files.begin(); 
-           fileIt != component->Files.end(); 
+      for (fileIt = component->Files.begin();
+           fileIt != component->Files.end();
            ++fileIt)
         {
         if ( needQuotesInFile )
@@ -792,11 +792,11 @@ CreateComponentDescription(cmCPackComponent *component,
     // Build the archive in the upload area
     std::string cmd = this->GetOption("CPACK_ZIP_COMMAND");
     cmsys::SystemTools::ReplaceString(cmd, "<ARCHIVE>", archiveFile.c_str());
-    cmsys::SystemTools::ReplaceString(cmd, "<FILELIST>", 
+    cmsys::SystemTools::ReplaceString(cmd, "<FILELIST>",
                                       zipListFileName.c_str());
     std::string output;
     int retVal = -1;
-    int res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output, &retVal, 
+    int res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output, &retVal,
                                               dirName.c_str(),
                                               cmSystemTools::OUTPUT_NONE, 0);
     if ( !res || retVal )
@@ -812,7 +812,7 @@ CreateComponentDescription(cmCPackComponent *component,
         << "Please check " << tmpFile.c_str() << " for errors" << std::endl);
       return "";
     }
-    
+
     // Create the NSIS code to download this file on-the-fly.
     unsigned long totalSizeInKbytes = (totalSize + 512) / 1024;
     if (totalSizeInKbytes == 0)
@@ -823,7 +823,7 @@ CreateComponentDescription(cmCPackComponent *component,
     out << "  AddSize " << totalSizeInKbytes << "\n"
         << "  Push \"" << component->ArchiveFile << "\"\n"
         << "  Call DownloadFile\n"
-        << "  ZipDLL::extractall \"$INSTDIR\\" 
+        << "  ZipDLL::extractall \"$INSTDIR\\"
         << component->ArchiveFile << "\" \"$INSTDIR\"\n"
         <<  "  Pop $2 ; error message\n"
                      "  StrCmp $2 \"success\" +2 0\n"
@@ -889,7 +889,7 @@ std::string cmCPackNSISGenerator::CreateSelectionDependenciesDescription
                std::set<cmCPackComponent *>& visited)
 {
   // Don't visit a component twice
-  if (visited.count(component)) 
+  if (visited.count(component))
     {
     return std::string();
     }
@@ -921,7 +921,7 @@ std::string cmCPackNSISGenerator::CreateDeselectionDependenciesDescription
                    std::set<cmCPackComponent *>& visited)
 {
   // Don't visit a component twice
-  if (visited.count(component)) 
+  if (visited.count(component))
     {
     return std::string();
     }
@@ -939,7 +939,7 @@ std::string cmCPackNSISGenerator::CreateDeselectionDependenciesDescription
     out << "  IntOp $0 $0 & $1\n";
     out << "  SectionSetFlags ${" << (*dependIt)->Name << "} $0\n";
     out << "  IntOp $" << (*dependIt)->Name << "_selected 0 + 0\n";
-    
+
     // Recurse
     out <<
       CreateDeselectionDependenciesDescription(*dependIt, visited).c_str();
@@ -949,9 +949,9 @@ std::string cmCPackNSISGenerator::CreateDeselectionDependenciesDescription
 }
 
 //----------------------------------------------------------------------
-std::string 
+std::string
 cmCPackNSISGenerator::
-CreateComponentGroupDescription(cmCPackComponentGroup *group, 
+CreateComponentGroupDescription(cmCPackComponentGroup *group,
                                 cmOStringStream& macrosOut)
 {
   if (group->Components.empty() && group->Subgroups.empty())
@@ -982,8 +982,8 @@ CreateComponentGroupDescription(cmCPackComponentGroup *group,
     }
 
   std::vector<cmCPackComponent*>::iterator comp;
-  for (comp = group->Components.begin(); 
-       comp != group->Components.end(); 
+  for (comp = group->Components.begin();
+       comp != group->Components.end();
        ++comp)
     {
     if ((*comp)->Files.empty())
diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx
index 363ccea0c..76e15fb84 100644
--- a/Source/CPack/cmCPackOSXX11Generator.cxx
+++ b/Source/CPack/cmCPackOSXX11Generator.cxx
@@ -64,7 +64,7 @@ int cmCPackOSXX11Generator::PackageFiles()
       {
       std::string cpackExecutableName = *it;
       ++ it;
-      this->SetOptionIfNotSet("CPACK_EXECUTABLE_NAME", 
+      this->SetOptionIfNotSet("CPACK_EXECUTABLE_NAME",
         cpackExecutableName.c_str());
       }
     }
@@ -113,7 +113,7 @@ int cmCPackOSXX11Generator::PackageFiles()
   cmSystemTools::CreateSymlink("/Applications", applicationsLinkName.c_str());
 
   if (
-    !this->CopyResourcePlistFile("VolumeIcon.icns", 
+    !this->CopyResourcePlistFile("VolumeIcon.icns",
                                  diskImageDirectory.c_str(),
                                  ".VolumeIcon.icns", true ) ||
     !this->CopyResourcePlistFile("DS_Store", diskImageDirectory.c_str(),
@@ -125,9 +125,9 @@ int cmCPackOSXX11Generator::PackageFiles()
       "Info.plist" ) ||
     !this->CopyResourcePlistFile("OSXX11.main.scpt", scrDir,
       "main.scpt", true ) ||
-    !this->CopyResourcePlistFile("OSXScriptLauncher.rsrc", dir, 
+    !this->CopyResourcePlistFile("OSXScriptLauncher.rsrc", dir,
       rsrcFile, true) ||
-    !this->CopyResourcePlistFile("OSXScriptLauncher", appdir, 
+    !this->CopyResourcePlistFile("OSXScriptLauncher", appdir,
       this->GetOption("CPACK_PACKAGE_FILE_NAME"), true)
   )
     {
@@ -167,11 +167,11 @@ int cmCPackOSXX11Generator::PackageFiles()
   tmpFile += "/hdiutilOutput.log";
   cmOStringStream dmgCmd;
   dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM_DISK_IMAGE")
-         << "\" create -ov -format UDZO -srcfolder \"" 
-         << diskImageDirectory.c_str() 
+         << "\" create -ov -format UDZO -srcfolder \""
+         << diskImageDirectory.c_str()
          << "\" \"" << packageFileNames[0] << "\"";
   cmCPackLogger(cmCPackLog::LOG_VERBOSE,
-                "Compress disk image using command: " 
+                "Compress disk image using command: "
                 << dmgCmd.str().c_str() << std::endl);
   // since we get random dashboard failures with this one
   // try running it more than once
@@ -181,7 +181,7 @@ int cmCPackOSXX11Generator::PackageFiles()
   while(numTries > 0)
     {
     res = cmSystemTools::RunSingleCommand(dmgCmd.str().c_str(), &output,
-                                          &retVal, 0, 
+                                          &retVal, 0,
                                           this->GeneratorVerbose, 0);
     if ( res && !retVal )
       {
@@ -219,7 +219,7 @@ int cmCPackOSXX11Generator::InitializeInternal()
       << std::endl);
     return 0;
     }
-  this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM_DISK_IMAGE", 
+  this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM_DISK_IMAGE",
                           pkgPath.c_str());
 
   return this->Superclass::InitializeInternal();
@@ -235,7 +235,7 @@ bool cmCPackOSXX11Generator::CopyCreateResourceFile(const char* name)
   if ( !inFileName )
     {
     cmCPackLogger(cmCPackLog::LOG_ERROR, "CPack option: " << cpackVar.c_str()
-                  << " not specified. It should point to " 
+                  << " not specified. It should point to "
                   << (name ? name : "(NULL)")
                   << ".rtf, " << name
                   << ".html, or " << name << ".txt file" << std::endl);
@@ -243,7 +243,7 @@ bool cmCPackOSXX11Generator::CopyCreateResourceFile(const char* name)
     }
   if ( !cmSystemTools::FileExists(inFileName) )
     {
-    cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find " 
+    cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find "
                   << (name ? name : "(NULL)")
                   << " resource file: " << inFileName << std::endl);
     return false;
@@ -262,7 +262,7 @@ bool cmCPackOSXX11Generator::CopyCreateResourceFile(const char* name)
   destFileName += name + ext;
 
 
-  cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " 
+  cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: "
                 << (inFileName ? inFileName : "(NULL)")
                 << " to " << destFileName.c_str() << std::endl);
   this->ConfigureFile(inFileName, destFileName.c_str());
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx
index 3a0e89bbd..edbe8380d 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.cxx
+++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx
@@ -52,7 +52,7 @@ int cmCPackPackageMakerGenerator::CopyInstallScript(const char* resdir,
   cmSystemTools::CopyFileAlways(script, dst.c_str());
   cmSystemTools::SetPermissions(dst.c_str(),0777);
   cmCPackLogger(cmCPackLog::LOG_VERBOSE,
-                "copy script : " << script << "\ninto " << dst.c_str() << 
+                "copy script : " << script << "\ninto " << dst.c_str() <<
                 std::endl);
 
   return 1;
@@ -79,7 +79,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
     if ( !cmsys::SystemTools::MakeDirectory(packageDirFileName.c_str()))
       {
       cmCPackLogger(cmCPackLog::LOG_ERROR,
-                    "unable to create package directory " 
+                    "unable to create package directory "
                     << packageDirFileName << std::endl);
         return 0;
       }
@@ -89,7 +89,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
     if ( !cmsys::SystemTools::MakeDirectory(resDir.c_str()))
       {
       cmCPackLogger(cmCPackLog::LOG_ERROR,
-                    "unable to create package subdirectory " << resDir 
+                    "unable to create package subdirectory " << resDir
                     << std::endl);
         return 0;
       }
@@ -98,7 +98,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
     if ( !cmsys::SystemTools::MakeDirectory(resDir.c_str()))
       {
       cmCPackLogger(cmCPackLog::LOG_ERROR,
-                    "unable to create package subdirectory " << resDir 
+                    "unable to create package subdirectory " << resDir
                     << std::endl);
         return 0;
       }
@@ -135,7 +135,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
       return 0;
       }
     }
-  // if preflight, postflight, or postupgrade are set 
+  // if preflight, postflight, or postupgrade are set
   // then copy them into the resource directory and make
   // them executable
   if(preflight)
@@ -206,7 +206,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
             if (!cmSystemTools::MakeDirectory(uploadDirectory.c_str()))
               {
               cmCPackLogger(cmCPackLog::LOG_ERROR,
-                            "Unable to create package upload directory " 
+                            "Unable to create package upload directory "
                             << uploadDirectory << std::endl);
               return 0;
               }
@@ -254,7 +254,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
       std::string packageDir = toplevel;
       packageDir += '/';
       packageDir += compIt->first;
-      if (!this->GenerateComponentPackage(packageFile.c_str(), 
+      if (!this->GenerateComponentPackage(packageFile.c_str(),
                                           packageDir.c_str(),
                                           compIt->second))
         {
@@ -293,7 +293,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
       }
     pkgCmd << "\" -r \"" << this->GetOption("CPACK_TOPLEVEL_DIRECTORY")
            << "/Resources\" -i \""
-           << this->GetOption("CPACK_TOPLEVEL_DIRECTORY") 
+           << this->GetOption("CPACK_TOPLEVEL_DIRECTORY")
            << "/Info.plist\" -d \""
            << this->GetOption("CPACK_TOPLEVEL_DIRECTORY")
            << "/Description.plist\"";
@@ -324,7 +324,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
   while(numTries > 0)
     {
     res = cmSystemTools::RunSingleCommand(dmgCmd.str().c_str(), &output,
-                                          &retVal, 0, this->GeneratorVerbose, 
+                                          &retVal, 0, this->GeneratorVerbose,
                                           0);
     if ( res && !retVal )
       {
@@ -474,7 +474,7 @@ int cmCPackPackageMakerGenerator::InitializeInternal()
   const char *packageCompat = this->GetOption("CPACK_OSX_PACKAGE_VERSION");
   if (packageCompat && *packageCompat)
     {
-    this->PackageCompatibilityVersion = atof(packageCompat);  
+    this->PackageCompatibilityVersion = atof(packageCompat);
     }
   else if (this->GetOption("CPACK_DOWNLOAD_SITE"))
     {
@@ -500,7 +500,7 @@ int cmCPackPackageMakerGenerator::InitializeInternal()
       << std::endl);
     return 0;
     }
-  this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM_DISK_IMAGE", 
+  this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM_DISK_IMAGE",
                           pkgPath.c_str());
 
   return this->Superclass::InitializeInternal();
@@ -516,7 +516,7 @@ bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(const char* name,
   if ( !inFileName )
     {
     cmCPackLogger(cmCPackLog::LOG_ERROR, "CPack option: " << cpackVar.c_str()
-                  << " not specified. It should point to " 
+                  << " not specified. It should point to "
                   << (name ? name : "(NULL)")
                   << ".rtf, " << name
                   << ".html, or " << name << ".txt file" << std::endl);
@@ -524,7 +524,7 @@ bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(const char* name,
     }
   if ( !cmSystemTools::FileExists(inFileName) )
     {
-    cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find " 
+    cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find "
                   << (name ? name : "(NULL)")
                   << " resource file: " << inFileName << std::endl);
     return false;
@@ -547,7 +547,7 @@ bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(const char* name,
   this->SetOption(("CPACK_RESOURCE_FILE_" + uname + "_NOPATH").c_str(),
                   (name + ext).c_str());
 
-  cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " 
+  cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: "
                 << (inFileName ? inFileName : "(NULL)")
                 << " to " << destFileName.c_str() << std::endl);
   this->ConfigureFile(inFileName, destFileName.c_str());
@@ -593,7 +593,7 @@ bool cmCPackPackageMakerGenerator::RunPackageMaker(const char *command,
   cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << command << std::endl);
   std::string output;
   int retVal = 1;
-  bool res = cmSystemTools::RunSingleCommand(command, &output, &retVal, 0, 
+  bool res = cmSystemTools::RunSingleCommand(command, &output, &retVal, 0,
                                              this->GeneratorVerbose, 0);
   cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Done running package maker"
     << std::endl);
@@ -612,7 +612,7 @@ bool cmCPackPackageMakerGenerator::RunPackageMaker(const char *command,
   // sometimes the command finishes but the directory is not yet
   // created, so try 10 times to see if it shows up
   int tries = 10;
-  while(tries > 0 && 
+  while(tries > 0 &&
         !cmSystemTools::FileExists(packageFile))
     {
     cmSystemTools::Delay(500);
@@ -632,7 +632,7 @@ bool cmCPackPackageMakerGenerator::RunPackageMaker(const char *command,
 }
 
 //----------------------------------------------------------------------
-std::string 
+std::string
 cmCPackPackageMakerGenerator::GetPackageName(const cmCPackComponent& component)
 {
   if (component.ArchiveFile.empty())
@@ -664,7 +664,7 @@ GenerateComponentPackage(const char *packageFile,
   // The command that will be used to run PackageMaker
   cmOStringStream pkgCmd;
 
-  if (this->PackageCompatibilityVersion < 10.5 || 
+  if (this->PackageCompatibilityVersion < 10.5 ||
       this->PackageMakerVersion < 3.0)
     {
     // Create Description.plist and Info.plist files for normal Mac OS
@@ -680,10 +680,10 @@ GenerateComponentPackage(const char *packageFile,
         << "  <key>IFPkgDescriptionTitle</key>" << std::endl
         << "  <string>" << component.DisplayName << "</string>" << std::endl
         << "  <key>IFPkgDescriptionVersion</key>" << std::endl
-        << "  <string>" << this->GetOption("CPACK_PACKAGE_VERSION") 
+        << "  <string>" << this->GetOption("CPACK_PACKAGE_VERSION")
         << "</string>" << std::endl
         << "  <key>IFPkgDescriptionDescription</key>" << std::endl
-        << "  <string>" + this->EscapeForXML(component.Description) 
+        << "  <string>" + this->EscapeForXML(component.Description)
         << "</string>" << std::endl
         << "</dict>" << std::endl
         << "</plist>" << std::endl;
@@ -692,7 +692,7 @@ GenerateComponentPackage(const char *packageFile,
     // Create the Info.plist file for this component
     std::string moduleVersionSuffix = ".";
     moduleVersionSuffix += component.Name;
-    this->SetOption("CPACK_MODULE_VERSION_SUFFIX", 
+    this->SetOption("CPACK_MODULE_VERSION_SUFFIX",
                     moduleVersionSuffix.c_str());
     std::string infoFileName = component.Name;
     infoFileName += "-Info.plist";
@@ -704,9 +704,9 @@ GenerateComponentPackage(const char *packageFile,
     pkgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM")
            << "\" -build -p \"" << packageFile << "\""
            << " -f \"" << packageDir << "\""
-           << " -i \"" << this->GetOption("CPACK_TOPLEVEL_DIRECTORY") 
+           << " -i \"" << this->GetOption("CPACK_TOPLEVEL_DIRECTORY")
            << "/" << infoFileName << "\""
-           << " -d \"" << descriptionFile << "\""; 
+           << " -d \"" << descriptionFile << "\"";
     }
   else
     {
@@ -729,16 +729,16 @@ GenerateComponentPackage(const char *packageFile,
            << " --out \"" << packageFile << "\"";
     }
 
-  // Run PackageMaker  
+  // Run PackageMaker
   return RunPackageMaker(pkgCmd.str().c_str(), packageFile);
 }
 
 //----------------------------------------------------------------------
-void 
+void
 cmCPackPackageMakerGenerator::
 WriteDistributionFile(const char* metapackageFile)
 {
-  std::string distributionTemplate 
+  std::string distributionTemplate
     = this->FindTemplate("CPack.distribution.dist.in");
   if ( distributionTemplate.empty() )
     {
@@ -757,8 +757,8 @@ WriteDistributionFile(const char* metapackageFile)
 
   // Emit the outline for the groups
   std::map<std::string, cmCPackComponentGroup>::iterator groupIt;
-  for (groupIt = this->ComponentGroups.begin(); 
-       groupIt != this->ComponentGroups.end(); 
+  for (groupIt = this->ComponentGroups.begin();
+       groupIt != this->ComponentGroups.end();
        ++groupIt)
     {
     if (groupIt->second.ParentGroup == 0)
@@ -781,8 +781,8 @@ WriteDistributionFile(const char* metapackageFile)
   choiceOut << "</choices-outline>" << std::endl;
 
   // Create the actual choices
-  for (groupIt = this->ComponentGroups.begin(); 
-       groupIt != this->ComponentGroups.end(); 
+  for (groupIt = this->ComponentGroups.begin();
+       groupIt != this->ComponentGroups.end();
        ++groupIt)
     {
     CreateChoice(groupIt->second, choiceOut);
@@ -796,7 +796,7 @@ WriteDistributionFile(const char* metapackageFile)
 
   // Create the distribution.dist file in the metapackage to turn it
   // into a distribution package.
-  this->ConfigureFile(distributionTemplate.c_str(), 
+  this->ConfigureFile(distributionTemplate.c_str(),
                       distributionFile.c_str());
 }
 
@@ -824,13 +824,13 @@ CreateChoiceOutline(const cmCPackComponentGroup& group, cmOStringStream& out)
 }
 
 //----------------------------------------------------------------------
-void 
+void
 cmCPackPackageMakerGenerator::CreateChoice(const cmCPackComponentGroup& group,
                                            cmOStringStream& out)
 {
-  out << "<choice id=\"" << group.Name << "Choice\" " 
+  out << "<choice id=\"" << group.Name << "Choice\" "
       << "title=\"" << group.DisplayName << "\" "
-      << "start_selected=\"true\" " 
+      << "start_selected=\"true\" "
       << "start_enabled=\"true\" "
       << "start_visible=\"true\" ";
   if (!group.Description.empty())
@@ -842,21 +842,21 @@ cmCPackPackageMakerGenerator::CreateChoice(const cmCPackComponentGroup& group,
 }
 
 //----------------------------------------------------------------------
-void 
+void
 cmCPackPackageMakerGenerator::CreateChoice(const cmCPackComponent& component,
                                            cmOStringStream& out)
 {
   std::string packageId = "com.";
   packageId += this->GetOption("CPACK_PACKAGE_VENDOR");
-  packageId += '.'; 
+  packageId += '.';
   packageId += this->GetOption("CPACK_PACKAGE_NAME");
   packageId += '.';
   packageId += component.Name;
 
-  out << "<choice id=\"" << component.Name << "Choice\" " 
+  out << "<choice id=\"" << component.Name << "Choice\" "
       << "title=\"" << component.DisplayName << "\" "
-      << "start_selected=\"" 
-      << (component.IsDisabledByDefault && 
+      << "start_selected=\""
+      << (component.IsDisabledByDefault &&
           !component.IsRequired? "false" : "true")
       << "\" "
       << "start_enabled=\""
@@ -905,7 +905,7 @@ cmCPackPackageMakerGenerator::CreateChoice(const cmCPackComponent& component,
   std::string dirName = this->GetOption("CPACK_TEMPORARY_DIRECTORY");
   dirName += '/';
   dirName += component.Name;
-  unsigned long installedSize 
+  unsigned long installedSize
     = component.GetInstalledSizeInKbytes(dirName.c_str());
 
   out << "<pkg-ref id=\"" << packageId << "\" "
@@ -914,7 +914,7 @@ cmCPackPackageMakerGenerator::CreateChoice(const cmCPackComponent& component,
       << "auth=\"Admin\" onConclusion=\"None\">";
   if (component.IsDownloaded)
     {
-    out << this->GetOption("CPACK_DOWNLOAD_SITE") 
+    out << this->GetOption("CPACK_DOWNLOAD_SITE")
         << this->GetPackageName(component);
     }
   else
@@ -925,9 +925,9 @@ cmCPackPackageMakerGenerator::CreateChoice(const cmCPackComponent& component,
 }
 
 //----------------------------------------------------------------------
-void 
+void
 cmCPackPackageMakerGenerator::
-AddDependencyAttributes(const cmCPackComponent& component, 
+AddDependencyAttributes(const cmCPackComponent& component,
                         std::set<const cmCPackComponent *>& visited,
                         cmOStringStream& out)
 {
@@ -942,16 +942,16 @@ AddDependencyAttributes(const cmCPackComponent& component,
        dependIt != component.Dependencies.end();
        ++dependIt)
     {
-    out << " &amp;&amp; choices['" << 
+    out << " &amp;&amp; choices['" <<
       (*dependIt)->Name << "Choice'].selected";
     AddDependencyAttributes(**dependIt, visited, out);
     }
 }
 
 //----------------------------------------------------------------------
-void 
+void
 cmCPackPackageMakerGenerator::
-AddReverseDependencyAttributes(const cmCPackComponent& component, 
+AddReverseDependencyAttributes(const cmCPackComponent& component,
                                std::set<const cmCPackComponent *>& visited,
                                cmOStringStream& out)
 {
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.h b/Source/CPack/cmCPackPackageMakerGenerator.h
index 2bab94791..101813fa4 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.h
+++ b/Source/CPack/cmCPackPackageMakerGenerator.h
@@ -67,8 +67,8 @@ protected:
   // Generate a package in the file packageFile for the given
   // component.  All of the files within this component are stored in
   // the directory packageDir. Returns true if successful, false
-  // otherwise. 
-  bool GenerateComponentPackage(const char *packageFile, 
+  // otherwise.
+  bool GenerateComponentPackage(const char *packageFile,
                                 const char *packageDir,
                                 const cmCPackComponent& component);
 
@@ -87,14 +87,14 @@ protected:
 
   // Subroutine of WriteDistributionFile that writes out the
   // reverse dependency attributes for inter-component dependencies.
-  void 
+  void
   AddReverseDependencyAttributes(const cmCPackComponent& component,
                                  std::set<const cmCPackComponent *>& visited,
                                  cmOStringStream& out);
 
   // Generates XML that encodes the hierarchy of component groups and
   // their components in a form that can be used by distribution
-  // metapackages. 
+  // metapackages.
   void CreateChoiceOutline(const cmCPackComponentGroup& group,
                            cmOStringStream& out);
 
@@ -111,7 +111,7 @@ protected:
   // Escape the given string to make it usable as an XML attribute
   // value.
   std::string EscapeForXML(std::string str);
-  
+
   double PackageMakerVersion;
   double PackageCompatibilityVersion;
 };
diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx
index 413572ee7..13aa6d8f9 100644
--- a/Source/CPack/cmCPackRPMGenerator.cxx
+++ b/Source/CPack/cmCPackRPMGenerator.cxx
@@ -230,7 +230,7 @@ int cmCPackRPMGenerator::PackageFiles()
       }
     }
 
-  if (!this->IsSet("RPMBUILD_EXECUTABLE")) 
+  if (!this->IsSet("RPMBUILD_EXECUTABLE"))
     {
     cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find rpmbuild" << std::endl);
     retval = 0;
diff --git a/Source/CPack/cmCPackSTGZGenerator.cxx b/Source/CPack/cmCPackSTGZGenerator.cxx
index 966a231b7..9b6cf14df 100644
--- a/Source/CPack/cmCPackSTGZGenerator.cxx
+++ b/Source/CPack/cmCPackSTGZGenerator.cxx
@@ -97,7 +97,7 @@ int cmCPackSTGZGenerator::GenerateHeader(std::ostream* os)
     {
     licenseText += line + "\n";
     }
-  this->SetOptionIfNotSet("CPACK_RESOURCE_FILE_LICENSE_CONTENT", 
+  this->SetOptionIfNotSet("CPACK_RESOURCE_FILE_LICENSE_CONTENT",
                           licenseText.c_str());
 
   const char headerLengthTag[] = "###CPACK_HEADER_LENGTH###";
@@ -126,7 +126,7 @@ int cmCPackSTGZGenerator::GenerateHeader(std::ostream* os)
     ++ptr;
     }
   counter ++;
-  cmCPackLogger(cmCPackLog::LOG_DEBUG, 
+  cmCPackLogger(cmCPackLog::LOG_DEBUG,
                 "Number of lines: " << counter << std::endl);
   char buffer[1024];
   sprintf(buffer, "%d", counter);
diff --git a/Source/CPack/cmCPackTarBZip2Generator.cxx b/Source/CPack/cmCPackTarBZip2Generator.cxx
index 971d16667..ae73c3795 100644
--- a/Source/CPack/cmCPackTarBZip2Generator.cxx
+++ b/Source/CPack/cmCPackTarBZip2Generator.cxx
@@ -12,7 +12,7 @@
 
 #include "cmCPackTarBZip2Generator.h"
 //----------------------------------------------------------------------
-cmCPackTarBZip2Generator::cmCPackTarBZip2Generator() 
+cmCPackTarBZip2Generator::cmCPackTarBZip2Generator()
  :cmCPackArchiveGenerator(cmArchiveWrite::CompressBZip2,
                           cmArchiveWrite::TypeTAR)
 {
diff --git a/Source/CPack/cmCPackTarCompressGenerator.cxx b/Source/CPack/cmCPackTarCompressGenerator.cxx
index 7a8f697c0..df294084c 100644
--- a/Source/CPack/cmCPackTarCompressGenerator.cxx
+++ b/Source/CPack/cmCPackTarCompressGenerator.cxx
@@ -13,7 +13,7 @@
 #include "cmCPackTarCompressGenerator.h"
 
 //----------------------------------------------------------------------
-cmCPackTarCompressGenerator::cmCPackTarCompressGenerator() 
+cmCPackTarCompressGenerator::cmCPackTarCompressGenerator()
   :cmCPackArchiveGenerator(cmArchiveWrite::CompressCompress,
                            cmArchiveWrite::TypeTAR)
 {
diff --git a/Source/CPack/cygwin.readme b/Source/CPack/cygwin.readme
index 88922d3e6..c0cd4b913 100644
--- a/Source/CPack/cygwin.readme
+++ b/Source/CPack/cygwin.readme
@@ -16,11 +16,11 @@ Source-
 - write diff into toplevel
 - create tar file call super class
 
-cmake-2.2.3-1 
+cmake-2.2.3-1
+
 
-   
 1. a source release
-cmake-2.2.3-2-src.tar.bz2  
+cmake-2.2.3-2-src.tar.bz2
 
 cmake-2.2.3-2.patch  has cmake-2.2.3/CYGWIN-PATCHES/cmake.README cmake-2.2.3/CYGWIN-PATCHES/setup.hint
 cmake-2.2.3-2.sh  -> script to create cygwin release
diff --git a/Source/CTest/cmCTestBatchTestHandler.cxx b/Source/CTest/cmCTestBatchTestHandler.cxx
index 00bb6fa70..a22c7be41 100644
--- a/Source/CTest/cmCTestBatchTestHandler.cxx
+++ b/Source/CTest/cmCTestBatchTestHandler.cxx
@@ -56,7 +56,7 @@ void cmCTestBatchTestHandler::WriteSrunArgs(int test, std::fstream& fout)
   fout << "srun ";
   //fout << "--jobid=" << test << " ";
   fout << "-J=" << properties->Name << " ";
- 
+
   //Write dependency information
   /*if(this->Tests[test].size() > 0)
     {
diff --git a/Source/CTest/cmCTestBatchTestHandler.h b/Source/CTest/cmCTestBatchTestHandler.h
index fdfd1be29..ab0d081ae 100644
--- a/Source/CTest/cmCTestBatchTestHandler.h
+++ b/Source/CTest/cmCTestBatchTestHandler.h
@@ -21,7 +21,7 @@
 /** \class cmCTestBatchTestHandler
  * \brief run parallel ctest
  *
- * cmCTestBatchTestHandler 
+ * cmCTestBatchTestHandler
  */
 class cmCTestBatchTestHandler : public cmCTestMultiProcessHandler
 {
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx
index 8a2d65a7b..554efb5bb 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.cxx
+++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx
@@ -67,7 +67,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
     generator += this->BuildGenerator;
     args.push_back(generator);
     }
-  
+
   const char* config = 0;
   if ( this->CTest->GetConfigType().size() > 0 )
     {
@@ -79,7 +79,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
     config = CMAKE_INTDIR;
     }
 #endif
-  
+
   if ( config )
     {
     std::string btype
@@ -198,8 +198,8 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
     std::string resultingConfig;
     std::vector<std::string> extraPaths;
     std::vector<std::string> failed;
-    fullPath = 
-      cmCTestTestHandler::FindExecutable(this->CTest, 
+    fullPath =
+      cmCTestTestHandler::FindExecutable(this->CTest,
                                          this->ConfigSample.c_str(),
                                          resultingConfig,
                                          extraPaths,
@@ -211,7 +211,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
     out << "Using config sample with results: "
         << fullPath << " and " << resultingConfig << std::endl;
     }
-  
+
   // we need to honor the timeout specified, the timeout include cmake, build
   // and test time
   double clock_start = cmSystemTools::GetTime();
@@ -228,7 +228,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
 
   // should we cmake?
   cmake cm;
-  cm.SetProgressCallback(CMakeProgressCallback, &cmakeOutString); 
+  cm.SetProgressCallback(CMakeProgressCallback, &cmakeOutString);
   cm.SetGlobalGenerator(cm.CreateGlobalGenerator(
       this->BuildGenerator.c_str()));
 
@@ -247,7 +247,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
     {
     this->BuildTargets.push_back("");
     }
-  for ( tarIt = this->BuildTargets.begin(); 
+  for ( tarIt = this->BuildTargets.begin();
         tarIt != this->BuildTargets.end(); ++ tarIt )
     {
     double remainingTime = 0;
@@ -284,7 +284,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
       this->BuildProject.c_str(), tarIt->c_str(),
       &output, this->BuildMakeProgram.c_str(),
       config,
-      !this->BuildNoClean, 
+      !this->BuildNoClean,
       false, remainingTime);
     out << output;
     // if the build failed then return
@@ -322,13 +322,13 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
     extraPaths.push_back(tempPath);
     }
   std::vector<std::string> failed;
-  fullPath = 
-    cmCTestTestHandler::FindExecutable(this->CTest, 
+  fullPath =
+    cmCTestTestHandler::FindExecutable(this->CTest,
                                        this->TestCommand.c_str(),
                                        resultingConfig,
                                        extraPaths,
                                        failed);
-  
+
   if(!cmSystemTools::FileExists(fullPath.c_str()))
     {
     out << "Could not find path to executable, perhaps it was not built: "
@@ -388,8 +388,8 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
       return 1;
       }
     }
-  
-  int runTestRes = this->CTest->RunTest(testCommand, &outs, &retval, 0, 
+
+  int runTestRes = this->CTest->RunTest(testCommand, &outs, &retval, 0,
                                         remainingTime, 0);
 
   if(runTestRes != cmsysProcess_State_Exited || retval != 0)
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.h b/Source/CTest/cmCTestBuildAndTestHandler.h
index 6e5f7a6ab..90296001a 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.h
+++ b/Source/CTest/cmCTestBuildAndTestHandler.h
@@ -42,7 +42,7 @@ public:
    * Get the output variable
    */
   const char* GetOutput();
-  
+
   cmCTestBuildAndTestHandler();
 
   virtual void Initialize();
@@ -50,10 +50,10 @@ public:
 protected:
   ///! Run CMake and build a test and then run it as a single test.
   int RunCMakeAndTest(std::string* output);
-  int RunCMake(std::string* outstring, cmOStringStream &out, 
+  int RunCMake(std::string* outstring, cmOStringStream &out,
                std::string &cmakeOutString,
                std::string &cwd, cmake *cm);
-  
+
   cmStdString  Output;
 
   std::string              BuildGenerator;
diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx
index b984e850f..f4d38cef1 100644
--- a/Source/CTest/cmCTestBuildCommand.cxx
+++ b/Source/CTest/cmCTestBuildCommand.cxx
@@ -175,7 +175,7 @@ bool cmCTestBuildCommand::InitialPass(std::vector<std::string> const& args,
 {
   bool ret =  cmCTestHandlerCommand::InitialPass(args, status);
   if ( this->Values[ctb_NUMBER_ERRORS] && *this->Values[ctb_NUMBER_ERRORS])
-    {  
+    {
     cmOStringStream str;
     str << this->Handler->GetTotalErrors();
     this->Makefile->AddDefinition(
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index 27bb06c13..39eeb70a3 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -168,7 +168,7 @@ static cmCTestBuildCompileErrorWarningRex
 cmCTestWarningErrorFileLine[] = {
     { "^Warning W[0-9]+ ([a-zA-Z.\\:/0-9_+ ~-]+) ([0-9]+):", 1, 2 },
     { "^([a-zA-Z./0-9_+ ~-]+):([0-9]+):", 1, 2 },
-    { "^([a-zA-Z.\\:/0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2 }, 
+    { "^([a-zA-Z.\\:/0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2 },
     { "^[0-9]+>([a-zA-Z.\\:/0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2 },
     { "^([a-zA-Z./0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2 },
     { "\"([a-zA-Z./0-9_+ ~-]+)\", line ([0-9]+)", 1, 2 },
@@ -289,7 +289,7 @@ std::string cmCTestBuildHandler::GetMakeCommand()
   std::string makeCommand
     = this->CTest->GetCTestConfiguration("MakeCommand");
   cmCTestLog(this->CTest,
-             HANDLER_VERBOSE_OUTPUT, "MakeCommand:" << makeCommand << 
+             HANDLER_VERBOSE_OUTPUT, "MakeCommand:" << makeCommand <<
              "\n");
 
   std::string configType = this->CTest->GetConfigType();
@@ -392,7 +392,7 @@ int cmCTestBuildHandler::ProcessHandler()
     {
     this->CustomWarningMatches.push_back(cmCTestWarningMatches[cc]);
     }
-  
+
   for ( cc = 0; cmCTestWarningExceptions[cc]; cc ++ )
     {
     this->CustomWarningExceptions.push_back(cmCTestWarningExceptions[cc]);
@@ -557,7 +557,7 @@ void cmCTestBuildHandler::GenerateXMLHeader(std::ostream& os)
   this->CTest->StartXML(os, this->AppendXML);
   os << "<Build>\n"
      << "\t<StartDateTime>" << this->StartBuild << "</StartDateTime>\n"
-     << "\t<StartBuildTime>" << 
+     << "\t<StartBuildTime>" <<
     static_cast<unsigned int>(this->StartBuildTime)
      << "</StartBuildTime>\n"
      << "<BuildCommand>"
@@ -998,7 +998,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command,
         // dashboard.
         cmCTestBuildErrorWarning errorwarning;
         errorwarning.LogLine     = 1;
-        errorwarning.Text 
+        errorwarning.Text
           = "*** WARNING non-zero return value in ctest from: ";
         errorwarning.Text        += argv[0];
         errorwarning.PreContext  = "";
@@ -1150,7 +1150,7 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, int length,
         {
         // This is not an error or warning.
         // So, figure out if this is a post-context line
-        if ( this->ErrorsAndWarnings.size() && 
+        if ( this->ErrorsAndWarnings.size() &&
              this->LastErrorOrWarning != this->ErrorsAndWarnings.end() &&
              this->PostContextCount < this->MaxPostContext )
           {
diff --git a/Source/CTest/cmCTestConfigureHandler.cxx b/Source/CTest/cmCTestConfigureHandler.cxx
index 33297564e..7c4129864 100644
--- a/Source/CTest/cmCTestConfigureHandler.cxx
+++ b/Source/CTest/cmCTestConfigureHandler.cxx
@@ -106,7 +106,7 @@ int cmCTestConfigureHandler::ProcessHandler()
       std::string end_time = this->CTest->CurrentTime();
       os << "\t<ConfigureStatus>" << retVal << "</ConfigureStatus>\n"
          << "\t<EndDateTime>" << end_time << "</EndDateTime>\n"
-         << "\t<EndConfigureTime>" << 
+         << "\t<EndConfigureTime>" <<
         static_cast<unsigned int>(cmSystemTools::GetTime())
          << "</EndConfigureTime>\n"
          << "<ElapsedMinutes>"
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 81d366937..4d1e249e6 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -80,15 +80,15 @@ public:
         {
         args.push_back(i->c_str());
         }
-      args.push_back(0); // null terminate 
+      args.push_back(0); // null terminate
       cmsysProcess_SetCommand(this->Process, &*args.begin());
       if(this->WorkingDirectory.size())
         {
         cmsysProcess_SetWorkingDirectory(this->Process,
                                          this->WorkingDirectory.c_str());
         }
-      
-      cmsysProcess_SetOption(this->Process, 
+
+      cmsysProcess_SetOption(this->Process,
                              cmsysProcess_Option_HideWindow, 1);
       if(this->TimeOut != -1)
         {
@@ -112,7 +112,7 @@ public:
     {
     cmsysProcess_SetPipeFile(this->Process, cmsysProcess_Pipe_STDERR, fname);
     }
-  int WaitForExit(double* timeout =0) 
+  int WaitForExit(double* timeout =0)
     {
       this->PipeState = cmsysProcess_WaitForExit(this->Process,
                                                  timeout);
@@ -183,7 +183,7 @@ bool cmCTestCoverageHandler::StartCoverageLogFile(
   this->CTest->StartXML(covLogFile, this->AppendXML);
   covLogFile << "<CoverageLog>" << std::endl
              << "\t<StartDateTime>" << local_start_time << "</StartDateTime>"
-             << "\t<StartTime>" 
+             << "\t<StartTime>"
              << static_cast<unsigned int>(cmSystemTools::GetTime())
              << "</StartTime>"
     << std::endl;
@@ -196,7 +196,7 @@ void cmCTestCoverageHandler::EndCoverageLogFile(cmGeneratedFileStream& ostr,
 {
   std::string local_end_time = this->CTest->CurrentTime();
   ostr << "\t<EndDateTime>" << local_end_time << "</EndDateTime>" << std::endl
-       << "\t<EndTime>" << 
+       << "\t<EndTime>" <<
        static_cast<unsigned int>(cmSystemTools::GetTime())
        << "</EndTime>" << std::endl
     << "</CoverageLog>" << std::endl;
@@ -325,7 +325,7 @@ int cmCTestCoverageHandler::ProcessHandler()
     {
     return error;
     }
-  
+
   std::string coverage_start_time = this->CTest->CurrentTime();
   unsigned int coverage_start_time_time = static_cast<unsigned int>(
     cmSystemTools::GetTime());
@@ -659,7 +659,7 @@ int cmCTestCoverageHandler::ProcessHandler()
   covSumFile.precision(2);
   covSumFile << (percent_coverage)<< "</PercentCoverage>\n"
     << "\t<EndDateTime>" << end_time << "</EndDateTime>\n"
-    << "\t<EndTime>" << 
+    << "\t<EndTime>" <<
          static_cast<unsigned int>(cmSystemTools::GetTime())
     << "</EndTime>\n";
   covSumFile << "<ElapsedMinutes>" <<
@@ -871,7 +871,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
     cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
       " Cannot find any GCov coverage files."
       << std::endl);
-    // No coverage files is a valid thing, so the exit code is 0 
+    // No coverage files is a valid thing, so the exit code is 0
     return 0;
     }
 
@@ -1294,7 +1294,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage(
     cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
       " Cannot find any Python Trace.py coverage files."
       << std::endl);
-    // No coverage files is a valid thing, so the exit code is 0 
+    // No coverage files is a valid thing, so the exit code is 0
     return 0;
     }
 
@@ -1436,7 +1436,7 @@ std::string cmCTestCoverageHandler::FindFile(
 // This is a header put on each marked up source file
 namespace
 {
-  const char* bullseyeHelp[] = 
+  const char* bullseyeHelp[] =
   {"    Coverage produced by bullseye covbr tool: ",
    "      www.bullseye.com/help/ref_covbr.html",
    "    * An arrow --> indicates incomplete coverage.",
@@ -1451,7 +1451,7 @@ namespace
    "    * The slash / means this probe is excluded from summary results. ",
    0};
 }
-  
+
 //----------------------------------------------------------------------
 int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
   cmCTestCoverageHandlerContainer* cont,
@@ -1461,7 +1461,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
 {
   if(files.size() != filesFullPath.size())
     {
-    cmCTestLog(this->CTest, ERROR_MESSAGE, 
+    cmCTestLog(this->CTest, ERROR_MESSAGE,
                "Files and full path files not the same size?:\n");
     return 0;
     }
@@ -1498,13 +1498,13 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
     }
   std::map<cmStdString, cmStdString> fileMap;
   std::vector<std::string>::iterator fp = filesFullPath.begin();
-  for(std::vector<std::string>::iterator f =  files.begin(); 
+  for(std::vector<std::string>::iterator f =  files.begin();
       f != files.end(); ++f, ++fp)
     {
     fileMap[*f] = *fp;
     }
 
-  int count =0; // keep count of the number of files 
+  int count =0; // keep count of the number of files
   // Now parse each line from the bullseye cov log file
   std::string lineIn;
   bool valid = false; // are we in a valid output file
@@ -1542,9 +1542,9 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
           {
           return -1;
           }
-        count++; // move on one 
+        count++; // move on one
         }
-      std::map<cmStdString, cmStdString>::iterator 
+      std::map<cmStdString, cmStdString>::iterator
         i = fileMap.find(file);
       // if the file should be covered write out the header for that file
       if(i != fileMap.end())
@@ -1659,10 +1659,10 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
     cmCTestLog(this->CTest, ERROR_MESSAGE, "error running covsrc:\n");
     return 0;
     }
-  
+
   std::ostream& tmpLog = *cont->OFS;
   // copen the Coverage.xml file in the Testing directory
-  cmGeneratedFileStream covSumFile; 
+  cmGeneratedFileStream covSumFile;
   if(!this->StartResultingXML(cmCTest::PartCoverage, "Coverage", covSumFile))
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
@@ -1673,10 +1673,10 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
   double elapsed_time_start = cmSystemTools::GetTime();
   std::string coverage_start_time = this->CTest->CurrentTime();
   covSumFile << "<Coverage>" << std::endl
-             << "\t<StartDateTime>" 
+             << "\t<StartDateTime>"
              << coverage_start_time << "</StartDateTime>"
              << std::endl
-             << "\t<StartTime>" 
+             << "\t<StartTime>"
              << static_cast<unsigned int>(cmSystemTools::GetTime())
              << "</StartTime>"
              << std::endl;
@@ -1717,7 +1717,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
       {
       // parse the comma separated output
       this->ParseBullsEyeCovsrcLine(stdline,
-                                    sourceFile, 
+                                    sourceFile,
                                     functionsCalled,
                                     totalFunctions,
                                     percentFunction,
@@ -1741,7 +1741,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
       file = cmSystemTools::CollapseFullPath(file.c_str());
       bool shouldIDoCoverage
         = this->ShouldIDoCoverage(file.c_str(),
-                                  cont->SourceDir.c_str(), 
+                                  cont->SourceDir.c_str(),
                                   cont->BinaryDir.c_str());
       if ( !shouldIDoCoverage )
         {
@@ -1797,20 +1797,20 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
                  << "\t\t<BranchesTested>"
                  << branchCovered
                  << "</BranchesTested>\n"
-                 << "\t\t<BranchesUnTested>" 
+                 << "\t\t<BranchesUnTested>"
                  << totalBranches - branchCovered
                  << "</BranchesUnTested>\n"
                  << "\t\t<FunctionsTested>"
                  << functionsCalled
                  << "</FunctionsTested>\n"
-                 << "\t\t<FunctionsUnTested>" 
+                 << "\t\t<FunctionsUnTested>"
                  << totalFunctions - functionsCalled
                  << "</FunctionsUnTested>\n"
         // Hack for conversion of function to loc assume a function
         // has 100 lines of code
                  << "\t\t<LOCTested>" << functionsCalled *100
                  << "</LOCTested>\n"
-                 << "\t\t<LOCUnTested>" 
+                 << "\t\t<LOCUnTested>"
                  << (totalFunctions - functionsCalled)*100
                  << "</LOCUnTested>\n"
                  << "\t\t<PercentCoverage>";
@@ -1832,12 +1832,12 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
     << "\t<PercentCoverage>";
   covSumFile.setf(std::ios::fixed, std::ios::floatfield);
   covSumFile.precision(2);
-  covSumFile 
+  covSumFile
     << SAFEDIV(percent_coverage,number_files)<< "</PercentCoverage>\n"
     << "\t<EndDateTime>" << end_time << "</EndDateTime>\n"
     << "\t<EndTime>" << static_cast<unsigned int>(cmSystemTools::GetTime())
     << "</EndTime>\n";
-  covSumFile 
+  covSumFile
     << "<ElapsedMinutes>" <<
     static_cast<int>((cmSystemTools::GetTime() - elapsed_time_start)/6)/10.0
     << "</ElapsedMinutes>"
@@ -1858,22 +1858,22 @@ int cmCTestCoverageHandler::HandleBullseyeCoverage(
   const char* covfile = cmSystemTools::GetEnv("COVFILE");
   if(!covfile || strlen(covfile) == 0)
     {
-    cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, 
-               " COVFILE environment variable not found, not running " 
+    cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+               " COVFILE environment variable not found, not running "
                " bullseye\n");
     return 0;
     }
-  cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, 
-             " run covsrc with COVFILE=[" 
+  cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+             " run covsrc with COVFILE=["
              << covfile
              << "]" << std::endl);
   if(!this->RunBullseyeSourceSummary(cont))
-    { 
-    cmCTestLog(this->CTest, ERROR_MESSAGE, 
+    {
+    cmCTestLog(this->CTest, ERROR_MESSAGE,
                "Error running bullseye summary.\n");
     return 0;
     }
-  cmCTestLog(this->CTest, DEBUG, "HandleBullseyeCoverage return 1 "  
+  cmCTestLog(this->CTest, DEBUG, "HandleBullseyeCoverage return 1 "
              << std::endl);
   return 1;
 }
@@ -1881,7 +1881,7 @@ int cmCTestCoverageHandler::HandleBullseyeCoverage(
 bool cmCTestCoverageHandler::GetNextInt(std::string const& inputLine,
                                         std::string::size_type& pos,
                                         int& value)
-{ 
+{
   std::string::size_type start = pos;
   pos = inputLine.find(',', start);
   value = atoi(inputLine.substr(start, pos).c_str());
@@ -1892,7 +1892,7 @@ bool cmCTestCoverageHandler::GetNextInt(std::string const& inputLine,
   pos++;
   return true;
 }
-                                                 
+
 bool cmCTestCoverageHandler::ParseBullsEyeCovsrcLine(
   std::string const& inputLine,
   std::string& sourceFile,
@@ -1906,7 +1906,7 @@ bool cmCTestCoverageHandler::ParseBullsEyeCovsrcLine(
   // find the first comma
   std::string::size_type pos = inputLine.find(',');
   if(pos == inputLine.npos)
-    { 
+    {
     cmCTestLog(this->CTest, ERROR_MESSAGE, "Error parsing string : "
                << inputLine.c_str() << "\n");
     return false;
@@ -1942,7 +1942,7 @@ bool cmCTestCoverageHandler::ParseBullsEyeCovsrcLine(
   if(pos != inputLine.npos)
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE, "Error parsing input : "
-               << inputLine.c_str() << " last pos not npos =  " << pos << 
+               << inputLine.c_str() << " last pos not npos =  " << pos <<
                "\n");
     }
   return true;
diff --git a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
index 56312c0fb..abc33de68 100644
--- a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
+++ b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
@@ -28,8 +28,8 @@ bool cmCTestEmptyBinaryDirectoryCommand
     ostr << "problem removing the binary directory: " << args[0].c_str();
     this->SetError(ostr.str().c_str());
     return false;
-    }  
-  
+    }
+
   return true;
 }
 
diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx
index fd75e45e8..5338f307b 100644
--- a/Source/CTest/cmCTestGenericHandler.cxx
+++ b/Source/CTest/cmCTestGenericHandler.cxx
@@ -51,7 +51,7 @@ void cmCTestGenericHandler::SetOption(const char* op, const char* value)
 }
 
 //----------------------------------------------------------------------
-void cmCTestGenericHandler::SetPersistentOption(const char* op, 
+void cmCTestGenericHandler::SetPersistentOption(const char* op,
                                                 const char* value)
 {
   this->SetOption(op, value);
@@ -79,7 +79,7 @@ void cmCTestGenericHandler::Initialize()
   this->AppendXML = false;
   this->Options.clear();
   t_StringToString::iterator it;
-  for ( it = this->PersistentOptions.begin(); 
+  for ( it = this->PersistentOptions.begin();
     it != this->PersistentOptions.end();
     ++ it )
     {
@@ -117,7 +117,7 @@ bool cmCTestGenericHandler::StartResultingXML(cmCTest::Part part,
     {
     ostr << "_" << this->SubmitIndex;
     }
-  ostr << ".xml"; 
+  ostr << ".xml";
   if(this->CTest->GetCurrentTag().empty())
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
diff --git a/Source/CTest/cmCTestGenericHandler.h b/Source/CTest/cmCTestGenericHandler.h
index 18189ec2b..ba8febb61 100644
--- a/Source/CTest/cmCTestGenericHandler.h
+++ b/Source/CTest/cmCTestGenericHandler.h
@@ -73,7 +73,7 @@ public:
 
   typedef std::map<cmStdString,cmStdString> t_StringToString;
 
-  
+
   void SetPersistentOption(const char* op, const char* value);
   void SetOption(const char* op, const char* value);
   const char* GetOption(const char* op);
diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx
index 1957e04e3..0da8aae52 100644
--- a/Source/CTest/cmCTestHandlerCommand.cxx
+++ b/Source/CTest/cmCTestHandlerCommand.cxx
@@ -91,7 +91,7 @@ bool cmCTestHandlerCommand
     }
   else
     {
-    const char* bdir = 
+    const char* bdir =
       this->Makefile->GetSafeDefinition("CTEST_BINARY_DIRECTORY");
     if(bdir)
       {
diff --git a/Source/CTest/cmCTestMemCheckCommand.h b/Source/CTest/cmCTestMemCheckCommand.h
index 399fe8b22..6db47aec8 100644
--- a/Source/CTest/cmCTestMemCheckCommand.h
+++ b/Source/CTest/cmCTestMemCheckCommand.h
@@ -60,7 +60,7 @@ public:
       "  ctest_memcheck([BUILD build_dir] [RETURN_VALUE res] [APPEND]\n"
       "             [START start number] [END end number]\n"
       "             [STRIDE stride number] [EXCLUDE exclude regex ]\n"
-      "             [INCLUDE include regex] \n" 
+      "             [INCLUDE include regex] \n"
       "             [EXCLUDE_LABEL exclude regex] \n"
       "             [INCLUDE_LABEL label regex] \n"
       "             [PARALLEL_LEVEL level] )\n"
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index 3e4ecddaa..a2a16d3bd 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -84,7 +84,7 @@ public:
     }
 
   const char* GetAttribute(const char* name, const char** atts)
-    { 
+    {
       int i = 0;
       for(; atts[i] != 0; ++i)
         {
@@ -117,9 +117,9 @@ public:
         }
       if(ptr->ErrorCategory)
         {
-        this->Errors.push_back(cmCTestMemCheckHandler::ABW); // do not know 
+        this->Errors.push_back(cmCTestMemCheckHandler::ABW); // do not know
         cmCTestLog(this->CTest, ERROR_MESSAGE,
-                   "Found unknown Bounds Checker error " 
+                   "Found unknown Bounds Checker error "
                    << ptr->ErrorCategory << std::endl);
         }
     }
@@ -528,7 +528,7 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
     this->MemoryTesterOptions.push_back(outputFile);
     }
   else if ( this->MemoryTester.find("BC") != std::string::npos )
-    { 
+    {
     this->BoundsCheckerXMLFile = this->MemoryTesterOutputFile;
     std::string dpbdFile = this->CTest->GetBinaryDir()
       + "/Testing/Temporary/MemoryChecker.DPbd";
@@ -594,9 +594,9 @@ bool cmCTestMemCheckHandler::ProcessMemCheckOutput(const std::string& str,
 bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput(
   const std::string& str, std::string& log,
   int* results)
-{ 
+{
   std::vector<cmStdString> lines;
-  cmSystemTools::Split(str.c_str(), lines); 
+  cmSystemTools::Split(str.c_str(), lines);
   cmOStringStream ostr;
   log = "";
 
@@ -604,7 +604,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput(
 
   int defects = 0;
 
-  for( std::vector<cmStdString>::iterator i = lines.begin(); 
+  for( std::vector<cmStdString>::iterator i = lines.begin();
        i != lines.end(); ++i)
     {
     int failure = cmCTestMemCheckHandler::NO_MEMORY_FAULT;
@@ -657,7 +657,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput(
     {
     unlimitedOutput = true;
     }
-  
+
   std::string::size_type cc;
 
   cmOStringStream ostr;
@@ -782,7 +782,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput(
         }
       totalOutputSize += lines[cc].size();
       ostr << cmXMLSafe(lines[cc]) << std::endl;
-      } 
+      }
     else
       {
       nonValGrindOutput.push_back(cc);
@@ -791,7 +791,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput(
   // Now put all all the non valgrind output into the test output
   if(!outputFull)
     {
-    for(std::vector<std::string::size_type>::iterator i = 
+    for(std::vector<std::string::size_type>::iterator i =
           nonValGrindOutput.begin(); i != nonValGrindOutput.end(); ++i)
       {
       totalOutputSize += lines[*i].size();
@@ -801,7 +801,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput(
                  <<  cmXMLSafe(lines[*i]) << std::endl);
 
       ostr << cmXMLSafe(lines[*i]) << std::endl;
-      if(!unlimitedOutput && totalOutputSize > 
+      if(!unlimitedOutput && totalOutputSize >
          static_cast<size_t>(this->CustomMaximumFailedTestOutputSize))
         {
         outputFull = true;
@@ -833,7 +833,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckBoundsCheckerOutput(
   log = "";
   double sttime = cmSystemTools::GetTime();
   std::vector<cmStdString> lines;
-  cmSystemTools::Split(str.c_str(), lines); 
+  cmSystemTools::Split(str.c_str(), lines);
   cmCTestLog(this->CTest, DEBUG, "Start test: " << lines.size() << std::endl);
   std::vector<cmStdString>::size_type cc;
   for ( cc = 0; cc < lines.size(); cc ++ )
@@ -886,8 +886,8 @@ bool cmCTestMemCheckHandler::ProcessMemCheckBoundsCheckerOutput(
 // for the test
 void
 cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res)
-{ 
-  cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, 
+{
+  cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
              "PostProcessBoundsCheckerTest for : "
              << res.Name.c_str() << std::endl);
   if ( !cmSystemTools::FileExists(this->MemoryTesterOutputFile.c_str()) )
@@ -902,22 +902,22 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res)
   std::ifstream ifs(this->MemoryTesterOutputFile.c_str());
   if ( !ifs )
     {
-    std::string log = "Cannot read memory tester output file: " 
+    std::string log = "Cannot read memory tester output file: "
       + this->MemoryTesterOutputFile;
     cmCTestLog(this->CTest, ERROR_MESSAGE, log.c_str() << std::endl);
     return;
-    } 
+    }
   res.Output += BOUNDS_CHECKER_MARKER;
   res.Output += "\n";
   std::string line;
   while ( cmSystemTools::GetLineFromStream(ifs, line) )
     {
-    res.Output += line; 
+    res.Output += line;
     res.Output += "\n";
     }
   }
   cmSystemTools::Delay(1000);
-  cmSystemTools::RemoveFile(this->BoundsCheckerDPBDFile.c_str()); 
+  cmSystemTools::RemoveFile(this->BoundsCheckerDPBDFile.c_str());
   cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Remove: "
     << this->BoundsCheckerDPBDFile.c_str() << std::endl);
   cmSystemTools::RemoveFile(this->BoundsCheckerXMLFile.c_str());
@@ -928,7 +928,7 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res)
 void
 cmCTestMemCheckHandler::PostProcessPurifyTest(cmCTestTestResult& res)
 {
-  cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, 
+  cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
              "PostProcessPurifyTest for : "
              << res.Name.c_str() << std::endl);
   if ( !cmSystemTools::FileExists(this->MemoryTesterOutputFile.c_str()) )
@@ -945,7 +945,7 @@ cmCTestMemCheckHandler::PostProcessPurifyTest(cmCTestTestResult& res)
       + this->MemoryTesterOutputFile;
     cmCTestLog(this->CTest, ERROR_MESSAGE, log.c_str() << std::endl);
     return;
-    } 
+    }
   std::string line;
   while ( cmSystemTools::GetLineFromStream(ifs, line) )
     {
diff --git a/Source/CTest/cmCTestMemCheckHandler.h b/Source/CTest/cmCTestMemCheckHandler.h
index 427d4717d..1e81c893b 100644
--- a/Source/CTest/cmCTestMemCheckHandler.h
+++ b/Source/CTest/cmCTestMemCheckHandler.h
@@ -30,7 +30,7 @@ public:
   cmTypeMacro(cmCTestMemCheckHandler, cmCTestTestHandler);
 
   void PopulateCustomVectors(cmMakefile *mf);
-  
+
   cmCTestMemCheckHandler();
 
   void Initialize();
@@ -108,13 +108,13 @@ private:
   //! Parse Valgrind/Purify/Bounds Checker result out of the output
   //string. After running, log holds the output and results hold the
   //different memmory errors.
-  bool ProcessMemCheckOutput(const std::string& str, 
+  bool ProcessMemCheckOutput(const std::string& str,
                              std::string& log, int* results);
-  bool ProcessMemCheckValgrindOutput(const std::string& str, 
+  bool ProcessMemCheckValgrindOutput(const std::string& str,
                                      std::string& log, int* results);
-  bool ProcessMemCheckPurifyOutput(const std::string& str, 
+  bool ProcessMemCheckPurifyOutput(const std::string& str,
                                    std::string& log, int* results);
-  bool ProcessMemCheckBoundsCheckerOutput(const std::string& str, 
+  bool ProcessMemCheckBoundsCheckerOutput(const std::string& str,
                                           std::string& log, int* results);
 
   void PostProcessPurifyTest(cmCTestTestResult& res);
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index 2cae80215..ebef1ed9c 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -48,7 +48,7 @@ cmCTestMultiProcessHandler::~cmCTestMultiProcessHandler()
 }
 
   // Set the tests
-void 
+void
 cmCTestMultiProcessHandler::SetTests(TestMap& tests,
                                      PropertiesMap& properties)
 {
@@ -178,7 +178,7 @@ void cmCTestMultiProcessHandler::EraseTest(int test)
 //---------------------------------------------------------
 inline size_t cmCTestMultiProcessHandler::GetProcessorsUsed(int test)
 {
-  size_t processors = 
+  size_t processors =
     static_cast<int>(this->Properties[test]->Processors);
   //If this is set to run serially, it must run alone.
   //Also, if processors setting is set higher than the -j
@@ -205,7 +205,7 @@ bool cmCTestMultiProcessHandler::StartTest(int test)
       }
     }
 
-  // copy the depend tests locally because when 
+  // copy the depend tests locally because when
   // a test is finished it will be removed from the depend list
   // and we don't want to be iterating a list while removing from it
   TestSet depends = this->Tests[test];
@@ -240,7 +240,7 @@ bool cmCTestMultiProcessHandler::StartTest(int test)
     this->StartTestProcess(test);
     return true;
     }
-  // This test was not able to start because it is waiting 
+  // This test was not able to start because it is waiting
   // on depends to run
   return false;
 }
@@ -351,7 +351,7 @@ void cmCTestMultiProcessHandler::UpdateCostData()
     while(std::getline(fin, line))
       {
       if(line == "---") break;
-      std::vector<cmsys::String> parts = 
+      std::vector<cmsys::String> parts =
         cmSystemTools::SplitString(line.c_str(), ' ');
       //Format: <name> <previous_runs> <avg_cost>
       if(parts.size() < 3) break;
@@ -552,7 +552,7 @@ void cmCTestMultiProcessHandler::PrintTestList()
       }
     cmOStringStream indexStr;
     indexStr << " #" << p.Index << ":";
-    cmCTestLog(this->CTest, HANDLER_OUTPUT, 
+    cmCTestLog(this->CTest, HANDLER_OUTPUT,
       std::setw(3 + getNumWidth(this->TestHandler->GetMaxIndex()))
       << indexStr.str().c_str());
     cmCTestLog(this->CTest, HANDLER_OUTPUT, " ");
@@ -603,7 +603,7 @@ void cmCTestMultiProcessHandler::CheckResume()
         << std::endl
         << "----------------------------------------------------------"
         << std::endl;
-        
+
       std::ifstream fin;
       fin.open(fname.c_str());
       std::string line;
diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h
index 1483440c6..cd21d9187 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.h
+++ b/Source/CTest/cmCTestMultiProcessHandler.h
@@ -19,16 +19,16 @@
 /** \class cmCTestMultiProcessHandler
  * \brief run parallel ctest
  *
- * cmCTestMultiProcessHandler 
+ * cmCTestMultiProcessHandler
  */
-class cmCTestMultiProcessHandler 
+class cmCTestMultiProcessHandler
 {
   friend class TestComparator;
 public:
   struct TestSet : public std::set<int> {};
   struct TestMap : public std::map<int, TestSet> {};
   struct TestList : public std::vector<int> {};
-  struct PropertiesMap : public 
+  struct PropertiesMap : public
      std::map<int, cmCTestTestHandler::cmCTestTestProperties*> {};
 
   cmCTestMultiProcessHandler();
diff --git a/Source/CTest/cmCTestReadCustomFilesCommand.h b/Source/CTest/cmCTestReadCustomFilesCommand.h
index f382b0f2d..b984c84e9 100644
--- a/Source/CTest/cmCTestReadCustomFilesCommand.h
+++ b/Source/CTest/cmCTestReadCustomFilesCommand.h
@@ -25,11 +25,11 @@ class cmCTestReadCustomFilesCommand : public cmCTestCommand
 public:
 
   cmCTestReadCustomFilesCommand() {}
-  
+
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     cmCTestReadCustomFilesCommand* ni = new cmCTestReadCustomFilesCommand;
     ni->CTest = this->CTest;
@@ -55,7 +55,7 @@ public:
     {
     return "read CTestCustom files.";
     }
-  
+
   /**
    * More documentation.
    */
diff --git a/Source/CTest/cmCTestRunScriptCommand.h b/Source/CTest/cmCTestRunScriptCommand.h
index 6df69afa6..05e78991a 100644
--- a/Source/CTest/cmCTestRunScriptCommand.h
+++ b/Source/CTest/cmCTestRunScriptCommand.h
@@ -25,11 +25,11 @@ class cmCTestRunScriptCommand : public cmCTestCommand
 public:
 
   cmCTestRunScriptCommand() {}
-  
+
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     cmCTestRunScriptCommand* ni = new cmCTestRunScriptCommand;
     ni->CTest = this->CTest;
@@ -56,7 +56,7 @@ public:
     {
     return "runs a ctest -S script";
     }
-  
+
   /**
    * More documentation.
    */
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index c3de5dcf6..5eabf3fbe 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -59,7 +59,7 @@ bool cmCTestRunTest::CheckOutput()
       {
       // Store this line of output.
       cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
-                 this->GetIndex() << ": " << line << std::endl);  
+                 this->GetIndex() << ": " << line << std::endl);
       this->ProcessOutput += line;
       this->ProcessOutput += "\n";
       }
@@ -79,7 +79,7 @@ void cmCTestRunTest::CompressOutput()
   int ret;
   z_stream strm;
 
-  unsigned char* in = 
+  unsigned char* in =
     reinterpret_cast<unsigned char*>(
     const_cast<char*>(this->ProcessOutput.c_str()));
   //zlib makes the guarantee that this is the maximum output size
@@ -112,7 +112,7 @@ void cmCTestRunTest::CompressOutput()
     }
 
   (void)deflateEnd(&strm);
- 
+
   unsigned char *encoded_buffer
     = new unsigned char[static_cast<int>(outSize * 1.5)];
 
@@ -169,11 +169,11 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
         }
       }
     if ( !found )
-      { 
+      {
       reason = "Required regular expression not found.";
       forceFail = true;
       }
-    reason +=  "Regex=["; 
+    reason +=  "Regex=[";
     for ( passIt = this->TestProperties->RequiredRegularExpressions.begin();
           passIt != this->TestProperties->RequiredRegularExpressions.end();
           ++ passIt )
@@ -201,10 +201,10 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
     }
   if (res == cmsysProcess_State_Exited)
     {
-    bool success = 
-      !forceFail &&  (retVal == 0 || 
+    bool success =
+      !forceFail &&  (retVal == 0 ||
       this->TestProperties->RequiredRegularExpressions.size());
-    if((success && !this->TestProperties->WillFail) 
+    if((success && !this->TestProperties->WillFail)
       || (!success && this->TestProperties->WillFail))
       {
       this->TestResult.Status = cmCTestTestHandler::COMPLETED;
@@ -312,10 +312,10 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
       << std::endl;
     if(this->TestResult.Reason.size())
       {
-      *this->TestHandler->LogFile << reasonType << ":\n" 
+      *this->TestHandler->LogFile << reasonType << ":\n"
         << this->TestResult.Reason << "\n";
       }
-    else 
+    else
       {
       if(pass)
         {
@@ -333,14 +333,14 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
       << "----------------------------------------------------------"
       << std::endl << std::endl;
     }
-  // if the test actually started and ran 
-  // record the results in TestResult 
+  // if the test actually started and ran
+  // record the results in TestResult
   if(started)
     {
     bool compress = !this->TestHandler->MemCheck &&
       this->CompressionRatio < 1 &&
       this->CTest->ShouldCompressTestOutput();
-    this->TestResult.Output = compress ? this->CompressedOutput 
+    this->TestResult.Output = compress ? this->CompressedOutput
       : this->ProcessOutput;
     this->TestResult.CompressOutput = compress;
     this->TestResult.ReturnValue = this->TestProcess->GetExitValue();
@@ -378,7 +378,7 @@ void cmCTestRunTest::MemCheckPostProcess()
     {
     return;
     }
-  cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->Index 
+  cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->Index
              << ": process test output now: "
              << this->TestProperties->Name.c_str() << " "
              << this->TestResult.Name.c_str() << std::endl);
@@ -390,7 +390,7 @@ void cmCTestRunTest::MemCheckPostProcess()
     }
   else if(handler->MemoryTesterStyle == cmCTestMemCheckHandler::PURIFY)
     {
-    handler->PostProcessPurifyTest(this->TestResult); 
+    handler->PostProcessPurifyTest(this->TestResult);
     }
 }
 
@@ -411,7 +411,7 @@ bool cmCTestRunTest::StartTest(size_t total)
   this->TestResult.ReturnValue = -1;
   this->TestResult.CompletionStatus = "Failed to start";
   this->TestResult.Status = cmCTestTestHandler::BAD_COMMAND;
-  this->TestResult.TestCount = this->TestProperties->Index;  
+  this->TestResult.TestCount = this->TestProperties->Index;
   this->TestResult.Name = this->TestProperties->Name;
   this->TestResult.Path = this->TestProperties->Directory.c_str();
 
@@ -438,7 +438,7 @@ bool cmCTestRunTest::StartTest(size_t total)
     this->TestResult.Status = cmCTestTestHandler::NOT_RUN;
     return false;
     }
-  
+
   // Check if all required files exist
   for(std::vector<std::string>::iterator i =
     this->TestProperties->RequiredFiles.begin();
@@ -465,9 +465,9 @@ bool cmCTestRunTest::StartTest(size_t total)
   if (this->ActualCommand == "")
     {
     // if the command was not found create a TestResult object
-    // that has that information 
+    // that has that information
     this->TestProcess = new cmProcess;
-    *this->TestHandler->LogFile << "Unable to find executable: " 
+    *this->TestHandler->LogFile << "Unable to find executable: "
                    << args[1].c_str() << std::endl;
     cmCTestLog(this->CTest, ERROR_MESSAGE, "Unable to find executable: "
                << args[1].c_str() << std::endl);
@@ -536,7 +536,7 @@ void cmCTestRunTest::ComputeArguments()
 
   cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl
              << this->Index << ": "
-             << (this->TestHandler->MemCheck?"MemCheck":"Test") 
+             << (this->TestHandler->MemCheck?"MemCheck":"Test")
              << " command: " << testCommand
              << std::endl);
 }
@@ -544,7 +544,7 @@ void cmCTestRunTest::ComputeArguments()
 //----------------------------------------------------------------------
 void cmCTestRunTest::DartProcessing()
 {
-  if (!this->ProcessOutput.empty() && 
+  if (!this->ProcessOutput.empty() &&
      this->ProcessOutput.find("<DartMeasurement") != this->ProcessOutput.npos)
     {
     if (this->TestHandler->DartStuff.find(this->ProcessOutput.c_str()))
@@ -695,7 +695,7 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total)
 
   cmOStringStream indexStr;
   indexStr << " #" << this->Index << ":";
-  cmCTestLog(this->CTest, HANDLER_OUTPUT, 
+  cmCTestLog(this->CTest, HANDLER_OUTPUT,
              std::setw(3 + getNumWidth(this->TestHandler->GetMaxIndex()))
              << indexStr.str().c_str());
   cmCTestLog(this->CTest, HANDLER_OUTPUT, " ");
@@ -704,17 +704,17 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total)
   outname.resize(maxTestNameWidth + 4, '.');
 
   *this->TestHandler->LogFile << this->TestProperties->Index << "/"
-    << this->TestHandler->TotalNumberOfTests << " Testing: " 
+    << this->TestHandler->TotalNumberOfTests << " Testing: "
     << this->TestProperties->Name << std::endl;
   *this->TestHandler->LogFile << this->TestProperties->Index << "/"
     << this->TestHandler->TotalNumberOfTests
     << " Test: " << this->TestProperties->Name.c_str() << std::endl;
   *this->TestHandler->LogFile << "Command: \"" << this->ActualCommand << "\"";
-  
+
   for (std::vector<std::string>::iterator i = this->Arguments.begin();
        i != this->Arguments.end(); ++i)
     {
-    *this->TestHandler->LogFile 
+    *this->TestHandler->LogFile
       << " \"" << i->c_str() << "\"";
     }
   *this->TestHandler->LogFile << std::endl
@@ -730,6 +730,6 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total)
     << this->ProcessOutput.c_str() << "<end of output>" << std::endl;
 
   cmCTestLog(this->CTest, HANDLER_OUTPUT, outname.c_str());
-  cmCTestLog(this->CTest, DEBUG, "Testing " 
+  cmCTestLog(this->CTest, DEBUG, "Testing "
              << this->TestProperties->Name.c_str() << " ... ");
 }
diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h
index 89456d505..476f3e126 100644
--- a/Source/CTest/cmCTestRunTest.h
+++ b/Source/CTest/cmCTestRunTest.h
@@ -74,7 +74,7 @@ private:
   cmCTestTestHandler * TestHandler;
   cmCTest * CTest;
   cmProcess * TestProcess;
-  //If the executable to run is ctest, don't create a new process; 
+  //If the executable to run is ctest, don't create a new process;
   //just instantiate a new cmTest.  (Can be disabled for a single test
   //if this option is set to false.)
   //bool OptimizeForCTest;
diff --git a/Source/CTest/cmCTestScriptHandler.h b/Source/CTest/cmCTestScriptHandler.h
index a7cf6ba65..9d852cab6 100644
--- a/Source/CTest/cmCTestScriptHandler.h
+++ b/Source/CTest/cmCTestScriptHandler.h
@@ -97,7 +97,7 @@ public:
   static void SleepInSeconds(unsigned int secondsToWait);
   void UpdateElapsedTime();
 
-  /** 
+  /**
    * Return the time remaianing that the script is allowed to run in
    * seconds if the user has set the variable CTEST_TIME_LIMIT. If that has
    * not been set it returns 1e7 seconds
diff --git a/Source/CTest/cmCTestSleepCommand.cxx b/Source/CTest/cmCTestSleepCommand.cxx
index 5b0697219..7e8755066 100644
--- a/Source/CTest/cmCTestSleepCommand.cxx
+++ b/Source/CTest/cmCTestSleepCommand.cxx
@@ -47,7 +47,7 @@ bool cmCTestSleepCommand
       }
     return true;
     }
-  
+
   this->SetError("called with incorrect number of arguments");
   return false;
 }
diff --git a/Source/CTest/cmCTestSleepCommand.h b/Source/CTest/cmCTestSleepCommand.h
index 80fd6afb7..0f51ddfeb 100644
--- a/Source/CTest/cmCTestSleepCommand.h
+++ b/Source/CTest/cmCTestSleepCommand.h
@@ -25,11 +25,11 @@ class cmCTestSleepCommand : public cmCTestCommand
 public:
 
   cmCTestSleepCommand() {}
-  
+
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     cmCTestSleepCommand* ni = new cmCTestSleepCommand;
     ni->CTest = this->CTest;
@@ -56,7 +56,7 @@ public:
     {
     return "sleeps for some amount of time";
     }
-  
+
   /**
    * More documentation.
    */
diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx
index 5aee035c7..231f035fb 100644
--- a/Source/CTest/cmCTestTestCommand.cxx
+++ b/Source/CTest/cmCTestTestCommand.cxx
@@ -32,7 +32,7 @@ cmCTestTestCommand::cmCTestTestCommand()
 
 cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler()
 {
-  const char* ctestTimeout = 
+  const char* ctestTimeout =
     this->Makefile->GetDefinition("CTEST_TEST_TIMEOUT");
 
   double timeout = this->CTest->GetTimeOut();
@@ -86,7 +86,7 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler()
     }
   if(this->Values[ctt_INCLUDE_LABEL])
     {
-    handler->SetOption("LabelRegularExpression", 
+    handler->SetOption("LabelRegularExpression",
                        this->Values[ctt_INCLUDE_LABEL]);
     }
   if(this->Values[ctt_PARALLEL_LEVEL])
diff --git a/Source/CTest/cmCTestTestCommand.h b/Source/CTest/cmCTestTestCommand.h
index d184ff2a0..130cb6973 100644
--- a/Source/CTest/cmCTestTestCommand.h
+++ b/Source/CTest/cmCTestTestCommand.h
@@ -58,7 +58,7 @@ public:
       "  ctest_test([BUILD build_dir] [APPEND]\n"
       "             [START start number] [END end number]\n"
       "             [STRIDE stride number] [EXCLUDE exclude regex ]\n"
-      "             [INCLUDE include regex] [RETURN_VALUE res] \n" 
+      "             [INCLUDE include regex] [RETURN_VALUE res] \n"
       "             [EXCLUDE_LABEL exclude regex] \n"
       "             [INCLUDE_LABEL label regex] \n"
       "             [PARALLEL_LEVEL level] \n"
diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx
index 0ee631fe9..000bc8503 100644
--- a/Source/CTest/cmProcess.cxx
+++ b/Source/CTest/cmProcess.cxx
@@ -196,12 +196,12 @@ int cmProcess::ReportStatus()
     {
     case cmsysProcess_State_Starting:
       {
-      std::cerr << "cmProcess: Never started " 
+      std::cerr << "cmProcess: Never started "
            << this->Command << " process.\n";
       } break;
     case cmsysProcess_State_Error:
       {
-      std::cerr << "cmProcess: Error executing " << this->Command 
+      std::cerr << "cmProcess: Error executing " << this->Command
                 << " process: "
                 << cmsysProcess_GetErrorString(this->Process)
                 << "\n";
@@ -241,19 +241,19 @@ int cmProcess::ReportStatus()
       } break;
     case cmsysProcess_State_Executing:
       {
-      std::cerr << "cmProcess: Never terminated " << 
+      std::cerr << "cmProcess: Never terminated " <<
         this->Command << " process.\n";
       } break;
     case cmsysProcess_State_Exited:
       {
       result = cmsysProcess_GetExitValue(this->Process);
-      std::cerr << "cmProcess: " << this->Command 
+      std::cerr << "cmProcess: " << this->Command
                 << " process exited with code "
                 << result << "\n";
       } break;
     case cmsysProcess_State_Expired:
       {
-      std::cerr << "cmProcess: killed " << this->Command 
+      std::cerr << "cmProcess: killed " << this->Command
                 << " process due to timeout.\n";
       } break;
     case cmsysProcess_State_Killed:
diff --git a/Source/CTest/cmProcess.h b/Source/CTest/cmProcess.h
index ff99ca23d..1479df05f 100644
--- a/Source/CTest/cmProcess.h
+++ b/Source/CTest/cmProcess.h
@@ -22,7 +22,7 @@
  *
  * cmProcess wraps the kwsys process stuff in a c++ class.
  */
-class cmProcess 
+class cmProcess
 {
 public:
   cmProcess();
@@ -37,7 +37,7 @@ public:
 
   // return the process status
   int GetProcessStatus();
-  // Report the status of the program 
+  // Report the status of the program
   int ReportStatus();
   int GetId() { return this->Id; }
   void SetId(int id) { this->Id = id;}
diff --git a/Source/CursesDialog/cmCursesBoolWidget.cxx b/Source/CursesDialog/cmCursesBoolWidget.cxx
index 9c4c5a577..fd15b9944 100644
--- a/Source/CursesDialog/cmCursesBoolWidget.cxx
+++ b/Source/CursesDialog/cmCursesBoolWidget.cxx
@@ -12,7 +12,7 @@
 #include "cmCursesBoolWidget.h"
 #include "cmCursesMainForm.h"
 
-cmCursesBoolWidget::cmCursesBoolWidget(int width, int height, 
+cmCursesBoolWidget::cmCursesBoolWidget(int width, int height,
                                        int left, int top) :
   cmCursesWidget(width, height, left, top)
 {
@@ -38,15 +38,15 @@ bool cmCursesBoolWidget::HandleInput(int& key, cmCursesMainForm*, WINDOW* w)
       this->SetValueAsBool(true);
       }
 
-    touchwin(w); 
-    wrefresh(w); 
+    touchwin(w);
+    wrefresh(w);
     return true;
     }
   else
     {
     return false;
     }
-  
+
 }
 
 void cmCursesBoolWidget::SetValueAsBool(bool value)
@@ -56,7 +56,7 @@ void cmCursesBoolWidget::SetValueAsBool(bool value)
     this->SetValue("ON");
     }
   else
-    { 
+    {
     this->SetValue("OFF");
     }
 }
@@ -68,7 +68,7 @@ bool cmCursesBoolWidget::GetValueAsBool()
     return true;
     }
   else
-    { 
+    {
     return false;
     }
 }
diff --git a/Source/CursesDialog/cmCursesBoolWidget.h b/Source/CursesDialog/cmCursesBoolWidget.h
index 0d1d6a6cf..d2a25ca12 100644
--- a/Source/CursesDialog/cmCursesBoolWidget.h
+++ b/Source/CursesDialog/cmCursesBoolWidget.h
@@ -19,7 +19,7 @@ class cmCursesBoolWidget : public cmCursesWidget
 {
 public:
   cmCursesBoolWidget(int width, int height, int left, int top);
-  
+
   // Description:
   // Handle user input. Called by the container of this widget
   // when this widget has focus. Returns true if the input was
diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
index 828384d71..c58d037f0 100644
--- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
+++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
@@ -19,19 +19,19 @@
 #include "../cmSystemTools.h"
 
 cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(const char* key,
-                                                         int labelwidth, 
+                                                         int labelwidth,
                                                          int entrywidth) :
   Key(key), LabelWidth(labelwidth), EntryWidth(entrywidth)
 {
   this->Label = new cmCursesLabelWidget(this->LabelWidth, 1, 1, 1, key);
   this->IsNewLabel = new cmCursesLabelWidget(1, 1, 1, 1, " ");
-  this->Entry = 0; 
+  this->Entry = 0;
   this->Entry = new cmCursesStringWidget(this->EntryWidth, 1, 1, 1);
 }
 
 cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
-  const char* key, const cmCacheManager::CacheIterator& it, bool isNew, 
-  int labelwidth, int entrywidth) 
+  const char* key, const cmCacheManager::CacheIterator& it, bool isNew,
+  int labelwidth, int entrywidth)
   : Key(key), LabelWidth(labelwidth), EntryWidth(entrywidth)
 {
   this->Label = new cmCursesLabelWidget(this->LabelWidth, 1, 1, 1, key);
@@ -74,7 +74,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
         it.GetValue());
       break;
     case cmCacheManager::UNINITIALIZED:
-      cmSystemTools::Error("Found an undefined variable: ", it.GetName());      
+      cmSystemTools::Error("Found an undefined variable: ", it.GetName());
       break;
     default:
       // TODO : put warning message here
diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.h b/Source/CursesDialog/cmCursesCacheEntryComposite.h
index a40ea28e1..1357a02ec 100644
--- a/Source/CursesDialog/cmCursesCacheEntryComposite.h
+++ b/Source/CursesDialog/cmCursesCacheEntryComposite.h
@@ -20,7 +20,7 @@ class cmCursesCacheEntryComposite
 public:
   cmCursesCacheEntryComposite(const char* key, int labelwidth, int entrywidth);
   cmCursesCacheEntryComposite(const char* key,
-                              const cmCacheManager::CacheIterator& it, 
+                              const cmCacheManager::CacheIterator& it,
                               bool isNew, int labelwidth, int entrywidth);
   ~cmCursesCacheEntryComposite();
   const char* GetValue();
diff --git a/Source/CursesDialog/cmCursesDummyWidget.cxx b/Source/CursesDialog/cmCursesDummyWidget.cxx
index 1d8a45d79..60086a51b 100644
--- a/Source/CursesDialog/cmCursesDummyWidget.cxx
+++ b/Source/CursesDialog/cmCursesDummyWidget.cxx
@@ -11,7 +11,7 @@
 ============================================================================*/
 #include "cmCursesDummyWidget.h"
 
-cmCursesDummyWidget::cmCursesDummyWidget(int width, int height, 
+cmCursesDummyWidget::cmCursesDummyWidget(int width, int height,
                                            int left, int top) :
   cmCursesWidget(width, height, left, top)
 {
diff --git a/Source/CursesDialog/cmCursesDummyWidget.h b/Source/CursesDialog/cmCursesDummyWidget.h
index cc4cc748d..9ac13652d 100644
--- a/Source/CursesDialog/cmCursesDummyWidget.h
+++ b/Source/CursesDialog/cmCursesDummyWidget.h
@@ -20,7 +20,7 @@ class cmCursesDummyWidget : public cmCursesWidget
 {
 public:
   cmCursesDummyWidget(int width, int height, int left, int top);
-  
+
   // Description:
   // Handle user input. Called by the container of this widget
   // when this widget has focus. Returns true if the input was
diff --git a/Source/CursesDialog/cmCursesFilePathWidget.cxx b/Source/CursesDialog/cmCursesFilePathWidget.cxx
index 13bbcc936..01db014bb 100644
--- a/Source/CursesDialog/cmCursesFilePathWidget.cxx
+++ b/Source/CursesDialog/cmCursesFilePathWidget.cxx
@@ -11,7 +11,7 @@
 ============================================================================*/
 #include "cmCursesFilePathWidget.h"
 
-cmCursesFilePathWidget::cmCursesFilePathWidget(int width, int height, 
+cmCursesFilePathWidget::cmCursesFilePathWidget(int width, int height,
                                            int left, int top) :
   cmCursesPathWidget(width, height, left, top)
 {
diff --git a/Source/CursesDialog/cmCursesForm.h b/Source/CursesDialog/cmCursesForm.h
index 7556d74b5..3cba856ab 100644
--- a/Source/CursesDialog/cmCursesForm.h
+++ b/Source/CursesDialog/cmCursesForm.h
@@ -20,7 +20,7 @@ class cmCursesForm
 public:
   cmCursesForm();
   virtual ~cmCursesForm();
-  
+
   // Description:
   // Handle user input.
   virtual void HandleInput() = 0;
@@ -59,7 +59,7 @@ public:
     }
 
   static cmCursesForm* CurrentForm;
-  
+
 
 protected:
 
diff --git a/Source/CursesDialog/cmCursesLabelWidget.cxx b/Source/CursesDialog/cmCursesLabelWidget.cxx
index 2ad4813c6..b5ed3128c 100644
--- a/Source/CursesDialog/cmCursesLabelWidget.cxx
+++ b/Source/CursesDialog/cmCursesLabelWidget.cxx
@@ -11,7 +11,7 @@
 ============================================================================*/
 #include "cmCursesLabelWidget.h"
 
-cmCursesLabelWidget::cmCursesLabelWidget(int width, int height, 
+cmCursesLabelWidget::cmCursesLabelWidget(int width, int height,
                                          int left, int top,
                                          const std::string& name) :
   cmCursesWidget(width, height, left, top)
diff --git a/Source/CursesDialog/cmCursesLabelWidget.h b/Source/CursesDialog/cmCursesLabelWidget.h
index bbcc58618..cc32d11ea 100644
--- a/Source/CursesDialog/cmCursesLabelWidget.h
+++ b/Source/CursesDialog/cmCursesLabelWidget.h
@@ -23,7 +23,7 @@ public:
   cmCursesLabelWidget(int width, int height, int left, int top,
                       const std::string& name);
   virtual ~cmCursesLabelWidget();
-  
+
   // Description:
   // Handle user input. Called by the container of this widget
   // when this widget has focus. Returns true if the input was
diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx
index 0e2cd229f..057f8f3d8 100644
--- a/Source/CursesDialog/cmCursesLongMessageForm.cxx
+++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx
@@ -19,10 +19,10 @@
 inline int ctrl(int z)
 {
     return (z&037);
-} 
+}
 
-cmCursesLongMessageForm::cmCursesLongMessageForm(std::vector<std::string> 
-                                                 const& messages, const char* 
+cmCursesLongMessageForm::cmCursesLongMessageForm(std::vector<std::string>
+                                                 const& messages, const char*
                                                  title)
 {
   // Append all messages into on big string
@@ -84,7 +84,7 @@ void cmCursesLongMessageForm::UpdateStatusBar()
   curses_move(y-4,0);
   attron(A_STANDOUT);
   printw(bar);
-  attroff(A_STANDOUT);  
+  attroff(A_STANDOUT);
   curses_move(y-3,0);
   printw(version);
   pos_form_cursor(this->Form);
@@ -94,7 +94,7 @@ void cmCursesLongMessageForm::PrintKeys()
 {
   int x,y;
   getmaxyx(stdscr, y, x);
-  if ( x < cmCursesMainForm::MIN_WIDTH  || 
+  if ( x < cmCursesMainForm::MIN_WIDTH  ||
        y < cmCursesMainForm::MIN_HEIGHT )
     {
     return;
@@ -105,7 +105,7 @@ void cmCursesLongMessageForm::PrintKeys()
   curses_move(y-2,0);
   printw(firstLine);
   pos_form_cursor(this->Form);
-  
+
 }
 
 void cmCursesLongMessageForm::Render(int, int, int, int)
@@ -155,7 +155,7 @@ void cmCursesLongMessageForm::Render(int, int, int, int)
 
   this->UpdateStatusBar();
   this->PrintKeys();
-  touchwin(stdscr); 
+  touchwin(stdscr);
   refresh();
 
 }
@@ -200,8 +200,8 @@ void cmCursesLongMessageForm::HandleInput()
 
     this->UpdateStatusBar();
     this->PrintKeys();
-    touchwin(stdscr); 
-    wrefresh(stdscr); 
+    touchwin(stdscr);
+    wrefresh(stdscr);
     }
 
 }
diff --git a/Source/CursesDialog/cmCursesLongMessageForm.h b/Source/CursesDialog/cmCursesLongMessageForm.h
index 341f9c6c6..1e86974f2 100644
--- a/Source/CursesDialog/cmCursesLongMessageForm.h
+++ b/Source/CursesDialog/cmCursesLongMessageForm.h
@@ -21,10 +21,10 @@ class cmCursesCacheEntryComposite;
 class cmCursesLongMessageForm : public cmCursesForm
 {
 public:
-  cmCursesLongMessageForm(std::vector<std::string> const& messages, 
+  cmCursesLongMessageForm(std::vector<std::string> const& messages,
                           const char* title);
   virtual ~cmCursesLongMessageForm();
-  
+
   // Description:
   // Handle user input.
   virtual void HandleInput();
diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h
index 3e191b497..883a2b3d6 100644
--- a/Source/CursesDialog/cmCursesMainForm.h
+++ b/Source/CursesDialog/cmCursesMainForm.h
@@ -30,12 +30,12 @@ class cmCursesMainForm : public cmCursesForm
 public:
   cmCursesMainForm(std::vector<std::string> const& args, int initwidth);
   virtual ~cmCursesMainForm();
-  
+
   /**
    * Set the widgets which represent the cache entries.
    */
   void InitializeUI();
-  
+
   /**
    * Handle user input.
    */
@@ -65,7 +65,7 @@ public:
    * exception is during a resize. The optional argument specifies the
    * string to be displayed in the status bar.
    */
-  virtual void UpdateStatusBar() { this->UpdateStatusBar(0); } 
+  virtual void UpdateStatusBar() { this->UpdateStatusBar(0); }
   virtual void UpdateStatusBar(const char* message);
 
   /**
@@ -90,7 +90,7 @@ public:
   int Configure(int noconfigure=0);
 
   /**
-   * Used to generate 
+   * Used to generate
    */
   int Generate();
 
@@ -98,7 +98,7 @@ public:
    * Used by main program
    */
   int LoadCache(const char *dir);
-  
+
   /**
    * Progress callback
    */
diff --git a/Source/CursesDialog/cmCursesPathWidget.cxx b/Source/CursesDialog/cmCursesPathWidget.cxx
index b113c2e6a..14c325bcb 100644
--- a/Source/CursesDialog/cmCursesPathWidget.cxx
+++ b/Source/CursesDialog/cmCursesPathWidget.cxx
@@ -14,7 +14,7 @@
 #include "cmCursesMainForm.h"
 #include "cmSystemTools.h"
 
-cmCursesPathWidget::cmCursesPathWidget(int width, int height, 
+cmCursesPathWidget::cmCursesPathWidget(int width, int height,
                                            int left, int top) :
   cmCursesStringWidget(width, height, left, top)
 {
@@ -75,8 +75,8 @@ void cmCursesPathWidget::OnTab(cmCursesMainForm* fm, WINDOW* w)
     }
 
   this->SetString(cstr.c_str());
-  touchwin(w); 
-  wrefresh(w); 
+  touchwin(w);
+  wrefresh(w);
   form_driver(form, REQ_END_FIELD);
   this->LastGlob = glob;
   this->LastString = cstr;
diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx
index d363f0090..5c7414f13 100644
--- a/Source/CursesDialog/cmCursesStringWidget.cxx
+++ b/Source/CursesDialog/cmCursesStringWidget.cxx
@@ -15,9 +15,9 @@
 inline int ctrl(int z)
 {
     return (z&037);
-} 
+}
 
-cmCursesStringWidget::cmCursesStringWidget(int width, int height, 
+cmCursesStringWidget::cmCursesStringWidget(int width, int height,
                                            int left, int top) :
   cmCursesWidget(width, height, left, top)
 {
@@ -63,7 +63,7 @@ void cmCursesStringWidget::OnType(int& key, cmCursesMainForm* fm, WINDOW*)
   form_driver(fm->GetForm(), key);
 }
 
-bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm, 
+bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
                                        WINDOW* w)
 {
   int x,y;
@@ -90,7 +90,7 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
 
     getmaxyx(stdscr, y, x);
     // If window too small, handle 'q' only
-    if ( x < cmCursesMainForm::MIN_WIDTH  || 
+    if ( x < cmCursesMainForm::MIN_WIDTH  ||
          y < cmCursesMainForm::MIN_HEIGHT )
       {
       // quit
@@ -100,7 +100,7 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
         }
       else
         {
-        key=getch(); 
+        key=getch();
         continue;
         }
       }
@@ -111,7 +111,7 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
       return false;
       }
     // 10 == enter
-    if (key == 10 || key == KEY_ENTER) 
+    if (key == 10 || key == KEY_ENTER)
       {
       this->OnReturn(fm, w);
       }
@@ -121,7 +121,7 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
               key == KEY_PPAGE || key == ctrl('u'))
       {
       this->InEdit = false;
-      delete[] this->OriginalString;     
+      delete[] this->OriginalString;
       // trick to force forms to update the field buffer
       form_driver(form, REQ_NEXT_FIELD);
       form_driver(form, REQ_PREV_FIELD);
@@ -136,8 +136,8 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
         fm->PrintKeys();
         this->SetString(this->OriginalString);
         delete[] this->OriginalString;
-        touchwin(w); 
-        wrefresh(w); 
+        touchwin(w);
+        wrefresh(w);
         return true;
         }
       }
@@ -165,7 +165,7 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
       {
       form_driver(form, REQ_END_FIELD);
       }
-    else if ( key == 127 || 
+    else if ( key == 127 ||
               key == KEY_BACKSPACE )
       {
       if ( form->curcol > 0 )
@@ -186,10 +186,10 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
       }
     if ( !this->Done )
       {
-      touchwin(w); 
-      wrefresh(w); 
-      
-      key=getch(); 
+      touchwin(w);
+      wrefresh(w);
+
+      key=getch();
       }
     }
   return true;
@@ -214,7 +214,7 @@ bool cmCursesStringWidget::PrintKeys()
 {
   int x,y;
   getmaxyx(stdscr, y, x);
-  if ( x < cmCursesMainForm::MIN_WIDTH  || 
+  if ( x < cmCursesMainForm::MIN_WIDTH  ||
        y < cmCursesMainForm::MIN_HEIGHT )
     {
     return false;
diff --git a/Source/CursesDialog/cmCursesStringWidget.h b/Source/CursesDialog/cmCursesStringWidget.h
index cd54f249b..e939049df 100644
--- a/Source/CursesDialog/cmCursesStringWidget.h
+++ b/Source/CursesDialog/cmCursesStringWidget.h
@@ -26,7 +26,7 @@ class cmCursesStringWidget : public cmCursesWidget
 {
 public:
   cmCursesStringWidget(int width, int height, int left, int top);
-  
+
   /**
    * Handle user input. Called by the container of this widget
    * when this widget has focus. Returns true if the input was
diff --git a/Source/CursesDialog/cmCursesWidget.h b/Source/CursesDialog/cmCursesWidget.h
index ee36af613..952c67a86 100644
--- a/Source/CursesDialog/cmCursesWidget.h
+++ b/Source/CursesDialog/cmCursesWidget.h
@@ -22,7 +22,7 @@ class cmCursesWidget
 public:
   cmCursesWidget(int width, int height, int left, int top);
   virtual ~cmCursesWidget();
-  
+
   /**
    * Handle user input. Called by the container of this widget
    * when this widget has focus. Returns true if the input was
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx
index c942bc4ad..01893f589 100644
--- a/Source/QtDialog/CMakeSetup.cxx
+++ b/Source/QtDialog/CMakeSetup.cxx
@@ -99,15 +99,15 @@ int main(int argc, char** argv)
     }
 
   QApplication app(argc, argv);
-  
+
   // clean out standard Qt paths for plugins, which we don't use anyway
   // when creating Mac bundles, it potentially causes problems
   foreach(QString p, QApplication::libraryPaths())
     {
     QApplication::removeLibraryPath(p);
     }
-  
-  // if arg for install 
+
+  // if arg for install
   for(int i =0; i < argc; i++)
     {
     if(strcmp(argv[i], "--mac-install") == 0)
@@ -117,7 +117,7 @@ int main(int argc, char** argv)
       return 0;
       }
     }
-  // tell the cmake library where cmake is 
+  // tell the cmake library where cmake is
   QDir cmExecDir(QApplication::applicationDirPath());
 #if defined(Q_OS_MAC)
   cmExecDir.cd("../../../");
@@ -131,7 +131,7 @@ int main(int argc, char** argv)
   QString transfile = QString("cmake_%1").arg(QLocale::system().name());
   translator.load(transfile, translationsDir.path());
   app.installTranslator(&translator);
-  
+
   // app setup
   app.setApplicationName("CMakeSetup");
   app.setOrganizationName("Kitware");
@@ -139,16 +139,16 @@ int main(int argc, char** argv)
   appIcon.addFile(":/Icons/CMakeSetup32.png");
   appIcon.addFile(":/Icons/CMakeSetup128.png");
   app.setWindowIcon(appIcon);
-  
+
   CMakeSetupDialog dialog;
   dialog.show();
- 
+
   cmsys::CommandLineArguments arg;
   arg.Initialize(argc, argv);
   std::string binaryDirectory;
   std::string sourceDirectory;
   typedef cmsys::CommandLineArguments argT;
-  arg.AddArgument("-B", argT::CONCAT_ARGUMENT, 
+  arg.AddArgument("-B", argT::CONCAT_ARGUMENT,
                   &binaryDirectory, "Binary Directory");
   arg.AddArgument("-H", argT::CONCAT_ARGUMENT,
                   &sourceDirectory, "Source Directory");
@@ -199,7 +199,7 @@ int main(int argc, char** argv)
         }
       }
     }
-  
+
   return app.exec();
 }
 
diff --git a/Source/QtDialog/Compilers.h b/Source/QtDialog/Compilers.h
index e9c90a504..3f7b83411 100644
--- a/Source/QtDialog/Compilers.h
+++ b/Source/QtDialog/Compilers.h
@@ -10,7 +10,7 @@ class Compilers : public QWidget, public Ui::Compilers
 {
   Q_OBJECT
 public:
-  Compilers(QWidget* p=NULL) : 
+  Compilers(QWidget* p=NULL) :
     QWidget(p)
   {
     this->setupUi(this);
diff --git a/Source/QtDialog/FirstConfigure.cxx b/Source/QtDialog/FirstConfigure.cxx
index 2a79877da..6de9f00cc 100644
--- a/Source/QtDialog/FirstConfigure.cxx
+++ b/Source/QtDialog/FirstConfigure.cxx
@@ -25,7 +25,7 @@ StartCompilerSetup::StartCompilerSetup(QWidget* p)
   l->addWidget(this->CompilerSetupOptions[1]);
   l->addWidget(this->CompilerSetupOptions[2]);
   l->addWidget(this->CompilerSetupOptions[3]);
-  
+
   this->CompilerSetupOptions[0]->setChecked(true);
 
   QObject::connect(this->CompilerSetupOptions[0], SIGNAL(toggled(bool)),
@@ -47,7 +47,7 @@ void StartCompilerSetup::setGenerators(const QStringList& gens)
   this->GeneratorOptions->clear();
   this->GeneratorOptions->addItems(gens);
 };
-    
+
 void StartCompilerSetup::setCurrentGenerator(const QString& gen)
 {
   int idx = this->GeneratorOptions->findText(gen);
@@ -237,7 +237,7 @@ void CrossCompilerSetup::setProcessor(const QString& t)
 {
   this->systemProcessor->setText(t);
 }
-    
+
 QString CrossCompilerSetup::getFindRoot() const
 {
   return this->crossFindRoot->text();
@@ -313,10 +313,10 @@ FirstConfigure::FirstConfigure()
 
   this->mNativeCompilerSetupPage = new NativeCompilerSetup(this);
   this->setPage(NativeSetup, this->mNativeCompilerSetupPage);
-  
+
   this->mCrossCompilerSetupPage = new CrossCompilerSetup(this);
   this->setPage(CrossSetup, this->mCrossCompilerSetupPage);
-  
+
   this->mToolchainCompilerSetupPage = new ToolchainCompilerSetup(this);
   this->setPage(ToolchainSetup, this->mToolchainCompilerSetupPage);
 }
@@ -370,14 +370,14 @@ void FirstConfigure::loadFromSettings()
 void FirstConfigure::saveToSettings()
 {
   QSettings settings;
-  
+
   // save generator
   settings.beginGroup("Settings/StartPath");
   QString lastGen = this->mStartCompilerSetupPage->getGenerator();
   settings.setValue("LastGenerator", lastGen);
   settings.endGroup();
 
-  // save compiler setup 
+  // save compiler setup
   settings.beginGroup("Settings/Compiler");
   settings.setValue("CCompiler", this->mNativeCompilerSetupPage->getCCompiler());
   settings.setValue("CXXCompiler", this->mNativeCompilerSetupPage->getCXXCompiler());
@@ -419,7 +419,7 @@ bool FirstConfigure::crossCompilerToolChainFile() const
 {
   return this->mStartCompilerSetupPage->crossCompilerToolChainFile();
 }
-  
+
 QString FirstConfigure::getCrossCompilerToolChainFile() const
 {
   return this->mToolchainCompilerSetupPage->toolchainFile();
diff --git a/Source/QtDialog/FirstConfigure.h b/Source/QtDialog/FirstConfigure.h
index f4e368bfc..be390b0fd 100644
--- a/Source/QtDialog/FirstConfigure.h
+++ b/Source/QtDialog/FirstConfigure.h
@@ -30,14 +30,14 @@ class StartCompilerSetup : public QWizardPage
     void setGenerators(const QStringList& gens);
     void setCurrentGenerator(const QString& gen);
     QString getGenerator() const;
-    
+
     bool defaultSetup() const;
     bool compilerSetup() const;
     bool crossCompilerSetup() const;
     bool crossCompilerToolChainFile() const;
 
     int nextId() const;
-  
+
   signals:
     void selectionChanged();
 
@@ -56,7 +56,7 @@ class NativeCompilerSetup : public QWizardPage, protected Ui::Compilers
   public:
     NativeCompilerSetup(QWidget* p);
     ~NativeCompilerSetup();
-    
+
     QString getCCompiler() const;
     void setCCompiler(const QString&);
 
@@ -65,7 +65,7 @@ class NativeCompilerSetup : public QWizardPage, protected Ui::Compilers
 
     QString getFortranCompiler() const;
     void setFortranCompiler(const QString&);
-    
+
     int nextId() const { return -1; }
 };
 
@@ -76,13 +76,13 @@ class CrossCompilerSetup : public QWizardPage, protected Ui::CrossCompiler
   public:
     CrossCompilerSetup(QWidget* p);
     ~CrossCompilerSetup();
-    
+
     QString getSystem() const;
     void setSystem(const QString&);
-    
+
     QString getVersion() const;
     void setVersion(const QString&);
-    
+
     QString getProcessor() const;
     void setProcessor(const QString&);
 
@@ -94,7 +94,7 @@ class CrossCompilerSetup : public QWizardPage, protected Ui::CrossCompiler
 
     QString getFortranCompiler() const;
     void setFortranCompiler(const QString&);
-    
+
     QString getFindRoot() const;
     void setFindRoot(const QString&);
 
@@ -104,14 +104,14 @@ class CrossCompilerSetup : public QWizardPage, protected Ui::CrossCompiler
         ONLY,
         NEVER
       };
-  
+
     int getProgramMode() const;
     void setProgramMode(int);
     int getLibraryMode() const;
     void setLibraryMode(int);
     int getIncludeMode() const;
     void setIncludeMode(int);
-    
+
     int nextId() const { return -1; }
 };
 
@@ -127,7 +127,7 @@ class ToolchainCompilerSetup : public QWizardPage
     void setToolchainFile(const QString&);
 
     int nextId() const { return -1; }
-    
+
   protected:
     QCMakeFilePathEditor* ToolchainFile;
 };
@@ -151,7 +151,7 @@ public:
   QString getCCompiler() const;
   QString getCXXCompiler() const;
   QString getFortranCompiler() const;
-  
+
   QString getSystemName() const;
   QString getSystemVersion() const;
   QString getSystemProcessor() const;
@@ -159,7 +159,7 @@ public:
   QString getCrossProgramMode() const;
   QString getCrossLibraryMode() const;
   QString getCrossIncludeMode() const;
-  
+
   QString getCrossCompilerToolChainFile() const;
 
   void loadFromSettings();
diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx
index 8554ff894..a2b1567bf 100644
--- a/Source/QtDialog/QCMake.cxx
+++ b/Source/QtDialog/QCMake.cxx
@@ -32,9 +32,9 @@ QCMake::QCMake(QObject* p)
   this->WarnUnusedMode = false;
   qRegisterMetaType<QCMakeProperty>();
   qRegisterMetaType<QCMakePropertyList>();
-  
+
   QDir execDir(QCoreApplication::applicationDirPath());
-  
+
 #if defined(Q_OS_MAC)
   if(execDir.exists("../bin/cmake"))
     {
@@ -45,7 +45,7 @@ QCMake::QCMake(QObject* p)
     execDir.cd("../../../");  // path to cmake in build directory (need to fix for deployment)
     }
 #endif
-  
+
   QString cmakeCommand = QString("cmake")+QString::fromLocal8Bit(cmSystemTools::GetExecutableExtension());
   cmakeCommand = execDir.filePath(cmakeCommand);
 
@@ -58,7 +58,7 @@ QCMake::QCMake(QObject* p)
   this->CMakeInstance->SetCMakeCommand(cmakeCommand.toLocal8Bit().data());
 #if defined(Q_OS_MAC)
   this->CMakeInstance->SetCMakeEditCommand("cmake-gui.app/Contents/MacOS/cmake-gui");
-#else  
+#else
   this->CMakeInstance->SetCMakeEditCommand("cmake-gui");
 #endif
   this->CMakeInstance->SetProgressCallback(QCMake::progressCallback, this);
@@ -96,7 +96,7 @@ void QCMake::loadCache(const QString& dir)
 
 void QCMake::setSourceDirectory(const QString& _dir)
 {
-  QString dir = 
+  QString dir =
     QString::fromLocal8Bit(cmSystemTools::GetActualCaseForPath(_dir.toLocal8Bit().data()).c_str());
   if(this->SourceDirectory != dir)
     {
@@ -107,7 +107,7 @@ void QCMake::setSourceDirectory(const QString& _dir)
 
 void QCMake::setBinaryDirectory(const QString& _dir)
 {
-  QString dir = 
+  QString dir =
     QString::fromLocal8Bit(cmSystemTools::GetActualCaseForPath(_dir.toLocal8Bit().data()).c_str());
   if(this->BinaryDirectory != dir)
     {
@@ -126,7 +126,7 @@ void QCMake::setBinaryDirectory(const QString& _dir)
             "Please check the permissions of the directory you are trying to run CMake on.");
         }
       }
-    
+
     QCMakePropertyList props = this->properties();
     emit this->propertiesChanged(props);
     cmCacheManager::CacheIterator itm = cachem->NewIterator();
@@ -202,7 +202,7 @@ void QCMake::generate()
 
   emit this->generateDone(err);
 }
-  
+
 void QCMake::setProperties(const QCMakePropertyList& newProps)
 {
   QCMakePropertyList props = newProps;
@@ -251,7 +251,7 @@ void QCMake::setProperties(const QCMakePropertyList& newProps)
 
     cachem->RemoveCacheEntry(s.toLocal8Bit().data());
     }
-  
+
   // add some new properites
   foreach(QCMakeProperty s, props)
     {
@@ -286,7 +286,7 @@ void QCMake::setProperties(const QCMakePropertyList& newProps)
                             cmCacheManager::FILEPATH);
       }
     }
-  
+
   cachem->SaveCache(this->BinaryDirectory.toLocal8Bit().data());
 }
 
@@ -339,7 +339,7 @@ QCMakePropertyList QCMake::properties() const
 
   return ret;
 }
-  
+
 void QCMake::interrupt()
 {
   this->InterruptFlag.ref();
@@ -416,7 +416,7 @@ void QCMake::reloadCache()
   props = this->properties();
   emit this->propertiesChanged(props);
 }
-  
+
 void QCMake::setDebugOutput(bool flag)
 {
   if(flag != this->CMakeInstance->GetDebugOutput())
diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h
index 0d68586f2..93ac8ab00 100644
--- a/Source/QtDialog/QCMake.h
+++ b/Source/QtDialog/QCMake.h
@@ -38,12 +38,12 @@ struct QCMakeProperty
   QString Help;
   PropertyType Type;
   bool Advanced;
-  bool operator==(const QCMakeProperty& other) const 
-    { 
+  bool operator==(const QCMakeProperty& other) const
+    {
     return this->Key == other.Key;
     }
-  bool operator<(const QCMakeProperty& other) const 
-    { 
+  bool operator<(const QCMakeProperty& other) const
+    {
     return this->Key < other.Key;
     }
 };
@@ -56,7 +56,7 @@ Q_DECLARE_METATYPE(QCMakeProperty)
 Q_DECLARE_METATYPE(QCMakePropertyList)
 
 /// Qt API for CMake library.
-/// Wrapper like class allows for easier integration with 
+/// Wrapper like class allows for easier integration with
 /// Qt features such as, signal/slot connections, multi-threading, etc..
 class QCMake : public QObject
 {
@@ -136,7 +136,7 @@ protected:
 
   static bool interruptCallback(void*);
   static void progressCallback(const char* msg, float percent, void* cd);
-  static void errorCallback(const char* msg, const char* title, 
+  static void errorCallback(const char* msg, const char* title,
                             bool&, void* cd);
   bool SuppressDevWarnings;
   bool WarnUninitializedMode;
diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx
index 72e9b2464..1d21d421d 100644
--- a/Source/QtDialog/QCMakeCacheView.cxx
+++ b/Source/QtDialog/QCMakeCacheView.cxx
@@ -64,7 +64,7 @@ protected:
         return true;
         }
       }
-    
+
     return false;
     }
 };
@@ -73,11 +73,11 @@ protected:
 class QCMakeAdvancedFilter : public QSortFilterProxyModel
 {
 public:
-  QCMakeAdvancedFilter(QObject* o) 
+  QCMakeAdvancedFilter(QObject* o)
     : QSortFilterProxyModel(o), ShowAdvanced(false) {}
 
-  void setShowAdvanced(bool f) 
-  { 
+  void setShowAdvanced(bool f)
+  {
     this->ShowAdvanced = f;
     this->invalidate();
   }
@@ -102,7 +102,7 @@ protected:
         }
       return false;
       }
-    
+
     // check children
     int num = m->rowCount(idx);
     for(int i=0; i<num; i++)
@@ -134,9 +134,9 @@ QCMakeCacheView::QCMakeCacheView(QWidget* p)
   // our delegate for creating our editors
   QCMakeCacheModelDelegate* delegate = new QCMakeCacheModelDelegate(this);
   this->setItemDelegate(delegate);
-  
+
   this->setUniformRowHeights(true);
- 
+
   this->setEditTriggers(QAbstractItemView::AllEditTriggers);
 
   // tab, backtab doesn't step through items
@@ -153,13 +153,13 @@ bool QCMakeCacheView::event(QEvent* e)
     }
   return QTreeView::event(e);
 }
-  
+
 QCMakeCacheModel* QCMakeCacheView::cacheModel() const
 {
   return this->CacheModel;
 }
- 
-QModelIndex QCMakeCacheView::moveCursor(CursorAction act, 
+
+QModelIndex QCMakeCacheView::moveCursor(CursorAction act,
   Qt::KeyboardModifiers mod)
 {
   // want home/end to go to begin/end of rows, not columns
@@ -173,7 +173,7 @@ QModelIndex QCMakeCacheView::moveCursor(CursorAction act,
     }
   return QTreeView::moveCursor(act, mod);
 }
-  
+
 void QCMakeCacheView::setShowAdvanced(bool s)
 {
 #if QT_VERSION >= 040300
@@ -224,7 +224,7 @@ void QCMakeCacheModel::clear()
 {
   this->QStandardItemModel::clear();
   this->NewPropertyCount = 0;
-  
+
   QStringList labels;
   labels << tr("Name") << tr("Value");
   this->setHorizontalHeaderLabels(labels);
@@ -281,7 +281,7 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
     this->breakProperties(newProps2, newPropsTree2);
 
     QStandardItem* root = this->invisibleRootItem();
-    
+
     foreach(QString key, newPropsTree.keys())
       {
       QCMakePropertyList props2 = newPropsTree[key];
@@ -308,12 +308,12 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
         this->setPropertyData(this->indexFromItem(items[0]), prop, true);
         }
       }
-    
+
     foreach(QString key, newPropsTree2.keys())
       {
       QCMakePropertyList props2 = newPropsTree2[key];
 
-      QStandardItem* parentItem = 
+      QStandardItem* parentItem =
         new QStandardItem(key.isEmpty() ? tr("Ungrouped Entries") : key);
       root->appendRow(parentItem);
       parentItem->setData(1, GroupRole);
@@ -330,7 +330,7 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
         }
       }
   }
-  
+
   this->blockSignals(b);
   this->reset();
 }
@@ -361,7 +361,7 @@ void QCMakeCacheModel::setViewType(QCMakeCacheModel::ViewType t)
   this->reset();
 }
 
-void QCMakeCacheModel::setPropertyData(const QModelIndex& idx1, 
+void QCMakeCacheModel::setPropertyData(const QModelIndex& idx1,
     const QCMakeProperty& prop, bool isNew)
 {
   QModelIndex idx2 = idx1.sibling(idx1.row(), 1);
@@ -370,7 +370,7 @@ void QCMakeCacheModel::setPropertyData(const QModelIndex& idx1,
   this->setData(idx1, prop.Help, QCMakeCacheModel::HelpRole);
   this->setData(idx1, prop.Type, QCMakeCacheModel::TypeRole);
   this->setData(idx1, prop.Advanced, QCMakeCacheModel::AdvancedRole);
-  
+
   if(prop.Type == QCMakeProperty::BOOL)
   {
     int check = prop.Value.toBool() ? Qt::Checked : Qt::Unchecked;
@@ -394,7 +394,7 @@ void QCMakeCacheModel::setPropertyData(const QModelIndex& idx1,
   }
 }
 
-void QCMakeCacheModel::getPropertyData(const QModelIndex& idx1, 
+void QCMakeCacheModel::getPropertyData(const QModelIndex& idx1,
     QCMakeProperty& prop) const
 {
   QModelIndex idx2 = idx1.sibling(idx1.row(), 1);
@@ -457,7 +457,7 @@ void QCMakeCacheModel::breakProperties(const QSet<QCMakeProperty>& props,
     }
   result = tmp;
 }
-  
+
 QCMakePropertyList QCMakeCacheModel::properties() const
 {
   QCMakePropertyList props;
@@ -488,7 +488,7 @@ QCMakePropertyList QCMakeCacheModel::properties() const
         this->getPropertyData(idx, prop);
         props.append(prop);
       }
-      
+
       // go to the next in the tree
       while(!idxs.isEmpty() && !idxs.last().sibling(idxs.last().row()+1, 0).isValid())
       {
@@ -503,7 +503,7 @@ QCMakePropertyList QCMakeCacheModel::properties() const
 
   return props;
 }
-  
+
 bool QCMakeCacheModel::insertProperty(QCMakeProperty::PropertyType t,
                       const QString& name, const QString& description,
                       const QVariant& value, bool advanced)
@@ -554,7 +554,7 @@ Qt::ItemFlags QCMakeCacheModel::flags (const QModelIndex& idx) const
 
 QModelIndex QCMakeCacheModel::buddy(const QModelIndex& idx) const
 {
-  if(!this->hasChildren(idx) && 
+  if(!this->hasChildren(idx) &&
      this->data(idx, TypeRole).toInt() != QCMakeProperty::BOOL)
   {
     return this->index(idx.row(), 1, idx.parent());
@@ -572,7 +572,7 @@ void QCMakeCacheModelDelegate::setFileDialogFlag(bool f)
   this->FileDialogFlag = f;
 }
 
-QWidget* QCMakeCacheModelDelegate::createEditor(QWidget* p, 
+QWidget* QCMakeCacheModelDelegate::createEditor(QWidget* p,
     const QStyleOptionViewItem&, const QModelIndex& idx) const
 {
   QModelIndex var = idx.sibling(idx.row(), 0);
@@ -584,7 +584,7 @@ QWidget* QCMakeCacheModelDelegate::createEditor(QWidget* p,
   else if(type == QCMakeProperty::PATH)
     {
     QCMakePathEditor* editor =
-      new QCMakePathEditor(p, 
+      new QCMakePathEditor(p,
       var.data(Qt::DisplayRole).toString());
     QObject::connect(editor, SIGNAL(fileDialogExists(bool)), this,
         SLOT(setFileDialogFlag(bool)));
@@ -593,7 +593,7 @@ QWidget* QCMakeCacheModelDelegate::createEditor(QWidget* p,
   else if(type == QCMakeProperty::FILEPATH)
     {
     QCMakeFilePathEditor* editor =
-      new QCMakeFilePathEditor(p, 
+      new QCMakeFilePathEditor(p,
       var.data(Qt::DisplayRole).toString());
     QObject::connect(editor, SIGNAL(fileDialogExists(bool)), this,
         SLOT(setFileDialogFlag(bool)));
@@ -602,7 +602,7 @@ QWidget* QCMakeCacheModelDelegate::createEditor(QWidget* p,
   else if(type == QCMakeProperty::STRING &&
           var.data(QCMakeCacheModel::StringsRole).isValid())
     {
-    QCMakeComboBox* editor = 
+    QCMakeComboBox* editor =
       new QCMakeComboBox(p, var.data(QCMakeCacheModel::StringsRole).toStringList());
     editor->setFrame(false);
     return editor;
@@ -613,7 +613,7 @@ QWidget* QCMakeCacheModelDelegate::createEditor(QWidget* p,
   return editor;
 }
 
-bool QCMakeCacheModelDelegate::editorEvent(QEvent* e, QAbstractItemModel* model, 
+bool QCMakeCacheModelDelegate::editorEvent(QEvent* e, QAbstractItemModel* model,
        const QStyleOptionViewItem& option, const QModelIndex& index)
 {
   Qt::ItemFlags flags = model->flags(index);
@@ -637,7 +637,7 @@ bool QCMakeCacheModelDelegate::editorEvent(QEvent* e, QAbstractItemModel* model,
       {
       return true;
       }
-    } 
+    }
   else if (e->type() == QEvent::KeyPress)
     {
     if(static_cast<QKeyEvent*>(e)->key() != Qt::Key_Space &&
@@ -645,8 +645,8 @@ bool QCMakeCacheModelDelegate::editorEvent(QEvent* e, QAbstractItemModel* model,
       {
       return false;
       }
-    } 
-  else 
+    }
+  else
     {
     return false;
     }
@@ -660,7 +660,7 @@ bool QCMakeCacheModelDelegate::editorEvent(QEvent* e, QAbstractItemModel* model,
     }
   return success;
 }
-  
+
 // Issue 205903 fixed in Qt 4.5.0.
 // Can remove this function and FileDialogFlag when minimum Qt version is 4.5
 bool QCMakeCacheModelDelegate::eventFilter(QObject* object, QEvent* evt)
@@ -682,7 +682,7 @@ void QCMakeCacheModelDelegate::setModelData(QWidget* editor,
   QItemDelegate::setModelData(editor, model, index);
   const_cast<QCMakeCacheModelDelegate*>(this)->recordChange(model, index);
 }
-  
+
 QSize QCMakeCacheModelDelegate::sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const
 {
   QSize sz = QItemDelegate::sizeHint(option, index);
@@ -695,7 +695,7 @@ QSize QCMakeCacheModelDelegate::sizeHint(const QStyleOptionViewItem& option, con
 
   return sz;
 }
-  
+
 QSet<QCMakeProperty> QCMakeCacheModelDelegate::changes() const
 {
   return mChanges;
@@ -721,7 +721,7 @@ void QCMakeCacheModelDelegate::recordChange(QAbstractItemModel* model, const QMo
     QCMakeProperty prop;
     idx = idx.sibling(idx.row(), 0);
     cache_model->getPropertyData(idx, prop);
-    
+
     // clean out an old one
     QSet<QCMakeProperty>::iterator iter = mChanges.find(prop);
     if(iter != mChanges.end())
diff --git a/Source/QtDialog/QCMakeCacheView.h b/Source/QtDialog/QCMakeCacheView.h
index 0a628b90a..41f0bd87c 100644
--- a/Source/QtDialog/QCMakeCacheView.h
+++ b/Source/QtDialog/QCMakeCacheView.h
@@ -33,7 +33,7 @@ public:
   // retrieve the QCMakeCacheModel storing all the pointers
   // this isn't necessarily the model one would get from model()
   QCMakeCacheModel* cacheModel() const;
-  
+
   // get whether to show advanced entries
   bool showAdvanced() const;
 
@@ -65,7 +65,7 @@ public:
   // roles used to retrieve extra data such has help strings, types of
   // properties, and the advanced flag
   enum { HelpRole = Qt::ToolTipRole,
-         TypeRole = Qt::UserRole, 
+         TypeRole = Qt::UserRole,
          AdvancedRole,
          StringsRole,
          GroupRole
@@ -102,7 +102,7 @@ public slots:
 public:
   // get the properties
   QCMakePropertyList properties() const;
-  
+
   // editing enabled
   bool editEnabled() const;
 
@@ -112,7 +112,7 @@ public:
   // return flags (overloaded to modify flag based on EditEnabled flag)
   Qt::ItemFlags flags (const QModelIndex& index) const;
   QModelIndex buddy(const QModelIndex& idx) const;
-  
+
   // get the data in the model for this property
   void getPropertyData(const QModelIndex& idx1,
                        QCMakeProperty& prop) const;
@@ -124,20 +124,20 @@ protected:
   ViewType View;
 
   // set the data in the model for this property
-  void setPropertyData(const QModelIndex& idx1, 
+  void setPropertyData(const QModelIndex& idx1,
                        const QCMakeProperty& p, bool isNew);
 
   // breaks up he property list into groups
   // where each group has the same prefix up to the first underscore
   static void breakProperties(const QSet<QCMakeProperty>& props,
                        QMap<QString, QCMakePropertyList>& result);
-  
+
   // gets the prefix of a string up to the first _
   static QString prefix(const QString& s);
 
 };
 
-/// Qt delegate class for interaction (or other customization) 
+/// Qt delegate class for interaction (or other customization)
 /// with cache properties
 class QCMakeCacheModelDelegate : public QItemDelegate
 {
@@ -145,9 +145,9 @@ class QCMakeCacheModelDelegate : public QItemDelegate
 public:
   QCMakeCacheModelDelegate(QObject* p);
   /// create our own editors for cache properties
-  QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, 
+  QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option,
       const QModelIndex& index ) const;
-  bool editorEvent (QEvent* event, QAbstractItemModel* model, 
+  bool editorEvent (QEvent* event, QAbstractItemModel* model,
        const QStyleOptionViewItem& option, const QModelIndex& index);
   bool eventFilter(QObject* object, QEvent* event);
   void setModelData(QWidget * editor, QAbstractItemModel * model, const QModelIndex & index ) const;
diff --git a/Source/QtDialog/QCMakeWidgets.cxx b/Source/QtDialog/QCMakeWidgets.cxx
index 144e1f32e..a0c5e17fe 100644
--- a/Source/QtDialog/QCMakeWidgets.cxx
+++ b/Source/QtDialog/QCMakeWidgets.cxx
@@ -69,7 +69,7 @@ void QCMakeFilePathEditor::chooseFile()
   this->fileDialogExists(true);
   path = QFileDialog::getOpenFileName(this, title, info.absolutePath());
   this->fileDialogExists(false);
-  
+
   if(!path.isEmpty())
     {
     this->setText(QDir::fromNativeSeparators(path));
diff --git a/Source/QtDialog/QMacInstallDialog.cxx b/Source/QtDialog/QMacInstallDialog.cxx
index 6eb053b21..8b8c5319f 100644
--- a/Source/QtDialog/QMacInstallDialog.cxx
+++ b/Source/QtDialog/QMacInstallDialog.cxx
@@ -15,11 +15,11 @@ QMacInstallDialog::QMacInstallDialog(QWidget*w)
 {
   this->Internals = new QMacInstallDialogInternals;
   this->Internals->setupUi(this);
-  QObject::connect(this->Internals->choosePathButton, SIGNAL(pressed()), 
+  QObject::connect(this->Internals->choosePathButton, SIGNAL(pressed()),
                    this, SLOT(ShowBrowser()));
-  QObject::connect(this->Internals->skipInstallButton, SIGNAL(pressed()), 
+  QObject::connect(this->Internals->skipInstallButton, SIGNAL(pressed()),
                    this, SLOT(SkipInstall()));
-  QObject::connect(this->Internals->doInstallButton, SIGNAL(pressed()), 
+  QObject::connect(this->Internals->doInstallButton, SIGNAL(pressed()),
                    this, SLOT(DoInstall()));
   this->Internals->InstallPrefix->setText("/usr/bin/");
 
@@ -31,7 +31,7 @@ QMacInstallDialog::~QMacInstallDialog()
 }
 
 void QMacInstallDialog::DoInstall()
-{  
+{
   QDir installDir(this->Internals->InstallPrefix->text());
   QString installTo = installDir.path();
   if(!cmSystemTools::FileExists(installTo.toLocal8Bit().data()))
@@ -42,7 +42,7 @@ void QMacInstallDialog::DoInstall()
     message += installDir.path();
     QString title = tr("Create Directory");
     QMessageBox::StandardButton btn;
-    btn = QMessageBox::information(this, title, message, 
+    btn = QMessageBox::information(this, title, message,
                                    QMessageBox::Yes | QMessageBox::No);
     if(btn == QMessageBox::Yes)
       {
@@ -52,7 +52,7 @@ void QMacInstallDialog::DoInstall()
   QDir cmExecDir(QApplication::applicationDirPath());
   cmExecDir.cd("../bin");
   QFileInfoList list = cmExecDir.entryInfoList();
-  for (int i = 0; i < list.size(); ++i) 
+  for (int i = 0; i < list.size(); ++i)
     {
     QFileInfo fileInfo = list.at(i);
     QString filename = fileInfo.fileName();
@@ -75,7 +75,7 @@ void QMacInstallDialog::DoInstall()
         message += newName;
         QString title = tr("Error Removing file");
         QMessageBox::StandardButton btn =
-          QMessageBox::critical(this, title, message, 
+          QMessageBox::critical(this, title, message,
                                 QMessageBox::Ok|QMessageBox::Abort);
         if(btn == QMessageBox::Abort)
           {
@@ -93,7 +93,7 @@ void QMacInstallDialog::DoInstall()
       message += newName;
       QString title = tr("Error Creating Symlink");
       QMessageBox::StandardButton btn =
-        QMessageBox::critical(this, title, message, 
+        QMessageBox::critical(this, title, message,
                               QMessageBox::Ok|QMessageBox::Abort);
       if(btn == QMessageBox::Abort)
         {
@@ -112,7 +112,7 @@ void QMacInstallDialog::SkipInstall()
 
 void QMacInstallDialog::ShowBrowser()
 {
-  QString dir = QFileDialog::getExistingDirectory(this, 
+  QString dir = QFileDialog::getExistingDirectory(this,
     tr("Enter Install Prefix"), this->Internals->InstallPrefix->text());
   if(!dir.isEmpty())
     {
diff --git a/Source/QtDialog/QtDialogCPack.cmake.in b/Source/QtDialog/QtDialogCPack.cmake.in
index 701991b7a..e73e23f22 100644
--- a/Source/QtDialog/QtDialogCPack.cmake.in
+++ b/Source/QtDialog/QtDialogCPack.cmake.in
@@ -2,7 +2,7 @@ SET(IS_APPLE @APPLE@)
 SET(CMAKE_PACKAGE_QTGUI @CMAKE_PACKAGE_QTGUI@)
 
 IF(CMAKE_PACKAGE_QTGUI)
-  SET(CPACK_PACKAGE_EXECUTABLES "cmake-gui" "CMake (cmake-gui)" ${CPACK_PACKAGE_EXECUTABLES}) 
+  SET(CPACK_PACKAGE_EXECUTABLES "cmake-gui" "CMake (cmake-gui)" ${CPACK_PACKAGE_EXECUTABLES})
   SET(CPACK_CREATE_DESKTOP_LINKS "cmake-gui" ${CPACK_CREATE_DESKTOP_LINKS})
   IF(IS_APPLE)
     # for apple install we set the install prefix to
diff --git a/Source/cmAddCustomCommandCommand.h b/Source/cmAddCustomCommandCommand.h
index 1f770ed39..c5252b794 100644
--- a/Source/cmAddCustomCommandCommand.h
+++ b/Source/cmAddCustomCommandCommand.h
@@ -16,7 +16,7 @@
 #include "cmDocumentGeneratorExpressions.h"
 
 /** \class cmAddCustomCommandCommand
- * \brief 
+ * \brief
  *
  *  cmAddCustomCommandCommand defines a new command (rule) that can
  *  be executed within the build process
@@ -29,7 +29,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmAddCustomCommandCommand;
     }
@@ -45,7 +45,7 @@ public:
    * The name of the command as specified in CMakeList.txt.
    */
   virtual const char* GetName() const {return "add_custom_command";}
-  
+
   /**
    * Succinct documentation.
    */
@@ -53,7 +53,7 @@ public:
     {
     return "Add a custom build rule to the generated build system.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -177,7 +177,7 @@ public:
       "is recompiled.\n"
       ;
     }
-  
+
   cmTypeMacro(cmAddCustomCommandCommand, cmCommand);
 protected:
   bool CheckOutputs(const std::vector<std::string>& outputs);
diff --git a/Source/cmAddCustomTargetCommand.h b/Source/cmAddCustomTargetCommand.h
index 50bffefde..d4ed450f0 100644
--- a/Source/cmAddCustomTargetCommand.h
+++ b/Source/cmAddCustomTargetCommand.h
@@ -27,7 +27,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmAddCustomTargetCommand;
     }
@@ -38,13 +38,13 @@ public:
    */
   virtual bool InitialPass(std::vector<std::string> const& args,
                            cmExecutionStatus &status);
-  
+
   /**
    * The name of the command as specified in CMakeList.txt.
    */
   virtual const char* GetName() const
     {return "add_custom_target";}
-  
+
   /**
    * Succinct documentation.
    */
@@ -52,7 +52,7 @@ public:
     {
     return "Add a target with no output so it will always be built.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -101,7 +101,7 @@ public:
       "convenience in editing even if they have not build rules."
       ;
     }
-  
+
   cmTypeMacro(cmAddCustomTargetCommand, cmCommand);
 };
 
diff --git a/Source/cmAddDependenciesCommand.h b/Source/cmAddDependenciesCommand.h
index 14a7741fa..ed8006765 100644
--- a/Source/cmAddDependenciesCommand.h
+++ b/Source/cmAddDependenciesCommand.h
@@ -25,7 +25,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmAddDependenciesCommand;
     }
@@ -49,7 +49,7 @@ public:
     {
     return "Add a dependency between top-level targets.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -70,7 +70,7 @@ public:
       "SET_SOURCE_FILES_PROPERTIES to add file-level dependencies to object "
       "files.";
     }
-  
+
   cmTypeMacro(cmAddDependenciesCommand, cmCommand);
 };
 
diff --git a/Source/cmAddLibraryCommand.h b/Source/cmAddLibraryCommand.h
index b1ae20289..b330e68c8 100644
--- a/Source/cmAddLibraryCommand.h
+++ b/Source/cmAddLibraryCommand.h
@@ -26,7 +26,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmAddLibraryCommand;
     }
@@ -50,7 +50,7 @@ public:
     {
     return "Add a library to the project using the specified source files.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -134,7 +134,7 @@ public:
       "Object libraries cannot be imported, exported, installed, or linked."
       ;
     }
-  
+
   cmTypeMacro(cmAddLibraryCommand, cmCommand);
 };
 
diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx
index 5fca527ca..9efeda48f 100644
--- a/Source/cmAddSubDirectoryCommand.cxx
+++ b/Source/cmAddSubDirectoryCommand.cxx
@@ -20,11 +20,11 @@ bool cmAddSubDirectoryCommand::InitialPass
     this->SetError("called with incorrect number of arguments");
     return false;
     }
-  
+
   // store the binpath
   std::string srcArg = args[0];
   std::string binArg;
-  
+
   bool excludeFromAll = false;
 
   // process the rest of the arguments looking for optional args
diff --git a/Source/cmAddSubDirectoryCommand.h b/Source/cmAddSubDirectoryCommand.h
index 3d6f51ea5..fa322b0c4 100644
--- a/Source/cmAddSubDirectoryCommand.h
+++ b/Source/cmAddSubDirectoryCommand.h
@@ -27,7 +27,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmAddSubDirectoryCommand;
     }
@@ -51,7 +51,7 @@ public:
     {
     return "Add a subdirectory to the build.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -90,7 +90,7 @@ public:
       "project build system to satisfy the dependency."
       ;
     }
-  
+
   cmTypeMacro(cmAddSubDirectoryCommand, cmCommand);
 };
 
diff --git a/Source/cmAddTestCommand.h b/Source/cmAddTestCommand.h
index 59f10f622..b11bff967 100644
--- a/Source/cmAddTestCommand.h
+++ b/Source/cmAddTestCommand.h
@@ -26,7 +26,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmAddTestCommand;
     }
@@ -50,7 +50,7 @@ public:
     {
     return "Add a test to the project with the specified arguments.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -91,7 +91,7 @@ public:
       "executable file produced by target \"myexe\"."
       ;
     }
-  
+
   cmTypeMacro(cmAddTestCommand, cmCommand);
 private:
   bool HandleNameMode(std::vector<std::string> const& args);
diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx
index f88be3d58..01f64b730 100644
--- a/Source/cmAuxSourceDirectoryCommand.cxx
+++ b/Source/cmAuxSourceDirectoryCommand.cxx
@@ -23,7 +23,7 @@ bool cmAuxSourceDirectoryCommand::InitialPass
     this->SetError("called with incorrect number of arguments");
     return false;
     }
-  
+
   std::string sourceListValue;
   std::string templateDirectory = args[0];
   this->Makefile->AddExtraDirectory(templateDirectory.c_str());
@@ -40,12 +40,12 @@ bool cmAuxSourceDirectoryCommand::InitialPass
     }
 
   // was the list already populated
-  const char *def = this->Makefile->GetDefinition(args[1].c_str());  
+  const char *def = this->Makefile->GetDefinition(args[1].c_str());
   if (def)
     {
     sourceListValue = def;
     }
-  
+
   // Load all the files in the directory
   cmsys::Directory dir;
   if(dir.Load(tdir.c_str()))
@@ -69,7 +69,7 @@ bool cmAuxSourceDirectoryCommand::InitialPass
           std::string fullname = templateDirectory;
           fullname += "/";
           fullname += file;
-          // add the file as a class file so 
+          // add the file as a class file so
           // depends can be done
           cmSourceFile* sf =
             this->Makefile->GetOrCreateSource(fullname.c_str());
@@ -83,7 +83,7 @@ bool cmAuxSourceDirectoryCommand::InitialPass
         }
       }
     }
-  this->Makefile->AddDefinition(args[1].c_str(), sourceListValue.c_str());  
+  this->Makefile->AddDefinition(args[1].c_str(), sourceListValue.c_str());
   return true;
 }
 
diff --git a/Source/cmAuxSourceDirectoryCommand.h b/Source/cmAuxSourceDirectoryCommand.h
index f059e4473..8a70f19cb 100644
--- a/Source/cmAuxSourceDirectoryCommand.h
+++ b/Source/cmAuxSourceDirectoryCommand.h
@@ -29,7 +29,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmAuxSourceDirectoryCommand;
     }
@@ -45,7 +45,7 @@ public:
    * The name of the command as specified in CMakeList.txt.
    */
   virtual const char* GetName() const { return "aux_source_directory";}
-  
+
   /**
    * Succinct documentation.
    */
@@ -53,7 +53,7 @@ public:
     {
     return "Find all source files in a directory.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -77,7 +77,7 @@ public:
       "one would have to manually rerun CMake to generate a build system "
       "incorporating the new file.";
     }
-  
+
   cmTypeMacro(cmAuxSourceDirectoryCommand, cmCommand);
 };
 
diff --git a/Source/cmBreakCommand.h b/Source/cmBreakCommand.h
index 67ef37e9a..17f57cfa1 100644
--- a/Source/cmBreakCommand.h
+++ b/Source/cmBreakCommand.h
@@ -25,7 +25,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmBreakCommand;
     }
@@ -46,7 +46,7 @@ public:
    * The name of the command as specified in CMakeList.txt.
    */
   virtual const char* GetName() const {return "break";}
-  
+
   /**
    * Succinct documentation.
    */
@@ -54,7 +54,7 @@ public:
     {
     return "Break from an enclosing foreach or while loop.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -64,7 +64,7 @@ public:
       "  break()\n"
       "Breaks from an enclosing foreach loop or while loop";
     }
-  
+
   cmTypeMacro(cmBreakCommand, cmCommand);
 };
 
diff --git a/Source/cmBuildCommand.h b/Source/cmBuildCommand.h
index a333c5d95..1bab4536e 100644
--- a/Source/cmBuildCommand.h
+++ b/Source/cmBuildCommand.h
@@ -25,7 +25,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmBuildCommand;
     }
diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx
index fa698303c..f95a79eda 100644
--- a/Source/cmBuildNameCommand.cxx
+++ b/Source/cmBuildNameCommand.cxx
@@ -25,7 +25,7 @@ bool cmBuildNameCommand
   const char* cacheValue = this->Makefile->GetDefinition(args[0].c_str());
   if(cacheValue)
     {
-    // do we need to correct the value? 
+    // do we need to correct the value?
     cmsys::RegularExpression reg("[()/]");
     if (reg.find(cacheValue))
       {
@@ -41,7 +41,7 @@ bool cmBuildNameCommand
     return true;
     }
 
-  
+
   std::string buildname = "WinNT";
   if(this->Makefile->GetDefinition("UNIX"))
     {
@@ -67,7 +67,7 @@ bool cmBuildNameCommand
                                "(", "_");
   cmSystemTools::ReplaceString(buildname,
                                ")", "_");
-  
+
   this->Makefile->AddCacheDefinition(args[0].c_str(),
                                  buildname.c_str(),
                                  "Name of build.",
diff --git a/Source/cmCMakeMinimumRequired.cxx b/Source/cmCMakeMinimumRequired.cxx
index 126934ceb..49c585fba 100644
--- a/Source/cmCMakeMinimumRequired.cxx
+++ b/Source/cmCMakeMinimumRequired.cxx
@@ -120,7 +120,7 @@ bool cmCMakeMinimumRequired
   {
     this->Makefile->SetPolicyVersion(version_string.c_str());
   }
-  
+
   return true;
 }
 
diff --git a/Source/cmCMakeMinimumRequired.h b/Source/cmCMakeMinimumRequired.h
index d23ce79cf..acf28298b 100644
--- a/Source/cmCMakeMinimumRequired.h
+++ b/Source/cmCMakeMinimumRequired.h
@@ -25,7 +25,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmCMakeMinimumRequired;
     }
@@ -46,7 +46,7 @@ public:
    * The name of the command as specified in CMakeList.txt.
    */
   virtual const char* GetName() const {return "cmake_minimum_required";}
-  
+
   /**
    * Succinct documentation.
    */
@@ -54,7 +54,7 @@ public:
     {
     return "Set the minimum required version of cmake for a project.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -77,7 +77,7 @@ public:
       "It should be specified so CMake versions 2.4 and lower fail with an "
       "error instead of just a warning.";
     }
-  
+
   cmTypeMacro(cmCMakeMinimumRequired, cmCommand);
 
 private:
diff --git a/Source/cmCMakePolicyCommand.h b/Source/cmCMakePolicyCommand.h
index 4f1ed36ad..4f9faa168 100644
--- a/Source/cmCMakePolicyCommand.h
+++ b/Source/cmCMakePolicyCommand.h
@@ -17,8 +17,8 @@
 /** \class cmCMakePolicyCommand
  * \brief Set how CMake should handle policies
  *
- * cmCMakePolicyCommand sets how CMake should deal with backwards 
- * compatibility policies.   
+ * cmCMakePolicyCommand sets how CMake should deal with backwards
+ * compatibility policies.
  */
 class cmCMakePolicyCommand : public cmCommand
 {
@@ -26,7 +26,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmCMakePolicyCommand;
     }
@@ -47,7 +47,7 @@ public:
    * The name of the command as specified in CMakeList.txt.
    */
   virtual const char* GetName() const {return "cmake_policy";}
-  
+
  /**
    * Succinct documentation.
    */
@@ -55,7 +55,7 @@ public:
     {
     return "Manage CMake Policy settings.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -129,7 +129,7 @@ public:
       "closest nested policy stack entry."
       ;
     }
-  
+
   cmTypeMacro(cmCMakePolicyCommand, cmCommand);
 private:
   bool HandleSetMode(std::vector<std::string> const& args);
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
index e23791355..48ae50e42 100644
--- a/Source/cmCPluginAPI.cxx
+++ b/Source/cmCPluginAPI.cxx
@@ -389,7 +389,7 @@ void CCONV cmAddLibrary(void *arg, const char *libname, int shared,
     {
     srcs2.push_back(srcs[i]);
     }
-  mf->AddLibrary(libname, 
+  mf->AddLibrary(libname,
                  (shared? cmTarget::SHARED_LIBRARY : cmTarget::STATIC_LIBRARY),
                   srcs2);
 }
@@ -859,13 +859,13 @@ void CCONV cmFree(void *data)
 }
 
 void CCONV DefineSourceFileProperty (void *arg, const char *name,
-  const char *briefDocs, 
+  const char *briefDocs,
   const char *longDocs,
   int chained)
 {
   cmMakefile *mf = static_cast<cmMakefile *>(arg);
   mf->GetCMakeInstance()->DefineProperty(name,cmProperty::SOURCE_FILE,
-                                         briefDocs, longDocs, 
+                                         briefDocs, longDocs,
                                          chained != 0);
 }
 
diff --git a/Source/cmCPluginAPI.h b/Source/cmCPluginAPI.h
index fd5a4f819..5c832c30e 100644
--- a/Source/cmCPluginAPI.h
+++ b/Source/cmCPluginAPI.h
@@ -168,10 +168,10 @@ typedef struct
   /* new functions added after 2.4 */
   void *(CCONV *CreateNewSourceFile) (void *mf);
   void (CCONV *DefineSourceFileProperty) (void *mf, const char *name,
-                                          const char *briefDocs, 
+                                          const char *briefDocs,
                                           const char *longDocs,
                                           int chained);
-  
+
   /* this is the end of the C function stub API structure */
 } cmCAPI;
 
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index b5687e39a..a6d04b70d 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -75,8 +75,8 @@ struct tm* cmCTest::GetNightlyTime(std::string str,
   char buf[1024];
   // add todays year day and month to the time in str because
   // curl_getdate no longer assumes the day is today
-  sprintf(buf, "%d%02d%02d %s", 
-          lctime->tm_year+1900, 
+  sprintf(buf, "%d%02d%02d %s",
+          lctime->tm_year+1900,
           lctime->tm_mon +1,
           lctime->tm_mday,
           str.c_str());
@@ -223,7 +223,7 @@ int cmCTest::HTTPRequest(std::string url, HTTPMethod method,
     default:
       break;
     }
-  
+
   ::curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
   ::curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout);
   ::curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
@@ -237,7 +237,7 @@ int cmCTest::HTTPRequest(std::string url, HTTPMethod method,
 
   ::curl_easy_cleanup(curl);
   ::curl_global_cleanup();
-  
+
   return static_cast<int>(res);
 }
 #endif
@@ -300,7 +300,7 @@ cmCTest::cmCTest()
   this->ForceNewCTestProcess   = false;
   this->TomorrowTag            = false;
   this->Verbose                = false;
-  
+
   this->Debug                  = false;
   this->ShowLineNumbers        = false;
   this->Quiet                  = false;
@@ -760,7 +760,7 @@ bool cmCTest::UpdateCTestConfiguration()
     }
   else
     {
-    cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Parse Config file:" 
+    cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Parse Config file:"
                << fileName.c_str() << "\n");
     // parse the dart test file
     std::ifstream fin(fileName.c_str());
@@ -944,7 +944,7 @@ bool cmCTest::AddIfExists(Part part, const char* file)
 //----------------------------------------------------------------------
 bool cmCTest::CTestFileExists(const std::string& filename)
 {
-  std::string testingDir = this->BinaryDir + "/Testing/" + 
+  std::string testingDir = this->BinaryDir + "/Testing/" +
     this->CurrentTag + "/" + filename;
   return cmSystemTools::FileExists(testingDir.c_str());
 }
@@ -952,7 +952,7 @@ bool cmCTest::CTestFileExists(const std::string& filename)
 //----------------------------------------------------------------------
 cmCTestGenericHandler* cmCTest::GetInitializedHandler(const char* handler)
 {
-  cmCTest::t_TestingHandlers::iterator it = 
+  cmCTest::t_TestingHandlers::iterator it =
     this->TestingHandlers.find(handler);
   if ( it == this->TestingHandlers.end() )
     {
@@ -965,7 +965,7 @@ cmCTestGenericHandler* cmCTest::GetInitializedHandler(const char* handler)
 //----------------------------------------------------------------------
 cmCTestGenericHandler* cmCTest::GetHandler(const char* handler)
 {
-  cmCTest::t_TestingHandlers::iterator it = 
+  cmCTest::t_TestingHandlers::iterator it =
     this->TestingHandlers.find(handler);
   if ( it == this->TestingHandlers.end() )
     {
@@ -1314,8 +1314,8 @@ int cmCTest::RunTest(std::vector<const char*> argv,
       {
       if(argv[i])
         {
-        // make sure we pass the timeout in for any build and test 
-        // invocations. Since --build-generator is required this is a 
+        // make sure we pass the timeout in for any build and test
+        // invocations. Since --build-generator is required this is a
         // good place to check for it, and to add the arguments in
         if (strcmp(argv[i],"--build-generator") == 0 && timeout > 0)
           {
@@ -1524,18 +1524,18 @@ void cmCTest::StartXML(std::ostream& ostr, bool append)
        << "\tNumberOfPhysicalCPU=\""<< info.GetNumberOfPhysicalCPU() << "\"\n"
        << "\tTotalVirtualMemory=\"" << info.GetTotalVirtualMemory() << "\"\n"
        << "\tTotalPhysicalMemory=\""<< info.GetTotalPhysicalMemory() << "\"\n"
-       << "\tLogicalProcessorsPerPhysical=\"" 
+       << "\tLogicalProcessorsPerPhysical=\""
        << info.GetLogicalProcessorsPerPhysical() << "\"\n"
-       << "\tProcessorClockFrequency=\"" 
-       << info.GetProcessorClockFrequency() << "\"\n" 
+       << "\tProcessorClockFrequency=\""
+       << info.GetProcessorClockFrequency() << "\"\n"
        << ">" << std::endl;
-  this->AddSiteProperties(ostr); 
+  this->AddSiteProperties(ostr);
 }
 
 //----------------------------------------------------------------------
 void cmCTest::AddSiteProperties(std::ostream& ostr)
 {
-  cmCTestScriptHandler* ch = 
+  cmCTestScriptHandler* ch =
     static_cast<cmCTestScriptHandler*>(this->GetHandler("script"));
   cmake* cm =  ch->GetCMake();
   // if no CMake then this is the old style script and props like
@@ -1547,9 +1547,9 @@ void cmCTest::AddSiteProperties(std::ostream& ostr)
   // This code should go when cdash is changed to use labels only
   const char* subproject = cm->GetProperty("SubProject", cmProperty::GLOBAL);
   if(subproject)
-    { 
+    {
     ostr << "<Subproject name=\"" << subproject << "\">\n";
-    const char* labels = 
+    const char* labels =
       ch->GetCMake()->GetProperty("SubProjectLabels", cmProperty::GLOBAL);
     if(labels)
       {
@@ -1566,11 +1566,11 @@ void cmCTest::AddSiteProperties(std::ostream& ostr)
       }
     ostr << "</Subproject>\n";
     }
-  
+
   // This code should stay when cdash only does label based sub-projects
   const char* label = cm->GetProperty("Label", cmProperty::GLOBAL);
   if(label)
-    { 
+    {
     ostr << "<Labels>\n";
     ostr << "  <Label>" << label << "</Label>\n";
     ostr << "</Labels>\n";
@@ -1762,7 +1762,7 @@ bool cmCTest::SubmitExtraFiles(const char* cfiles)
 
 
 //-------------------------------------------------------
-// for a -D argument convert the next argument into 
+// for a -D argument convert the next argument into
 // the proper list of dashboard steps via SetTest
 bool cmCTest::AddTestsForDashboardType(std::string &targ)
 {
@@ -1980,9 +1980,9 @@ bool cmCTest::CheckArgument(const std::string& arg, const char* varg1,
 
 
 //----------------------------------------------------------------------
-// Processes one command line argument (and its arguments if any) 
+// Processes one command line argument (and its arguments if any)
 // for many simple options and then returns
-void cmCTest::HandleCommandLineArguments(size_t &i, 
+void cmCTest::HandleCommandLineArguments(size_t &i,
                                          std::vector<std::string> &args)
 {
   std::string arg = args[i];
@@ -2031,14 +2031,14 @@ void cmCTest::HandleCommandLineArguments(size_t &i,
     i++;
     this->SetStopTime(args[i]);
     }
-  
+
   if(this->CheckArgument(arg, "-C", "--build-config") &&
      i < args.size() - 1)
     {
     i++;
     this->SetConfigType(args[i].c_str());
     }
-  
+
   if(this->CheckArgument(arg, "--debug"))
     {
     this->Debug = true;
@@ -2078,7 +2078,7 @@ void cmCTest::HandleCommandLineArguments(size_t &i,
     {
     this->OutputTestOutputOnTestFailure = true;
     }
-  
+
   if(this->CheckArgument(arg, "-N", "--show-only"))
     {
     this->ShowOnly = true;
@@ -2118,7 +2118,7 @@ void cmCTest::HandleCommandLineArguments(size_t &i,
       this->SubmitIndex = 0;
       }
     }
-  
+
   if(this->CheckArgument(arg, "--overwrite") && i < args.size() - 1)
     {
     i++;
@@ -2171,7 +2171,7 @@ void cmCTest::HandleCommandLineArguments(size_t &i,
     this->GetHandler("memcheck")->
       SetPersistentOption("ExcludeLabelRegularExpression", args[i].c_str());
     }
-  
+
   if(this->CheckArgument(arg, "-E", "--exclude-regex") &&
      i < args.size() - 1)
     {
@@ -2180,17 +2180,17 @@ void cmCTest::HandleCommandLineArguments(size_t &i,
       SetPersistentOption("ExcludeRegularExpression", args[i].c_str());
     this->GetHandler("memcheck")->
       SetPersistentOption("ExcludeRegularExpression", args[i].c_str());
-    }  
+    }
 }
 
 //----------------------------------------------------------------------
 // handle the -S -SR and -SP arguments
-void cmCTest::HandleScriptArguments(size_t &i, 
+void cmCTest::HandleScriptArguments(size_t &i,
                                     std::vector<std::string> &args,
                                     bool &SRArgumentSpecified)
 {
   std::string arg = args[i];
-  if(this->CheckArgument(arg, "-SP", "--script-new-process") && 
+  if(this->CheckArgument(arg, "-SP", "--script-new-process") &&
      i < args.size() - 1 )
     {
     this->RunConfigurationScript = true;
@@ -2203,8 +2203,8 @@ void cmCTest::HandleScriptArguments(size_t &i,
       ch->AddConfigurationScript(args[i].c_str(),false);
       }
     }
-  
-  if(this->CheckArgument(arg, "-SR", "--script-run") && 
+
+  if(this->CheckArgument(arg, "-SR", "--script-run") &&
      i < args.size() - 1 )
     {
     SRArgumentSpecified = true;
@@ -2214,7 +2214,7 @@ void cmCTest::HandleScriptArguments(size_t &i,
       = static_cast<cmCTestScriptHandler*>(this->GetHandler("script"));
     ch->AddConfigurationScript(args[i].c_str(),true);
     }
-  
+
   if(this->CheckArgument(arg, "-S", "--script") && i < args.size() - 1 )
     {
     this->RunConfigurationScript = true;
@@ -2396,7 +2396,7 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output)
     } // the close of the for argument loop
 
 
-  // now what sould cmake do? if --build-and-test was specified then 
+  // now what sould cmake do? if --build-and-test was specified then
   // we run the build and test handler and return
   if(cmakeAndTest)
     {
@@ -2410,7 +2410,7 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output)
 #endif
     if(retv != 0)
       {
-      cmCTestLog(this, DEBUG, "build and test failing returing: " << retv 
+      cmCTestLog(this, DEBUG, "build and test failing returing: " << retv
                  << std::endl);
       }
     return retv;
@@ -2438,14 +2438,14 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output)
       res = this->GetHandler("script")->ProcessHandler();
       if(res != 0)
         {
-        cmCTestLog(this, DEBUG, "running script failing returning: " << res 
+        cmCTestLog(this, DEBUG, "running script failing returning: " << res
                    << std::endl);
         }
 
       }
     else
       {
-      // What is this?  -V seems to be the same as -VV, 
+      // What is this?  -V seems to be the same as -VV,
       // and Verbose is always on in this case
       this->ExtraVerbose = this->Verbose;
       this->Verbose = true;
@@ -2472,7 +2472,7 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output)
       }
     if(res != 0)
       {
-      cmCTestLog(this, DEBUG, "Running a test(s) failed returning : " << res 
+      cmCTestLog(this, DEBUG, "Running a test(s) failed returning : " << res
                  << std::endl);
       }
     return res;
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index beffe9e7a..f2638feda 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -93,7 +93,7 @@ public:
    */
   static int HTTPRequest(std::string url, HTTPMethod method,
                           std::string& response,
-                          std::string fields = "", 
+                          std::string fields = "",
                           std::string putFile = "", int timeout = 0);
 #endif
 
@@ -198,13 +198,13 @@ public:
   //! base64 encode a file
   std::string Base64EncodeFile(std::string file);
 
-  /** 
+  /**
    * Return the time remaining that the script is allowed to run in
    * seconds if the user has set the variable CTEST_TIME_LIMIT. If that has
    * not been set it returns 1e7 seconds
    */
   double GetRemainingTimeAllowed();
-    
+
   ///! Open file in the output directory and set the stream
   bool OpenOutputFile(const std::string& path,
                       const std::string& name,
@@ -529,11 +529,11 @@ private:
   bool AddVariableDefinition(const std::string &arg);
 
   //! parse and process most common command line arguments
-  void HandleCommandLineArguments(size_t &i, 
+  void HandleCommandLineArguments(size_t &i,
                                   std::vector<std::string> &args);
 
   //! hande the -S -SP and -SR arguments
-  void HandleScriptArguments(size_t &i, 
+  void HandleScriptArguments(size_t &i,
                              std::vector<std::string> &args,
                              bool &SRArgumentSpecified);
 
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 47a0e8553..423124340 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -267,7 +267,7 @@ bool cmCacheManager::LoadCache(const char* path,
         // If the entry is not internal to the cache being loaded
         // or if it is in the list of internal entries to be
         // imported, load it.
-        if ( internal || (e.Type != INTERNAL) || 
+        if ( internal || (e.Type != INTERNAL) ||
              (includes.find(entryKey) != includes.end()) )
           {
           // If we are loading the cache from another project,
@@ -478,7 +478,7 @@ bool cmCacheManager::SaveCache(const char* path)
     = this->GetCacheEntry("CMAKE_COMMAND");
   if ( cmakeCacheEntry )
     {
-    fout << "# It was generated by CMake: " << 
+    fout << "# It was generated by CMake: " <<
       cmakeCacheEntry->Value << std::endl;
     }
 
@@ -500,10 +500,10 @@ bool cmCacheManager::SaveCache(const char* path)
   fout << "########################\n";
   fout << "\n";
 
-  for( std::map<cmStdString, CacheEntry>::const_iterator i = 
+  for( std::map<cmStdString, CacheEntry>::const_iterator i =
          this->Cache.begin(); i != this->Cache.end(); ++i)
     {
-    const CacheEntry& ce = (*i).second; 
+    const CacheEntry& ce = (*i).second;
     CacheEntryType t = ce.Type;
     if(!ce.Initialized)
       {
@@ -641,7 +641,7 @@ void cmCacheManager::OutputHelpString(std::ostream& fout,
   std::string::size_type pos = 0;
   for (std::string::size_type i=0; i<=end; i++)
     {
-    if ((i==end) 
+    if ((i==end)
         || (helpString[i]=='\n')
         || ((i-pos >= 60) && (helpString[i]==' ')))
       {
@@ -700,12 +700,12 @@ void cmCacheManager::PrintCache(std::ostream& out) const
 {
   out << "=================================================" << std::endl;
   out << "CMakeCache Contents:" << std::endl;
-  for(std::map<cmStdString, CacheEntry>::const_iterator i = 
+  for(std::map<cmStdString, CacheEntry>::const_iterator i =
         this->Cache.begin(); i != this->Cache.end(); ++i)
     {
     if((*i).second.Type != INTERNAL)
       {
-      out << (*i).first.c_str() << " = " << (*i).second.Value.c_str() 
+      out << (*i).first.c_str() << " = " << (*i).second.Value.c_str()
           << std::endl;
       }
     }
@@ -768,7 +768,7 @@ bool cmCacheManager::CacheIterator::IsAtEnd() const
 
 void cmCacheManager::CacheIterator::Begin()
 {
-  this->Position = this->Container.Cache.begin(); 
+  this->Position = this->Container.Cache.begin();
 }
 
 bool cmCacheManager::CacheIterator::Find(const char* key)
@@ -781,7 +781,7 @@ void cmCacheManager::CacheIterator::Next()
 {
   if (!this->IsAtEnd())
     {
-    ++this->Position; 
+    ++this->Position;
     }
 }
 
diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h
index 9c94d214c..4a5ee450f 100644
--- a/Source/cmCacheManager.h
+++ b/Source/cmCacheManager.h
@@ -22,7 +22,7 @@ class cmake;
  * \brief Control class for cmake's cache
  *
  * Load and Save CMake cache files.
- * 
+ *
  */
 class cmCacheManager
 {
@@ -30,7 +30,7 @@ public:
   cmCacheManager(cmake* cm);
   class CacheIterator;
   friend class cmCacheManager::CacheIterator;
-  enum CacheEntryType{ BOOL=0, PATH, FILEPATH, STRING, INTERNAL,STATIC, 
+  enum CacheEntryType{ BOOL=0, PATH, FILEPATH, STRING, INTERNAL,STATIC,
                        UNINITIALIZED };
 
 private:
@@ -57,7 +57,7 @@ public:
     bool IsAtEnd() const;
     void Next();
     const char *GetName() const {
-      return this->Position->first.c_str(); } 
+      return this->Position->first.c_str(); }
     const char* GetProperty(const char*) const ;
     bool GetPropertyAsBool(const char*) const ;
     bool PropertyExists(const char*) const;
@@ -76,7 +76,7 @@ public:
     CacheIterator(cmCacheManager &cm) : Container(cm) {
       this->Begin();
     }
-    CacheIterator(cmCacheManager &cm, const char* key) : Container(cm) 
+    CacheIterator(cmCacheManager &cm, const char* key) : Container(cm)
       {
       if ( key )
         {
@@ -87,30 +87,30 @@ public:
     CacheEntry const& GetEntry() const { return this->Position->second; }
     CacheEntry& GetEntry() { return this->Position->second; }
   };
-  
+
   ///! return an iterator to iterate through the cache map
-  cmCacheManager::CacheIterator NewIterator() 
+  cmCacheManager::CacheIterator NewIterator()
     {
       return CacheIterator(*this);
-    } 
-  
+    }
+
   /**
    * Types for the cache entries.  These are useful as
    * hints for a cache editor program.  Path should bring
-   * up a file chooser, BOOL a check box, and STRING a 
+   * up a file chooser, BOOL a check box, and STRING a
    * text entry box, FILEPATH is a full path to a file which
    * can be different than just a path input
    */
   static CacheEntryType StringToType(const char*);
   static const char* TypeToString(CacheEntryType);
   static bool IsType(const char*);
-  
+
   ///! Load a cache for given makefile.  Loads from ouput home.
-  bool LoadCache(cmMakefile*); 
+  bool LoadCache(cmMakefile*);
   ///! Load a cache for given makefile.  Loads from path/CMakeCache.txt.
   bool LoadCache(const char* path);
   bool LoadCache(const char* path, bool internal);
-  bool LoadCache(const char* path, bool internal, 
+  bool LoadCache(const char* path, bool internal,
                  std::set<cmStdString>& excludes,
                  std::set<cmStdString>& includes);
 
@@ -124,19 +124,19 @@ public:
 
   ///! Print the cache to a stream
   void PrintCache(std::ostream&) const;
-  
+
   ///! Get the iterator for an entry with a given key.
   cmCacheManager::CacheIterator GetCacheIterator(const char *key=0);
-  
+
   ///! Remove an entry from the cache
   void RemoveCacheEntry(const char* key);
-  
+
   ///! Get the number of entries in the cache
   int GetSize() {
     return static_cast<int>(this->Cache.size()); }
-  
+
   ///! Break up a line like VAR:type="value" into var, type and value
-  static bool ParseEntry(const char* entry, 
+  static bool ParseEntry(const char* entry,
                          std::string& var,
                          std::string& value,
                          CacheEntryType& type);
@@ -154,7 +154,7 @@ public:
 
 protected:
   ///! Add an entry into the cache
-  void AddCacheEntry(const char* key, const char* value, 
+  void AddCacheEntry(const char* key, const char* value,
                      const char* helpString, CacheEntryType type);
 
   ///! Get a cache entry object for a key
diff --git a/Source/cmCommand.h b/Source/cmCommand.h
index 4faaee3ac..49f451b58 100644
--- a/Source/cmCommand.h
+++ b/Source/cmCommand.h
@@ -23,8 +23,8 @@
  * cmCommand is the base class for all commands in CMake. A command
  * manifests as an entry in CMakeLists.txt and produces one or
  * more makefile rules. Commands are associated with a particular
- * makefile. This base class cmCommand defines the API for commands 
- * to support such features as enable/disable, inheritance, 
+ * makefile. This base class cmCommand defines the API for commands
+ * to support such features as enable/disable, inheritance,
  * documentation, and construction.
  */
 class cmCommand : public cmObject
@@ -35,18 +35,18 @@ public:
   /**
    * Construct the command. By default it is enabled with no makefile.
    */
-  cmCommand()  
+  cmCommand()
     {this->Makefile = 0; this->Enabled = true;}
 
   /**
    * Need virtual destructor to destroy real command type.
    */
   virtual ~cmCommand() {}
-  
+
   /**
    * Specify the makefile.
    */
-  void SetMakefile(cmMakefile*m) 
+  void SetMakefile(cmMakefile*m)
     {this->Makefile = m; }
   cmMakefile* GetMakefile() { return this->Makefile; }
 
@@ -87,12 +87,12 @@ public:
    * Does this command have a final pass?  Query after InitialPass.
    */
   virtual bool HasFinalPass() const { return false; }
-  
+
   /**
    * This is a virtual constructor for the command.
    */
   virtual cmCommand* Clone() = 0;
-  
+
   /**
    * This determines if the command is invoked when in script mode.
    */
@@ -139,13 +139,13 @@ public:
   /**
    * Enable the command.
    */
-  void EnabledOn() 
+  void EnabledOn()
     {this->Enabled = true;}
 
   /**
    * Disable the command.
    */
-  void EnabledOff() 
+  void EnabledOff()
     {this->Enabled = false;}
 
   /**
@@ -157,13 +157,13 @@ public:
   /**
    * Disable or enable the command.
    */
-  void SetEnabled(bool enabled)  
+  void SetEnabled(bool enabled)
     {this->Enabled = enabled;}
 
   /**
    * Return the last error string.
    */
-  const char* GetError() 
+  const char* GetError()
     {
       if(this->Error.length() == 0)
         {
diff --git a/Source/cmCommandArgumentLexer.h b/Source/cmCommandArgumentLexer.h
index 828122b9f..2ea3fa29f 100644
--- a/Source/cmCommandArgumentLexer.h
+++ b/Source/cmCommandArgumentLexer.h
@@ -45,7 +45,7 @@
 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 
 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types. 
+ * if you want the limit (max/min) macros for int types.
  */
 #ifndef __STDC_LIMIT_MACROS
 #define __STDC_LIMIT_MACROS 1
@@ -62,7 +62,7 @@ typedef uint32_t flex_uint32_t;
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
 typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t; 
+typedef unsigned char flex_uint8_t;
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
 
@@ -192,7 +192,7 @@ struct yy_buffer_state
 
     int yy_bs_lineno; /**< The line count. */
     int yy_bs_column; /**< The column count. */
-    
+
         /* Whether to try to fill the input buffer when we reach the
          * end of it.
          */
diff --git a/Source/cmCommandArgumentLexer.in.l b/Source/cmCommandArgumentLexer.in.l
index d10e50d97..fdca61bfa 100644
--- a/Source/cmCommandArgumentLexer.in.l
+++ b/Source/cmCommandArgumentLexer.in.l
@@ -66,43 +66,43 @@ Modify cmCommandArgumentLexer.h:
   return cal_ENVCURLY;
 }
 
-\$[A-Za-z0-9/_.+-]+\{ { 
+\$[A-Za-z0-9/_.+-]+\{ {
   //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
-  yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2); 
-  return cal_NCURLY; 
-} 
+  yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2);
+  return cal_NCURLY;
+}
 
-@[A-Za-z0-9/_.+-]+@ { 
+@[A-Za-z0-9/_.+-]+@ {
   //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
-  yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2); 
-  return cal_ATNAME; 
-} 
+  yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2);
+  return cal_ATNAME;
+}
 
 "${" {
   //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
-  //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
+  //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
   yylvalp->str = yyextra->DCURLYVariable;
   return cal_DCURLY;
 }
 
 "}" {
   //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
-  //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
+  //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
   yylvalp->str = yyextra->RCURLYVariable;
   return cal_RCURLY;
 }
 
 "@" {
   //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
-  //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
+  //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
   yylvalp->str = yyextra->ATVariable;
   return cal_AT;
 }
 
-[A-Za-z0-9/_.+-]+ { 
+[A-Za-z0-9/_.+-]+ {
   //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
-  yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
-  return cal_NAME; 
+  yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
+  return cal_NAME;
 }
 
 <ESCAPES>\\. {
@@ -110,31 +110,31 @@ Modify cmCommandArgumentLexer.h:
     {
     return cal_ERROR;
     }
-  return cal_SYMBOL; 
+  return cal_SYMBOL;
 }
 
-[^\${}\\@]+ { 
+[^\${}\\@]+ {
   //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
-  yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
-  return cal_SYMBOL; 
+  yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
+  return cal_SYMBOL;
 }
 
 "$" {
-  //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
+  //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
   yylvalp->str = yyextra->DOLLARVariable;
-  return cal_DOLLAR; 
+  return cal_DOLLAR;
 }
 
 "{" {
-  //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
+  //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
   yylvalp->str = yyextra->LCURLYVariable;
-  return cal_LCURLY; 
+  return cal_LCURLY;
 }
 
 <ESCAPES>"\\" {
-  //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
+  //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
   yylvalp->str = yyextra->BSLASHVariable;
-  return cal_BSLASH; 
+  return cal_BSLASH;
 }
 
 <NOESCAPES>"\\" {
diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx
index a781767e3..2f26b0cd4 100644
--- a/Source/cmCommandArgumentParserHelper.cxx
+++ b/Source/cmCommandArgumentParserHelper.cxx
@@ -61,7 +61,7 @@ char* cmCommandArgumentParserHelper::AddString(const char* str)
   return stVal;
 }
 
-char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key, 
+char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key,
                                                            const char* var)
 {
   if ( !key )
@@ -163,7 +163,7 @@ char* cmCommandArgumentParserHelper::ExpandVariableForAt(const char* var)
     // try to expand the variable
     char* ret = this->ExpandVariable(var);
     // if the return was 0 and we want to replace empty strings
-    // then return an empty string 
+    // then return an empty string
     if(!ret && this->RemoveEmpty)
       {
       return this->AddString(ret);
@@ -175,7 +175,7 @@ char* cmCommandArgumentParserHelper::ExpandVariableForAt(const char* var)
       }
     }
   // at this point we want to put it back because of one of these cases:
-  // - this->ReplaceAtSyntax is false  
+  // - this->ReplaceAtSyntax is false
   // - this->ReplaceAtSyntax is true, but this->RemoveEmpty is false,
   //   and the variable was not defined
   std::string ref = "@";
@@ -274,7 +274,7 @@ int cmCommandArgumentParserHelper::ParseString(const char* str, int verb)
   this->InputBuffer = str;
   this->InputBufferPos = 0;
   this->CurrentLine = 0;
-  
+
   this->Result = "";
 
   yyscan_t yyscanner;
@@ -292,7 +292,7 @@ int cmCommandArgumentParserHelper::ParseString(const char* str, int verb)
 
   if ( Verbose )
     {
-    std::cerr << "Expanding [" << str << "] produced: [" 
+    std::cerr << "Expanding [" << str << "] produced: ["
               << this->Result.c_str() << "]" << std::endl;
     }
   return 1;
diff --git a/Source/cmCommandArgumentParserHelper.h b/Source/cmCommandArgumentParserHelper.h
index cdb832b5f..f8c672fef 100644
--- a/Source/cmCommandArgumentParserHelper.h
+++ b/Source/cmCommandArgumentParserHelper.h
@@ -66,8 +66,8 @@ public:
   void SetNoEscapeMode(bool b) { this->NoEscapeMode = b; }
   void SetReplaceAtSyntax(bool b) { this->ReplaceAtSyntax = b; }
   void SetRemoveEmpty(bool b) { this->RemoveEmpty = b; }
-  
-  const char* GetError() { return this->ErrorString.c_str(); } 
+
+  const char* GetError() { return this->ErrorString.c_str(); }
   char EmptyVariable[1];
   char DCURLYVariable[3];
   char RCURLYVariable[3];
@@ -102,7 +102,7 @@ private:
   std::string ErrorString;
   bool NoEscapeMode;
   bool ReplaceAtSyntax;
-  bool RemoveEmpty; 
+  bool RemoveEmpty;
 };
 
 #endif
diff --git a/Source/cmCommandArgumentsHelper.cxx b/Source/cmCommandArgumentsHelper.cxx
index d92013788..1d5fc0790 100644
--- a/Source/cmCommandArgumentsHelper.cxx
+++ b/Source/cmCommandArgumentsHelper.cxx
@@ -12,20 +12,20 @@
 
 #include "cmCommandArgumentsHelper.h"
 
-cmCommandArgument::cmCommandArgument(cmCommandArgumentsHelper* args, 
-                                     const char* key, 
+cmCommandArgument::cmCommandArgument(cmCommandArgumentsHelper* args,
+                                     const char* key,
                                      cmCommandArgumentGroup* group)
 :Key(key)
 ,Group(group)
 ,WasActive(false)
 ,ArgumentsBeforeEmpty(true)
-,CurrentIndex(0) 
+,CurrentIndex(0)
 {
   if (args!=0)
     {
     args->AddArgument(this);
     }
-    
+
   if (this->Group!=0)
     {
     this->Group->ContainedArguments.push_back(this);
@@ -50,7 +50,7 @@ void cmCommandArgument::FollowsGroup(const cmCommandArgumentGroup* group)
   if (group!=0)
     {
     this->ArgumentsBeforeEmpty = false;
-    for(std::vector<cmCommandArgument*>::const_iterator 
+    for(std::vector<cmCommandArgument*>::const_iterator
         argIt= group->ContainedArguments.begin();
         argIt != group->ContainedArguments.end();
         ++argIt)
@@ -67,7 +67,7 @@ bool cmCommandArgument::MayFollow(const cmCommandArgument* current) const
     return true;
     }
 
-  std::set<const cmCommandArgument*>::const_iterator argIt 
+  std::set<const cmCommandArgument*>::const_iterator argIt
                                          = this->ArgumentsBefore.find(current);
   if (argIt != this->ArgumentsBefore.end())
     {
@@ -90,7 +90,7 @@ void cmCommandArgument::ApplyOwnGroup()
 {
   if (this->Group!=0)
     {
-    for (std::vector<cmCommandArgument*>::const_iterator 
+    for (std::vector<cmCommandArgument*>::const_iterator
          it = this->Group->ContainedArguments.begin();
          it != this->Group->ContainedArguments.end();
          ++it)
@@ -105,7 +105,7 @@ void cmCommandArgument::ApplyOwnGroup()
 
 void cmCommandArgument::Activate()
 {
-  this->WasActive = true; 
+  this->WasActive = true;
   this->CurrentIndex = 0;
 }
 
@@ -117,8 +117,8 @@ bool cmCommandArgument::Consume(const std::string& arg)
 }
 
 
-cmCAStringVector::cmCAStringVector(cmCommandArgumentsHelper* args, 
-                                   const char* key, 
+cmCAStringVector::cmCAStringVector(cmCommandArgumentsHelper* args,
+                                   const char* key,
                                    cmCommandArgumentGroup* group)
 :cmCommandArgument(args, key, group)
 ,Ignore(0)
@@ -151,8 +151,8 @@ void cmCAStringVector::DoReset()
   this->Vector.clear();
 }
 
-cmCAString::cmCAString(cmCommandArgumentsHelper* args, 
-                       const char* key, 
+cmCAString::cmCAString(cmCommandArgumentsHelper* args,
+                       const char* key,
                        cmCommandArgumentGroup* group)
 :cmCommandArgument(args, key, group)
 {
@@ -181,11 +181,11 @@ void cmCAString::DoReset()
   this->String = "";
 }
 
-cmCAEnabler::cmCAEnabler(cmCommandArgumentsHelper* args, 
-                         const char* key, 
+cmCAEnabler::cmCAEnabler(cmCommandArgumentsHelper* args,
+                         const char* key,
                          cmCommandArgumentGroup* group)
 :cmCommandArgument(args, key, group)
-,Enabled(false) 
+,Enabled(false)
 {}
 
 bool cmCAEnabler::DoConsume(const std::string&, unsigned int index)
@@ -202,11 +202,11 @@ void cmCAEnabler::DoReset()
   this->Enabled = false;
 }
 
-cmCADisabler::cmCADisabler(cmCommandArgumentsHelper* args, 
-                           const char* key, 
+cmCADisabler::cmCADisabler(cmCommandArgumentsHelper* args,
+                           const char* key,
                            cmCommandArgumentGroup* group)
 :cmCommandArgument(args, key, group)
-,Enabled(true) 
+,Enabled(true)
 {}
 
 bool cmCADisabler::DoConsume(const std::string&, unsigned int index)
@@ -225,7 +225,7 @@ void cmCADisabler::DoReset()
 
 void cmCommandArgumentGroup::Follows(const cmCommandArgument* arg)
 {
-  for(std::vector<cmCommandArgument*>::iterator 
+  for(std::vector<cmCommandArgument*>::iterator
       it = this->ContainedArguments.begin();
       it != this->ContainedArguments.end();
       ++it)
@@ -236,7 +236,7 @@ void cmCommandArgumentGroup::Follows(const cmCommandArgument* arg)
 
 void cmCommandArgumentGroup::FollowsGroup(const cmCommandArgumentGroup* group)
 {
-  for(std::vector<cmCommandArgument*>::iterator 
+  for(std::vector<cmCommandArgument*>::iterator
       it = this->ContainedArguments.begin();
       it != this->ContainedArguments.end();
       ++it)
@@ -245,7 +245,7 @@ void cmCommandArgumentGroup::FollowsGroup(const cmCommandArgumentGroup* group)
     }
 }
 
-void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* args, 
+void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* args,
                                      std::vector<std::string>* unconsumedArgs)
 {
   if(args==0)
@@ -253,7 +253,7 @@ void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* args,
     return;
     }
 
-  for(std::vector<cmCommandArgument*>::iterator 
+  for(std::vector<cmCommandArgument*>::iterator
       argIt = this->Arguments.begin();
       argIt != this->Arguments.end();
       ++argIt)
@@ -268,7 +268,7 @@ void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* args,
       it != args->end();
       ++it)
     {
-    for(std::vector<cmCommandArgument*>::iterator 
+    for(std::vector<cmCommandArgument*>::iterator
         argIt = this->Arguments.begin();
         argIt != this->Arguments.end();
         ++argIt)
diff --git a/Source/cmCommandArgumentsHelper.h b/Source/cmCommandArgumentsHelper.h
index 3b0b058fd..f732f8f1d 100644
--- a/Source/cmCommandArgumentsHelper.h
+++ b/Source/cmCommandArgumentsHelper.h
@@ -18,7 +18,7 @@ class cmCommandArgumentsHelper;
 class cmCommandArgumentGroup;
 
 /* cmCommandArgumentsHelper, cmCommandArgumentGroup and cmCommandArgument (i.e.
-its derived classes cmCAXXX can be used to simplify the processing of 
+its derived classes cmCAXXX can be used to simplify the processing of
 arguments to cmake commands. Maybe they can also be used to generate
 documentation.
 
@@ -26,11 +26,11 @@ For every argument supported by a command one cmCommandArgument is created
 and added to cmCommandArgumentsHelper. cmCommand has a cmCommandArgumentsHelper
 as member variable so this should be used.
 
-The order of the arguments is defined using the Follows(arg) method. It says 
+The order of the arguments is defined using the Follows(arg) method. It says
 that this argument follows immediateley the given argument. It can be used
 with multiple arguments if the argument can follow after different arguments.
 
-Arguments can be arranged in groups using cmCommandArgumentGroup. Every 
+Arguments can be arranged in groups using cmCommandArgumentGroup. Every
 member of a group can follow any other member of the group. These groups
 can also be used to define the order.
 
@@ -42,8 +42,8 @@ For an example see cmExportCommand.cxx.
 class cmCommandArgument
 {
   public:
-    cmCommandArgument(cmCommandArgumentsHelper* args, 
-                      const char* key, 
+    cmCommandArgument(cmCommandArgumentsHelper* args,
+                      const char* key,
                       cmCommandArgumentGroup* group=0);
     virtual ~cmCommandArgument() {}
 
@@ -56,8 +56,8 @@ class cmCommandArgument
     /// Returns true if the argument was found in the argument list
     bool WasFound() const                             {return this->WasActive;}
 
-    // The following methods are only called from 
-    // cmCommandArgumentsHelper::Parse(), but making this a friend would 
+    // The following methods are only called from
+    // cmCommandArgumentsHelper::Parse(), but making this a friend would
     // give it access to everything
 
     /// Make the current argument the currently active argument
@@ -89,19 +89,19 @@ class cmCommandArgument
     virtual void DoReset() = 0;
 };
 
-/** cmCAStringVector is to be used for arguments which can consist of more 
+/** cmCAStringVector is to be used for arguments which can consist of more
 than one string, e.g. the FILES argument in INSTALL(FILES f1 f2 f3 ...). */
 class cmCAStringVector : public cmCommandArgument
 {
   public:
-    cmCAStringVector(cmCommandArgumentsHelper* args, 
-                     const char* key, 
+    cmCAStringVector(cmCommandArgumentsHelper* args,
+                     const char* key,
                      cmCommandArgumentGroup* group=0);
 
     /// Return the vector of strings
     const std::vector<std::string>& GetVector() const    {return this->Vector;}
 
-    /** Is there a keyword which should be skipped in 
+    /** Is there a keyword which should be skipped in
     the arguments (e.g. ARGS for ADD_CUSTOM_COMMAND) ? */
     void SetIgnore(const char* ignore)                   {this->Ignore=ignore;}
   private:
@@ -118,8 +118,8 @@ e.g. the executable name in ADD_EXECUTABLE(). */
 class cmCAString : public cmCommandArgument
 {
   public:
-    cmCAString(cmCommandArgumentsHelper* args, 
-               const char* key, 
+    cmCAString(cmCommandArgumentsHelper* args,
+               const char* key,
                cmCommandArgumentGroup* group=0);
 
     /// Return the string
@@ -138,8 +138,8 @@ enabled using a special argument, e.g. EXCLUDE_FROM_ALL in ADD_EXECUTABLE(). */
 class cmCAEnabler : public cmCommandArgument
 {
   public:
-    cmCAEnabler(cmCommandArgumentsHelper* args, 
-                const char* key, 
+    cmCAEnabler(cmCommandArgumentsHelper* args,
+                const char* key,
                 cmCommandArgumentGroup* group=0);
 
     /// Has it been enabled ?
@@ -156,8 +156,8 @@ disabled using a special argument.*/
 class cmCADisabler : public cmCommandArgument
 {
   public:
-    cmCADisabler(cmCommandArgumentsHelper* args, 
-                 const char* key, 
+    cmCADisabler(cmCommandArgumentsHelper* args,
+                 const char* key,
                  cmCommandArgumentGroup* group=0);
 
     /// Is it still enabled ?
@@ -170,7 +170,7 @@ class cmCADisabler : public cmCommandArgument
 };
 
 
-/** Group of arguments, needed for ordering. E.g. WIN32, EXCLUDE_FROM_ALL and 
+/** Group of arguments, needed for ordering. E.g. WIN32, EXCLUDE_FROM_ALL and
 MACSOX_BUNDLE from ADD_EXECUTABLE() are a group.
 */
 class cmCommandArgumentGroup
@@ -192,7 +192,7 @@ class cmCommandArgumentsHelper
 {
   public:
     /// Parse the argument list
-    void Parse(const std::vector<std::string>* args, 
+    void Parse(const std::vector<std::string>* args,
                std::vector<std::string>* unconsumedArgs);
     /// Add an argument.
     void AddArgument(cmCommandArgument* arg);
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index df78bf886..cd3ef59a9 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -1214,7 +1214,7 @@ void cmComputeLinkInformation::AddUserItem(std::string const& item,
     {
     // if this is a -l option then we might need to warn about
     // CMP0003 so put it in OldUserFlagItems, if it is not a -l
-    // or -Wl,-l (-framework -pthread), then allow it without a 
+    // or -Wl,-l (-framework -pthread), then allow it without a
     // CMP0003 as -L will not affect those other linker flags
     if(item.find("-l") == 0 ||  item.find("-Wl,-l") == 0)
       {
diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx
index ea98326e2..e52ddef35 100644
--- a/Source/cmConfigureFileCommand.cxx
+++ b/Source/cmConfigureFileCommand.cxx
@@ -104,7 +104,7 @@ bool cmConfigureFileCommand
       this->Immediate = true;
       }
     }
-  
+
   // If we were told to copy the file immediately, then do it on the
   // first pass (now).
   if(this->Immediate)
@@ -115,7 +115,7 @@ bool cmConfigureFileCommand
       return false;
       }
     }
-  
+
   return true;
 }
 
diff --git a/Source/cmConfigureFileCommand.h b/Source/cmConfigureFileCommand.h
index de497a952..347174a9e 100644
--- a/Source/cmConfigureFileCommand.h
+++ b/Source/cmConfigureFileCommand.h
@@ -19,7 +19,7 @@ class cmConfigureFileCommand : public cmCommand
 public:
   cmTypeMacro(cmConfigureFileCommand, cmCommand);
 
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
       return new cmConfigureFileCommand;
     }
@@ -48,7 +48,7 @@ public:
     {
     return "Copy a file to another location and modify its contents.";
     }
-  
+
   /**
    * Longer documentation.
    */
@@ -93,7 +93,7 @@ public:
 
 private:
   int ConfigureFile();
-  
+
   cmNewLineStyle NewLineStyle;
 
   std::string InputFile;
diff --git a/Source/cmCreateTestSourceList.h b/Source/cmCreateTestSourceList.h
index 806e5a909..3aa0a79cf 100644
--- a/Source/cmCreateTestSourceList.h
+++ b/Source/cmCreateTestSourceList.h
@@ -15,7 +15,7 @@
 #include "cmCommand.h"
 
 /** \class cmCreateTestSourceList
- * \brief 
+ * \brief
  *
  */
 
@@ -25,7 +25,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmCreateTestSourceList;
     }
@@ -41,7 +41,7 @@ public:
    * The name of the command as specified in CMakeList.txt.
    */
   virtual const char* GetName() const {return "create_test_sourcelist";}
-  
+
   /**
    * Succinct documentation.
    */
@@ -49,7 +49,7 @@ public:
     {
     return "Create a test driver and source list for building test programs.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -81,7 +81,7 @@ public:
       "CMAKE_TESTDRIVER_AFTER_TESTMAIN can be set to have code that will be "
       "placed directly after the call to the test main function.";
     }
-  
+
   cmTypeMacro(cmCreateTestSourceList, cmCommand);
 };
 
diff --git a/Source/cmDefinePropertyCommand.h b/Source/cmDefinePropertyCommand.h
index 55ef52137..b5175d50b 100644
--- a/Source/cmDefinePropertyCommand.h
+++ b/Source/cmDefinePropertyCommand.h
@@ -17,7 +17,7 @@
 class cmDefinePropertyCommand : public cmCommand
 {
 public:
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
       return new cmDefinePropertyCommand;
     }
@@ -41,7 +41,7 @@ public:
     {
     return "Define and document custom properties.";
     }
-  
+
   /**
    * Longer documentation.
    */
@@ -80,7 +80,7 @@ public:
         "Corresponding options to the get_property command will retrieve the "
         "documentation.";
     }
-  
+
   cmTypeMacro(cmDefinePropertyCommand, cmCommand);
 private:
   std::string PropertyName;
diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx
index 9296d4cca..545fe97e8 100644
--- a/Source/cmDepends.cxx
+++ b/Source/cmDepends.cxx
@@ -154,7 +154,7 @@ bool cmDepends::CheckDependencies(std::istream& internalDepends,
 
   while(internalDepends.getline(this->Dependee, this->MaxPath))
     {
-    if ( this->Dependee[0] == 0 || this->Dependee[0] == '#' || 
+    if ( this->Dependee[0] == 0 || this->Dependee[0] == '#' ||
          this->Dependee[0] == '\r' )
       {
       continue;
diff --git a/Source/cmDepends.h b/Source/cmDepends.h
index 087da6400..100e187b4 100644
--- a/Source/cmDepends.h
+++ b/Source/cmDepends.h
@@ -30,7 +30,7 @@ public:
   /** Instances need to know the build directory name and the relative
       path from the build directory to the target file.  */
   cmDepends(cmLocalGenerator* lg=0, const char* targetDir="");
-  
+
   /** at what level will the compile be done from */
   void SetCompileDirectory(const char *dir) {this->CompileDirectory = dir;};
 
@@ -48,7 +48,7 @@ public:
 
   /** should this be verbose in its output */
   void SetVerbose(bool verb) { this->Verbose = verb; }
-    
+
   /** Virtual destructor to cleanup subclasses properly.  */
   virtual ~cmDepends();
 
@@ -69,7 +69,7 @@ public:
   void Clear(const char *file);
 
   /** Set the file comparison object */
-  void SetFileComparison(cmFileTimeComparison* fc) { 
+  void SetFileComparison(cmFileTimeComparison* fc) {
     this->FileComparison = fc; }
 
 protected:
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx
index c1b60905d..3e660587d 100644
--- a/Source/cmDependsFortran.cxx
+++ b/Source/cmDependsFortran.cxx
@@ -889,7 +889,7 @@ bool cmDependsFortran::FindIncludeFile(const char* dir,
       }
 
     // Search the include path for the file.
-    for(std::vector<std::string>::const_iterator i = 
+    for(std::vector<std::string>::const_iterator i =
           this->IncludePath.begin(); i != this->IncludePath.end(); ++i)
       {
       fullName = *i;
diff --git a/Source/cmDependsJavaLexer.h b/Source/cmDependsJavaLexer.h
index 09c19bfff..61aa66de2 100644
--- a/Source/cmDependsJavaLexer.h
+++ b/Source/cmDependsJavaLexer.h
@@ -58,7 +58,7 @@ typedef uint32_t flex_uint32_t;
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
 typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t; 
+typedef unsigned char flex_uint8_t;
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
 #endif /* ! C99 */
@@ -188,7 +188,7 @@ struct yy_buffer_state
 
     int yy_bs_lineno; /**< The line count. */
     int yy_bs_column; /**< The column count. */
-    
+
   /* Whether to try to fill the input buffer when we reach the
    * end of it.
    */
diff --git a/Source/cmDependsJavaLexer.in.l b/Source/cmDependsJavaLexer.in.l
index aae7ec658..9796ad52a 100644
--- a/Source/cmDependsJavaLexer.in.l
+++ b/Source/cmDependsJavaLexer.in.l
@@ -171,18 +171,18 @@ null { PRIMITIVE; return jp_NULLLITERAL; }
 "\*" { SYMBOL; return jp_TIMES; }
 "\*=" { SYMBOL; return jp_TIMESEQUALS; }
 
-[a-z_A-Z][a-z_0-9A-Z]* { 
-  yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); 
-  return jp_NAME; 
+[a-z_A-Z][a-z_0-9A-Z]* {
+  yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
+  return jp_NAME;
 }
 
 \/\/.*\n { }
 [ \f\t\n\r] { }
-. 	{ 
-  std::cerr << "Unknown character: " << yytext[0] 
-    << " (" << (int)yytext[0] << ")" << std::endl; 
-  yyextra->Error("Unknown character"); 
-  return jp_ERROR; 
+. 	{
+  std::cerr << "Unknown character: " << yytext[0]
+    << " (" << (int)yytext[0] << ")" << std::endl;
+  yyextra->Error("Unknown character");
+  return jp_ERROR;
 }
 
 %%
diff --git a/Source/cmDependsJavaParserHelper.cxx b/Source/cmDependsJavaParserHelper.cxx
index 7b595cc1f..6136baa84 100644
--- a/Source/cmDependsJavaParserHelper.cxx
+++ b/Source/cmDependsJavaParserHelper.cxx
@@ -35,7 +35,7 @@ cmDependsJavaParserHelper::~cmDependsJavaParserHelper()
 }
 
 void cmDependsJavaParserHelper::CurrentClass
-::AddFileNamesForPrinting(std::vector<cmStdString> *files, 
+::AddFileNamesForPrinting(std::vector<cmStdString> *files,
                           const char* prefix, const char* sep)
 {
   cmStdString rname = "";
@@ -103,7 +103,7 @@ void cmDependsJavaParserHelper::AddPackagesImport(const char* sclass)
   this->PackagesImport.push_back(sclass);
 }
 
-void cmDependsJavaParserHelper::SafePrintMissing(const char* str, 
+void cmDependsJavaParserHelper::SafePrintMissing(const char* str,
                                                  int line, int cnt)
 {
   if ( str )
@@ -134,7 +134,7 @@ void cmDependsJavaParserHelper::Print(const char* place, const char* str)
     }
 }
 
-void cmDependsJavaParserHelper::CombineUnions(char** out, 
+void cmDependsJavaParserHelper::CombineUnions(char** out,
                                               const char* in1, char** in2,
                                               const char* sep)
 {
@@ -193,7 +193,7 @@ void cmDependsJavaParserHelper
 }
 
 void cmDependsJavaParserHelper
-::AllocateParserType(cmDependsJavaParserHelper::ParserType* pt, 
+::AllocateParserType(cmDependsJavaParserHelper::ParserType* pt,
                      const char* str, int len)
 {
   pt->str = 0;
@@ -270,7 +270,7 @@ std::vector<cmStdString> cmDependsJavaParserHelper::GetFilesProduced()
   std::vector<cmStdString> files;
   CurrentClass* toplevel = &(*(this->ClassStack.begin()));
   std::vector<CurrentClass>::iterator it;
-  for ( it = toplevel->NestedClasses->begin(); 
+  for ( it = toplevel->NestedClasses->begin();
     it != toplevel->NestedClasses->end();
     ++ it )
     {
@@ -289,7 +289,7 @@ int cmDependsJavaParserHelper::ParseString(const char* str, int verb)
   this->InputBuffer = str;
   this->InputBufferPos = 0;
   this->CurrentLine = 0;
-  
+
 
   yyscan_t yyscanner;
   cmDependsJava_yylex_init(&yyscanner);
@@ -306,7 +306,7 @@ int cmDependsJavaParserHelper::ParseString(const char* str, int verb)
     {
     if ( this->CurrentPackage.size() > 0 )
       {
-      std::cout << "Current package is: " << 
+      std::cout << "Current package is: " <<
         this->CurrentPackage.c_str() << std::endl;
       }
     std::cout << "Imports packages:";
@@ -337,7 +337,7 @@ int cmDependsJavaParserHelper::ParseString(const char* str, int verb)
     this->PrintClasses();
     if ( this->UnionsAvailable != 0 )
       {
-      std::cout << "There are still " << 
+      std::cout << "There are still " <<
         this->UnionsAvailable << " unions available" << std::endl;
       }
     }
@@ -348,13 +348,13 @@ int cmDependsJavaParserHelper::ParseString(const char* str, int verb)
 void cmDependsJavaParserHelper::CleanupParser()
 {
   std::vector<char*>::iterator it;
-  for ( it = this->Allocates.begin(); 
+  for ( it = this->Allocates.begin();
     it != this->Allocates.end();
     ++ it )
     {
     delete [] *it;
     }
-  this->Allocates.erase(this->Allocates.begin(), 
+  this->Allocates.erase(this->Allocates.begin(),
     this->Allocates.end());
 }
 
@@ -382,11 +382,11 @@ int cmDependsJavaParserHelper::LexInput(char* buf, int maxlen)
 void cmDependsJavaParserHelper::Error(const char* str)
 {
   unsigned long pos = static_cast<unsigned long>(this->InputBufferPos);
-  fprintf(stderr, "JPError: %s (%lu / Line: %d)\n", 
+  fprintf(stderr, "JPError: %s (%lu / Line: %d)\n",
           str, pos, this->CurrentLine);
   int cc;
   std::cerr << "String: [";
-  for ( cc = 0; 
+  for ( cc = 0;
         cc < 30 && *(this->InputBuffer.c_str() + this->InputBufferPos + cc);
         cc ++ )
     {
@@ -395,7 +395,7 @@ void cmDependsJavaParserHelper::Error(const char* str)
   std::cerr << "]" << std::endl;
 }
 
-void cmDependsJavaParserHelper::UpdateCombine(const char* str1, 
+void cmDependsJavaParserHelper::UpdateCombine(const char* str1,
                                               const char* str2)
 {
   if ( this->CurrentCombine == "" && str1 != 0)
diff --git a/Source/cmDependsJavaParserHelper.h b/Source/cmDependsJavaParserHelper.h
index baecab378..9807a048c 100644
--- a/Source/cmDependsJavaParserHelper.h
+++ b/Source/cmDependsJavaParserHelper.h
@@ -9,7 +9,7 @@
   implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the License for more information.
 ============================================================================*/
-#ifndef cmDependsJavaParserHelper_h 
+#ifndef cmDependsJavaParserHelper_h
 #define cmDependsJavaParserHelper_h
 
 #include "cmStandardIncludes.h"
@@ -39,7 +39,7 @@ public:
   int ParseFile(const char* file);
 
   // For the lexer:
-  void AllocateParserType(cmDependsJavaParserHelper::ParserType* pt, 
+  void AllocateParserType(cmDependsJavaParserHelper::ParserType* pt,
     const char* str, int len = 0);
 
   int LexInput(char* buf, int maxlen);
@@ -69,7 +69,7 @@ private:
   public:
     cmStdString Name;
     std::vector<CurrentClass>* NestedClasses;
-    CurrentClass() 
+    CurrentClass()
       {
         this->NestedClasses = new std::vector<CurrentClass>;
       }
@@ -77,7 +77,7 @@ private:
       {
         delete this->NestedClasses;
       }
-    CurrentClass& operator=(CurrentClass const& c) 
+    CurrentClass& operator=(CurrentClass const& c)
       {
         this->NestedClasses->clear();
         this->Name = c.Name;
@@ -93,7 +93,7 @@ private:
       {
         (*this) = c;
       }
-    void AddFileNamesForPrinting(std::vector<cmStdString> *files, 
+    void AddFileNamesForPrinting(std::vector<cmStdString> *files,
                                  const char* prefix, const char* sep);
   };
   cmStdString CurrentPackage;
@@ -117,7 +117,7 @@ private:
   void PrintClasses();
 
   void Print(const char* place, const char* str);
-  void CombineUnions(char** out, const char* in1, char** in2, 
+  void CombineUnions(char** out, const char* in1, char** in2,
                      const char* sep);
   void SafePrintMissing(const char* str, int line, int cnt);
 
diff --git a/Source/cmDocumentationFormatter.cxx b/Source/cmDocumentationFormatter.cxx
index 6762d6677..9f01949b9 100644
--- a/Source/cmDocumentationFormatter.cxx
+++ b/Source/cmDocumentationFormatter.cxx
@@ -19,7 +19,7 @@ cmDocumentationFormatter::~cmDocumentationFormatter()
 {
 }
 
-void cmDocumentationFormatter::PrintFormatted(std::ostream& os, 
+void cmDocumentationFormatter::PrintFormatted(std::ostream& os,
                                               const char* text)
 {
   if(!text)
diff --git a/Source/cmDocumentationFormatterDocbook.cxx b/Source/cmDocumentationFormatterDocbook.cxx
index 30873306d..eabdbc128 100644
--- a/Source/cmDocumentationFormatterDocbook.cxx
+++ b/Source/cmDocumentationFormatterDocbook.cxx
@@ -34,7 +34,7 @@ static void cmDocumentationPrintDocbookChar(std::ostream& os, char c)
     case '<':
       os << "&lt;";
       break;
-    case '>': 
+    case '>':
       os << "&gt;";
       break;
     case '&':
@@ -126,13 +126,13 @@ void cmDocumentationFormatterDocbook
 
   std::string prefix = this->ComputeSectionLinkPrefix(name);
 
-  const std::vector<cmDocumentationEntry> &entries = 
+  const std::vector<cmDocumentationEntry> &entries =
     section.GetEntries();
 
   if (!entries.empty())
     {
     os << "<itemizedlist>\n";
-    for(std::vector<cmDocumentationEntry>::const_iterator op 
+    for(std::vector<cmDocumentationEntry>::const_iterator op
           = entries.begin(); op != entries.end(); ++ op )
       {
       if(op->Name.size())
@@ -147,7 +147,7 @@ void cmDocumentationFormatterDocbook
     os << "</itemizedlist>\n" ;
     }
 
-  for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin(); 
+  for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin();
       op != entries.end();)
     {
     if(op->Name.size())
@@ -160,8 +160,8 @@ void cmDocumentationFormatterDocbook
           cmDocumentationPrintDocbookEscapes(os, op->Name.c_str());
 
           // make sure that each id exists only once.  Since it seems
-          // not easily possible to determine which link refers to which id, 
-          // we have at least to make sure that the duplicated id's get a 
+          // not easily possible to determine which link refers to which id,
+          // we have at least to make sure that the duplicated id's get a
           // different name (by appending an increasing number), Alex
           std::string id = prefix;
           id += "_";
@@ -191,7 +191,7 @@ void cmDocumentationFormatterDocbook
         if(op->Full.size())
           {
           // a line break seems to be simply a line break with docbook
-          os << "\n    ";  
+          os << "\n    ";
           this->PrintFormatted(os, op->Full.c_str());
           }
         os << "\n";
@@ -210,7 +210,7 @@ void cmDocumentationFormatterDocbook
     }
 }
 
-void cmDocumentationFormatterDocbook::PrintPreformatted(std::ostream& os, 
+void cmDocumentationFormatterDocbook::PrintPreformatted(std::ostream& os,
                                                      const char* text)
 {
   os << "<literallayout>";
@@ -218,7 +218,7 @@ void cmDocumentationFormatterDocbook::PrintPreformatted(std::ostream& os,
   os << "</literallayout>\n    ";
 }
 
-void cmDocumentationFormatterDocbook::PrintParagraph(std::ostream& os, 
+void cmDocumentationFormatterDocbook::PrintParagraph(std::ostream& os,
                                                   const char* text)
 {
   os << "<para>";
@@ -232,7 +232,7 @@ void cmDocumentationFormatterDocbook::PrintHeader(const char* docname,
                                                   std::ostream& os)
 {
   // this one is used to ensure that we don't create multiple link targets
-  // with the same name. We can clear it here since we are at the 
+  // with the same name. We can clear it here since we are at the
   // start of a document here.
   this->EmittedLinkIds.clear();
 
diff --git a/Source/cmDocumentationFormatterHTML.cxx b/Source/cmDocumentationFormatterHTML.cxx
index cd0077ed9..7213b43de 100644
--- a/Source/cmDocumentationFormatterHTML.cxx
+++ b/Source/cmDocumentationFormatterHTML.cxx
@@ -29,7 +29,7 @@ static void cmDocumentationPrintHTMLChar(std::ostream& os, char c)
   // Use an escape sequence if necessary.
   switch (c)
     {
-    case '<': 
+    case '<':
       os << "&lt;";
       break;
     case '>':
@@ -114,7 +114,7 @@ void cmDocumentationFormatterHTML
 {
   std::string prefix = this->ComputeSectionLinkPrefix(name);
 
-  const std::vector<cmDocumentationEntry> &entries = 
+  const std::vector<cmDocumentationEntry> &entries =
     section.GetEntries();
 
   // skip the index if the help for only a single item (--help-command,
@@ -131,7 +131,7 @@ void cmDocumentationFormatterHTML
       }
 
     // Is a list needed?
-    for(std::vector<cmDocumentationEntry>::const_iterator op 
+    for(std::vector<cmDocumentationEntry>::const_iterator op
          = entries.begin(); op != entries.end(); ++ op )
       {
       if (op->Name.size())
@@ -154,7 +154,7 @@ void cmDocumentationFormatterHTML
       }
     }
 
-  for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin(); 
+  for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin();
       op != entries.end();)
     {
     if(op->Name.size())
@@ -191,7 +191,7 @@ void cmDocumentationFormatterHTML
     }
 }
 
-void cmDocumentationFormatterHTML::PrintPreformatted(std::ostream& os, 
+void cmDocumentationFormatterHTML::PrintPreformatted(std::ostream& os,
                                                      const char* text)
 {
   os << "<pre>";
@@ -199,7 +199,7 @@ void cmDocumentationFormatterHTML::PrintPreformatted(std::ostream& os,
   os << "</pre>\n    ";
 }
 
-void cmDocumentationFormatterHTML::PrintParagraph(std::ostream& os, 
+void cmDocumentationFormatterHTML::PrintParagraph(std::ostream& os,
                                                   const char* text)
 {
   os << "<p>";
@@ -229,7 +229,7 @@ void cmDocumentationFormatterHTML::PrintFooter(std::ostream& os)
 }
 
 //----------------------------------------------------------------------------
-void cmDocumentationFormatterHTML::PrintHTMLEscapes(std::ostream& os, 
+void cmDocumentationFormatterHTML::PrintHTMLEscapes(std::ostream& os,
                                                     const char* text)
 {
   // Hyperlink prefixes.
@@ -262,7 +262,7 @@ void cmDocumentationFormatterHTML
              std::vector<const cmDocumentationSection *>& sections)
 {
   // skip the index if only the help for a single item is printed
-  if ((sections.size() == 1) 
+  if ((sections.size() == 1)
        && (sections[0]->GetName(this->GetForm()) != 0 )
        && (std::string(sections[0]->GetName(this->GetForm())) == "SingleItem"))
     {
diff --git a/Source/cmDocumentationFormatterHTML.h b/Source/cmDocumentationFormatterHTML.h
index 427e04bc5..44bf24026 100644
--- a/Source/cmDocumentationFormatterHTML.h
+++ b/Source/cmDocumentationFormatterHTML.h
@@ -32,7 +32,7 @@ public:
                     const cmDocumentationSection& section,
                     const char* name);
   virtual void PrintPreformatted(std::ostream& os, const char* text);
-  virtual void PrintParagraph(std::ostream& os, const char* text); 
+  virtual void PrintParagraph(std::ostream& os, const char* text);
   virtual void PrintIndex(std::ostream& ,
                           std::vector<const cmDocumentationSection *>&);
 private:
diff --git a/Source/cmDocumentationFormatterText.cxx b/Source/cmDocumentationFormatterText.cxx
index 0b04b73d2..5def1947a 100644
--- a/Source/cmDocumentationFormatterText.cxx
+++ b/Source/cmDocumentationFormatterText.cxx
@@ -33,9 +33,9 @@ void cmDocumentationFormatterText
     os << name << "\n\n";
     }
 
-  const std::vector<cmDocumentationEntry> &entries = 
+  const std::vector<cmDocumentationEntry> &entries =
     section.GetEntries();
-  for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin(); 
+  for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin();
       op != entries.end(); ++op)
     {
     if(op->Name.size())
@@ -58,7 +58,7 @@ void cmDocumentationFormatterText
     }
 }
 
-void cmDocumentationFormatterText::PrintPreformatted(std::ostream& os, 
+void cmDocumentationFormatterText::PrintPreformatted(std::ostream& os,
                                                      const char* text)
 {
   bool newline = true;
@@ -78,7 +78,7 @@ void cmDocumentationFormatterText::PrintPreformatted(std::ostream& os,
   os << "\n";
 }
 
-void cmDocumentationFormatterText::PrintParagraph(std::ostream& os, 
+void cmDocumentationFormatterText::PrintParagraph(std::ostream& os,
                                                   const char* text)
 {
   os << this->TextIndent;
@@ -91,7 +91,7 @@ void cmDocumentationFormatterText::SetIndent(const char* indent)
   this->TextIndent = indent;
 }
 
-void cmDocumentationFormatterText::PrintColumn(std::ostream& os, 
+void cmDocumentationFormatterText::PrintColumn(std::ostream& os,
                                                const char* text)
 {
   // Print text arranged in an indented column of fixed witdh.
@@ -100,14 +100,14 @@ void cmDocumentationFormatterText::PrintColumn(std::ostream& os,
   bool newSentence = false;
   bool firstLine = true;
   int width = this->TextWidth - static_cast<int>(strlen(this->TextIndent));
-  
+
   // Loop until the end of the text.
   while(*l)
     {
     // Parse the next word.
     const char* r = l;
     while(*r && (*r != '\n') && (*r != ' ')) { ++r; }
-    
+
     // Does it fit on this line?
     if(r-l < (width-column-(newSentence?1:0)))
       {
@@ -135,12 +135,12 @@ void cmDocumentationFormatterText::PrintColumn(std::ostream& os,
           // first line.
           os << (firstLine?"":this->TextIndent);
           }
-        
+
         // Print the word.
         os.write(l, static_cast<long>(r-l));
         newSentence = (*(r-1) == '.');
         }
-      
+
       if(*r == '\n')
         {
         // Text provided a newline.  Start a new line.
@@ -175,6 +175,6 @@ void cmDocumentationFormatterText::PrintColumn(std::ostream& os,
 
     // Move to beginning of next word.  Skip over whitespace.
     l = r;
-    while(*l && (*l == ' ')) { ++l; }    
+    while(*l && (*l == ' ')) { ++l; }
     }
 }
diff --git a/Source/cmDocumentationFormatterUsage.cxx b/Source/cmDocumentationFormatterUsage.cxx
index 8a415cb4d..a068e5682 100644
--- a/Source/cmDocumentationFormatterUsage.cxx
+++ b/Source/cmDocumentationFormatterUsage.cxx
@@ -28,9 +28,9 @@ void cmDocumentationFormatterUsage
     os << name << "\n";
     }
 
-  const std::vector<cmDocumentationEntry> &entries = 
+  const std::vector<cmDocumentationEntry> &entries =
     section.GetEntries();
-  for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin(); 
+  for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin();
       op != entries.end(); ++op)
     {
     if(op->Name.size())
diff --git a/Source/cmDocumentationSection.h b/Source/cmDocumentationSection.h
index 0fab38f81..4f8c10d3e 100644
--- a/Source/cmDocumentationSection.h
+++ b/Source/cmDocumentationSection.h
@@ -26,28 +26,28 @@ public:
   /** Create a cmSection, with a special name for man-output mode. */
   cmDocumentationSection(const char* name, const char* manName)
     :Name(name), ManName(manName)       {}
-  
+
   /** Has any content been added to this section or is it empty ? */
   bool IsEmpty() const { return this->Entries.empty(); }
-  
+
   /** Clear contents. */
   void Clear() { this->Entries.clear(); }
-  
+
   /** Return the name of this section for the given output form. */
   const char* GetName(cmDocumentationEnums::Form form) const
   { return (form==cmDocumentationEnums::ManForm ?
             this->ManName.c_str() : this->Name.c_str()); }
-  
+
   /** Return a pointer to the first entry of this section. */
   const std::vector<cmDocumentationEntry> &GetEntries() const
   { return this->Entries; }
-  
+
   /** Append an entry to this section. */
   void Append(const cmDocumentationEntry& entry)
   { this->Entries.push_back(entry); }
   void Append(const std::vector<cmDocumentationEntry> &entries)
   { this->Entries.insert(this->Entries.end(),entries.begin(),entries.end()); }
-  
+
   /** Append an entry to this section using NULL terminated chars */
   void Append(const char *[][3]);
   void Append(const char *n, const char *b, const char *f);
@@ -58,7 +58,7 @@ public:
   { this->Entries.insert(this->Entries.begin(),
                          entries.begin(),entries.end()); }
 
-  
+
 private:
   std::string Name;
   std::string ManName;
diff --git a/Source/cmElseCommand.h b/Source/cmElseCommand.h
index 5e8b79058..f25991943 100644
--- a/Source/cmElseCommand.h
+++ b/Source/cmElseCommand.h
@@ -25,7 +25,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmElseCommand;
     }
@@ -54,7 +54,7 @@ public:
     {
     return "Starts the else portion of an if block.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -64,7 +64,7 @@ public:
       "  else(expression)\n"
       "See the if command.";
     }
-  
+
   cmTypeMacro(cmElseCommand, cmCommand);
 };
 
diff --git a/Source/cmElseIfCommand.h b/Source/cmElseIfCommand.h
index 20cd81aaa..46e2bd9f9 100644
--- a/Source/cmElseIfCommand.h
+++ b/Source/cmElseIfCommand.h
@@ -25,7 +25,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmElseIfCommand;
     }
@@ -54,7 +54,7 @@ public:
     {
     return "Starts the elseif portion of an if block.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -64,7 +64,7 @@ public:
       "  elseif(expression)\n"
       "See the if command.";
     }
-  
+
   cmTypeMacro(cmElseIfCommand, cmCommand);
 };
 
diff --git a/Source/cmEnableLanguageCommand.cxx b/Source/cmEnableLanguageCommand.cxx
index f8f36ebbb..dcabf6a46 100644
--- a/Source/cmEnableLanguageCommand.cxx
+++ b/Source/cmEnableLanguageCommand.cxx
@@ -22,7 +22,7 @@ bool cmEnableLanguageCommand
     this->SetError
       ("called with incorrect number of arguments");
     return false;
-    } 
+    }
   for (std::vector<std::string>::const_iterator it = args.begin();
        it != args.end();
        ++it)
diff --git a/Source/cmEnableLanguageCommand.h b/Source/cmEnableLanguageCommand.h
index 5958e4481..e4bb2517a 100644
--- a/Source/cmEnableLanguageCommand.h
+++ b/Source/cmEnableLanguageCommand.h
@@ -28,7 +28,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmEnableLanguageCommand;
     }
@@ -39,7 +39,7 @@ public:
    */
   virtual bool InitialPass(std::vector<std::string> const& args,
                            cmExecutionStatus &status);
-  
+
   /**
    * The name of the command as specified in CMakeList.txt.
    */
@@ -52,7 +52,7 @@ public:
     {
     return "Enable a language (CXX/C/Fortran/etc)";
     }
-  
+
   /**
    * More documentation.
    */
@@ -67,7 +67,7 @@ public:
       "If OPTIONAL is used, use the CMAKE_<languageName>_COMPILER_WORKS "
       "variable to check whether the language has been enabled successfully.";
     }
-  
+
   cmTypeMacro(cmEnableLanguageCommand, cmCommand);
 };
 
diff --git a/Source/cmEnableTestingCommand.cxx b/Source/cmEnableTestingCommand.cxx
index 5abb873bd..aa41ef73b 100644
--- a/Source/cmEnableTestingCommand.cxx
+++ b/Source/cmEnableTestingCommand.cxx
@@ -12,7 +12,7 @@
 #include "cmEnableTestingCommand.h"
 #include "cmLocalGenerator.h"
 
-// we do this in the final pass so that we now the subdirs have all 
+// we do this in the final pass so that we now the subdirs have all
 // been defined
 bool cmEnableTestingCommand::InitialPass(std::vector<std::string> const&,
                                          cmExecutionStatus &)
diff --git a/Source/cmEnableTestingCommand.h b/Source/cmEnableTestingCommand.h
index b607818ce..9b9e9851b 100644
--- a/Source/cmEnableTestingCommand.h
+++ b/Source/cmEnableTestingCommand.h
@@ -24,7 +24,7 @@
  * within the valid control structures are replicated in Testfile
  * (i.e. SUBDIRS() and ADD_TEST() commands within IF() commands that are
  * not entered by CMake are not replicated in Testfile).
- * Note that CTest expects to find this file in the build directory root; 
+ * Note that CTest expects to find this file in the build directory root;
  * therefore, this command should be in the source directory root too.
  */
 class cmEnableTestingCommand : public cmCommand
@@ -33,7 +33,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmEnableTestingCommand;
     }
@@ -57,7 +57,7 @@ public:
     {
     return "Enable testing for current directory and below.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -70,9 +70,9 @@ public:
       "a test file in the build directory root.  Therefore, this command "
       "should be in the source directory root.";
     }
-  
+
   cmTypeMacro(cmEnableTestingCommand, cmCommand);
-  
+
 };
 
 
diff --git a/Source/cmEndForEachCommand.cxx b/Source/cmEndForEachCommand.cxx
index 2eca4e292..7f11ae5f9 100644
--- a/Source/cmEndForEachCommand.cxx
+++ b/Source/cmEndForEachCommand.cxx
@@ -12,7 +12,7 @@
 #include "cmEndForEachCommand.h"
 
 bool cmEndForEachCommand
-::InvokeInitialPass(std::vector<cmListFileArgument> const&, 
+::InvokeInitialPass(std::vector<cmListFileArgument> const&,
                     cmExecutionStatus &)
 {
   this->SetError("An ENDFOREACH command was found outside of a proper "
diff --git a/Source/cmEndForEachCommand.h b/Source/cmEndForEachCommand.h
index 37b2d2a32..d5ee8a6ae 100644
--- a/Source/cmEndForEachCommand.h
+++ b/Source/cmEndForEachCommand.h
@@ -25,7 +25,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmEndForEachCommand;
     }
@@ -36,7 +36,7 @@ public:
    */
   virtual bool InvokeInitialPass(std::vector<cmListFileArgument> const&,
                                  cmExecutionStatus &);
-  
+
   /**
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
@@ -61,7 +61,7 @@ public:
     {
     return "Ends a list of commands in a FOREACH block.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -71,7 +71,7 @@ public:
       "  endforeach(expression)\n"
       "See the FOREACH command.";
     }
-  
+
   cmTypeMacro(cmEndForEachCommand, cmCommand);
 };
 
diff --git a/Source/cmEndFunctionCommand.h b/Source/cmEndFunctionCommand.h
index 54ac068f3..d7b74e98b 100644
--- a/Source/cmEndFunctionCommand.h
+++ b/Source/cmEndFunctionCommand.h
@@ -25,7 +25,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmEndFunctionCommand;
     }
@@ -36,7 +36,7 @@ public:
    */
   virtual bool InvokeInitialPass(std::vector<cmListFileArgument> const&,
                                  cmExecutionStatus &);
-  
+
   /**
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
@@ -61,7 +61,7 @@ public:
     {
     return "Ends a list of commands in a function block.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -71,7 +71,7 @@ public:
       "  endfunction(expression)\n"
       "See the function command.";
     }
-  
+
   cmTypeMacro(cmEndFunctionCommand, cmCommand);
 };
 
diff --git a/Source/cmEndIfCommand.cxx b/Source/cmEndIfCommand.cxx
index e98d4d415..0ac09de72 100644
--- a/Source/cmEndIfCommand.cxx
+++ b/Source/cmEndIfCommand.cxx
@@ -20,7 +20,7 @@ bool cmEndIfCommand::InitialPass(std::vector<std::string> const&,
     {
     return true;
     }
-  
+
   this->SetError("An ENDIF command was found outside of a proper "
                  "IF ENDIF structure. Or its arguments did not match "
                  "the opening IF command.");
diff --git a/Source/cmEndIfCommand.h b/Source/cmEndIfCommand.h
index 81d1b5ff4..5c4b9e36a 100644
--- a/Source/cmEndIfCommand.h
+++ b/Source/cmEndIfCommand.h
@@ -25,7 +25,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmEndIfCommand;
     }
@@ -54,7 +54,7 @@ public:
     {
     return "Ends a list of commands in an if block.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -64,7 +64,7 @@ public:
       "  endif(expression)\n"
       "See the if command.";
     }
-  
+
   cmTypeMacro(cmEndIfCommand, cmCommand);
 };
 
diff --git a/Source/cmEndMacroCommand.h b/Source/cmEndMacroCommand.h
index 25e86b70f..9d0e70fdc 100644
--- a/Source/cmEndMacroCommand.h
+++ b/Source/cmEndMacroCommand.h
@@ -25,7 +25,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmEndMacroCommand;
     }
@@ -36,7 +36,7 @@ public:
    */
   virtual bool InvokeInitialPass(std::vector<cmListFileArgument> const&,
                                  cmExecutionStatus &);
-  
+
   /**
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
@@ -61,7 +61,7 @@ public:
     {
     return "Ends a list of commands in a macro block.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -71,7 +71,7 @@ public:
       "  endmacro(expression)\n"
       "See the macro command.";
     }
-  
+
   cmTypeMacro(cmEndMacroCommand, cmCommand);
 };
 
diff --git a/Source/cmEndWhileCommand.h b/Source/cmEndWhileCommand.h
index 635ad5a7f..18ba5ea31 100644
--- a/Source/cmEndWhileCommand.h
+++ b/Source/cmEndWhileCommand.h
@@ -25,7 +25,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmEndWhileCommand;
     }
@@ -36,7 +36,7 @@ public:
    */
   virtual bool InvokeInitialPass(std::vector<cmListFileArgument> const& args,
                                  cmExecutionStatus &status);
-  
+
   /**
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
@@ -61,7 +61,7 @@ public:
     {
     return "Ends a list of commands in a while block.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -71,7 +71,7 @@ public:
       "  endwhile(expression)\n"
       "See the while command.";
     }
-  
+
   cmTypeMacro(cmEndWhileCommand, cmCommand);
 };
 
diff --git a/Source/cmExecProgramCommand.cxx b/Source/cmExecProgramCommand.cxx
index 61b27eaf0..9fdb1e896 100644
--- a/Source/cmExecProgramCommand.cxx
+++ b/Source/cmExecProgramCommand.cxx
@@ -36,7 +36,7 @@ bool cmExecProgramCommand
       doingargs = false;
       havereturn_variable = false;
       haveoutput_variable = true;
-      }    
+      }
     else if ( haveoutput_variable )
       {
       if ( output_variable.size() > 0 )
@@ -54,7 +54,7 @@ bool cmExecProgramCommand
       doingargs = false;
       haveoutput_variable = false;
       havereturn_variable = true;
-      }    
+      }
     else if ( havereturn_variable )
       {
       if ( return_variable.size() > 0 )
@@ -108,16 +108,16 @@ bool cmExecProgramCommand
     }
   else
     {
-    result = cmSystemTools::RunCommand(command.c_str(), output, 
+    result = cmSystemTools::RunCommand(command.c_str(), output,
                                        retVal, 0, verbose);
     }
   if(!result)
     {
     retVal = -1;
-    }  
+    }
 
   if ( output_variable.size() > 0 )
-    {    
+    {
     std::string::size_type first = output.find_first_not_of(" \n\t\r");
     std::string::size_type last = output.find_last_not_of(" \n\t\r");
     if(first == std::string::npos)
@@ -128,7 +128,7 @@ bool cmExecProgramCommand
       {
       last = output.size()-1;
       }
-    
+
     std::string coutput = std::string(output, first, last-first+1);
     this->Makefile->AddDefinition(output_variable.c_str(), coutput.c_str());
     }
@@ -139,7 +139,7 @@ bool cmExecProgramCommand
     sprintf(buffer, "%d", retVal);
     this->Makefile->AddDefinition(return_variable.c_str(), buffer);
     }
-  
+
   return true;
 }
 
diff --git a/Source/cmExecProgramCommand.h b/Source/cmExecProgramCommand.h
index 723386099..f752501fa 100644
--- a/Source/cmExecProgramCommand.h
+++ b/Source/cmExecProgramCommand.h
@@ -27,7 +27,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmExecProgramCommand;
     }
@@ -38,13 +38,13 @@ public:
    */
   virtual bool InitialPass(std::vector<std::string> const& args,
                            cmExecutionStatus &status);
-  
+
   /**
    * The name of the command as specified in CMakeList.txt.
    */
   virtual const char* GetName() const
     {return "exec_program";}
-  
+
   /**
    * This determines if the command is invoked when in script mode.
    */
@@ -55,10 +55,10 @@ public:
    */
   virtual const char* GetTerseDocumentation() const
     {
-    return 
+    return
       "Deprecated.  Use the execute_process() command instead.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -82,7 +82,7 @@ public:
       "stdout/stderr of the console running cmake.\n"
       ;
     }
-  
+
   /** This command is kept for compatibility with older CMake versions. */
   virtual bool IsDiscouraged() const
     {
diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx
index a0d9c9caf..994c1707b 100644
--- a/Source/cmExecuteProcessCommand.cxx
+++ b/Source/cmExecuteProcessCommand.cxx
@@ -266,12 +266,12 @@ bool cmExecuteProcessCommand
     }
   if(!output_file.empty())
     {
-    cmsysProcess_SetPipeFile(cp, cmsysProcess_Pipe_STDOUT, 
+    cmsysProcess_SetPipeFile(cp, cmsysProcess_Pipe_STDOUT,
                              output_file.c_str());
     }
   if(!error_file.empty())
     {
-    cmsysProcess_SetPipeFile(cp, cmsysProcess_Pipe_STDERR, 
+    cmsysProcess_SetPipeFile(cp, cmsysProcess_Pipe_STDERR,
                              error_file.c_str());
     }
 
@@ -326,12 +326,12 @@ bool cmExecuteProcessCommand
   // Store the output obtained.
   if(!output_variable.empty() && tempOutput.size())
     {
-    this->Makefile->AddDefinition(output_variable.c_str(), 
+    this->Makefile->AddDefinition(output_variable.c_str(),
                                   &*tempOutput.begin());
     }
   if(!merge_output && !error_variable.empty() && tempError.size())
     {
-    this->Makefile->AddDefinition(error_variable.c_str(), 
+    this->Makefile->AddDefinition(error_variable.c_str(),
                                   &*tempError.begin());
     }
 
diff --git a/Source/cmExecutionStatus.h b/Source/cmExecutionStatus.h
index 9fbecacfe..1488924c7 100644
--- a/Source/cmExecutionStatus.h
+++ b/Source/cmExecutionStatus.h
@@ -23,19 +23,19 @@ class cmExecutionStatus : public cmObject
 {
 public:
   cmTypeMacro(cmExecutionStatus, cmObject);
-  
+
   cmExecutionStatus() { this->Clear();};
-  
-  virtual void SetReturnInvoked(bool val) 
+
+  virtual void SetReturnInvoked(bool val)
   { this->ReturnInvoked = val; }
   virtual bool GetReturnInvoked()
   { return this->ReturnInvoked; }
-                                 
-  virtual void SetBreakInvoked(bool val) 
+
+  virtual void SetBreakInvoked(bool val)
   { this->BreakInvoked = val; }
   virtual bool GetBreakInvoked()
   { return this->BreakInvoked; }
-            
+
   virtual void Clear()
     {
     this->ReturnInvoked = false;
@@ -45,7 +45,7 @@ public:
   virtual void SetNestedError(bool val) { this->NestedError = val; }
   virtual bool GetNestedError() { return this->NestedError; }
 
-                                        
+
 protected:
   bool ReturnInvoked;
   bool BreakInvoked;
diff --git a/Source/cmExportLibraryDependencies.cxx b/Source/cmExportLibraryDependencies.cxx
index 8fdb069da..f07b783d6 100644
--- a/Source/cmExportLibraryDependencies.cxx
+++ b/Source/cmExportLibraryDependencies.cxx
@@ -26,7 +26,7 @@ bool cmExportLibraryDependenciesCommand
     this->SetError("called with incorrect number of arguments");
     return false;
     }
-  
+
   // store the arguments for the final pass
   this->Filename = args[0];
   this->Append = false;
diff --git a/Source/cmExportLibraryDependencies.h b/Source/cmExportLibraryDependencies.h
index 2a2ff215e..d8b65ccf1 100644
--- a/Source/cmExportLibraryDependencies.h
+++ b/Source/cmExportLibraryDependencies.h
@@ -18,7 +18,7 @@
  * \brief Add a test to the lists of tests to run.
  *
  * cmExportLibraryDependenciesCommand adds a test to the list of tests to run
- * 
+ *
  */
 class cmExportLibraryDependenciesCommand : public cmCommand
 {
@@ -26,7 +26,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmExportLibraryDependenciesCommand;
     }
@@ -40,7 +40,7 @@ public:
 
   /**
    * This is called at the end after all the information
-   * specified by the command is accumulated. 
+   * specified by the command is accumulated.
    */
   virtual void FinalPass();
   virtual bool HasFinalPass() const { return true; }
@@ -57,7 +57,7 @@ public:
     {
     return "Deprecated.  Use INSTALL(EXPORT) or EXPORT command.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -87,7 +87,7 @@ public:
     {
     return true;
     }
-  
+
   cmTypeMacro(cmExportLibraryDependenciesCommand, cmCommand);
 
 private:
diff --git a/Source/cmExprLexer.h b/Source/cmExprLexer.h
index 4c10496ab..03b36cec5 100644
--- a/Source/cmExprLexer.h
+++ b/Source/cmExprLexer.h
@@ -58,7 +58,7 @@ typedef uint32_t flex_uint32_t;
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
 typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t; 
+typedef unsigned char flex_uint8_t;
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
 #endif /* ! C99 */
@@ -188,7 +188,7 @@ struct yy_buffer_state
 
     int yy_bs_lineno; /**< The line count. */
     int yy_bs_column; /**< The column count. */
-    
+
   /* Whether to try to fill the input buffer when we reach the
    * end of it.
    */
diff --git a/Source/cmExprLexer.in.l b/Source/cmExprLexer.in.l
index db9018f99..f344b40ff 100644
--- a/Source/cmExprLexer.in.l
+++ b/Source/cmExprLexer.in.l
@@ -54,19 +54,19 @@ Modify cmExprLexer.h:
 
 %%
 
-[0-9][0-9]* { yylvalp->Number = atoi(yytext); return exp_NUMBER; } 
+[0-9][0-9]* { yylvalp->Number = atoi(yytext); return exp_NUMBER; }
 
 "+" { return exp_PLUS; }
-"-" { return exp_MINUS; } 
-"*" { return exp_TIMES; } 
-"/" { return exp_DIVIDE; } 
-"%" { return exp_MOD; } 
-"\|" { return exp_OR; } 
-"&" { return exp_AND; } 
-"^" { return exp_XOR; } 
-"~" { return exp_NOT; } 
-"<<" { return exp_SHIFTLEFT; } 
-">>" { return exp_SHIFTRIGHT; } 
+"-" { return exp_MINUS; }
+"*" { return exp_TIMES; }
+"/" { return exp_DIVIDE; }
+"%" { return exp_MOD; }
+"\|" { return exp_OR; }
+"&" { return exp_AND; }
+"^" { return exp_XOR; }
+"~" { return exp_NOT; }
+"<<" { return exp_SHIFTLEFT; }
+">>" { return exp_SHIFTRIGHT; }
 "(" { return exp_OPENPARENT; }
 ")" { return exp_CLOSEPARENT; }
 
diff --git a/Source/cmExprParserHelper.cxx b/Source/cmExprParserHelper.cxx
index 7728d740b..9c1795ec2 100644
--- a/Source/cmExprParserHelper.cxx
+++ b/Source/cmExprParserHelper.cxx
@@ -42,7 +42,7 @@ int cmExprParserHelper::ParseString(const char* str, int verb)
   this->InputBuffer = str;
   this->InputBufferPos = 0;
   this->CurrentLine = 0;
-  
+
   this->Result = 0;
 
   yyscan_t yyscanner;
@@ -61,7 +61,7 @@ int cmExprParserHelper::ParseString(const char* str, int verb)
 
   if ( Verbose )
     {
-    std::cerr << "Expanding [" << str << "] produced: [" 
+    std::cerr << "Expanding [" << str << "] produced: ["
               << this->Result << "]" << std::endl;
     }
   return 1;
diff --git a/Source/cmExprParserHelper.h b/Source/cmExprParserHelper.h
index 690426d8d..4b76b3322 100644
--- a/Source/cmExprParserHelper.h
+++ b/Source/cmExprParserHelper.h
@@ -9,7 +9,7 @@
   implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the License for more information.
 ============================================================================*/
-#ifndef cmExprParserHelper_h 
+#ifndef cmExprParserHelper_h
 #define cmExprParserHelper_h
 
 #include "cmStandardIncludes.h"
diff --git a/Source/cmExternalMakefileProjectGenerator.cxx b/Source/cmExternalMakefileProjectGenerator.cxx
index 6ed84bd95..9c965cc24 100644
--- a/Source/cmExternalMakefileProjectGenerator.cxx
+++ b/Source/cmExternalMakefileProjectGenerator.cxx
@@ -49,7 +49,7 @@ const char* cmExternalMakefileProjectGenerator::GetGlobalGeneratorName(
     }
 
   // otherwise search for the matching global generator
-  for (std::vector<std::string>::const_iterator 
+  for (std::vector<std::string>::const_iterator
        it = this->SupportedGlobalGenerators.begin();
        it != this->SupportedGlobalGenerators.end();
        ++it)
diff --git a/Source/cmExternalMakefileProjectGenerator.h b/Source/cmExternalMakefileProjectGenerator.h
index 46f1d310b..182c1a8f6 100644
--- a/Source/cmExternalMakefileProjectGenerator.h
+++ b/Source/cmExternalMakefileProjectGenerator.h
@@ -22,12 +22,12 @@ class cmGlobalGenerator;
  * \brief Base class for generators for "External Makefile based IDE projects".
  *
  * cmExternalMakefileProjectGenerator is a base class for generators
- * for "external makefile based projects", i.e. IDE projects which work 
+ * for "external makefile based projects", i.e. IDE projects which work
  * an already existing makefiles.
  * See cmGlobalKdevelopGenerator as an example.
- * After the makefiles have been generated by one of the Makefile 
+ * After the makefiles have been generated by one of the Makefile
  * generators, the Generate() method is called and this generator
- * can iterate over the local generators and/or projects to produce the 
+ * can iterate over the local generators and/or projects to produce the
  * project files for the IDE.
  */
 class cmExternalMakefileProjectGenerator
@@ -39,7 +39,7 @@ public:
   ///! Get the name for this generator.
   virtual const char* GetName() const = 0;
   /** Get the documentation entry for this generator.  */
-  virtual void GetDocumentation(cmDocumentationEntry& entry, 
+  virtual void GetDocumentation(cmDocumentationEntry& entry,
                                 const char* fullName) const = 0;
 
   ///! set the global generator which will generate the makefiles
@@ -47,7 +47,7 @@ public:
                                            {this->GlobalGenerator = generator;}
 
   ///! Return the list of global generators supported by this extra generator
-  const std::vector<std::string>& GetSupportedGlobalGenerators() const 
+  const std::vector<std::string>& GetSupportedGlobalGenerators() const
                                       {return this->SupportedGlobalGenerators;}
 
   ///! Get the name of the global generator for the given full name
@@ -55,7 +55,7 @@ public:
   /** Create a full name from the given global generator name and the
    * extra generator name
    */
-  static std::string CreateFullGeneratorName(const char* globalGenerator, 
+  static std::string CreateFullGeneratorName(const char* globalGenerator,
                                              const char* extraGenerator);
 
   ///! Generate the project files, the Makefiles have already been generated
diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx
index 93533e57c..a4aa75a7d 100644
--- a/Source/cmFLTKWrapUICommand.cxx
+++ b/Source/cmFLTKWrapUICommand.cxx
@@ -33,19 +33,19 @@ bool cmFLTKWrapUICommand
 
   std::vector<std::string> newArgs;
   this->Makefile->ExpandSourceListArguments(args,newArgs, 1);
-  
-  // get the list of GUI files from which .cxx and .h will be generated 
+
+  // get the list of GUI files from which .cxx and .h will be generated
   std::string outputDirectory = this->Makefile->GetCurrentOutputDirectory();
 
-  // Some of the generated files are *.h so the directory "GUI" 
+  // Some of the generated files are *.h so the directory "GUI"
   // where they are created have to be added to the include path
   this->Makefile->AddIncludeDirectory( outputDirectory.c_str() );
 
-  for(std::vector<std::string>::iterator i = (newArgs.begin() + 1); 
+  for(std::vector<std::string>::iterator i = (newArgs.begin() + 1);
       i != newArgs.end(); i++)
     {
     cmSourceFile *curr = this->Makefile->GetSource(i->c_str());
-    // if we should use the source GUI 
+    // if we should use the source GUI
     // to generate .cxx and .h files
     if (!curr || !curr->GetPropertyAsBool("WRAP_EXCLUDE"))
       {
@@ -107,11 +107,11 @@ bool cmFLTKWrapUICommand
   std::string varName = this->Target;
   varName += "_FLTK_UI_SRCS";
   this->Makefile->AddDefinition(varName.c_str(), sourceListValue.c_str());
-  
+
   return true;
 }
 
-void cmFLTKWrapUICommand::FinalPass() 
+void cmFLTKWrapUICommand::FinalPass()
 {
   // people should add the srcs to the target themselves, but the old command
   // didn't support that, so check and see if they added the files in and if
@@ -119,7 +119,7 @@ void cmFLTKWrapUICommand::FinalPass()
   cmTarget* target = this->Makefile->FindTarget(this->Target.c_str());
   if(!target)
     {
-    std::string msg = 
+    std::string msg =
       "FLTK_WRAP_UI was called with a target that was never created: ";
     msg += this->Target;
     msg +=".  The problem was found while processing the source directory: ";
@@ -128,12 +128,12 @@ void cmFLTKWrapUICommand::FinalPass()
     cmSystemTools::Message(msg.c_str(),"Warning");
     return;
     }
-  std::vector<cmSourceFile*> const& srcs = 
+  std::vector<cmSourceFile*> const& srcs =
     target->GetSourceFiles();
   bool found = false;
   for (unsigned int i = 0; i < srcs.size(); ++i)
     {
-    if (srcs[i]->GetFullPath() == 
+    if (srcs[i]->GetFullPath() ==
         this->GeneratedSourcesClasses[0]->GetFullPath())
       {
       found = true;
@@ -142,7 +142,7 @@ void cmFLTKWrapUICommand::FinalPass()
     }
   if (!found)
     {
-    std::string msg = 
+    std::string msg =
       "In CMake 2.2 the FLTK_WRAP_UI command sets a variable to the list of "
       "source files that should be added to your executable or library. It "
       "appears that you have not added these source files to your target. "
@@ -153,13 +153,13 @@ void cmFLTKWrapUICommand::FinalPass()
       "of sources to add to your target when you call ADD_LIBRARY or "
       "ADD_EXECUTABLE. For now CMake will add the sources to your target "
       "for you as was done in CMake 2.0 and earlier. In the future this may "
-      "become an error."; 
+      "become an error.";
     msg +="The problem was found while processing the source directory: ";
     msg += this->Makefile->GetStartDirectory();
     cmSystemTools::Message(msg.c_str(),"Warning");
     // first we add the rules for all the .fl to .h and .cxx files
     size_t lastHeadersClass = this->GeneratedSourcesClasses.size();
-    
+
     // Generate code for all the .fl files
     for(size_t classNum = 0; classNum < lastHeadersClass; classNum++)
       {
diff --git a/Source/cmFLTKWrapUICommand.h b/Source/cmFLTKWrapUICommand.h
index cb0f9d534..530de2c96 100644
--- a/Source/cmFLTKWrapUICommand.h
+++ b/Source/cmFLTKWrapUICommand.h
@@ -28,7 +28,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmFLTKWrapUICommand;
     }
@@ -39,7 +39,7 @@ public:
    */
   virtual bool InitialPass(std::vector<std::string> const& args,
                            cmExecutionStatus &status);
-  
+
   /**
    * This is called at the end after all the information
    * specified by the command is accumulated. Most commands do
@@ -61,7 +61,7 @@ public:
     {
     return "Create FLTK user interfaces Wrappers.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -75,7 +75,7 @@ public:
       "resultingLibraryName_FLTK_UI_SRCS which should be added to your "
       "library.";
     }
-  
+
 private:
   /**
    * List of produced files.
@@ -83,7 +83,7 @@ private:
   std::vector<cmSourceFile *> GeneratedSourcesClasses;
 
   /**
-   * List of Fluid files that provide the source 
+   * List of Fluid files that provide the source
    * generating .cxx and .h files
    */
   std::string Target;
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 5da5a0181..5103d395c 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -271,7 +271,7 @@ bool cmFileCommand::HandleReadCommand(std::vector<std::string> const& args)
 
   // Open the specified file.
 #if defined(_WIN32) || defined(__CYGWIN__)
-  std::ifstream file(fileName.c_str(), std::ios::in | 
+  std::ifstream file(fileName.c_str(), std::ios::in |
                (hexOutputArg.IsEnabled() ? std::ios::binary : std::ios::in));
 #else
   std::ifstream file(fileName.c_str(), std::ios::in);
@@ -2621,17 +2621,17 @@ namespace {
           ::curl_easy_cleanup(this->Easy);
           }
       }
-    
-    inline void release(void) 
+
+    inline void release(void)
       {
         this->Easy = 0;
         return;
       }
-    
+
   private:
     ::CURL * Easy;
   };
-  
+
 }
 #endif
 
diff --git a/Source/cmFileTimeComparison.cxx b/Source/cmFileTimeComparison.cxx
index b1050d311..3167be496 100644
--- a/Source/cmFileTimeComparison.cxx
+++ b/Source/cmFileTimeComparison.cxx
@@ -116,7 +116,7 @@ cmFileTimeComparison::~cmFileTimeComparison()
 }
 
 //----------------------------------------------------------------------------
-bool cmFileTimeComparison::FileTimeCompare(const char* f1, 
+bool cmFileTimeComparison::FileTimeCompare(const char* f1,
                                            const char* f2, int* result)
 {
   return this->Internals->FileTimeCompare(f1, f2, result);
@@ -129,7 +129,7 @@ bool cmFileTimeComparison::FileTimesDiffer(const char* f1, const char* f2)
 }
 
 //----------------------------------------------------------------------------
-int cmFileTimeComparisonInternal::Compare(cmFileTimeComparison_Type* s1, 
+int cmFileTimeComparisonInternal::Compare(cmFileTimeComparison_Type* s1,
                                           cmFileTimeComparison_Type* s2)
 {
 #if !defined(_WIN32) || defined(__CYGWIN__)
diff --git a/Source/cmFileTimeComparison.h b/Source/cmFileTimeComparison.h
index f5de2f619..cc1ef633d 100644
--- a/Source/cmFileTimeComparison.h
+++ b/Source/cmFileTimeComparison.h
@@ -31,7 +31,7 @@ public:
    *  Compare file modification times.
    *  Return true for successful comparison and false for error.
    *  When true is returned, result has -1, 0, +1 for
-   *  f1 older, same, or newer than f2.  
+   *  f1 older, same, or newer than f2.
    */
   bool FileTimeCompare(const char* f1, const char* f2, int* result);
 
@@ -42,7 +42,7 @@ public:
   bool FileTimesDiffer(const char* f1, const char* f2);
 
 protected:
-  
+
   cmFileTimeComparisonInternal* Internals;
 };
 
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index fb8bcf78d..a54bf7c4a 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -10,7 +10,7 @@
   See the License for more information.
 ============================================================================*/
 #include "cmFindBase.h"
-  
+
 cmFindBase::cmFindBase()
 {
   this->AlreadyInCache = false;
@@ -132,7 +132,7 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
   bool compatibility = this->Makefile->NeedBackwardsCompatibility(2,3);
 
   // copy argsIn into args so it can be modified,
-  // in the process extract the DOC "documentation" 
+  // in the process extract the DOC "documentation"
   size_t size = argsIn.size();
   std::vector<std::string> args;
   bool foundDoc = false;
@@ -178,7 +178,7 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
     this->AlreadyInCache = true;
     return true;
     }
-  this->AlreadyInCache = false; 
+  this->AlreadyInCache = false;
 
   // Find the current root path mode.
   this->SelectDefaultRootPathMode();
@@ -264,17 +264,17 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
       }
     else if(this->Names.size() == 1)
       {
-      this->VariableDocumentation += "the " 
+      this->VariableDocumentation += "the "
         + this->Names[0] + " library be found";
       }
     else
-      { 
+      {
       this->VariableDocumentation += "one of the " + this->Names[0];
       for (unsigned int j = 1; j < this->Names.size() - 1; ++j)
         {
         this->VariableDocumentation += ", " + this->Names[j];
         }
-      this->VariableDocumentation += " or " 
+      this->VariableDocumentation += " or "
         + this->Names[this->Names.size() - 1] + " libraries be found";
       }
     }
@@ -504,7 +504,7 @@ void cmFindBase::AddPathSuffixes()
     cmSystemTools::ConvertToUnixSlashes(*i);
     // copy each finalPath combined with SearchPathSuffixes
     // to the SearchPaths ivar
-    for(std::vector<std::string>::iterator j = 
+    for(std::vector<std::string>::iterator j =
           this->SearchPathSuffixes.begin();
         j != this->SearchPathSuffixes.end(); ++j)
       {
@@ -517,7 +517,7 @@ void cmFindBase::AddPathSuffixes()
         p += std::string("/");
         }
       p +=  *j;
-      // add to all paths because the search path may be modified 
+      // add to all paths because the search path may be modified
       // later with lib being replaced for lib64 which may exist
       paths.push_back(p);
       }
@@ -535,13 +535,13 @@ void cmFindBase::PrintFindStuff()
   std::cerr << "SearchAppBundleOnly: " << this->SearchAppBundleOnly << "\n";
   std::cerr << "SearchAppBundleFirst: " << this->SearchAppBundleFirst << "\n";
   std::cerr << "VariableName " << this->VariableName << "\n";
-  std::cerr << "VariableDocumentation " 
+  std::cerr << "VariableDocumentation "
             << this->VariableDocumentation << "\n";
   std::cerr << "NoDefaultPath " << this->NoDefaultPath << "\n";
-  std::cerr << "NoCMakeEnvironmentPath " 
+  std::cerr << "NoCMakeEnvironmentPath "
             << this->NoCMakeEnvironmentPath << "\n";
   std::cerr << "NoCMakePath " << this->NoCMakePath << "\n";
-  std::cerr << "NoSystemEnvironmentPath " 
+  std::cerr << "NoSystemEnvironmentPath "
             << this->NoSystemEnvironmentPath << "\n";
   std::cerr << "NoCMakeSystemPath " << this->NoCMakeSystemPath << "\n";
   std::cerr << "EnvironmentPath " << this->EnvironmentPath << "\n";
diff --git a/Source/cmFindBase.h b/Source/cmFindBase.h
index 37ab2ecd2..eac1885f3 100644
--- a/Source/cmFindBase.h
+++ b/Source/cmFindBase.h
@@ -30,7 +30,7 @@ public:
    */
   virtual bool ParseArguments(std::vector<std::string> const& args);
   cmTypeMacro(cmFindBase, cmFindCommon);
-  
+
   virtual const char* GetFullDocumentation() const;
 
 protected:
@@ -43,7 +43,7 @@ protected:
   // also copy the documentation from the cache to VariableDocumentation
   // if it has documentation in the cache
   bool CheckForVariableInCache();
-  
+
   cmStdString GenericDocumentation;
   // use by command during find
   cmStdString VariableDocumentation;
diff --git a/Source/cmFindFileCommand.h b/Source/cmFindFileCommand.h
index 7d349d33c..1bfdcbd16 100644
--- a/Source/cmFindFileCommand.h
+++ b/Source/cmFindFileCommand.h
@@ -18,7 +18,7 @@
  * \brief Define a command to search for an executable program.
  *
  * cmFindFileCommand is used to define a CMake variable
- * that specifies an executable program. The command searches 
+ * that specifies an executable program. The command searches
  * in the current path (e.g., PATH environment variable) for
  * an executable that matches one of the supplied names.
  */
@@ -29,7 +29,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmFindFileCommand;
     }
@@ -42,7 +42,7 @@ public:
     {
     return "Find the full path to a file.";
     }
-  
+
   cmTypeMacro(cmFindFileCommand, cmFindPathCommand);
 protected:
   virtual void GenerateDocumentation();
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx
index 652e697ed..0080e55aa 100644
--- a/Source/cmFindLibraryCommand.cxx
+++ b/Source/cmFindLibraryCommand.cxx
@@ -15,7 +15,7 @@
 #include <cmsys/stl/algorithm>
 
 cmFindLibraryCommand::cmFindLibraryCommand()
-{ 
+{
   this->EnvironmentPath = "LIB";
 }
 
diff --git a/Source/cmFindLibraryCommand.h b/Source/cmFindLibraryCommand.h
index 31a5c3f8d..455348aaf 100644
--- a/Source/cmFindLibraryCommand.h
+++ b/Source/cmFindLibraryCommand.h
@@ -29,7 +29,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmFindLibraryCommand;
     }
@@ -59,7 +59,7 @@ public:
     return "Find a library.";
     }
   cmTypeMacro(cmFindLibraryCommand, cmFindBase);
-  
+
 protected:
   void AddArchitecturePaths(const char* suffix);
   void AddArchitecturePath(std::string const& dir,
diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx
index 846d187cb..952492463 100644
--- a/Source/cmFindPathCommand.cxx
+++ b/Source/cmFindPathCommand.cxx
@@ -104,7 +104,7 @@ bool cmFindPathCommand
     (this->VariableName.c_str(),
      (this->VariableName + "-NOTFOUND").c_str(),
      this->VariableDocumentation.c_str(),
-     (this->IncludeFileInPath) ? 
+     (this->IncludeFileInPath) ?
      cmCacheManager::FILEPATH :cmCacheManager::PATH);
   return true;
 }
@@ -143,14 +143,14 @@ cmFindPathCommand::FindHeaderInFramework(std::string const& file,
     // remove the name from the slash;
     fileName = fileName.substr(pos+1);
     frameWorkName = file;
-    frameWorkName = 
+    frameWorkName =
       frameWorkName.substr(0, frameWorkName.size()-fileName.size()-1);
     // if the framework has a path in it then just use the filename
     if(frameWorkName.find("/") != frameWorkName.npos)
       {
       fileName = file;
       frameWorkName = "";
-      } 
+      }
     if(frameWorkName.size())
       {
       std::string fpath = dir;
@@ -160,7 +160,7 @@ cmFindPathCommand::FindHeaderInFramework(std::string const& file,
       intPath += "/Headers/";
       intPath += fileName;
       if(cmSystemTools::FileExists(intPath.c_str()))
-        { 
+        {
         if(this->IncludeFileInPath)
           {
           return intPath;
diff --git a/Source/cmFindPathCommand.h b/Source/cmFindPathCommand.h
index a61299011..759567dc1 100644
--- a/Source/cmFindPathCommand.h
+++ b/Source/cmFindPathCommand.h
@@ -29,7 +29,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmFindPathCommand;
     }
diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx
index 00f5419c2..909b333ff 100644
--- a/Source/cmFindProgramCommand.cxx
+++ b/Source/cmFindProgramCommand.cxx
@@ -81,7 +81,7 @@ bool cmFindProgramCommand
                                        result.c_str(),
                                        this->VariableDocumentation.c_str(),
                                        cmCacheManager::FILEPATH);
-    
+
     return true;
     }
   this->Makefile->AddCacheDefinition(this->VariableName.c_str(),
@@ -117,21 +117,21 @@ std::string cmFindProgramCommand
   for(std::vector<std::string>::const_iterator name = names.begin();
       name != names.end() ; ++name)
     {
-    
+
     std::string appName = *name + std::string(".app");
-    std::string appPath = cmSystemTools::FindDirectory(appName.c_str(), 
-                                                       this->SearchPaths, 
+    std::string appPath = cmSystemTools::FindDirectory(appName.c_str(),
+                                                       this->SearchPaths,
                                                        true);
 
     if ( !appPath.empty() )
       {
       std::string executable = GetBundleExecutable(appPath);
-      if (!executable.empty()) 
+      if (!executable.empty())
         {
         return cmSystemTools::CollapseFullPath(executable.c_str());
         }
-      } 
-    } 
+      }
+    }
 
   // Couldn't find app bundle
   return "";
@@ -142,44 +142,44 @@ std::string cmFindProgramCommand::GetBundleExecutable(std::string bundlePath)
   std::string executable = "";
   (void)bundlePath;
 #if defined(__APPLE__)
-  // Started with an example on developer.apple.com about finding bundles 
+  // Started with an example on developer.apple.com about finding bundles
   // and modified from that.
-  
+
   // Get a CFString of the app bundle path
   // XXX - Is it safe to assume everything is in UTF8?
-  CFStringRef bundlePathCFS = 
-    CFStringCreateWithCString(kCFAllocatorDefault , 
+  CFStringRef bundlePathCFS =
+    CFStringCreateWithCString(kCFAllocatorDefault ,
                               bundlePath.c_str(), kCFStringEncodingUTF8 );
-  
+
   // Make a CFURLRef from the CFString representation of the
   // bundle’s path.
-  CFURLRef bundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, 
+  CFURLRef bundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault,
                                                      bundlePathCFS,
                                                      kCFURLPOSIXPathStyle,
                                                      true );
-  
+
   // Make a bundle instance using the URLRef.
   CFBundleRef appBundle = CFBundleCreate( kCFAllocatorDefault, bundleURL );
-  
+
   // returned executableURL is relative to <appbundle>/Contents/MacOS/
   CFURLRef executableURL = CFBundleCopyExecutableURL(appBundle);
-  
+
   if (executableURL != NULL)
     {
     const int MAX_OSX_PATH_SIZE = 1024;
     char buffer[MAX_OSX_PATH_SIZE];
-    
+
     // Convert the CFString to a C string
-    CFStringGetCString( CFURLGetString(executableURL), buffer, 
+    CFStringGetCString( CFURLGetString(executableURL), buffer,
                         MAX_OSX_PATH_SIZE, kCFStringEncodingUTF8 );
-    
+
     // And finally to a c++ string
     executable = bundlePath + "/Contents/MacOS/" + std::string(buffer);
     // Only release CFURLRef if it's not null
     CFRelease( executableURL );
     }
 
-  // Any CF objects returned from functions with "create" or 
+  // Any CF objects returned from functions with "create" or
   // "copy" in their names must be released by us!
   CFRelease( bundlePathCFS );
   CFRelease( bundleURL );
diff --git a/Source/cmFindProgramCommand.h b/Source/cmFindProgramCommand.h
index c1b14f912..8350c9b42 100644
--- a/Source/cmFindProgramCommand.h
+++ b/Source/cmFindProgramCommand.h
@@ -18,7 +18,7 @@
  * \brief Define a command to search for an executable program.
  *
  * cmFindProgramCommand is used to define a CMake variable
- * that specifies an executable program. The command searches 
+ * that specifies an executable program. The command searches
  * in the current path (e.g., PATH environment variable) for
  * an executable that matches one of the supplied names.
  */
@@ -28,7 +28,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmFindProgramCommand;
     }
@@ -57,7 +57,7 @@ public:
     {
     return "Find an executable program.";
     }
-  
+
   cmTypeMacro(cmFindProgramCommand, cmFindBase);
 
 protected:
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx
index 74966c9c8..d69706730 100644
--- a/Source/cmForEachCommand.cxx
+++ b/Source/cmForEachCommand.cxx
@@ -25,7 +25,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
   else if (!cmSystemTools::Strucmp(lff.Name.c_str(),"endforeach"))
     {
     // if this is the endofreach for this statement
-    if (!this->Depth) 
+    if (!this->Depth)
       {
       // Remove the function blocker for this scope or bail.
       cmsys::auto_ptr<cmFunctionBlocker>
@@ -45,7 +45,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
       std::string tmps;
       cmListFileArgument arg;
       for( ; j != this->Args.end(); ++j)
-        {   
+        {
         // set the variable to the loop value
         mf.AddDefinition(this->Args[0].c_str(),j->c_str());
         // Invoke all the functions that were collected in the block.
@@ -83,10 +83,10 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
       this->Depth--;
       }
     }
-  
+
   // record the command
   this->Functions.push_back(lff);
-  
+
   // always return true
   return true;
 }
@@ -121,7 +121,7 @@ bool cmForEachCommand
     {
     return this->HandleInMode(args);
     }
-  
+
   // create a function blocker
   cmForEachFunctionBlocker *f = new cmForEachFunctionBlocker();
   if ( args.size() > 1 )
@@ -157,7 +157,7 @@ bool cmForEachCommand
           step = 1;
           }
         }
-      if ( 
+      if (
         (start > stop && step > 0) ||
         (start < stop && step < 0) ||
         step == 0
@@ -198,7 +198,7 @@ bool cmForEachCommand
     f->Args = args;
     }
   this->Makefile->AddFunctionBlocker(f);
-  
+
   return true;
 }
 
diff --git a/Source/cmForEachCommand.h b/Source/cmForEachCommand.h
index ae50005be..dc4761306 100644
--- a/Source/cmForEachCommand.h
+++ b/Source/cmForEachCommand.h
@@ -25,7 +25,7 @@ public:
                                  cmMakefile &mf,
                                  cmExecutionStatus &);
   virtual bool ShouldRemove(const cmListFileFunction& lff, cmMakefile &mf);
-  
+
   std::vector<std::string> Args;
   std::vector<cmListFileFunction> Functions;
 private:
@@ -39,7 +39,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmForEachCommand;
     }
@@ -68,7 +68,7 @@ public:
     {
     return "Evaluate a group of commands for each value in a list.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -106,7 +106,7 @@ public:
       "following it in the iteration."
       ;
     }
-  
+
   cmTypeMacro(cmForEachCommand, cmCommand);
 private:
   bool HandleInMode(std::vector<std::string> const& args);
diff --git a/Source/cmFunctionBlocker.h b/Source/cmFunctionBlocker.h
index 9ee0b5c2d..68bf76286 100644
--- a/Source/cmFunctionBlocker.h
+++ b/Source/cmFunctionBlocker.h
@@ -29,7 +29,7 @@ public:
 
   /**
    * should this function blocker be removed, useful when one function adds a
-   * blocker and another must remove it 
+   * blocker and another must remove it
    */
   virtual bool ShouldRemove(const cmListFileFunction&,
                             cmMakefile&) {return false;}
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx
index ce36145f4..10b47b9e0 100644
--- a/Source/cmFunctionCommand.cxx
+++ b/Source/cmFunctionCommand.cxx
@@ -65,7 +65,7 @@ public:
    * The name of the command as specified in CMakeList.txt.
    */
   virtual const char* GetName() const { return this->Args[0].c_str(); }
-  
+
   /**
    * Succinct documentation.
    */
@@ -131,15 +131,15 @@ bool cmFunctionHelperCommand::InvokeInitialPass
     {
     cmOStringStream tmpStream;
     tmpStream << "ARGV" << t;
-    this->Makefile->AddDefinition(tmpStream.str().c_str(), 
+    this->Makefile->AddDefinition(tmpStream.str().c_str(),
                                   expandedArgs[t].c_str());
     this->Makefile->MarkVariableAsUsed(tmpStream.str().c_str());
     }
-  
+
   // define the formal arguments
   for (unsigned int j = 1; j < this->Args.size(); ++j)
     {
-    this->Makefile->AddDefinition(this->Args[j].c_str(), 
+    this->Makefile->AddDefinition(this->Args[j].c_str(),
                                   expandedArgs[j-1].c_str());
     }
 
@@ -208,7 +208,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
   else if(!cmSystemTools::Strucmp(lff.Name.c_str(),"endfunction"))
     {
     // if this is the endfunction for this function then execute
-    if (!this->Depth) 
+    if (!this->Depth)
       {
       std::string name = this->Args[0];
       std::vector<std::string>::size_type cc;
@@ -224,20 +224,20 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
       f->Args = this->Args;
       f->Functions = this->Functions;
       mf.RecordPolicies(f->Policies);
-      
+
       // Set the FilePath on the arguments to match the function since it is
       // not stored and the original values may be freed
       for (unsigned int i = 0; i < f->Functions.size(); ++i)
         {
         for (unsigned int j = 0; j < f->Functions[i].Arguments.size(); ++j)
           {
-          f->Functions[i].Arguments[j].FilePath = 
+          f->Functions[i].Arguments[j].FilePath =
             f->Functions[i].FilePath.c_str();
           }
         }
 
       std::string newName = "_" + this->Args[0];
-      mf.GetCMakeInstance()->RenameCommand(this->Args[0].c_str(), 
+      mf.GetCMakeInstance()->RenameCommand(this->Args[0].c_str(),
                                            newName.c_str());
       mf.AddCommand(f);
 
@@ -265,7 +265,7 @@ ShouldRemove(const cmListFileFunction& lff, cmMakefile &mf)
   if(!cmSystemTools::Strucmp(lff.Name.c_str(),"endfunction"))
     {
     std::vector<std::string> expandedArguments;
-    mf.ExpandArguments(lff.Arguments, expandedArguments); 
+    mf.ExpandArguments(lff.Arguments, expandedArguments);
     // if the endfunction has arguments then make sure
     // they match the ones in the openeing function command
     if ((expandedArguments.empty() ||
@@ -291,7 +291,7 @@ bool cmFunctionCommand
   cmFunctionFunctionBlocker *f = new cmFunctionFunctionBlocker();
   for(std::vector<std::string>::const_iterator j = args.begin();
       j != args.end(); ++j)
-    {   
+    {
     f->Args.push_back(*j);
     }
   this->Makefile->AddFunctionBlocker(f);
diff --git a/Source/cmFunctionCommand.h b/Source/cmFunctionCommand.h
index 43c8e2983..730a7a760 100644
--- a/Source/cmFunctionCommand.h
+++ b/Source/cmFunctionCommand.h
@@ -20,11 +20,11 @@ class cmFunctionFunctionBlocker : public cmFunctionBlocker
 public:
   cmFunctionFunctionBlocker() {this->Depth=0;}
   virtual ~cmFunctionFunctionBlocker() {}
-  virtual bool IsFunctionBlocked(const cmListFileFunction&, 
+  virtual bool IsFunctionBlocked(const cmListFileFunction&,
                                  cmMakefile &mf,
                                  cmExecutionStatus &);
   virtual bool ShouldRemove(const cmListFileFunction&, cmMakefile &mf);
-  
+
   std::vector<std::string> Args;
   std::vector<cmListFileFunction> Functions;
   int Depth;
diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx
index 1a391ede9..0af07532a 100644
--- a/Source/cmGeneratedFileStream.cxx
+++ b/Source/cmGeneratedFileStream.cxx
@@ -31,7 +31,7 @@ cmGeneratedFileStream::cmGeneratedFileStream(const char* name, bool quiet):
   // Check if the file opened.
   if(!*this && !quiet)
     {
-    cmSystemTools::Error("Cannot open file for write: ", 
+    cmSystemTools::Error("Cannot open file for write: ",
                          this->TempName.c_str());
     cmSystemTools::ReportLastSystemError("");
     }
@@ -58,7 +58,7 @@ cmGeneratedFileStream::Open(const char* name, bool quiet, bool binaryFlag)
   // Open the temporary output file.
   if ( binaryFlag )
     {
-    this->Stream::open(this->TempName.c_str(), 
+    this->Stream::open(this->TempName.c_str(),
                        std::ios::out | std::ios::binary);
     }
   else
@@ -69,7 +69,7 @@ cmGeneratedFileStream::Open(const char* name, bool quiet, bool binaryFlag)
   // Check if the file opened.
   if(!*this && !quiet)
     {
-    cmSystemTools::Error("Cannot open file for write: ", 
+    cmSystemTools::Error("Cannot open file for write: ",
                          this->TempName.c_str());
     cmSystemTools::ReportLastSystemError("");
     }
diff --git a/Source/cmGetCMakePropertyCommand.h b/Source/cmGetCMakePropertyCommand.h
index 0a5917cfd..b77eaae04 100644
--- a/Source/cmGetCMakePropertyCommand.h
+++ b/Source/cmGetCMakePropertyCommand.h
@@ -17,7 +17,7 @@
 class cmGetCMakePropertyCommand : public cmCommand
 {
 public:
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
       return new cmGetCMakePropertyCommand;
     }
@@ -46,7 +46,7 @@ public:
     {
     return "Get a property of the CMake instance.";
     }
-  
+
   /**
    * Longer documentation.
    */
@@ -63,7 +63,7 @@ public:
         "\n"
         "See also the more general get_property() command.";
     }
-  
+
   cmTypeMacro(cmGetCMakePropertyCommand, cmCommand);
 };
 
diff --git a/Source/cmGetDirectoryPropertyCommand.cxx b/Source/cmGetDirectoryPropertyCommand.cxx
index 5714b5079..9e76e1bc3 100644
--- a/Source/cmGetDirectoryPropertyCommand.cxx
+++ b/Source/cmGetDirectoryPropertyCommand.cxx
@@ -22,12 +22,12 @@ bool cmGetDirectoryPropertyCommand
     this->SetError("called with incorrect number of arguments");
     return false;
     }
-  
+
   std::vector<std::string>::const_iterator i = args.begin();
   std::string variable = *i;
   ++i;
   std::string output = "";
-    
+
   // get the directory argument if there is one
   cmMakefile *dir = this->Makefile;
   if (*i == "DIRECTORY")
@@ -52,7 +52,7 @@ bool cmGetDirectoryPropertyCommand
     sd = cmSystemTools::CollapseFullPath(sd.c_str());
 
     // lookup the makefile from the directory name
-    cmLocalGenerator *lg = 
+    cmLocalGenerator *lg =
       this->Makefile->GetLocalGenerator()->GetGlobalGenerator()->
       FindLocalGenerator(sd.c_str());
     if (!lg)
@@ -69,7 +69,7 @@ bool cmGetDirectoryPropertyCommand
 
   // OK, now we have the directory to process, we just get the requested
   // information out of it
-  
+
   if ( *i == "DEFINITION" )
     {
     ++i;
diff --git a/Source/cmGetDirectoryPropertyCommand.h b/Source/cmGetDirectoryPropertyCommand.h
index 901b90cff..d0d582028 100644
--- a/Source/cmGetDirectoryPropertyCommand.h
+++ b/Source/cmGetDirectoryPropertyCommand.h
@@ -17,7 +17,7 @@
 class cmGetDirectoryPropertyCommand : public cmCommand
 {
 public:
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
       return new cmGetDirectoryPropertyCommand;
     }
@@ -46,7 +46,7 @@ public:
     {
     return "Get a property of DIRECTORY scope.";
     }
-  
+
   /**
    * Longer documentation.
    */
@@ -69,7 +69,7 @@ public:
         "\n"
         "See also the more general get_property() command.";
     }
-  
+
   cmTypeMacro(cmGetDirectoryPropertyCommand, cmCommand);
 };
 
diff --git a/Source/cmGetFilenameComponentCommand.cxx b/Source/cmGetFilenameComponentCommand.cxx
index 1a31d5428..fd1ad601f 100644
--- a/Source/cmGetFilenameComponentCommand.cxx
+++ b/Source/cmGetFilenameComponentCommand.cxx
@@ -32,7 +32,7 @@ bool cmGetFilenameComponentCommand
       return true;
       }
     }
-  
+
   std::string result;
   std::string filename = args[1];
   if(filename.find("[HKEY") != filename.npos)
@@ -79,7 +79,7 @@ bool cmGetFilenameComponentCommand
           }
         }
       }
-    cmSystemTools::SplitProgramFromArgs(filename.c_str(), 
+    cmSystemTools::SplitProgramFromArgs(filename.c_str(),
                                         result, programArgs);
     }
   else if (args[2] == "EXT")
@@ -104,7 +104,7 @@ bool cmGetFilenameComponentCommand
       result = cmSystemTools::GetRealPath(result.c_str());
       }
     }
-  else 
+  else
     {
     std::string err = "unknown component " + args[2];
     this->SetError(err.c_str());
@@ -125,7 +125,7 @@ bool cmGetFilenameComponentCommand
        args[2] == "PATH" ? cmCacheManager::FILEPATH
        : cmCacheManager::STRING);
     }
-  else 
+  else
     {
     if(programArgs.size() && storeArgs.size())
       {
diff --git a/Source/cmGetFilenameComponentCommand.h b/Source/cmGetFilenameComponentCommand.h
index 0c8e57a26..c46101625 100644
--- a/Source/cmGetFilenameComponentCommand.h
+++ b/Source/cmGetFilenameComponentCommand.h
@@ -18,7 +18,7 @@
  * \brief Get a specific component of a filename.
  *
  * cmGetFilenameComponentCommand is a utility command used to get the path,
- * name, extension or name without extension of a full filename. 
+ * name, extension or name without extension of a full filename.
  */
 class cmGetFilenameComponentCommand : public cmCommand
 {
@@ -26,7 +26,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmGetFilenameComponentCommand;
     }
@@ -55,7 +55,7 @@ public:
     {
     return "Get a specific component of a full filename.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -82,7 +82,7 @@ public:
       "from the program name and stored in <ARG_VAR>.  This is used to "
       "separate a program name from its arguments in a command line string.";
     }
-  
+
   cmTypeMacro(cmGetFilenameComponentCommand, cmCommand);
 };
 
diff --git a/Source/cmGetPropertyCommand.h b/Source/cmGetPropertyCommand.h
index dca262725..3c597fdcf 100644
--- a/Source/cmGetPropertyCommand.h
+++ b/Source/cmGetPropertyCommand.h
@@ -19,7 +19,7 @@ class cmGetPropertyCommand : public cmCommand
 public:
   cmGetPropertyCommand();
 
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
       return new cmGetPropertyCommand;
     }
@@ -48,7 +48,7 @@ public:
     {
     return "Get a property.";
     }
-  
+
   /**
    * Longer documentation.
    */
@@ -92,7 +92,7 @@ public:
         "If documentation is requested for a property that has not been "
         "defined NOTFOUND is returned.";
     }
-  
+
   cmTypeMacro(cmGetPropertyCommand, cmCommand);
 private:
   enum OutType { OutValue, OutDefined, OutBriefDoc, OutFullDoc, OutSet };
diff --git a/Source/cmGetSourceFilePropertyCommand.h b/Source/cmGetSourceFilePropertyCommand.h
index 6d52503b5..2ba81037f 100644
--- a/Source/cmGetSourceFilePropertyCommand.h
+++ b/Source/cmGetSourceFilePropertyCommand.h
@@ -17,7 +17,7 @@
 class cmGetSourceFilePropertyCommand : public cmCommand
 {
 public:
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
       return new cmGetSourceFilePropertyCommand;
     }
@@ -41,7 +41,7 @@ public:
     {
     return "Get a property for a source file.";
     }
-  
+
   /**
    * Longer documentation.
    */
@@ -57,7 +57,7 @@ public:
         "\n"
         "See also the more general get_property() command.";
     }
-  
+
   cmTypeMacro(cmGetSourceFilePropertyCommand, cmCommand);
 };
 
diff --git a/Source/cmGetTargetPropertyCommand.h b/Source/cmGetTargetPropertyCommand.h
index b60abea4c..f5e1aa729 100644
--- a/Source/cmGetTargetPropertyCommand.h
+++ b/Source/cmGetTargetPropertyCommand.h
@@ -17,7 +17,7 @@
 class cmGetTargetPropertyCommand : public cmCommand
 {
 public:
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
       return new cmGetTargetPropertyCommand;
     }
@@ -41,7 +41,7 @@ public:
     {
     return "Get a property from a target.";
     }
-  
+
   /**
    * Longer documentation.
    */
@@ -59,7 +59,7 @@ public:
         "\n"
         "See also the more general get_property() command.";
     }
-  
+
   cmTypeMacro(cmGetTargetPropertyCommand, cmCommand);
 };
 
diff --git a/Source/cmGetTestPropertyCommand.h b/Source/cmGetTestPropertyCommand.h
index af6bafaf3..01f54d951 100644
--- a/Source/cmGetTestPropertyCommand.h
+++ b/Source/cmGetTestPropertyCommand.h
@@ -17,7 +17,7 @@
 class cmGetTestPropertyCommand : public cmCommand
 {
 public:
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmGetTestPropertyCommand;
     }
diff --git a/Source/cmGlobalBorlandMakefileGenerator.cxx b/Source/cmGlobalBorlandMakefileGenerator.cxx
index b87b7e186..8c6787a2c 100644
--- a/Source/cmGlobalBorlandMakefileGenerator.cxx
+++ b/Source/cmGlobalBorlandMakefileGenerator.cxx
@@ -25,14 +25,14 @@ cmGlobalBorlandMakefileGenerator::cmGlobalBorlandMakefileGenerator()
 
 
 void cmGlobalBorlandMakefileGenerator
-::EnableLanguage(std::vector<std::string>const& l, 
-                 cmMakefile *mf, 
+::EnableLanguage(std::vector<std::string>const& l,
+                 cmMakefile *mf,
                  bool optional)
 {
   std::string outdir = this->CMakeInstance->GetStartOutputDirectory();
   mf->AddDefinition("BORLAND", "1");
   mf->AddDefinition("CMAKE_GENERATOR_CC", "bcc32");
-  mf->AddDefinition("CMAKE_GENERATOR_CXX", "bcc32"); 
+  mf->AddDefinition("CMAKE_GENERATOR_CXX", "bcc32");
   this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional);
 }
 
diff --git a/Source/cmGlobalBorlandMakefileGenerator.h b/Source/cmGlobalBorlandMakefileGenerator.h
index 0d3868989..c0cb8a6d1 100644
--- a/Source/cmGlobalBorlandMakefileGenerator.h
+++ b/Source/cmGlobalBorlandMakefileGenerator.h
@@ -23,9 +23,9 @@ class cmGlobalBorlandMakefileGenerator : public cmGlobalNMakeMakefileGenerator
 {
 public:
   cmGlobalBorlandMakefileGenerator();
-  static cmGlobalGenerator* New() 
+  static cmGlobalGenerator* New()
     { return new cmGlobalBorlandMakefileGenerator; }
-  
+
   ///! Get the name for the generator.
   virtual const char* GetName() const {
     return cmGlobalBorlandMakefileGenerator::GetActualName();}
@@ -33,13 +33,13 @@ public:
 
   /** Get the documentation entry for this generator.  */
   virtual void GetDocumentation(cmDocumentationEntry& entry) const;
-  
+
   ///! Create a local generator appropriate to this Global Generator
   virtual cmLocalGenerator *CreateLocalGenerator();
 
   /**
    * Try to determine system infomation such as shared library
-   * extension, pthreads, byte order etc.  
+   * extension, pthreads, byte order etc.
    */
   virtual void EnableLanguage(std::vector<std::string>const& languages,
                               cmMakefile *, bool optional);
diff --git a/Source/cmGlobalJOMMakefileGenerator.cxx b/Source/cmGlobalJOMMakefileGenerator.cxx
index 411e28bf1..ef42bd4d6 100644
--- a/Source/cmGlobalJOMMakefileGenerator.cxx
+++ b/Source/cmGlobalJOMMakefileGenerator.cxx
@@ -22,14 +22,14 @@ cmGlobalJOMMakefileGenerator::cmGlobalJOMMakefileGenerator()
 }
 
 void cmGlobalJOMMakefileGenerator
-::EnableLanguage(std::vector<std::string>const& l, 
-                 cmMakefile *mf, 
+::EnableLanguage(std::vector<std::string>const& l,
+                 cmMakefile *mf,
                  bool optional)
 {
-  // pick a default 
+  // pick a default
   mf->AddDefinition("CMAKE_GENERATOR_CC", "cl");
   mf->AddDefinition("CMAKE_GENERATOR_CXX", "cl");
-  if(!(cmSystemTools::GetEnv("INCLUDE") && 
+  if(!(cmSystemTools::GetEnv("INCLUDE") &&
        cmSystemTools::GetEnv("LIB"))
     )
     {
@@ -40,7 +40,7 @@ void cmGlobalJOMMakefileGenerator
     mf->IssueMessage(cmake::WARNING,
                      message);
     }
-  
+
   this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional);
 }
 
diff --git a/Source/cmGlobalJOMMakefileGenerator.h b/Source/cmGlobalJOMMakefileGenerator.h
index 08be4b4fc..691ebdb8f 100644
--- a/Source/cmGlobalJOMMakefileGenerator.h
+++ b/Source/cmGlobalJOMMakefileGenerator.h
@@ -34,13 +34,13 @@ public:
 
   /** Get the documentation entry for this generator.  */
   virtual void GetDocumentation(cmDocumentationEntry& entry) const;
-  
+
   ///! Create a local generator appropriate to this Global Generator
   virtual cmLocalGenerator *CreateLocalGenerator();
 
   /**
    * Try to determine system infomation such as shared library
-   * extension, pthreads, byte order etc.  
+   * extension, pthreads, byte order etc.
    */
   virtual void EnableLanguage(std::vector<std::string>const& languages,
                               cmMakefile *, bool optional);
diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx
index f69944847..a81c26c0f 100644
--- a/Source/cmGlobalKdevelopGenerator.cxx
+++ b/Source/cmGlobalKdevelopGenerator.cxx
@@ -51,11 +51,11 @@ cmGlobalKdevelopGenerator::cmGlobalKdevelopGenerator()
 
 void cmGlobalKdevelopGenerator::Generate()
 {
-  // for each sub project in the project create 
+  // for each sub project in the project create
   // a kdevelop project
-  for (std::map<cmStdString, std::vector<cmLocalGenerator*> >::const_iterator 
-       it = this->GlobalGenerator->GetProjectMap().begin(); 
-      it!= this->GlobalGenerator->GetProjectMap().end(); 
+  for (std::map<cmStdString, std::vector<cmLocalGenerator*> >::const_iterator
+       it = this->GlobalGenerator->GetProjectMap().begin();
+      it!= this->GlobalGenerator->GetProjectMap().end();
       ++it)
     {
     cmMakefile* mf = it->second[0]->GetMakefile();
@@ -94,7 +94,7 @@ void cmGlobalKdevelopGenerator::Generate()
         break;
         }
       }
-      
+
     // now create a project file
     this->CreateProjectFile(outputDir, projectDir, projectName,
                             executable, cmakeFilePattern, fileToOpen);
@@ -103,7 +103,7 @@ void cmGlobalKdevelopGenerator::Generate()
 
 bool cmGlobalKdevelopGenerator
 ::CreateFilelistFile(const std::vector<cmLocalGenerator*>& lgs,
-                     const std::string& outputDir, 
+                     const std::string& outputDir,
                      const std::string& projectDirIn,
                      const std::string& projectname,
                      std::string& cmakeFilePattern,
@@ -115,24 +115,24 @@ bool cmGlobalKdevelopGenerator
   std::set<cmStdString> files;
   std::string tmp;
 
-  for (std::vector<cmLocalGenerator*>::const_iterator it=lgs.begin(); 
+  for (std::vector<cmLocalGenerator*>::const_iterator it=lgs.begin();
        it!=lgs.end(); it++)
     {
     cmMakefile* makefile=(*it)->GetMakefile();
     const std::vector<std::string>& listFiles=makefile->GetListFiles();
-    for (std::vector<std::string>::const_iterator lt=listFiles.begin(); 
+    for (std::vector<std::string>::const_iterator lt=listFiles.begin();
          lt!=listFiles.end(); lt++)
       {
       tmp=*lt;
       cmSystemTools::ReplaceString(tmp, projectDir.c_str(), "");
       // make sure the file is part of this source tree
-      if ((tmp[0]!='/') && 
-          (strstr(tmp.c_str(), 
+      if ((tmp[0]!='/') &&
+          (strstr(tmp.c_str(),
                   cmake::GetCMakeFilesDirectoryPostSlash())==0))
         {
         files.insert(tmp);
         tmp=cmSystemTools::GetFilenameName(tmp);
-        //add all files which dont match the default 
+        //add all files which dont match the default
         // */CMakeLists.txt;*cmake; to the file pattern
         if ((tmp!="CMakeLists.txt")
             && (strstr(tmp.c_str(), ".cmake")==0))
@@ -141,7 +141,7 @@ bool cmGlobalKdevelopGenerator
           }
         }
       }
-  
+
     //get all sources
     cmTargets& targets=makefile->GetTargets();
     for (cmTargets::iterator ti = targets.begin();
@@ -158,8 +158,8 @@ bool cmGlobalKdevelopGenerator
 
         cmSystemTools::ReplaceString(tmp, projectDir.c_str(), "");
 
-        if ((tmp[0]!='/')  && 
-            (strstr(tmp.c_str(), 
+        if ((tmp[0]!='/')  &&
+            (strstr(tmp.c_str(),
                   cmake::GetCMakeFilesDirectoryPostSlash())==0) &&
            (cmSystemTools::GetFilenameExtension(tmp)!=".moc"))
           {
@@ -187,8 +187,8 @@ bool cmGlobalKdevelopGenerator
         {
         tmp=*lt;
         cmSystemTools::ReplaceString(tmp, projectDir.c_str(), "");
-        if ((tmp[0]!='/') && 
-            (strstr(tmp.c_str(), 
+        if ((tmp[0]!='/') &&
+            (strstr(tmp.c_str(),
                     cmake::GetCMakeFilesDirectoryPostSlash())==0))
           {
           files.insert(tmp.c_str());
@@ -223,9 +223,9 @@ bool cmGlobalKdevelopGenerator
     {
     return false;
     }
-   
+
   fileToOpen="";
-  for (std::set<cmStdString>::const_iterator it=files.begin(); 
+  for (std::set<cmStdString>::const_iterator it=files.begin();
        it!=files.end(); it++)
     {
     // get the full path to the file
@@ -257,7 +257,7 @@ existing one, otherwise create a new one */
 void cmGlobalKdevelopGenerator
 ::CreateProjectFile(const std::string& outputDir,
                     const std::string& projectDir,
-                    const std::string& projectname, 
+                    const std::string& projectname,
                     const std::string& executable,
                     const std::string& cmakeFilePattern,
                     const std::string& fileToOpen)
@@ -271,13 +271,13 @@ void cmGlobalKdevelopGenerator
 
   if (cmSystemTools::FileExists(filename.c_str()))
     {
-    this->MergeProjectFiles(outputDir, projectDir, filename, 
-                            executable, cmakeFilePattern, 
+    this->MergeProjectFiles(outputDir, projectDir, filename,
+                            executable, cmakeFilePattern,
                             fileToOpen, sessionFilename);
     }
   else
     {
-    // add all subdirectories which are cmake build directories to the 
+    // add all subdirectories which are cmake build directories to the
     // kdevelop blacklist so they are not monitored for added or removed files
     // since this is handled by adding files to the cmake files
     cmsys::Directory d;
@@ -295,7 +295,7 @@ void cmGlobalKdevelopGenerator
           if (cmSystemTools::FileIsDirectory(tmp.c_str()))
             {
             tmp += "/CMakeCache.txt";
-            if ((nextFile == "CMakeFiles") 
+            if ((nextFile == "CMakeFiles")
                 || (cmSystemTools::FileExists(tmp.c_str())))
               {
               this->Blacklist.push_back(nextFile);
@@ -305,17 +305,17 @@ void cmGlobalKdevelopGenerator
         }
       }
     this->CreateNewProjectFile(outputDir, projectDir, filename,
-                               executable, cmakeFilePattern, 
+                               executable, cmakeFilePattern,
                                fileToOpen, sessionFilename);
     }
 
 }
 
 void cmGlobalKdevelopGenerator
-::MergeProjectFiles(const std::string& outputDir, 
-                    const std::string& projectDir, 
-                    const std::string& filename, 
-                    const std::string& executable, 
+::MergeProjectFiles(const std::string& outputDir,
+                    const std::string& projectDir,
+                    const std::string& filename,
+                    const std::string& executable,
                     const std::string& cmakeFilePattern,
                     const std::string& fileToOpen,
                     const std::string& sessionFilename)
@@ -323,8 +323,8 @@ void cmGlobalKdevelopGenerator
   std::ifstream oldProjectFile(filename.c_str());
   if (!oldProjectFile)
     {
-    this->CreateNewProjectFile(outputDir, projectDir, filename, 
-                               executable, cmakeFilePattern, 
+    this->CreateNewProjectFile(outputDir, projectDir, filename,
+                               executable, cmakeFilePattern,
                                fileToOpen, sessionFilename);
     return;
     }
@@ -346,7 +346,7 @@ void cmGlobalKdevelopGenerator
     return;
     }
 
-  for (std::vector<std::string>::const_iterator it=lines.begin(); 
+  for (std::vector<std::string>::const_iterator it=lines.begin();
        it!=lines.end(); it++)
     {
     const char* line=(*it).c_str();
@@ -368,7 +368,7 @@ void cmGlobalKdevelopGenerator
     if (strstr(line, "<general>"))
       {
       fout<< "  <projectmanagement>KDevCustomProject</projectmanagement>\n";
-      fout<< "  <projectdirectory>" <<projectDir.c_str() 
+      fout<< "  <projectdirectory>" <<projectDir.c_str()
           << "</projectdirectory>\n";   //this one is important
       fout<<"  <absoluteprojectpath>true</absoluteprojectpath>\n";
       //and this one
@@ -407,7 +407,7 @@ void cmGlobalKdevelopGenerator
   bool hasSvn = cmSystemTools::FileExists((projectDir + "/.svn").c_str());
   bool hasCvs = cmSystemTools::FileExists((projectDir + "/CVS").c_str());
 
-  bool enableCxx = (this->GlobalGenerator->GetLanguageEnabled("C") 
+  bool enableCxx = (this->GlobalGenerator->GetLanguageEnabled("C")
                           || this->GlobalGenerator->GetLanguageEnabled("CXX"));
   bool enableFortran = this->GlobalGenerator->GetLanguageEnabled("Fortran");
   std::string primaryLanguage = "C++";
@@ -425,7 +425,7 @@ void cmGlobalKdevelopGenerator
         "  <projectmanagement>KDevCustomProject</projectmanagement>\n"
         "  <primarylanguage>" << primaryLanguage << "</primarylanguage>\n"
         "  <ignoreparts/>\n"
-        "  <projectdirectory>" << projectDir.c_str() << 
+        "  <projectdirectory>" << projectDir.c_str() <<
         "</projectdirectory>\n";   //this one is important
   fout<<"  <absoluteprojectpath>true</absoluteprojectpath>\n"; //and this one
 
@@ -472,7 +472,7 @@ void cmGlobalKdevelopGenerator
         "      <numberofjobs>1</numberofjobs>\n"
         "      <dontact>false</dontact>\n"
         "      <makebin>" << this->GlobalGenerator->GetLocalGenerators()[0]->
-            GetMakefile()->GetRequiredDefinition("CMAKE_BUILD_TOOL") 
+            GetMakefile()->GetRequiredDefinition("CMAKE_BUILD_TOOL")
             << " </makebin>\n"
         "      <selectedenvironment>default</selectedenvironment>\n"
         "      <environments>\n"
diff --git a/Source/cmGlobalMSYSMakefileGenerator.cxx b/Source/cmGlobalMSYSMakefileGenerator.cxx
index 820e7e605..80526aad8 100644
--- a/Source/cmGlobalMSYSMakefileGenerator.cxx
+++ b/Source/cmGlobalMSYSMakefileGenerator.cxx
@@ -22,7 +22,7 @@ cmGlobalMSYSMakefileGenerator::cmGlobalMSYSMakefileGenerator()
   this->UseLinkScript = false;
 }
 
-std::string 
+std::string
 cmGlobalMSYSMakefileGenerator::FindMinGW(std::string const& makeloc)
 {
   std::string fstab = makeloc;
@@ -45,8 +45,8 @@ cmGlobalMSYSMakefileGenerator::FindMinGW(std::string const& makeloc)
 }
 
 void cmGlobalMSYSMakefileGenerator
-::EnableLanguage(std::vector<std::string>const& l, 
-                 cmMakefile *mf, 
+::EnableLanguage(std::vector<std::string>const& l,
+                 cmMakefile *mf,
                  bool optional)
 {
   this->FindMakeProgram(mf);
diff --git a/Source/cmGlobalMSYSMakefileGenerator.h b/Source/cmGlobalMSYSMakefileGenerator.h
index b5294acd5..b76a5bf9b 100644
--- a/Source/cmGlobalMSYSMakefileGenerator.h
+++ b/Source/cmGlobalMSYSMakefileGenerator.h
@@ -23,7 +23,7 @@ class cmGlobalMSYSMakefileGenerator : public cmGlobalUnixMakefileGenerator3
 {
 public:
   cmGlobalMSYSMakefileGenerator();
-  static cmGlobalGenerator* New() { 
+  static cmGlobalGenerator* New() {
     return new cmGlobalMSYSMakefileGenerator; }
 
   ///! Get the name for the generator.
@@ -33,13 +33,13 @@ public:
 
   /** Get the documentation entry for this generator.  */
   virtual void GetDocumentation(cmDocumentationEntry& entry) const;
-  
+
   ///! Create a local generator appropriate to this Global Generator
   virtual cmLocalGenerator *CreateLocalGenerator();
 
   /**
    * Try to determine system infomation such as shared library
-   * extension, pthreads, byte order etc.  
+   * extension, pthreads, byte order etc.
    */
   virtual void EnableLanguage(std::vector<std::string>const& languages,
                               cmMakefile *, bool optional);
diff --git a/Source/cmGlobalMinGWMakefileGenerator.cxx b/Source/cmGlobalMinGWMakefileGenerator.cxx
index a9e779847..d6045c8de 100644
--- a/Source/cmGlobalMinGWMakefileGenerator.cxx
+++ b/Source/cmGlobalMinGWMakefileGenerator.cxx
@@ -22,10 +22,10 @@ cmGlobalMinGWMakefileGenerator::cmGlobalMinGWMakefileGenerator()
 }
 
 void cmGlobalMinGWMakefileGenerator
-::EnableLanguage(std::vector<std::string>const& l, 
-                 cmMakefile *mf, 
+::EnableLanguage(std::vector<std::string>const& l,
+                 cmMakefile *mf,
                  bool optional)
-{ 
+{
   this->FindMakeProgram(mf);
   std::string makeProgram = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM");
   std::vector<std::string> locations;
diff --git a/Source/cmGlobalMinGWMakefileGenerator.h b/Source/cmGlobalMinGWMakefileGenerator.h
index 366146b0a..9a6a5139f 100644
--- a/Source/cmGlobalMinGWMakefileGenerator.h
+++ b/Source/cmGlobalMinGWMakefileGenerator.h
@@ -23,7 +23,7 @@ class cmGlobalMinGWMakefileGenerator : public cmGlobalUnixMakefileGenerator3
 {
 public:
   cmGlobalMinGWMakefileGenerator();
-  static cmGlobalGenerator* New() { 
+  static cmGlobalGenerator* New() {
     return new cmGlobalMinGWMakefileGenerator; }
   ///! Get the name for the generator.
   virtual const char* GetName() const {
@@ -32,13 +32,13 @@ public:
 
   /** Get the documentation entry for this generator.  */
   virtual void GetDocumentation(cmDocumentationEntry& entry) const;
-  
+
   ///! Create a local generator appropriate to this Global Generator
   virtual cmLocalGenerator *CreateLocalGenerator();
 
   /**
    * Try to determine system infomation such as shared library
-   * extension, pthreads, byte order etc.  
+   * extension, pthreads, byte order etc.
    */
   virtual void EnableLanguage(std::vector<std::string>const& languages,
                               cmMakefile *, bool optional);
diff --git a/Source/cmGlobalNMakeMakefileGenerator.cxx b/Source/cmGlobalNMakeMakefileGenerator.cxx
index c3c15e70f..57a26c8ae 100644
--- a/Source/cmGlobalNMakeMakefileGenerator.cxx
+++ b/Source/cmGlobalNMakeMakefileGenerator.cxx
@@ -22,14 +22,14 @@ cmGlobalNMakeMakefileGenerator::cmGlobalNMakeMakefileGenerator()
 }
 
 void cmGlobalNMakeMakefileGenerator
-::EnableLanguage(std::vector<std::string>const& l, 
-                 cmMakefile *mf, 
+::EnableLanguage(std::vector<std::string>const& l,
+                 cmMakefile *mf,
                  bool optional)
 {
-  // pick a default 
+  // pick a default
   mf->AddDefinition("CMAKE_GENERATOR_CC", "cl");
   mf->AddDefinition("CMAKE_GENERATOR_CXX", "cl");
-  if(!(cmSystemTools::GetEnv("INCLUDE") && 
+  if(!(cmSystemTools::GetEnv("INCLUDE") &&
        cmSystemTools::GetEnv("LIB"))
     )
     {
@@ -40,7 +40,7 @@ void cmGlobalNMakeMakefileGenerator
     mf->IssueMessage(cmake::WARNING,
                      message);
     }
-  
+
   this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional);
 }
 
diff --git a/Source/cmGlobalNMakeMakefileGenerator.h b/Source/cmGlobalNMakeMakefileGenerator.h
index 70a8c1909..de33b8f94 100644
--- a/Source/cmGlobalNMakeMakefileGenerator.h
+++ b/Source/cmGlobalNMakeMakefileGenerator.h
@@ -32,13 +32,13 @@ public:
 
   /** Get the documentation entry for this generator.  */
   virtual void GetDocumentation(cmDocumentationEntry& entry) const;
-  
+
   ///! Create a local generator appropriate to this Global Generator
   virtual cmLocalGenerator *CreateLocalGenerator();
 
   /**
    * Try to determine system infomation such as shared library
-   * extension, pthreads, byte order etc.  
+   * extension, pthreads, byte order etc.
    */
   virtual void EnableLanguage(std::vector<std::string>const& languages,
                               cmMakefile *, bool optional);
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 947a1c99d..48ead25db 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -94,7 +94,7 @@ void cmGlobalVisualStudio10Generator
 
 //----------------------------------------------------------------------------
 void cmGlobalVisualStudio10Generator
-::EnableLanguage(std::vector<std::string>const &  lang, 
+::EnableLanguage(std::vector<std::string>const &  lang,
                  cmMakefile *mf, bool optional)
 {
   cmGlobalVisualStudio8Generator::EnableLanguage(lang, mf, optional);
@@ -146,12 +146,12 @@ std::string cmGlobalVisualStudio10Generator::GetUserMacrosRegKeyBase()
 
 std::string cmGlobalVisualStudio10Generator
 ::GenerateBuildCommand(const char* makeProgram,
-                       const char *projectName, 
+                       const char *projectName,
                        const char* additionalOptions, const char *targetName,
                        const char* config, bool ignoreErrors, bool fast)
 {
   // now build the test
-  std::string makeCommand 
+  std::string makeCommand
     = cmSystemTools::ConvertToOutputPath(makeProgram);
   std::string lowerCaseCommand = makeCommand;
   cmSystemTools::LowerCase(lowerCaseCommand);
@@ -177,7 +177,7 @@ std::string cmGlobalVisualStudio10Generator
   if(!targetName || strlen(targetName) == 0)
     {
     targetName = "ALL_BUILD";
-    }    
+    }
   bool clean = false;
   if ( targetName && strcmp(targetName, "clean") == 0 )
     {
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index 060cdfff3..47ce790f8 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -20,26 +20,26 @@
  *
  * cmGlobalVisualStudio10Generator manages UNIX build process for a tree
  */
-class cmGlobalVisualStudio10Generator : 
+class cmGlobalVisualStudio10Generator :
   public cmGlobalVisualStudio8Generator
 {
 public:
   cmGlobalVisualStudio10Generator();
-  static cmGlobalGenerator* New() { 
+  static cmGlobalGenerator* New() {
     return new cmGlobalVisualStudio10Generator; }
-  
-  virtual std::string 
+
+  virtual std::string
   GenerateBuildCommand(const char* makeProgram,
-                       const char *projectName, 
+                       const char *projectName,
                        const char* additionalOptions, const char *targetName,
                        const char* config, bool ignoreErrors, bool);
-  
+
   ///! Get the name for the generator.
   virtual const char* GetName() const {
     return cmGlobalVisualStudio10Generator::GetActualName();}
   static const char* GetActualName() {return "Visual Studio 10";}
   virtual void AddPlatformDefinitions(cmMakefile* mf);
-  
+
   /** Get the documentation entry for this generator.  */
   virtual void GetDocumentation(cmDocumentationEntry& entry) const;
 
@@ -50,9 +50,9 @@ public:
 
   /**
    * Try to determine system infomation such as shared library
-   * extension, pthreads, byte order etc.  
+   * extension, pthreads, byte order etc.
    */
-  virtual void EnableLanguage(std::vector<std::string>const& languages, 
+  virtual void EnableLanguage(std::vector<std::string>const& languages,
                               cmMakefile *, bool optional);
   virtual void WriteSLNHeader(std::ostream& fout);
 
diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx
index fe44e200e..cc7034129 100644
--- a/Source/cmGlobalVisualStudio6Generator.cxx
+++ b/Source/cmGlobalVisualStudio6Generator.cxx
@@ -36,13 +36,13 @@ cmGlobalVisualStudio6Generator::cmGlobalVisualStudio6Generator()
 }
 
 void cmGlobalVisualStudio6Generator
-::EnableLanguage(std::vector<std::string>const& lang, 
-                 cmMakefile *mf, 
+::EnableLanguage(std::vector<std::string>const& lang,
+                 cmMakefile *mf,
                  bool optional)
 {
   mf->AddDefinition("CMAKE_GENERATOR_CC", "cl");
   mf->AddDefinition("CMAKE_GENERATOR_CXX", "cl");
-  mf->AddDefinition("CMAKE_GENERATOR_RC", "rc"); 
+  mf->AddDefinition("CMAKE_GENERATOR_RC", "rc");
   mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1");
   mf->AddDefinition("CMAKE_GENERATOR_Fortran", "ifort");
   mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "X86");
@@ -84,10 +84,10 @@ void cmGlobalVisualStudio6Generator::GenerateConfigurations(cmMakefile* mf)
 
 std::string cmGlobalVisualStudio6Generator
 ::GenerateBuildCommand(const char* makeProgram,
-                       const char *projectName, 
-                       const char* additionalOptions, 
+                       const char *projectName,
+                       const char* additionalOptions,
                        const char *targetName,
-                       const char* config, 
+                       const char* config,
                        bool ignoreErrors,
                        bool)
 {
@@ -100,7 +100,7 @@ std::string cmGlobalVisualStudio6Generator
                "\\6.0\\Setup;VsCommonDir]/MSDev98/Bin");
   cmSystemTools::ExpandRegistryValues(mp[0]);
   std::string originalCommand = makeProgram;
-  std::string makeCommand = 
+  std::string makeCommand =
     cmSystemTools::FindProgram(makeProgram, mp);
   if(makeCommand.size() == 0)
     {
@@ -116,7 +116,7 @@ std::string cmGlobalVisualStudio6Generator
   // if there are spaces in the makeCommand, assume a full path
   // and convert it to a path with no spaces in it as the
   // RunSingleCommand does not like spaces
-#if defined(_WIN32) && !defined(__CYGWIN__)      
+#if defined(_WIN32) && !defined(__CYGWIN__)
   if(makeCommand.find(' ') != std::string::npos)
     {
     cmSystemTools::GetShortPath(makeCommand.c_str(), makeCommand);
@@ -226,7 +226,7 @@ void cmGlobalVisualStudio6Generator
 }
 
 void cmGlobalVisualStudio6Generator
-::OutputDSWFile(cmLocalGenerator* root, 
+::OutputDSWFile(cmLocalGenerator* root,
                 std::vector<cmLocalGenerator*>& generators)
 {
   if(generators.size() == 0)
@@ -250,7 +250,7 @@ void cmGlobalVisualStudio6Generator
 
 // output the DSW file
 void cmGlobalVisualStudio6Generator::OutputDSWFile()
-{ 
+{
   std::map<cmStdString, std::vector<cmLocalGenerator*> >::iterator it;
   for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it)
     {
@@ -259,16 +259,16 @@ void cmGlobalVisualStudio6Generator::OutputDSWFile()
 }
 
 // Write a dsp file into the DSW file,
-// Note, that dependencies from executables to 
+// Note, that dependencies from executables to
 // the libraries it uses are also done here
-void cmGlobalVisualStudio6Generator::WriteProject(std::ostream& fout, 
+void cmGlobalVisualStudio6Generator::WriteProject(std::ostream& fout,
                                                   const char* dspname,
                                                   const char* dir,
                                                   cmTarget& target)
 {
   fout << "#########################################################"
     "######################\n\n";
-  fout << "Project: \"" << dspname << "\"=" 
+  fout << "Project: \"" << dspname << "\"="
        << dir << "\\" << dspname << ".dsp - Package Owner=<4>\n\n";
   fout << "Package=<5>\n{{{\n}}}\n\n";
   fout << "Package=<4>\n";
@@ -304,22 +304,22 @@ void cmGlobalVisualStudio6Generator::WriteProject(std::ostream& fout,
 
 
 // Write a dsp file into the DSW file,
-// Note, that dependencies from executables to 
+// Note, that dependencies from executables to
 // the libraries it uses are also done here
-void cmGlobalVisualStudio6Generator::WriteExternalProject(std::ostream& fout, 
+void cmGlobalVisualStudio6Generator::WriteExternalProject(std::ostream& fout,
                                const char* name,
                                const char* location,
                                const std::set<cmStdString>& dependencies)
 {
  fout << "#########################################################"
     "######################\n\n";
-  fout << "Project: \"" << name << "\"=" 
+  fout << "Project: \"" << name << "\"="
        << location << " - Package Owner=<4>\n\n";
   fout << "Package=<5>\n{{{\n}}}\n\n";
   fout << "Package=<4>\n";
   fout << "{{{\n";
 
-  
+
   std::set<cmStdString>::const_iterator i, end;
   // write dependencies.
   i = dependencies.begin();
@@ -347,7 +347,7 @@ void cmGlobalVisualStudio6Generator::WriteDSWFooter(std::ostream& fout)
     "##########################\n\n";
 }
 
-  
+
 // ouput standard header for dsw file
 void cmGlobalVisualStudio6Generator::WriteDSWHeader(std::ostream& fout)
 {
diff --git a/Source/cmGlobalVisualStudio6Generator.h b/Source/cmGlobalVisualStudio6Generator.h
index da08a125b..259aa8d03 100644
--- a/Source/cmGlobalVisualStudio6Generator.h
+++ b/Source/cmGlobalVisualStudio6Generator.h
@@ -25,9 +25,9 @@ class cmGlobalVisualStudio6Generator : public cmGlobalVisualStudioGenerator
 {
 public:
   cmGlobalVisualStudio6Generator();
-  static cmGlobalGenerator* New() { 
+  static cmGlobalGenerator* New() {
     return new cmGlobalVisualStudio6Generator; }
-  
+
   ///! Get the name for the generator.
   virtual const char* GetName() const {
     return cmGlobalVisualStudio6Generator::GetActualName();}
@@ -35,15 +35,15 @@ public:
 
   /** Get the documentation entry for this generator.  */
   virtual void GetDocumentation(cmDocumentationEntry& entry) const;
-  
+
   ///! Create a local generator appropriate to this Global Generator
   virtual cmLocalGenerator *CreateLocalGenerator();
 
   /**
    * Try to determine system infomation such as shared library
-   * extension, pthreads, byte order etc.  
+   * extension, pthreads, byte order etc.
    */
-  virtual void EnableLanguage(std::vector<std::string>const& languages, 
+  virtual void EnableLanguage(std::vector<std::string>const& languages,
                               cmMakefile *, bool optional);
 
   /**
@@ -52,8 +52,8 @@ public:
    */
   virtual std::string GenerateBuildCommand(const char* makeProgram,
                                            const char *projectName,
-                                           const char* additionalOptions, 
-                                           const char *targetName, 
+                                           const char* additionalOptions,
+                                           const char *targetName,
                                            const char* config,
                                            bool ignoreErrors,
                                            bool fast);
@@ -61,7 +61,7 @@ public:
   /**
    * Generate the all required files for building this project/tree. This
    * basically creates a series of LocalGenerators for each directory and
-   * requests that they Generate.  
+   * requests that they Generate.
    */
   virtual void Generate();
 
@@ -90,9 +90,9 @@ private:
   void GenerateConfigurations(cmMakefile* mf);
   void WriteDSWFile(std::ostream& fout);
   void WriteDSWHeader(std::ostream& fout);
-  void WriteProject(std::ostream& fout, 
+  void WriteProject(std::ostream& fout,
                     const char* name, const char* path, cmTarget &t);
-  void WriteExternalProject(std::ostream& fout, 
+  void WriteExternalProject(std::ostream& fout,
                             const char* name, const char* path,
                             const std::set<cmStdString>& dependencies);
   void WriteDSWFooter(std::ostream& fout);
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index d6b653ca6..1da575ef8 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -99,7 +99,7 @@ void cmGlobalVisualStudio71Generator
 ::WriteSLNFile(std::ostream& fout,
                cmLocalGenerator* root,
                std::vector<cmLocalGenerator*>& generators)
-{ 
+{
   // Write out the header for a SLN file
   this->WriteSLNHeader(fout);
 
@@ -156,7 +156,7 @@ cmGlobalVisualStudio71Generator
 
 //----------------------------------------------------------------------------
 // Write a dsp file into the SLN file,
-// Note, that dependencies from executables to 
+// Note, that dependencies from executables to
 // the libraries it uses are also done here
 void
 cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout,
@@ -166,11 +166,11 @@ cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout,
 {
   // check to see if this is a fortran build
   const char* ext = ".vcproj";
-  const char* project = 
+  const char* project =
     "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"";
   if(this->TargetIsFortranOnly(t))
     {
-    ext = ".vfproj"; 
+    ext = ".vfproj";
     project = "Project(\"{6989167D-11E4-40FE-8C1A-2192A86A7E90}\") = \"";
     }
   const char* targetExt = t.GetProperty("GENERATOR_FILE_NAME_EXT");
@@ -187,7 +187,7 @@ cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout,
   fout << "\tProjectSection(ProjectDependencies) = postProject\n";
   this->WriteProjectDepends(fout, dspname, dir, t);
   fout << "\tEndProjectSection\n";
-  
+
   fout <<"EndProject\n";
 
   UtilityDependsMap::iterator ui = this->UtilityDepends.find(&t);
@@ -208,7 +208,7 @@ cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout,
 
 //----------------------------------------------------------------------------
 // Write a dsp file into the SLN file,
-// Note, that dependencies from executables to 
+// Note, that dependencies from executables to
 // the libraries it uses are also done here
 void
 cmGlobalVisualStudio71Generator
@@ -238,12 +238,12 @@ cmGlobalVisualStudio71Generator
 // Write a dsp file into the SLN file, Note, that dependencies from
 // executables to the libraries it uses are also done here
 void cmGlobalVisualStudio71Generator
-::WriteExternalProject(std::ostream& fout, 
+::WriteExternalProject(std::ostream& fout,
                        const char* name,
                        const char* location,
                        const char* typeGuid,
                        const std::set<cmStdString>& depends)
-{ 
+{
   fout << "Project(\"{"
        << (typeGuid ? typeGuid : "8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942")
        << "}\") = \""
@@ -251,7 +251,7 @@ void cmGlobalVisualStudio71Generator
        << this->ConvertToSolutionPath(location) << "\", \"{"
        << this->GetGUID(name)
        << "}\"\n";
-  
+
   // write out the dependencies here VS 7.1 includes dependencies with the
   // project instead of in the global section
   if(!depends.empty())
@@ -262,18 +262,18 @@ void cmGlobalVisualStudio71Generator
       {
       if(it->size() > 0)
         {
-        fout << "\t\t{" 
-             << this->GetGUID(it->c_str()) 
-             << "} = {" 
-             << this->GetGUID(it->c_str()) 
+        fout << "\t\t{"
+             << this->GetGUID(it->c_str())
+             << "} = {"
+             << this->GetGUID(it->c_str())
              << "}\n";
         }
       }
     fout << "\tEndProjectSection\n";
-    }  
+    }
 
   fout << "EndProject\n";
-  
+
 
 }
 
@@ -289,7 +289,7 @@ void cmGlobalVisualStudio71Generator
   for(std::vector<std::string>::iterator i = this->Configurations.begin();
       i != this->Configurations.end(); ++i)
     {
-    fout << "\t\t{" << guid << "}." << *i 
+    fout << "\t\t{" << guid << "}." << *i
          << ".ActiveCfg = " << *i << "|"
          << (platformMapping ? platformMapping : "Win32") << std::endl;
     if(partOfDefaultBuild)
diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h
index 503b708e5..285f202dc 100644
--- a/Source/cmGlobalVisualStudio71Generator.h
+++ b/Source/cmGlobalVisualStudio71Generator.h
@@ -24,9 +24,9 @@ class cmGlobalVisualStudio71Generator : public cmGlobalVisualStudio7Generator
 {
 public:
   cmGlobalVisualStudio71Generator();
-  static cmGlobalGenerator* New() 
+  static cmGlobalGenerator* New()
     { return new cmGlobalVisualStudio71Generator; }
-  
+
   ///! Get the name for the generator.
   virtual const char* GetName() const {
     return cmGlobalVisualStudio71Generator::GetActualName();}
@@ -34,7 +34,7 @@ public:
 
   /** Get the documentation entry for this generator.  */
   virtual void GetDocumentation(cmDocumentationEntry& entry) const;
-  
+
   ///! Create a local generator appropriate to this Global Generator
   virtual cmLocalGenerator *CreateLocalGenerator();
 
@@ -54,13 +54,13 @@ public:
 protected:
   virtual const char* GetIDEVersion() { return "7.1"; }
   virtual void AddPlatformDefinitions(cmMakefile* mf);
-  virtual void WriteSLNFile(std::ostream& fout, 
+  virtual void WriteSLNFile(std::ostream& fout,
                             cmLocalGenerator* root,
                             std::vector<cmLocalGenerator*>& generators);
   virtual void WriteSolutionConfigurations(std::ostream& fout);
-  virtual void WriteProject(std::ostream& fout, 
+  virtual void WriteProject(std::ostream& fout,
                             const char* name, const char* path, cmTarget &t);
-  virtual void WriteProjectDepends(std::ostream& fout, 
+  virtual void WriteProjectDepends(std::ostream& fout,
                            const char* name, const char* path, cmTarget &t);
   virtual void WriteProjectConfigurations(std::ostream& fout,
                                           const char* name,
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 6332d0b10..d485d6ee3 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -23,7 +23,7 @@ cmGlobalVisualStudio7Generator::cmGlobalVisualStudio7Generator()
 
 
 void cmGlobalVisualStudio7Generator
-::EnableLanguage(std::vector<std::string>const &  lang, 
+::EnableLanguage(std::vector<std::string>const &  lang,
                  cmMakefile *mf, bool optional)
 {
   mf->AddDefinition("CMAKE_GENERATOR_CC", "cl");
@@ -32,13 +32,13 @@ void cmGlobalVisualStudio7Generator
   mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1");
   mf->AddDefinition("CMAKE_GENERATOR_FC", "ifort");
   this->AddPlatformDefinitions(mf);
-  
+
   // Create list of configurations requested by user's cache, if any.
   this->cmGlobalGenerator::EnableLanguage(lang, mf, optional);
   this->GenerateConfigurations(mf);
-  
+
   // if this environment variable is set, then copy it to
-  // a static cache entry.  It will be used by 
+  // a static cache entry.  It will be used by
   // cmLocalGenerator::ConstructScript, to add an extra PATH
   // to all custom commands.   This is because the VS IDE
   // does not use the environment it is run in, and this allows
@@ -48,7 +48,7 @@ void cmGlobalVisualStudio7Generator
   if(extraPath)
     {
     mf->AddCacheDefinition
-      ("CMAKE_MSVCIDE_RUN_PATH", extraPath, 
+      ("CMAKE_MSVCIDE_RUN_PATH", extraPath,
        "Saved environment variable CMAKE_MSVCIDE_RUN_PATH",
        cmCacheManager::STATIC);
     }
@@ -64,7 +64,7 @@ void cmGlobalVisualStudio7Generator::AddPlatformDefinitions(cmMakefile* mf)
 
 std::string cmGlobalVisualStudio7Generator
 ::GenerateBuildCommand(const char* makeProgram,
-                       const char *projectName, 
+                       const char *projectName,
                        const char* additionalOptions, const char *targetName,
                        const char* config, bool ignoreErrors, bool)
 {
@@ -72,7 +72,7 @@ std::string cmGlobalVisualStudio7Generator
   (void) ignoreErrors;
 
   // now build the test
-  std::string makeCommand = 
+  std::string makeCommand =
     cmSystemTools::ConvertToOutputPath(makeProgram);
   std::string lowerCaseCommand = makeCommand;
   cmSystemTools::LowerCase(lowerCaseCommand);
@@ -80,7 +80,7 @@ std::string cmGlobalVisualStudio7Generator
   // if there are spaces in the makeCommand, assume a full path
   // and convert it to a path with no spaces in it as the
   // RunSingleCommand does not like spaces
-#if defined(_WIN32) && !defined(__CYGWIN__)      
+#if defined(_WIN32) && !defined(__CYGWIN__)
   if(makeCommand.find(' ') != std::string::npos)
     {
     cmSystemTools::GetShortPath(makeCommand.c_str(), makeCommand);
@@ -143,7 +143,7 @@ cmLocalGenerator *cmGlobalVisualStudio7Generator::CreateLocalGenerator()
 void cmGlobalVisualStudio7Generator::GenerateConfigurations(cmMakefile* mf)
 {
   // process the configurations
-  const char* ct 
+  const char* ct
     = this->CMakeInstance->GetCacheDefinition("CMAKE_CONFIGURATION_TYPES");
   if ( ct )
     {
@@ -152,7 +152,7 @@ void cmGlobalVisualStudio7Generator::GenerateConfigurations(cmMakefile* mf)
     for(std::vector<std::string>::iterator i = argsOut.begin();
         i != argsOut.end(); ++i)
       {
-      if(std::find(this->Configurations.begin(), 
+      if(std::find(this->Configurations.begin(),
                    this->Configurations.end(),
                    *i) == this->Configurations.end())
         {
@@ -166,7 +166,7 @@ void cmGlobalVisualStudio7Generator::GenerateConfigurations(cmMakefile* mf)
     this->Configurations.push_back("Debug");
     this->Configurations.push_back("Release");
     }
-  
+
   // Reset the entry to have a semi-colon separated list.
   std::string configs = this->Configurations[0];
   for(unsigned int i=1; i < this->Configurations.size(); ++i)
@@ -237,7 +237,7 @@ void cmGlobalVisualStudio7Generator::OutputSLNFile()
 
 
 void cmGlobalVisualStudio7Generator::WriteTargetConfigurations(
-  std::ostream& fout, 
+  std::ostream& fout,
   cmLocalGenerator* root,
   OrderedTargetDependSet const& projectTargets)
 {
@@ -258,7 +258,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetConfigurations(
       {
       bool partOfDefaultBuild = this->IsPartOfDefaultBuild(
         root->GetMakefile()->GetProjectName(), target);
-      const char *vcprojName = 
+      const char *vcprojName =
         target->GetProperty("GENERATOR_FILE_NAME");
       if (vcprojName)
         {
@@ -369,13 +369,13 @@ void cmGlobalVisualStudio7Generator::WriteTargetDepends(
         projectTargets.begin(); tt != projectTargets.end(); ++tt)
     {
     cmTarget* target = *tt;
-    cmMakefile* mf = target->GetMakefile(); 
-    const char *vcprojName = 
+    cmMakefile* mf = target->GetMakefile();
+    const char *vcprojName =
       target->GetProperty("GENERATOR_FILE_NAME");
     if (vcprojName)
-      { 
+      {
       std::string dir = mf->GetStartDirectory();
-      this->WriteProjectDepends(fout, vcprojName, 
+      this->WriteProjectDepends(fout, vcprojName,
                                 dir.c_str(), *target);
       }
     }
@@ -409,7 +409,7 @@ void cmGlobalVisualStudio7Generator
   // Write out the configurations information for the solution
   fout << "Global\n"
        << "\tGlobalSection(SolutionConfiguration) = preSolution\n";
-  
+
   int c = 0;
   for(std::vector<std::string>::iterator i = this->Configurations.begin();
       i != this->Configurations.end(); ++i)
@@ -418,7 +418,7 @@ void cmGlobalVisualStudio7Generator
     c++;
     }
   fout << "\tEndGlobalSection\n";
-  // Write out project(target) depends 
+  // Write out project(target) depends
   fout << "\tGlobalSection(ProjectDependencies) = postSolution\n";
   this->WriteTargetDepends(fout, orderedProjectTargets);
   fout << "\tEndGlobalSection\n";
@@ -506,12 +506,12 @@ cmGlobalVisualStudio7Generator::ConvertToSolutionPath(const char* path)
 }
 
 // Write a dsp file into the SLN file,
-// Note, that dependencies from executables to 
+// Note, that dependencies from executables to
 // the libraries it uses are also done here
-void cmGlobalVisualStudio7Generator::WriteProject(std::ostream& fout, 
+void cmGlobalVisualStudio7Generator::WriteProject(std::ostream& fout,
                                const char* dspname,
                                const char* dir, cmTarget& target)
-{ 
+{
    // check to see if this is a fortran build
   const char* ext = ".vcproj";
   const char* project =
@@ -544,7 +544,7 @@ void cmGlobalVisualStudio7Generator::WriteProject(std::ostream& fout,
 
 
 // Write a dsp file into the SLN file,
-// Note, that dependencies from executables to 
+// Note, that dependencies from executables to
 // the libraries it uses are also done here
 void
 cmGlobalVisualStudio7Generator
@@ -607,14 +607,14 @@ void cmGlobalVisualStudio7Generator
 
 
 // Write a dsp file into the SLN file,
-// Note, that dependencies from executables to 
+// Note, that dependencies from executables to
 // the libraries it uses are also done here
-void cmGlobalVisualStudio7Generator::WriteExternalProject(std::ostream& fout, 
+void cmGlobalVisualStudio7Generator::WriteExternalProject(std::ostream& fout,
                                const char* name,
                                const char* location,
                                const char* typeGuid,
                                const std::set<cmStdString>&)
-{ 
+{
   std::string d = cmSystemTools::ConvertToOutputPath(location);
   fout << "Project("
        << "\"{"
@@ -639,7 +639,7 @@ void cmGlobalVisualStudio7Generator::WriteSLNFooter(std::ostream& fout)
        << "EndGlobal\n";
 }
 
-  
+
 // ouput standard header for dsw file
 void cmGlobalVisualStudio7Generator::WriteSLNHeader(std::ostream& fout)
 {
@@ -705,7 +705,7 @@ std::string cmGlobalVisualStudio7Generator::GetGUID(const char* name)
 {
   std::string guidStoreName = name;
   guidStoreName += "_GUID_CMAKE";
-  const char* storedGUID = 
+  const char* storedGUID =
     this->CMakeInstance->GetCacheDefinition(guidStoreName.c_str());
   if(storedGUID)
     {
@@ -733,8 +733,8 @@ void cmGlobalVisualStudio7Generator::CreateGUID(const char* name)
   ret = reinterpret_cast<char*>(uidstr);
   RpcStringFree(&uidstr);
   ret = cmSystemTools::UpperCase(ret);
-  this->CMakeInstance->AddCacheEntry(guidStoreName.c_str(), 
-                                     ret.c_str(), "Stored GUID", 
+  this->CMakeInstance->AddCacheEntry(guidStoreName.c_str(),
+                                     ret.c_str(), "Stored GUID",
                                      cmCacheManager::INTERNAL);
 }
 
@@ -775,7 +775,7 @@ bool cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(const char* project,
     {
     return false;
     }
-  // if it is a utilitiy target then only make it part of the 
+  // if it is a utilitiy target then only make it part of the
   // default build if another target depends on it
   int type = target->GetType();
   if (type == cmTarget::GLOBAL_TARGET)
@@ -785,7 +785,7 @@ bool cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(const char* project,
   if(type == cmTarget::UTILITY)
     {
     return this->IsDependedOn(project, target);
-    } 
+    }
   // default is to be part of the build
   return true;
 }
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index e7c42327d..a74a4eebe 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -35,7 +35,7 @@ cmLocalGenerator *cmGlobalVisualStudio8Generator::CreateLocalGenerator()
   lg->SetGlobalGenerator(this);
   return lg;
 }
-  
+
 //----------------------------------------------------------------------------
 // ouput standard header for dsw file
 void cmGlobalVisualStudio8Generator::WriteSLNHeader(std::ostream& fout)
@@ -336,7 +336,7 @@ bool cmGlobalVisualStudio8Generator::NeedLinkLibraryDependencies(
 
 //----------------------------------------------------------------------------
 static cmVS7FlagTable cmVS8ExtraFlagTable[] =
-{ 
+{
   {"CallingConvention", "Gd", "cdecl", "0", 0 },
   {"CallingConvention", "Gr", "fastcall", "1", 0 },
   {"CallingConvention", "Gz", "stdcall", "2", 0 },
diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h
index 7dae42907..31501bc90 100644
--- a/Source/cmGlobalVisualStudio8Generator.h
+++ b/Source/cmGlobalVisualStudio8Generator.h
@@ -24,9 +24,9 @@ class cmGlobalVisualStudio8Generator : public cmGlobalVisualStudio71Generator
 {
 public:
   cmGlobalVisualStudio8Generator();
-  static cmGlobalGenerator* New() { 
+  static cmGlobalGenerator* New() {
     return new cmGlobalVisualStudio8Generator; }
-  
+
   ///! Get the name for the generator.
   virtual const char* GetName() const {
     return cmGlobalVisualStudio8Generator::GetActualName();}
@@ -36,7 +36,7 @@ public:
 
   /** Get the documentation entry for this generator.  */
   virtual void GetDocumentation(cmDocumentationEntry& entry) const;
-  
+
   ///! Create a local generator appropriate to this Global Generator
   virtual cmLocalGenerator *CreateLocalGenerator();
 
diff --git a/Source/cmGlobalVisualStudio8Win64Generator.h b/Source/cmGlobalVisualStudio8Win64Generator.h
index 084ba697c..136cdb8b4 100644
--- a/Source/cmGlobalVisualStudio8Win64Generator.h
+++ b/Source/cmGlobalVisualStudio8Win64Generator.h
@@ -20,14 +20,14 @@
  *
  * cmGlobalVisualStudio8Win64Generator manages UNIX build process for a tree
  */
-class cmGlobalVisualStudio8Win64Generator : 
+class cmGlobalVisualStudio8Win64Generator :
   public cmGlobalVisualStudio8Generator
 {
 public:
   cmGlobalVisualStudio8Win64Generator();
-  static cmGlobalGenerator* New() { 
+  static cmGlobalGenerator* New() {
     return new cmGlobalVisualStudio8Win64Generator; }
-  
+
   ///! Get the name for the generator.
   virtual const char* GetName() const {
     return cmGlobalVisualStudio8Win64Generator::GetActualName();}
@@ -43,7 +43,7 @@ public:
 
   /**
    * Try to determine system infomation such as shared library
-   * extension, pthreads, byte order etc.  
+   * extension, pthreads, byte order etc.
    */
   virtual void AddPlatformDefinitions(cmMakefile *);
 };
diff --git a/Source/cmGlobalVisualStudio9Generator.cxx b/Source/cmGlobalVisualStudio9Generator.cxx
index f082675eb..fcf00d532 100644
--- a/Source/cmGlobalVisualStudio9Generator.cxx
+++ b/Source/cmGlobalVisualStudio9Generator.cxx
@@ -59,7 +59,7 @@ void cmGlobalVisualStudio9Generator
 
 //----------------------------------------------------------------------------
 void cmGlobalVisualStudio9Generator
-::EnableLanguage(std::vector<std::string>const &  lang, 
+::EnableLanguage(std::vector<std::string>const &  lang,
                  cmMakefile *mf, bool optional)
 {
   cmGlobalVisualStudio8Generator::EnableLanguage(lang, mf, optional);
diff --git a/Source/cmGlobalVisualStudio9Generator.h b/Source/cmGlobalVisualStudio9Generator.h
index bfb03c4c5..361b58c76 100644
--- a/Source/cmGlobalVisualStudio9Generator.h
+++ b/Source/cmGlobalVisualStudio9Generator.h
@@ -20,20 +20,20 @@
  *
  * cmGlobalVisualStudio9Generator manages UNIX build process for a tree
  */
-class cmGlobalVisualStudio9Generator : 
+class cmGlobalVisualStudio9Generator :
   public cmGlobalVisualStudio8Generator
 {
 public:
   cmGlobalVisualStudio9Generator();
-  static cmGlobalGenerator* New() { 
+  static cmGlobalGenerator* New() {
     return new cmGlobalVisualStudio9Generator; }
-  
+
   ///! Get the name for the generator.
   virtual const char* GetName() const {
     return cmGlobalVisualStudio9Generator::GetActualName();}
   static const char* GetActualName() {return "Visual Studio 9 2008";}
   virtual void AddPlatformDefinitions(cmMakefile* mf);
-  
+
   /** Get the documentation entry for this generator.  */
   virtual void GetDocumentation(cmDocumentationEntry& entry) const;
 
@@ -42,9 +42,9 @@ public:
 
   /**
    * Try to determine system infomation such as shared library
-   * extension, pthreads, byte order etc.  
+   * extension, pthreads, byte order etc.
    */
-  virtual void EnableLanguage(std::vector<std::string>const& languages, 
+  virtual void EnableLanguage(std::vector<std::string>const& languages,
                               cmMakefile *, bool optional);
   virtual void WriteSLNHeader(std::ostream& fout);
 
diff --git a/Source/cmGlobalVisualStudio9Win64Generator.h b/Source/cmGlobalVisualStudio9Win64Generator.h
index f6dcc03cd..0ce1afe3d 100644
--- a/Source/cmGlobalVisualStudio9Win64Generator.h
+++ b/Source/cmGlobalVisualStudio9Win64Generator.h
@@ -20,14 +20,14 @@
  *
  * cmGlobalVisualStudio8Win64Generator manages UNIX build process for a tree
  */
-class cmGlobalVisualStudio9Win64Generator : 
+class cmGlobalVisualStudio9Win64Generator :
   public cmGlobalVisualStudio9Generator
 {
 public:
   cmGlobalVisualStudio9Win64Generator();
-  static cmGlobalGenerator* New() { 
+  static cmGlobalGenerator* New() {
     return new cmGlobalVisualStudio9Win64Generator; }
-  
+
   ///! Get the name for the generator.
   virtual const char* GetName() const {
     return cmGlobalVisualStudio9Win64Generator::GetActualName();}
@@ -43,7 +43,7 @@ public:
 
   /**
    * Try to determine system infomation such as shared library
-   * extension, pthreads, byte order etc.  
+   * extension, pthreads, byte order etc.
    */
   virtual void AddPlatformDefinitions(cmMakefile *);
 };
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 2a918c925..a2b4c6519 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -53,7 +53,7 @@ void cmGlobalVisualStudioGenerator::Generate()
       {
       // Use no actual command lines so that the target itself is not
       // considered always out of date.
-      cmTarget* allBuild = 
+      cmTarget* allBuild =
         gen[0]->GetMakefile()->
         AddUtilityCommand("ALL_BUILD", true, no_working_dir,
                           no_depends, no_commands, false,
diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h
index b62ba229d..27fc8cf2e 100644
--- a/Source/cmGlobalVisualStudioGenerator.h
+++ b/Source/cmGlobalVisualStudioGenerator.h
@@ -58,7 +58,7 @@ public:
    */
   virtual void CallVisualStudioMacro(MacroName m,
                                      const char* vsSolutionFile = 0);
-  
+
   // return true if target is fortran only
   bool TargetIsFortranOnly(cmTarget& t);
 
diff --git a/Source/cmGlobalWatcomWMakeGenerator.cxx b/Source/cmGlobalWatcomWMakeGenerator.cxx
index 8c6dff9bd..45b171ff2 100644
--- a/Source/cmGlobalWatcomWMakeGenerator.cxx
+++ b/Source/cmGlobalWatcomWMakeGenerator.cxx
@@ -23,11 +23,11 @@ cmGlobalWatcomWMakeGenerator::cmGlobalWatcomWMakeGenerator()
 }
 
 void cmGlobalWatcomWMakeGenerator
-::EnableLanguage(std::vector<std::string>const& l, 
-                 cmMakefile *mf, 
+::EnableLanguage(std::vector<std::string>const& l,
+                 cmMakefile *mf,
                  bool optional)
 {
-  // pick a default 
+  // pick a default
   mf->AddDefinition("WATCOM", "1");
   mf->AddDefinition("CMAKE_QUOTE_INCLUDE_PATHS", "1");
   mf->AddDefinition("CMAKE_MANGLE_OBJECT_FILE_NAMES", "1");
diff --git a/Source/cmGlobalWatcomWMakeGenerator.h b/Source/cmGlobalWatcomWMakeGenerator.h
index b416bb181..ee16eaebc 100644
--- a/Source/cmGlobalWatcomWMakeGenerator.h
+++ b/Source/cmGlobalWatcomWMakeGenerator.h
@@ -31,15 +31,15 @@ public:
 
   /** Get the documentation entry for this generator.  */
   virtual void GetDocumentation(cmDocumentationEntry& entry) const;
-  
+
   ///! Create a local generator appropriate to this Global Generator
   virtual cmLocalGenerator *CreateLocalGenerator();
 
   /**
    * Try to determine system infomation such as shared library
-   * extension, pthreads, byte order etc.  
+   * extension, pthreads, byte order etc.
    */
-  virtual void EnableLanguage(std::vector<std::string>const& languages, 
+  virtual void EnableLanguage(std::vector<std::string>const& languages,
                               cmMakefile *, bool optional);
 };
 
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index 800963b9c..afa1ca22e 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -38,15 +38,15 @@ public:
 
   /** Get the documentation entry for this generator.  */
   virtual void GetDocumentation(cmDocumentationEntry& entry) const;
-  
+
   ///! Create a local generator appropriate to this Global Generator
   virtual cmLocalGenerator *CreateLocalGenerator();
 
   /**
    * Try to determine system infomation such as shared library
-   * extension, pthreads, byte order etc.  
+   * extension, pthreads, byte order etc.
    */
-  virtual void EnableLanguage(std::vector<std::string>const& languages, 
+  virtual void EnableLanguage(std::vector<std::string>const& languages,
                               cmMakefile *, bool optional);
   /**
    * Try running cmake and building a file. This is used for dynalically
@@ -54,16 +54,16 @@ public:
    */
   virtual std::string GenerateBuildCommand(const char* makeProgram,
                                            const char *projectName,
-                                           const char* additionalOptions, 
+                                           const char* additionalOptions,
                                            const char *targetName,
-                                           const char* config, 
+                                           const char* config,
                                            bool ignoreErrors,
                                            bool fast);
 
   /**
    * Generate the all required files for building this project/tree. This
    * basically creates a series of LocalGenerators for each directory and
-   * requests that they Generate.  
+   * requests that they Generate.
    */
   virtual void Generate();
 
@@ -82,7 +82,7 @@ public:
       i.e. "Can I build Debug and Release in the same tree?" */
   virtual bool IsMultiConfig();
 
-private: 
+private:
   cmXCodeObject* CreateOrGetPBXGroup(cmTarget& cmtarget,
                                      cmSourceGroup* sg);
   cmXCodeObject* CreatePBXGroup(cmXCodeObject *parent,
@@ -107,18 +107,18 @@ private:
 
   void AddCommandsToBuildPhase(cmXCodeObject* buildphase,
                                cmTarget& target,
-                               std::vector<cmCustomCommand> 
+                               std::vector<cmCustomCommand>
                                const & commands,
                                const char* commandFileName);
-  
-  void CreateCustomRulesMakefile(const char* makefileBasename, 
+
+  void CreateCustomRulesMakefile(const char* makefileBasename,
                                  cmTarget& target,
                                  std::vector<cmCustomCommand> const & commands,
                                  const char* configName,
-                                 const std::map<cmStdString, cmStdString>& 
+                                 const std::map<cmStdString, cmStdString>&
                                      multipleOutputPairs
                                 );
-  
+
   cmXCodeObject* FindXCodeTarget(cmTarget*);
   std::string GetOrCreateId(const char* name, const char* id);
 
@@ -135,9 +135,9 @@ private:
   const char* GetTargetFileType(cmTarget& cmtarget);
   const char* GetTargetProductType(cmTarget& cmtarget);
   std::string AddConfigurations(cmXCodeObject* target, cmTarget& cmtarget);
-  void AppendOrAddBuildSetting(cmXCodeObject* settings, const char* attr, 
+  void AppendOrAddBuildSetting(cmXCodeObject* settings, const char* attr,
                                const char* value);
-  void AppendBuildSettingAttribute(cmXCodeObject* target, const char* attr, 
+  void AppendBuildSettingAttribute(cmXCodeObject* target, const char* attr,
                                    const char* value, const char* configName);
   cmXCodeObject* CreateUtilityTarget(cmTarget& target);
   void AddDependAndLinkInformation(cmXCodeObject* target);
@@ -161,10 +161,10 @@ private:
                                                const std::string &lang);
   cmXCodeObject* CreateXCodeFileReference(cmSourceFile* sf,
                                           cmTarget& cmtarget);
-  cmXCodeObject* CreateXCodeSourceFile(cmLocalGenerator* gen, 
+  cmXCodeObject* CreateXCodeSourceFile(cmLocalGenerator* gen,
                                        cmSourceFile* sf,
                                        cmTarget& cmtarget);
-  void CreateXCodeTargets(cmLocalGenerator* gen, 
+  void CreateXCodeTargets(cmLocalGenerator* gen,
                           std::vector<cmXCodeObject*>&);
   bool IsHeaderFile(cmSourceFile*);
   void AddDependTarget(cmXCodeObject* target,
@@ -172,9 +172,9 @@ private:
   void CreateXCodeDependHackTarget(std::vector<cmXCodeObject*>& targets);
   bool SpecialTargetEmitted(std::string const& tname);
   void SetGenerationRoot(cmLocalGenerator* root);
-  void AddExtraTargets(cmLocalGenerator* root, 
+  void AddExtraTargets(cmLocalGenerator* root,
                        std::vector<cmLocalGenerator*>& gens);
-  cmXCodeObject* CreateBuildPhase(const char* name, 
+  cmXCodeObject* CreateBuildPhase(const char* name,
                                   const char* name2,
                                   cmTarget& cmtarget,
                                   const std::vector<cmCustomCommand>&);
diff --git a/Source/cmHexFileConverter.cxx b/Source/cmHexFileConverter.cxx
index 2ff794573..a540825ff 100644
--- a/Source/cmHexFileConverter.cxx
+++ b/Source/cmHexFileConverter.cxx
@@ -22,8 +22,8 @@
 // might go to SystemTools ?
 static bool cm_IsHexChar(char c)
 {
-  return (((c >= '0') && (c <= '9')) 
-         || ((c >= 'a') && (c <= 'f')) 
+  return (((c >= '0') && (c <= '9'))
+         || ((c >= 'a') && (c <= 'f'))
          || ((c >= 'A') && (c <= 'F')));
 }
 
@@ -45,7 +45,7 @@ static unsigned int ChompStrlen(const char* line)
   return length;
 }
 
-static bool OutputBin(FILE* file, const char * buf, 
+static bool OutputBin(FILE* file, const char * buf,
                       unsigned int startIndex, unsigned int stopIndex)
 {
   bool success = true;
@@ -77,7 +77,7 @@ static bool OutputBin(FILE* file, const char * buf,
 static bool ConvertMotorolaSrecLine(const char* buf, FILE* outFile)
 {
   unsigned int slen = ChompStrlen(buf);
-  if ((slen < MOTOROLA_SREC_MIN_LINE_LENGTH) 
+  if ((slen < MOTOROLA_SREC_MIN_LINE_LENGTH)
        || (slen > MOTOROLA_SREC_MAX_LINE_LENGTH))
     {
     return false;
@@ -125,7 +125,7 @@ static bool ConvertMotorolaSrecLine(const char* buf, FILE* outFile)
 static bool ConvertIntelHexLine(const char* buf, FILE* outFile)
 {
   unsigned int slen = ChompStrlen(buf);
-  if ((slen < INTEL_HEX_MIN_LINE_LENGTH) 
+  if ((slen < INTEL_HEX_MIN_LINE_LENGTH)
        || (slen > INTEL_HEX_MAX_LINE_LENGTH))
     {
     return false;
@@ -148,7 +148,7 @@ static bool ConvertIntelHexLine(const char* buf, FILE* outFile)
     dataStart = 9;
     }
   // ignore extra address records
-  else if ((buf[8] == '2') || (buf[8] == '3') || (buf[8] == '4') 
+  else if ((buf[8] == '2') || (buf[8] == '3') || (buf[8] == '4')
             || (buf[8] == '5'))
     {
     return true;
diff --git a/Source/cmHexFileConverter.h b/Source/cmHexFileConverter.h
index 94c757f79..e11d74a2f 100644
--- a/Source/cmHexFileConverter.h
+++ b/Source/cmHexFileConverter.h
@@ -13,7 +13,7 @@
 #define cmHexFileConverter_h
 
 /** \class cmHexFileConverter
- * \brief Can detects Intel Hex and Motorola S-record files and convert them 
+ * \brief Can detects Intel Hex and Motorola S-record files and convert them
  *        to binary files.
  *
  */
diff --git a/Source/cmIfCommand.h b/Source/cmIfCommand.h
index 94e4d998a..4893a17b6 100644
--- a/Source/cmIfCommand.h
+++ b/Source/cmIfCommand.h
@@ -26,7 +26,7 @@ public:
                                  cmExecutionStatus &);
   virtual bool ShouldRemove(const cmListFileFunction& lff,
                             cmMakefile &mf);
-  
+
   std::vector<cmListFileArgument> Args;
   std::vector<cmListFileFunction> Functions;
   bool IsBlocking;
@@ -41,7 +41,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmIfCommand;
     }
@@ -52,7 +52,7 @@ public:
    */
   virtual bool InvokeInitialPass(const std::vector<cmListFileArgument>& args,
                                  cmExecutionStatus &);
-    
+
   /**
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
@@ -72,7 +72,7 @@ public:
     {
     return "Conditionally execute a group of commands.";
     }
-  
+
   /**
    * This determines if the command is invoked when in script mode.
    */
@@ -238,22 +238,22 @@ public:
       "7) The left and right hand arguments to AND OR are "
       "independently tested to see if they are boolean constants, if "
       "so they are used as such, otherwise they are assumed to be "
-      "variables and are dereferenced. \n"    
+      "variables and are dereferenced. \n"
       ;
     }
 
   // this is a shared function for both If and Else to determine if the
   // arguments were valid, and if so, was the response true. If there is
   // an error, the errorString will be set.
-  static bool IsTrue(const std::vector<std::string> &args, 
-    std::string &errorString, cmMakefile *mf, 
+  static bool IsTrue(const std::vector<std::string> &args,
+    std::string &errorString, cmMakefile *mf,
     cmake::MessageType &status);
-  
+
   // Get a definition from the makefile.  If it doesn't exist,
   // return the original string.
   static const char* GetVariableOrString(const char* str,
                                          const cmMakefile* mf);
-  
+
   cmTypeMacro(cmIfCommand, cmCommand);
 };
 
diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx
index 9e6f4b6ef..4dd98a16c 100644
--- a/Source/cmIncludeDirectoryCommand.cxx
+++ b/Source/cmIncludeDirectoryCommand.cxx
@@ -67,8 +67,8 @@ bool cmIncludeDirectoryCommand
 // output from a program and passing it into a command the cleanup doesn't
 // always happen
 //
-void cmIncludeDirectoryCommand::AddDirectory(const char *i, 
-                                             bool before, 
+void cmIncludeDirectoryCommand::AddDirectory(const char *i,
+                                             bool before,
                                              bool system)
 {
   // break apart any line feed arguments
@@ -91,7 +91,7 @@ void cmIncludeDirectoryCommand::AddDirectory(const char *i,
   // remove any leading or trailing spaces and \r
   std::string::size_type b = ret.find_first_not_of(" \r");
   std::string::size_type e = ret.find_last_not_of(" \r");
-  if ((b!=ret.npos) && (e!=ret.npos))  
+  if ((b!=ret.npos) && (e!=ret.npos))
     {
     ret.assign(ret, b, 1+e-b);   // copy the remaining substring
     }
diff --git a/Source/cmIncludeDirectoryCommand.h b/Source/cmIncludeDirectoryCommand.h
index dcc116aa8..6751fc02f 100644
--- a/Source/cmIncludeDirectoryCommand.h
+++ b/Source/cmIncludeDirectoryCommand.h
@@ -26,7 +26,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmIncludeDirectoryCommand;
     }
@@ -50,7 +50,7 @@ public:
     {
     return "Add include directories to the build.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -76,7 +76,7 @@ public:
       "directories are meant as system include directories on some "
       "platforms.";
     }
-  
+
   cmTypeMacro(cmIncludeDirectoryCommand, cmCommand);
 
 protected:
diff --git a/Source/cmIncludeExternalMSProjectCommand.cxx b/Source/cmIncludeExternalMSProjectCommand.cxx
index d219c169a..d40d8fe72 100644
--- a/Source/cmIncludeExternalMSProjectCommand.cxx
+++ b/Source/cmIncludeExternalMSProjectCommand.cxx
@@ -15,7 +15,7 @@
 bool cmIncludeExternalMSProjectCommand
 ::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &)
 {
-  if(args.size() < 2) 
+  if(args.size() < 2)
   {
   this->SetError("INCLUDE_EXTERNAL_MSPROJECT called with incorrect "
                  "number of arguments");
@@ -77,7 +77,7 @@ bool cmIncludeExternalMSProjectCommand
       }
 
     // Create a target instance for this utility.
-    cmTarget* target=this->Makefile->AddNewTarget(cmTarget::UTILITY, 
+    cmTarget* target=this->Makefile->AddNewTarget(cmTarget::UTILITY,
                                                   utility_name.c_str());
 
     target->SetProperty("GENERATOR_FILE_NAME", utility_name.c_str());
diff --git a/Source/cmIncludeExternalMSProjectCommand.h b/Source/cmIncludeExternalMSProjectCommand.h
index 2b2ed0d15..d5cec01eb 100644
--- a/Source/cmIncludeExternalMSProjectCommand.h
+++ b/Source/cmIncludeExternalMSProjectCommand.h
@@ -27,7 +27,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmIncludeExternalMSProjectCommand;
     }
@@ -38,7 +38,7 @@ public:
    */
   virtual bool InitialPass(std::vector<std::string> const& args,
                            cmExecutionStatus &status);
-  
+
   /**
    * The name of the command as specified in CMakeList.txt.
    */
@@ -51,7 +51,7 @@ public:
     {
     return "Include an external Microsoft project file in a workspace.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -75,7 +75,7 @@ public:
       "(e.g. WIX projects). "
       "These options are not supported by the Visual Studio 6 generator.";
     }
-  
+
   cmTypeMacro(cmIncludeExternalMSProjectCommand, cmCommand);
 };
 
diff --git a/Source/cmIncludeRegularExpressionCommand.cxx b/Source/cmIncludeRegularExpressionCommand.cxx
index b0d8325d3..ef6e8c6ae 100644
--- a/Source/cmIncludeRegularExpressionCommand.cxx
+++ b/Source/cmIncludeRegularExpressionCommand.cxx
@@ -21,12 +21,12 @@ bool cmIncludeRegularExpressionCommand
     return false;
     }
   this->Makefile->SetIncludeRegularExpression(args[0].c_str());
-  
+
   if(args.size() > 1)
     {
     this->Makefile->SetComplainRegularExpression(args[1].c_str());
     }
-  
+
   return true;
 }
 
diff --git a/Source/cmIncludeRegularExpressionCommand.h b/Source/cmIncludeRegularExpressionCommand.h
index 7c633c0a3..2e4177548 100644
--- a/Source/cmIncludeRegularExpressionCommand.h
+++ b/Source/cmIncludeRegularExpressionCommand.h
@@ -26,7 +26,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmIncludeRegularExpressionCommand;
     }
@@ -37,7 +37,7 @@ public:
    */
   virtual bool InitialPass(std::vector<std::string> const& args,
                            cmExecutionStatus &status);
-  
+
   /**
    * The name of the command as specified in CMakeList.txt.
    */
@@ -50,7 +50,7 @@ public:
     {
     return "Set the regular expression used for dependency checking.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -66,7 +66,7 @@ public:
       "  regex_match    = \"^.*$\" (match everything)\n"
       "  regex_complain = \"^$\" (match empty string only)";
     }
-  
+
   cmTypeMacro(cmIncludeRegularExpressionCommand, cmCommand);
 };
 
diff --git a/Source/cmInstallFilesCommand.h b/Source/cmInstallFilesCommand.h
index d3c7ed67f..bb0a6ccaf 100644
--- a/Source/cmInstallFilesCommand.h
+++ b/Source/cmInstallFilesCommand.h
@@ -18,7 +18,7 @@
  * \brief Specifies where to install some files
  *
  * cmInstallFilesCommand specifies the relative path where a list of
- * files should be installed.  
+ * files should be installed.
  */
 class cmInstallFilesCommand : public cmCommand
 {
@@ -26,7 +26,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmInstallFilesCommand;
     }
@@ -50,7 +50,7 @@ public:
     {
     return "Deprecated.  Use the install(FILES ) command instead.";
     }
-  
+
   /**
    * This is called at the end after all the information
    * specified by the command is accumulated. Most commands do
@@ -90,7 +90,7 @@ public:
       "The directory <dir> is relative to the installation prefix, which "
       "is stored in the variable CMAKE_INSTALL_PREFIX.";
     }
-  
+
   /** This command is kept for compatibility with older CMake versions. */
   virtual bool IsDiscouraged() const
     {
@@ -102,7 +102,7 @@ public:
 protected:
   void CreateInstallGenerator() const;
   std::string FindInstallSource(const char* name) const;
-  
+
  private:
   std::vector<std::string> FinalArgs;
   bool IsFilesForm;
diff --git a/Source/cmInstallProgramsCommand.h b/Source/cmInstallProgramsCommand.h
index 29c84a09f..27a0498e5 100644
--- a/Source/cmInstallProgramsCommand.h
+++ b/Source/cmInstallProgramsCommand.h
@@ -18,7 +18,7 @@
  * \brief Specifies where to install some programs
  *
  * cmInstallProgramsCommand specifies the relative path where a list of
- * programs should be installed.  
+ * programs should be installed.
  */
 class cmInstallProgramsCommand : public cmCommand
 {
@@ -26,7 +26,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmInstallProgramsCommand;
     }
@@ -50,7 +50,7 @@ public:
     {
     return "Deprecated. Use the install(PROGRAMS ) command instead.";
     }
-  
+
   /**
    * This is called at the end after all the information
    * specified by the command is accumulated. Most commands do
@@ -87,7 +87,7 @@ public:
       "The directory <dir> is relative to the installation prefix, which "
       "is stored in the variable CMAKE_INSTALL_PREFIX.";
     }
-  
+
   /** This command is kept for compatibility with older CMake versions. */
   virtual bool IsDiscouraged() const
     {
diff --git a/Source/cmInstallTargetGenerator.h b/Source/cmInstallTargetGenerator.h
index b48d45661..5d158b8d0 100644
--- a/Source/cmInstallTargetGenerator.h
+++ b/Source/cmInstallTargetGenerator.h
@@ -24,7 +24,7 @@ public:
   cmInstallTargetGenerator(
     cmTarget& t, const char* dest, bool implib,
     const char* file_permissions = "",
-    std::vector<std::string> const& configurations 
+    std::vector<std::string> const& configurations
     = std::vector<std::string>(),
     const char* component = "Unspecified",
     bool optional = false
@@ -86,7 +86,7 @@ protected:
   void AddRPathCheckRule(std::ostream& os, Indent const& indent,
                          const char* config,
                          std::string const& toDestDirPath);
-  
+
   void AddStripRule(std::ostream& os, Indent const& indent,
                     const std::string& toDestDirPath);
   void AddRanlibRule(std::ostream& os, Indent const& indent,
diff --git a/Source/cmInstallTargetsCommand.h b/Source/cmInstallTargetsCommand.h
index e05462faa..c47b38700 100644
--- a/Source/cmInstallTargetsCommand.h
+++ b/Source/cmInstallTargetsCommand.h
@@ -19,7 +19,7 @@
  *
  * cmInstallTargetsCommand specifies the relative path where a list of
  * targets should be installed. The targets can be executables or
- * libraries.  
+ * libraries.
  */
 class cmInstallTargetsCommand : public cmCommand
 {
@@ -27,7 +27,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmInstallTargetsCommand;
     }
@@ -51,7 +51,7 @@ public:
     {
     return "Deprecated. Use the install(TARGETS )  command instead.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -67,7 +67,7 @@ public:
       "is specified, then on systems with special runtime files "
       "(Windows DLL), the files will be copied to that directory.";
     }
-  
+
   /** This command is kept for compatibility with older CMake versions. */
   virtual bool IsDiscouraged() const
     {
diff --git a/Source/cmLinkDirectoriesCommand.h b/Source/cmLinkDirectoriesCommand.h
index a7cd58340..889118cbc 100644
--- a/Source/cmLinkDirectoriesCommand.h
+++ b/Source/cmLinkDirectoriesCommand.h
@@ -18,8 +18,8 @@
  * \brief Define a list of directories containing files to link.
  *
  * cmLinkDirectoriesCommand is used to specify a list
- * of directories containing files to link into executable(s). 
- * Note that the command supports the use of CMake built-in variables 
+ * of directories containing files to link into executable(s).
+ * Note that the command supports the use of CMake built-in variables
  * such as CMAKE_BINARY_DIR and CMAKE_SOURCE_DIR.
  */
 class cmLinkDirectoriesCommand : public cmCommand
@@ -28,7 +28,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmLinkDirectoriesCommand;
     }
@@ -52,7 +52,7 @@ public:
     {
     return "Specify directories in which the linker will look for libraries.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -73,7 +73,7 @@ public:
       "them."
       ;
     }
-  
+
   cmTypeMacro(cmLinkDirectoriesCommand, cmCommand);
 private:
   void AddLinkDir(std::string const& dir);
diff --git a/Source/cmLinkLibrariesCommand.cxx b/Source/cmLinkLibrariesCommand.cxx
index c4458aa6a..2f1db2aa0 100644
--- a/Source/cmLinkLibrariesCommand.cxx
+++ b/Source/cmLinkLibrariesCommand.cxx
@@ -19,7 +19,7 @@ bool cmLinkLibrariesCommand
     {
     return true;
     }
-  // add libraries, nothe that there is an optional prefix 
+  // add libraries, nothe that there is an optional prefix
   // of debug and optimized than can be used
   for(std::vector<std::string>::const_iterator i = args.begin();
       i != args.end(); ++i)
@@ -50,10 +50,10 @@ bool cmLinkLibrariesCommand
       }
     else
       {
-      this->Makefile->AddLinkLibrary(i->c_str());  
+      this->Makefile->AddLinkLibrary(i->c_str());
       }
     }
-  
+
   return true;
 }
 
diff --git a/Source/cmLinkLibrariesCommand.h b/Source/cmLinkLibrariesCommand.h
index 2c0212cef..c450a1cb9 100644
--- a/Source/cmLinkLibrariesCommand.h
+++ b/Source/cmLinkLibrariesCommand.h
@@ -19,7 +19,7 @@
  *
  * cmLinkLibrariesCommand is used to specify a list of libraries to link
  * into executable(s) or shared objects. The names of the libraries
- * should be those defined by the LIBRARY(library) command(s).  
+ * should be those defined by the LIBRARY(library) command(s).
  */
 class cmLinkLibrariesCommand : public cmCommand
 {
@@ -27,7 +27,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmLinkLibrariesCommand;
     }
@@ -51,7 +51,7 @@ public:
     {
     return "Deprecated. Use the target_link_libraries() command instead.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -68,7 +68,7 @@ public:
       "the next library listed is to be used only for that specific "
       "type of build.";
     }
-  
+
   /** This command is kept for compatibility with older CMake versions. */
   virtual bool IsDiscouraged() const
     {
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx
index 908f3b060..9d4f17529 100644
--- a/Source/cmListCommand.cxx
+++ b/Source/cmListCommand.cxx
@@ -98,7 +98,7 @@ bool cmListCommand::GetList(std::vector<std::string>& list, const char* var)
     {
     return false;
     }
-  // if the size of the list 
+  // if the size of the list
   if(listString.size() == 0)
     {
     return true;
@@ -107,7 +107,7 @@ bool cmListCommand::GetList(std::vector<std::string>& list, const char* var)
   cmSystemTools::ExpandListArgument(listString, list, true);
   // check the list for empty values
   bool hasEmpty = false;
-  for(std::vector<std::string>::iterator i = list.begin(); 
+  for(std::vector<std::string>::iterator i = list.begin();
       i != list.end(); ++i)
     {
     if(i->size() == 0)
@@ -116,7 +116,7 @@ bool cmListCommand::GetList(std::vector<std::string>& list, const char* var)
       break;
       }
     }
-  // if no empty elements then just return 
+  // if no empty elements then just return
   if(!hasEmpty)
     {
     return true;
@@ -124,7 +124,7 @@ bool cmListCommand::GetList(std::vector<std::string>& list, const char* var)
   // if we have empty elements we need to check policy CMP0007
   switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0007))
     {
-    case cmPolicies::WARN: 
+    case cmPolicies::WARN:
       {
       // Default is to warn and use old behavior
       // OLD behavior is to allow compatibility, so recall
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index 84cb8fd83..36d84f3be 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -26,7 +26,7 @@ bool cmListFileCacheParseFunction(cmListFileLexer* lexer,
                                   cmListFileFunction& function,
                                   const char* filename);
 
-bool cmListFile::ParseFile(const char* filename, 
+bool cmListFile::ParseFile(const char* filename,
                            bool topLevel,
                            cmMakefile *mf)
 {
@@ -47,7 +47,7 @@ bool cmListFile::ParseFile(const char* filename,
   if(!cmListFileLexer_SetFileName(lexer, filename))
     {
     cmListFileLexer_Delete(lexer);
-    cmSystemTools::Error("cmListFileCache: error can not open file ", 
+    cmSystemTools::Error("cmListFileCache: error can not open file ",
                          filename);
     return false;
     }
@@ -119,7 +119,7 @@ bool cmListFile::ParseFile(const char* filename,
   {
     bool hasVersion = false;
     // search for the right policy command
-    for(std::vector<cmListFileFunction>::iterator i 
+    for(std::vector<cmListFileFunction>::iterator i
           = this->Functions.begin();
         i != this->Functions.end(); ++i)
     {
@@ -129,7 +129,7 @@ bool cmListFile::ParseFile(const char* filename,
         break;
       }
     }
-    // if no policy command is found this is an error if they use any 
+    // if no policy command is found this is an error if they use any
     // non advanced functions or a lot of functions
     if(!hasVersion)
     {
@@ -152,7 +152,7 @@ bool cmListFile::ParseFile(const char* filename,
         allowedCommands.insert("option");
         allowedCommands.insert("message");
         isProblem = false;
-        for(std::vector<cmListFileFunction>::iterator i 
+        for(std::vector<cmListFileFunction>::iterator i
               = this->Functions.begin();
             i != this->Functions.end(); ++i)
         {
@@ -161,10 +161,10 @@ bool cmListFile::ParseFile(const char* filename,
           {
             isProblem = true;
             break;
-          }       
+          }
         }
       }
-      
+
       if (isProblem)
       {
       // Tell the top level cmMakefile to diagnose
@@ -181,7 +181,7 @@ bool cmListFile::ParseFile(const char* filename,
     {
     bool hasProject = false;
     // search for a project command
-    for(std::vector<cmListFileFunction>::iterator i 
+    for(std::vector<cmListFileFunction>::iterator i
           = this->Functions.begin();
         i != this->Functions.end(); ++i)
       {
@@ -256,7 +256,7 @@ bool cmListFileCacheParseFunction(cmListFileLexer* lexer,
       parenDepth--;
       cmListFileArgument a(")",
                            false, filename, token->line);
-      function.Arguments.push_back(a);        
+      function.Arguments.push_back(a);
       }
     else if(token->type == cmListFileLexer_Token_Identifier ||
             token->type == cmListFileLexer_Token_ArgumentUnquoted)
@@ -276,7 +276,7 @@ bool cmListFileCacheParseFunction(cmListFileLexer* lexer,
       // Error.
       cmOStringStream error;
       error << "Error in cmake code at\n"
-            << filename << ":" << cmListFileLexer_GetCurrentLine(lexer) 
+            << filename << ":" << cmListFileLexer_GetCurrentLine(lexer)
             << ":\n"
             << "Parse error.  Function missing ending \")\".  "
             << "Instead found "
diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h
index ec5886dbd..c057754a3 100644
--- a/Source/cmListFileCache.h
+++ b/Source/cmListFileCache.h
@@ -22,7 +22,7 @@
  */
 
 class cmMakefile;
- 
+
 struct cmListFileArgument
 {
   cmListFileArgument(): Value(), Quoted(false), FilePath(0), Line(0) {}
@@ -64,11 +64,11 @@ class cmListFileBacktrace: public std::vector<cmListFileContext> {};
 
 struct cmListFile
 {
-  cmListFile() 
-    :ModifiedTime(0) 
+  cmListFile()
+    :ModifiedTime(0)
     {
     }
-  bool ParseFile(const char* path, 
+  bool ParseFile(const char* path,
                  bool topLevel,
                  cmMakefile *mf);
 
diff --git a/Source/cmListFileLexer.c b/Source/cmListFileLexer.c
index df5dc2b65..b6424d60e 100644
--- a/Source/cmListFileLexer.c
+++ b/Source/cmListFileLexer.c
@@ -43,7 +43,7 @@ typedef uint32_t flex_uint32_t;
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
 typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t; 
+typedef unsigned char flex_uint8_t;
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
 #endif /* ! C99 */
@@ -165,7 +165,7 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
 
     /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
      *       access to the local variable yy_act. Since yyless() is a macro, it would break
-     *       existing scanners that call yyless() from OUTSIDE cmListFileLexer_yylex. 
+     *       existing scanners that call yyless() from OUTSIDE cmListFileLexer_yylex.
      *       One obvious solution it to make yy_act a global. I tried that, and saw
      *       a 5% performance hit in a non-yylineno scanner, because yy_act is
      *       normally declared as a register variable-- so it is not worth it.
@@ -177,7 +177,7 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
                     if ( yytext[yyl] == '\n' )\
                         --yylineno;\
             }while(0)
-    
+
 /* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
         do \
@@ -242,7 +242,7 @@ struct yy_buffer_state
 
     int yy_bs_lineno; /**< The line count. */
     int yy_bs_column; /**< The column count. */
-    
+
         /* Whether to try to fill the input buffer when we reach the
          * end of it.
          */
@@ -834,7 +834,7 @@ yy_find_action:
                         int yyl;
                         for ( yyl = 0; yyl < yyleng; ++yyl )
                                 if ( yytext[yyl] == '\n' )
-                                           
+
     do{ yylineno++;
         yycolumn=0;
     }while(0)
@@ -1380,7 +1380,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
         yyg->yy_hold_char = *++yyg->yy_c_buf_p;
 
         if ( c == '\n' )
-                   
+
     do{ yylineno++;
         yycolumn=0;
     }while(0)
@@ -1463,7 +1463,7 @@ static void cmListFileLexer_yy_load_buffer_state  (yyscan_t yyscanner)
     YY_BUFFER_STATE cmListFileLexer_yy_create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
 {
         YY_BUFFER_STATE b;
-    
+
         b = (YY_BUFFER_STATE) cmListFileLexer_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
         if ( ! b )
                 YY_FATAL_ERROR( "out of dynamic memory in cmListFileLexer_yy_create_buffer()" );
@@ -1529,7 +1529,7 @@ static void cmListFileLexer_yy_load_buffer_state  (yyscan_t yyscanner)
     }
 
         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-    
+
         errno = oerrno;
 }
 
@@ -1633,9 +1633,9 @@ static void cmListFileLexer_yyensure_buffer_stack (yyscan_t yyscanner)
                 yyg->yy_buffer_stack = (struct yy_buffer_state**)cmListFileLexer_yyalloc
                                                                 (num_to_alloc * sizeof(struct yy_buffer_state*)
                                                                 , yyscanner);
-                
+
                 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-                                
+
                 yyg->yy_buffer_stack_max = num_to_alloc;
                 yyg->yy_buffer_stack_top = 0;
                 return;
@@ -1662,12 +1662,12 @@ static void cmListFileLexer_yyensure_buffer_stack (yyscan_t yyscanner)
  * @param base the character buffer
  * @param size the size in bytes of the character buffer
  * @param yyscanner The scanner object.
- * @return the newly allocated buffer state object. 
+ * @return the newly allocated buffer state object.
  */
 YY_BUFFER_STATE cmListFileLexer_yy_scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
 {
         YY_BUFFER_STATE b;
-    
+
         if ( size < 2 ||
              base[size-2] != YY_END_OF_BUFFER_CHAR ||
              base[size-1] != YY_END_OF_BUFFER_CHAR )
@@ -1703,7 +1703,7 @@ YY_BUFFER_STATE cmListFileLexer_yy_scan_buffer  (char * base, yy_size_t  size ,
  */
 YY_BUFFER_STATE cmListFileLexer_yy_scan_string (yyconst char * yy_str , yyscan_t yyscanner)
 {
-    
+
         return cmListFileLexer_yy_scan_bytes(yy_str,strlen(yy_str) ,yyscanner);
 }
 
@@ -1720,7 +1720,7 @@ YY_BUFFER_STATE cmListFileLexer_yy_scan_bytes  (yyconst char * bytes, int  len ,
         char *buf;
         yy_size_t n;
         int i;
-    
+
         /* Get memory for full buffer, including space for trailing EOB's. */
         n = len + 2;
         buf = (char *) cmListFileLexer_yyalloc(n ,yyscanner );
@@ -1789,10 +1789,10 @@ YY_EXTRA_TYPE cmListFileLexer_yyget_extra  (yyscan_t yyscanner)
 int cmListFileLexer_yyget_lineno  (yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    
+
         if (! YY_CURRENT_BUFFER)
             return 0;
-    
+
     return yylineno;
 }
 
@@ -1802,10 +1802,10 @@ int cmListFileLexer_yyget_lineno  (yyscan_t yyscanner)
 int cmListFileLexer_yyget_column  (yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    
+
         if (! YY_CURRENT_BUFFER)
             return 0;
-    
+
     return yycolumn;
 }
 
@@ -1866,8 +1866,8 @@ void cmListFileLexer_yyset_lineno (int  line_number , yyscan_t yyscanner)
 
         /* lineno is only valid if an input buffer exists. */
         if (! YY_CURRENT_BUFFER )
-           yy_fatal_error( "cmListFileLexer_yyset_lineno called with no buffer" , yyscanner); 
-    
+           yy_fatal_error( "cmListFileLexer_yyset_lineno called with no buffer" , yyscanner);
+
     yylineno = line_number;
 }
 
@@ -1881,8 +1881,8 @@ void cmListFileLexer_yyset_column (int  column_no , yyscan_t yyscanner)
 
         /* column is only valid if an input buffer exists. */
         if (! YY_CURRENT_BUFFER )
-           yy_fatal_error( "cmListFileLexer_yyset_column called with no buffer" , yyscanner); 
-    
+           yy_fatal_error( "cmListFileLexer_yyset_column called with no buffer" , yyscanner);
+
     yycolumn = column_no;
 }
 
diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx
index a239e55bf..462e086ef 100644
--- a/Source/cmLoadCacheCommand.cxx
+++ b/Source/cmLoadCacheCommand.cxx
@@ -26,7 +26,7 @@ bool cmLoadCacheCommand
     {
     return this->ReadWithPrefix(args);
     }
-  
+
   // Cache entries to be excluded from the import list.
   // If this set is empty, all cache entries are brought in
   // and they can not be overridden.
@@ -97,7 +97,7 @@ bool cmLoadCacheCommand::ReadWithPrefix(std::vector<std::string> const& args)
     this->SetError("READ_WITH_PREFIX form must specify a prefix.");
     return false;
     }
-  
+
   // Make sure the cache file exists.
   std::string cacheFile = args[0]+"/CMakeCache.txt";
   if(!cmSystemTools::FileExists(cacheFile.c_str()))
@@ -106,22 +106,22 @@ bool cmLoadCacheCommand::ReadWithPrefix(std::vector<std::string> const& args)
     this->SetError(e.c_str());
     return false;
     }
-  
+
   // Prepare the table of variables to read.
   this->Prefix = args[2];
   for(unsigned int i=3; i < args.size(); ++i)
     {
     this->VariablesToRead.insert(args[i]);
     }
-  
+
   // Read the cache file.
-  std::ifstream fin(cacheFile.c_str());  
-  
+  std::ifstream fin(cacheFile.c_str());
+
   // This is a big hack read loop to overcome a buggy ifstream
   // implementation on HP-UX.  This should work on all platforms even
   // for small buffer sizes.
   const int bufferSize = 4096;
-  char buffer[bufferSize];  
+  char buffer[bufferSize];
   std::string line;
   while(fin)
     {
@@ -152,7 +152,7 @@ bool cmLoadCacheCommand::ReadWithPrefix(std::vector<std::string> const& args)
           // Completed a line.
           this->CheckLine(line.c_str());
           line = "";
-          
+
           // Skip the newline character.
           ++i;
           }
@@ -164,7 +164,7 @@ bool cmLoadCacheCommand::ReadWithPrefix(std::vector<std::string> const& args)
     // Partial last line.
     this->CheckLine(line.c_str());
     }
-  
+
   return true;
 }
 
diff --git a/Source/cmLoadCacheCommand.h b/Source/cmLoadCacheCommand.h
index ac50f8d39..f55cbb3c1 100644
--- a/Source/cmLoadCacheCommand.h
+++ b/Source/cmLoadCacheCommand.h
@@ -25,7 +25,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmLoadCacheCommand;
     }
@@ -49,7 +49,7 @@ public:
     {
     return "Load in the values from another project's CMake cache.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -74,13 +74,13 @@ public:
       "of this form of the command is strongly discouraged, but it is "
       "provided for backward compatibility.";
     }
-  
+
   cmTypeMacro(cmLoadCacheCommand, cmCommand);
 protected:
-  
+
   std::set<cmStdString> VariablesToRead;
   std::string Prefix;
-  
+
   bool ReadWithPrefix(std::vector<std::string> const& args);
   void CheckLine(const char* line);
 };
diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx
index 3a0115c96..b2acf06ad 100644
--- a/Source/cmLoadCommandCommand.cxx
+++ b/Source/cmLoadCommandCommand.cxx
@@ -25,23 +25,23 @@
 #include <signal.h>
 extern "C" void TrapsForSignalsCFunction(int sig);
 
-  
+
 // a class for loadabple commands
 class cmLoadedCommand : public cmCommand
 {
 public:
   cmLoadedCommand() {
-    memset(&this->info,0,sizeof(this->info)); 
+    memset(&this->info,0,sizeof(this->info));
     this->info.CAPI = &cmStaticCAPI;
   }
-  
+
   ///! clean up any memory allocated by the plugin
   ~cmLoadedCommand();
-    
+
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
       cmLoadedCommand *newC = new cmLoadedCommand;
       // we must copy when we clone
@@ -53,7 +53,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string> const& args, 
+  virtual bool InitialPass(std::vector<std::string> const& args,
                            cmExecutionStatus &);
 
   /**
@@ -70,7 +70,7 @@ public:
    * The name of the command as specified in CMakeList.txt.
    */
   virtual const char* GetName() const { return info.Name; }
-  
+
   /**
    * Succinct documentation.
    */
@@ -79,7 +79,7 @@ public:
       if (this->info.GetTerseDocumentation)
         {
         cmLoadedCommand::InstallSignalHandlers(info.Name);
-        const char* ret = info.GetTerseDocumentation(); 
+        const char* ret = info.GetTerseDocumentation();
         cmLoadedCommand::InstallSignalHandlers(info.Name, 1);
         return ret;
         }
@@ -101,7 +101,7 @@ public:
         {
         cmLoadedCommand::LastName = "????";
         }
-      
+
       if(!remove)
         {
         signal(SIGSEGV, TrapsForSignalsCFunction);
@@ -119,7 +119,7 @@ public:
         signal(SIGILL,  0);
         }
     }
-  
+
   /**
    * More documentation.
    */
@@ -137,7 +137,7 @@ public:
         return "LoadedCommand without any additional documentation";
         }
     }
-  
+
   cmTypeMacro(cmLoadedCommand, cmCommand);
 
   cmLoadedCommandInfo info;
@@ -164,7 +164,7 @@ bool cmLoadedCommand::InitialPass(std::vector<std::string> const& args,
     {
     free(this->info.Error);
     }
-  
+
   // create argc and argv and then invoke the command
   int argc = static_cast<int> (args.size());
   char **argv = 0;
@@ -179,10 +179,10 @@ bool cmLoadedCommand::InitialPass(std::vector<std::string> const& args,
     }
   cmLoadedCommand::InstallSignalHandlers(info.Name);
   int result = info.InitialPass((void *)&info,
-                                (void *)this->Makefile,argc,argv); 
+                                (void *)this->Makefile,argc,argv);
   cmLoadedCommand::InstallSignalHandlers(info.Name, 1);
   cmFreeArguments(argc,argv);
-  
+
   if (result)
     {
     return true;
@@ -249,7 +249,7 @@ bool cmLoadCommandCommand
     // expand variables
     std::string exp = args[j];
     cmSystemTools::ExpandRegistryValues(exp);
-    
+
     // Glob the entry in case of wildcards.
     cmSystemTools::GlobDirs(exp.c_str(), path);
     }
@@ -298,7 +298,7 @@ bool cmLoadCommandCommand
     initFunction = (CM_INIT_FUNCTION)(
       cmsys::DynamicLoader::GetSymbolAddress(lib, initFuncName.c_str()));
     }
-  // if the symbol is found call it to set the name on the 
+  // if the symbol is found call it to set the name on the
   // function blocker
   if(initFunction)
     {
diff --git a/Source/cmLoadCommandCommand.h b/Source/cmLoadCommandCommand.h
index 651701948..f0b34ee59 100644
--- a/Source/cmLoadCommandCommand.h
+++ b/Source/cmLoadCommandCommand.h
@@ -25,7 +25,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmLoadCommandCommand;
     }
@@ -41,7 +41,7 @@ public:
    * The name of the command as specified in CMakeList.txt.
    */
   virtual const char* GetName() const {return "load_command";}
-  
+
   /**
    * Succinct documentation.
    */
@@ -49,7 +49,7 @@ public:
     {
     return "Load a command into a running CMake.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -66,7 +66,7 @@ public:
       "will be set to the full path of the module that was loaded.  "
       "Otherwise the variable will not be set.";
     }
-  
+
   cmTypeMacro(cmLoadCommandCommand, cmCommand);
 };
 
diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx
index ace7adfa1..c3789a022 100644
--- a/Source/cmLocalVisualStudio10Generator.cxx
+++ b/Source/cmLocalVisualStudio10Generator.cxx
@@ -21,9 +21,9 @@ class cmVS10XMLParser : public cmXMLParser
   public:
   virtual void EndElement(const char* /* name */)
     {
-    } 
+    }
   virtual void CharacterDataHandler(const char* data, int length)
-    { 
+    {
       if(this->DoGUID )
         {
         this->GUID.assign(data+1, length-2);
@@ -40,7 +40,7 @@ class cmVS10XMLParser : public cmXMLParser
       if(strcmp("ProjectGUID", name) == 0 || strcmp("ProjectGuid", name) == 0)
         {
         this->DoGUID = true;
-        } 
+        }
     }
   int InitializeParser()
     {
@@ -50,7 +50,7 @@ class cmVS10XMLParser : public cmXMLParser
         {
         return ret;
         }
-      // visual studio projects have a strange encoding, but it is 
+      // visual studio projects have a strange encoding, but it is
       // really utf-8
       XML_SetEncoding(static_cast<XML_Parser>(this->Parser), "utf-8");
       return 1;
@@ -72,7 +72,7 @@ cmLocalVisualStudio10Generator::~cmLocalVisualStudio10Generator()
 
 void cmLocalVisualStudio10Generator::Generate()
 {
-  
+
   cmTargets &tgts = this->Makefile->GetTargets();
   for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l)
     {
@@ -98,7 +98,7 @@ void cmLocalVisualStudio10Generator
                            const char* path)
 {
   cmVS10XMLParser parser;
-  parser.ParseFile(path); 
+  parser.ParseFile(path);
 
   // if we can not find a GUID then create one
   if(parser.GUID.empty())
diff --git a/Source/cmLocalVisualStudio10Generator.h b/Source/cmLocalVisualStudio10Generator.h
index 699de4c00..41db735b2 100644
--- a/Source/cmLocalVisualStudio10Generator.h
+++ b/Source/cmLocalVisualStudio10Generator.h
@@ -31,7 +31,7 @@ public:
 
 
   /**
-   * Generate the makefile for this directory. 
+   * Generate the makefile for this directory.
    */
   virtual void Generate();
   virtual void ReadAndStoreExternalGUID(const char* name,
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 5ab223b7e..1a7e611aa 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -108,7 +108,7 @@ void cmLocalVisualStudio6Generator::Generate()
 }
 
 void cmLocalVisualStudio6Generator::OutputDSPFile()
-{ 
+{
   // If not an in source build, then create the output directory
   if(strcmp(this->Makefile->GetStartOutputDirectory(),
             this->Makefile->GetHomeDirectory()) != 0)
@@ -126,7 +126,7 @@ void cmLocalVisualStudio6Generator::OutputDSPFile()
   cmTargets &tgts = this->Makefile->GetTargets();
 
   // build any targets
-  for(cmTargets::iterator l = tgts.begin(); 
+  for(cmTargets::iterator l = tgts.begin();
       l != tgts.end(); l++)
     {
     switch(l->second.GetType())
@@ -152,7 +152,7 @@ void cmLocalVisualStudio6Generator::OutputDSPFile()
       }
     // INCLUDE_EXTERNAL_MSPROJECT command only affects the workspace
     // so don't build a projectfile for it
-    const char* path = 
+    const char* path =
       l->second.GetProperty("EXTERNAL_MSPROJECT");
     if(!path)
       {
@@ -178,7 +178,7 @@ void cmLocalVisualStudio6Generator::OutputDSPFile()
 //
 extern std::string GetVS6TargetName(const std::string& targetName);
 
-void cmLocalVisualStudio6Generator::CreateSingleDSP(const char *lname, 
+void cmLocalVisualStudio6Generator::CreateSingleDSP(const char *lname,
                                                     cmTarget &target)
 {
   // add to the list of projects
@@ -210,7 +210,7 @@ void cmLocalVisualStudio6Generator::AddDSPBuildRule(cmTarget& tgt)
 {
   std::string dspname = GetVS6TargetName(tgt.GetName());
   dspname += ".dsp.cmake";
-  const char* dsprule = 
+  const char* dsprule =
     this->Makefile->GetRequiredDefinition("CMAKE_COMMAND");
   cmCustomCommandLine commandLine;
   commandLine.push_back(dsprule);
@@ -229,8 +229,8 @@ void cmLocalVisualStudio6Generator::AddDSPBuildRule(cmTarget& tgt)
                         START_OUTPUT, UNCHANGED, true);
   commandLine.push_back(args);
   args = "-B";
-  args += 
-    this->Convert(this->Makefile->GetHomeOutputDirectory(), 
+  args +=
+    this->Convert(this->Makefile->GetHomeOutputDirectory(),
                   START_OUTPUT, UNCHANGED, true);
   commandLine.push_back(args);
 
@@ -254,7 +254,7 @@ void cmLocalVisualStudio6Generator::AddDSPBuildRule(cmTarget& tgt)
 }
 
 
-void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout, 
+void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout,
                                                  const char *libName,
                                                  cmTarget &target)
 {
@@ -301,21 +301,21 @@ void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout,
       this->AddUtilityCommandHack(target, count++, depends, *cr);
       }
     }
-  
+
   // We may be modifying the source groups temporarily, so make a copy.
   std::vector<cmSourceGroup> sourceGroups = this->Makefile->GetSourceGroups();
-  
+
   // get the classes from the source lists then add them to the groups
   std::vector<cmSourceFile*> const & classes = target.GetSourceFiles();
 
   // now all of the source files have been properly assigned to the target
   // now stick them into source groups using the reg expressions
-  for(std::vector<cmSourceFile*>::const_iterator i = classes.begin(); 
+  for(std::vector<cmSourceFile*>::const_iterator i = classes.begin();
       i != classes.end(); i++)
     {
     // Add the file to the list of sources.
     std::string source = (*i)->GetFullPath();
-    cmSourceGroup& sourceGroup = 
+    cmSourceGroup& sourceGroup =
       this->Makefile->FindSourceGroup(source.c_str(), sourceGroups);
     sourceGroup.AssignSource(*i);
     // while we are at it, if it is a .rule file then for visual studio 6 we
@@ -326,11 +326,11 @@ void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout,
         {
         cmSystemTools::ReplaceString(source, "$(IntDir)/", "");
 #if defined(_WIN32) || defined(__CYGWIN__)
-        std::ofstream fout(source.c_str(), 
-                           std::ios::binary | std::ios::out 
+        std::ofstream fout(source.c_str(),
+                           std::ios::binary | std::ios::out
                            | std::ios::trunc);
 #else
-        std::ofstream fout(source.c_str(), 
+        std::ofstream fout(source.c_str(),
                            std::ios::out | std::ios::trunc);
 #endif
         if(fout)
@@ -345,14 +345,14 @@ void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout,
 
   // Write the DSP file's header.
   this->WriteDSPHeader(fout, libName, target, sourceGroups);
-  
+
 
   // Loop through every source group.
   for(std::vector<cmSourceGroup>::const_iterator sg = sourceGroups.begin();
       sg != sourceGroups.end(); ++sg)
     {
     this->WriteGroup(&(*sg), target, fout, libName);
-    }  
+    }
 
   // Write the DSP file's footer.
   this->WriteDSPFooter(fout);
@@ -364,15 +364,15 @@ void cmLocalVisualStudio6Generator
 {
   cmGeneratorTarget* gt =
     this->GlobalGenerator->GetGeneratorTarget(&target);
-  const std::vector<const cmSourceFile *> &sourceFiles = 
+  const std::vector<const cmSourceFile *> &sourceFiles =
     sg->GetSourceFiles();
   // If the group is empty, don't write it at all.
-        
+
   if(sourceFiles.empty() && sg->GetGroupChildren().empty())
-    { 
-    return; 
+    {
+    return;
     }
-    
+
   // If the group has a name, write the header.
   std::string name = sg->GetName();
   if(name != "")
@@ -385,7 +385,7 @@ void cmLocalVisualStudio6Generator
         sourceFiles.begin(); sf != sourceFiles.end(); ++sf)
     {
     std::string source = (*sf)->GetFullPath();
-    const cmCustomCommand *command = 
+    const cmCustomCommand *command =
       (*sf)->GetCustomCommand();
     std::string compileFlags;
     std::vector<std::string> depends;
@@ -441,7 +441,7 @@ void cmLocalVisualStudio6Generator
 
     bool excludedFromBuild =
       (lang && (*sf)->GetPropertyAsBool("HEADER_FILE_ONLY"));
-      
+
     // Check for extra object-file dependencies.
     const char* dependsValue = (*sf)->GetProperty("OBJECT_DEPENDS");
     if(dependsValue)
@@ -453,10 +453,10 @@ void cmLocalVisualStudio6Generator
       target.GetType() == cmTarget::GLOBAL_TARGET)
       {
       fout << "# Begin Source File\n\n";
-        
+
       // Tell MS-Dev what the source is.  If the compiler knows how to
       // build it, then it will.
-      fout << "SOURCE=" << 
+      fout << "SOURCE=" <<
         this->ConvertToOptionallyRelativeOutputPath(source.c_str()) << "\n\n";
       if(!depends.empty())
         {
@@ -464,8 +464,8 @@ void cmLocalVisualStudio6Generator
         fout << "USERDEP__HACK=";
         for(std::vector<std::string>::const_iterator d = depends.begin();
             d != depends.end(); ++d)
-          { 
-          fout << "\\\n\t" << 
+          {
+          fout << "\\\n\t" <<
             this->ConvertToOptionallyRelativeOutputPath(d->c_str());
           }
         fout << "\n";
@@ -479,16 +479,16 @@ void cmLocalVisualStudio6Generator
               excludedFromBuild || !cdmap.empty())
         {
         for(std::vector<std::string>::iterator i
-              = this->Configurations.begin(); 
+              = this->Configurations.begin();
             i != this->Configurations.end(); ++i)
-          { 
+          {
           // Strip the subdirectory name out of the configuration name.
           std::string config = this->GetConfigName(*i);
           if (i == this->Configurations.begin())
             {
             fout << "!IF  \"$(CFG)\" == " << i->c_str() << std::endl;
             }
-          else 
+          else
             {
             fout << "!ELSEIF  \"$(CFG)\" == " << i->c_str() << std::endl;
             }
@@ -512,7 +512,7 @@ void cmLocalVisualStudio6Generator
             fout << "\n# PROP Intermediate_Dir \""
                  << config << "/" << objectNameDir << "\"\n\n";
             }
-          } 
+          }
         fout << "!ENDIF\n\n";
         }
       fout << "# End Source File\n";
@@ -528,7 +528,7 @@ void cmLocalVisualStudio6Generator
 
 
 
-    
+
   // If the group has a name, write the footer.
   if(name != "")
     {
@@ -586,7 +586,7 @@ cmLocalVisualStudio6Generator
     {
     comment = "";
     }
-  
+
   // Write the rule for each configuration.
   std::vector<std::string>::iterator i;
   for(i = this->Configurations.begin(); i != this->Configurations.end(); ++i)
@@ -594,12 +594,12 @@ cmLocalVisualStudio6Generator
     std::string config = this->GetConfigName(*i);
     std::string script =
       this->ConstructScript(command, config.c_str(), "\\\n\t");
-      
+
     if (i == this->Configurations.begin())
       {
       fout << "!IF  \"$(CFG)\" == " << i->c_str() << std::endl;
       }
-    else 
+    else
       {
       fout << "!ELSEIF  \"$(CFG)\" == " << i->c_str() << std::endl;
       }
@@ -609,9 +609,9 @@ cmLocalVisualStudio6Generator
       }
     // Write out the dependencies for the rule.
     fout << "USERDEP__HACK=";
-    for(std::vector<std::string>::const_iterator d = 
+    for(std::vector<std::string>::const_iterator d =
           command.GetDepends().begin();
-        d != command.GetDepends().end(); 
+        d != command.GetDepends().end();
         ++d)
       {
       // Lookup the real name of the dependency in case it is a CMake target.
@@ -633,15 +633,15 @@ cmLocalVisualStudio6Generator
     fout << "\n\n";
     if(command.GetOutputs().empty())
       {
-      fout << source 
+      fout << source
            << "_force :  \"$(SOURCE)\" \"$(INTDIR)\" \"$(OUTDIR)\"\n\t";
       fout << script.c_str() << "\n\n";
       }
     else
       {
-      for(std::vector<std::string>::const_iterator o = 
+      for(std::vector<std::string>::const_iterator o =
           command.GetOutputs().begin();
-          o != command.GetOutputs().end(); 
+          o != command.GetOutputs().end();
           ++o)
         {
         // Write a rule for every output generated by this command.
@@ -652,12 +652,12 @@ cmLocalVisualStudio6Generator
       }
     fout << "# End Custom Build\n\n";
     }
-  
+
   fout << "!ENDIF\n\n";
 }
 
 
-void cmLocalVisualStudio6Generator::WriteDSPBeginGroup(std::ostream& fout, 
+void cmLocalVisualStudio6Generator::WriteDSPBeginGroup(std::ostream& fout,
                                                        const char* group,
                                                        const char* filter)
 {
@@ -679,7 +679,7 @@ void cmLocalVisualStudio6Generator::SetBuildType(BuildType b,
                                                  cmTarget& target)
 {
   std::string root= this->Makefile->GetRequiredDefinition("CMAKE_ROOT");
-  const char *def= 
+  const char *def=
     this->Makefile->GetDefinition( "MSPROJECT_TEMPLATE_DIRECTORY");
 
   if( def)
@@ -690,7 +690,7 @@ void cmLocalVisualStudio6Generator::SetBuildType(BuildType b,
     {
     root += "/Templates";
     }
-  
+
   switch(b)
     {
     case STATIC_LIBRARY:
@@ -740,7 +740,7 @@ void cmLocalVisualStudio6Generator::SetBuildType(BuildType b,
     }
 
   // reset this->Configurations
-  this->Configurations.erase(this->Configurations.begin(), 
+  this->Configurations.erase(this->Configurations.begin(),
                              this->Configurations.end());
 
   // now add all the configurations possible
@@ -785,9 +785,9 @@ cmLocalVisualStudio6Generator::MaybeCreateOutputDir(cmTarget& target,
 }
 
 // look for custom rules on a target and collect them together
-std::string 
-cmLocalVisualStudio6Generator::CreateTargetRules(cmTarget &target, 
-                                                 const char* configName, 
+std::string
+cmLocalVisualStudio6Generator::CreateTargetRules(cmTarget &target,
+                                                 const char* configName,
                                                  const char * /* libName */)
 {
   if (target.GetType() >= cmTarget::UTILITY )
@@ -895,8 +895,8 @@ cmLocalVisualStudio6Generator::GetTargetIncludeOptions(cmTarget &target)
 #define CM_USE_OLD_VS6
 
 void cmLocalVisualStudio6Generator
-::WriteDSPHeader(std::ostream& fout, 
-                 const char *libName, cmTarget &target, 
+::WriteDSPHeader(std::ostream& fout,
+                 const char *libName, cmTarget &target,
                  std::vector<cmSourceGroup> &)
 {
   bool targetBuilds = (target.GetType() >= cmTarget::EXECUTABLE &&
@@ -931,7 +931,7 @@ void cmLocalVisualStudio6Generator
     }
 
   std::set<std::string> pathEmitted;
-  
+
   // determine the link directories
   std::string libOptions;
   std::string libDebugOptions;
@@ -944,14 +944,14 @@ void cmLocalVisualStudio6Generator
 
   if(libPath.size())
     {
-    std::string lpath = 
+    std::string lpath =
       this->ConvertToOptionallyRelativeOutputPath(libPath.c_str());
     if(lpath.size() == 0)
       {
       lpath = ".";
       }
     std::string lpathIntDir = libPath + "$(INTDIR)";
-    lpathIntDir =  
+    lpathIntDir =
       this->ConvertToOptionallyRelativeOutputPath(lpathIntDir.c_str());
     if(pathEmitted.insert(lpath).second)
       {
@@ -977,7 +977,7 @@ void cmLocalVisualStudio6Generator
     }
   if(exePath.size())
     {
-    std::string lpath = 
+    std::string lpath =
       this->ConvertToOptionallyRelativeOutputPath(exePath.c_str());
     if(lpath.size() == 0)
       {
@@ -986,7 +986,7 @@ void cmLocalVisualStudio6Generator
     std::string lpathIntDir = exePath + "$(INTDIR)";
     lpathIntDir =
       this->ConvertToOptionallyRelativeOutputPath(lpathIntDir.c_str());
-    
+
     if(pathEmitted.insert(lpath).second)
       {
       libOptions += " /LIBPATH:";
@@ -1018,7 +1018,7 @@ void cmLocalVisualStudio6Generator
       {
       path += "/";
       }
-    std::string lpath = 
+    std::string lpath =
       this->ConvertToOptionallyRelativeOutputPath(path.c_str());
     if(lpath.size() == 0)
       {
@@ -1035,7 +1035,7 @@ void cmLocalVisualStudio6Generator
       libOptions += " /LIBPATH:";
       libOptions += lpath;
       libOptions += " ";
-      
+
       libMultiLineOptions += "# ADD LINK32 /LIBPATH:";
       libMultiLineOptions += lpathIntDir;
       libMultiLineOptions += " ";
@@ -1059,8 +1059,8 @@ void cmLocalVisualStudio6Generator
     // a library in a library, bad recursion)
     // NEVER LINK STATIC LIBRARIES TO OTHER STATIC LIBRARIES
     if ((target.GetType() != cmTarget::SHARED_LIBRARY
-         && target.GetType() != cmTarget::STATIC_LIBRARY 
-         && target.GetType() != cmTarget::MODULE_LIBRARY) || 
+         && target.GetType() != cmTarget::STATIC_LIBRARY
+         && target.GetType() != cmTarget::MODULE_LIBRARY) ||
         (target.GetType()==cmTarget::SHARED_LIBRARY
          && libName != GetVS6TargetName(j->first)) ||
         (target.GetType()==cmTarget::MODULE_LIBRARY
@@ -1090,7 +1090,7 @@ void cmLocalVisualStudio6Generator
           }
         }
       lib = this->ConvertToOptionallyRelativeOutputPath(lib.c_str());
-      libDebug = 
+      libDebug =
         this->ConvertToOptionallyRelativeOutputPath(libDebug.c_str());
 
       if (j->second == cmTarget::GENERAL)
@@ -1121,7 +1121,7 @@ void cmLocalVisualStudio6Generator
         libMultiLineOptimizedOptions += "# ADD LINK32 ";
         libMultiLineOptimizedOptions += lib;
         libMultiLineOptimizedOptions += "\n";
-        }      
+        }
       }
     }
 #endif
@@ -1137,17 +1137,17 @@ void cmLocalVisualStudio6Generator
   std::string extraLinkOptionsRelWithDebInfo;
   if(target.GetType() == cmTarget::EXECUTABLE)
     {
-    extraLinkOptions = 
+    extraLinkOptions =
       this->Makefile->GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS");
     }
   if(target.GetType() == cmTarget::SHARED_LIBRARY)
     {
-    extraLinkOptions = 
+    extraLinkOptions =
       this->Makefile->GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS");
     }
   if(target.GetType() == cmTarget::MODULE_LIBRARY)
     {
-    extraLinkOptions = 
+    extraLinkOptions =
       this->Makefile->GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS");
     }
 
@@ -1229,7 +1229,7 @@ void cmLocalVisualStudio6Generator
     }
 
   // Compute the real name of the target.
-  std::string outputName = 
+  std::string outputName =
     "(OUTPUT_NAME is for libraries and executables only)";
   std::string outputNameDebug = outputName;
   std::string outputNameRelease = outputName;
@@ -1380,13 +1380,13 @@ void cmLocalVisualStudio6Generator
 
   // are there any custom rules on the target itself
   // only if the target is a lib or exe
-  std::string customRuleCodeRelease        
+  std::string customRuleCodeRelease
       = this->CreateTargetRules(target, "RELEASE",        libName);
-  std::string customRuleCodeDebug          
+  std::string customRuleCodeDebug
       = this->CreateTargetRules(target, "DEBUG",          libName);
-  std::string customRuleCodeMinSizeRel     
+  std::string customRuleCodeMinSizeRel
       = this->CreateTargetRules(target, "MINSIZEREL",     libName);
-  std::string customRuleCodeRelWithDebInfo 
+  std::string customRuleCodeRelWithDebInfo
       = this->CreateTargetRules(target, "RELWITHDEBINFO", libName);
 
   std::ifstream fin(this->DSPHeaderTemplate.c_str());
@@ -1400,7 +1400,7 @@ void cmLocalVisualStudio6Generator
   std::string staticLibOptionsMinSizeRel;
   std::string staticLibOptionsRelWithDebInfo;
   if(target.GetType() == cmTarget::STATIC_LIBRARY )
-    { 
+    {
     if(const char* libflags = target.GetProperty("STATIC_LIBRARY_FLAGS"))
       {
       staticLibOptions = libflags;
@@ -1484,7 +1484,7 @@ void cmLocalVisualStudio6Generator
                                    staticLibOptionsRelWithDebInfo.c_str());
       cmSystemTools::ReplaceString(line, "CM_STATIC_LIB_ARGS",
                                    staticLibOptions.c_str());
-      } 
+      }
     if(this->Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE"))
       {
       cmSystemTools::ReplaceString(line, "/nologo", "");
@@ -1506,8 +1506,8 @@ void cmLocalVisualStudio6Generator
     cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIMIZED_LIBRARIES",
                                  libMultiLineOptimizedOptions.c_str());
 #endif
-    
-    // Substitute the rules for custom command. When specifying just the 
+
+    // Substitute the rules for custom command. When specifying just the
     // target name for the command the command can be different for
     // different configs
     cmSystemTools::ReplaceString(line, "CMAKE_CUSTOM_RULE_CODE_RELEASE",
@@ -1520,24 +1520,24 @@ void cmLocalVisualStudio6Generator
                                  customRuleCodeRelWithDebInfo.c_str());
 
     // Substitute the real output name into the template.
-    cmSystemTools::ReplaceString(line, "OUTPUT_NAME_DEBUG", 
+    cmSystemTools::ReplaceString(line, "OUTPUT_NAME_DEBUG",
                                  outputNameDebug.c_str());
-    cmSystemTools::ReplaceString(line, "OUTPUT_NAME_RELEASE", 
+    cmSystemTools::ReplaceString(line, "OUTPUT_NAME_RELEASE",
                                  outputNameRelease.c_str());
     cmSystemTools::ReplaceString(line, "OUTPUT_NAME_MINSIZEREL",
                                  outputNameMinSizeRel.c_str());
-    cmSystemTools::ReplaceString(line, "OUTPUT_NAME_RELWITHDEBINFO", 
+    cmSystemTools::ReplaceString(line, "OUTPUT_NAME_RELWITHDEBINFO",
                                  outputNameRelWithDebInfo.c_str());
     cmSystemTools::ReplaceString(line, "OUTPUT_NAME", outputName.c_str());
 
     // Substitute the proper link information into the template.
-    cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_DEBUG", 
+    cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_DEBUG",
                                  optionsDebug.c_str());
-    cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_RELEASE", 
+    cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_RELEASE",
                                  optionsRelease.c_str());
     cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_MINSIZEREL",
                                  optionsMinSizeRel.c_str());
-    cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_RELWITHDEBINFO", 
+    cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_RELWITHDEBINFO",
                                  optionsRelWithDebInfo.c_str());
 
     cmSystemTools::ReplaceString(line, "BUILD_INCLUDES",
@@ -1588,12 +1588,12 @@ void cmLocalVisualStudio6Generator
         }
       }
 
-    cmSystemTools::ReplaceString(line, 
-                                 "EXTRA_DEFINES", 
+    cmSystemTools::ReplaceString(line,
+                                 "EXTRA_DEFINES",
                                  this->Makefile->GetDefineFlags());
     const char* debugPostfix
       = this->Makefile->GetDefinition("CMAKE_DEBUG_POSTFIX");
-    cmSystemTools::ReplaceString(line, "DEBUG_POSTFIX", 
+    cmSystemTools::ReplaceString(line, "DEBUG_POSTFIX",
                                  debugPostfix?debugPostfix:"");
     // store flags for each configuration
     std::string flags = " ";
@@ -1601,7 +1601,7 @@ void cmLocalVisualStudio6Generator
     std::string flagsMinSize = " ";
     std::string flagsDebug = " ";
     std::string flagsDebugRel = " ";
-    if(target.GetType() >= cmTarget::EXECUTABLE && 
+    if(target.GetType() >= cmTarget::EXECUTABLE &&
        target.GetType() <= cmTarget::OBJECT_LIBRARY)
       {
       const char* linkLanguage = target.GetLinkerLanguage();
@@ -1617,7 +1617,7 @@ void cmLocalVisualStudio6Generator
       baseFlagVar += linkLanguage;
       baseFlagVar += "_FLAGS";
       flags = this->Makefile->GetSafeDefinition(baseFlagVar.c_str());
-      
+
       std::string flagVar = baseFlagVar + "_RELEASE";
       flagsRelease = this->Makefile->GetSafeDefinition(flagVar.c_str());
       flagsRelease += " -DCMAKE_INTDIR=\\\"Release\\\" ";
@@ -1695,28 +1695,28 @@ void cmLocalVisualStudio6Generator
     flagsRelease += releaseDefines;
     flagsMinSize += minsizeDefines;
     flagsDebugRel += debugrelDefines;
- 
+
     // The template files have CXX FLAGS in them, that need to be replaced.
     // There are not separate CXX and C template files, so we use the same
     // variable names.   The previous code sets up flags* variables to contain
     // the correct C or CXX flags
     cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_MINSIZEREL",
                                  flagsMinSize.c_str());
-    cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_DEBUG", 
+    cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_DEBUG",
                                  flagsDebug.c_str());
-    cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_RELWITHDEBINFO", 
+    cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_RELWITHDEBINFO",
                                  flagsDebugRel.c_str());
-    cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_RELEASE", 
+    cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_RELEASE",
                                  flagsRelease.c_str());
     cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS", flags.c_str());
 
     cmSystemTools::ReplaceString(line, "COMPILE_DEFINITIONS_MINSIZEREL",
                                  minsizeDefines.c_str());
-    cmSystemTools::ReplaceString(line, "COMPILE_DEFINITIONS_DEBUG", 
+    cmSystemTools::ReplaceString(line, "COMPILE_DEFINITIONS_DEBUG",
                                  debugDefines.c_str());
-    cmSystemTools::ReplaceString(line, "COMPILE_DEFINITIONS_RELWITHDEBINFO", 
+    cmSystemTools::ReplaceString(line, "COMPILE_DEFINITIONS_RELWITHDEBINFO",
                                  debugrelDefines.c_str());
-    cmSystemTools::ReplaceString(line, "COMPILE_DEFINITIONS_RELEASE", 
+    cmSystemTools::ReplaceString(line, "COMPILE_DEFINITIONS_RELEASE",
                                  releaseDefines.c_str());
     cmSystemTools::ReplaceString(line, "COMPILE_DEFINITIONS", defines.c_str());
 
@@ -1725,7 +1725,7 @@ void cmLocalVisualStudio6Generator
 }
 
 void cmLocalVisualStudio6Generator::WriteDSPFooter(std::ostream& fout)
-{  
+{
   std::ifstream fin(this->DSPFooterTemplate.c_str());
   if(!fin)
     {
diff --git a/Source/cmLocalVisualStudio6Generator.h b/Source/cmLocalVisualStudio6Generator.h
index 1decc3531..9315d9700 100644
--- a/Source/cmLocalVisualStudio6Generator.h
+++ b/Source/cmLocalVisualStudio6Generator.h
@@ -37,7 +37,7 @@ public:
   virtual void AddCMakeListsRules();
 
   /**
-   * Generate the makefile for this directory. 
+   * Generate the makefile for this directory.
    */
   virtual void Generate();
 
@@ -57,9 +57,9 @@ private:
   std::string DSPFooterTemplate;
 
   void CreateSingleDSP(const char *lname, cmTarget &tgt);
-  void WriteDSPFile(std::ostream& fout, const char *libName, 
+  void WriteDSPFile(std::ostream& fout, const char *libName,
                     cmTarget &tgt);
-  void WriteDSPBeginGroup(std::ostream& fout, 
+  void WriteDSPBeginGroup(std::ostream& fout,
                           const char* group,
                           const char* filter);
   void WriteDSPEndGroup(std::ostream& fout);
@@ -82,8 +82,8 @@ private:
   friend class EventWriter;
   cmsys::auto_ptr<cmCustomCommand>
   MaybeCreateOutputDir(cmTarget& target, const char* config);
-  std::string CreateTargetRules(cmTarget &target, 
-                                const char* configName, 
+  std::string CreateTargetRules(cmTarget &target,
+                                const char* configName,
                                 const char *libName);
   void ComputeLinkOptions(cmTarget& target, const char* configName,
                           const std::string extraOptions,
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index f2ab79d7e..2dfca025c 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -291,7 +291,7 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
   comment += makefileIn;
   std::string args;
   args = "-H";
-  args += this->Convert(this->Makefile->GetHomeDirectory(), 
+  args += this->Convert(this->Makefile->GetHomeDirectory(),
                         START_OUTPUT, UNCHANGED, true);
   commandLine.push_back(args);
   args = "-B";
@@ -343,8 +343,8 @@ void cmLocalVisualStudio7Generator::WriteConfigurations(std::ostream& fout,
   fout << "\t</Configurations>\n";
 }
 cmVS7FlagTable cmLocalVisualStudio7GeneratorFortranFlagTable[] =
-{ 
-  {"Preprocess", "fpp", "Run Preprocessor on files", "preprocessYes", 0}, 
+{
+  {"Preprocess", "fpp", "Run Preprocessor on files", "preprocessYes", 0},
   {"SuppressStartupBanner", "nologo", "SuppressStartupBanner", "true", 0},
   {"SourceFileFormat", "fixed", "Use Fixed Format", "fileFormatFixed", 0},
   {"SourceFileFormat", "free", "Use Free Format", "fileFormatFree", 0},
@@ -376,15 +376,15 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFortranFlagTable[] =
   {"OptimizeForProcessor", "QxO", "", "codeExclusivelyCore2StreamingSIMD", 0},
   {"OptimizeForProcessor", "QxS", "", "codeExclusivelyCore2StreamingSIMD4", 0},
 
-  {"ModulePath", "module:", "", "", 
+  {"ModulePath", "module:", "", "",
    cmVS7FlagTable::UserValueRequired},
-  {"LoopUnrolling", "Qunroll:", "", "", 
+  {"LoopUnrolling", "Qunroll:", "", "",
    cmVS7FlagTable::UserValueRequired},
-  {"AutoParallelThreshold", "Qpar-threshold:", "", "", 
+  {"AutoParallelThreshold", "Qpar-threshold:", "", "",
    cmVS7FlagTable::UserValueRequired},
-  {"HeapArrays", "heap-arrays:", "", "", 
+  {"HeapArrays", "heap-arrays:", "", "",
    cmVS7FlagTable::UserValueRequired},
-  {"ObjectText", "bintext:", "", "", 
+  {"ObjectText", "bintext:", "", "",
    cmVS7FlagTable::UserValueRequired},
   {"Parallelization", "Qparallel", "", "true", 0},
   {"PrefetchInsertion", "Qprefetch-", "", "false", 0},
@@ -476,7 +476,7 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFlagTable[] =
   // boolean flags
   {"BufferSecurityCheck", "GS", "Buffer security check", "TRUE", 0},
   {"BufferSecurityCheck", "GS-", "Turn off Buffer security check", "FALSE", 0},
-  {"Detect64BitPortabilityProblems", "Wp64", 
+  {"Detect64BitPortabilityProblems", "Wp64",
    "Detect 64-bit Portability Problems", "TRUE", 0},
   {"EnableFiberSafeOptimizations", "GT", "Enable Fiber-safe Optimizations",
    "TRUE", 0},
@@ -566,7 +566,7 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] =
   {"TurnOffAssemblyGeneration", "NOASSEMBLY",
    "No assembly even if CLR information is present in objects.", "true", 0},
   {"ModuleDefinitionFile", "DEF:", "add an export def file", "",
-   cmVS7FlagTable::UserValue}, 
+   cmVS7FlagTable::UserValue},
   {"GenerateMapFile", "MAP", "enable generation of map file", "TRUE", 0},
   {0,0,0,0,0}
 };
@@ -800,7 +800,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
   if(this->FortranProject)
     {
     const char* target_mod_dir =
-      target.GetProperty("Fortran_MODULE_DIRECTORY"); 
+      target.GetProperty("Fortran_MODULE_DIRECTORY");
     std::string modDir;
     if(target_mod_dir)
       {
@@ -812,7 +812,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
       {
       modDir = ".";
       }
-    fout << "\t\t\t\tModulePath=\"" 
+    fout << "\t\t\t\tModulePath=\""
          << this->ConvertToXMLOutputPath(modDir.c_str())
          << "\\$(ConfigurationName)\"\n";
     }
@@ -826,7 +826,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
     // output the include path
     std::string ipath = this->ConvertToXMLOutputPath(i->c_str());
     fout << ipath << ";";
-    // if this is fortran then output the include with 
+    // if this is fortran then output the include with
     // a ConfigurationName on the end of it.
     if(this->FortranProject)
       {
@@ -918,7 +918,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
       // Add a flag telling the manifest tool to use a workaround
       // for FAT32 file systems, which can cause an empty manifest
       // to be embedded into the resulting executable.  See CMake
-      // bug #2617. 
+      // bug #2617.
       const char* tool  = "VCManifestTool";
       if(this->FortranProject)
         {
@@ -941,7 +941,7 @@ cmLocalVisualStudio7Generator
 ::GetBuildTypeLinkerFlags(std::string rootLinkerFlags, const char* configName)
 {
   std::string configTypeUpper = cmSystemTools::UpperCase(configName);
-  std::string extraLinkOptionsBuildTypeDef = 
+  std::string extraLinkOptionsBuildTypeDef =
     rootLinkerFlags + "_" + configTypeUpper;
 
   std::string extraLinkOptionsBuildType =
@@ -962,23 +962,23 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
   std::string extraLinkOptions;
   if(target.GetType() == cmTarget::EXECUTABLE)
     {
-    extraLinkOptions = 
-      this->Makefile->GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS") 
-      + std::string(" ") 
+    extraLinkOptions =
+      this->Makefile->GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS")
+      + std::string(" ")
       + GetBuildTypeLinkerFlags("CMAKE_EXE_LINKER_FLAGS", configName);
     }
   if(target.GetType() == cmTarget::SHARED_LIBRARY)
     {
-    extraLinkOptions = 
-      this->Makefile->GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS") 
-      + std::string(" ") 
+    extraLinkOptions =
+      this->Makefile->GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS")
+      + std::string(" ")
       + GetBuildTypeLinkerFlags("CMAKE_SHARED_LINKER_FLAGS", configName);
     }
   if(target.GetType() == cmTarget::MODULE_LIBRARY)
     {
-    extraLinkOptions = 
-      this->Makefile->GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS") 
-      + std::string(" ") 
+    extraLinkOptions =
+      this->Makefile->GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS")
+      + std::string(" ")
       + GetBuildTypeLinkerFlags("CMAKE_MODULE_LINKER_FLAGS", configName);
     }
 
@@ -1203,7 +1203,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
     temp = target.GetDirectory(configName);
     temp += "/";
     temp += targetNameFull;
-    fout << "\t\t\t\tOutputFile=\"" 
+    fout << "\t\t\t\tOutputFile=\""
          << this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"\n";
     this->WriteTargetVersionAttribute(fout, target);
     linkOptions.OutputFlagMap(fout, "\t\t\t\t");
@@ -1594,7 +1594,7 @@ cmLocalVisualStudio7Generator
 
 void cmLocalVisualStudio7Generator
 ::WriteGroup(const cmSourceGroup *sg, cmTarget& target,
-             std::ostream &fout, const char *libName, 
+             std::ostream &fout, const char *libName,
              std::vector<std::string> *configs)
 {
   const std::vector<const cmSourceFile *> &sourceFiles =
@@ -1652,7 +1652,7 @@ void cmLocalVisualStudio7Generator
           }
         if(ext == "rc")
           {
-          aCompilerTool = "VCResourceCompilerTool";  
+          aCompilerTool = "VCResourceCompilerTool";
           lang = "RC";
           if(this->FortranProject)
             {
@@ -1744,7 +1744,7 @@ WriteCustomRule(std::ostream& fout,
                 FCInfo& fcinfo)
 {
   std::string comment = this->ConstructComment(command);
-  
+
   // Write the rule for each configuration.
   std::vector<std::string>::iterator i;
   std::vector<std::string> *configs =
@@ -1780,9 +1780,9 @@ WriteCustomRule(std::ostream& fout,
       }
     fout << "\t\t\t\t\t<Tool\n"
          << "\t\t\t\t\tName=\"" << customTool << "\"\n"
-         << "\t\t\t\t\tDescription=\"" 
+         << "\t\t\t\t\tDescription=\""
          << this->EscapeForXML(comment.c_str()) << "\"\n"
-         << "\t\t\t\t\tCommandLine=\"" 
+         << "\t\t\t\t\tCommandLine=\""
          << this->EscapeForXML(script.c_str()) << "\"\n"
          << "\t\t\t\t\tAdditionalDependencies=\"";
     if(command.GetDepends().empty())
@@ -1799,9 +1799,9 @@ WriteCustomRule(std::ostream& fout,
     else
       {
       // Write out the dependencies for the rule.
-      for(std::vector<std::string>::const_iterator d = 
+      for(std::vector<std::string>::const_iterator d =
           command.GetDepends().begin();
-          d != command.GetDepends().end(); 
+          d != command.GetDepends().end();
           ++d)
         {
         // Get the real name of the dependency in case it is a CMake target.
@@ -1823,9 +1823,9 @@ WriteCustomRule(std::ostream& fout,
       {
       // Write a rule for the output generated by this command.
       const char* sep = "";
-      for(std::vector<std::string>::const_iterator o = 
-          command.GetOutputs().begin(); 
-          o != command.GetOutputs().end(); 
+      for(std::vector<std::string>::const_iterator o =
+          command.GetOutputs().begin();
+          o != command.GetOutputs().end();
           ++o)
         {
         fout << sep << this->ConvertToXMLOutputPathSingle(o->c_str());
@@ -1922,7 +1922,7 @@ cmLocalVisualStudio7Generator
                            const char *libName,
                            cmTarget & target)
 {
-  
+
   cmGlobalVisualStudio7Generator* gg =
     static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator);
 
@@ -1954,7 +1954,7 @@ cmLocalVisualStudio7Generator
   if(!keyword)
     {
     keyword = "Console Application";
-    } 
+    }
   const char* projectType = 0;
   switch(target.GetType())
     {
@@ -1990,7 +1990,7 @@ cmLocalVisualStudio7Generator
     fout << "\tProjectType=\"" << projectType << "\"\n";
     }
   this->WriteProjectSCC(fout, target);
-  fout<< "\tKeyword=\"" << keyword << "\">\n" 
+  fout<< "\tKeyword=\"" << keyword << "\">\n"
        << "\tProjectGUID=\"{" << gg->GetGUID(libName) << "}\">\n"
        << "\t<Platforms>\n"
        << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n"
@@ -2110,7 +2110,7 @@ std::string cmLocalVisualStudio7Generator
 
 
 // This class is used to parse an existing vs 7 project
-// and extract the GUID 
+// and extract the GUID
 class cmVS7XMLParser : public cmXMLParser
 {
 public:
@@ -2130,7 +2130,7 @@ public:
         while(atts[i])
           {
           if(strcmp(atts[i], "ProjectGUID") == 0)
-            { 
+            {
             if(atts[i+1])
               {
               this->GUID =  atts[i+1];
@@ -2144,7 +2144,7 @@ public:
             }
           ++i;
           }
-        } 
+        }
     }
   int InitializeParser()
     {
@@ -2153,7 +2153,7 @@ public:
         {
         return ret;
         }
-      // visual studio projects have a strange encoding, but it is 
+      // visual studio projects have a strange encoding, but it is
       // really utf-8
       XML_SetEncoding(static_cast<XML_Parser>(this->Parser), "utf-8");
       return 1;
diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h
index 9aa408eda..95db2cc8c 100644
--- a/Source/cmLocalVisualStudio7Generator.h
+++ b/Source/cmLocalVisualStudio7Generator.h
@@ -42,7 +42,7 @@ public:
   virtual void AddHelperCommands();
 
   /**
-   * Generate the makefile for this directory. 
+   * Generate the makefile for this directory.
    */
   virtual void Generate();
 
@@ -77,17 +77,17 @@ private:
   void WriteVCProjHeader(std::ostream& fout, const char *libName,
                          cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
   void WriteVCProjFooter(std::ostream& fout, cmTarget &target);
-  void WriteVCProjFile(std::ostream& fout, const char *libName, 
+  void WriteVCProjFile(std::ostream& fout, const char *libName,
                        cmTarget &tgt);
   void WriteConfigurations(std::ostream& fout,
                            const char *libName, cmTarget &tgt);
   void WriteConfiguration(std::ostream& fout,
                           const char* configName,
-                          const char* libName, cmTarget &tgt); 
+                          const char* libName, cmTarget &tgt);
   std::string EscapeForXML(const char* s);
   std::string ConvertToXMLOutputPath(const char* path);
   std::string ConvertToXMLOutputPathSingle(const char* path);
-  void OutputTargetRules(std::ostream& fout, const char* configName, 
+  void OutputTargetRules(std::ostream& fout, const char* configName,
                          cmTarget &target, const char *libName);
   void OutputBuildTool(std::ostream& fout, const char* configName,
                        cmTarget& t, bool debug);
@@ -98,18 +98,18 @@ private:
                          cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
   void WriteProjectStartFortran(std::ostream& fout, const char *libName,
                                 cmTarget &tgt);
-  void WriteVCProjBeginGroup(std::ostream& fout, 
+  void WriteVCProjBeginGroup(std::ostream& fout,
                           const char* group,
                           const char* filter);
   void WriteVCProjEndGroup(std::ostream& fout);
-  
+
   void WriteCustomRule(std::ostream& fout,
                        const char* source,
                        const cmCustomCommand& command,
                        FCInfo& fcinfo);
   void WriteTargetVersionAttribute(std::ostream& fout, cmTarget& target);
 
-  void WriteGroup(const cmSourceGroup *sg, 
+  void WriteGroup(const cmSourceGroup *sg,
                   cmTarget& target, std::ostream &fout,
                   const char *libName, std::vector<std::string> *configs);
 
@@ -122,7 +122,7 @@ private:
   cmVS7FlagTable const* ExtraFlagTable;
   std::string ModuleDefinitionFile;
   bool FortranProject;
-  std::string PlatformName; // Win32 or x64 
+  std::string PlatformName; // Win32 or x64
   cmLocalVisualStudio7GeneratorInternals* Internal;
 };
 
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index 259922759..bd7ec004b 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -56,7 +56,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InvokeInitialPass(const std::vector<cmListFileArgument>& args, 
+  virtual bool InvokeInitialPass(const std::vector<cmListFileArgument>& args,
                                  cmExecutionStatus &);
 
   virtual bool InitialPass(std::vector<std::string> const&,
@@ -66,7 +66,7 @@ public:
    * The name of the command as specified in CMakeList.txt.
    */
   virtual const char* GetName() const { return this->Args[0].c_str(); }
-  
+
   /**
    * Succinct documentation.
    */
@@ -164,7 +164,7 @@ bool cmMacroHelperCommand::InvokeInitialPass
         {
         variable = "${";
         variable += this->Args[j];
-        variable += "}"; 
+        variable += "}";
         cmSystemTools::ReplaceString(tmps, variable.c_str(),
                                      expandedArgs[j-1].c_str());
         }
@@ -270,7 +270,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
   else if(!cmSystemTools::Strucmp(lff.Name.c_str(),"endmacro"))
     {
     // if this is the endmacro for this macro then execute
-    if (!this->Depth) 
+    if (!this->Depth)
       {
       std::string name = this->Args[0];
       std::vector<std::string>::size_type cc;
@@ -287,7 +287,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
       f->Functions = this->Functions;
       mf.RecordPolicies(f->Policies);
       std::string newName = "_" + this->Args[0];
-      mf.GetCMakeInstance()->RenameCommand(this->Args[0].c_str(), 
+      mf.GetCMakeInstance()->RenameCommand(this->Args[0].c_str(),
                                            newName.c_str());
       mf.AddCommand(f);
 
@@ -341,7 +341,7 @@ bool cmMacroCommand::InitialPass(std::vector<std::string> const& args,
   cmMacroFunctionBlocker *f = new cmMacroFunctionBlocker();
   for(std::vector<std::string>::const_iterator j = args.begin();
       j != args.end(); ++j)
-    {   
+    {
     f->Args.push_back(*j);
     }
   this->Makefile->AddFunctionBlocker(f);
diff --git a/Source/cmMacroCommand.h b/Source/cmMacroCommand.h
index 36e4b2f6b..f8c40c002 100644
--- a/Source/cmMacroCommand.h
+++ b/Source/cmMacroCommand.h
@@ -20,11 +20,11 @@ class cmMacroFunctionBlocker : public cmFunctionBlocker
 public:
   cmMacroFunctionBlocker() {this->Depth=0;}
   virtual ~cmMacroFunctionBlocker() {}
-  virtual bool IsFunctionBlocked(const cmListFileFunction&, 
+  virtual bool IsFunctionBlocked(const cmListFileFunction&,
                                  cmMakefile &mf,
                                  cmExecutionStatus &);
   virtual bool ShouldRemove(const cmListFileFunction&, cmMakefile &mf);
-  
+
   std::vector<std::string> Args;
   std::vector<cmListFileFunction> Functions;
   int Depth;
diff --git a/Source/cmMakeDepend.cxx b/Source/cmMakeDepend.cxx
index 6055c5585..a68b57c23 100644
--- a/Source/cmMakeDepend.cxx
+++ b/Source/cmMakeDepend.cxx
@@ -31,8 +31,8 @@ cmMakeDepend::cmMakeDepend()
 
 
 cmMakeDepend::~cmMakeDepend()
-{ 
-  for(DependInformationMapType::iterator i = 
+{
+  for(DependInformationMapType::iterator i =
         this->DependInformationMap.begin();
       i != this->DependInformationMap.end(); ++i)
     {
@@ -162,7 +162,7 @@ void cmMakeDepend::GenerateDependInformation(cmDependInformation* info)
       else
         {
         //try to guess which include path to use
-        for(std::vector<std::string>::iterator t = 
+        for(std::vector<std::string>::iterator t =
               this->IncludeDirectories.begin();
             t != this->IncludeDirectories.end(); ++t)
           {
@@ -175,7 +175,7 @@ void cmMakeDepend::GenerateDependInformation(cmDependInformation* info)
           if (srcFile->GetFullPath() == incpath)
             {
             // set the path to the guessed path
-            info->FullPath = incpath; 
+            info->FullPath = incpath;
             found=true;
             }
           }
@@ -243,7 +243,7 @@ void cmMakeDepend::DependWalk(cmDependInformation* info)
 
 void cmMakeDepend::AddDependency(cmDependInformation* info, const char* file)
 {
-  cmDependInformation* dependInfo = 
+  cmDependInformation* dependInfo =
     this->GetDependInformation(file, info->PathOnly.c_str());
   this->GenerateDependInformation(dependInfo);
   info->AddDependencies(dependInfo);
@@ -288,7 +288,7 @@ std::string cmMakeDepend::FullPath(const char* fname, const char *extraPath)
     {
     m = this->DirectoryToFileToPathMap.find("");
     }
-  
+
   if(m != this->DirectoryToFileToPathMap.end())
     {
     FileToPathMapType& map = m->second;
@@ -305,7 +305,7 @@ std::string cmMakeDepend::FullPath(const char* fname, const char *extraPath)
     this->DirectoryToFileToPathMap[extraPath? extraPath: ""][fname] = fp;
     return fp;
     }
-  
+
   for(std::vector<std::string>::iterator i = this->IncludeDirectories.begin();
       i != this->IncludeDirectories.end(); ++i)
     {
diff --git a/Source/cmMakeDepend.h b/Source/cmMakeDepend.h
index 185f4e356..b6e3928e9 100644
--- a/Source/cmMakeDepend.h
+++ b/Source/cmMakeDepend.h
@@ -48,26 +48,26 @@ public:
    * to it.
    */
   const cmSourceFile *SourceFile;
-  
+
   /**
    * Full path to this file.
    */
   std::string FullPath;
-  
+
   /**
    * Full path not including file name.
    */
   std::string PathOnly;
-  
+
   /**
    * Name used to #include this file.
    */
   std::string IncludeName;
-  
+
   /**
    * This method adds the dependencies of another file to this one.
    */
-  void AddDependencies(cmDependInformation*);  
+  void AddDependencies(cmDependInformation*);
 };
 
 
@@ -85,11 +85,11 @@ public:
    * Destructor.
    */
   virtual ~cmMakeDepend();
-  
-  /** 
+
+  /**
    * Set the makefile that is used as a source of classes.
    */
-  virtual void SetMakefile(cmMakefile* makefile); 
+  virtual void SetMakefile(cmMakefile* makefile);
 
   /**
    * Add a directory to the search path for include files.
@@ -107,26 +107,26 @@ protected:
    * Compute the depend information for this class.
    */
   virtual void DependWalk(cmDependInformation* info);
-  
+
   /**
    * Add a dependency.  Possibly walk it for more dependencies.
    */
   virtual void AddDependency(cmDependInformation* info, const char* file);
-  
+
   /**
    * Fill in the given object with dependency information.  If the
    * information is already complete, nothing is done.
    */
   void GenerateDependInformation(cmDependInformation* info);
-  
+
   /**
    * Get an instance of cmDependInformation corresponding to the given file
    * name.
    */
-  cmDependInformation* GetDependInformation(const char* file, 
-                                            const char *extraPath);  
-  
-  /** 
+  cmDependInformation* GetDependInformation(const char* file,
+                                            const char *extraPath);
+
+  /**
    * Find the full path name for the given file name.
    * This uses the include directories.
    * TODO: Cache path conversions to reduce FileExists calls.
@@ -139,9 +139,9 @@ protected:
   cmsys::RegularExpression ComplainFileRegularExpression;
   std::vector<std::string> IncludeDirectories;
   typedef std::map<cmStdString, cmStdString> FileToPathMapType;
-  typedef std::map<cmStdString, FileToPathMapType> 
+  typedef std::map<cmStdString, FileToPathMapType>
   DirectoryToFileToPathMapType;
-  typedef std::map<cmStdString, cmDependInformation*> 
+  typedef std::map<cmStdString, cmDependInformation*>
   DependInformationMapType;
   DependInformationMapType DependInformationMap;
   DirectoryToFileToPathMapType DirectoryToFileToPathMap;
diff --git a/Source/cmMakeDirectoryCommand.h b/Source/cmMakeDirectoryCommand.h
index 4e6e1d5ab..a0f866a5f 100644
--- a/Source/cmMakeDirectoryCommand.h
+++ b/Source/cmMakeDirectoryCommand.h
@@ -29,7 +29,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmMakeDirectoryCommand;
     }
@@ -45,7 +45,7 @@ public:
    * The name of the command as specified in CMakeList.txt.
    */
   virtual const char* GetName() const { return "make_directory";}
-  
+
   /**
    * This determines if the command is invoked when in script mode.
    */
@@ -58,7 +58,7 @@ public:
     {
     return "Deprecated. Use the file(MAKE_DIRECTORY ) command instead.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -70,7 +70,7 @@ public:
       "parent directories that do not exist will also be created.  Use with "
       "care.";
     }
-  
+
   /** This command is kept for compatibility with older CMake versions. */
   virtual bool IsDiscouraged() const
     {
diff --git a/Source/cmMarkAsAdvancedCommand.cxx b/Source/cmMarkAsAdvancedCommand.cxx
index a80f7ecd6..4236d102c 100644
--- a/Source/cmMarkAsAdvancedCommand.cxx
+++ b/Source/cmMarkAsAdvancedCommand.cxx
@@ -37,7 +37,7 @@ bool cmMarkAsAdvancedCommand
     {
     std::string variable = args[i];
     cmCacheManager* manager = this->Makefile->GetCacheManager();
-    cmCacheManager::CacheIterator it = 
+    cmCacheManager::CacheIterator it =
       manager->GetCacheIterator(variable.c_str());
     if ( it.IsAtEnd() )
       {
diff --git a/Source/cmMarkAsAdvancedCommand.h b/Source/cmMarkAsAdvancedCommand.h
index 3658dbbd3..246eb8aa3 100644
--- a/Source/cmMarkAsAdvancedCommand.h
+++ b/Source/cmMarkAsAdvancedCommand.h
@@ -25,7 +25,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmMarkAsAdvancedCommand;
     }
@@ -41,7 +41,7 @@ public:
    * The name of the command as specified in CMakeList.txt.
    */
   virtual const char* GetName() const {return "mark_as_advanced";}
-  
+
   /**
    * Succinct documentation.
    */
@@ -49,7 +49,7 @@ public:
     {
     return "Mark cmake cached variables as advanced.";
     }
-  
+
   /**
    * More documentation.
    */
diff --git a/Source/cmMathCommand.cxx b/Source/cmMathCommand.cxx
index 3c1129d04..9fc42659a 100644
--- a/Source/cmMathCommand.cxx
+++ b/Source/cmMathCommand.cxx
@@ -43,7 +43,7 @@ bool cmMathCommand::HandleExprCommand(std::vector<std::string> const& args)
 
   const std::string& outputVariable = args[1];
   const std::string& expression = args[2];
-  
+
   cmExprParserHelper helper;
   if ( !helper.ParseString(expression.c_str(), 0) )
     {
diff --git a/Source/cmMathCommand.h b/Source/cmMathCommand.h
index d62290428..27c5b6a3b 100644
--- a/Source/cmMathCommand.h
+++ b/Source/cmMathCommand.h
@@ -21,7 +21,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmMathCommand;
     }
@@ -50,7 +50,7 @@ public:
     {
     return "Mathematical expressions.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -64,10 +64,10 @@ public:
       "+ - * / % | & ^ ~ << >> * / %.  They have the same meaning "
       " as they do in c code.";
     }
-  
+
   cmTypeMacro(cmMathCommand, cmCommand);
 protected:
- 
+
   bool HandleExprCommand(std::vector<std::string> const& args);
 };
 
diff --git a/Source/cmMessageCommand.h b/Source/cmMessageCommand.h
index 03ab94b1c..9f01eaf24 100644
--- a/Source/cmMessageCommand.h
+++ b/Source/cmMessageCommand.h
@@ -24,7 +24,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmMessageCommand;
     }
@@ -53,7 +53,7 @@ public:
     {
     return "Display a message to the user.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -83,7 +83,7 @@ public:
       "Indented text is considered pre-formatted."
       ;
     }
-  
+
   cmTypeMacro(cmMessageCommand, cmCommand);
 };
 
diff --git a/Source/cmObject.h b/Source/cmObject.h
index 1a39aa76a..ca6a54fd0 100644
--- a/Source/cmObject.h
+++ b/Source/cmObject.h
@@ -27,7 +27,7 @@ public:
    * Need virtual destructor to destroy real command type.
    */
   virtual ~cmObject() {}
-  
+
   /**
    * The class name of the command.
    */
@@ -38,7 +38,7 @@ public:
    */
   static bool IsTypeOf(const char *type)
     { return !strcmp("cmObject", type); }
-  
+
   /**
    * Returns true if this object is an instance of the given class or
    * a subclass of it.
diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx
index af9d94bcf..776a3a443 100644
--- a/Source/cmOptionCommand.cxx
+++ b/Source/cmOptionCommand.cxx
@@ -42,11 +42,11 @@ bool cmOptionCommand
     this->SetError(m.c_str());
     return false;
     }
-  
+
   std::string initialValue = "Off";
   // Now check and see if the value has been stored in the cache
   // already, if so use that value and don't look for the program
-  cmCacheManager::CacheIterator it = 
+  cmCacheManager::CacheIterator it =
     this->Makefile->GetCacheManager()->GetCacheIterator(args[0].c_str());
   if(!it.IsAtEnd())
     {
diff --git a/Source/cmOptionCommand.h b/Source/cmOptionCommand.h
index da3133237..7d0240050 100644
--- a/Source/cmOptionCommand.h
+++ b/Source/cmOptionCommand.h
@@ -25,7 +25,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmOptionCommand;
     }
@@ -41,7 +41,7 @@ public:
    * The name of the command as specified in CMakeList.txt.
    */
   virtual const char* GetName() const {return "option";}
-  
+
   /**
    * Succinct documentation.
    */
@@ -49,7 +49,7 @@ public:
     {
     return "Provides an option that the user can optionally select.";
     }
-  
+
   /**
    * More documentation.
    */
diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx
index be079c096..01fc2cf8a 100644
--- a/Source/cmOutputRequiredFilesCommand.cxx
+++ b/Source/cmOutputRequiredFilesCommand.cxx
@@ -28,7 +28,7 @@ void cmLBDepend::DependWalk(cmDependInformation* info)
     cmSystemTools::Error("error can not open ", info->FullPath.c_str());
     return;
     }
-  
+
   std::string line;
   while(cmSystemTools::GetLineFromStream(fin, line))
     {
@@ -45,7 +45,7 @@ void cmLBDepend::DependWalk(cmDependInformation* info)
         // if a < is not found then move on
         if(qstart == std::string::npos)
           {
-          cmSystemTools::Error("unknown include directive ", 
+          cmSystemTools::Error("unknown include directive ",
                                currentline.c_str() );
           continue;
           }
@@ -73,7 +73,7 @@ void cmLBDepend::DependWalk(cmDependInformation* info)
           }
         continue;
         }
-      
+
       // Add this file and all its dependencies.
       this->AddDependency(info, includeFile.c_str());
       /// add the cxx file if it exists
@@ -89,7 +89,7 @@ void cmLBDepend::DependWalk(cmDependInformation* info)
           {
           found = true;
           }
-        for(std::vector<std::string>::iterator i = 
+        for(std::vector<std::string>::iterator i =
               this->IncludeDirectories.begin();
             i != this->IncludeDirectories.end(); ++i)
           {
@@ -108,7 +108,7 @@ void cmLBDepend::DependWalk(cmDependInformation* info)
             {
             found = true;
             }
-          for(std::vector<std::string>::iterator i = 
+          for(std::vector<std::string>::iterator i =
                 this->IncludeDirectories.begin();
               i != this->IncludeDirectories.end(); ++i)
             {
@@ -128,7 +128,7 @@ void cmLBDepend::DependWalk(cmDependInformation* info)
             {
             found = true;
             }
-          for(std::vector<std::string>::iterator i = 
+          for(std::vector<std::string>::iterator i =
                 this->IncludeDirectories.begin();
               i != this->IncludeDirectories.end(); ++i)
             {
@@ -148,7 +148,7 @@ void cmLBDepend::DependWalk(cmDependInformation* info)
             {
             found = true;
             }
-          for(std::vector<std::string>::iterator i = 
+          for(std::vector<std::string>::iterator i =
                 this->IncludeDirectories.begin();
               i != this->IncludeDirectories.end(); ++i)
             {
@@ -183,7 +183,7 @@ bool cmOutputRequiredFilesCommand
   // store the arg for final pass
   this->File = args[0];
   this->OutputFile = args[1];
-  
+
   // compute the list of files
   cmLBDepend md;
   md.SetMakefile(this->Makefile);
@@ -217,7 +217,7 @@ ListDependencies(cmDependInformation const *info,
   // add info to the visited set
   visited->insert(info);
   // now recurse with info's dependencies
-  for(cmDependInformation::DependencySetType::const_iterator d = 
+  for(cmDependInformation::DependencySetType::const_iterator d =
         info->DependencySet.begin();
       d != info->DependencySet.end(); ++d)
     {
diff --git a/Source/cmOutputRequiredFilesCommand.h b/Source/cmOutputRequiredFilesCommand.h
index 85d9095e2..1d7e39457 100644
--- a/Source/cmOutputRequiredFilesCommand.h
+++ b/Source/cmOutputRequiredFilesCommand.h
@@ -25,7 +25,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmOutputRequiredFilesCommand;
     }
@@ -49,7 +49,7 @@ public:
     {
     return "Deprecated.  Approximate C preprocessor dependency scanning.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -72,7 +72,7 @@ public:
     return true;
     }
 
-  
+
   cmTypeMacro(cmOutputRequiredFilesCommand, cmCommand);
   void ListDependencies(cmDependInformation const *info,
                         FILE *fout,
diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx
index fcf0a4903..11f9a7621 100644
--- a/Source/cmProjectCommand.cxx
+++ b/Source/cmProjectCommand.cxx
@@ -19,14 +19,14 @@ bool cmProjectCommand
     {
     this->SetError("PROJECT called with incorrect number of arguments");
     return false;
-    } 
+    }
   this->Makefile->SetProjectName(args[0].c_str());
 
   std::string bindir = args[0];
   bindir += "_BINARY_DIR";
   std::string srcdir = args[0];
   srcdir += "_SOURCE_DIR";
-  
+
   this->Makefile->AddCacheDefinition
     (bindir.c_str(),
      this->Makefile->GetCurrentOutputDirectory(),
@@ -35,7 +35,7 @@ bool cmProjectCommand
     (srcdir.c_str(),
      this->Makefile->GetCurrentDirectory(),
      "Value Computed by CMake", cmCacheManager::STATIC);
-  
+
   bindir = "PROJECT_BINARY_DIR";
   srcdir = "PROJECT_SOURCE_DIR";
 
diff --git a/Source/cmProjectCommand.h b/Source/cmProjectCommand.h
index 88a1944b4..a53cb3fb8 100644
--- a/Source/cmProjectCommand.h
+++ b/Source/cmProjectCommand.h
@@ -28,7 +28,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmProjectCommand;
     }
@@ -39,7 +39,7 @@ public:
    */
   virtual bool InitialPass(std::vector<std::string> const& args,
                            cmExecutionStatus &status);
-  
+
   /**
    * The name of the command as specified in CMakeList.txt.
    */
@@ -52,7 +52,7 @@ public:
     {
     return "Set a name for the entire project.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -73,7 +73,7 @@ public:
       "the file pointed to by that variable will be included as the last step "
       "of the project command.";
     }
-  
+
   cmTypeMacro(cmProjectCommand, cmCommand);
 };
 
diff --git a/Source/cmProperty.h b/Source/cmProperty.h
index e0fcd631e..bb75bb0b9 100644
--- a/Source/cmProperty.h
+++ b/Source/cmProperty.h
@@ -14,7 +14,7 @@
 
 #include "cmStandardIncludes.h"
 
-class cmProperty 
+class cmProperty
 {
 public:
   enum ScopeType { TARGET, SOURCE_FILE, DIRECTORY, GLOBAL, CACHE,
diff --git a/Source/cmPropertyDefinition.h b/Source/cmPropertyDefinition.h
index 16bd148a7..296366dca 100644
--- a/Source/cmPropertyDefinition.h
+++ b/Source/cmPropertyDefinition.h
@@ -29,7 +29,7 @@ public:
   /// Define this property
   void DefineProperty(const char *name, cmProperty::ScopeType scope,
                       const char *ShortDescription,
-                      const char *FullDescription, 
+                      const char *FullDescription,
                       const char *DocumentationSection,
                       bool chained);
 
@@ -44,7 +44,7 @@ public:
 
   /// Get the section if any
   const std::string &GetDocumentationSection() const {
-    return this->DocumentationSection; }; 
+    return this->DocumentationSection; };
 
   /// Get the scope
   cmProperty::ScopeType GetScope() const {
@@ -56,7 +56,7 @@ public:
 
   /// Get the documentation (full version)
   const std::string &GetFullDescription() const {
-    return this->FullDescription; }; 
+    return this->FullDescription; };
 
 protected:
   std::string Name;
diff --git a/Source/cmPropertyDefinitionMap.cxx b/Source/cmPropertyDefinitionMap.cxx
index fcdb93776..20fa07c43 100644
--- a/Source/cmPropertyDefinitionMap.cxx
+++ b/Source/cmPropertyDefinitionMap.cxx
@@ -30,7 +30,7 @@ void cmPropertyDefinitionMap
   if (it == this->end())
     {
     prop = &(*this)[name];
-    prop->DefineProperty(name,scope,ShortDescription, FullDescription, 
+    prop->DefineProperty(name,scope,ShortDescription, FullDescription,
                          DocumentationSection, chain);
     }
 }
@@ -49,10 +49,10 @@ void cmPropertyDefinitionMap
       {
       switch (j->second.GetScope())
         {
-        case cmProperty::GLOBAL: 
+        case cmProperty::GLOBAL:
           secName = "Properties of Global Scope";
           break;
-        case cmProperty::TARGET: 
+        case cmProperty::TARGET:
           secName = "Properties on Targets";
           break;
         case cmProperty::SOURCE_FILE:
@@ -80,7 +80,7 @@ void cmPropertyDefinitionMap
       }
     if (!v[secName])
       {
-      v[secName] = new 
+      v[secName] = new
         cmDocumentationSection(secName.c_str(),
                                cmSystemTools::UpperCase(secName).c_str());
       }
diff --git a/Source/cmPropertyDefinitionMap.h b/Source/cmPropertyDefinitionMap.h
index c6f9d59cd..007e26515 100644
--- a/Source/cmPropertyDefinitionMap.h
+++ b/Source/cmPropertyDefinitionMap.h
@@ -16,7 +16,7 @@
 
 class cmDocumentationSection;
 
-class cmPropertyDefinitionMap : 
+class cmPropertyDefinitionMap :
 public std::map<cmStdString,cmPropertyDefinition>
 {
 public:
diff --git a/Source/cmPropertyMap.cxx b/Source/cmPropertyMap.cxx
index a4d0bf3d8..78f378ab7 100644
--- a/Source/cmPropertyMap.cxx
+++ b/Source/cmPropertyMap.cxx
@@ -43,7 +43,7 @@ void cmPropertyMap::SetProperty(const char *name, const char *value,
 #ifdef CMAKE_STRICT
   if (!this->CMakeInstance)
     {
-    cmSystemTools::Error("CMakeInstance not set on a property map!"); 
+    cmSystemTools::Error("CMakeInstance not set on a property map!");
     abort();
     }
   else
@@ -85,10 +85,10 @@ void cmPropertyMap::AppendProperty(const char* name, const char* value,
 }
 
 const char *cmPropertyMap
-::GetPropertyValue(const char *name, 
-                   cmProperty::ScopeType scope, 
+::GetPropertyValue(const char *name,
+                   cmProperty::ScopeType scope,
                    bool &chain) const
-{ 
+{
   chain = false;
   if (!name)
     {
@@ -99,7 +99,7 @@ const char *cmPropertyMap
 #ifdef CMAKE_STRICT
   if (!this->CMakeInstance)
     {
-    cmSystemTools::Error("CMakeInstance not set on a property map!"); 
+    cmSystemTools::Error("CMakeInstance not set on a property map!");
     abort();
     }
   else
diff --git a/Source/cmPropertyMap.h b/Source/cmPropertyMap.h
index 94275e2ac..0c3aad461 100644
--- a/Source/cmPropertyMap.h
+++ b/Source/cmPropertyMap.h
@@ -21,13 +21,13 @@ class cmPropertyMap : public std::map<cmStdString,cmProperty>
 public:
   cmProperty *GetOrCreateProperty(const char *name);
 
-  void SetProperty(const char *name, const char *value, 
+  void SetProperty(const char *name, const char *value,
                    cmProperty::ScopeType scope);
 
   void AppendProperty(const char* name, const char* value,
                       cmProperty::ScopeType scope, bool asString=false);
 
-  const char *GetPropertyValue(const char *name, 
+  const char *GetPropertyValue(const char *name,
                                cmProperty::ScopeType scope,
                                bool &chain) const;
 
diff --git a/Source/cmQTWrapCPPCommand.cxx b/Source/cmQTWrapCPPCommand.cxx
index 1f1aed72f..0d3c9941c 100644
--- a/Source/cmQTWrapCPPCommand.cxx
+++ b/Source/cmQTWrapCPPCommand.cxx
@@ -12,7 +12,7 @@
 #include "cmQTWrapCPPCommand.h"
 
 // cmQTWrapCPPCommand
-bool cmQTWrapCPPCommand::InitialPass(std::vector<std::string> const& argsIn, 
+bool cmQTWrapCPPCommand::InitialPass(std::vector<std::string> const& argsIn,
                                      cmExecutionStatus &)
 {
   if(argsIn.size() < 3 )
diff --git a/Source/cmQTWrapCPPCommand.h b/Source/cmQTWrapCPPCommand.h
index 0184927c9..1af084065 100644
--- a/Source/cmQTWrapCPPCommand.h
+++ b/Source/cmQTWrapCPPCommand.h
@@ -30,7 +30,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmQTWrapCPPCommand;
     }
@@ -54,7 +54,7 @@ public:
     {
     return "Create Qt Wrappers.";
     }
-  
+
   /**
    * More documentation.
    */
diff --git a/Source/cmQTWrapUICommand.cxx b/Source/cmQTWrapUICommand.cxx
index bbecd8dcc..a6a4b5158 100644
--- a/Source/cmQTWrapUICommand.cxx
+++ b/Source/cmQTWrapUICommand.cxx
@@ -12,7 +12,7 @@
 #include "cmQTWrapUICommand.h"
 
 // cmQTWrapUICommand
-bool cmQTWrapUICommand::InitialPass(std::vector<std::string> const& argsIn, 
+bool cmQTWrapUICommand::InitialPass(std::vector<std::string> const& argsIn,
                                     cmExecutionStatus &)
 {
   if(argsIn.size() < 4 )
diff --git a/Source/cmQTWrapUICommand.h b/Source/cmQTWrapUICommand.h
index 744ae9838..1fff04162 100644
--- a/Source/cmQTWrapUICommand.h
+++ b/Source/cmQTWrapUICommand.h
@@ -28,7 +28,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmQTWrapUICommand;
     }
@@ -52,7 +52,7 @@ public:
     {
     return "Create Qt user interfaces Wrappers.";
     }
-  
+
   /**
    * More documentation.
    */
diff --git a/Source/cmRemoveCommand.cxx b/Source/cmRemoveCommand.cxx
index d80b3fe9f..bcb856438 100644
--- a/Source/cmRemoveCommand.cxx
+++ b/Source/cmRemoveCommand.cxx
@@ -30,13 +30,13 @@ bool cmRemoveCommand
     {
     return true;
     }
-  
+
   // expand the variable
   std::vector<std::string> varArgsExpanded;
   cmSystemTools::ExpandListArgument(cacheValue, varArgsExpanded);
-  
+
   // expand the args
-  // check for REMOVE(VAR v1 v2 ... vn) 
+  // check for REMOVE(VAR v1 v2 ... vn)
   std::vector<std::string> argsExpanded;
   std::vector<std::string> temp;
   for(unsigned int j = 1; j < args.size(); ++j)
@@ -44,7 +44,7 @@ bool cmRemoveCommand
     temp.push_back(args[j]);
     }
   cmSystemTools::ExpandList(temp, argsExpanded);
-  
+
   // now create the new value
   std::string value;
   for(unsigned int j = 0; j < varArgsExpanded.size(); ++j)
@@ -67,7 +67,7 @@ bool cmRemoveCommand
       value += varArgsExpanded[j];
       }
     }
-  
+
   // add the definition
   this->Makefile->AddDefinition(variable, value.c_str());
 
diff --git a/Source/cmRemoveCommand.h b/Source/cmRemoveCommand.h
index c62d58f64..5aedc26e5 100644
--- a/Source/cmRemoveCommand.h
+++ b/Source/cmRemoveCommand.h
@@ -25,7 +25,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmRemoveCommand;
     }
@@ -46,7 +46,7 @@ public:
    * The name of the command as specified in CMakeList.txt.
    */
   virtual const char* GetName() const {return "remove";}
-  
+
   /**
    * Succinct documentation.
    */
@@ -54,7 +54,7 @@ public:
     {
     return "Deprecated. Use the list(REMOVE_ITEM ) command instead.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -66,13 +66,13 @@ public:
       "This is typically used to remove entries from a vector "
       "(e.g. semicolon separated list).  VALUE is expanded.";
     }
-  
+
   /** This command is kept for compatibility with older CMake versions. */
   virtual bool IsDiscouraged() const
     {
     return true;
     }
-  
+
   cmTypeMacro(cmRemoveCommand, cmCommand);
 };
 
diff --git a/Source/cmRemoveDefinitionsCommand.h b/Source/cmRemoveDefinitionsCommand.h
index f0e906d15..18f617124 100644
--- a/Source/cmRemoveDefinitionsCommand.h
+++ b/Source/cmRemoveDefinitionsCommand.h
@@ -17,9 +17,9 @@
 /** \class cmRemoveDefinitionsCommand
  * \brief Specify a list of compiler defines
  *
- * cmRemoveDefinitionsCommand specifies a list of compiler defines. 
+ * cmRemoveDefinitionsCommand specifies a list of compiler defines.
  * These defines will
- * be removed from the compile command.  
+ * be removed from the compile command.
  */
 class cmRemoveDefinitionsCommand : public cmCommand
 {
@@ -27,7 +27,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmRemoveDefinitionsCommand;
     }
@@ -43,7 +43,7 @@ public:
    * The name of the command as specified in CMakeList.txt.
    */
   virtual const char* GetName() const {return "remove_definitions";}
-  
+
   /**
    * Succinct documentation.
    */
@@ -51,7 +51,7 @@ public:
     {
     return "Removes -D define flags added by add_definitions.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -62,7 +62,7 @@ public:
       "Removes flags (added by add_definitions) from the compiler command "
       "line for sources in the current directory and below.";
     }
-  
+
   cmTypeMacro(cmRemoveDefinitionsCommand, cmCommand);
 };
 
diff --git a/Source/cmReturnCommand.h b/Source/cmReturnCommand.h
index 690ab79ca..a6e87eff3 100644
--- a/Source/cmReturnCommand.h
+++ b/Source/cmReturnCommand.h
@@ -25,7 +25,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmReturnCommand;
     }
@@ -46,7 +46,7 @@ public:
    * The name of the command as specified in CMakeList.txt.
    */
   virtual const char* GetName() const {return "return";}
-  
+
   /**
    * Succinct documentation.
    */
@@ -54,7 +54,7 @@ public:
     {
     return "Return from a file, directory or function.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -72,7 +72,7 @@ public:
       "of the function. Note that a macro "
       "is not a function and does not handle return like a function does.";
     }
-  
+
   cmTypeMacro(cmReturnCommand, cmCommand);
 };
 
diff --git a/Source/cmSeparateArgumentsCommand.h b/Source/cmSeparateArgumentsCommand.h
index 6a51a9223..d62baf787 100644
--- a/Source/cmSeparateArgumentsCommand.h
+++ b/Source/cmSeparateArgumentsCommand.h
@@ -25,7 +25,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmSeparateArgumentsCommand;
     }
@@ -46,16 +46,16 @@ public:
    * The name of the command as specified in CMakeList.txt.
    */
   virtual const char* GetName() const {return "separate_arguments";}
-  
+
   /**
    * Succinct documentation.
    */
   virtual const char* GetTerseDocumentation() const
     {
-    return 
+    return
       "Parse space-separated arguments into a semicolon-separated list.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -83,7 +83,7 @@ public:
       "All spaces are replaced with ';'.  This helps with generating "
       "command lines.";
     }
-  
+
   cmTypeMacro(cmSeparateArgumentsCommand, cmCommand);
 };
 
diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx
index d00fc86cf..20f38be10 100644
--- a/Source/cmSetCommand.cxx
+++ b/Source/cmSetCommand.cxx
@@ -20,7 +20,7 @@ bool cmSetCommand
     this->SetError("called with incorrect number of arguments");
     return false;
     }
-  
+
   // watch for ENV signatures
   const char* variable = args[0].c_str(); // VAR is always first
   if (!strncmp(variable,"ENV{",4) && strlen(variable) > 5)
@@ -31,7 +31,7 @@ bool cmSetCommand
     varName[strlen(variable)-5] = '\0';
     std::string putEnvArg = varName;
     putEnvArg += "=";
-    
+
     // what is the current value if any
     const char *currValue = getenv(varName);
     delete [] varName;
@@ -47,7 +47,7 @@ bool cmSetCommand
         }
       return true;
       }
-    
+
     // if it will be cleared, then clear it if it isn;t already clear
     if (currValue)
       {
@@ -55,7 +55,7 @@ bool cmSetCommand
       }
     return true;
     }
-  
+
   // SET (VAR) // Removes the definition of VAR.
   if (args.size() == 1)
     {
@@ -63,7 +63,7 @@ bool cmSetCommand
     return true;
     }
 
-  // here are the remaining options 
+  // here are the remaining options
   //  SET (VAR value )
   //  SET (VAR CACHE TYPE "doc String" [FORCE])
   //  SET (VAR value CACHE TYPE "doc string" [FORCE])
@@ -71,10 +71,10 @@ bool cmSetCommand
   bool cache = false; // optional
   bool force = false; // optional
   bool parentScope = false;
-  cmCacheManager::CacheEntryType type 
+  cmCacheManager::CacheEntryType type
     = cmCacheManager::STRING; // required if cache
   const char* docstring = 0; // required if cache
-  
+
   unsigned int ignoreLastArgs = 0;
   // look for PARENT_SCOPE argument
   if (args.size() > 1 && args[args.size()-1] == "PARENT_SCOPE")
@@ -136,7 +136,7 @@ bool cmSetCommand
     this->SetError("given invalid arguments for CACHE mode.");
     return false;
     }
-  
+
   if(cache)
     {
     std::string::size_type cacheStart = args.size() - 3 - (force ? 1 : 0);
@@ -145,7 +145,7 @@ bool cmSetCommand
     }
 
   // see if this is already in the cache
-  cmCacheManager::CacheIterator it = 
+  cmCacheManager::CacheIterator it =
     this->Makefile->GetCacheManager()->GetCacheIterator(variable);
   if(!it.IsAtEnd() && (it.GetType() != cmCacheManager::UNINITIALIZED))
     {
@@ -158,7 +158,7 @@ bool cmSetCommand
       return true;
       }
     }
-  
+
   // if it is meant to be in the cache then define it in the cache
   if(cache)
     {
diff --git a/Source/cmSetCommand.h b/Source/cmSetCommand.h
index 2dd80e37f..fe1d58df6 100644
--- a/Source/cmSetCommand.h
+++ b/Source/cmSetCommand.h
@@ -17,7 +17,7 @@
 /** \class cmSetCommand
  * \brief Set a CMAKE variable
  *
- * cmSetCommand sets a variable to a value with expansion.  
+ * cmSetCommand sets a variable to a value with expansion.
  */
 class cmSetCommand : public cmCommand
 {
@@ -25,7 +25,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmSetCommand;
     }
@@ -46,7 +46,7 @@ public:
    * The name of the command as specified in CMakeList.txt.
    */
   virtual const char* GetName() const {return "set";}
-  
+
   /**
    * Succinct documentation.
    */
@@ -54,7 +54,7 @@ public:
     {
     return "Set a CMake, cache or environment variable to a given value.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -154,7 +154,7 @@ public:
       "variable will use the value from the normal variable, which hides the "
       "cache variable.";
     }
-  
+
   cmTypeMacro(cmSetCommand, cmCommand);
 };
 
diff --git a/Source/cmSetDirectoryPropertiesCommand.cxx b/Source/cmSetDirectoryPropertiesCommand.cxx
index b956313a0..62c9b87c7 100644
--- a/Source/cmSetDirectoryPropertiesCommand.cxx
+++ b/Source/cmSetDirectoryPropertiesCommand.cxx
@@ -22,11 +22,11 @@ bool cmSetDirectoryPropertiesCommand
     this->SetError("called with incorrect number of arguments");
     return false;
     }
-  
+
   std::string errors;
-  bool ret = 
-    cmSetDirectoryPropertiesCommand::RunCommand(this->Makefile, 
-                                                args.begin() + 1, 
+  bool ret =
+    cmSetDirectoryPropertiesCommand::RunCommand(this->Makefile,
+                                                args.begin() + 1,
                                                 args.end(), errors);
   if (!ret)
     {
@@ -52,19 +52,19 @@ bool cmSetDirectoryPropertiesCommand
     const std::string& value = *(ait+1);
     if ( prop == "VARIABLES" )
       {
-      errors = 
+      errors =
         "Variables and cache variables should be set using SET command";
       return false;
       }
     else if ( prop == "MACROS" )
       {
-      errors = 
+      errors =
         "Commands and macros cannot be set using SET_CMAKE_PROPERTIES";
       return false;
       }
     mf->SetProperty(prop.c_str(), value.c_str());
     }
-  
+
   return true;
 }
 
diff --git a/Source/cmSetDirectoryPropertiesCommand.h b/Source/cmSetDirectoryPropertiesCommand.h
index ee401582a..8a50c60ff 100644
--- a/Source/cmSetDirectoryPropertiesCommand.h
+++ b/Source/cmSetDirectoryPropertiesCommand.h
@@ -17,7 +17,7 @@
 class cmSetDirectoryPropertiesCommand : public cmCommand
 {
 public:
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
       return new cmSetDirectoryPropertiesCommand;
     }
@@ -46,7 +46,7 @@ public:
     {
     return "Set a property of the directory.";
     }
-  
+
   /**
    * Static entry point for use by other commands
    */
@@ -69,7 +69,7 @@ public:
         "ADDITIONAL_MAKE_CLEAN_FILES is a list of files that will be cleaned "
         "as a part of \"make clean\" stage.";
     }
-  
+
   cmTypeMacro(cmSetDirectoryPropertiesCommand, cmCommand);
 };
 
diff --git a/Source/cmSetSourceFilesPropertiesCommand.cxx b/Source/cmSetSourceFilesPropertiesCommand.cxx
index 89ff4b18b..619dfc5a5 100644
--- a/Source/cmSetSourceFilesPropertiesCommand.cxx
+++ b/Source/cmSetSourceFilesPropertiesCommand.cxx
@@ -40,14 +40,14 @@ bool cmSetSourceFilesPropertiesCommand
     ++j;
     }
 
-  // now call the worker function 
+  // now call the worker function
   std::string errors;
-  bool ret = 
+  bool ret =
     cmSetSourceFilesPropertiesCommand
-    ::RunCommand(this->Makefile, 
+    ::RunCommand(this->Makefile,
                  args.begin(),
                  args.begin() + numFiles,
-                 args.begin() + numFiles, 
+                 args.begin() + numFiles,
                  args.end(), errors);
   if (!ret)
     {
diff --git a/Source/cmSetSourceFilesPropertiesCommand.h b/Source/cmSetSourceFilesPropertiesCommand.h
index 2a67bc09f..f7009e781 100644
--- a/Source/cmSetSourceFilesPropertiesCommand.h
+++ b/Source/cmSetSourceFilesPropertiesCommand.h
@@ -17,7 +17,7 @@
 class cmSetSourceFilesPropertiesCommand : public cmCommand
 {
 public:
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
       return new cmSetSourceFilesPropertiesCommand;
     }
@@ -41,7 +41,7 @@ public:
     {
     return "Source files can have properties that affect how they are built.";
     }
-  
+
   /**
    * Longer documentation.
    */
@@ -58,7 +58,7 @@ public:
         "Source file properties are visible only to targets "
         "added in the same directory (CMakeLists.txt).";
     }
-  
+
   cmTypeMacro(cmSetSourceFilesPropertiesCommand, cmCommand);
 
   static bool RunCommand(cmMakefile *mf,
diff --git a/Source/cmSetTargetPropertiesCommand.cxx b/Source/cmSetTargetPropertiesCommand.cxx
index 45a305e32..a2b50a8ef 100644
--- a/Source/cmSetTargetPropertiesCommand.cxx
+++ b/Source/cmSetTargetPropertiesCommand.cxx
@@ -67,11 +67,11 @@ bool cmSetTargetPropertiesCommand
                     "a PROPERTIES specifier?");
      return false;
     }
-  
+
   // now loop over all the targets
   int i;
   for(i = 0; i < numFiles; ++i)
-    {   
+    {
     bool ret = cmSetTargetPropertiesCommand::SetOneTarget
       (args[i].c_str(),propertyPairs,this->Makefile);
     if (!ret)
@@ -86,7 +86,7 @@ bool cmSetTargetPropertiesCommand
 }
 
 bool cmSetTargetPropertiesCommand
-::SetOneTarget(const char *tname, 
+::SetOneTarget(const char *tname,
                std::vector<std::string> &propertyPairs,
                cmMakefile *mf)
 {
@@ -103,7 +103,7 @@ bool cmSetTargetPropertiesCommand
     }
   // if file is not already in the makefile, then add it
   else
-    { 
+    {
     return false;
     }
   return true;
diff --git a/Source/cmSetTargetPropertiesCommand.h b/Source/cmSetTargetPropertiesCommand.h
index 1bc429cfd..e04f7eb78 100644
--- a/Source/cmSetTargetPropertiesCommand.h
+++ b/Source/cmSetTargetPropertiesCommand.h
@@ -17,7 +17,7 @@
 class cmSetTargetPropertiesCommand : public cmCommand
 {
 public:
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
       return new cmSetTargetPropertiesCommand;
     }
@@ -41,12 +41,12 @@ public:
     {
     return "Targets can have properties that affect how they are built.";
     }
-  
+
   /**
    *  Used by this command and cmSetPropertiesCommand
    */
-  static bool SetOneTarget(const char *tname, 
-                           std::vector<std::string> &propertyPairs, 
+  static bool SetOneTarget(const char *tname,
+                           std::vector<std::string> &propertyPairs,
                            cmMakefile *mf);
 
   /**
@@ -159,7 +159,7 @@ public:
         "part of the default build when you select \"Build Solution\"."
         ;
     }
-  
+
   cmTypeMacro(cmSetTargetPropertiesCommand, cmCommand);
 };
 
diff --git a/Source/cmSetTestsPropertiesCommand.cxx b/Source/cmSetTestsPropertiesCommand.cxx
index e4fee18f1..3d52cf242 100644
--- a/Source/cmSetTestsPropertiesCommand.cxx
+++ b/Source/cmSetTestsPropertiesCommand.cxx
@@ -73,10 +73,10 @@ bool cmSetTestsPropertiesCommand
   // now loop over all the targets
   int i;
   for(i = 0; i < numFiles; ++i)
-    {   
+    {
     std::string errors;
-    bool ret = 
-      cmSetTestsPropertiesCommand::SetOneTest(args[i].c_str(), 
+    bool ret =
+      cmSetTestsPropertiesCommand::SetOneTest(args[i].c_str(),
                                               propertyPairs,
                                               this->Makefile, errors);
     if (!ret)
@@ -91,7 +91,7 @@ bool cmSetTestsPropertiesCommand
 
 
 bool cmSetTestsPropertiesCommand
-::SetOneTest(const char *tname, 
+::SetOneTest(const char *tname,
              std::vector<std::string> &propertyPairs,
              cmMakefile *mf, std::string &errors)
 {
@@ -106,11 +106,11 @@ bool cmSetTestsPropertiesCommand
       }
     }
   else
-    { 
+    {
     errors = "Can not find test to add properties to: ";
     errors += tname;
     return false;
-    } 
+    }
 
   return true;
 }
diff --git a/Source/cmSetTestsPropertiesCommand.h b/Source/cmSetTestsPropertiesCommand.h
index 10df17dd8..3a592189b 100644
--- a/Source/cmSetTestsPropertiesCommand.h
+++ b/Source/cmSetTestsPropertiesCommand.h
@@ -17,7 +17,7 @@
 class cmSetTestsPropertiesCommand : public cmCommand
 {
 public:
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmSetTestsPropertiesCommand;
     }
@@ -70,7 +70,7 @@ public:
 
   cmTypeMacro(cmSetTestsPropertiesCommand, cmCommand);
 
-  static bool SetOneTest(const char *tname, 
+  static bool SetOneTest(const char *tname,
                          std::vector<std::string> &propertyPairs,
                          cmMakefile *mf,
                          std::string &errors);
diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx
index 04e357ca8..2bdd1ad28 100644
--- a/Source/cmSiteNameCommand.cxx
+++ b/Source/cmSiteNameCommand.cxx
@@ -29,25 +29,25 @@ bool cmSiteNameCommand
   paths.push_back("/bin");
   paths.push_back("/sbin");
   paths.push_back("/usr/local/bin");
-  
+
   const char* cacheValue
     = this->Makefile->GetDefinition(args[0].c_str());
   if(cacheValue)
     {
     return true;
     }
-  
+
   const char *temp = this->Makefile->GetDefinition("HOSTNAME");
   std::string hostname_cmd;
   if(temp)
     {
     hostname_cmd = temp;
     }
-  else 
+  else
     {
     hostname_cmd = cmSystemTools::FindProgram("hostname", paths);
     }
-  
+
   std::string siteName = "unknown";
 #if defined(_WIN32) && !defined(__CYGWIN__)
   std::string host;
@@ -64,7 +64,7 @@ bool cmSiteNameCommand
     std::string host;
     cmSystemTools::RunSingleCommand(hostname_cmd.c_str(),
       &host, 0, 0, cmSystemTools::OUTPUT_NONE);
-    
+
     // got the hostname
     if (host.length())
       {
diff --git a/Source/cmSiteNameCommand.h b/Source/cmSiteNameCommand.h
index 532710cc1..52a63bc9c 100644
--- a/Source/cmSiteNameCommand.h
+++ b/Source/cmSiteNameCommand.h
@@ -25,7 +25,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmSiteNameCommand;
     }
@@ -46,7 +46,7 @@ public:
    * The name of the command as specified in CMakeList.txt.
    */
   virtual const char* GetName() const {return "site_name";}
-  
+
   /**
    * Succinct documentation.
    */
@@ -54,7 +54,7 @@ public:
     {
     return "Set the given variable to the name of the computer.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -63,7 +63,7 @@ public:
     return
       "  site_name(variable)\n";
     }
-  
+
   cmTypeMacro(cmSiteNameCommand, cmCommand);
 };
 
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index cd94753cb..cc3b6d603 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -346,7 +346,7 @@ const char* cmSourceFile::GetProperty(const char* prop) const
     }
 
   bool chain = false;
-  const char *retVal = 
+  const char *retVal =
     this->Properties.GetPropertyValue(prop, cmProperty::SOURCE_FILE, chain);
   if (chain)
     {
@@ -354,7 +354,7 @@ const char* cmSourceFile::GetProperty(const char* prop) const
     return mf->GetProperty(prop,cmProperty::SOURCE_FILE);
     }
 
-  return retVal;    
+  return retVal;
 }
 
 //----------------------------------------------------------------------------
@@ -388,7 +388,7 @@ void cmSourceFile::DefineProperties(cmake *cm)
 {
   // define properties
   cm->DefineProperty
-    ("ABSTRACT", cmProperty::SOURCE_FILE, 
+    ("ABSTRACT", cmProperty::SOURCE_FILE,
      "Is this source file an abstract class.",
      "A property on a source file that indicates if the source file "
      "represents a class that is abstract. This only makes sense for "
@@ -396,7 +396,7 @@ void cmSourceFile::DefineProperties(cmake *cm)
      "only used by some tools that wrap classes into other languages.");
 
   cm->DefineProperty
-    ("COMPILE_FLAGS", cmProperty::SOURCE_FILE, 
+    ("COMPILE_FLAGS", cmProperty::SOURCE_FILE,
      "Additional flags to be added when compiling this source file.",
      "These flags will be added to the list of compile flags when "
      "this source file builds.  Use COMPILE_DEFINITIONS to pass additional "
@@ -430,7 +430,7 @@ void cmSourceFile::DefineProperties(cmake *cm)
      "be ignored by the Xcode generator.");
 
   cm->DefineProperty
-    ("EXTERNAL_OBJECT", cmProperty::SOURCE_FILE, 
+    ("EXTERNAL_OBJECT", cmProperty::SOURCE_FILE,
      "If set to true then this is an object file.",
      "If this property is set to true then the source file "
      "is really an object file and should not be compiled.  "
@@ -446,14 +446,14 @@ void cmSourceFile::DefineProperties(cmake *cm)
      "source files in a target share the same format.");
 
   cm->DefineProperty
-    ("GENERATED", cmProperty::SOURCE_FILE, 
+    ("GENERATED", cmProperty::SOURCE_FILE,
      "Is this source file generated as part of the build process.",
      "If a source file is generated by the build process CMake will "
      "handle it differently in terms of dependency checking etc. "
      "Otherwise having a non-existent source file could create problems.");
 
   cm->DefineProperty
-    ("HEADER_FILE_ONLY", cmProperty::SOURCE_FILE, 
+    ("HEADER_FILE_ONLY", cmProperty::SOURCE_FILE,
      "Is this source file only a header file.",
      "A property on a source file that indicates if the source file "
      "is a header file with no associated implementation. This is "
@@ -462,7 +462,7 @@ void cmSourceFile::DefineProperties(cmake *cm)
      "computed.");
 
   cm->DefineProperty
-    ("KEEP_EXTENSION", cmProperty::SOURCE_FILE, 
+    ("KEEP_EXTENSION", cmProperty::SOURCE_FILE,
      "Make the output file have the same extension as the source file.",
      "If this property is set then the file extension of the output "
      "file will be the same as that of the source file. Normally "
@@ -477,7 +477,7 @@ void cmSourceFile::DefineProperties(cmake *cm)
      "No other semantics are currently specified.");
 
   cm->DefineProperty
-    ("LANGUAGE", cmProperty::SOURCE_FILE, 
+    ("LANGUAGE", cmProperty::SOURCE_FILE,
      "What programming language is the file.",
      "A property that can be set to indicate what programming language "
      "the source file is. If it is not set the language is determined "
@@ -486,13 +486,13 @@ void cmSourceFile::DefineProperties(cmake *cm)
      "Do not set this for header or files that should not be compiled.");
 
   cm->DefineProperty
-    ("LOCATION", cmProperty::SOURCE_FILE, 
+    ("LOCATION", cmProperty::SOURCE_FILE,
      "The full path to a source file.",
      "A read only property on a SOURCE FILE that contains the full path "
      "to the source file.");
 
   cm->DefineProperty
-    ("MACOSX_PACKAGE_LOCATION", cmProperty::SOURCE_FILE, 
+    ("MACOSX_PACKAGE_LOCATION", cmProperty::SOURCE_FILE,
      "Place a source file inside a Mac OS X bundle, CFBundle, or framework.",
      "Executable targets with the MACOSX_BUNDLE property set are built "
      "as Mac OS X application bundles on Apple platforms.  "
@@ -531,7 +531,7 @@ void cmSourceFile::DefineProperties(cmake *cm)
      "command (if one does not already exist due to linking relationships).");
 
   cm->DefineProperty
-    ("OBJECT_OUTPUTS", cmProperty::SOURCE_FILE, 
+    ("OBJECT_OUTPUTS", cmProperty::SOURCE_FILE,
      "Additional outputs for a Makefile rule.",
      "Additional outputs created by compilation of this source file. "
      "If any of these outputs is missing the object will be recompiled. "
@@ -539,14 +539,14 @@ void cmSourceFile::DefineProperties(cmake *cm)
      "on other generators.");
 
   cm->DefineProperty
-    ("SYMBOLIC", cmProperty::SOURCE_FILE, 
+    ("SYMBOLIC", cmProperty::SOURCE_FILE,
      "Is this just a name for a rule.",
      "If SYMBOLIC (boolean) is set to true the build system will be "
      "informed that the source file is not actually created on disk but "
      "instead used as a symbolic name for a build rule.");
-  
+
   cm->DefineProperty
-    ("WRAP_EXCLUDE", cmProperty::SOURCE_FILE, 
+    ("WRAP_EXCLUDE", cmProperty::SOURCE_FILE,
      "Exclude this source file from any code wrapping techniques.",
      "Some packages can wrap source files into alternate languages "
      "to provide additional functionality. For example, C++ code "
diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h
index ae012747d..6c68b8745 100644
--- a/Source/cmSourceFile.h
+++ b/Source/cmSourceFile.h
@@ -21,7 +21,7 @@ class cmake;
 /** \class cmSourceFile
  * \brief Represent a class loaded from a makefile.
  *
- * cmSourceFile is represents a class loaded from 
+ * cmSourceFile is represents a class loaded from
  * a makefile.
  */
 class cmSourceFile
diff --git a/Source/cmSourceGroup.cxx b/Source/cmSourceGroup.cxx
index 2b34f2bfc..4fd98518b 100644
--- a/Source/cmSourceGroup.cxx
+++ b/Source/cmSourceGroup.cxx
@@ -71,13 +71,13 @@ void cmSourceGroup::SetGroupRegex(const char* regex)
     this->GroupRegex.compile("^$");
     }
 }
-  
+
 //----------------------------------------------------------------------------
 void cmSourceGroup::AddGroupFile(const char* name)
 {
   this->GroupFiles.insert(name);
 }
-  
+
 //----------------------------------------------------------------------------
 const char* cmSourceGroup::GetName() const
 {
@@ -89,7 +89,7 @@ const char* cmSourceGroup::GetFullName() const
 {
   return this->FullName.c_str();
 }
-  
+
 //----------------------------------------------------------------------------
 bool cmSourceGroup::MatchesRegex(const char* name)
 {
@@ -137,12 +137,12 @@ cmSourceGroup *cmSourceGroup::lookupChild(const char* name)
   // st
   for(;iter!=end; ++iter)
     {
-    std::string sgName = iter->GetName(); 
+    std::string sgName = iter->GetName();
 
     // look if descenened is the one were looking for
     if(sgName == name)
       {
-      return &(*iter); // if it so return it 
+      return &(*iter); // if it so return it
       }
     }
 
diff --git a/Source/cmSourceGroup.h b/Source/cmSourceGroup.h
index 641dcbd57..11a0c74ae 100644
--- a/Source/cmSourceGroup.h
+++ b/Source/cmSourceGroup.h
@@ -37,12 +37,12 @@ public:
   cmSourceGroup(cmSourceGroup const& r);
   ~cmSourceGroup();
   cmSourceGroup& operator=(cmSourceGroup const&);
-  
+
   /**
    * Set the regular expression for this group.
    */
   void SetGroupRegex(const char* regex);
-  
+
   /**
    * Add a file name to the explicit list of files for this group.
    */
@@ -57,7 +57,7 @@ public:
    * Looks up child and returns it
    */
   cmSourceGroup *lookupChild(const char *name);
-  
+
   /**
    * Get the name of this group.
    */
@@ -67,12 +67,12 @@ public:
    * Get the full path name for group.
    */
   const char* GetFullName() const;
-  
+
   /**
    * Check if the given name matches this group's regex.
    */
   bool MatchesRegex(const char* name);
-  
+
   /**
    * Check if the given name matches this group's explicit file list.
    */
@@ -88,8 +88,8 @@ public:
    * Check if the given name matches this group's regex in children.
    */
   cmSourceGroup *MatchChildrenRegex(const char *name);
-  
-  /**  
+
+  /**
    * Assign the given source file to this group.  Used only by
    * generators.
    */
@@ -100,7 +100,7 @@ public:
    * source group.
    */
   const std::vector<const cmSourceFile*>& GetSourceFiles() const;
-  
+
   std::vector<cmSourceGroup> const& GetGroupChildren() const;
 private:
   /**
@@ -109,17 +109,17 @@ private:
   std::string Name;
   // Full path to group
   std::string FullName;
-  
+
   /**
    * The regular expression matching the files in the group.
    */
   cmsys::RegularExpression GroupRegex;
-  
+
   /**
    * Set of file names explicitly added to this group.
    */
   std::set<cmStdString> GroupFiles;
-  
+
   /**
    * Vector of all source files that have been assigned to
    * this group.
diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx
index 8e61d0a15..9cb80f617 100644
--- a/Source/cmSourceGroupCommand.cxx
+++ b/Source/cmSourceGroupCommand.cxx
@@ -19,7 +19,7 @@ bool cmSourceGroupCommand
     {
     this->SetError("called with incorrect number of arguments");
     return false;
-    }  
+    }
 
   std::string delimiter = "\\";
   if(this->Makefile->GetDefinition("SOURCE_GROUP_DELIMITER"))
@@ -29,7 +29,7 @@ bool cmSourceGroupCommand
 
   std::vector<std::string> folders =
     cmSystemTools::tokenize(args[0], delimiter);
- 
+
   cmSourceGroup* sg = 0;
   sg = this->Makefile->GetSourceGroup(folders);
   if(!sg)
@@ -50,7 +50,7 @@ bool cmSourceGroupCommand
     sg->SetGroupRegex(args[1].c_str());
     return true;
     }
-  
+
   // Process arguments.
   bool doingFiles = false;
   for(unsigned int i=1; i < args.size(); ++i)
@@ -97,6 +97,6 @@ bool cmSourceGroupCommand
       return false;
       }
     }
-  
+
   return true;
 }
diff --git a/Source/cmSourceGroupCommand.h b/Source/cmSourceGroupCommand.h
index 6a29fc810..6c87b7101 100644
--- a/Source/cmSourceGroupCommand.h
+++ b/Source/cmSourceGroupCommand.h
@@ -26,7 +26,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmSourceGroupCommand;
     }
@@ -37,7 +37,7 @@ public:
    */
   virtual bool InitialPass(std::vector<std::string> const& args,
                            cmExecutionStatus &status);
-  
+
   /**
    * The name of the command as specified in CMakeList.txt.
    */
@@ -50,7 +50,7 @@ public:
     {
     return "Define a grouping for sources in the makefile.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -72,7 +72,7 @@ public:
       "format:\n"
       "  source_group(name regex)";
     }
-  
+
   cmTypeMacro(cmSourceGroupCommand, cmCommand);
 };
 
diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h
index ea299ca90..a4aec2e12 100644
--- a/Source/cmStandardIncludes.h
+++ b/Source/cmStandardIncludes.h
@@ -152,10 +152,10 @@ extern int putenv (char *__string) __THROW;
 
 // if std:: is not supported, then just #define it away
 #ifdef CMAKE_NO_STD_NAMESPACE
-#define std 
+#define std
 #endif
 
-// if the compiler does not support ansi for scoping of vars use a 
+// if the compiler does not support ansi for scoping of vars use a
 // #define hack
 #ifdef CMAKE_NO_ANSI_FOR_SCOPE
 #define for if(false) {} else for
@@ -178,7 +178,7 @@ namespace std { typedef ios ios_base; }
 #endif
 
 #ifdef __DECCXX_VER
-# if __DECCXX_VER <= 60390008 
+# if __DECCXX_VER <= 60390008
 #  define CM_HAS_STD_BUT_NOT_FOR_IOSTREAM
 # endif
 #endif
@@ -200,7 +200,7 @@ using ::cerr;
 using ::cin;
 using ::ifstream;
 using ::ofstream;
-  
+
 #if !defined(CMAKE_NO_ANSI_STRING_STREAM)
   using ::ostringstream;
   using ::istringstream;
@@ -208,7 +208,7 @@ using ::ofstream;
   using ::ostrstream;
   using ::istrstream;
 #endif
-  
+
 using ::endl;
 using ::ends;
 using ::flush;
@@ -324,8 +324,8 @@ struct cmDocumentationEntry
   std::string Full;
   cmDocumentationEntry(){};
   cmDocumentationEntry(const char *doc[3])
-  { if (doc[0]) this->Name = doc[0]; 
-  if (doc[1]) this->Brief = doc[1]; 
+  { if (doc[0]) this->Name = doc[0];
+  if (doc[1]) this->Brief = doc[1];
   if (doc[2]) this->Full = doc[2]; };
   cmDocumentationEntry(const char *n, const char *b, const char *f)
   { if (n) this->Name = n; if (b) this->Brief = b; if (f) this->Full = f; };
@@ -353,7 +353,7 @@ public:
 # pragma reset woff 1375 /* base class destructor not virtual */
 #endif
 
-// All subclasses of cmCommand or cmCTestGenericHandler should 
+// All subclasses of cmCommand or cmCTestGenericHandler should
 // invoke this macro.
 #define cmTypeMacro(thisClass,superclass) \
 virtual const char* GetNameOfClass() { return #thisClass; } \
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx
index ec10d571f..0193dc9e7 100644
--- a/Source/cmStringCommand.cxx
+++ b/Source/cmStringCommand.cxx
@@ -28,7 +28,7 @@ bool cmStringCommand
     this->SetError("must be called with at least one argument.");
     return false;
     }
-  
+
   const std::string &subCommand = args[0];
   if(subCommand == "REGEX")
     {
@@ -134,11 +134,11 @@ bool cmStringCommand::HandleToUpperLowerCommand(
   std::string outvar = args[2];
   std::string output;
 
-  if (toUpper) 
+  if (toUpper)
     {
     output = cmSystemTools::UpperCase(args[1]);
-    } 
-  else 
+    }
+  else
     {
     output = cmSystemTools::LowerCase(args[1]);
     }
@@ -266,7 +266,7 @@ bool cmStringCommand::HandleRegexCommand(std::vector<std::string> const& args)
       }
     return this->RegexReplace(args);
     }
-  
+
   std::string e = "sub-command REGEX does not recognize mode "+mode;
   this->SetError(e.c_str());
   return false;
@@ -279,25 +279,25 @@ bool cmStringCommand::RegexMatch(std::vector<std::string> const& args)
   // <input> [<input>...])\n";
   std::string regex = args[2];
   std::string outvar = args[3];
-  
+
   // Concatenate all the last arguments together.
   std::string input = args[4];
   for(unsigned int i=5; i < args.size(); ++i)
     {
     input += args[i];
     }
-  
+
   this->ClearMatches(this->Makefile);
   // Compile the regular expression.
   cmsys::RegularExpression re;
   if(!re.compile(regex.c_str()))
     {
-    std::string e = 
+    std::string e =
       "sub-command REGEX, mode MATCH failed to compile regex \""+regex+"\".";
     this->SetError(e.c_str());
     return false;
     }
-  
+
   // Scan through the input for all matches.
   std::string output;
   if(re.find(input.c_str()))
@@ -307,7 +307,7 @@ bool cmStringCommand::RegexMatch(std::vector<std::string> const& args)
     std::string::size_type r = re.end();
     if(r-l == 0)
       {
-      std::string e = 
+      std::string e =
         "sub-command REGEX, mode MATCH regex \""+regex+
         "\" matched an empty string.";
       this->SetError(e.c_str());
@@ -315,7 +315,7 @@ bool cmStringCommand::RegexMatch(std::vector<std::string> const& args)
       }
     output = input.substr(l, r-l);
     }
-  
+
   // Store the output in the provided variable.
   this->Makefile->AddDefinition(outvar.c_str(), output.c_str());
   return true;
@@ -324,18 +324,18 @@ bool cmStringCommand::RegexMatch(std::vector<std::string> const& args)
 //----------------------------------------------------------------------------
 bool cmStringCommand::RegexMatchAll(std::vector<std::string> const& args)
 {
-  //"STRING(REGEX MATCHALL <regular_expression> <output variable> <input> 
+  //"STRING(REGEX MATCHALL <regular_expression> <output variable> <input>
   // [<input>...])\n";
   std::string regex = args[2];
   std::string outvar = args[3];
-  
+
   // Concatenate all the last arguments together.
   std::string input = args[4];
   for(unsigned int i=5; i < args.size(); ++i)
     {
     input += args[i];
     }
-  
+
   this->ClearMatches(this->Makefile);
   // Compile the regular expression.
   cmsys::RegularExpression re;
@@ -347,7 +347,7 @@ bool cmStringCommand::RegexMatchAll(std::vector<std::string> const& args)
     this->SetError(e.c_str());
     return false;
     }
-  
+
   // Scan through the input for all matches.
   std::string output;
   const char* p = input.c_str();
@@ -370,7 +370,7 @@ bool cmStringCommand::RegexMatchAll(std::vector<std::string> const& args)
     output += std::string(p+l, r-l);
     p += r;
     }
-  
+
   // Store the output in the provided variable.
   this->Makefile->AddDefinition(outvar.c_str(), output.c_str());
   return true;
@@ -379,12 +379,12 @@ bool cmStringCommand::RegexMatchAll(std::vector<std::string> const& args)
 //----------------------------------------------------------------------------
 bool cmStringCommand::RegexReplace(std::vector<std::string> const& args)
 {
-  //"STRING(REGEX REPLACE <regular_expression> <replace_expression> 
+  //"STRING(REGEX REPLACE <regular_expression> <replace_expression>
   // <output variable> <input> [<input>...])\n"
   std::string regex = args[2];
-  std::string replace = args[3];  
+  std::string replace = args[3];
   std::string outvar = args[4];
-  
+
   // Pull apart the replace expression to find the escaped [0-9] values.
   std::vector<RegexReplacement> replacement;
   std::string::size_type l = 0;
@@ -432,26 +432,26 @@ bool cmStringCommand::RegexReplace(std::vector<std::string> const& args)
       }
     l = r;
     }
-  
+
   // Concatenate all the last arguments together.
   std::string input = args[5];
   for(unsigned int i=6; i < args.size(); ++i)
     {
     input += args[i];
     }
-  
+
   this->ClearMatches(this->Makefile);
   // Compile the regular expression.
   cmsys::RegularExpression re;
   if(!re.compile(regex.c_str()))
     {
-    std::string e = 
+    std::string e =
       "sub-command REGEX, mode REPLACE failed to compile regex \""+
       regex+"\".";
     this->SetError(e.c_str());
     return false;
     }
-  
+
   // Scan through the input for all matches.
   std::string output;
   std::string::size_type base = 0;
@@ -460,10 +460,10 @@ bool cmStringCommand::RegexReplace(std::vector<std::string> const& args)
     this->StoreMatches(this->Makefile, re);
     std::string::size_type l2 = re.start();
     std::string::size_type r = re.end();
-    
+
     // Concatenate the part of the input that was not matched.
     output += input.substr(base, l2);
-    
+
     // Make sure the match had some text.
     if(r-l2 == 0)
       {
@@ -472,7 +472,7 @@ bool cmStringCommand::RegexReplace(std::vector<std::string> const& args)
       this->SetError(e.c_str());
       return false;
       }
-    
+
     // Concatenate the replacement for the match.
     for(unsigned int i=0; i < replacement.size(); ++i)
       {
@@ -504,14 +504,14 @@ bool cmStringCommand::RegexReplace(std::vector<std::string> const& args)
           }
         }
       }
-    
+
     // Move past the match.
     base += r;
     }
-  
+
   // Concatenate the text after the last match.
   output += input.substr(base, input.length()-base);
-  
+
   // Store the output in the provided variable.
   this->Makefile->AddDefinition(outvar.c_str(), output.c_str());
   return true;
@@ -624,9 +624,9 @@ bool cmStringCommand::HandleCompareCommand(std::vector<std::string> const&
       this->SetError(e.c_str());
       return false;
       }
-    
+
     const std::string& left = args[2];
-    const std::string& right = args[3];  
+    const std::string& right = args[3];
     const std::string& outvar = args[4];
     bool result;
     if(mode == "LESS")
@@ -654,7 +654,7 @@ bool cmStringCommand::HandleCompareCommand(std::vector<std::string> const&
       this->Makefile->AddDefinition(outvar.c_str(), "0");
       }
     return true;
-    }  
+    }
   std::string e = "sub-command COMPARE does not recognize mode "+mode;
   this->SetError(e.c_str());
   return false;
@@ -680,7 +680,7 @@ bool cmStringCommand::HandleReplaceCommand(std::vector<std::string> const&
     input += args[i];
     }
 
-  cmsys::SystemTools::ReplaceString(input, matchExpression.c_str(), 
+  cmsys::SystemTools::ReplaceString(input, matchExpression.c_str(),
                                     replaceExpression.c_str());
 
   this->Makefile->AddDefinition(variableName.c_str(), input.c_str());
@@ -688,7 +688,7 @@ bool cmStringCommand::HandleReplaceCommand(std::vector<std::string> const&
 }
 
 //----------------------------------------------------------------------------
-bool cmStringCommand::HandleSubstringCommand(std::vector<std::string> const& 
+bool cmStringCommand::HandleSubstringCommand(std::vector<std::string> const&
                                              args)
 {
   if(args.size() != 5)
@@ -722,7 +722,7 @@ bool cmStringCommand::HandleSubstringCommand(std::vector<std::string> const&
     return false;
     }
 
-  this->Makefile->AddDefinition(variableName.c_str(), 
+  this->Makefile->AddDefinition(variableName.c_str(),
                                 stringValue.substr(begin, end).c_str());
   return true;
 }
@@ -780,7 +780,7 @@ bool cmStringCommand::HandleStripCommand(
 
   size_t outLength = 0;
 
-  // if the input string didn't contain any non-space characters, return 
+  // if the input string didn't contain any non-space characters, return
   // an empty string
   if (startPos > inStringLength)
     {
diff --git a/Source/cmStringCommand.h b/Source/cmStringCommand.h
index 3e585a5b3..43a0dbe1f 100644
--- a/Source/cmStringCommand.h
+++ b/Source/cmStringCommand.h
@@ -30,7 +30,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmStringCommand;
     }
@@ -59,7 +59,7 @@ public:
     {
     return "String operations.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -143,7 +143,7 @@ public:
       "             by all regular expression-related commands, including \n"
       "             e.g. if( MATCHES ), in the variables CMAKE_MATCH_(0..9).";
     }
-  
+
   cmTypeMacro(cmStringCommand, cmCommand);
   static void ClearMatches(cmMakefile* mf);
   static void StoreMatches(cmMakefile* mf, cmsys::RegularExpression& re);
diff --git a/Source/cmSubdirCommand.cxx b/Source/cmSubdirCommand.cxx
index 9fcbe77ec..0cfe7722d 100644
--- a/Source/cmSubdirCommand.cxx
+++ b/Source/cmSubdirCommand.cxx
@@ -39,13 +39,13 @@ bool cmSubdirCommand
       }
 
     // if they specified a relative path then compute the full
-    std::string srcPath = 
-      std::string(this->Makefile->GetCurrentDirectory()) + 
+    std::string srcPath =
+      std::string(this->Makefile->GetCurrentDirectory()) +
         "/" + i->c_str();
     if (cmSystemTools::FileIsDirectory(srcPath.c_str()))
       {
-      std::string binPath = 
-        std::string(this->Makefile->GetCurrentOutputDirectory()) + 
+      std::string binPath =
+        std::string(this->Makefile->GetCurrentOutputDirectory()) +
         "/" + i->c_str();
       this->Makefile->AddSubDirectory(srcPath.c_str(), binPath.c_str(),
                                   excludeFromAll, preorder, false);
@@ -55,8 +55,8 @@ bool cmSubdirCommand
       {
       // we must compute the binPath from the srcPath, we just take the last
       // element from the source path and use that
-      std::string binPath = 
-        std::string(this->Makefile->GetCurrentOutputDirectory()) + 
+      std::string binPath =
+        std::string(this->Makefile->GetCurrentOutputDirectory()) +
         "/" + cmSystemTools::GetFilenameName(i->c_str());
       this->Makefile->AddSubDirectory(i->c_str(), binPath.c_str(),
                                   excludeFromAll, preorder, false);
@@ -65,7 +65,7 @@ bool cmSubdirCommand
       {
       std::string error = "Incorrect SUBDIRS command. Directory: ";
       error += *i + " does not exists.";
-      this->SetError(error.c_str());   
+      this->SetError(error.c_str());
       res = false;
       }
     }
diff --git a/Source/cmSubdirCommand.h b/Source/cmSubdirCommand.h
index eedbfff92..618d5ff2b 100644
--- a/Source/cmSubdirCommand.h
+++ b/Source/cmSubdirCommand.h
@@ -27,7 +27,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmSubdirCommand;
     }
@@ -51,7 +51,7 @@ public:
     {
     return "Deprecated. Use the add_subdirectory() command instead.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -68,7 +68,7 @@ public:
       "This will cause any CMakeLists.txt files in the sub directories "
       "to be processed by CMake.  Any directories after the PREORDER flag "
       "are traversed first by makefile builds, the PREORDER flag has no "
-      "effect on IDE projects. " 
+      "effect on IDE projects. "
       " Any directories after the EXCLUDE_FROM_ALL marker "
       "will not be included in the top level makefile or project file. "
       "This is useful for having CMake create makefiles or projects for "
@@ -77,7 +77,7 @@ public:
       "the same time, but you would not want them to show up in the "
       "top level project or be built each time make is run from the top.";
     }
-  
+
   /** This command is kept for compatibility with older CMake versions. */
   virtual bool IsDiscouraged() const
     {
diff --git a/Source/cmSubdirDependsCommand.h b/Source/cmSubdirDependsCommand.h
index daf97cd2f..b274d0196 100644
--- a/Source/cmSubdirDependsCommand.h
+++ b/Source/cmSubdirDependsCommand.h
@@ -27,7 +27,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmSubdirDependsCommand;
     }
@@ -51,7 +51,7 @@ public:
     {
     return "Deprecated.  Does nothing.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -62,7 +62,7 @@ public:
       "Does not do anything.  This command used to help projects order "
       "parallel builds correctly.  This functionality is now automatic.";
     }
-  
+
   /** This command is kept for compatibility with older CMake versions. */
   virtual bool IsDiscouraged() const
     {
diff --git a/Source/cmTest.cxx b/Source/cmTest.cxx
index 502c1740d..912ec7634 100644
--- a/Source/cmTest.cxx
+++ b/Source/cmTest.cxx
@@ -57,7 +57,7 @@ void cmTest::SetCommand(std::vector<std::string> const& command)
 const char *cmTest::GetProperty(const char* prop) const
 {
   bool chain = false;
-  const char *retVal = 
+  const char *retVal =
     this->Properties.GetPropertyValue(prop, cmProperty::TEST, chain);
   if (chain)
     {
@@ -149,14 +149,14 @@ void cmTest::DefineProperties(cmake *cm)
     "not to run concurrently.");
 
   cm->DefineProperty
-    ("MEASUREMENT", cmProperty::TEST, 
+    ("MEASUREMENT", cmProperty::TEST,
      "Specify a CDASH measurement and value to be reported for a test.",
      "If set to a name then that name will be reported to CDASH as a "
      "named measurement with a value of 1. You may also specify a value "
      "by setting MEASUREMENT to \"measurement=value\".");
 
   cm->DefineProperty
-    ("PASS_REGULAR_EXPRESSION", cmProperty::TEST, 
+    ("PASS_REGULAR_EXPRESSION", cmProperty::TEST,
      "The output must match this regular expression for the test to pass.",
      "If set, the test output will be checked "
      "against the specified regular expressions and at least one of the"
@@ -183,7 +183,7 @@ void cmTest::DefineProperties(cmake *cm)
      "any other tests.");
 
   cm->DefineProperty
-    ("TIMEOUT", cmProperty::TEST, 
+    ("TIMEOUT", cmProperty::TEST,
      "How many seconds to allow for this test.",
      "This property if set will limit a test to not take more than "
      "the specified number of seconds to run. If it exceeds that the "
@@ -192,7 +192,7 @@ void cmTest::DefineProperties(cmake *cm)
      "CTEST_TESTING_TIMEOUT.");
 
   cm->DefineProperty
-    ("WILL_FAIL", cmProperty::TEST, 
+    ("WILL_FAIL", cmProperty::TEST,
      "If set to true, this will invert the pass/fail flag of the test.",
      "This property can be used for tests that are expected to fail and "
      "return a non zero return code.");
diff --git a/Source/cmTest.h b/Source/cmTest.h
index 6223a01ea..73ac133f1 100644
--- a/Source/cmTest.h
+++ b/Source/cmTest.h
@@ -51,7 +51,7 @@ public:
   const char *GetProperty(const char *prop) const;
   bool GetPropertyAsBool(const char *prop) const;
   cmPropertyMap &GetProperties() { return this->Properties; };
-    
+
   // Define the properties
   static void DefineProperties(cmake *cm);
 
diff --git a/Source/cmTryRunCommand.h b/Source/cmTryRunCommand.h
index 06a9118b6..7878729d9 100644
--- a/Source/cmTryRunCommand.h
+++ b/Source/cmTryRunCommand.h
@@ -25,7 +25,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmTryRunCommand;
     }
@@ -49,7 +49,7 @@ public:
     {
     return "Try compiling and then running some code.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -101,10 +101,10 @@ public:
 
   cmTypeMacro(cmTryRunCommand, cmCoreTryCompile);
 private:
-  void RunExecutable(const std::string& runArgs, 
+  void RunExecutable(const std::string& runArgs,
                      std::string* runOutputContents);
-  void DoNotRunExecutable(const std::string& runArgs, 
-                          const std::string& srcFile, 
+  void DoNotRunExecutable(const std::string& runArgs,
+                          const std::string& srcFile,
                           std::string* runOutputContents);
 
   std::string CompileResultVariable;
diff --git a/Source/cmUseMangledMesaCommand.cxx b/Source/cmUseMangledMesaCommand.cxx
index 0e6f28aeb..4c189e665 100644
--- a/Source/cmUseMangledMesaCommand.cxx
+++ b/Source/cmUseMangledMesaCommand.cxx
@@ -17,7 +17,7 @@
 // cmUseMangledMesaCommand
 bool cmUseMangledMesaCommand
 ::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &)
-{ 
+{
   // expected two arguments:
   // arguement one: the full path to gl_mangle.h
   // arguement two : directory for output of edited headers
@@ -55,11 +55,11 @@ bool cmUseMangledMesaCommand
     path += *i;
     this->CopyAndFullPathMesaHeader(path.c_str(), destDir);
     }
-  
+
   return true;
 }
 
-void 
+void
 cmUseMangledMesaCommand::
 CopyAndFullPathMesaHeader(const char* source,
                           const char* outdir)
@@ -74,7 +74,7 @@ CopyAndFullPathMesaHeader(const char* source,
   std::ofstream fout(tempOutputFile.c_str());
   if(!fout)
     {
-    cmSystemTools::Error("Could not open file for write in copy operation: ", 
+    cmSystemTools::Error("Could not open file for write in copy operation: ",
                          tempOutputFile.c_str(), outdir);
     cmSystemTools::ReportLastSystemError("");
     return;
@@ -88,7 +88,7 @@ CopyAndFullPathMesaHeader(const char* source,
     }
   // now copy input to output and expand variables in the
   // input file at the same time
-  std::string inLine;  
+  std::string inLine;
   // regular expression for any #include line
   cmsys::RegularExpression includeLine(
     "^[ \t]*#[ \t]*include[ \t]*[<\"]([^\">]+)[\">]");
@@ -108,7 +108,7 @@ CopyAndFullPathMesaHeader(const char* source,
         }
       else if(glLine.find(includeFile.c_str()))
         {
-        fout << "#include \"" << outdir << "/" << 
+        fout << "#include \"" << outdir << "/" <<
           includeLine.match(1).c_str() << "\"\n";
         }
       else
diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx
index 41c82c2ba..6ea3dfac8 100644
--- a/Source/cmUtilitySourceCommand.cxx
+++ b/Source/cmUtilitySourceCommand.cxx
@@ -22,7 +22,7 @@ bool cmUtilitySourceCommand
     }
 
   std::vector<std::string>::const_iterator arg = args.begin();
-  
+
   // The first argument is the cache entry name.
   std::string cacheEntry = *arg++;
   const char* cacheValue =
@@ -30,7 +30,7 @@ bool cmUtilitySourceCommand
   // If it exists already and appears up to date then we are done.  If
   // the string contains "(IntDir)" but that is not the
   // CMAKE_CFG_INTDIR setting then the value is out of date.
-  const char* intDir = 
+  const char* intDir =
     this->Makefile->GetRequiredDefinition("CMAKE_CFG_INTDIR");
 
   bool haveCacheValue = false;
@@ -60,21 +60,21 @@ bool cmUtilitySourceCommand
     {
     return true;
     }
-  
+
   // The second argument is the utility's executable name, which will be
   // needed later.
   std::string utilityName = *arg++;
-  
+
   // The third argument specifies the relative directory of the source
   // of the utility.
   std::string relativeSource = *arg++;
   std::string utilitySource = this->Makefile->GetCurrentDirectory();
   utilitySource = utilitySource+"/"+relativeSource;
-  
+
   // If the directory doesn't exist, the source has not been included.
   if(!cmSystemTools::FileExists(utilitySource.c_str()))
     { return true; }
-  
+
   // Make sure all the files exist in the source directory.
   while(arg != args.end())
     {
@@ -82,9 +82,9 @@ bool cmUtilitySourceCommand
     if(!cmSystemTools::FileExists(file.c_str()))
       { return true; }
     }
-  
+
   // The source exists.
-  std::string cmakeCFGout = 
+  std::string cmakeCFGout =
     this->Makefile->GetRequiredDefinition("CMAKE_CFG_INTDIR");
   std::string utilityDirectory = this->Makefile->GetCurrentOutputDirectory();
   std::string exePath;
@@ -100,7 +100,7 @@ bool cmUtilitySourceCommand
     {
     utilityDirectory += "/"+relativeSource;
     }
-  
+
   // Construct the cache entry for the executable's location.
   std::string utilityExecutable =
     utilityDirectory+"/"+cmakeCFGout+"/"
@@ -108,7 +108,7 @@ bool cmUtilitySourceCommand
 
   // make sure we remove any /./ in the name
   cmSystemTools::ReplaceString(utilityExecutable, "/./", "/");
-  
+
   // Enter the value into the cache.
   this->Makefile->AddCacheDefinition(cacheEntry.c_str(),
                                  utilityExecutable.c_str(),
@@ -121,7 +121,7 @@ bool cmUtilitySourceCommand
                                  utilityName.c_str(),
                                  "Executable to project name.",
                                  cmCacheManager::INTERNAL);
-  
+
   return true;
 }
 
diff --git a/Source/cmUtilitySourceCommand.h b/Source/cmUtilitySourceCommand.h
index 32afddadc..195f605f2 100644
--- a/Source/cmUtilitySourceCommand.h
+++ b/Source/cmUtilitySourceCommand.h
@@ -29,7 +29,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmUtilitySourceCommand;
     }
@@ -53,7 +53,7 @@ public:
     {
     return "Specify the source tree of a third-party utility.";
     }
-  
+
   /**
    * More documentation.
    */
diff --git a/Source/cmVariableRequiresCommand.cxx b/Source/cmVariableRequiresCommand.cxx
index 0e97a832a..747e9be5e 100644
--- a/Source/cmVariableRequiresCommand.cxx
+++ b/Source/cmVariableRequiresCommand.cxx
@@ -22,7 +22,7 @@ bool cmVariableRequiresCommand
     return false;
     }
 
-  std::string testVariable = args[0]; 
+  std::string testVariable = args[0];
   if(!this->Makefile->IsOn(testVariable.c_str()))
     {
     return true;
@@ -38,7 +38,7 @@ bool cmVariableRequiresCommand
       requirementsMet = false;
       notSet += args[i];
       notSet += "\n";
-      cmCacheManager::CacheIterator it = 
+      cmCacheManager::CacheIterator it =
         this->Makefile->GetCacheManager()->GetCacheIterator(args[i].c_str());
       if(!it.IsAtEnd() && it.GetPropertyAsBool("ADVANCED"))
         {
@@ -47,7 +47,7 @@ bool cmVariableRequiresCommand
       }
     }
   const char* reqVar = this->Makefile->GetDefinition(resultVariable.c_str());
-  // if reqVar is unset, then set it to requirementsMet 
+  // if reqVar is unset, then set it to requirementsMet
   // if reqVar is set to true, but requirementsMet is false , then
   // set reqVar to false.
   if(!reqVar || (!requirementsMet && this->Makefile->IsOn(reqVar)))
@@ -58,14 +58,14 @@ bool cmVariableRequiresCommand
   if(!requirementsMet)
     {
     std::string message = "Variable assertion failed:\n";
-    message += testVariable + 
+    message += testVariable +
       " Requires that the following unset variables are set:\n";
     message += notSet;
     message += "\nPlease set them, or set ";
     message += testVariable + " to false, and re-configure.\n";
     if(hasAdvanced)
       {
-      message += 
+      message +=
         "One or more of the required variables is advanced."
         "  To set the variable, you must turn on advanced mode in cmake.";
       }
diff --git a/Source/cmVariableRequiresCommand.h b/Source/cmVariableRequiresCommand.h
index 91c351e60..c86f43dc6 100644
--- a/Source/cmVariableRequiresCommand.h
+++ b/Source/cmVariableRequiresCommand.h
@@ -24,7 +24,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmVariableRequiresCommand;
     }
@@ -35,7 +35,7 @@ public:
    */
   virtual bool InitialPass(std::vector<std::string> const& args,
                            cmExecutionStatus &status);
-  
+
   /**
    * The name of the command as specified in CMakeList.txt.
    */
@@ -48,7 +48,7 @@ public:
     {
     return "Deprecated. Use the if() command instead.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -63,12 +63,12 @@ public:
       "tested, if that variable is false nothing else is done. If "
       "TEST_VARIABLE is true, then "
       "the next argument (RESULT_VARIABLE) is a variable that is set to true "
-      "if all the required variables are set. " 
+      "if all the required variables are set. "
       "The rest of the arguments are variables that must be true or not "
       "set to NOTFOUND to avoid an error.  If any are not true, an error "
       "is reported.";
     }
-  
+
   /** This command is kept for compatibility with older CMake versions. */
   virtual bool IsDiscouraged() const
     {
diff --git a/Source/cmVariableWatch.cxx b/Source/cmVariableWatch.cxx
index 47bab1530..f5fdca465 100644
--- a/Source/cmVariableWatch.cxx
+++ b/Source/cmVariableWatch.cxx
@@ -38,7 +38,7 @@ cmVariableWatch::~cmVariableWatch()
 {
 }
 
-void cmVariableWatch::AddWatch(const std::string& variable, 
+void cmVariableWatch::AddWatch(const std::string& variable,
                                WatchMethod method, void* client_data /*=0*/)
 {
   cmVariableWatch::Pair p;
@@ -58,7 +58,7 @@ void cmVariableWatch::AddWatch(const std::string& variable,
   vp->push_back(p);
 }
 
-void cmVariableWatch::RemoveWatch(const std::string& variable, 
+void cmVariableWatch::RemoveWatch(const std::string& variable,
                                   WatchMethod method)
 {
   cmVariableWatch::VectorOfPairs* vp = &this->WatchMap[variable];
@@ -73,12 +73,12 @@ void cmVariableWatch::RemoveWatch(const std::string& variable,
     }
 }
 
-void  cmVariableWatch::VariableAccessed(const std::string& variable, 
+void  cmVariableWatch::VariableAccessed(const std::string& variable,
                                         int access_type,
                                         const char* newValue,
                                         const cmMakefile* mf) const
 {
-  cmVariableWatch::StringToVectorOfPairs::const_iterator mit = 
+  cmVariableWatch::StringToVectorOfPairs::const_iterator mit =
     this->WatchMap.find(variable);
   if ( mit  != this->WatchMap.end() )
     {
diff --git a/Source/cmVariableWatch.h b/Source/cmVariableWatch.h
index 83e9e9799..7dd4ac5e6 100644
--- a/Source/cmVariableWatch.h
+++ b/Source/cmVariableWatch.h
@@ -36,7 +36,7 @@ public:
   void AddWatch(const std::string& variable, WatchMethod method,
                 void* client_data=0);
   void RemoveWatch(const std::string& variable, WatchMethod method);
-  
+
   /**
    * This method is called when variable is accessed
    */
@@ -61,7 +61,7 @@ public:
    * Return the access as string
    */
   static const char* GetAccessAsString(int access_type);
-  
+
 protected:
   struct Pair
   {
diff --git a/Source/cmVariableWatchCommand.cxx b/Source/cmVariableWatchCommand.cxx
index 93c05afb7..a432943ae 100644
--- a/Source/cmVariableWatchCommand.cxx
+++ b/Source/cmVariableWatchCommand.cxx
@@ -95,7 +95,7 @@ void cmVariableWatchCommand::VariableAccessed(const std::string& variable,
       cmListFileArgument(currentListFile, true, "unknown", 9999));
     newLFF.Arguments.push_back(
       cmListFileArgument(stack, true, "unknown", 9999));
-    newLFF.Name = command; 
+    newLFF.Name = command;
     newLFF.FilePath = "Some weird path";
     newLFF.Line = 9999;
     cmExecutionStatus status;
diff --git a/Source/cmVariableWatchCommand.h b/Source/cmVariableWatchCommand.h
index cb80736e6..3abc08894 100644
--- a/Source/cmVariableWatchCommand.h
+++ b/Source/cmVariableWatchCommand.h
@@ -31,7 +31,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmVariableWatchCommand;
     }
@@ -67,7 +67,7 @@ public:
     {
     return "Watch the CMake variable for change.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -80,7 +80,7 @@ public:
       "will be executed. The command will receive the following arguments:"
       " COMMAND(<variable> <access> <value> <current list file> <stack>)";
     }
-  
+
   cmTypeMacro(cmVariableWatchCommand, cmCommand);
 
   void VariableAccessed(const std::string& variable, int access_type,
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 9a97ab0e3..53b6a9bb7 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -65,7 +65,7 @@ cmVisualStudio10TargetGenerator(cmTarget* target,
   this->Target = target;
   this->GeneratorTarget = gg->GetGeneratorTarget(target);
   this->Makefile = target->GetMakefile();
-  this->LocalGenerator =  
+  this->LocalGenerator =
     (cmLocalVisualStudio7Generator*)
     this->Makefile->GetLocalGenerator();
   this->Name = this->Target->GetName();
@@ -108,9 +108,9 @@ void cmVisualStudio10TargetGenerator::WritePlatformConfigTag(
     stream = this->BuildFileStream;
     }
   stream->fill(' ');
-  stream->width(indentLevel*2 ); 
+  stream->width(indentLevel*2 );
   (*stream ) << "";
-  (*stream ) << "<" << tag 
+  (*stream ) << "<" << tag
              << " Condition=\"'$(Configuration)|$(Platform)'=='";
   (*stream ) << config << "|" << this->Platform << "'\"";
   if(attribute)
@@ -164,7 +164,7 @@ void cmVisualStudio10TargetGenerator::Generate()
     new cmGeneratedFileStream(path.c_str());
   this->PathToVcxproj = path;
   this->BuildFileStream->SetCopyIfDifferent(true);
-  
+
   // Write the encoding header into the file
   char magic[] = {0xEF,0xBB, 0xBF};
   this->BuildFileStream->write(magic, 3);
@@ -370,9 +370,9 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
         break;
       }
     configType += "</ConfigurationType>\n";
-    this->WriteString(configType.c_str(), 2); 
+    this->WriteString(configType.c_str(), 2);
 
-    const char* mfcFlag = 
+    const char* mfcFlag =
       this->Target->GetMakefile()->GetDefinition("CMAKE_MFC_FLAG");
     std::string mfcFlagValue = mfcFlag ? mfcFlag : "0";
 
@@ -453,9 +453,9 @@ void cmVisualStudio10TargetGenerator::WriteCustomCommand(cmSourceFile* sf)
     }
 }
 
-void 
+void
 cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source,
-                                                 cmCustomCommand const & 
+                                                 cmCustomCommand const &
                                                  command)
 {
   std::string sourcePath = source->GetFullPath();
@@ -490,7 +490,7 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source,
   comment = cmVS10EscapeComment(comment);
   std::vector<std::string> *configs =
     static_cast<cmGlobalVisualStudio7Generator *>
-    (this->GlobalGenerator)->GetConfigurations(); 
+    (this->GlobalGenerator)->GetConfigurations();
 
   this->WriteSource("CustomBuild", source, ">\n");
 
@@ -504,11 +504,11 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source,
     this->WritePlatformConfigTag("Command", i->c_str(), 3);
     (*this->BuildFileStream ) << script << "</Command>\n";
     this->WritePlatformConfigTag("AdditionalInputs", i->c_str(), 3);
-    
+
     (*this->BuildFileStream ) << source->GetFullPath();
-    for(std::vector<std::string>::const_iterator d = 
+    for(std::vector<std::string>::const_iterator d =
           command.GetDepends().begin();
-        d != command.GetDepends().end(); 
+        d != command.GetDepends().end();
         ++d)
       {
       std::string dep;
@@ -521,9 +521,9 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source,
     (*this->BuildFileStream ) << ";%(AdditionalInputs)</AdditionalInputs>\n";
     this->WritePlatformConfigTag("Outputs", i->c_str(), 3);
     const char* sep = "";
-    for(std::vector<std::string>::const_iterator o = 
+    for(std::vector<std::string>::const_iterator o =
           command.GetOutputs().begin();
-        o != command.GetOutputs().end(); 
+        o != command.GetOutputs().end();
         ++o)
       {
       std::string out = *o;
@@ -559,19 +559,19 @@ void cmVisualStudio10TargetGenerator::ConvertToWindowsSlash(std::string& s)
     }
 }
 void cmVisualStudio10TargetGenerator::WriteGroups()
-{ 
+{
   // collect up group information
-  std::vector<cmSourceGroup> sourceGroups = 
+  std::vector<cmSourceGroup> sourceGroups =
     this->Makefile->GetSourceGroups();
   std::vector<cmSourceFile*>  classes = this->Target->GetSourceFiles();
-  
+
   std::set<cmSourceGroup*> groupsUsed;
-  for(std::vector<cmSourceFile*>::const_iterator s = classes.begin(); 
+  for(std::vector<cmSourceFile*>::const_iterator s = classes.begin();
       s != classes.end(); s++)
     {
-    cmSourceFile* sf = *s; 
+    cmSourceFile* sf = *s;
     std::string const& source = sf->GetFullPath();
-    cmSourceGroup& sourceGroup = 
+    cmSourceGroup& sourceGroup =
       this->Makefile->FindSourceGroup(source.c_str(), sourceGroups);
     groupsUsed.insert(&sourceGroup);
     }
@@ -634,9 +634,9 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
       guidName += name;
       this->GlobalGenerator->CreateGUID(guidName.c_str());
       this->WriteString("<UniqueIdentifier>", 3);
-      std::string guid 
+      std::string guid
         = this->GlobalGenerator->GetGUID(guidName.c_str());
-      (*this->BuildFileStream) 
+      (*this->BuildFileStream)
         << "{"
         << guid << "}"
         << "</UniqueIdentifier>\n";
@@ -724,10 +724,10 @@ WriteGroupSources(const char* name,
     {
     cmSourceFile* sf = s->SourceFile;
     std::string const& source = sf->GetFullPath();
-    cmSourceGroup& sourceGroup = 
+    cmSourceGroup& sourceGroup =
       this->Makefile->FindSourceGroup(source.c_str(), sourceGroups);
     const char* filter = sourceGroup.GetFullName();
-    this->WriteString("<", 2); 
+    this->WriteString("<", 2);
     std::string path = this->ConvertPath(source, s->RelativePath);
     this->ConvertToWindowsSlash(path);
     (*this->BuildFileStream) << name << " Include=\""
@@ -868,7 +868,7 @@ void cmVisualStudio10TargetGenerator::WriteAllSources()
 
 bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
   cmSourceFile* source)
-{ 
+{
   cmSourceFile& sf = *source;
   cmLocalVisualStudio7Generator* lg = this->LocalGenerator;
 
@@ -883,7 +883,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
   if(const char* cflags = sf.GetProperty("COMPILE_FLAGS"))
     {
     flags += cflags;
-    } 
+    }
   if(const char* cdefs = sf.GetProperty("COMPILE_DEFINITIONS"))
     {
     defines += cdefs;
@@ -899,7 +899,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
     {
     needForceLang = true;
     lang = sourceLang;
-    }  
+    }
   // if the source file does not match the linker language
   // then force c or c++
   if(needForceLang || (linkLanguage && lang
@@ -923,7 +923,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
   if(objectName.size())
     {
     (*this->BuildFileStream ) << firstString;
-    firstString = ""; 
+    firstString = "";
     hasFlags = true;
     this->WriteString("<ObjectFileName>", 3);
     (*this->BuildFileStream )
@@ -934,7 +934,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
     (this->GlobalGenerator)->GetConfigurations();
   for( std::vector<std::string>::iterator config = configs->begin();
        config != configs->end(); ++config)
-    { 
+    {
     std::string configUpper = cmSystemTools::UpperCase(*config);
     std::string configDefines = defines;
     std::string defPropName = "COMPILE_DEFINITIONS_";
@@ -947,14 +947,14 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
         }
       configDefines += ccdefs;
       }
-    // if we have flags or defines for this config then 
+    // if we have flags or defines for this config then
     // use them
     if(flags.size() || configDefines.size())
       {
       (*this->BuildFileStream ) << firstString;
       firstString = ""; // only do firstString once
       hasFlags = true;
-      cmVisualStudioGeneratorOptions 
+      cmVisualStudioGeneratorOptions
         clOptions(this->LocalGenerator,
                   cmVisualStudioGeneratorOptions::Compiler,
                   cmVS10CLFlagTable, 0, this);
@@ -962,7 +962,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
       clOptions.AddDefines(configDefines.c_str());
       clOptions.SetConfiguration((*config).c_str());
       clOptions.OutputAdditionalOptions(*this->BuildFileStream, "      ", "");
-      clOptions.OutputFlagMap(*this->BuildFileStream, "      "); 
+      clOptions.OutputFlagMap(*this->BuildFileStream, "      ");
       clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream,
                                               "      ", "\n", lang);
       }
@@ -1045,10 +1045,10 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
 
 
 
-void 
+void
 cmVisualStudio10TargetGenerator::
 OutputLinkIncremental(std::string const& configName)
-{ 
+{
   std::string CONFIG = cmSystemTools::UpperCase(configName);
   // static libraries and things greater than modules do not need
   // to set this option
@@ -1062,7 +1062,7 @@ OutputLinkIncremental(std::string const& configName)
     {
     linkType = "EXE";
     }
-  
+
   // assume incremental linking
   const char* incremental = "true";
   const char* linkLanguage =
@@ -1091,9 +1091,9 @@ OutputLinkIncremental(std::string const& configName)
     flags += this->
       Target->GetMakefile()->GetRequiredDefinition(baseFlagVar.c_str());
     std::string flagVar = baseFlagVar + std::string("_") + CONFIG;
-    flags += 
+    flags +=
       Target->GetMakefile()->GetRequiredDefinition(flagVar.c_str());
-    }  
+    }
   const char* targetLinkFlags = this->Target->GetProperty("LINK_FLAGS");
   if(targetLinkFlags)
     {
@@ -1113,7 +1113,7 @@ OutputLinkIncremental(std::string const& configName)
     }
   this->WritePlatformConfigTag("LinkIncremental", configName.c_str(), 3);
   *this->BuildFileStream << incremental
-                         << "</LinkIncremental>\n"; 
+                         << "</LinkIncremental>\n";
 
   const char* manifest = "true";
   if(flags.find("MANIFEST:NO") != flags.npos)
@@ -1155,7 +1155,7 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
   Options& clOptions = *pOptions;
 
   std::string flags;
-  // collect up flags for 
+  // collect up flags for
   if(this->Target->GetType() < cmTarget::UTILITY)
     {
     const char* linkLanguage =
@@ -1247,10 +1247,10 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
                       "</DebugInformationFormat>\n", 3);
     }
 
-  clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, "      ", 
+  clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, "      ",
                                           "\n", "CXX");
   this->WriteString("<AssemblerListingLocation>", 3);
-  *this->BuildFileStream << configName 
+  *this->BuildFileStream << configName
                          << "</AssemblerListingLocation>\n";
   this->WriteString("<ObjectFileName>$(IntDir)</ObjectFileName>\n", 3);
   if(this->Target->GetType() != cmTarget::OBJECT_LIBRARY)
@@ -1277,7 +1277,7 @@ OutputIncludes(std::vector<std::string> const & includes)
   this->WriteString("%(AdditionalIncludeDirectories)"
                     "</AdditionalIncludeDirectories>\n", 0);
 }
-  
+
 
 
 void cmVisualStudio10TargetGenerator::
@@ -1315,7 +1315,7 @@ cmVisualStudio10TargetGenerator::WriteLibOptions(std::string const& config)
     libOptions.Parse(libflags?libflags:"");
     libOptions.Parse(libflagsConfig?libflagsConfig:"");
     libOptions.OutputAdditionalOptions(*this->BuildFileStream, "      ", "");
-    libOptions.OutputFlagMap(*this->BuildFileStream, "      "); 
+    libOptions.OutputFlagMap(*this->BuildFileStream, "      ");
     this->WriteString("</Lib>\n", 2);
     }
 }
@@ -1324,7 +1324,7 @@ cmVisualStudio10TargetGenerator::WriteLibOptions(std::string const& config)
 void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const&
                                                        config)
 {
-  
+
   // static libraries and things greater than modules do not need
   // to set this option
   if(this->Target->GetType() == cmTarget::STATIC_LIBRARY
@@ -1344,7 +1344,7 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const&
 
   this->WriteString("<Link>\n", 2);
   std::string CONFIG = cmSystemTools::UpperCase(config);
-  
+
   const char* linkType = "SHARED";
   if(this->Target->GetType() == cmTarget::MODULE_LIBRARY)
     {
@@ -1405,7 +1405,7 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const&
   std::string standardLibsVar = "CMAKE_";
   standardLibsVar += linkLanguage;
   standardLibsVar += "_STANDARD_LIBRARIES";
-  std::string 
+  std::string
     libs = this->Makefile->GetSafeDefinition(standardLibsVar.c_str());
   // Remove trailing spaces from libs
   std::string::size_type pos = libs.size()-1;
@@ -1463,7 +1463,7 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const&
   else
     {
     linkOptions.AddFlag("GenerateDebugInformation", "false");
-    } 
+    }
   std::string targetName;
   std::string targetNameSO;
   std::string targetNameFull;
@@ -1472,13 +1472,13 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const&
   if(this->Target->GetType() == cmTarget::EXECUTABLE)
     {
     this->Target->GetExecutableNames(targetName, targetNameFull,
-                                     targetNameImport, targetNamePDB, 
+                                     targetNameImport, targetNamePDB,
                                      config.c_str());
     }
   else
     {
     this->Target->GetLibraryNames(targetName, targetNameSO, targetNameFull,
-                                  targetNameImport, targetNamePDB, 
+                                  targetNameImport, targetNamePDB,
                                   config.c_str());
     }
 
@@ -1502,7 +1502,7 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const&
   linkOptions.RemoveFlag("GenerateManifest");
   linkOptions.OutputAdditionalOptions(*this->BuildFileStream, "      ", "");
   linkOptions.OutputFlagMap(*this->BuildFileStream, "      ");
-  
+
   this->WriteString("</Link>\n", 2);
   if(!this->GlobalGenerator->NeedLinkLibraryDependencies(*this->Target))
     {
@@ -1516,7 +1516,7 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const&
 void cmVisualStudio10TargetGenerator::AddLibraries(
   cmComputeLinkInformation& cli,
   std::string& libstring)
-{ 
+{
   typedef cmComputeLinkInformation::ItemVector ItemVector;
   ItemVector libs = cli.GetItems();
   const char* sep = ";";
@@ -1582,15 +1582,15 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups()
     this->WriteMidlOptions(*i, includes);
     // write events
     this->WriteEvents(*i);
-    //    output link flags       <Link></Link> 
+    //    output link flags       <Link></Link>
     this->WriteLinkOptions(*i);
-    //    output lib flags       <Lib></Lib> 
+    //    output lib flags       <Lib></Lib>
     this->WriteLibOptions(*i);
     this->WriteString("</ItemDefinitionGroup>\n", 1);
     }
 }
 
-void 
+void
 cmVisualStudio10TargetGenerator::WriteEvents(std::string const& configName)
 {
   this->WriteEvent("PreLinkEvent",
@@ -1618,7 +1618,7 @@ void cmVisualStudio10TargetGenerator::WriteEvent(
   std::string comment;
   for(std::vector<cmCustomCommand>::iterator i = commands.begin();
       i != commands.end(); ++i)
-    {  
+    {
     cmCustomCommand& command = *i;
     comment += pre;
     comment += lg->ConstructComment(command);
@@ -1675,7 +1675,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences()
       }
     (*this->BuildFileStream) << path << "\">\n";
     this->WriteString("<Project>", 3);
-    (*this->BuildFileStream) 
+    (*this->BuildFileStream)
       << this->GlobalGenerator->GetGUID(name.c_str())
       << "</Project>\n";
     this->WriteString("</ProjectReference>\n", 2);
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 2d5ec2a6b..308b9bd94 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -28,20 +28,20 @@ class cmVisualStudioGeneratorOptions;
 class cmVisualStudio10TargetGenerator
 {
 public:
-  cmVisualStudio10TargetGenerator(cmTarget* target, 
+  cmVisualStudio10TargetGenerator(cmTarget* target,
                                   cmGlobalVisualStudio10Generator* gg);
   ~cmVisualStudio10TargetGenerator();
   void Generate();
-  // used by cmVisualStudioGeneratorOptions 
-  void WritePlatformConfigTag( 
+  // used by cmVisualStudioGeneratorOptions
+  void WritePlatformConfigTag(
     const char* tag,
-    const char* config, 
+    const char* config,
     int indentLevel,
     const char* attribute = 0,
     const char* end = 0,
     std::ostream* strm = 0
     );
-  
+
 private:
   struct ToolSource
   {
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index 9369af60c..1df0d9ed1 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -342,10 +342,10 @@ cmVisualStudioGeneratorOptions
   if(!this->FlagString.empty())
     {
     if(this->Version >= cmLocalVisualStudioGenerator::VS10)
-      { 
+      {
       fout << prefix;
       if(this->Configuration.size())
-        { 
+        {
         this->TargetGenerator->WritePlatformConfigTag(
           "AdditionalOptions",
           this->Configuration.c_str(),
diff --git a/Source/cmWhileCommand.h b/Source/cmWhileCommand.h
index e111ae40d..1bdf27af3 100644
--- a/Source/cmWhileCommand.h
+++ b/Source/cmWhileCommand.h
@@ -25,7 +25,7 @@ public:
                                  cmMakefile &mf,
                                  cmExecutionStatus &);
   virtual bool ShouldRemove(const cmListFileFunction& lff, cmMakefile &mf);
-  
+
   std::vector<cmListFileArgument> Args;
   std::vector<cmListFileFunction> Functions;
 private:
@@ -39,7 +39,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmWhileCommand;
     }
@@ -50,7 +50,7 @@ public:
    */
   virtual bool InvokeInitialPass(const std::vector<cmListFileArgument>& args,
                                  cmExecutionStatus &);
-    
+
   /**
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
@@ -75,7 +75,7 @@ public:
     {
     return "Evaluate a group of commands while a condition is true";
     }
-  
+
   /**
    * More documentation.
    */
@@ -93,7 +93,7 @@ public:
       "is true. The condition is evaluated using the same logic as the "
       "if command.";
     }
-  
+
   cmTypeMacro(cmWhileCommand, cmCommand);
 };
 
diff --git a/Source/cmWin32ProcessExecution.cxx b/Source/cmWin32ProcessExecution.cxx
index f37e0ff4e..9a536c159 100644
--- a/Source/cmWin32ProcessExecution.cxx
+++ b/Source/cmWin32ProcessExecution.cxx
@@ -11,7 +11,7 @@
 ============================================================================*/
 #include "cmWin32ProcessExecution.h"
 
-#include "cmSystemTools.h"   
+#include "cmSystemTools.h"
 
 #include <malloc.h>
 #include <io.h>
@@ -48,26 +48,26 @@
 void DisplayErrorMessage()
 {
   LPVOID lpMsgBuf;
-  FormatMessage( 
-    FORMAT_MESSAGE_ALLOCATE_BUFFER | 
-    FORMAT_MESSAGE_FROM_SYSTEM | 
+  FormatMessage(
+    FORMAT_MESSAGE_ALLOCATE_BUFFER |
+    FORMAT_MESSAGE_FROM_SYSTEM |
     FORMAT_MESSAGE_IGNORE_INSERTS,
     NULL,
     GetLastError(),
     MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
     (LPTSTR) &lpMsgBuf,
     0,
-    NULL 
+    NULL
     );
   // Process any inserts in lpMsgBuf.
-  // ... 
+  // ...
   // Display the string.
   MessageBox( NULL, (LPCTSTR)lpMsgBuf, "Error", MB_OK | MB_ICONINFORMATION );
   // Free the buffer.
   LocalFree( lpMsgBuf );
 }
- 
-// Code from a Borland web site with the following explaination : 
+
+// Code from a Borland web site with the following explaination :
 /* In this article, I will explain how to spawn a console application
  * and redirect its standard input/output using anonymous pipes. An
  * anonymous pipe is a pipe that goes only in one direction (read
@@ -93,74 +93,74 @@ void DisplayErrorMessage()
  * monitor the read end of the stdout pipe to check for display on our
  * child process. Every time there is something availabe for reading,
  * we will display it in our app. Consequently, we check for input in
- * our app and send it off to the write end of the stdin pipe. */ 
+ * our app and send it off to the write end of the stdin pipe. */
 
-inline bool IsWinNT() 
-//check if we're running NT 
+inline bool IsWinNT()
+//check if we're running NT
 {
   OSVERSIONINFO osv;
   osv.dwOSVersionInfoSize = sizeof(osv);
   GetVersionEx(&osv);
-  return (osv.dwPlatformId == VER_PLATFORM_WIN32_NT); 
+  return (osv.dwPlatformId == VER_PLATFORM_WIN32_NT);
 }
 
-//--------------------------------------------------------------------------- 
+//---------------------------------------------------------------------------
 bool cmWin32ProcessExecution::BorlandRunCommand(
-  const char* command, const char* dir, 
-  std::string& output, int& retVal, bool verbose, int /* timeout */, 
-  bool hideWindows) 
+  const char* command, const char* dir,
+  std::string& output, int& retVal, bool verbose, int /* timeout */,
+  bool hideWindows)
 {
   //verbose = true;
-  //std::cerr << std::endl 
-  //        << "WindowsRunCommand(" << command << ")" << std::endl 
+  //std::cerr << std::endl
+  //        << "WindowsRunCommand(" << command << ")" << std::endl
   //        << std::flush;
   const int BUFFER_SIZE = 4096;
   char buf[BUFFER_SIZE];
- 
-//i/o buffer 
+
+//i/o buffer
   STARTUPINFO si;
   SECURITY_ATTRIBUTES sa;
   SECURITY_DESCRIPTOR sd;
- 
-//security information for pipes 
+
+//security information for pipes
   PROCESS_INFORMATION pi;
   HANDLE newstdin,newstdout,read_stdout,write_stdin;
- 
-//pipe handles 
-  if (IsWinNT()) 
-//initialize security descriptor (Windows NT) 
+
+//pipe handles
+  if (IsWinNT())
+//initialize security descriptor (Windows NT)
     {
     InitializeSecurityDescriptor(&sd,SECURITY_DESCRIPTOR_REVISION);
     SetSecurityDescriptorDacl(&sd, true, NULL, false);
     sa.lpSecurityDescriptor = &sd;
- 
+
     }
   else sa.lpSecurityDescriptor = NULL;
   sa.nLength = sizeof(SECURITY_ATTRIBUTES);
   sa.bInheritHandle = true;
- 
-//allow inheritable handles 
-  if (!CreatePipe(&newstdin,&write_stdin,&sa,0)) 
-//create stdin pipe 
+
+//allow inheritable handles
+  if (!CreatePipe(&newstdin,&write_stdin,&sa,0))
+//create stdin pipe
     {
     return false;
     }
-  if (!CreatePipe(&read_stdout,&newstdout,&sa,0)) 
-//create stdout pipe 
+  if (!CreatePipe(&read_stdout,&newstdout,&sa,0))
+//create stdout pipe
     {
     CloseHandle(newstdin);
     CloseHandle(write_stdin);
     return false;
- 
+
     }
   GetStartupInfo(&si);
- 
-//set startupinfo for the spawned process 
+
+//set startupinfo for the spawned process
   /* The dwFlags member tells CreateProcess how to make the
    * process. STARTF_USESTDHANDLES validates the hStd*
    * members. STARTF_USESHOWWINDOW validates the wShowWindow
-   * member. */ 
-  
+   * member. */
+
   si.cb = sizeof(STARTUPINFO);
   si.dwFlags = STARTF_USESTDHANDLES|STARTF_USESHOWWINDOW;
   si.hStdOutput = newstdout;
@@ -170,12 +170,12 @@ bool cmWin32ProcessExecution::BorlandRunCommand(
     {
     si.wShowWindow = SW_HIDE;
     }
- 
+
 //set the new handles for the child process si.hStdInput = newstdin;
   char* commandAndArgs = strcpy(new char[strlen(command)+1], command);
   if (!CreateProcess(NULL,commandAndArgs,NULL,NULL,TRUE,
-                     0, // CREATE_NEW_CONSOLE, 
-                     NULL,dir,&si,&pi)) 
+                     0, // CREATE_NEW_CONSOLE,
+                     NULL,dir,&si,&pi))
     {
     std::cerr << "CreateProcess failed " << commandAndArgs << std::endl;
     CloseHandle(newstdin);
@@ -184,37 +184,37 @@ bool cmWin32ProcessExecution::BorlandRunCommand(
     CloseHandle(write_stdin);
     delete [] commandAndArgs;
     return false;
- 
+
     }
   delete [] commandAndArgs;
   unsigned long exit=0;
- 
-//process exit code unsigned 
+
+//process exit code unsigned
   unsigned long bread;
- 
-//bytes read unsigned 
+
+//bytes read unsigned
   unsigned long avail;
- 
-//bytes available 
+
+//bytes available
   memset(buf, 0, sizeof(buf));
-  for(;;) 
-//main program loop 
+  for(;;)
+//main program loop
     {
     Sleep(10);
-//check to see if there is any data to read from stdout 
+//check to see if there is any data to read from stdout
     //std::cout << "Peek for data..." << std::endl;
     PeekNamedPipe(read_stdout,buf,1023,&bread,&avail,NULL);
-    if (bread != 0) 
+    if (bread != 0)
       {
       memset(buf, 0, sizeof(buf));
-      if (avail > 1023) 
+      if (avail > 1023)
         {
-        while (bread >= 1023) 
+        while (bread >= 1023)
           {
           //std::cout << "Read data..." << std::endl;
           ReadFile(read_stdout,buf,1023,&bread,NULL);
- 
-          //read the stdout pipe 
+
+          //read the stdout pipe
           memset(buf, 0, sizeof(buf));
           output += buf;
           if (verbose)
@@ -223,39 +223,39 @@ bool cmWin32ProcessExecution::BorlandRunCommand(
             }
           }
         }
-      else 
+      else
         {
         ReadFile(read_stdout,buf,1023,&bread,NULL);
         output += buf;
-        if(verbose) 
+        if(verbose)
           {
           cmSystemTools::Stdout(buf);
           }
- 
+
         }
- 
+
       }
- 
+
     //std::cout << "Check for process..." << std::endl;
     GetExitCodeProcess(pi.hProcess,&exit);
- 
-//while the process is running 
+
+//while the process is running
     if (exit != STILL_ACTIVE) break;
- 
+
     }
   WaitForSingleObject(pi.hProcess, INFINITE);
   GetExitCodeProcess(pi.hProcess,&exit);
   CloseHandle(pi.hThread);
   CloseHandle(pi.hProcess);
   CloseHandle(newstdin);
- 
-//clean stuff up 
+
+//clean stuff up
   CloseHandle(newstdout);
   CloseHandle(read_stdout);
   CloseHandle(write_stdin);
   retVal = exit;
   return true;
- 
+
 }
 
 bool cmWin32ProcessExecution::StartProcess(
@@ -279,7 +279,7 @@ bool cmWin32ProcessExecution::Wait(int timeout)
 static void *_PyPopenProcs = NULL;
 
 static BOOL RealPopenCreateProcess(const char *cmdstring,
-                                   const char *path, 
+                                   const char *path,
                                    const char *szConsoleSpawn,
                                    HANDLE hStdin,
                                    HANDLE hStdout,
@@ -314,7 +314,7 @@ static BOOL RealPopenCreateProcess(const char *cmdstring,
     ++comshell;
 
     if (GetVersion() < 0x80000000 &&
-        STRICMP(comshell, "command.com") != 0) 
+        STRICMP(comshell, "command.com") != 0)
       {
       /* NT/2000 and not using command.com. */
       x = i + (int)strlen(s3) + (int)strlen(cmdstring) + 1;
@@ -323,7 +323,7 @@ static BOOL RealPopenCreateProcess(const char *cmdstring,
       //sprintf(s2, "%s%s%s", s1, s3, cmdstring);
       sprintf(s2, "%s", cmdstring);
       }
-    else 
+    else
       {
       /*
        * Oh gag, we're on Win9x or using COMMAND.COM. Use
@@ -337,22 +337,22 @@ static BOOL RealPopenCreateProcess(const char *cmdstring,
           x = i+1;
       modulepath[x] = '\0';
       /* Create the full-name to w9xpopen, so we can test it exists */
-      strncat(modulepath, 
-              szConsoleSpawn, 
+      strncat(modulepath,
+              szConsoleSpawn,
               (sizeof(modulepath)/sizeof(modulepath[0]))
               -strlen(modulepath));
-      if (stat(modulepath, &statinfo) != 0) 
+      if (stat(modulepath, &statinfo) != 0)
         {
-          /* Eeek - file-not-found - possibly an embedding 
-             situation - see if we can locate it in sys.prefix 
+          /* Eeek - file-not-found - possibly an embedding
+             situation - see if we can locate it in sys.prefix
           */
-        strncpy(modulepath, 
-                ".", 
+        strncpy(modulepath,
+                ".",
                 sizeof(modulepath)/sizeof(modulepath[0]));
         if (modulepath[strlen(modulepath)-1] != '\\')
           strcat(modulepath, "\\");
-        strncat(modulepath, 
-                szConsoleSpawn, 
+        strncat(modulepath,
+                szConsoleSpawn,
                 (sizeof(modulepath)/sizeof(modulepath[0]))
                 -strlen(modulepath));
         /* No where else to look - raise an easily identifiable
@@ -361,20 +361,20 @@ static BOOL RealPopenCreateProcess(const char *cmdstring,
            unaware this shim EXE is used, and it will confuse them.
            (well, it confused me for a while ;-)
         */
-        if (stat(modulepath, &statinfo) != 0) 
+        if (stat(modulepath, &statinfo) != 0)
           {
-          std::cout 
+          std::cout
             << "Can not locate '" << modulepath
             << "' which is needed "
             "for popen to work with your shell "
-            "or platform." << std::endl;    
+            "or platform." << std::endl;
           free(s1);
           free(s2);
           return FALSE;
           }
         }
       x = i + (int)strlen(s3) + (int)strlen(cmdstring) + 1 +
-        (int)strlen(modulepath) + 
+        (int)strlen(modulepath) +
         (int)strlen(szConsoleSpawn) + 1;
       if(s2)
         {
@@ -399,22 +399,22 @@ static BOOL RealPopenCreateProcess(const char *cmdstring,
 
   /* Could be an else here to try cmd.exe / command.com in the path
      Now we'll just error out.. */
-  else 
+  else
     {
     std::cout << "Cannot locate a COMSPEC environment variable to "
-              << "use as the shell" << std::endl; 
+              << "use as the shell" << std::endl;
     free(s2);
     free(s1);
     return FALSE;
     }
-  
+
   ZeroMemory(&siStartInfo, sizeof(STARTUPINFO));
   siStartInfo.cb = sizeof(STARTUPINFO);
   siStartInfo.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
   siStartInfo.hStdInput = hStdin;
   siStartInfo.hStdOutput = hStdout;
   siStartInfo.hStdError = hStderr;
-  siStartInfo.wShowWindow = SW_SHOWDEFAULT; 
+  siStartInfo.wShowWindow = SW_SHOWDEFAULT;
   if(hideWindows)
     {
     siStartInfo.wShowWindow = SW_HIDE;
@@ -430,7 +430,7 @@ static BOOL RealPopenCreateProcess(const char *cmdstring,
                     NULL,
                     path,
                     &siStartInfo,
-                    &piProcInfo) ) 
+                    &piProcInfo) )
     {
     /* Close the handles now so anyone waiting is woken. */
     CloseHandle(piProcInfo.hThread);
@@ -477,9 +477,9 @@ static BOOL RealPopenCreateProcess(const char *cmdstring,
 
 /* The following code is based off of KB: Q190351 */
 
-bool cmWin32ProcessExecution::PrivateOpen(const char *cmdstring, 
+bool cmWin32ProcessExecution::PrivateOpen(const char *cmdstring,
                                           const char* path,
-                                          int mode, 
+                                          int mode,
                                           int n)
 {
   HANDLE hProcess;
@@ -496,11 +496,11 @@ bool cmWin32ProcessExecution::PrivateOpen(const char *cmdstring,
   this->hChildStdinWrDup = 0;
   this->hChildStdoutRdDup = 0;
   this->hChildStderrRdDup = 0;
-  
+
   saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
   saAttr.bInheritHandle = TRUE;
   saAttr.lpSecurityDescriptor = NULL;
-  
+
   fd1 = 0;
   fd2 = 0;
   fd3 = 0;
@@ -510,7 +510,7 @@ bool cmWin32ProcessExecution::PrivateOpen(const char *cmdstring,
     this->Output += "CreatePipeError\n";
     return false;
     }
-    
+
   /* Create new output read handle and the input write handle. Set
    * the inheritance properties to FALSE. Otherwise, the child inherits
    * the these handles; resulting in non-closeable handles to the pipes
@@ -549,7 +549,7 @@ bool cmWin32ProcessExecution::PrivateOpen(const char *cmdstring,
      that we're using. */
   CloseHandle(hChildStdoutRd);
 
-  if (n != POPEN_4) 
+  if (n != POPEN_4)
     {
     if (!CreatePipe(&this->hChildStderrRd, &this->hChildStderrWr, &saAttr, 0))
       {
@@ -570,11 +570,11 @@ bool cmWin32ProcessExecution::PrivateOpen(const char *cmdstring,
     CloseHandle(hChildStderrRd);
 
     }
-          
-  switch (n) 
+
+  switch (n)
     {
     case POPEN_1:
-      switch (mode & (_O_RDONLY | _O_TEXT | _O_BINARY | _O_WRONLY)) 
+      switch (mode & (_O_RDONLY | _O_TEXT | _O_BINARY | _O_WRONLY))
         {
         case _O_WRONLY | _O_TEXT:
           /* Case for writing to child Stdin in text mode. */
@@ -606,18 +606,18 @@ bool cmWin32ProcessExecution::PrivateOpen(const char *cmdstring,
           break;
         }
       break;
-        
+
     case POPEN_2:
-    case POPEN_4: 
-      //if ( 1 ) 
+    case POPEN_4:
+      //if ( 1 )
         {
         fd1 = _open_osfhandle(TO_INTPTR(this->hChildStdinWrDup), mode);
         fd2 = _open_osfhandle(TO_INTPTR(this->hChildStdoutRdDup), mode);
         break;
         }
-        
+
     case POPEN_3:
-      //if ( 1) 
+      //if ( 1)
         {
         fd1 = _open_osfhandle(TO_INTPTR(this->hChildStdinWrDup), mode);
         fd2 = _open_osfhandle(TO_INTPTR(this->hChildStdoutRdDup), mode);
@@ -626,7 +626,7 @@ bool cmWin32ProcessExecution::PrivateOpen(const char *cmdstring,
         }
     }
 
-  if (n == POPEN_4) 
+  if (n == POPEN_4)
     {
     if (!RealPopenCreateProcess(cmdstring,
                                 path,
@@ -652,7 +652,7 @@ bool cmWin32ProcessExecution::PrivateOpen(const char *cmdstring,
       return 0;
       }
     }
-  else 
+  else
     {
     if (!RealPopenCreateProcess(cmdstring,
                                 path,
@@ -852,15 +852,15 @@ bool cmWin32ProcessExecution::PrivateClose(int /* timeout */)
         break;
         }
       }
-    }  
+    }
+
 
-  
   if (WaitForSingleObject(hProcess, INFINITE) != WAIT_FAILED &&
-      GetExitCodeProcess(hProcess, &exit_code)) 
+      GetExitCodeProcess(hProcess, &exit_code))
     {
     result = exit_code;
-    } 
-  else 
+    }
+  else
     {
     /* Indicate failure - this will cause the file object
      * to raise an I/O error and translate the last Win32
@@ -868,7 +868,7 @@ bool cmWin32ProcessExecution::PrivateClose(int /* timeout */)
      * last errors that overlap the normal errno table,
      * but that's a consistent problem with the file object.
      */
-    if (result != EOF) 
+    if (result != EOF)
       {
       /* If the error wasn't from the fclose(), then
        * set errno for the file object error handling.
@@ -897,7 +897,7 @@ int cmWin32ProcessExecution::Windows9xHack(const char* command)
   PROCESS_INFORMATION pi;
   DWORD exit_code=0;
 
-  if (!command) 
+  if (!command)
     {
     cmSystemTools::Error("Windows9xHack: Command not specified");
     return 1;
@@ -911,7 +911,7 @@ int cmWin32ProcessExecution::Windows9xHack(const char* command)
   si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
   si.hStdError = GetStdHandle(STD_ERROR_HANDLE);
 
-  
+
   char * app = 0;
   char* cmd = new char[ strlen(command) + 1 ];
   strcpy(cmd, command);
@@ -925,9 +925,9 @@ int cmWin32ProcessExecution::Windows9xHack(const char* command)
     );
   delete [] cmd;
 
-  if (bRet) 
+  if (bRet)
     {
-    if (WaitForSingleObject(pi.hProcess, INFINITE) != WAIT_FAILED) 
+    if (WaitForSingleObject(pi.hProcess, INFINITE) != WAIT_FAILED)
       {
       GetExitCodeProcess(pi.hProcess, &exit_code);
       }
diff --git a/Source/cmWin32ProcessExecution.h b/Source/cmWin32ProcessExecution.h
index def69a8cc..98b6bda98 100644
--- a/Source/cmWin32ProcessExecution.h
+++ b/Source/cmWin32ProcessExecution.h
@@ -47,12 +47,12 @@ public:
   ~cmWin32ProcessExecution();
   ///! If true windows will be created hidden.
   void SetHideWindows(bool v) { this->HideWindows = v;  }
-  
+
   /**
    * Initialize the process execution datastructure. Do not call while
    * running the process.
    */
-  void Initialize() 
+  void Initialize()
     {
     this->ProcessHandle = 0;
     this->ExitValue    = -1;
@@ -65,7 +65,7 @@ public:
     this->pStdOut =  -1;
     this->pStdErr =  -1;
     }
-  
+
   /**
    * Start the process in the directory path. Make sure that the
    * executable is either in the path or specify the full path. The
@@ -129,10 +129,10 @@ public:
    * process. Every time there is something availabe for reading, we
    * will display it in our app. Consequently, we check for input in
    * our app and send it off to the write end of the stdin pipe.
-   */ 
-  static bool BorlandRunCommand(const char* command, 
-                                const char* dir, 
-                                std::string& output, int& retVal, 
+   */
+  static bool BorlandRunCommand(const char* command,
+                                const char* dir,
+                                std::string& output, int& retVal,
                                 bool verbose,
                                 int timeout, bool hideWindows);
 
@@ -151,8 +151,8 @@ private:
   HANDLE hChildStdinWrDup;
   HANDLE hChildStdoutRdDup;
   HANDLE hChildStderrRdDup;
-  
-  
+
+
   int pStdIn;
   int pStdOut;
   int pStdErr;
diff --git a/Source/cmWriteFileCommand.cxx b/Source/cmWriteFileCommand.cxx
index b2acb2bc1..3642c6fba 100644
--- a/Source/cmWriteFileCommand.cxx
+++ b/Source/cmWriteFileCommand.cxx
@@ -71,7 +71,7 @@ bool cmWriteFileCommand
     }
   // If GetPermissions fails, pretend like it is ok. File open will fail if
   // the file is not writable
-  std::ofstream file(fileName.c_str(), 
+  std::ofstream file(fileName.c_str(),
                      overwrite?std::ios::out : std::ios::app);
   if ( !file )
     {
diff --git a/Source/cmWriteFileCommand.h b/Source/cmWriteFileCommand.h
index 8808d32bb..771ef5a1b 100644
--- a/Source/cmWriteFileCommand.h
+++ b/Source/cmWriteFileCommand.h
@@ -24,7 +24,7 @@ public:
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmWriteFileCommand;
     }
@@ -53,7 +53,7 @@ public:
     {
     return "Deprecated. Use the file(WRITE ) command instead.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -71,7 +71,7 @@ public:
       "lead to an infinite loop. Use configure_file if you want to generate "
       "input files to CMake.";
     }
-  
+
   /** This command is kept for compatibility with older CMake versions. */
   virtual bool IsDiscouraged() const
     {
diff --git a/Source/cmXCode21Object.cxx b/Source/cmXCode21Object.cxx
index c679cd8bf..855e1ad2f 100644
--- a/Source/cmXCode21Object.cxx
+++ b/Source/cmXCode21Object.cxx
@@ -79,20 +79,20 @@ void cmXCode21Object::PrintList(std::vector<cmXCodeObject*> const& v,
   cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXBuildStyle);
   cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXContainerItemProxy);
   cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXFileReference);
-  cmXCode21Object::PrintList(v, out, 
+  cmXCode21Object::PrintList(v, out,
                              cmXCode21Object::PBXFrameworksBuildPhase);
   cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXGroup);
   cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXHeadersBuildPhase);
   cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXNativeTarget);
   cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXProject);
-  cmXCode21Object::PrintList(v, out, 
+  cmXCode21Object::PrintList(v, out,
                              cmXCode21Object::PBXShellScriptBuildPhase);
   cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXResourcesBuildPhase);
   cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXSourcesBuildPhase);
   cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXCopyFilesBuildPhase);
-  cmXCode21Object::PrintList(v, out, 
+  cmXCode21Object::PrintList(v, out,
                              cmXCode21Object::PBXApplicationReference);
-  cmXCode21Object::PrintList(v, out, 
+  cmXCode21Object::PrintList(v, out,
                              cmXCode21Object::PBXExecutableFileReference);
   cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXLibraryReference);
   cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXToolTarget);
diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx
index 30ade9637..de150ee0f 100644
--- a/Source/cmXCodeObject.cxx
+++ b/Source/cmXCodeObject.cxx
@@ -16,13 +16,13 @@
 
 //----------------------------------------------------------------------------
 const char* cmXCodeObject::PBXTypeNames[] = {
-    "PBXGroup", "PBXBuildStyle", "PBXProject", "PBXHeadersBuildPhase", 
+    "PBXGroup", "PBXBuildStyle", "PBXProject", "PBXHeadersBuildPhase",
     "PBXSourcesBuildPhase", "PBXFrameworksBuildPhase", "PBXNativeTarget",
-    "PBXFileReference", "PBXBuildFile", "PBXContainerItemProxy", 
-    "PBXTargetDependency", "PBXShellScriptBuildPhase", 
+    "PBXFileReference", "PBXBuildFile", "PBXContainerItemProxy",
+    "PBXTargetDependency", "PBXShellScriptBuildPhase",
     "PBXResourcesBuildPhase", "PBXApplicationReference",
     "PBXExecutableFileReference", "PBXLibraryReference", "PBXToolTarget",
-    "PBXLibraryTarget", "PBXAggregateTarget", "XCBuildConfiguration", 
+    "PBXLibraryTarget", "PBXAggregateTarget", "XCBuildConfiguration",
     "XCConfigurationList",
     "PBXCopyFilesBuildPhase",
     "None"
@@ -92,7 +92,7 @@ void cmXCodeObject::Print(std::ostream& out)
 {
   std::string separator = "\n";
   int indentFactor = 1;
-  if(this->Version > 15 
+  if(this->Version > 15
      && (this->IsA == PBXFileReference || this->IsA == PBXBuildFile))
     {
     separator = " ";
@@ -112,12 +112,12 @@ void cmXCodeObject::Print(std::ostream& out)
   std::map<cmStdString, cmXCodeObject*>::iterator i;
   cmXCodeObject::Indent(3*indentFactor, out);
   out << "isa = " << PBXTypeNames[this->IsA]  << ";" << separator;
-  for(i = this->ObjectAttributes.begin(); 
+  for(i = this->ObjectAttributes.begin();
       i != this->ObjectAttributes.end(); ++i)
-    { 
+    {
     cmXCodeObject* object = i->second;
     if(i->first != "isa")
-      { 
+      {
       cmXCodeObject::Indent(3*indentFactor, out);
       }
     else
@@ -133,7 +133,7 @@ void cmXCodeObject::Print(std::ostream& out)
         out << i->second->List[k]->Id << " ";
         i->second->List[k]->PrintComment(out);
         out << "," << separator;
-        } 
+        }
       cmXCodeObject::Indent(3*indentFactor, out);
       out << ");" << separator;
       }
@@ -141,7 +141,7 @@ void cmXCodeObject::Print(std::ostream& out)
       {
       std::map<cmStdString, cmXCodeObject*>::iterator j;
       out << i->first << " = {" << separator;
-      for(j = object->ObjectAttributes.begin(); j != 
+      for(j = object->ObjectAttributes.begin(); j !=
             object->ObjectAttributes.end(); ++j)
         {
         cmXCodeObject::Indent(4 *indentFactor, out);
@@ -209,11 +209,11 @@ void cmXCodeObject::Print(std::ostream& out)
   cmXCodeObject::Indent(2*indentFactor, out);
   out << "};\n";
 }
-  
+
 //----------------------------------------------------------------------------
 void cmXCodeObject::PrintList(std::vector<cmXCodeObject*> const& objs,
                               std::ostream& out)
-{ 
+{
   cmXCodeObject::Indent(1, out);
   out << "objects = {\n";
   for(unsigned int i = 0; i < objs.size(); ++i)
diff --git a/Source/cmXCodeObject.h b/Source/cmXCodeObject.h
index 2fb96f30e..bb2d5b225 100644
--- a/Source/cmXCodeObject.h
+++ b/Source/cmXCodeObject.h
@@ -19,13 +19,13 @@ class cmXCodeObject
 {
 public:
   enum Type { OBJECT_LIST, STRING, ATTRIBUTE_GROUP, OBJECT_REF, OBJECT };
-  enum PBXType { PBXGroup, PBXBuildStyle, PBXProject, PBXHeadersBuildPhase, 
-                 PBXSourcesBuildPhase, PBXFrameworksBuildPhase, 
-                 PBXNativeTarget, PBXFileReference, PBXBuildFile, 
+  enum PBXType { PBXGroup, PBXBuildStyle, PBXProject, PBXHeadersBuildPhase,
+                 PBXSourcesBuildPhase, PBXFrameworksBuildPhase,
+                 PBXNativeTarget, PBXFileReference, PBXBuildFile,
                  PBXContainerItemProxy, PBXTargetDependency,
                  PBXShellScriptBuildPhase, PBXResourcesBuildPhase,
-                 PBXApplicationReference, PBXExecutableFileReference, 
-                 PBXLibraryReference, PBXToolTarget, PBXLibraryTarget, 
+                 PBXApplicationReference, PBXExecutableFileReference,
+                 PBXLibraryReference, PBXToolTarget, PBXLibraryTarget,
                  PBXAggregateTarget,XCBuildConfiguration,XCConfigurationList,
                  PBXCopyFilesBuildPhase,
                  None
@@ -38,16 +38,16 @@ public:
   PBXType GetIsA() { return this->IsA;}
 
   void SetString(const char* s);
-  const char* GetString() 
+  const char* GetString()
     {
       return this->String.c_str();
     }
-  
+
   void AddAttribute(const char* name, cmXCodeObject* value)
     {
       this->ObjectAttributes[name] = value;
     }
-  
+
   void SetObject(cmXCodeObject* value)
     {
       this->Object = value;
@@ -60,14 +60,14 @@ public:
     {
       this->List.push_back(value);
     }
-  bool HasObject(cmXCodeObject* o) 
+  bool HasObject(cmXCodeObject* o)
   {
-    return !(std::find(this->List.begin(), this->List.end(), o) 
+    return !(std::find(this->List.begin(), this->List.end(), o)
              == this->List.end());
   }
   void AddUniqueObject(cmXCodeObject* value)
   {
-    if(std::find(this->List.begin(), this->List.end(), value) 
+    if(std::find(this->List.begin(), this->List.end(), value)
        == this->List.end())
       {
       this->List.push_back(value);
@@ -77,7 +77,7 @@ public:
   void Print(std::ostream& out);
   virtual void PrintComment(std::ostream&) {};
 
-  static void PrintList(std::vector<cmXCodeObject*> const&, 
+  static void PrintList(std::vector<cmXCodeObject*> const&,
                         std::ostream& out);
   const char* GetId()
     {
@@ -119,7 +119,7 @@ public:
         }
       return 0;
     }
-  
+
   cmXCodeObject* GetPBXTargetDependency()
     {
       return this->PBXTargetDependencyValue;
@@ -129,7 +129,7 @@ public:
       this->PBXTargetDependencyValue = d;
     }
   void CopyAttributes(cmXCodeObject* );
-  
+
   void AddDependLibrary(const char* configName,
                         const char* l)
     {
diff --git a/Source/cmXMLParser.cxx b/Source/cmXMLParser.cxx
index 46a1ca4aa..882fc172e 100644
--- a/Source/cmXMLParser.cxx
+++ b/Source/cmXMLParser.cxx
@@ -34,7 +34,7 @@ cmXMLParser::~cmXMLParser()
 int cmXMLParser::Parse(const char* string)
 {
   return (int)this->InitializeParser() &&
-    this->ParseChunk(string, strlen(string)) && 
+    this->ParseChunk(string, strlen(string)) &&
     this->CleanupParser();
 }
 
@@ -79,7 +79,7 @@ int cmXMLParser::InitializeParser()
 }
 
 //----------------------------------------------------------------------------
-int cmXMLParser::ParseChunk(const char* inputString, 
+int cmXMLParser::ParseChunk(const char* inputString,
                             std::string::size_type length)
 {
   if ( !this->Parser )
@@ -116,11 +116,11 @@ int cmXMLParser::CleanupParser()
       result = 0;
       }
     }
-  
+
   // Clean up the parser.
   XML_ParserFree(static_cast<XML_Parser>(this->Parser));
   this->Parser = 0;
-  
+
   return result;
 }
 
@@ -128,7 +128,7 @@ int cmXMLParser::CleanupParser()
 int cmXMLParser::ParseBuffer(const char* buffer, std::string::size_type count)
 {
   // Pass the buffer to the expat XML parser.
-  if(!XML_Parse(static_cast<XML_Parser>(this->Parser), buffer, 
+  if(!XML_Parse(static_cast<XML_Parser>(this->Parser), buffer,
                 static_cast<int>(count), 0))
     {
     this->ReportXmlParseError();
diff --git a/Source/cmXMLParser.h b/Source/cmXMLParser.h
index c72be5751..d916075e5 100644
--- a/Source/cmXMLParser.h
+++ b/Source/cmXMLParser.h
@@ -18,7 +18,7 @@ extern "C"
 {
   void cmXMLParserStartElement(void*, const char*, const char**);
   void cmXMLParserEndElement(void*, const char*);
-  void cmXMLParserCharacterDataHandler(void*, const char*, int);  
+  void cmXMLParserCharacterDataHandler(void*, const char*, int);
 }
 
 /** \class cmXMLParser
@@ -37,7 +37,7 @@ public:
 
   //! Parse given XML file
   virtual int ParseFile(const char* file);
-  
+
   /**
    * When parsing fragments of XML or streaming XML, use the following
    * three methods.  InitializeParser method initialize parser but does
@@ -47,7 +47,7 @@ public:
    * them.
    */
   virtual int InitializeParser();
-  virtual int ParseChunk(const char* inputString, 
+  virtual int ParseChunk(const char* inputString,
                          std::string::size_type length);
   virtual int CleanupParser();
 
@@ -65,7 +65,7 @@ protected:
    * terminating condition for parsing.  Parsing always stops when the end of
    * file is reached in the stream.
    */
-  
+
   virtual int ParsingComplete();
 
   /**
@@ -75,28 +75,28 @@ protected:
    * Even indices are attribute names, and odd indices are values.
    */
   virtual void StartElement(const char* name, const char** atts);
-  
+
   //! Called at the end of an element in the XML source opened when
   //StartElement was called.
   virtual void EndElement(const char* name);
-  
+
   //! Called when there is character data to handle.
-  virtual void CharacterDataHandler(const char* data, int length);  
+  virtual void CharacterDataHandler(const char* data, int length);
 
   //! Called by Parse to report an XML syntax error.
-  virtual void ReportXmlParseError();  
+  virtual void ReportXmlParseError();
 
   /** Called by ReportXmlParseError with basic error info.  */
   virtual void ReportError(int line, int column, const char* msg);
 
   //! Utility for convenience of subclasses.  Wraps isspace C library
   // routine.
-  static int IsSpace(char c);  
-  
+  static int IsSpace(char c);
+
   //! Send the given buffer to the XML parser.
-  virtual int ParseBuffer(const char* buffer, 
+  virtual int ParseBuffer(const char* buffer,
                           std::string::size_type length);
-  
+
   //! Send the given c-style string to the XML parser.
   int ParseBuffer(const char* buffer);
 
diff --git a/Source/cmakewizard.cxx b/Source/cmakewizard.cxx
index cd427cb40..749f669d0 100644
--- a/Source/cmakewizard.cxx
+++ b/Source/cmakewizard.cxx
@@ -137,7 +137,7 @@ int cmakewizard::RunWizard(std::vector<std::string> const& args)
           }
         }
       else
-        {    
+        {
         if(this->ShowAdvanced || !i.GetPropertyAsBool("ADVANCED"))
           {
           this->AskUser(key.c_str(), i);
diff --git a/Source/cmakewizard.h b/Source/cmakewizard.h
index fcb2c7ae2..0c8dba93c 100644
--- a/Source/cmakewizard.h
+++ b/Source/cmakewizard.h
@@ -18,24 +18,24 @@ class cmakewizard
 public:
   cmakewizard();
   virtual ~cmakewizard() {}
-  /** 
+  /**
    * Prompt the user to see if they want to see advanced entries.
    */
   virtual bool AskAdvanced();
-  
+
   /**
    * Prompt the User for a new value for key, the answer is put in entry.
    */
   virtual void AskUser(const char* key, cmCacheManager::CacheIterator& iter);
   ///! Show a message to wait for cmake to run.
   virtual void ShowMessage(const char*);
-  
-  /**  
-   *  Run cmake in wizard mode.  This will coninue to ask the user questions 
+
+  /**
+   *  Run cmake in wizard mode.  This will coninue to ask the user questions
    *  until there are no more entries in the cache.
    */
   int RunWizard(std::vector<std::string>const& args);
-  
+
 private:
   bool ShowAdvanced;
 };
diff --git a/Source/cmakexbuild.cxx b/Source/cmakexbuild.cxx
index 8eaae4795..9aaeeaa4d 100644
--- a/Source/cmakexbuild.cxx
+++ b/Source/cmakexbuild.cxx
@@ -33,7 +33,7 @@ int RunXCode(std::vector<const char*>& argv, bool& hitbug)
   int pipe = cmSystemTools::WaitForLine(cp, line, 100.0, out, err);
   while(pipe != cmsysProcess_Pipe_None)
     {
-    if(line.find("/bin/sh: bad interpreter: Text file busy") 
+    if(line.find("/bin/sh: bad interpreter: Text file busy")
        != line.npos)
       {
       hitbug = true;
@@ -69,7 +69,7 @@ int RunXCode(std::vector<const char*>& argv, bool& hitbug)
 }
 
 int main(int ac, char*av[])
-{ 
+{
   std::vector<const char*> argv;
   argv.push_back("xcodebuild");
   for(int i =1; i < ac; i++)
diff --git a/Source/cmparseMSBuildXML.py b/Source/cmparseMSBuildXML.py
index 4877e5913..a0c7ec44a 100755
--- a/Source/cmparseMSBuildXML.py
+++ b/Source/cmparseMSBuildXML.py
@@ -9,7 +9,7 @@
 #
 #  BoolProperty  <Name>true|false</Name>
 #   simple example:
-#     <BoolProperty ReverseSwitch="Oy-" Name="OmitFramePointers" 
+#     <BoolProperty ReverseSwitch="Oy-" Name="OmitFramePointers"
 #      Category="Optimization" Switch="Oy">
 #   <BoolProperty.DisplayName>  <BoolProperty.Description>
 # <CLCompile>
@@ -67,7 +67,7 @@
 #     <Optimization>MaxSpeed</Optimization>
 #     example for O1 would be this:
 #     <Optimization>MinSpace</Optimization>
-# 
+#
 #  StringListProperty
 #   <StringListProperty Name="PreprocessorDefinitions" Category="Preprocessor" Switch="D ">
 #     <StringListProperty.DisplayName>
@@ -130,7 +130,7 @@ class Property:
     if document is not None:
       self.populate(document)
     pass
-   
+
   #document = the dom file that's root node is the Property node (ex. if you were parsing a BoolProperty the root node should be something like <BoolProperty Name="RegisterOutput" Category="General" IncludeInCommandLine="false">
   #spaces = do not use
   def populate(self,document, spaces = ""):
@@ -155,9 +155,9 @@ class Property:
       self.populate(child,spaces+"----")
       pass
 
-  #toString function 
+  #toString function
   def __str__(self):
-    toReturn = self.prefix_type+self.suffix_type+":" 
+    toReturn = self.prefix_type+self.suffix_type+":"
     for i in self.attributeNames:
       toReturn += "\n    "+i+": "+self.attributes[i]
     if self.argumentProperty != "":
@@ -191,7 +191,7 @@ class MSBuildToCMake:
   #        self.<Name>Properties.append(Property("<Name>",[<List of attributes>],child))
   #
   #Replace <Name> with the name of the new property (ex. if property is StringProperty replace <Name> with String)
-  #Replace <List of attributes> with a list of attributes in your property's root node 
+  #Replace <List of attributes> with a list of attributes in your property's root node
   #in the __init__ function add the line self.<Name>Properties = []
   #
   #That is all that is required to add new properties
@@ -236,7 +236,7 @@ class MSBuildToCMake:
       for j in lastProp.values:
           toReturn+="  {\""+lastProp.attributes["Name"]+"\", \""+j.attributes["Switch"]+"\",\n   \""+j.DisplayName+"\", \""+j.attributes["Name"]+"\", 0},\n"
       toReturn += "\n"
-    
+
     toReturn += "\n  //Bool Properties\n"
     for i in self.boolProperties:
       if i.argumentProperty == "":
@@ -254,7 +254,7 @@ class MSBuildToCMake:
         if i.attributes["Switch"] != "":
           toReturn += "  {\""+i.attributes["Name"]+"\", \""+i.attributes["Switch"]+"\", \"\", \"true\",\n   cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue},\n"
           toReturn += "  {\""+i.argumentProperty+"\", \""+i.attributes["Switch"]+"\", \""+i.DisplayName+"\", \"\",\n   cmVS7FlagTable::UserValueRequired},\n"
-    
+
     toReturn += "\n  //String List Properties\n"
     for i in self.stringListProperties:
       if i.attributes["Switch"] == "":
@@ -289,7 +289,7 @@ class MSBuildToCMake:
     for p in allList:
       for i in p:
         toReturn += "==================================================\n"+str(i).replace("\n","\n    ")+"\n==================================================\n"
-    
+
     return toReturn
 ###########################################################################################
 
@@ -305,8 +305,8 @@ def main(argv):
   for i in range(0,len(argv)):
     if argv[i] == "-x":
       xml_file = argv[i+1]
-    if argv[i] == "-h": 
-      print help 
+    if argv[i] == "-h":
+      print help
       sys.exit(0)
     pass
   if xml_file == None:
diff --git a/Source/cmw9xcom.cxx b/Source/cmw9xcom.cxx
index 4ba274965..e6014b325 100644
--- a/Source/cmw9xcom.cxx
+++ b/Source/cmw9xcom.cxx
@@ -22,7 +22,7 @@ int main (int argc, char *argv[])
     return 1;
     }
   std::string arg = argv[1];
-  if ( (arg.find_first_of(" ") != arg.npos) && 
+  if ( (arg.find_first_of(" ") != arg.npos) &&
        (arg.find_first_of("\"") == arg.npos) )
     {
     arg = "\"" + arg + "\"";
@@ -32,7 +32,7 @@ int main (int argc, char *argv[])
   for ( cc = 2; cc < argc; cc ++ )
     {
     std::string arg = argv[cc];
-    if ( (arg.find_first_of(" ") != arg.npos) && 
+    if ( (arg.find_first_of(" ") != arg.npos) &&
          (arg.find_first_of("\"") == arg.npos) )
       {
       arg = "\"" + arg + "\"";
diff --git a/Templates/CMakeVisualStudio6Configurations.cmake b/Templates/CMakeVisualStudio6Configurations.cmake
index a9db2eeba..b8e797427 100644
--- a/Templates/CMakeVisualStudio6Configurations.cmake
+++ b/Templates/CMakeVisualStudio6Configurations.cmake
@@ -1,3 +1,3 @@
-# When the dll templates are changed, this list should be 
+# When the dll templates are changed, this list should be
 # updated with the list of possible configurations.
 SET(CMAKE_CONFIGURATION_TYPES Debug Release MinSizeRel RelWithDebInfo)
diff --git a/Templates/TestDriver.cxx.in b/Templates/TestDriver.cxx.in
index 9e5303004..f4510bb55 100644
--- a/Templates/TestDriver.cxx.in
+++ b/Templates/TestDriver.cxx.in
@@ -64,7 +64,7 @@ int main(int ac, char *av[])
   int testToRun = -1;
 
   @CMAKE_TESTDRIVER_ARGVC_FUNCTION@
-    
+
   for(count =0; cmakeGeneratedFunctionMapEntries[count].name != 0; count++)
     {
     }
@@ -141,8 +141,8 @@ int main(int ac, char *av[])
 @CMAKE_TESTDRIVER_AFTER_TESTMAIN@
     return result;
     }
-  
-  
+
+
   /* Nothing was run, display the test names.  */
   printf("Available tests:\n");
   for (i =0; i < NumTests; ++i)
@@ -150,6 +150,6 @@ int main(int ac, char *av[])
     printf("%3d. %s\n", i, cmakeGeneratedFunctionMapEntries[i].name);
     }
   printf("Failed: %s is an invalid test name.\n", av[1]);
-  
+
   return -1;
 }
diff --git a/Templates/cygwin-package.sh.in b/Templates/cygwin-package.sh.in
index 8482e7e4d..69b6c0f6f 100755
--- a/Templates/cygwin-package.sh.in
+++ b/Templates/cygwin-package.sh.in
@@ -10,11 +10,11 @@ TOP_DIR=`cd \`echo "$0" | sed -n '/\//{s/\/[^\/]*$//;p;}'\`;pwd`
 mkdirs()
 {
   (
-  mkdir -p "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build" 
+  mkdir -p "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build"
   )
 }
 
-# cd into 
+# cd into
 # untar source tree and apply patch
 prep()
 {
@@ -31,7 +31,7 @@ prep()
 conf()
 {
   (
-  cd "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build" && 
+  cd "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build" &&
   cmake ..
   )
 }
@@ -60,8 +60,8 @@ pkg()
 {
   (
   cd "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build" &&
-  cpack && 
-  mv @CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.tar.bz2 "$TOP_DIR"     
+  cpack &&
+  mv @CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.tar.bz2 "$TOP_DIR"
   )
 }
 
@@ -71,7 +71,7 @@ spkg()
  (
   cd "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build" &&
   cpack --config  CPackSourceConfig.cmake &&
-  mv @CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@-src.tar.bz2 "$TOP_DIR" 
+  mv @CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@-src.tar.bz2 "$TOP_DIR"
   )
 }
 
diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt
index 5e36d11b4..045acb8c0 100644
--- a/Tests/BuildDepends/CMakeLists.txt
+++ b/Tests/BuildDepends/CMakeLists.txt
@@ -1,9 +1,9 @@
 # this test creates a static library and an executable
-# the source to the library is then changed 
+# the source to the library is then changed
 # and the build is done on the executable and if things
 # are working the executable should relink with the new
 # value.  The subdir Project contains the CMakelists.txt
-# and source files for the test project. 
+# and source files for the test project.
 cmake_minimum_required (VERSION 2.6)
 project(BuildDepends)
 
@@ -48,7 +48,7 @@ list(APPEND _cmake_options "-DCMAKE_FORCE_DEPFILES=1")
 
 file(MAKE_DIRECTORY ${BuildDepends_BINARY_DIR}/Project)
 message("Creating Project/foo.cxx")
-write_file(${BuildDepends_BINARY_DIR}/Project/foo.cxx 
+write_file(${BuildDepends_BINARY_DIR}/Project/foo.cxx
   "const char* foo() { return \"foo\";}" )
 
 file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot.hxx.in
@@ -63,19 +63,19 @@ file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot_macro_tgt.hxx
 help_xcode_depends()
 
 message("Building project first time")
-try_compile(RESULT 
+try_compile(RESULT
   ${BuildDepends_BINARY_DIR}/Project
   ${BuildDepends_SOURCE_DIR}/Project
   testRebuild
   CMAKE_FLAGS ${_cmake_options}
   OUTPUT_VARIABLE OUTPUT)
 if(HELP_XCODE)
-  try_compile(RESULT 
+  try_compile(RESULT
     ${BuildDepends_BINARY_DIR}/Project
     ${BuildDepends_SOURCE_DIR}/Project
     testRebuild
     OUTPUT_VARIABLE OUTPUT)
-  try_compile(RESULT 
+  try_compile(RESULT
     ${BuildDepends_BINARY_DIR}/Project
     ${BuildDepends_SOURCE_DIR}/Project
     testRebuild
@@ -88,20 +88,20 @@ if(NOT RESULT)
 endif(NOT RESULT)
 
 set(bar ${BuildDepends_BINARY_DIR}/Project/bar${CMAKE_EXECUTABLE_SUFFIX})
-if(EXISTS 
+if(EXISTS
     "${BuildDepends_BINARY_DIR}/Project/Debug/bar${CMAKE_EXECUTABLE_SUFFIX}" )
   message("found debug")
-  set(bar 
+  set(bar
     "${BuildDepends_BINARY_DIR}/Project/Debug/bar${CMAKE_EXECUTABLE_SUFFIX}")
-endif(EXISTS 
+endif(EXISTS
   "${BuildDepends_BINARY_DIR}/Project/Debug/bar${CMAKE_EXECUTABLE_SUFFIX}")
 set(zot ${BuildDepends_BINARY_DIR}/Project/zot${CMAKE_EXECUTABLE_SUFFIX})
-if(EXISTS 
+if(EXISTS
     "${BuildDepends_BINARY_DIR}/Project/Debug/zot${CMAKE_EXECUTABLE_SUFFIX}" )
   message("found debug")
-  set(zot 
+  set(zot
     "${BuildDepends_BINARY_DIR}/Project/Debug/zot${CMAKE_EXECUTABLE_SUFFIX}")
-endif(EXISTS 
+endif(EXISTS
   "${BuildDepends_BINARY_DIR}/Project/Debug/zot${CMAKE_EXECUTABLE_SUFFIX}")
 
 message("Running ${bar}  ")
@@ -150,7 +150,7 @@ endif()
 help_xcode_depends()
 
 message("Building project second time")
-try_compile(RESULT 
+try_compile(RESULT
   ${BuildDepends_BINARY_DIR}/Project
   ${BuildDepends_SOURCE_DIR}/Project
   testRebuild
@@ -159,12 +159,12 @@ try_compile(RESULT
 
 # Xcode is in serious need of help here
 if(HELP_XCODE OR HELP_NINJA)
-  try_compile(RESULT 
+  try_compile(RESULT
     ${BuildDepends_BINARY_DIR}/Project
     ${BuildDepends_SOURCE_DIR}/Project
     testRebuild
     OUTPUT_VARIABLE OUTPUT)
-  try_compile(RESULT 
+  try_compile(RESULT
     ${BuildDepends_BINARY_DIR}/Project
     ${BuildDepends_SOURCE_DIR}/Project
     testRebuild
@@ -175,15 +175,15 @@ message("Output from second build:\n${OUTPUT}")
 if(NOT RESULT)
   message(SEND_ERROR "Could not build test project (2)!")
 endif(NOT RESULT)
-if(EXISTS 
+if(EXISTS
     "${BuildDepends_BINARY_DIR}/Project/Debug/bar${CMAKE_EXECUTABLE_SUFFIX}" )
   message("found debug")
-endif(EXISTS 
+endif(EXISTS
   "${BuildDepends_BINARY_DIR}/Project/Debug/bar${CMAKE_EXECUTABLE_SUFFIX}")
-if(EXISTS 
+if(EXISTS
     "${BuildDepends_BINARY_DIR}/Project/Debug/zot${CMAKE_EXECUTABLE_SUFFIX}" )
   message("found debug")
-endif(EXISTS 
+endif(EXISTS
   "${BuildDepends_BINARY_DIR}/Project/Debug/zot${CMAKE_EXECUTABLE_SUFFIX}")
 
 message("Running ${bar}  ")
diff --git a/Tests/CMakeBuildTest.cmake.in b/Tests/CMakeBuildTest.cmake.in
index a8bb75090..02206deba 100644
--- a/Tests/CMakeBuildTest.cmake.in
+++ b/Tests/CMakeBuildTest.cmake.in
@@ -7,10 +7,10 @@ make_directory("@CMAKE_BUILD_TEST_BINARY_DIR@")
 message("Remove: @CMAKE_BUILD_TEST_SOURCE_DIR@/CMakeCache.txt")
 file(REMOVE "@CMAKE_BUILD_TEST_SOURCE_DIR@/CMakeCache.txt")
 
-# run cmake in the binary directory 
+# run cmake in the binary directory
 message("running: ${CMAKE_COMMAND}")
 execute_process(COMMAND "${CMAKE_COMMAND}"
-  "@CMAKE_BUILD_TEST_SOURCE_DIR@"  
+  "@CMAKE_BUILD_TEST_SOURCE_DIR@"
   "-G@CMAKE_TEST_GENERATOR@"
   WORKING_DIRECTORY "@CMAKE_BUILD_TEST_BINARY_DIR@"
   RESULT_VARIABLE RESULT)
@@ -20,7 +20,7 @@ endif(RESULT)
 
 # Now use the --build option to build the project
 message("running: ${CMAKE_COMMAND} --build")
-execute_process(COMMAND "${CMAKE_COMMAND}" 
+execute_process(COMMAND "${CMAKE_COMMAND}"
   --build "@CMAKE_BUILD_TEST_BINARY_DIR@" --config Debug
   RESULT_VARIABLE RESULT)
 if(RESULT)
@@ -29,7 +29,7 @@ endif(RESULT)
 
 # check for configuration types
 set(CMAKE_CONFIGURATION_TYPES @CMAKE_CONFIGURATION_TYPES@)
-# run the executable out of the Debug directory if there 
+# run the executable out of the Debug directory if there
 # are configuration types
 if(CMAKE_CONFIGURATION_TYPES)
   set(RUN_TEST "@CMAKE_BUILD_TEST_BINARY_DIR@/Debug/@CMAKE_BUILD_TEST_EXE@")
@@ -44,15 +44,15 @@ if(RESULT)
 endif(RESULT)
 
 # build it again with clean and only @CMAKE_BUILD_TEST_EXE@ target
-execute_process(COMMAND "${CMAKE_COMMAND}" 
-  --build "@CMAKE_BUILD_TEST_BINARY_DIR@" --config Debug 
+execute_process(COMMAND "${CMAKE_COMMAND}"
+  --build "@CMAKE_BUILD_TEST_BINARY_DIR@" --config Debug
   --clean-first --target @CMAKE_BUILD_TEST_EXE@
   RESULT_VARIABLE RESULT)
 if(RESULT)
   message(FATAL_ERROR "Error running cmake --build")
 endif(RESULT)
 
-# run it again after clean 
+# run it again after clean
 execute_process(COMMAND "${RUN_TEST}" RESULT_VARIABLE RESULT)
 if(RESULT)
   message(FATAL_ERROR "Error running test @CMAKE_BUILD_TEST_EXE@ after clean ")
diff --git a/Tests/CMakeTests/ToolchainTest.cmake.in b/Tests/CMakeTests/ToolchainTest.cmake.in
index e4a2e4813..179945646 100644
--- a/Tests/CMakeTests/ToolchainTest.cmake.in
+++ b/Tests/CMakeTests/ToolchainTest.cmake.in
@@ -55,7 +55,7 @@ set(CMAKE_HOST_SYSTEM_PROCESSOR)
 
 ############################################################
 
-# now define a toolchain file and check that everything is 
+# now define a toolchain file and check that everything is
 # detected correctly and nothing predefined is overwritten
 
 set(CMAKE_TOOLCHAIN_FILE "${MY_SOURCE_DIR}/DummyToolchain.cmake")
diff --git a/Tests/COnly/libc2.h b/Tests/COnly/libc2.h
index a99d8984e..2713d71ae 100644
--- a/Tests/COnly/libc2.h
+++ b/Tests/COnly/libc2.h
@@ -5,7 +5,7 @@
 #    define CM_TEST_LIB_EXPORT  __declspec( dllimport )
 #  endif
 #else
-#  define CM_TEST_LIB_EXPORT 
+#  define CM_TEST_LIB_EXPORT
 #endif
 
 CM_TEST_LIB_EXPORT float LibC2Func();
diff --git a/Tests/CPackComponents/CMakeLists.txt b/Tests/CPackComponents/CMakeLists.txt
index 58f5bdffe..1cb86696a 100644
--- a/Tests/CPackComponents/CMakeLists.txt
+++ b/Tests/CPackComponents/CMakeLists.txt
@@ -36,7 +36,7 @@ endif()
 # Create installation targets. Note that we put each kind of file
 # into a different component via COMPONENT. These components will
 # be used to create the installation components.
-install(TARGETS mylib 
+install(TARGETS mylib
   ARCHIVE
   DESTINATION lib
   COMPONENT libraries)
diff --git a/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in b/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in
index 0c4394faa..7731710b4 100644
--- a/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in
+++ b/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in
@@ -7,7 +7,7 @@ if (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "${CMAKE_CMAKE_SYSTEM_NAME}")
    message(FATAL_ERROR "Error: CMAKE_SYSTEM_NAME is \"${CMAKE_SYSTEM_NAME}\", but should be \"@CMAKE_SYSTEM_NAME@\"")
 endif(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "${CMAKE_CMAKE_SYSTEM_NAME}")
 
-# this seems to be necessary, otherwise ctest complains that these 
+# this seems to be necessary, otherwise ctest complains that these
 # variables are not set:
 set(CTEST_COMMAND "\"@CMAKE_CTEST_COMMAND@\"")
 set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestScriptMode/")
diff --git a/Tests/CTestTest/test.cmake.in b/Tests/CTestTest/test.cmake.in
index eac5eab20..5fede3390 100644
--- a/Tests/CTestTest/test.cmake.in
+++ b/Tests/CTestTest/test.cmake.in
@@ -6,13 +6,13 @@
 # this is the cvs module name that should be checked out
 SET (CTEST_MODULE_NAME SmallAndFast)
 
-# these are the the name of the source and binary directory on disk. 
+# these are the the name of the source and binary directory on disk.
 # They will be appended to DASHBOARD_ROOT
 SET (CTEST_SOURCE_NAME SmallAndFast)
 SET (CTEST_BINARY_NAME SmallAndFastBuild)
 
 # which ctest command to use for running the dashboard
-SET (CTEST_COMMAND 
+SET (CTEST_COMMAND
   "\"${CTEST_EXECUTABLE_NAME}\" --version"
   "\"${CTEST_EXECUTABLE_NAME}\" -D Experimental -A \"${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}\""
   )
@@ -54,7 +54,7 @@ MEMORYCHECK_COMMAND_OPTIONS:STRING=@MEMORYCHECK_COMMAND_OPTIONS@
 COVERAGE_COMMAND:FILEPATH=@COVERAGE_COMMAND@
 ")
 
-# if you do not want to use the default location for a 
+# if you do not want to use the default location for a
 # dashboard then set this variable to the directory
 # the dashboard should be in
 SET (CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@/Tests/CTestTest")
diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt
index ec3ad3985..080428d58 100644
--- a/Tests/Complex/CMakeLists.txt
+++ b/Tests/Complex/CMakeLists.txt
@@ -27,7 +27,7 @@ MACRO(ASSERT value msg)
     MESSAGE ("Assertion failure:" ${msg} )
   ENDIF (NOT ${value})
 ENDMACRO(ASSERT)
- 
+
 # invoke the macro
 ASSERT(Complex_BINARY_DIR "The PROJECT command is broken")
 
@@ -40,7 +40,7 @@ MACRO(TEST_ARGC value1 value2)
     ADD_DEFINITIONS(${ARGV2} ${ARGV3})
   ENDIF (${ARGC} MATCHES 4)
 ENDMACRO(TEST_ARGC)
- 
+
 # invoke the macro
 TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4)
 
@@ -111,7 +111,7 @@ ENDIF(${fooCACHE_TEST_VAR2} MATCHES bar)
 
 
 #
-# Specify include and lib dirs 
+# Specify include and lib dirs
 # (BEFORE is for coverage)
 #
 INCLUDE_DIRECTORIES(
@@ -151,9 +151,9 @@ MESSAGE("\nIgnore this message")
 OPTION(NO_EXEC_PROGRAM "Do not test EXEC_PROGRAM" 0)
 IF (NOT NO_EXEC_PROGRAM)
   EXEC_PROGRAM(${CMAKE_COMMAND} ARGS -E echo NO_EXEC_PROGRAM "${Complex_BINARY_DIR}")
-ELSE (NOT NO_EXEC_PROGRAM) 
+ELSE (NOT NO_EXEC_PROGRAM)
   MESSAGE("Set this option ON")
-ENDIF (NOT NO_EXEC_PROGRAM) 
+ENDIF (NOT NO_EXEC_PROGRAM)
 
 MARK_AS_ADVANCED(NO_EXEC_PROGRAM)
 MARK_AS_ADVANCED(CLEAR NO_EXEC_PROGRAM)
@@ -247,12 +247,12 @@ IF(NOT FIND_DUMMY_STLIB_VERSIONED MATCHES "/libdummylib${CMAKE_STATIC_LIBRARY_SU
 ENDIF()
 
 #
-# Test SET_SOURCE_FILES_PROPERTIES 
+# Test SET_SOURCE_FILES_PROPERTIES
 #
-SET_SOURCE_FILES_PROPERTIES(nonexisting_file2 
-  GENERATED 
-  ABSTRACT 
-  WRAP_EXCLUDE 
+SET_SOURCE_FILES_PROPERTIES(nonexisting_file2
+  GENERATED
+  ABSTRACT
+  WRAP_EXCLUDE
   COMPILE_FLAGS "-foo -bar")
 
 GET_SOURCE_FILE_PROPERTY(FILE_HAS_ABSTRACT nonexisting_file2 ABSTRACT)
@@ -320,7 +320,7 @@ ENDWHILE(while_var LESS 1000)
 SET(SHOULD_BE_ZERO )
 SET(SHOULD_BE_ONE 1)
 
-# test elseif functionality, the mess below tries to catch problem 
+# test elseif functionality, the mess below tries to catch problem
 # of clauses being executed early or late etc
 set (RESULT 3)
 if (RESULT EQUAL 1)
@@ -328,7 +328,7 @@ if (RESULT EQUAL 1)
     set (ELSEIF_RESULT 1)
   elseif (RESULT EQUAL 3)
     set (ELSEIF_RESULT 1)
-  endif (RESULT EQUAL 2)  
+  endif (RESULT EQUAL 2)
 elseif (RESULT EQUAL 2)
   set (ELSEIF_RESULT 1)
 elseif (RESULT EQUAL 3)
@@ -337,20 +337,20 @@ elseif (RESULT EQUAL 3)
   elseif (RESULT EQUAL 3)
     if (NOT ELSEIF_RESULT EQUAL 1)
       set (ELSEIF_RESULT 2)
-    endif (NOT ELSEIF_RESULT EQUAL 1)      
-  endif (RESULT EQUAL 2)  
+    endif (NOT ELSEIF_RESULT EQUAL 1)
+  endif (RESULT EQUAL 2)
 elseif (RESULT EQUAL 4)
   if (RESULT EQUAL 2)
     set (ELSEIF_RESULT 1)
   elseif (RESULT EQUAL 3)
     set (ELSEIF_RESULT 1)
-  endif (RESULT EQUAL 2)  
+  endif (RESULT EQUAL 2)
 else (RESULT  EQUAL 1)
   if (RESULT EQUAL 2)
     set (ELSEIF_RESULT 1)
   elseif (RESULT EQUAL 3)
     set (ELSEIF_RESULT 1)
-  endif (RESULT EQUAL 2)  
+  endif (RESULT EQUAL 2)
 endif (RESULT EQUAL 1)
 
 if (NOT ELSEIF_RESULT EQUAL 2)
@@ -364,7 +364,7 @@ endif()
 
 
 #
-# Configure file 
+# Configure file
 # (plug vars to #define so that they can be tested)
 #
 CONFIGURE_FILE(
diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt
index 345836257..6ccdaf026 100644
--- a/Tests/Complex/Executable/CMakeLists.txt
+++ b/Tests/Complex/Executable/CMakeLists.txt
@@ -1,6 +1,6 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 1.3)
 #
-# Create exe. 
+# Create exe.
 #
 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS")
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS")
@@ -22,7 +22,7 @@ IF(TARGET NotATarget)
   MESSAGE(FATAL_ERROR "IF(TARGET NotATarget) returned true!")
 ENDIF(TARGET NotATarget)
 
-  # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to 
+  # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to
 SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared)
 LINK_LIBRARIES(${COMPLEX_LIBS})
 
diff --git a/Tests/Complex/Executable/Temp/CMakeLists.txt b/Tests/Complex/Executable/Temp/CMakeLists.txt
index f00955029..989765e3a 100644
--- a/Tests/Complex/Executable/Temp/CMakeLists.txt
+++ b/Tests/Complex/Executable/Temp/CMakeLists.txt
@@ -4,5 +4,5 @@
 # The contents of this file is not tested (absolute paths).
 #
 OUTPUT_REQUIRED_FILES(
-   ${Complex_SOURCE_DIR}/Executable/complex.cxx 
-   ${Complex_BINARY_DIR}/Executable/Temp/complex-required.txt)  
+   ${Complex_SOURCE_DIR}/Executable/complex.cxx
+   ${Complex_BINARY_DIR}/Executable/Temp/complex-required.txt)
diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx
index 1901d9914..27d70adc8 100644
--- a/Tests/Complex/Executable/complex.cxx
+++ b/Tests/Complex/Executable/complex.cxx
@@ -33,7 +33,7 @@ int cm_failed = 0;
 
 void cmFailed(const char* Message, const char* m2= "", const char* m3 = "")
 {
-  std::cout << "FAILED: " << Message << m2 << m3 << "\n"; 
+  std::cout << "FAILED: " << Message << m2 << m3 << "\n";
   cm_failed++;
 }
 
@@ -41,7 +41,7 @@ void cmFailed(const char* Message, const char* m2= "", const char* m3 = "")
 
 void cmPassed(const char* Message, const char* m2="")
 {
-  std::cout << "Passed: " << Message << m2 << "\n"; 
+  std::cout << "Passed: " << Message << m2 << "\n";
   cm_passed++;
 }
 
@@ -67,7 +67,7 @@ void cmPassed(const char* Message, const char* m2="")
 
 // ======================================================================
 
-void TestAndRemoveFile(const char* filename) 
+void TestAndRemoveFile(const char* filename)
 {
   struct stat st;
   if(stat(filename, &st) < 0)
@@ -89,7 +89,7 @@ void TestAndRemoveFile(const char* filename)
 
 // ======================================================================
 
-void TestDir(const char* filename) 
+void TestDir(const char* filename)
 {
   struct stat st;
   if(stat(filename, &st) < 0 || !S_ISDIR(st.st_mode))
@@ -113,7 +113,7 @@ void ForceStringUse()
   std::string cachetest = CACHE_TEST_VAR_INTERNAL;
   v.push_back(cachetest);
   v2 = v;
-  std::string x(5,'x');  
+  std::string x(5,'x');
   char buff[5];
   x.copy(buff, 1, 0);
   x[0] = 'a';
@@ -165,7 +165,7 @@ int main()
 #else
   cmPassed("COMPILE_FLAGS did work with SET_TARGET_PROPERTIES");
 #endif
-  
+
 #ifdef ELSEIF_RESULT
   cmPassed("ELSEIF did work");
 #else
@@ -228,8 +228,8 @@ int main()
 #else
   cmPassed("CMAKE_IS_FUN is defined.");
 #endif
-  
-#if defined(CMAKE_ARGV1) && defined(CMAKE_ARGV2) && defined(CMAKE_ARGV3) && defined(CMAKE_ARGV4) 
+
+#if defined(CMAKE_ARGV1) && defined(CMAKE_ARGV2) && defined(CMAKE_ARGV3) && defined(CMAKE_ARGV4)
   cmPassed("Variable args for MACROs are working.");
 #else
   cmFailed("Variable args for MACROs are failing.");
@@ -250,7 +250,7 @@ int main()
 #else
   cmPassed("CMake found the parent directory properly");
 #endif
-  
+
   // ----------------------------------------------------------------------
   // Test GET_DIRECTORY_PROPERTY for listfiles
 #ifndef CMAKE_FOUND_LISTFILE_STACK
@@ -258,7 +258,7 @@ int main()
 #else
   cmPassed("CMake found the listfile stack properly");
 #endif
-  
+
   // ----------------------------------------------------------------------
   // Test SET, VARIABLE_REQUIRES
 
@@ -267,38 +267,38 @@ int main()
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED is defined.");
 #endif
-  
+
 #ifndef ONE_VAR
   cmFailed("cmakedefine is broken, ONE_VAR is not defined.");
 #else
   cmPassed("ONE_VAR is defined.");
 #endif
-  
+
 #ifndef ONE_VAR_IS_DEFINED
   cmFailed("cmakedefine, SET or VARIABLE_REQUIRES is broken, "
          "ONE_VAR_IS_DEFINED is not defined.");
 #else
   cmPassed("ONE_VAR_IS_DEFINED is defined.");
 #endif
-  
+
 #ifdef ZERO_VAR
   cmFailed("cmakedefine is broken, ZERO_VAR is defined.");
 #else
   cmPassed("ZERO_VAR is not defined.");
 #endif
-  
+
 #ifndef STRING_VAR
   cmFailed("the CONFIGURE_FILE command is broken, STRING_VAR is not defined.");
 #else
   if(strcmp(STRING_VAR, "CMake is great") != 0)
     {
-    cmFailed("the SET or CONFIGURE_FILE command is broken. STRING_VAR == ", 
+    cmFailed("the SET or CONFIGURE_FILE command is broken. STRING_VAR == ",
            STRING_VAR);
     }
   else
@@ -315,145 +315,145 @@ int main()
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_NOT is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_NOT
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_NOT is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_NOT is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_NOT2
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_NOT2 is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_NOT2 is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_NOT2
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_NOT2 is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_NOT2 is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_AND
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_AND is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_AND is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_AND
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_AND is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_AND is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_AND2
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_AND2 is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_AND2 is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_AND2
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_AND2 is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_AND2 is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_OR
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_OR is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_OR is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_OR
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_OR is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_OR is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_OR2
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_OR2 is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_OR2 is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_OR2
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_OR2 is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_OR2 is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_MATCHES
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_MATCHES is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_MATCHES is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_MATCHES
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_MATCHES is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_MATCHES is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_MATCHES2
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_MATCHES2 is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_MATCHES2 is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_MATCHES2
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_MATCHES2 is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_MATCHES2 is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_COMMAND
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_COMMAND is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_COMMAND is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_COMMAND
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_COMMAND is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_COMMAND is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_COMMAND2
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_COMMAND2 is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_COMMAND2 is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_COMMAND2
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_COMMAND2 is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_COMMAND2 is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_EXISTS
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_EXISTS is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_EXISTS is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_EXISTS
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_EXISTS is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_EXISTS is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_EXISTS2
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_EXISTS2 is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_EXISTS2 is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_EXISTS2
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_EXISTS2 is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_EXISTS2 is defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_IS_DIRECTORY
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_IS_DIRECTORY is not defined.\n");
 #else
@@ -471,31 +471,31 @@ int main()
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_LESS is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_LESS
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_LESS is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_LESS is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_LESS2
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_LESS2 is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_LESS2 is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_LESS2
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_LESS2 is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_LESS2 is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_GREATER
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_GREATER is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_GREATER is not defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_EQUAL
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_EQUAL is defined.");
 #else
@@ -513,67 +513,67 @@ int main()
 #else
   cmPassed("SHOULD_BE_DEFINED_GREATER is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_GREATER2
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_GREATER2 is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_GREATER2 is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_GREATER2
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_GREATER2 is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_GREATER2 is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_STRLESS
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_STRLESS is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_STRLESS is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_STRLESS
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_STRLESS is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_STRLESS is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_STRLESS2
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_STRLESS2 is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_STRLESS2 is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_STRLESS2
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_STRLESS2 is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_STRLESS2 is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_STRGREATER
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_STRGREATER is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_STRGREATER is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_STRGREATER
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_STRGREATER is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_STRGREATER is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_STRGREATER2
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_STRGREATER2 is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_STRGREATER2 is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_STRGREATER2
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_STRGREATER2 is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_STRGREATER2 is defined.");
 #endif
-  
+
   // ----------------------------------------------------------------------
   // Test FOREACH
 
@@ -624,7 +624,7 @@ int main()
 
   // ----------------------------------------------------------------------
   // Test WHILE
-  
+
   if(WHILE_VALUE != 1000)
     {
     cmFailed("WHILE command is not working");
@@ -814,7 +814,7 @@ int main()
   // only created during a build.
 
   TestAndRemoveFile(BINARY_DIR "/Library/custom_target1.txt");
-  
+
   // ----------------------------------------------------------------------
   // A directory has been created.
 
@@ -890,7 +890,7 @@ int main()
 #else
   if(strcmp(FILE_COMPILE_FLAGS, "-foo -bar") != 0)
     {
-    cmFailed("the SET_SOURCE_FILES_PROPERTIES or CONFIGURE_FILE command is broken. FILE_COMPILE_FLAGS == ", 
+    cmFailed("the SET_SOURCE_FILES_PROPERTIES or CONFIGURE_FILE command is broken. FILE_COMPILE_FLAGS == ",
              FILE_COMPILE_FLAGS);
     }
   else
@@ -908,7 +908,7 @@ int main()
   std::cout << "REGISTRY_TEST_PATH == " << REGISTRY_TEST_PATH << "\n";
   if(stricmp(REGISTRY_TEST_PATH, BINARY_DIR "/registry_dir") != 0)
     {
-    cmFailed("the 'read registry value' function or CONFIGURE_FILE command is broken. REGISTRY_TEST_PATH == ", 
+    cmFailed("the 'read registry value' function or CONFIGURE_FILE command is broken. REGISTRY_TEST_PATH == ",
              REGISTRY_TEST_PATH, " is not " BINARY_DIR "/registry_dir");
     }
   else
@@ -937,7 +937,7 @@ int main()
     {
     cmFailed("REMOVE is not working");
     }
-  
+
   // ----------------------------------------------------------------------
   // Test SEPARATE_ARGUMENTS
   if(strcmp("a;b;c", TEST_SEP) == 0)
@@ -948,7 +948,7 @@ int main()
     {
     cmFailed("SEPARATE_ARGUMENTS is not working");
     }
-  
+
   // ----------------------------------------------------------------------
   // Test Escape Quotes
   if(strcmp("\"hello world\"", STRING_WITH_QUOTES) == 0)
@@ -959,8 +959,8 @@ int main()
     {
     cmFailed("ESCAPE_QUOTES is not working");
     }
-    
-  
+
+
   // ----------------------------------------------------------------------
   // Test if IF command inside a FOREACH works.
 #if defined(IF_INSIDE_FOREACH_THEN_EXECUTED) && !defined(IF_INSIDE_FOREACH_ELSE_EXECUTED)
@@ -981,7 +981,7 @@ int main()
   else
     {
     cmFailed("cmakedefine01 is not working for 0");
-    }  
+    }
   if(SHOULD_BE_ONE == 1)
     {
     cmPassed("cmakedefine01 is working for 1");
@@ -989,7 +989,7 @@ int main()
   else
     {
     cmFailed("cmakedefine01 is not working for 1");
-    }  
+    }
 #ifdef FORCE_TEST
   cmFailed("CMake SET CACHE FORCE");
 #else
diff --git a/Tests/Complex/Executable/testcflags.c b/Tests/Complex/Executable/testcflags.c
index f4d584844..6c2dd5db3 100644
--- a/Tests/Complex/Executable/testcflags.c
+++ b/Tests/Complex/Executable/testcflags.c
@@ -18,7 +18,7 @@ int TestCFlags(char* m)
   return 0;
 #endif
   /* TEST_C_FLAGS should be defined in a c file */
-#ifndef TEST_C_FLAGS  
+#ifndef TEST_C_FLAGS
   strcpy(m, "CMake CMAKE_C_FLAGS (TEST_C_FLAGS) not found in c file.");
   return 0;
 #endif
diff --git a/Tests/Complex/Library/CMakeLists.txt b/Tests/Complex/Library/CMakeLists.txt
index c8efc3022..becf67207 100644
--- a/Tests/Complex/Library/CMakeLists.txt
+++ b/Tests/Complex/Library/CMakeLists.txt
@@ -15,12 +15,12 @@ SET_TARGET_PROPERTIES(create_file PROPERTIES RUNTIME_OUTPUT_DIRECTORY ".")
 #
 AUX_SOURCE_DIRECTORY(ExtraSources LibrarySources)
 SET(LibrarySources ${LibrarySources}
-  file2 
-  empty 
-  create_file.cxx 
-  GENERATED 
+  file2
+  empty
+  create_file.cxx
+  GENERATED
   nonexisting_file)
-REMOVE(LibrarySources create_file.cxx GENERATED nonexisting_file) 
+REMOVE(LibrarySources create_file.cxx GENERATED nonexisting_file)
 ADD_LIBRARY(CMakeTestLibrary ${LibrarySources})
 
 IF(WIN32)
@@ -28,10 +28,10 @@ IF(WIN32)
     IF(NOT BORLAND)
       IF(NOT MINGW)
         TARGET_LINK_LIBRARIES(CMakeTestLibrary
-          debug 
+          debug
           user32.lib)
         TARGET_LINK_LIBRARIES(CMakeTestLibrary
-          optimized 
+          optimized
           kernel32.lib)
       ENDIF(NOT MINGW)
     ENDIF(NOT BORLAND)
@@ -97,7 +97,7 @@ ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared POST_BUILD
 #
 ADD_CUSTOM_TARGET(custom_target1
                   ALL
-                  ${CREATE_FILE_EXE} 
+                  ${CREATE_FILE_EXE}
                   "${Complex_BINARY_DIR}/Library/custom_target1.txt")
 
 ADD_DEPENDENCIES(custom_target1 create_file)
diff --git a/Tests/Complex/Library/create_file.cxx b/Tests/Complex/Library/create_file.cxx
index d41551980..050ed0bac 100644
--- a/Tests/Complex/Library/create_file.cxx
+++ b/Tests/Complex/Library/create_file.cxx
@@ -8,7 +8,7 @@ int main (int argc, char *argv[])
     fprintf(stderr, "Missing name of file to create.\n");
     return EXIT_FAILURE;
     }
-  
+
   FILE *stream = fopen(argv[1], "w");
   if(stream == NULL)
     {
@@ -23,6 +23,6 @@ int main (int argc, char *argv[])
     }
 
   fprintf(stdout, ">> Creating %s!\n", argv[1]);
-  
+
   return EXIT_SUCCESS;
 }
diff --git a/Tests/Complex/Library/testConly.c b/Tests/Complex/Library/testConly.c
index 2d83f778e..a7d20b0b5 100644
--- a/Tests/Complex/Library/testConly.c
+++ b/Tests/Complex/Library/testConly.c
@@ -7,7 +7,7 @@ int CsharedFunction()
   printf("TEST_C_FLAGS failed\n");
   return 0;
 #else
-  printf("Passed: TEST_C_FLAGS passed\n");  
-#endif  
+  printf("Passed: TEST_C_FLAGS passed\n");
+#endif
   return 1;
 }
diff --git a/Tests/Complex/Library/testConly.h b/Tests/Complex/Library/testConly.h
index f1470a8d7..ba8458923 100644
--- a/Tests/Complex/Library/testConly.h
+++ b/Tests/Complex/Library/testConly.h
@@ -10,4 +10,4 @@
 #endif
 
 CMakeTest_EXPORT int CsharedFunction();
- 
+
diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt
index b50501905..500431cf2 100644
--- a/Tests/ComplexOneConfig/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/CMakeLists.txt
@@ -27,7 +27,7 @@ MACRO(ASSERT value msg)
     MESSAGE ("Assertion failure:" ${msg} )
   ENDIF (NOT ${value})
 ENDMACRO(ASSERT)
- 
+
 # invoke the macro
 ASSERT(Complex_BINARY_DIR "The PROJECT command is broken")
 
@@ -40,7 +40,7 @@ MACRO(TEST_ARGC value1 value2)
     ADD_DEFINITIONS(${ARGV2} ${ARGV3})
   ENDIF (${ARGC} MATCHES 4)
 ENDMACRO(TEST_ARGC)
- 
+
 # invoke the macro
 TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4)
 
@@ -111,7 +111,7 @@ ENDIF(${fooCACHE_TEST_VAR2} MATCHES bar)
 
 
 #
-# Specify include and lib dirs 
+# Specify include and lib dirs
 # (BEFORE is for coverage)
 #
 INCLUDE_DIRECTORIES(
@@ -151,9 +151,9 @@ MESSAGE("\nIgnore this message")
 OPTION(NO_EXEC_PROGRAM "Do not test EXEC_PROGRAM" 0)
 IF (NOT NO_EXEC_PROGRAM)
   EXEC_PROGRAM(${CMAKE_COMMAND} ARGS -E echo NO_EXEC_PROGRAM "${Complex_BINARY_DIR}")
-ELSE (NOT NO_EXEC_PROGRAM) 
+ELSE (NOT NO_EXEC_PROGRAM)
   MESSAGE("Set this option ON")
-ENDIF (NOT NO_EXEC_PROGRAM) 
+ENDIF (NOT NO_EXEC_PROGRAM)
 
 MARK_AS_ADVANCED(NO_EXEC_PROGRAM)
 MARK_AS_ADVANCED(CLEAR NO_EXEC_PROGRAM)
@@ -217,12 +217,12 @@ FIND_LIBRARY(FIND_DUMMY_LIB
              ${Complex_BINARY_DIR}/Library DOC "find dummy lib")
 
 #
-# Test SET_SOURCE_FILES_PROPERTIES 
+# Test SET_SOURCE_FILES_PROPERTIES
 #
-SET_SOURCE_FILES_PROPERTIES(nonexisting_file2 
-  GENERATED 
-  ABSTRACT 
-  WRAP_EXCLUDE 
+SET_SOURCE_FILES_PROPERTIES(nonexisting_file2
+  GENERATED
+  ABSTRACT
+  WRAP_EXCLUDE
   COMPILE_FLAGS "-foo -bar")
 
 GET_SOURCE_FILE_PROPERTY(FILE_HAS_ABSTRACT nonexisting_file2 ABSTRACT)
@@ -290,7 +290,7 @@ ENDWHILE(while_var LESS 1000)
 SET(SHOULD_BE_ZERO )
 SET(SHOULD_BE_ONE 1)
 
-# test elseif functionality, the mess below tries to catch problem 
+# test elseif functionality, the mess below tries to catch problem
 # of clauses being executed early or late etc
 set (RESULT 3)
 if (RESULT EQUAL 1)
@@ -298,7 +298,7 @@ if (RESULT EQUAL 1)
     set (ELSEIF_RESULT 1)
   elseif (RESULT EQUAL 3)
     set (ELSEIF_RESULT 1)
-  endif (RESULT EQUAL 2)  
+  endif (RESULT EQUAL 2)
 elseif (RESULT EQUAL 2)
   set (ELSEIF_RESULT 1)
 elseif (RESULT EQUAL 3)
@@ -307,20 +307,20 @@ elseif (RESULT EQUAL 3)
   elseif (RESULT EQUAL 3)
     if (NOT ELSEIF_RESULT EQUAL 1)
       set (ELSEIF_RESULT 2)
-    endif (NOT ELSEIF_RESULT EQUAL 1)      
-  endif (RESULT EQUAL 2)  
+    endif (NOT ELSEIF_RESULT EQUAL 1)
+  endif (RESULT EQUAL 2)
 elseif (RESULT EQUAL 4)
   if (RESULT EQUAL 2)
     set (ELSEIF_RESULT 1)
   elseif (RESULT EQUAL 3)
     set (ELSEIF_RESULT 1)
-  endif (RESULT EQUAL 2)  
+  endif (RESULT EQUAL 2)
 else (RESULT  EQUAL 1)
   if (RESULT EQUAL 2)
     set (ELSEIF_RESULT 1)
   elseif (RESULT EQUAL 3)
     set (ELSEIF_RESULT 1)
-  endif (RESULT EQUAL 2)  
+  endif (RESULT EQUAL 2)
 endif (RESULT EQUAL 1)
 
 if (NOT ELSEIF_RESULT EQUAL 2)
@@ -334,7 +334,7 @@ endif()
 
 
 #
-# Configure file 
+# Configure file
 # (plug vars to #define so that they can be tested)
 #
 CONFIGURE_FILE(
diff --git a/Tests/ComplexOneConfig/Executable/CMakeLists.txt b/Tests/ComplexOneConfig/Executable/CMakeLists.txt
index 345836257..6ccdaf026 100644
--- a/Tests/ComplexOneConfig/Executable/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/Executable/CMakeLists.txt
@@ -1,6 +1,6 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 1.3)
 #
-# Create exe. 
+# Create exe.
 #
 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS")
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS")
@@ -22,7 +22,7 @@ IF(TARGET NotATarget)
   MESSAGE(FATAL_ERROR "IF(TARGET NotATarget) returned true!")
 ENDIF(TARGET NotATarget)
 
-  # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to 
+  # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to
 SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared)
 LINK_LIBRARIES(${COMPLEX_LIBS})
 
diff --git a/Tests/ComplexOneConfig/Executable/Temp/CMakeLists.txt b/Tests/ComplexOneConfig/Executable/Temp/CMakeLists.txt
index f00955029..989765e3a 100644
--- a/Tests/ComplexOneConfig/Executable/Temp/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/Executable/Temp/CMakeLists.txt
@@ -4,5 +4,5 @@
 # The contents of this file is not tested (absolute paths).
 #
 OUTPUT_REQUIRED_FILES(
-   ${Complex_SOURCE_DIR}/Executable/complex.cxx 
-   ${Complex_BINARY_DIR}/Executable/Temp/complex-required.txt)  
+   ${Complex_SOURCE_DIR}/Executable/complex.cxx
+   ${Complex_BINARY_DIR}/Executable/Temp/complex-required.txt)
diff --git a/Tests/ComplexOneConfig/Executable/complex.cxx b/Tests/ComplexOneConfig/Executable/complex.cxx
index 1901d9914..27d70adc8 100644
--- a/Tests/ComplexOneConfig/Executable/complex.cxx
+++ b/Tests/ComplexOneConfig/Executable/complex.cxx
@@ -33,7 +33,7 @@ int cm_failed = 0;
 
 void cmFailed(const char* Message, const char* m2= "", const char* m3 = "")
 {
-  std::cout << "FAILED: " << Message << m2 << m3 << "\n"; 
+  std::cout << "FAILED: " << Message << m2 << m3 << "\n";
   cm_failed++;
 }
 
@@ -41,7 +41,7 @@ void cmFailed(const char* Message, const char* m2= "", const char* m3 = "")
 
 void cmPassed(const char* Message, const char* m2="")
 {
-  std::cout << "Passed: " << Message << m2 << "\n"; 
+  std::cout << "Passed: " << Message << m2 << "\n";
   cm_passed++;
 }
 
@@ -67,7 +67,7 @@ void cmPassed(const char* Message, const char* m2="")
 
 // ======================================================================
 
-void TestAndRemoveFile(const char* filename) 
+void TestAndRemoveFile(const char* filename)
 {
   struct stat st;
   if(stat(filename, &st) < 0)
@@ -89,7 +89,7 @@ void TestAndRemoveFile(const char* filename)
 
 // ======================================================================
 
-void TestDir(const char* filename) 
+void TestDir(const char* filename)
 {
   struct stat st;
   if(stat(filename, &st) < 0 || !S_ISDIR(st.st_mode))
@@ -113,7 +113,7 @@ void ForceStringUse()
   std::string cachetest = CACHE_TEST_VAR_INTERNAL;
   v.push_back(cachetest);
   v2 = v;
-  std::string x(5,'x');  
+  std::string x(5,'x');
   char buff[5];
   x.copy(buff, 1, 0);
   x[0] = 'a';
@@ -165,7 +165,7 @@ int main()
 #else
   cmPassed("COMPILE_FLAGS did work with SET_TARGET_PROPERTIES");
 #endif
-  
+
 #ifdef ELSEIF_RESULT
   cmPassed("ELSEIF did work");
 #else
@@ -228,8 +228,8 @@ int main()
 #else
   cmPassed("CMAKE_IS_FUN is defined.");
 #endif
-  
-#if defined(CMAKE_ARGV1) && defined(CMAKE_ARGV2) && defined(CMAKE_ARGV3) && defined(CMAKE_ARGV4) 
+
+#if defined(CMAKE_ARGV1) && defined(CMAKE_ARGV2) && defined(CMAKE_ARGV3) && defined(CMAKE_ARGV4)
   cmPassed("Variable args for MACROs are working.");
 #else
   cmFailed("Variable args for MACROs are failing.");
@@ -250,7 +250,7 @@ int main()
 #else
   cmPassed("CMake found the parent directory properly");
 #endif
-  
+
   // ----------------------------------------------------------------------
   // Test GET_DIRECTORY_PROPERTY for listfiles
 #ifndef CMAKE_FOUND_LISTFILE_STACK
@@ -258,7 +258,7 @@ int main()
 #else
   cmPassed("CMake found the listfile stack properly");
 #endif
-  
+
   // ----------------------------------------------------------------------
   // Test SET, VARIABLE_REQUIRES
 
@@ -267,38 +267,38 @@ int main()
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED is defined.");
 #endif
-  
+
 #ifndef ONE_VAR
   cmFailed("cmakedefine is broken, ONE_VAR is not defined.");
 #else
   cmPassed("ONE_VAR is defined.");
 #endif
-  
+
 #ifndef ONE_VAR_IS_DEFINED
   cmFailed("cmakedefine, SET or VARIABLE_REQUIRES is broken, "
          "ONE_VAR_IS_DEFINED is not defined.");
 #else
   cmPassed("ONE_VAR_IS_DEFINED is defined.");
 #endif
-  
+
 #ifdef ZERO_VAR
   cmFailed("cmakedefine is broken, ZERO_VAR is defined.");
 #else
   cmPassed("ZERO_VAR is not defined.");
 #endif
-  
+
 #ifndef STRING_VAR
   cmFailed("the CONFIGURE_FILE command is broken, STRING_VAR is not defined.");
 #else
   if(strcmp(STRING_VAR, "CMake is great") != 0)
     {
-    cmFailed("the SET or CONFIGURE_FILE command is broken. STRING_VAR == ", 
+    cmFailed("the SET or CONFIGURE_FILE command is broken. STRING_VAR == ",
            STRING_VAR);
     }
   else
@@ -315,145 +315,145 @@ int main()
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_NOT is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_NOT
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_NOT is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_NOT is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_NOT2
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_NOT2 is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_NOT2 is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_NOT2
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_NOT2 is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_NOT2 is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_AND
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_AND is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_AND is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_AND
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_AND is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_AND is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_AND2
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_AND2 is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_AND2 is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_AND2
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_AND2 is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_AND2 is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_OR
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_OR is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_OR is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_OR
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_OR is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_OR is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_OR2
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_OR2 is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_OR2 is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_OR2
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_OR2 is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_OR2 is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_MATCHES
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_MATCHES is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_MATCHES is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_MATCHES
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_MATCHES is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_MATCHES is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_MATCHES2
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_MATCHES2 is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_MATCHES2 is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_MATCHES2
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_MATCHES2 is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_MATCHES2 is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_COMMAND
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_COMMAND is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_COMMAND is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_COMMAND
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_COMMAND is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_COMMAND is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_COMMAND2
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_COMMAND2 is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_COMMAND2 is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_COMMAND2
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_COMMAND2 is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_COMMAND2 is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_EXISTS
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_EXISTS is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_EXISTS is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_EXISTS
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_EXISTS is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_EXISTS is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_EXISTS2
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_EXISTS2 is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_EXISTS2 is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_EXISTS2
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_EXISTS2 is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_EXISTS2 is defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_IS_DIRECTORY
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_IS_DIRECTORY is not defined.\n");
 #else
@@ -471,31 +471,31 @@ int main()
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_LESS is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_LESS
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_LESS is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_LESS is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_LESS2
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_LESS2 is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_LESS2 is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_LESS2
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_LESS2 is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_LESS2 is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_GREATER
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_GREATER is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_GREATER is not defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_EQUAL
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_EQUAL is defined.");
 #else
@@ -513,67 +513,67 @@ int main()
 #else
   cmPassed("SHOULD_BE_DEFINED_GREATER is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_GREATER2
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_GREATER2 is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_GREATER2 is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_GREATER2
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_GREATER2 is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_GREATER2 is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_STRLESS
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_STRLESS is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_STRLESS is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_STRLESS
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_STRLESS is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_STRLESS is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_STRLESS2
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_STRLESS2 is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_STRLESS2 is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_STRLESS2
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_STRLESS2 is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_STRLESS2 is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_STRGREATER
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_STRGREATER is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_STRGREATER is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_STRGREATER
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_STRGREATER is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_STRGREATER is defined.");
 #endif
-  
+
 #ifdef SHOULD_NOT_BE_DEFINED_STRGREATER2
   cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_STRGREATER2 is defined.");
 #else
   cmPassed("SHOULD_NOT_BE_DEFINED_STRGREATER2 is not defined.");
 #endif
-  
+
 #ifndef SHOULD_BE_DEFINED_STRGREATER2
   cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_STRGREATER2 is not defined.\n");
 #else
   cmPassed("SHOULD_BE_DEFINED_STRGREATER2 is defined.");
 #endif
-  
+
   // ----------------------------------------------------------------------
   // Test FOREACH
 
@@ -624,7 +624,7 @@ int main()
 
   // ----------------------------------------------------------------------
   // Test WHILE
-  
+
   if(WHILE_VALUE != 1000)
     {
     cmFailed("WHILE command is not working");
@@ -814,7 +814,7 @@ int main()
   // only created during a build.
 
   TestAndRemoveFile(BINARY_DIR "/Library/custom_target1.txt");
-  
+
   // ----------------------------------------------------------------------
   // A directory has been created.
 
@@ -890,7 +890,7 @@ int main()
 #else
   if(strcmp(FILE_COMPILE_FLAGS, "-foo -bar") != 0)
     {
-    cmFailed("the SET_SOURCE_FILES_PROPERTIES or CONFIGURE_FILE command is broken. FILE_COMPILE_FLAGS == ", 
+    cmFailed("the SET_SOURCE_FILES_PROPERTIES or CONFIGURE_FILE command is broken. FILE_COMPILE_FLAGS == ",
              FILE_COMPILE_FLAGS);
     }
   else
@@ -908,7 +908,7 @@ int main()
   std::cout << "REGISTRY_TEST_PATH == " << REGISTRY_TEST_PATH << "\n";
   if(stricmp(REGISTRY_TEST_PATH, BINARY_DIR "/registry_dir") != 0)
     {
-    cmFailed("the 'read registry value' function or CONFIGURE_FILE command is broken. REGISTRY_TEST_PATH == ", 
+    cmFailed("the 'read registry value' function or CONFIGURE_FILE command is broken. REGISTRY_TEST_PATH == ",
              REGISTRY_TEST_PATH, " is not " BINARY_DIR "/registry_dir");
     }
   else
@@ -937,7 +937,7 @@ int main()
     {
     cmFailed("REMOVE is not working");
     }
-  
+
   // ----------------------------------------------------------------------
   // Test SEPARATE_ARGUMENTS
   if(strcmp("a;b;c", TEST_SEP) == 0)
@@ -948,7 +948,7 @@ int main()
     {
     cmFailed("SEPARATE_ARGUMENTS is not working");
     }
-  
+
   // ----------------------------------------------------------------------
   // Test Escape Quotes
   if(strcmp("\"hello world\"", STRING_WITH_QUOTES) == 0)
@@ -959,8 +959,8 @@ int main()
     {
     cmFailed("ESCAPE_QUOTES is not working");
     }
-    
-  
+
+
   // ----------------------------------------------------------------------
   // Test if IF command inside a FOREACH works.
 #if defined(IF_INSIDE_FOREACH_THEN_EXECUTED) && !defined(IF_INSIDE_FOREACH_ELSE_EXECUTED)
@@ -981,7 +981,7 @@ int main()
   else
     {
     cmFailed("cmakedefine01 is not working for 0");
-    }  
+    }
   if(SHOULD_BE_ONE == 1)
     {
     cmPassed("cmakedefine01 is working for 1");
@@ -989,7 +989,7 @@ int main()
   else
     {
     cmFailed("cmakedefine01 is not working for 1");
-    }  
+    }
 #ifdef FORCE_TEST
   cmFailed("CMake SET CACHE FORCE");
 #else
diff --git a/Tests/ComplexOneConfig/Executable/testcflags.c b/Tests/ComplexOneConfig/Executable/testcflags.c
index f4d584844..6c2dd5db3 100644
--- a/Tests/ComplexOneConfig/Executable/testcflags.c
+++ b/Tests/ComplexOneConfig/Executable/testcflags.c
@@ -18,7 +18,7 @@ int TestCFlags(char* m)
   return 0;
 #endif
   /* TEST_C_FLAGS should be defined in a c file */
-#ifndef TEST_C_FLAGS  
+#ifndef TEST_C_FLAGS
   strcpy(m, "CMake CMAKE_C_FLAGS (TEST_C_FLAGS) not found in c file.");
   return 0;
 #endif
diff --git a/Tests/ComplexOneConfig/Library/CMakeLists.txt b/Tests/ComplexOneConfig/Library/CMakeLists.txt
index c8efc3022..becf67207 100644
--- a/Tests/ComplexOneConfig/Library/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/Library/CMakeLists.txt
@@ -15,12 +15,12 @@ SET_TARGET_PROPERTIES(create_file PROPERTIES RUNTIME_OUTPUT_DIRECTORY ".")
 #
 AUX_SOURCE_DIRECTORY(ExtraSources LibrarySources)
 SET(LibrarySources ${LibrarySources}
-  file2 
-  empty 
-  create_file.cxx 
-  GENERATED 
+  file2
+  empty
+  create_file.cxx
+  GENERATED
   nonexisting_file)
-REMOVE(LibrarySources create_file.cxx GENERATED nonexisting_file) 
+REMOVE(LibrarySources create_file.cxx GENERATED nonexisting_file)
 ADD_LIBRARY(CMakeTestLibrary ${LibrarySources})
 
 IF(WIN32)
@@ -28,10 +28,10 @@ IF(WIN32)
     IF(NOT BORLAND)
       IF(NOT MINGW)
         TARGET_LINK_LIBRARIES(CMakeTestLibrary
-          debug 
+          debug
           user32.lib)
         TARGET_LINK_LIBRARIES(CMakeTestLibrary
-          optimized 
+          optimized
           kernel32.lib)
       ENDIF(NOT MINGW)
     ENDIF(NOT BORLAND)
@@ -97,7 +97,7 @@ ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared POST_BUILD
 #
 ADD_CUSTOM_TARGET(custom_target1
                   ALL
-                  ${CREATE_FILE_EXE} 
+                  ${CREATE_FILE_EXE}
                   "${Complex_BINARY_DIR}/Library/custom_target1.txt")
 
 ADD_DEPENDENCIES(custom_target1 create_file)
diff --git a/Tests/ComplexOneConfig/Library/create_file.cxx b/Tests/ComplexOneConfig/Library/create_file.cxx
index d41551980..050ed0bac 100644
--- a/Tests/ComplexOneConfig/Library/create_file.cxx
+++ b/Tests/ComplexOneConfig/Library/create_file.cxx
@@ -8,7 +8,7 @@ int main (int argc, char *argv[])
     fprintf(stderr, "Missing name of file to create.\n");
     return EXIT_FAILURE;
     }
-  
+
   FILE *stream = fopen(argv[1], "w");
   if(stream == NULL)
     {
@@ -23,6 +23,6 @@ int main (int argc, char *argv[])
     }
 
   fprintf(stdout, ">> Creating %s!\n", argv[1]);
-  
+
   return EXIT_SUCCESS;
 }
diff --git a/Tests/ComplexOneConfig/Library/testConly.c b/Tests/ComplexOneConfig/Library/testConly.c
index 2d83f778e..a7d20b0b5 100644
--- a/Tests/ComplexOneConfig/Library/testConly.c
+++ b/Tests/ComplexOneConfig/Library/testConly.c
@@ -7,7 +7,7 @@ int CsharedFunction()
   printf("TEST_C_FLAGS failed\n");
   return 0;
 #else
-  printf("Passed: TEST_C_FLAGS passed\n");  
-#endif  
+  printf("Passed: TEST_C_FLAGS passed\n");
+#endif
   return 1;
 }
diff --git a/Tests/ComplexOneConfig/Library/testConly.h b/Tests/ComplexOneConfig/Library/testConly.h
index f1470a8d7..ba8458923 100644
--- a/Tests/ComplexOneConfig/Library/testConly.h
+++ b/Tests/ComplexOneConfig/Library/testConly.h
@@ -10,4 +10,4 @@
 #endif
 
 CMakeTest_EXPORT int CsharedFunction();
- 
+
diff --git a/Tests/CrossCompile/CMakeLists.txt b/Tests/CrossCompile/CMakeLists.txt
index 96a57a051..fb9a0d732 100644
--- a/Tests/CrossCompile/CMakeLists.txt
+++ b/Tests/CrossCompile/CMakeLists.txt
@@ -9,5 +9,5 @@ SET(CMAKE_CROSSCOMPILING ON)
 ADD_EXECUTABLE(CrossCompile main.c)
 
 TRY_RUN(run_result compile_result
-    ${CrossCompile_BINARY_DIR}  
+    ${CrossCompile_BINARY_DIR}
     ${CrossCompile_SOURCE_DIR}/main.c)
diff --git a/Tests/CustComDepend/CMakeLists.txt b/Tests/CustComDepend/CMakeLists.txt
index d5266842d..46276b2ef 100644
--- a/Tests/CustComDepend/CMakeLists.txt
+++ b/Tests/CustComDepend/CMakeLists.txt
@@ -10,5 +10,5 @@ add_custom_command(
   ${CustComDepend_BINARY_DIR}/bar.c
   DEPENDS ${CustComDepend_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/foo
 )
-  
+
 add_library(bar SHARED ${CustComDepend_BINARY_DIR}/bar.c)
diff --git a/Tests/CustComDepend/bar.h b/Tests/CustComDepend/bar.h
index d462c9b5b..d17946428 100644
--- a/Tests/CustComDepend/bar.h
+++ b/Tests/CustComDepend/bar.h
@@ -5,5 +5,5 @@
 #    define BAR_EXPORT  __declspec( dllimport )
 #  endif
 #else
-#  define BAR_EXPORT 
+#  define BAR_EXPORT
 #endif
diff --git a/Tests/CustComDepend/foo.cxx b/Tests/CustComDepend/foo.cxx
index 3c204f8a2..19dfcb143 100644
--- a/Tests/CustComDepend/foo.cxx
+++ b/Tests/CustComDepend/foo.cxx
@@ -12,4 +12,4 @@ int main(int ac, char** av)
   fclose(fout);
   return 0;
 }
-  
+
diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt
index b7c9ea268..c1d2ae09d 100644
--- a/Tests/CustomCommand/CMakeLists.txt
+++ b/Tests/CustomCommand/CMakeLists.txt
@@ -56,9 +56,9 @@ ADD_CUSTOM_COMMAND(
 #
 ################################################################
 ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}//doc1.dvi # test 2 slashes
-  DEPENDS ${PROJECT_SOURCE_DIR}/doc1.tex 
-  COMMAND   ${CMAKE_COMMAND}  
-  ARGS      -E copy ${PROJECT_SOURCE_DIR}/doc1.tex 
+  DEPENDS ${PROJECT_SOURCE_DIR}/doc1.tex
+  COMMAND   ${CMAKE_COMMAND}
+  ARGS      -E copy ${PROJECT_SOURCE_DIR}/doc1.tex
   ${PROJECT_BINARY_DIR}/doc1.dvi
   )
 
@@ -131,13 +131,13 @@ ADD_CUSTOM_COMMAND(
 ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/foo.pre
   DEPENDS ${PROJECT_SOURCE_DIR}/foo.in
           TDocument # Ensure doc1.h generates before this target
-  COMMAND   ${CMAKE_COMMAND}  
-  ARGS      -E copy ${PROJECT_SOURCE_DIR}/foo.in 
+  COMMAND   ${CMAKE_COMMAND}
+  ARGS      -E copy ${PROJECT_SOURCE_DIR}/foo.in
   ${PROJECT_BINARY_DIR}/foo.pre
   )
 
 ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/foo.c
-  DEPENDS   ${PROJECT_BINARY_DIR}/foo.pre 
+  DEPENDS   ${PROJECT_BINARY_DIR}/foo.pre
   COMMAND   ${CMAKE_COMMAND}
   ARGS      -E copy ${PROJECT_BINARY_DIR}/foo.pre
   ${PROJECT_BINARY_DIR}/foo.c
@@ -161,7 +161,7 @@ CONFIGURE_FILE(
   )
 
 # add the executable
-ADD_EXECUTABLE(CustomCommand 
+ADD_EXECUTABLE(CustomCommand
   ${PROJECT_BINARY_DIR}/foo.h
   ${PROJECT_BINARY_DIR}/foo.c
   ${PROJECT_BINARY_DIR}/wrapped.c
@@ -186,7 +186,7 @@ TARGET_LINK_LIBRARIES(CustomCommand GeneratedHeader)
 # Test for using just the target name as executable in the COMMAND
 # section. Has to be recognized and replaced by CMake with the output
 # actual location of the executable.
-# Additionally the generator is created in an extra subdir after the 
+# Additionally the generator is created in an extra subdir after the
 # ADD_CUSTOM_COMMAND() is used.
 #
 # Test the same for ADD_CUSTOM_TARGET()
@@ -197,11 +197,11 @@ ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated_extern.cxx
 
 ADD_EXECUTABLE(CustomCommandUsingTargetTest main.cxx ${CMAKE_CURRENT_BINARY_DIR}/generated_extern.cxx )
 
-ADD_CUSTOM_TARGET(RunTarget 
+ADD_CUSTOM_TARGET(RunTarget
   COMMAND generator_extern ${CMAKE_CURRENT_BINARY_DIR}/run_target.cxx
   )
 
-ADD_CUSTOM_COMMAND(TARGET CustomCommandUsingTargetTest POST_BUILD 
+ADD_CUSTOM_COMMAND(TARGET CustomCommandUsingTargetTest POST_BUILD
                    COMMAND dummy_generator ${CMAKE_CURRENT_BINARY_DIR}/generated_dummy.cxx)
 
 ADD_SUBDIRECTORY(GeneratorInExtraDir)
diff --git a/Tests/CustomCommand/GeneratedHeader/CMakeLists.txt b/Tests/CustomCommand/GeneratedHeader/CMakeLists.txt
index 2d47d8749..2ba8e68c1 100644
--- a/Tests/CustomCommand/GeneratedHeader/CMakeLists.txt
+++ b/Tests/CustomCommand/GeneratedHeader/CMakeLists.txt
@@ -2,12 +2,12 @@
 # builds.
 SET(CMAKE_INCLUDE_CURRENT_DIR 1)
 
-ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated.h 
-  COMMAND 
+ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated.h
+  COMMAND
   ${CMAKE_COMMAND} ARGS -E
-  copy ${CMAKE_CURRENT_SOURCE_DIR}/generated.h.in 
-  ${CMAKE_CURRENT_BINARY_DIR}/generated.h 
+  copy ${CMAKE_CURRENT_SOURCE_DIR}/generated.h.in
+  ${CMAKE_CURRENT_BINARY_DIR}/generated.h
 )
 
-ADD_LIBRARY(GeneratedHeader main.cpp ${CMAKE_CURRENT_BINARY_DIR}/generated.h) 
- 
+ADD_LIBRARY(GeneratedHeader main.cpp ${CMAKE_CURRENT_BINARY_DIR}/generated.h)
+
diff --git a/Tests/CustomCommand/foo.in b/Tests/CustomCommand/foo.in
index 08c559df4..0c5021caa 100644
--- a/Tests/CustomCommand/foo.in
+++ b/Tests/CustomCommand/foo.in
@@ -22,7 +22,7 @@ int main ()
       return -2;
       }
     }
-  
+
   return -1;
 }
 
diff --git a/Tests/CustomCommandWorkingDirectory/CMakeLists.txt b/Tests/CustomCommandWorkingDirectory/CMakeLists.txt
index 36d32e4a0..f64706485 100644
--- a/Tests/CustomCommandWorkingDirectory/CMakeLists.txt
+++ b/Tests/CustomCommandWorkingDirectory/CMakeLists.txt
@@ -13,7 +13,7 @@ SET_SOURCE_FILES_PROPERTIES(
   "${TestWorkingDir_BINARY_DIR}/customTarget2.c"
   PROPERTIES GENERATED 1)
 
-ADD_EXECUTABLE(working "${TestWorkingDir_BINARY_DIR}/working.c" 
+ADD_EXECUTABLE(working "${TestWorkingDir_BINARY_DIR}/working.c"
   "${TestWorkingDir_BINARY_DIR}/customTarget.c")
 
 ADD_CUSTOM_TARGET(
diff --git a/Tests/Dependency/Exec2/CMakeLists.txt b/Tests/Dependency/Exec2/CMakeLists.txt
index ee0c74d13..84d630ae1 100644
--- a/Tests/Dependency/Exec2/CMakeLists.txt
+++ b/Tests/Dependency/Exec2/CMakeLists.txt
@@ -2,7 +2,7 @@
 # If the dependencies of Five are emitted, and then we attempt to emit the
 # dependencies of Seven, then we find that they have already been done. So:
 #  Original line:      Eight Five
-#  Add deps of Five:   Eight Five Two ... NoDepA 
+#  Add deps of Five:   Eight Five Two ... NoDepA
 # Now, we must make sure that Seven gets inserted between Five and Two, and
 # not at the end. Unfortunately, if we get it wrong, the test will only
 # fail on a platform where the link order makes a difference.
diff --git a/Tests/DocTest/DocTest.cxx b/Tests/DocTest/DocTest.cxx
index 2263cbd73..a8a62ab6c 100644
--- a/Tests/DocTest/DocTest.cxx
+++ b/Tests/DocTest/DocTest.cxx
@@ -13,7 +13,7 @@ int main ()
     fprintf(stderr,"failed to find undefined properties file");
     return 1;
     }
-  
+
   char buffer[1024];
   while ( fin )
     {
@@ -28,6 +28,6 @@ int main ()
       }
     }
   fin.close();
-  
+
   return result;
 }
diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt
index a995f68dd..679ec8324 100644
--- a/Tests/Fortran/CMakeLists.txt
+++ b/Tests/Fortran/CMakeLists.txt
@@ -121,7 +121,7 @@ else()
   message("Fortran does not match c compiler")
   message("Fortran = ${CMAKE_Fortran_COMPILER_ID}")
   message("C = ${CMAKE_C_COMPILER_ID}")
-  # hack to make g77 work after CL has been enabled 
+  # hack to make g77 work after CL has been enabled
   # as a languge, cmake needs language specific versions
   # of these variables....
   if(WIN32 AND "${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
@@ -154,11 +154,11 @@ if(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
   add_executable(test_use_in_comment_fixedform
     test_use_in_comment_fixedform.f)
   set_property(SOURCE test_use_in_comment_fixedform.f PROPERTY Fortran_FORMAT FIXED)
-  add_executable(test_use_in_comment_freeform 
+  add_executable(test_use_in_comment_freeform
     test_use_in_comment_freeform.f90)
   set_property(SOURCE test_use_in_comment_freeform.f90 PROPERTY Fortran_FORMAT FREE)
 
-  add_executable(test_in_interface 
+  add_executable(test_in_interface
     in_interface/main.f90
     in_interface/module.f90)
 
diff --git a/Tests/Fortran/foo.f b/Tests/Fortran/foo.f
index dbbb3a4e9..ece0df44c 100644
--- a/Tests/Fortran/foo.f
+++ b/Tests/Fortran/foo.f
@@ -5,5 +5,5 @@
       contains
         subroutine sub
         end subroutine
-      
+
       end module test_mod
diff --git a/Tests/Fortran/test_use_in_comment_freeform.f90 b/Tests/Fortran/test_use_in_comment_freeform.f90
index c992a041b..48bcd5a21 100644
--- a/Tests/Fortran/test_use_in_comment_freeform.f90
+++ b/Tests/Fortran/test_use_in_comment_freeform.f90
@@ -1,7 +1,7 @@
 PROGRAM foo
-! USE bar       
-! use bar       
-! Use bar       
+! USE bar
+! use bar
+! Use bar
 
     WRITE(*,*) 'Hello, Fortran world.'
 END PROGRAM
diff --git a/Tests/Framework/foo.cxx b/Tests/Framework/foo.cxx
index b249ce348..e5c19738c 100644
--- a/Tests/Framework/foo.cxx
+++ b/Tests/Framework/foo.cxx
@@ -1,7 +1,7 @@
 #include <stdio.h>
 #if defined(_WIN32) && defined(foo_EXPORTS)
 #  define CM_TEST_LIB_EXPORT  __declspec( dllexport )
-#else 
+#else
 #  define CM_TEST_LIB_EXPORT
 #endif
 CM_TEST_LIB_EXPORT void foo()
diff --git a/Tests/JCTest/CMakeLists.txt b/Tests/JCTest/CMakeLists.txt
index a0f590e57..17cea0f08 100644
--- a/Tests/JCTest/CMakeLists.txt
+++ b/Tests/JCTest/CMakeLists.txt
@@ -3,7 +3,7 @@ project(TestTime)
 enable_testing()
 add_executable(TestTime TestTime.cxx)
 
-foreach(f 1 2 3 4 5 6 7 8 9 10 11 12 12 14 15 16 17 18 19 
+foreach(f 1 2 3 4 5 6 7 8 9 10 11 12 12 14 15 16 17 18 19
 20 21 22 23 24 25 26 27 28 29 30)
   add_test(TestTime${f} TestTime 50000000)
 endforeach(f)
diff --git a/Tests/Java/A.java b/Tests/Java/A.java
index e34b7046a..403a7f889 100644
--- a/Tests/Java/A.java
+++ b/Tests/Java/A.java
@@ -1,11 +1,11 @@
 class A
 {
-  public A() 
+  public A()
     {
     }
-  
+
   public void printName()
-    { 
+    {
       System.out.println("A");
     }
 }
diff --git a/Tests/Java/HelloWorld.java b/Tests/Java/HelloWorld.java
index 54246ec26..378e37193 100644
--- a/Tests/Java/HelloWorld.java
+++ b/Tests/Java/HelloWorld.java
@@ -1,5 +1,5 @@
 class HelloWorld
-{  
+{
     public static void main(String args[])
     {
         A a;
diff --git a/Tests/KDE4StableBranchTest/test_kde4.sh.in b/Tests/KDE4StableBranchTest/test_kde4.sh.in
index 81badcd79..bc90b9d0d 100755
--- a/Tests/KDE4StableBranchTest/test_kde4.sh.in
+++ b/Tests/KDE4StableBranchTest/test_kde4.sh.in
@@ -2,9 +2,9 @@
 
 # This shell script tests whether cmake is able to build the latest
 # stable KDE4 release, or at least some part of it.
-# It downloads automoc from KDE svn, builds and installs it, then it 
+# It downloads automoc from KDE svn, builds and installs it, then it
 # downloads phonon from KDE svn, builds and installs it, and finally
-# it downloads kdelibs (currently from the 4.3 branch), and builds 
+# it downloads kdelibs (currently from the 4.3 branch), and builds
 # a (small) part of it, i.e. libkdecore and one unit test depending on it.
 #
 # <neundorf AT kde.org>
diff --git a/Tests/LibName/CMakeLists.txt b/Tests/LibName/CMakeLists.txt
index 07499a14d..75dec4eb3 100644
--- a/Tests/LibName/CMakeLists.txt
+++ b/Tests/LibName/CMakeLists.txt
@@ -1,5 +1,5 @@
 project(LibName)
-# this is a test to make sure that relative path 
+# this is a test to make sure that relative path
 # LIBRARY_OUTPUT_PATH and EXECUTABLE_OUTPUT_PATH work
 set(LIBRARY_OUTPUT_PATH  lib)
 set(EXECUTABLE_OUTPUT_PATH lib)
diff --git a/Tests/LibName/bar.c b/Tests/LibName/bar.c
index 960718038..f82aa28e8 100644
--- a/Tests/LibName/bar.c
+++ b/Tests/LibName/bar.c
@@ -1,7 +1,7 @@
 #ifdef _WIN32
-__declspec(dllexport) 
+__declspec(dllexport)
 #endif
-  
+
 extern  void foo()
 {
 }
diff --git a/Tests/LibName/foo.c b/Tests/LibName/foo.c
index a68970405..6d258e0e9 100644
--- a/Tests/LibName/foo.c
+++ b/Tests/LibName/foo.c
@@ -1,9 +1,9 @@
 #ifdef _WIN32
-__declspec(dllimport) 
+__declspec(dllimport)
 #endif
 extern  void foo();
 #ifdef _WIN32
-__declspec(dllexport)  
+__declspec(dllexport)
 #endif
   void bar()
 {
diff --git a/Tests/LibName/foobar.c b/Tests/LibName/foobar.c
index 73b4b4156..2f8a3ff08 100644
--- a/Tests/LibName/foobar.c
+++ b/Tests/LibName/foobar.c
@@ -1,5 +1,5 @@
 #ifdef _WIN32
-__declspec(dllimport) 
+__declspec(dllimport)
 #endif
 extern  void bar();
 
diff --git a/Tests/LoadCommand/CMakeCommands/cmTestCommand.c b/Tests/LoadCommand/CMakeCommands/cmTestCommand.c
index 6b4f48f7b..fc04934dd 100644
--- a/Tests/LoadCommand/CMakeCommands/cmTestCommand.c
+++ b/Tests/LoadCommand/CMakeCommands/cmTestCommand.c
@@ -3,7 +3,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-typedef struct 
+typedef struct
 {
   char *LibraryName;
   int Argc;
@@ -24,8 +24,8 @@ static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[])
   char *ccDep[1];
   char *ccOut[1];
   cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf;
- 
-  cmVTKWrapTclData *cdata = 
+
+  cmVTKWrapTclData *cdata =
     (cmVTKWrapTclData *)malloc(sizeof(cmVTKWrapTclData));
   cdata->LibraryName = "BOO";
   cdata->Argc = argc;
@@ -36,33 +36,33 @@ static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[])
   /* already, if so use that value and don't look for the program */
   if(!info->CAPI->IsOn(mf,"TEST_COMMAND_TEST1"))
     {
-    info->CAPI->AddDefinition(mf, "TEST_DEF", "HOO");  
+    info->CAPI->AddDefinition(mf, "TEST_DEF", "HOO");
     return 1;
     }
-  
-  info->CAPI->AddDefinition(mf, "TEST_DEF", "HOO");  
+
+  info->CAPI->AddDefinition(mf, "TEST_DEF", "HOO");
   cdata->LibraryName = "HOO";
 
-  info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE", "ON", 
+  info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE", "ON",
     "Test cache variable",
     CM_CACHE_BOOL);
-  info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE1", "", 
+  info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE1", "",
     "Test cache variable 1",
     CM_CACHE_PATH);
-  info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE2", "", 
+  info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE2", "",
     "Test cache variable 2",
     CM_CACHE_FILEPATH);
-  info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE3", "", 
+  info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE3", "",
     "Test cache variable 3",
     CM_CACHE_STRING);
-  info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE4", "", 
+  info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE4", "",
     "Test cache variable 4",
     CM_CACHE_INTERNAL);
-  info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE5", "", 
+  info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE5", "",
     "Test cache variable 5",
     CM_CACHE_STATIC);
 
-  
+
   file = info->CAPI->ExpandVariablesInString(mf, "${CMAKE_COMMAND}", 0, 0);
 
   str = info->CAPI->GetFilenameWithoutExtension(file);
@@ -140,7 +140,7 @@ static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[])
                                1, ccDep,
                                1, ccOut,
                                "LoadedCommand");
-  
+
 
   ccArgs[2] = argv[1];
   ccArgs[3] = argv[2];
@@ -171,22 +171,22 @@ static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[])
     return 0;
     }
   info->CAPI->ExecuteCommand(mf,"SET",2,args);
-  
+
   /* make sure we can find the source file */
   if (!info->CAPI->GetSource(mf,argv[1]))
     {
     info->CAPI->SetError(mf, "Source file could not be found!");
-    return 0;    
+    return 0;
     }
 
   return 1;
 }
 
-static void  CCONV FinalPass(void *inf, void *mf) 
+static void  CCONV FinalPass(void *inf, void *mf)
 {
   cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf;
   /* get our client data from initial pass */
-  cmVTKWrapTclData *cdata = 
+  cmVTKWrapTclData *cdata =
     (cmVTKWrapTclData *)info->CAPI->GetClientData(info);
   if (strcmp(info->CAPI->GetDefinition(mf, "TEST_DEF"),"HOO") ||
       strcmp(cdata->LibraryName,"HOO"))
@@ -194,11 +194,11 @@ static void  CCONV FinalPass(void *inf, void *mf)
     fprintf(stderr,"*** Failed LOADED COMMAND Final Pass\n");
     }
 }
-static void CCONV Destructor(void *inf) 
+static void CCONV Destructor(void *inf)
 {
   cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf;
   /* get our client data from initial pass */
-  cmVTKWrapTclData *cdata = 
+  cmVTKWrapTclData *cdata =
     (cmVTKWrapTclData *)info->CAPI->GetClientData(info);
   free(cdata);
 }
diff --git a/Tests/LoadCommand/CMakeLists.txt b/Tests/LoadCommand/CMakeLists.txt
index 846cbb084..32e73f00c 100644
--- a/Tests/LoadCommand/CMakeLists.txt
+++ b/Tests/LoadCommand/CMakeLists.txt
@@ -21,16 +21,16 @@ INCLUDE_DIRECTORIES(${LoadCommand_BINARY_DIR})
 # make sure it is not already loaded
 IF(COMMAND CMAKE_TEST_COMMAND)
 ELSE(COMMAND CMAKE_TEST_COMMAND)
-  TRY_COMPILE(COMPILE_OK 
-    ${LoadCommand_BINARY_DIR}/CMakeCommands 
-    ${LoadCommand_SOURCE_DIR}/CMakeCommands 
+  TRY_COMPILE(COMPILE_OK
+    ${LoadCommand_BINARY_DIR}/CMakeCommands
+    ${LoadCommand_SOURCE_DIR}/CMakeCommands
     CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO
     OUTPUT_VARIABLE OUTPUT )
 # do another TRY_COMPILE to get around make
 # problem on hp
-  TRY_COMPILE(COMPILE_OK 
-    ${LoadCommand_BINARY_DIR}/CMakeCommands 
-    ${LoadCommand_SOURCE_DIR}/CMakeCommands 
+  TRY_COMPILE(COMPILE_OK
+    ${LoadCommand_BINARY_DIR}/CMakeCommands
+    ${LoadCommand_SOURCE_DIR}/CMakeCommands
     CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO
     OUTPUT_VARIABLE OUTPUT )
 ENDIF(COMMAND CMAKE_TEST_COMMAND)
@@ -39,8 +39,8 @@ MESSAGE("Output from try compile: ${OUTPUT}")
 
 # if the compile was OK, try loading the command
 IF (COMPILE_OK)
-  LOAD_COMMAND(CMAKE_TEST_COMMAND 
-    ${LoadCommand_BINARY_DIR}/CMakeCommands 
+  LOAD_COMMAND(CMAKE_TEST_COMMAND
+    ${LoadCommand_BINARY_DIR}/CMakeCommands
     ${LoadCommand_BINARY_DIR}/CMakeCommands/Debug
     ${LoadCommand_BINARY_DIR}/CMakeCommands/Development
     )
diff --git a/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c b/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c
index 6b4f48f7b..fc04934dd 100644
--- a/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c
+++ b/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c
@@ -3,7 +3,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-typedef struct 
+typedef struct
 {
   char *LibraryName;
   int Argc;
@@ -24,8 +24,8 @@ static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[])
   char *ccDep[1];
   char *ccOut[1];
   cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf;
- 
-  cmVTKWrapTclData *cdata = 
+
+  cmVTKWrapTclData *cdata =
     (cmVTKWrapTclData *)malloc(sizeof(cmVTKWrapTclData));
   cdata->LibraryName = "BOO";
   cdata->Argc = argc;
@@ -36,33 +36,33 @@ static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[])
   /* already, if so use that value and don't look for the program */
   if(!info->CAPI->IsOn(mf,"TEST_COMMAND_TEST1"))
     {
-    info->CAPI->AddDefinition(mf, "TEST_DEF", "HOO");  
+    info->CAPI->AddDefinition(mf, "TEST_DEF", "HOO");
     return 1;
     }
-  
-  info->CAPI->AddDefinition(mf, "TEST_DEF", "HOO");  
+
+  info->CAPI->AddDefinition(mf, "TEST_DEF", "HOO");
   cdata->LibraryName = "HOO";
 
-  info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE", "ON", 
+  info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE", "ON",
     "Test cache variable",
     CM_CACHE_BOOL);
-  info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE1", "", 
+  info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE1", "",
     "Test cache variable 1",
     CM_CACHE_PATH);
-  info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE2", "", 
+  info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE2", "",
     "Test cache variable 2",
     CM_CACHE_FILEPATH);
-  info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE3", "", 
+  info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE3", "",
     "Test cache variable 3",
     CM_CACHE_STRING);
-  info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE4", "", 
+  info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE4", "",
     "Test cache variable 4",
     CM_CACHE_INTERNAL);
-  info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE5", "", 
+  info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE5", "",
     "Test cache variable 5",
     CM_CACHE_STATIC);
 
-  
+
   file = info->CAPI->ExpandVariablesInString(mf, "${CMAKE_COMMAND}", 0, 0);
 
   str = info->CAPI->GetFilenameWithoutExtension(file);
@@ -140,7 +140,7 @@ static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[])
                                1, ccDep,
                                1, ccOut,
                                "LoadedCommand");
-  
+
 
   ccArgs[2] = argv[1];
   ccArgs[3] = argv[2];
@@ -171,22 +171,22 @@ static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[])
     return 0;
     }
   info->CAPI->ExecuteCommand(mf,"SET",2,args);
-  
+
   /* make sure we can find the source file */
   if (!info->CAPI->GetSource(mf,argv[1]))
     {
     info->CAPI->SetError(mf, "Source file could not be found!");
-    return 0;    
+    return 0;
     }
 
   return 1;
 }
 
-static void  CCONV FinalPass(void *inf, void *mf) 
+static void  CCONV FinalPass(void *inf, void *mf)
 {
   cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf;
   /* get our client data from initial pass */
-  cmVTKWrapTclData *cdata = 
+  cmVTKWrapTclData *cdata =
     (cmVTKWrapTclData *)info->CAPI->GetClientData(info);
   if (strcmp(info->CAPI->GetDefinition(mf, "TEST_DEF"),"HOO") ||
       strcmp(cdata->LibraryName,"HOO"))
@@ -194,11 +194,11 @@ static void  CCONV FinalPass(void *inf, void *mf)
     fprintf(stderr,"*** Failed LOADED COMMAND Final Pass\n");
     }
 }
-static void CCONV Destructor(void *inf) 
+static void CCONV Destructor(void *inf)
 {
   cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf;
   /* get our client data from initial pass */
-  cmVTKWrapTclData *cdata = 
+  cmVTKWrapTclData *cdata =
     (cmVTKWrapTclData *)info->CAPI->GetClientData(info);
   free(cdata);
 }
diff --git a/Tests/LoadCommandOneConfig/CMakeLists.txt b/Tests/LoadCommandOneConfig/CMakeLists.txt
index e99105a74..4bfa59964 100644
--- a/Tests/LoadCommandOneConfig/CMakeLists.txt
+++ b/Tests/LoadCommandOneConfig/CMakeLists.txt
@@ -27,16 +27,16 @@ INCLUDE_DIRECTORIES(${LoadCommand_BINARY_DIR})
 # make sure it is not already loaded
 IF(COMMAND CMAKE_TEST_COMMAND)
 ELSE(COMMAND CMAKE_TEST_COMMAND)
-  TRY_COMPILE(COMPILE_OK 
-    ${LoadCommand_BINARY_DIR}/CMakeCommands 
-    ${LoadCommand_SOURCE_DIR}/CMakeCommands 
+  TRY_COMPILE(COMPILE_OK
+    ${LoadCommand_BINARY_DIR}/CMakeCommands
+    ${LoadCommand_SOURCE_DIR}/CMakeCommands
     CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO
     OUTPUT_VARIABLE OUTPUT )
 # do another TRY_COMPILE to get around make
 # problem on hp
-  TRY_COMPILE(COMPILE_OK 
-    ${LoadCommand_BINARY_DIR}/CMakeCommands 
-    ${LoadCommand_SOURCE_DIR}/CMakeCommands 
+  TRY_COMPILE(COMPILE_OK
+    ${LoadCommand_BINARY_DIR}/CMakeCommands
+    ${LoadCommand_SOURCE_DIR}/CMakeCommands
     CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO
     OUTPUT_VARIABLE OUTPUT )
 ENDIF(COMMAND CMAKE_TEST_COMMAND)
@@ -45,8 +45,8 @@ MESSAGE("Output from try compile: ${OUTPUT}")
 
 # if the compile was OK, try loading the command
 IF (COMPILE_OK)
-  LOAD_COMMAND(CMAKE_TEST_COMMAND 
-    ${LoadCommand_BINARY_DIR}/CMakeCommands 
+  LOAD_COMMAND(CMAKE_TEST_COMMAND
+    ${LoadCommand_BINARY_DIR}/CMakeCommands
     ${LoadCommand_BINARY_DIR}/CMakeCommands/Debug
     ${LoadCommand_BINARY_DIR}/CMakeCommands/Development
     )
diff --git a/Tests/NewlineArgs/CMakeLists.txt b/Tests/NewlineArgs/CMakeLists.txt
index a18230488..755160102 100644
--- a/Tests/NewlineArgs/CMakeLists.txt
+++ b/Tests/NewlineArgs/CMakeLists.txt
@@ -5,10 +5,10 @@ project (NewlineArgs CXX)
 add_definitions("-DTEST_FLAG_1
 -DTEST_FLAG_2")
 
-include_directories(" ${NewlineArgs_BINARY_DIR} 
+include_directories(" ${NewlineArgs_BINARY_DIR}
  ${NewlineArgs_SOURCE_DIR} ")
 
-configure_file("${NewlineArgs_SOURCE_DIR}/libcxx2.h.in" 
+configure_file("${NewlineArgs_SOURCE_DIR}/libcxx2.h.in"
   "${NewlineArgs_BINARY_DIR}/libcxx2.h")
 
 add_library(testcxx1 libcxx1.cxx)
diff --git a/Tests/ObjC++/objc++.mm b/Tests/ObjC++/objc++.mm
index f0be25682..258ebaa52 100644
--- a/Tests/ObjC++/objc++.mm
+++ b/Tests/ObjC++/objc++.mm
@@ -5,7 +5,7 @@ using namespace std;
 int main()
 {
   NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-   
+
   NSMutableSet *mySet = [NSMutableSet set];
   cout<<"Adding values to the set."<<endl;
   [mySet addObject:[NSNumber numberWithInt:356]];
diff --git a/Tests/OutOfSource/OutOfSourceSubdir/testlib.h b/Tests/OutOfSource/OutOfSourceSubdir/testlib.h
index 289b67361..75c2d84fd 100644
--- a/Tests/OutOfSource/OutOfSourceSubdir/testlib.h
+++ b/Tests/OutOfSource/OutOfSourceSubdir/testlib.h
@@ -5,7 +5,7 @@
 #    define CM_TEST_LIB_EXPORT  __declspec( dllimport )
 #  endif
 #else
-#  define CM_TEST_LIB_EXPORT 
+#  define CM_TEST_LIB_EXPORT
 #endif
 
 CM_TEST_LIB_EXPORT float TestLib();
diff --git a/Tests/Plugin/src/example_exe.cxx b/Tests/Plugin/src/example_exe.cxx
index d2c52052c..309302e58 100644
--- a/Tests/Plugin/src/example_exe.cxx
+++ b/Tests/Plugin/src/example_exe.cxx
@@ -54,7 +54,7 @@ int main()
     kwsys_ios::cerr << "Incorrect return value from plugin!"
                     << kwsys_ios::endl;
     return 1;
-    } 
+    }
   kwsys::DynamicLoader::CloseLibrary(handle);
   return 0;
 }
diff --git a/Tests/Properties/CMakeLists.txt b/Tests/Properties/CMakeLists.txt
index c1bc3b9e3..ed6d2d49e 100644
--- a/Tests/Properties/CMakeLists.txt
+++ b/Tests/Properties/CMakeLists.txt
@@ -2,15 +2,15 @@
 cmake_minimum_required (VERSION 2.6)
 project (Properties)
 
-# these first three tests really test both properties and the management of 
-# cmSourceFile objects by CMake. 
+# these first three tests really test both properties and the management of
+# cmSourceFile objects by CMake.
 
 # test properties on a build tree file that is relative (yuck)
 configure_file(properties.h.in "${Properties_BINARY_DIR}/properties.h")
 set_source_files_properties(properties.h PROPERTIES TEST1 1)
 get_source_file_property(RESULT1 properties.h TEST1)
 
-# test properties on a headerfile in the source tree 
+# test properties on a headerfile in the source tree
 # accessed without an extenion (also yuck)
 set_source_files_properties(properties2 PROPERTIES TEST2 1)
 get_source_file_property(RESULT2 properties2 TEST2)
@@ -39,7 +39,7 @@ if (NOT GLOBALRESULT)
     message(SEND_ERROR "Error: global prop not defined "
             "result is GLOBALRESULT=${GLOBALRESULT}")
 endif (NOT GLOBALRESULT)
-  
+
 set_property(GLOBAL PROPERTY GLOBALTEST 1)
 set_property(DIRECTORY PROPERTY DIRECTORYTEST 1)
 set_property(SOURCE SubDir/properties3.cxx PROPERTY SOURCETEST 1)
@@ -50,24 +50,24 @@ get_property(SOURCERESULT
   PROPERTY SOURCETEST
   )
 
-if (RESULT1 AND RESULT2 AND RESULT3 AND GLOBALRESULT AND 
+if (RESULT1 AND RESULT2 AND RESULT3 AND GLOBALRESULT AND
     DIRECTORYRESULT AND SOURCERESULT)
   add_executable (Properties SubDir/properties3.cxx properties)
-else (RESULT1 AND RESULT2 AND RESULT3 AND GLOBALRESULT AND 
+else (RESULT1 AND RESULT2 AND RESULT3 AND GLOBALRESULT AND
     DIRECTORYRESULT AND SOURCERESULT)
-  message(SEND_ERROR 
+  message(SEND_ERROR
     "Error: test results are RESULT1=${RESULT1} RESULT2=${RESULT2} "
     "RESULT3=${RESULT3} GLOBALRESULT=${GLOBALRESULT} "
     "DIRECTORYRESULT=${DIRECTORYRESULT} "
     "SOURCERESULT=${SOURCERESULT}")
-endif (RESULT1 AND RESULT2 AND RESULT3 AND GLOBALRESULT AND 
+endif (RESULT1 AND RESULT2 AND RESULT3 AND GLOBALRESULT AND
   DIRECTORYRESULT AND SOURCERESULT)
 
 # test the target property
 set_property(TARGET Properties PROPERTY TARGETTEST 1)
 get_property(TARGETRESULT TARGET Properties PROPERTY TARGETTEST)
 if (NOT TARGETRESULT)
-    message(SEND_ERROR 
+    message(SEND_ERROR
       "Error: target result is TARGETRESULT=${TARGETRESULT}")
 endif (NOT TARGETRESULT)
 
@@ -92,7 +92,7 @@ endif ()
 # test get_property SET
 get_property(TARGETRESULT TARGET Properties PROPERTY TARGETTEST SET)
 if (NOT TARGETRESULT)
-    message(SEND_ERROR 
+    message(SEND_ERROR
       "Error: target prop not set, result is TARGETRESULT=${TARGETRESULT}")
 endif (NOT TARGETRESULT)
 
diff --git a/Tests/Simple/CMakeLists.txt b/Tests/Simple/CMakeLists.txt
index dc965a733..20d970565 100644
--- a/Tests/Simple/CMakeLists.txt
+++ b/Tests/Simple/CMakeLists.txt
@@ -3,9 +3,9 @@ project (Simple)
 
 add_executable (Simple simple.cxx)
 
-add_library (simpleLib STATIC 
-  simpleLib.cxx 
-  simpleCLib.c 
+add_library (simpleLib STATIC
+  simpleLib.cxx
+  simpleCLib.c
   simpleWe.cpp
   )
 
diff --git a/Tests/Simple/simpleWe.cpp b/Tests/Simple/simpleWe.cpp
index 859e07c06..e0f22ef8d 100644
--- a/Tests/Simple/simpleWe.cpp
+++ b/Tests/Simple/simpleWe.cpp
@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-class Foo 
+class Foo
 {
 public:
   Foo()
diff --git a/Tests/SimpleCOnly/main.c b/Tests/SimpleCOnly/main.c
index e4df685cb..022a8e88d 100644
--- a/Tests/SimpleCOnly/main.c
+++ b/Tests/SimpleCOnly/main.c
@@ -3,7 +3,7 @@
 extern int foo();
 extern int bar();
 
-int main() 
+int main()
 {
    int i=foo();
    int k=bar();
diff --git a/Tests/SimpleInstall/CMakeLists.txt b/Tests/SimpleInstall/CMakeLists.txt
index 378b5292b..a47c546e7 100644
--- a/Tests/SimpleInstall/CMakeLists.txt
+++ b/Tests/SimpleInstall/CMakeLists.txt
@@ -53,15 +53,15 @@ IF(STAGE2)
   SET(TEST2_LIBRARY "TEST2_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE)
   SET(TEST4_LIBRARY "TEST4_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE)
 
-  FIND_LIBRARY(TEST1_LIBRARY 
+  FIND_LIBRARY(TEST1_LIBRARY
     NAMES ${t1NAMES}
     PATHS ${LIBPATHS}
     DOC "First library")
-  FIND_LIBRARY(TEST2_LIBRARY 
+  FIND_LIBRARY(TEST2_LIBRARY
     NAMES ${t2NAMES}
     PATHS ${LIBPATHS}
     DOC "Second library")
-  FIND_LIBRARY(TEST4_LIBRARY 
+  FIND_LIBRARY(TEST4_LIBRARY
     NAMES ${t4NAMES}
     PATHS ${LIBPATHS}
     DOC "Fourth library")
@@ -200,7 +200,7 @@ ELSE(STAGE2)
     RUNTIME DESTINATION MyTest/bin        COMPONENT Runtime     # .exe, .dll
     LIBRARY DESTINATION MyTest/lib        COMPONENT Runtime     # .so, mod.dll
     ARCHIVE DESTINATION MyTest/lib/static COMPONENT Development # .a, .lib
-    PUBLIC_HEADER DESTINATION MyTest/include COMPONENT Development 
+    PUBLIC_HEADER DESTINATION MyTest/include COMPONENT Development
     )
 
   INSTALL(TARGETS test4 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
@@ -227,11 +227,11 @@ ELSE(STAGE2)
     scripts/sample_script scripts/sample_script.bat)
 
 # "export" the targets collected in "SimpleInstallS1"
-  INSTALL(EXPORT SimpleInstallS1 FILE SimpleInstallS1Config.cmake 
-                                 DESTINATION MyTest/lib 
+  INSTALL(EXPORT SimpleInstallS1 FILE SimpleInstallS1Config.cmake
+                                 DESTINATION MyTest/lib
                                  NAMESPACE S1_ )
 
-  EXPORT(TARGETS SimpleInstall test1 test2 test3 
+  EXPORT(TARGETS SimpleInstall test1 test2 test3
          FILE "${CMAKE_CURRENT_BINARY_DIR}/SimpleInstallS1Config.cmake"
          NAMESPACE S2_ )
 
@@ -299,9 +299,9 @@ ELSE(STAGE2)
     ADDITIONAL_MAKE_CLEAN_FILES
     "${CMAKE_INSTALL_PREFIX}/InstallScriptOut.cmake;${CMAKE_INSTALL_PREFIX}/InstallScript4Out.cmake")
 
-  SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES PRE_INSTALL_SCRIPT 
+  SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES PRE_INSTALL_SCRIPT
     ${CMAKE_CURRENT_SOURCE_DIR}/PreInstall.cmake)
-  SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES POST_INSTALL_SCRIPT 
+  SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES POST_INSTALL_SCRIPT
     ${CMAKE_CURRENT_SOURCE_DIR}/PostInstall.cmake)
   SET_TARGET_PROPERTIES(test4 PROPERTIES VERSION 1.2 SOVERSION 3
         INSTALL_NAME_DIR @executable_path/../lib)
diff --git a/Tests/SimpleInstall/PackageScript.cmake b/Tests/SimpleInstall/PackageScript.cmake
index 3567a2f43..36429e2f7 100644
--- a/Tests/SimpleInstall/PackageScript.cmake
+++ b/Tests/SimpleInstall/PackageScript.cmake
@@ -4,7 +4,7 @@ MESSAGE("It writes a file with all variables available in ${CMAKE_INSTALL_PREFIX
 FILE(WRITE ${CMAKE_INSTALL_PREFIX}/AllVariables.txt "")
 GET_CMAKE_PROPERTY(res VARIABLES)
 FOREACH(var ${res})
-  FILE(APPEND ${CMAKE_INSTALL_PREFIX}/AllVariables.txt 
+  FILE(APPEND ${CMAKE_INSTALL_PREFIX}/AllVariables.txt
              "${var} \"${${var}}\"\n")
 ENDFOREACH(var ${res})
 
diff --git a/Tests/SimpleInstall/lib2.h b/Tests/SimpleInstall/lib2.h
index ea5a6f7ea..d69b78613 100644
--- a/Tests/SimpleInstall/lib2.h
+++ b/Tests/SimpleInstall/lib2.h
@@ -5,7 +5,7 @@
 #    define CM_TEST_LIB_EXPORT  __declspec( dllimport )
 #  endif
 #else
-#  define CM_TEST_LIB_EXPORT 
+#  define CM_TEST_LIB_EXPORT
 #endif
 
 CM_TEST_LIB_EXPORT float Lib2Func();
diff --git a/Tests/SimpleInstall/lib3.h b/Tests/SimpleInstall/lib3.h
index c250ed769..66bc52a7f 100644
--- a/Tests/SimpleInstall/lib3.h
+++ b/Tests/SimpleInstall/lib3.h
@@ -5,7 +5,7 @@
 #    define CM_TEST_LIB_EXPORT  __declspec( dllimport )
 #  endif
 #else
-#  define CM_TEST_LIB_EXPORT 
+#  define CM_TEST_LIB_EXPORT
 #endif
 
 CM_TEST_LIB_EXPORT float Lib3Func();
diff --git a/Tests/SimpleInstall/lib4.h b/Tests/SimpleInstall/lib4.h
index 4b94ea207..11c127247 100644
--- a/Tests/SimpleInstall/lib4.h
+++ b/Tests/SimpleInstall/lib4.h
@@ -5,7 +5,7 @@
 #    define CM_TEST_LIB_EXPORT  __declspec( dllimport )
 #  endif
 #else
-#  define CM_TEST_LIB_EXPORT 
+#  define CM_TEST_LIB_EXPORT
 #endif
 
 CM_TEST_LIB_EXPORT float Lib4Func();
diff --git a/Tests/SimpleInstallS2/CMakeLists.txt b/Tests/SimpleInstallS2/CMakeLists.txt
index 378b5292b..a47c546e7 100644
--- a/Tests/SimpleInstallS2/CMakeLists.txt
+++ b/Tests/SimpleInstallS2/CMakeLists.txt
@@ -53,15 +53,15 @@ IF(STAGE2)
   SET(TEST2_LIBRARY "TEST2_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE)
   SET(TEST4_LIBRARY "TEST4_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE)
 
-  FIND_LIBRARY(TEST1_LIBRARY 
+  FIND_LIBRARY(TEST1_LIBRARY
     NAMES ${t1NAMES}
     PATHS ${LIBPATHS}
     DOC "First library")
-  FIND_LIBRARY(TEST2_LIBRARY 
+  FIND_LIBRARY(TEST2_LIBRARY
     NAMES ${t2NAMES}
     PATHS ${LIBPATHS}
     DOC "Second library")
-  FIND_LIBRARY(TEST4_LIBRARY 
+  FIND_LIBRARY(TEST4_LIBRARY
     NAMES ${t4NAMES}
     PATHS ${LIBPATHS}
     DOC "Fourth library")
@@ -200,7 +200,7 @@ ELSE(STAGE2)
     RUNTIME DESTINATION MyTest/bin        COMPONENT Runtime     # .exe, .dll
     LIBRARY DESTINATION MyTest/lib        COMPONENT Runtime     # .so, mod.dll
     ARCHIVE DESTINATION MyTest/lib/static COMPONENT Development # .a, .lib
-    PUBLIC_HEADER DESTINATION MyTest/include COMPONENT Development 
+    PUBLIC_HEADER DESTINATION MyTest/include COMPONENT Development
     )
 
   INSTALL(TARGETS test4 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
@@ -227,11 +227,11 @@ ELSE(STAGE2)
     scripts/sample_script scripts/sample_script.bat)
 
 # "export" the targets collected in "SimpleInstallS1"
-  INSTALL(EXPORT SimpleInstallS1 FILE SimpleInstallS1Config.cmake 
-                                 DESTINATION MyTest/lib 
+  INSTALL(EXPORT SimpleInstallS1 FILE SimpleInstallS1Config.cmake
+                                 DESTINATION MyTest/lib
                                  NAMESPACE S1_ )
 
-  EXPORT(TARGETS SimpleInstall test1 test2 test3 
+  EXPORT(TARGETS SimpleInstall test1 test2 test3
          FILE "${CMAKE_CURRENT_BINARY_DIR}/SimpleInstallS1Config.cmake"
          NAMESPACE S2_ )
 
@@ -299,9 +299,9 @@ ELSE(STAGE2)
     ADDITIONAL_MAKE_CLEAN_FILES
     "${CMAKE_INSTALL_PREFIX}/InstallScriptOut.cmake;${CMAKE_INSTALL_PREFIX}/InstallScript4Out.cmake")
 
-  SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES PRE_INSTALL_SCRIPT 
+  SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES PRE_INSTALL_SCRIPT
     ${CMAKE_CURRENT_SOURCE_DIR}/PreInstall.cmake)
-  SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES POST_INSTALL_SCRIPT 
+  SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES POST_INSTALL_SCRIPT
     ${CMAKE_CURRENT_SOURCE_DIR}/PostInstall.cmake)
   SET_TARGET_PROPERTIES(test4 PROPERTIES VERSION 1.2 SOVERSION 3
         INSTALL_NAME_DIR @executable_path/../lib)
diff --git a/Tests/SimpleInstallS2/PackageScript.cmake b/Tests/SimpleInstallS2/PackageScript.cmake
index 3567a2f43..36429e2f7 100644
--- a/Tests/SimpleInstallS2/PackageScript.cmake
+++ b/Tests/SimpleInstallS2/PackageScript.cmake
@@ -4,7 +4,7 @@ MESSAGE("It writes a file with all variables available in ${CMAKE_INSTALL_PREFIX
 FILE(WRITE ${CMAKE_INSTALL_PREFIX}/AllVariables.txt "")
 GET_CMAKE_PROPERTY(res VARIABLES)
 FOREACH(var ${res})
-  FILE(APPEND ${CMAKE_INSTALL_PREFIX}/AllVariables.txt 
+  FILE(APPEND ${CMAKE_INSTALL_PREFIX}/AllVariables.txt
              "${var} \"${${var}}\"\n")
 ENDFOREACH(var ${res})
 
diff --git a/Tests/SimpleInstallS2/lib2.h b/Tests/SimpleInstallS2/lib2.h
index ea5a6f7ea..d69b78613 100644
--- a/Tests/SimpleInstallS2/lib2.h
+++ b/Tests/SimpleInstallS2/lib2.h
@@ -5,7 +5,7 @@
 #    define CM_TEST_LIB_EXPORT  __declspec( dllimport )
 #  endif
 #else
-#  define CM_TEST_LIB_EXPORT 
+#  define CM_TEST_LIB_EXPORT
 #endif
 
 CM_TEST_LIB_EXPORT float Lib2Func();
diff --git a/Tests/SimpleInstallS2/lib3.h b/Tests/SimpleInstallS2/lib3.h
index c250ed769..66bc52a7f 100644
--- a/Tests/SimpleInstallS2/lib3.h
+++ b/Tests/SimpleInstallS2/lib3.h
@@ -5,7 +5,7 @@
 #    define CM_TEST_LIB_EXPORT  __declspec( dllimport )
 #  endif
 #else
-#  define CM_TEST_LIB_EXPORT 
+#  define CM_TEST_LIB_EXPORT
 #endif
 
 CM_TEST_LIB_EXPORT float Lib3Func();
diff --git a/Tests/SimpleInstallS2/lib4.h b/Tests/SimpleInstallS2/lib4.h
index 4b94ea207..11c127247 100644
--- a/Tests/SimpleInstallS2/lib4.h
+++ b/Tests/SimpleInstallS2/lib4.h
@@ -5,7 +5,7 @@
 #    define CM_TEST_LIB_EXPORT  __declspec( dllimport )
 #  endif
 #else
-#  define CM_TEST_LIB_EXPORT 
+#  define CM_TEST_LIB_EXPORT
 #endif
 
 CM_TEST_LIB_EXPORT float Lib4Func();
diff --git a/Tests/SourceGroups/CMakeLists.txt b/Tests/SourceGroups/CMakeLists.txt
index c3cf38c7a..6573c8241 100644
--- a/Tests/SourceGroups/CMakeLists.txt
+++ b/Tests/SourceGroups/CMakeLists.txt
@@ -2,9 +2,9 @@ cmake_minimum_required (VERSION 2.6)
 project(SourceGroups)
 
 # this is not really a test which can fail
-# it is more an example with several source_group() 
+# it is more an example with several source_group()
 # commands.
-# The created projects have to be loaded manually 
+# The created projects have to be loaded manually
 # in Visual Studio/Xcode/Eclipse/...
 # to see whether the correct groups have been created.
 
@@ -19,7 +19,7 @@ source_group(Base\\Sub1\\Sub2 FILES sub1/foobar.c)
 # a group with empty name
 source_group("" FILES foo.c)
 
-# a group, whose name consists only of the delimiter 
+# a group, whose name consists only of the delimiter
 #should be handled the same way as an empty name
 source_group("\\" FILES baz.c)
 
diff --git a/Tests/SourceGroups/README.txt b/Tests/SourceGroups/README.txt
index 1a4baf536..8b1378917 100644
--- a/Tests/SourceGroups/README.txt
+++ b/Tests/SourceGroups/README.txt
@@ -1 +1 @@
-  
+
diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt
index 7792a353d..13283d0c2 100644
--- a/Tests/StringFileTest/CMakeLists.txt
+++ b/Tests/StringFileTest/CMakeLists.txt
@@ -149,8 +149,8 @@ IF(NOT "$ENV{x+(y)}" STREQUAL "Obscure environment variable value")
 ENDIF()
 
 # Make directories test
-FILE(MAKE_DIRECTORY 
-  "${CMAKE_CURRENT_BINARY_DIR}/Includes" 
+FILE(MAKE_DIRECTORY
+  "${CMAKE_CURRENT_BINARY_DIR}/Includes"
   "${CMAKE_CURRENT_BINARY_DIR}/Directory1"
   "${CMAKE_CURRENT_BINARY_DIR}/Directory2"
   )
diff --git a/Tests/StringFileTest/InputFile.h.in b/Tests/StringFileTest/InputFile.h.in
index 3e70a36e8..0f01ccfc6 100644
--- a/Tests/StringFileTest/InputFile.h.in
+++ b/Tests/StringFileTest/InputFile.h.in
@@ -3,7 +3,7 @@
 /* This should be configured to a define.  */
 #cmakedefine TEST_DEFINED @TEST_DEFINED@
 /* This should be configured to a commented undef with the curlies in place */
-#cmakedefine TEST_NOT_DEFINED ${TEST_NOT_DEFINED} 
+#cmakedefine TEST_NOT_DEFINED ${TEST_NOT_DEFINED}
 
 /* This complicated line should be configured unchanged: */
 static const char* configvar =
@@ -34,5 +34,5 @@ int CheckMethod(const char* var, const char* val )
   return 1;
 #else
   return 0;
-#endif  
+#endif
 }
diff --git a/Tests/StringFileTest/StringFile.cxx b/Tests/StringFileTest/StringFile.cxx
index 609ebaf20..9eba6bff9 100644
--- a/Tests/StringFileTest/StringFile.cxx
+++ b/Tests/StringFileTest/StringFile.cxx
@@ -26,6 +26,6 @@ int main(int, char*[])
   res += CheckMethod(relpath, "../../X11R6/bin/xnest");
   res += CheckMethod(configvar,
                      "@$@$junk =~ s/#$xyz#/$foo_bar{$wibble}->{$xyz}/;@@");
-  
+
   return res;
 }
diff --git a/Tests/SubDir/CMakeLists.txt b/Tests/SubDir/CMakeLists.txt
index 9cfbe25ce..cf8fe97fa 100644
--- a/Tests/SubDir/CMakeLists.txt
+++ b/Tests/SubDir/CMakeLists.txt
@@ -4,11 +4,11 @@ SUBDIRS(Executable EXCLUDE_FROM_ALL Examples)
 WRITE_FILE(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.")
 #WATCOM WMAKE does not support + in the name of a file!
 IF(WATCOM)
-  SET(PLUS_NAME_FILES 
+  SET(PLUS_NAME_FILES
     AnotherSubdir/pair_int.int.c
     vcl_algorithm_vcl_pair_double.foo.c)
 ELSE(WATCOM)
-    SET(PLUS_NAME_FILES 
+    SET(PLUS_NAME_FILES
     AnotherSubdir/pair+int.int.c
     vcl_algorithm+vcl_pair+double.foo.c)
 ENDIF(WATCOM)
@@ -28,7 +28,7 @@ IF(WATCOM)
     ENDIF("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
   ENDFOREACH(f)
   SET(SOURCES ${SOURCES2})
-  SET(SOURCES ${SOURCES} 
+  SET(SOURCES ${SOURCES}
     vcl_algorithm_vcl_pair_double.foo.c)
 ELSE(WATCOM)
   FOREACH(f ${SOURCES})
@@ -39,8 +39,8 @@ ELSE(WATCOM)
     ENDIF("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
   ENDFOREACH(f)
   SET(SOURCES ${SOURCES2})
-  SET(SOURCES ${SOURCES} 
+  SET(SOURCES ${SOURCES}
     vcl_algorithm+vcl_pair+double.foo.c)
-ENDIF(WATCOM)  
+ENDIF(WATCOM)
 MESSAGE("Sources: ${SOURCES}")
 ADD_EXECUTABLE(TestWithAuxSourceDir ${SOURCES})
diff --git a/Tests/SubDirSpaces/CMakeLists.txt b/Tests/SubDirSpaces/CMakeLists.txt
index 879530b56..a0053a236 100644
--- a/Tests/SubDirSpaces/CMakeLists.txt
+++ b/Tests/SubDirSpaces/CMakeLists.txt
@@ -33,11 +33,11 @@ ENDIF(CMAKE_PAREN)
 WRITE_FILE(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.")
 #WATCOM WMAKE does not support + in the name of a file!
 IF(WATCOM)
-  SET(PLUS_NAME_FILES 
+  SET(PLUS_NAME_FILES
     "Another Subdir/pair_int.int.c"
     vcl_algorithm_vcl_pair_double.foo.c)
 ELSE(WATCOM)
-    SET(PLUS_NAME_FILES 
+    SET(PLUS_NAME_FILES
     "Another Subdir/pair+int.int.c"
     vcl_algorithm+vcl_pair+double.foo.c)
 ENDIF(WATCOM)
@@ -57,7 +57,7 @@ IF(WATCOM)
     ENDIF("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
   ENDFOREACH(f)
   SET(SOURCES ${SOURCES2})
-  SET(SOURCES ${SOURCES} 
+  SET(SOURCES ${SOURCES}
     vcl_algorithm_vcl_pair_double.foo.c)
 ELSE(WATCOM)
   FOREACH(f ${SOURCES})
@@ -67,9 +67,9 @@ ELSE(WATCOM)
     ENDIF("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
   ENDFOREACH(f)
   SET(SOURCES ${SOURCES2})
-  SET(SOURCES ${SOURCES} 
+  SET(SOURCES ${SOURCES}
     vcl_algorithm+vcl_pair+double.foo.c)
-ENDIF(WATCOM)  
+ENDIF(WATCOM)
 ADD_EXECUTABLE(TestWithAuxSourceDir ${SOURCES})
 IF(CMAKE_PAREN)
   target_link_libraries(TestWithAuxSourceDir testOddPath)
diff --git a/Tests/SwigTest/CMakeLists.txt b/Tests/SwigTest/CMakeLists.txt
index 5a8e61922..7e216446d 100644
--- a/Tests/SwigTest/CMakeLists.txt
+++ b/Tests/SwigTest/CMakeLists.txt
@@ -30,7 +30,7 @@ IF(${language} MATCHES ruby)
 ENDIF(${language} MATCHES ruby)
 IF(${language} MATCHES php4)
   FIND_PACKAGE(PHP4)
-  INCLUDE_DIRECTORIES(${PHP4_INCLUDE_PATH}) 
+  INCLUDE_DIRECTORIES(${PHP4_INCLUDE_PATH})
   SET(SWIG_LANG_LIBRARIES ${PHP4_LIBRARY})
 ENDIF(${language} MATCHES php4)
 IF(${language} MATCHES pike)
diff --git a/Tests/SwigTest/example.h b/Tests/SwigTest/example.h
index 46d901361..c9d59f22b 100644
--- a/Tests/SwigTest/example.h
+++ b/Tests/SwigTest/example.h
@@ -8,7 +8,7 @@ public:
   virtual ~Shape() {
     nshapes--;
   };
-  double  x, y;   
+  double  x, y;
   void    move(double dx, double dy);
   virtual double area(void) = 0;
   virtual double perimeter(void) = 0;
@@ -36,4 +36,4 @@ public:
 
 
 
-  
+
diff --git a/Tests/SwigTest/runme.pike b/Tests/SwigTest/runme.pike
index a6377600e..ec28dd70e 100755
--- a/Tests/SwigTest/runme.pike
+++ b/Tests/SwigTest/runme.pike
@@ -42,12 +42,12 @@ int main()
 
     /* See if we can force 's' to be garbage-collected */
     s = 0;
-    
+
     /* Now we should be down to only 1 shape */
     write("%d shapes remain\n", Shape_nshapes_get());
-    
+
     /* Done */
     write("Goodbye\n");
-    
+
     return 0;
 }
diff --git a/Tests/SwigTest/runme.py b/Tests/SwigTest/runme.py
index 42a5aa363..ed3909e30 100644
--- a/Tests/SwigTest/runme.py
+++ b/Tests/SwigTest/runme.py
@@ -3,7 +3,7 @@
 # This file illustrates the shadow-class C++ interface generated
 # by SWIG.
 
-import example 
+import example
 
 # ----- Object creation -----
 
diff --git a/Tests/SystemInformation/CMakeLists.txt b/Tests/SystemInformation/CMakeLists.txt
index c4285758e..6654664a1 100644
--- a/Tests/SystemInformation/CMakeLists.txt
+++ b/Tests/SystemInformation/CMakeLists.txt
@@ -8,9 +8,9 @@ SET_DIRECTORY_PROPERTIES(PROPERTIES INCLUDE_DIRECTORIES "${SystemInformation_BIN
 MESSAGE("To prevent CTest from stripping output, you have to display: CTEST_FULL_OUTPUT")
 
 
-CONFIGURE_FILE(${SystemInformation_SOURCE_DIR}/SystemInformation.in 
+CONFIGURE_FILE(${SystemInformation_SOURCE_DIR}/SystemInformation.in
 ${SystemInformation_BINARY_DIR}/SystemInformation.out)
-CONFIGURE_FILE(${SystemInformation_SOURCE_DIR}/DumpInformation.h.in 
+CONFIGURE_FILE(${SystemInformation_SOURCE_DIR}/DumpInformation.h.in
 ${SystemInformation_BINARY_DIR}/DumpInformation.h)
 ADD_EXECUTABLE(SystemInformation DumpInformation.cxx)
 
@@ -23,21 +23,21 @@ FOO(lala)
 FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt "")
 GET_CMAKE_PROPERTY(res VARIABLES)
 FOREACH(var ${res})
-  FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt 
+  FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt
              "${var} \"${${var}}\"\n")
 ENDFOREACH(var ${res})
 
 FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllCommands.txt "")
 GET_CMAKE_PROPERTY(res COMMANDS)
 FOREACH(var ${res})
-  FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllCommands.txt 
+  FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllCommands.txt
              "${var}\n")
 ENDFOREACH(var ${res})
 
 FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt "")
 GET_CMAKE_PROPERTY(res MACROS)
 FOREACH(var ${res})
-  FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt 
+  FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt
              "${var}\n")
 ENDFOREACH(var ${res})
 
diff --git a/Tests/SystemInformation/DumpInformation.cxx b/Tests/SystemInformation/DumpInformation.cxx
index 579dcbcf2..acafa874d 100644
--- a/Tests/SystemInformation/DumpInformation.cxx
+++ b/Tests/SystemInformation/DumpInformation.cxx
@@ -15,7 +15,7 @@ void cmDumpInformationPrintFile(const char* name, FILE* fout)
     fflush(fout);
     return;
     }
-  
+
   FILE* fin = fopen(name, "r");
   if(fin)
     {
@@ -59,7 +59,7 @@ int main(int,char *[])
       DumpInformation_BINARY_DIR "/AllMacros.txt",
       DumpInformation_BINARY_DIR "/OtherProperties.txt",
       DumpInformation_BINARY_DIR "/../../Source/cmConfigure.h",
-      DumpInformation_BINARY_DIR "/../../CMakeCache.txt", 
+      DumpInformation_BINARY_DIR "/../../CMakeCache.txt",
       DumpInformation_BINARY_DIR "/../../CMakeFiles/CMakeOutput.log",
       DumpInformation_BINARY_DIR "/../../CMakeFiles/CMakeError.log",
       DumpInformation_BINARY_DIR "/../../Bootstrap.cmk/cmake_bootstrap.log",
@@ -75,6 +75,6 @@ int main(int,char *[])
     {
     cmDumpInformationPrintFile(*f, stdout);
     }
-  
+
   return 0;
-} 
+}
diff --git a/Tests/TargetName/scripts/CMakeLists.txt b/Tests/TargetName/scripts/CMakeLists.txt
index 40d4e2fb0..a693e403e 100644
--- a/Tests/TargetName/scripts/CMakeLists.txt
+++ b/Tests/TargetName/scripts/CMakeLists.txt
@@ -1,7 +1,7 @@
 if(NOT CMAKE_BINARY_DIR STREQUAL "${CMAKE_SOURCE_DIR}")
   add_custom_command(
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hello_world
-  COMMAND ${CMAKE_COMMAND} -E copy 
+  COMMAND ${CMAKE_COMMAND} -E copy
   ${CMAKE_CURRENT_SOURCE_DIR}/hello_world ${CMAKE_CURRENT_BINARY_DIR}
   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/hello_world
   )
diff --git a/Tests/TestDriver/CMakeLists.txt b/Tests/TestDriver/CMakeLists.txt
index bd5e97414..cc953ce3f 100644
--- a/Tests/TestDriver/CMakeLists.txt
+++ b/Tests/TestDriver/CMakeLists.txt
@@ -4,11 +4,11 @@ PROJECT(TestDriverTest)
 SET(Extra_SRCS testExtraStuff.cxx testExtraStuff2.cxx )
 SET(Extra_SRCS ${Extra_SRCS};testExtraStuff3.cxx )
 INCLUDE_DIRECTORIES(${TestDriverTest_SOURCE_DIR})
-CREATE_TEST_SOURCELIST(testSrcs 
-                       TestDriverTest.cxx 
-                       test1.cxx 
-                       test2.cxx 
-                       subdir/test3.cxx 
+CREATE_TEST_SOURCELIST(testSrcs
+                       TestDriverTest.cxx
+                       test1.cxx
+                       test2.cxx
+                       subdir/test3.cxx
                        EXTRA_INCLUDE testArgs.h FUNCTION testProccessArgs)
 
 ADD_EXECUTABLE(TestDriverTest ${testSrcs} ${Extra_SRCS})
diff --git a/Tests/TestDriver/test1.cxx b/Tests/TestDriver/test1.cxx
index ac82f8ae9..b998fdae6 100644
--- a/Tests/TestDriver/test1.cxx
+++ b/Tests/TestDriver/test1.cxx
@@ -17,7 +17,7 @@ int test1(int ac, char* av[])
     {
     return -1;
     }
-  
+
   printf("test1\n");
   for(int i =0; i < ac; i++)
     printf("arg %d is %s\n", ac, av[i]);
diff --git a/Tests/Testing/CMakeLists.txt b/Tests/Testing/CMakeLists.txt
index 815b52b58..5c6f37c6e 100644
--- a/Tests/Testing/CMakeLists.txt
+++ b/Tests/Testing/CMakeLists.txt
@@ -7,12 +7,12 @@ PROJECT (Testing)
 #
 # Lib and exe path
 #
-SET (LIBRARY_OUTPUT_PATH 
-     ${Testing_BINARY_DIR}/bin/ CACHE PATH 
+SET (LIBRARY_OUTPUT_PATH
+     ${Testing_BINARY_DIR}/bin/ CACHE PATH
      "Single output directory for building all libraries.")
 
-SET (EXECUTABLE_OUTPUT_PATH 
-     ${Testing_BINARY_DIR}/bin/ CACHE PATH 
+SET (EXECUTABLE_OUTPUT_PATH
+     ${Testing_BINARY_DIR}/bin/ CACHE PATH
      "Single output directory for building all executables.")
 
 #
diff --git a/Tests/Testing/DartConfig.cmake b/Tests/Testing/DartConfig.cmake
index 26af720ac..9494eeccb 100644
--- a/Tests/Testing/DartConfig.cmake
+++ b/Tests/Testing/DartConfig.cmake
@@ -9,7 +9,7 @@ SET (DROP_SITE_USER "")
 SET (DROP_SITE_PASSWORD "")
 SET (TRIGGER_SITE "")
 
-# Dart server configuration 
+# Dart server configuration
 # SET (CVS_WEB_URL "")
 # SET (CVS_WEB_CVSROOT "")
 # SET (USE_DOXYGEN "Off")
diff --git a/Tests/TryCompile/CMakeLists.txt b/Tests/TryCompile/CMakeLists.txt
index 938c092c0..8bfb61eef 100644
--- a/Tests/TryCompile/CMakeLists.txt
+++ b/Tests/TryCompile/CMakeLists.txt
@@ -29,7 +29,7 @@ ENDMACRO(TEST_EXPECT_CONTAINS command expected)
 # try to compile a file that should compile
 # also check that COPY_FILE works
 TRY_COMPILE(SHOULD_PASS
-    ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp  
+    ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
     ${TryCompile_SOURCE_DIR}/pass.c
     OUTPUT_VARIABLE TRY_OUT
     COPY_FILE ${TryCompile_BINARY_DIR}/CopyOfPass
@@ -46,7 +46,7 @@ ENDIF(NOT EXISTS "${TryCompile_BINARY_DIR}/CopyOfPass")
 
 # try to compile a file that should not compile
 TRY_COMPILE(SHOULD_FAIL
-    ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp  
+    ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
     ${TryCompile_SOURCE_DIR}/fail.c
     OUTPUT_VARIABLE TRY_OUT)
 IF(SHOULD_FAIL)
@@ -55,7 +55,7 @@ ENDIF(SHOULD_FAIL)
 
 # try to compile a file that should compile
 TRY_COMPILE(SHOULD_PASS
-    ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp  
+    ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
     ${TryCompile_SOURCE_DIR}/pass.c
     OUTPUT_VARIABLE TRY_OUT)
 IF(NOT SHOULD_PASS)
@@ -64,7 +64,7 @@ ENDIF(NOT SHOULD_PASS)
 
 # try to compile a file that should not compile
 TRY_COMPILE(SHOULD_FAIL
-    ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp 
+    ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
     ${TryCompile_SOURCE_DIR}/fail.c
     OUTPUT_VARIABLE TRY_OUT)
 IF(SHOULD_FAIL)
@@ -80,8 +80,8 @@ IF(NOT SHOULD_FAIL)
 ELSE(NOT SHOULD_FAIL)
   MESSAGE("Test failed")
 ENDIF(NOT SHOULD_FAIL)
-TRY_COMPILE(CMAKE_ANSI_FOR_SCOPE   
-  ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp 
+TRY_COMPILE(CMAKE_ANSI_FOR_SCOPE
+  ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
     ${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx OUTPUT_VARIABLE OUT)
 IF (CMAKE_ANSI_FOR_SCOPE)
    MESSAGE("Compiler supports ansi for")
@@ -90,13 +90,13 @@ ELSE(CMAKE_ANSI_FOR_SCOPE)
 ENDIF(CMAKE_ANSI_FOR_SCOPE)
 
 TRY_COMPILE(CMAKE_ANSI_FOR_SCOPE
-  ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp 
+  ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
     ${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx OUTPUT_VARIABLE OUT)
 IF (CMAKE_ANSI_FOR_SCOPE)
    MESSAGE("Compiler supports ansi for")
 ELSE(CMAKE_ANSI_FOR_SCOPE)
    MESSAGE("Compiler does not support ansi for scope")
-ENDIF(CMAKE_ANSI_FOR_SCOPE)        
+ENDIF(CMAKE_ANSI_FOR_SCOPE)
 
 MESSAGE("use the module now")
 INCLUDE(${CMAKE_ROOT}/Modules/TestForANSIForScope.cmake)
@@ -124,7 +124,7 @@ ADD_EXECUTABLE(TryCompile pass.c)
 # also check that OUTPUT_VARIABLE contains both the compile output
 # and the run output
 TRY_RUN(SHOULD_RUN SHOULD_COMPILE
-    ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp  
+    ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
     ${TryCompile_SOURCE_DIR}/exit_success.c
     OUTPUT_VARIABLE TRY_OUT)
 IF(NOT SHOULD_COMPILE)
@@ -143,7 +143,7 @@ IF(NOT "${TRY_OUT}" MATCHES "hello world")
 ENDIF(NOT "${TRY_OUT}" MATCHES "hello world")
 
 TRY_RUN(ARG_TEST_RUN ARG_TEST_COMPILE
-    ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp  
+    ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
     ${TryCompile_SOURCE_DIR}/expect_arg.c
     OUTPUT_VARIABLE TRY_OUT
     ARGS arg1 arg2)
@@ -156,7 +156,7 @@ ENDIF(NOT "${ARG_TEST_RUN}" STREQUAL "0")
 
 # try to run a file that should compile and run, but return an error
 TRY_RUN(SHOULD_EXIT_WITH_ERROR SHOULD_COMPILE
-    ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp  
+    ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
     ${TryCompile_SOURCE_DIR}/exit_with_error.c
     COMPILE_OUTPUT_VARIABLE COMPILE_OUTPUT
     RUN_OUTPUT_VARIABLE RUN_OUTPUT)
diff --git a/Tests/TryCompile/expect_arg.c b/Tests/TryCompile/expect_arg.c
index 7ca49aa43..f18e03f60 100644
--- a/Tests/TryCompile/expect_arg.c
+++ b/Tests/TryCompile/expect_arg.c
@@ -10,7 +10,7 @@ int main(int ac, char*av[])
     }
   if(ac == 3)
     {
-    if(strcmp(av[1], "arg1") ==0 
+    if(strcmp(av[1], "arg1") ==0
        && strcmp(av[2], "arg2") ==0)
       {
       printf("arg1 and arg2 present and accounted for!\n");
diff --git a/Tests/TryCompile/pass.c b/Tests/TryCompile/pass.c
index 40bc5e2dd..43e8a7ee0 100644
--- a/Tests/TryCompile/pass.c
+++ b/Tests/TryCompile/pass.c
@@ -3,4 +3,4 @@ int main()
   return 0;
 }
 
-    
+
diff --git a/Tests/Tutorial/Step2/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step2/MathFunctions/mysqrt.cxx
index 76b8e2d9d..62523f69f 100644
--- a/Tests/Tutorial/Step2/MathFunctions/mysqrt.cxx
+++ b/Tests/Tutorial/Step2/MathFunctions/mysqrt.cxx
@@ -8,9 +8,9 @@ double mysqrt(double x)
     {
     return 0;
     }
-  
+
   double result;
-  double delta;  
+  double delta;
   result = x;
 
   // do ten iterations
diff --git a/Tests/Tutorial/Step3/CMakeLists.txt b/Tests/Tutorial/Step3/CMakeLists.txt
index 0b05fd737..22d715041 100644
--- a/Tests/Tutorial/Step3/CMakeLists.txt
+++ b/Tests/Tutorial/Step3/CMakeLists.txt
@@ -32,7 +32,7 @@ target_link_libraries (Tutorial  ${EXTRA_LIBS})
 
 # add the install targets
 install (TARGETS Tutorial DESTINATION bin)
-install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h" 
+install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
   DESTINATION include)
 
 
@@ -44,7 +44,7 @@ add_test (TutorialRuns Tutorial 25)
 
 # does it sqrt of 25
 add_test (TutorialComp25 Tutorial 25)
-set_tests_properties (TutorialComp25 
+set_tests_properties (TutorialComp25
   PROPERTIES PASS_REGULAR_EXPRESSION "25 is 5"
   )
 
@@ -63,6 +63,6 @@ set_tests_properties (TutorialSmall
 # does the usage message work?
 add_test (TutorialUsage Tutorial)
 set_tests_properties (TutorialUsage
-  PROPERTIES 
+  PROPERTIES
   PASS_REGULAR_EXPRESSION "Usage:.*number"
   )
diff --git a/Tests/Tutorial/Step3/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step3/MathFunctions/mysqrt.cxx
index 76b8e2d9d..62523f69f 100644
--- a/Tests/Tutorial/Step3/MathFunctions/mysqrt.cxx
+++ b/Tests/Tutorial/Step3/MathFunctions/mysqrt.cxx
@@ -8,9 +8,9 @@ double mysqrt(double x)
     {
     return 0;
     }
-  
+
   double result;
-  double delta;  
+  double delta;
   result = x;
 
   // do ten iterations
diff --git a/Tests/Tutorial/Step4/CMakeLists.txt b/Tests/Tutorial/Step4/CMakeLists.txt
index 3b24b4416..fbceedbcb 100644
--- a/Tests/Tutorial/Step4/CMakeLists.txt
+++ b/Tests/Tutorial/Step4/CMakeLists.txt
@@ -37,7 +37,7 @@ target_link_libraries (Tutorial  ${EXTRA_LIBS})
 
 # add the install targets
 install (TARGETS Tutorial DESTINATION bin)
-install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h" 
+install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
   DESTINATION include)
 
 # enable testing
@@ -49,7 +49,7 @@ add_test (TutorialRuns Tutorial 25)
 # does the usage message work?
 add_test (TutorialUsage Tutorial)
 set_tests_properties (TutorialUsage
-  PROPERTIES 
+  PROPERTIES
   PASS_REGULAR_EXPRESSION "Usage:.*number"
   )
 
diff --git a/Tests/Tutorial/Step4/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step4/MathFunctions/mysqrt.cxx
index 0cf7db480..d081d11d2 100644
--- a/Tests/Tutorial/Step4/MathFunctions/mysqrt.cxx
+++ b/Tests/Tutorial/Step4/MathFunctions/mysqrt.cxx
@@ -11,7 +11,7 @@ double mysqrt(double x)
     {
     return 0;
     }
-  
+
   double result;
 
   // if we have both log and exp then use them
@@ -19,7 +19,7 @@ double mysqrt(double x)
   result = exp(log(x)*0.5);
   fprintf(stdout,"Computing sqrt of %g to be %g using log\n",x,result);
 #else
-  double delta;  
+  double delta;
   result = x;
 
   // do ten iterations
diff --git a/Tests/Tutorial/Step5/CMakeLists.txt b/Tests/Tutorial/Step5/CMakeLists.txt
index 3002ea084..dcd735bd2 100644
--- a/Tests/Tutorial/Step5/CMakeLists.txt
+++ b/Tests/Tutorial/Step5/CMakeLists.txt
@@ -37,7 +37,7 @@ target_link_libraries (Tutorial  ${EXTRA_LIBS})
 
 # add the install targets
 install (TARGETS Tutorial DESTINATION bin)
-install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h" 
+install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
   DESTINATION include)
 
 # enable testing
@@ -49,7 +49,7 @@ add_test (TutorialRuns Tutorial 25)
 # does the usage message work?
 add_test (TutorialUsage Tutorial)
 set_tests_properties (TutorialUsage
-  PROPERTIES 
+  PROPERTIES
   PASS_REGULAR_EXPRESSION "Usage:.*number"
   )
 
diff --git a/Tests/Tutorial/Step5/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Step5/MathFunctions/MakeTable.cxx
index 540254271..ef98d5fdc 100644
--- a/Tests/Tutorial/Step5/MathFunctions/MakeTable.cxx
+++ b/Tests/Tutorial/Step5/MathFunctions/MakeTable.cxx
@@ -1,4 +1,4 @@
-// A simple program that builds a sqrt table 
+// A simple program that builds a sqrt table
 #include <stdio.h>
 #include <math.h>
 
@@ -12,14 +12,14 @@ int main (int argc, char *argv[])
     {
     return 1;
     }
-  
+
   // open the output file
   FILE *fout = fopen(argv[1],"w");
   if (!fout)
     {
     return 1;
     }
-  
+
   // create a source file with a table of square roots
   fprintf(fout,"double sqrtTable[] = {\n");
   for (i = 0; i < 10; ++i)
diff --git a/Tests/Tutorial/Step5/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step5/MathFunctions/mysqrt.cxx
index 33659b740..1f9b88719 100644
--- a/Tests/Tutorial/Step5/MathFunctions/mysqrt.cxx
+++ b/Tests/Tutorial/Step5/MathFunctions/mysqrt.cxx
@@ -14,11 +14,11 @@ double mysqrt(double x)
     {
     return 0;
     }
-  
+
   double result;
 
   // if we have both log and exp then use them
-  double delta;  
+  double delta;
 
   // use the table to help find an initial value
   result = x;
diff --git a/Tests/Tutorial/Step6/CMakeLists.txt b/Tests/Tutorial/Step6/CMakeLists.txt
index 4f70f4fc4..92a29fa37 100644
--- a/Tests/Tutorial/Step6/CMakeLists.txt
+++ b/Tests/Tutorial/Step6/CMakeLists.txt
@@ -37,7 +37,7 @@ target_link_libraries (Tutorial  ${EXTRA_LIBS})
 
 # add the install targets
 install (TARGETS Tutorial DESTINATION bin)
-install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h" 
+install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
   DESTINATION include)
 
 # enable testing
@@ -49,7 +49,7 @@ add_test (TutorialRuns Tutorial 25)
 # does the usage message work?
 add_test (TutorialUsage Tutorial)
 set_tests_properties (TutorialUsage
-  PROPERTIES 
+  PROPERTIES
   PASS_REGULAR_EXPRESSION "Usage:.*number"
   )
 
diff --git a/Tests/Tutorial/Step6/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step6/MathFunctions/CMakeLists.txt
index d606ac03e..9961e6945 100644
--- a/Tests/Tutorial/Step6/MathFunctions/CMakeLists.txt
+++ b/Tests/Tutorial/Step6/MathFunctions/CMakeLists.txt
@@ -12,7 +12,7 @@ add_custom_command (
   )
 
 set_source_files_properties (
-  mysqrt.cxx PROPERTIES 
+  mysqrt.cxx PROPERTIES
   OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Table.h
   )
 
diff --git a/Tests/Tutorial/Step6/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Step6/MathFunctions/MakeTable.cxx
index 540254271..ef98d5fdc 100644
--- a/Tests/Tutorial/Step6/MathFunctions/MakeTable.cxx
+++ b/Tests/Tutorial/Step6/MathFunctions/MakeTable.cxx
@@ -1,4 +1,4 @@
-// A simple program that builds a sqrt table 
+// A simple program that builds a sqrt table
 #include <stdio.h>
 #include <math.h>
 
@@ -12,14 +12,14 @@ int main (int argc, char *argv[])
     {
     return 1;
     }
-  
+
   // open the output file
   FILE *fout = fopen(argv[1],"w");
   if (!fout)
     {
     return 1;
     }
-  
+
   // create a source file with a table of square roots
   fprintf(fout,"double sqrtTable[] = {\n");
   for (i = 0; i < 10; ++i)
diff --git a/Tests/Tutorial/Step6/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step6/MathFunctions/mysqrt.cxx
index 33659b740..1f9b88719 100644
--- a/Tests/Tutorial/Step6/MathFunctions/mysqrt.cxx
+++ b/Tests/Tutorial/Step6/MathFunctions/mysqrt.cxx
@@ -14,11 +14,11 @@ double mysqrt(double x)
     {
     return 0;
     }
-  
+
   double result;
 
   // if we have both log and exp then use them
-  double delta;  
+  double delta;
 
   // use the table to help find an initial value
   result = x;
diff --git a/Tests/Tutorial/Step7/CMakeLists.txt b/Tests/Tutorial/Step7/CMakeLists.txt
index 42f73f221..898723ab9 100644
--- a/Tests/Tutorial/Step7/CMakeLists.txt
+++ b/Tests/Tutorial/Step7/CMakeLists.txt
@@ -37,7 +37,7 @@ target_link_libraries (Tutorial  ${EXTRA_LIBS})
 
 # add the install targets
 install (TARGETS Tutorial DESTINATION bin)
-install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h" 
+install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
   DESTINATION include)
 
 # enable testing
@@ -49,7 +49,7 @@ add_test (TutorialRuns Tutorial 25)
 # does the usage message work?
 add_test (TutorialUsage Tutorial)
 set_tests_properties (TutorialUsage
-  PROPERTIES 
+  PROPERTIES
   PASS_REGULAR_EXPRESSION "Usage:.*number"
   )
 
diff --git a/Tests/Tutorial/Step7/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step7/MathFunctions/CMakeLists.txt
index d606ac03e..9961e6945 100644
--- a/Tests/Tutorial/Step7/MathFunctions/CMakeLists.txt
+++ b/Tests/Tutorial/Step7/MathFunctions/CMakeLists.txt
@@ -12,7 +12,7 @@ add_custom_command (
   )
 
 set_source_files_properties (
-  mysqrt.cxx PROPERTIES 
+  mysqrt.cxx PROPERTIES
   OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Table.h
   )
 
diff --git a/Tests/Tutorial/Step7/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Step7/MathFunctions/MakeTable.cxx
index 540254271..ef98d5fdc 100644
--- a/Tests/Tutorial/Step7/MathFunctions/MakeTable.cxx
+++ b/Tests/Tutorial/Step7/MathFunctions/MakeTable.cxx
@@ -1,4 +1,4 @@
-// A simple program that builds a sqrt table 
+// A simple program that builds a sqrt table
 #include <stdio.h>
 #include <math.h>
 
@@ -12,14 +12,14 @@ int main (int argc, char *argv[])
     {
     return 1;
     }
-  
+
   // open the output file
   FILE *fout = fopen(argv[1],"w");
   if (!fout)
     {
     return 1;
     }
-  
+
   // create a source file with a table of square roots
   fprintf(fout,"double sqrtTable[] = {\n");
   for (i = 0; i < 10; ++i)
diff --git a/Tests/Tutorial/Step7/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step7/MathFunctions/mysqrt.cxx
index 33659b740..1f9b88719 100644
--- a/Tests/Tutorial/Step7/MathFunctions/mysqrt.cxx
+++ b/Tests/Tutorial/Step7/MathFunctions/mysqrt.cxx
@@ -14,11 +14,11 @@ double mysqrt(double x)
     {
     return 0;
     }
-  
+
   double result;
 
   // if we have both log and exp then use them
-  double delta;  
+  double delta;
 
   // use the table to help find an initial value
   result = x;
diff --git a/Tests/VSExternalInclude/CMakeLists.txt b/Tests/VSExternalInclude/CMakeLists.txt
index a2fd61973..4a413d598 100644
--- a/Tests/VSExternalInclude/CMakeLists.txt
+++ b/Tests/VSExternalInclude/CMakeLists.txt
@@ -18,12 +18,12 @@ SET(LIB2_BINARY_DIR ${VSExternalInclude_BINARY_DIR}/Lib2)
 MAKE_DIRECTORY("${LIB2_BINARY_DIR}")
 
 # generate lib1
-EXEC_PROGRAM("${CMAKE_COMMAND}" "${LIB1_BINARY_DIR}"  ARGS -G\"${CMAKE_GENERATOR}\" 
+EXEC_PROGRAM("${CMAKE_COMMAND}" "${LIB1_BINARY_DIR}"  ARGS -G\"${CMAKE_GENERATOR}\"
   \"${VSExternalInclude_SOURCE_DIR}/Lib1\" OUTPUT_VARIABLE OUT)
 MESSAGE("CMAKE Ran with the following output:\n\"${OUT}\"")
 
 # generate lib2
-EXEC_PROGRAM("${CMAKE_COMMAND}" "${LIB2_BINARY_DIR}"  ARGS -G\"${CMAKE_GENERATOR}\" 
+EXEC_PROGRAM("${CMAKE_COMMAND}" "${LIB2_BINARY_DIR}"  ARGS -G\"${CMAKE_GENERATOR}\"
   \"${VSExternalInclude_SOURCE_DIR}/Lib2\" OUTPUT_VARIABLE OUT)
 MESSAGE("CMAKE Ran with the following output:\n\"${OUT}\"")
 
diff --git a/Tests/Wrapping/CMakeLists.txt b/Tests/Wrapping/CMakeLists.txt
index c84dedc47..5f441dd9e 100644
--- a/Tests/Wrapping/CMakeLists.txt
+++ b/Tests/Wrapping/CMakeLists.txt
@@ -11,12 +11,12 @@ SET_DIRECTORY_PROPERTIES(PROPERTIES CLEAN_NO_CUSTOM 1)
 #
 # Lib and exe path
 #
-SET (LIBRARY_OUTPUT_PATH 
-  ${Wrapping_BINARY_DIR}/bin/ CACHE INTERNAL 
+SET (LIBRARY_OUTPUT_PATH
+  ${Wrapping_BINARY_DIR}/bin/ CACHE INTERNAL
   "Single output directory for building all libraries.")
 
-SET (EXECUTABLE_OUTPUT_PATH 
-  ${Wrapping_BINARY_DIR}/bin/ CACHE INTERNAL 
+SET (EXECUTABLE_OUTPUT_PATH
+  ${Wrapping_BINARY_DIR}/bin/ CACHE INTERNAL
   "Single output directory for building all executables.")
 
 #
diff --git a/Tests/Wrapping/qtnoqtmain.cxx b/Tests/Wrapping/qtnoqtmain.cxx
index 8b7334a18..92594d52e 100644
--- a/Tests/Wrapping/qtnoqtmain.cxx
+++ b/Tests/Wrapping/qtnoqtmain.cxx
@@ -2,4 +2,4 @@ int main(int ac, char** av)
 {
   return 0;
 }
-  
+
diff --git a/Tests/X11/CMakeLists.txt b/Tests/X11/CMakeLists.txt
index 03aa09578..3859ba229 100644
--- a/Tests/X11/CMakeLists.txt
+++ b/Tests/X11/CMakeLists.txt
@@ -8,8 +8,8 @@ MESSAGE("X11_FOUND: ${X11_FOUND}")
 ADD_EXECUTABLE (UseX11 X11.c)
 install(TARGETS UseX11 DESTINATION bin)
 
-# so for universal binaries this test will fail if 
-# 
+# so for universal binaries this test will fail if
+#
 IF(APPLE)
   LIST(LENGTH CMAKE_OSX_ARCHITECTURES NUMARCH)
   IF(NUMARCH GREATER 1)
diff --git a/Tests/X11/HelloWorldX11.cxx b/Tests/X11/HelloWorldX11.cxx
index e3c9dd9cf..f2b8bdd47 100644
--- a/Tests/X11/HelloWorldX11.cxx
+++ b/Tests/X11/HelloWorldX11.cxx
@@ -9,7 +9,7 @@
  *  Copyright (c) 2004 __MyCompanyName__. All rights reserved.
  *
  */
- 
+
 
 #ifndef MAIN_H
 #define MAIN_H 1
@@ -28,10 +28,10 @@ public:
   // constructor
   Main(int argc, char * const argv[]);
   //virtual ~Main();
-        
+
 
 private:
-        
+
 
   /* here are our X variables */
   Display *dis;
@@ -53,7 +53,7 @@ private:
 
 /*** START MAIN.CPP ***/
 
-// modified from Brian Hammond's Howdy program at 
+// modified from Brian Hammond's Howdy program at
 // http://www.insanityengine.com/doc/x11/xintro.html
 // jeff louie 02.05.2004
 
@@ -73,11 +73,11 @@ Main::Main (int argc, char * const argv[]) {
   init_x();
 
   // event loop
-  while(1) {     
+  while(1) {
   // get the next event and stuff it into our event variable.
   // Note:  only events we set the mask for are detected!
   XNextEvent(dis, &event);
-                                
+
 
   switch (event.type) {
   int x;
@@ -115,19 +115,19 @@ Main::Main (int argc, char * const argv[]) {
   }
 }
 
-void Main::init_x() {  
+void Main::init_x() {
   unsigned long black,white;
 
   dis=XOpenDisplay(NULL);
   screen=DefaultScreen(dis);
   black=BlackPixel(dis,screen),
     white=WhitePixel(dis, screen);
-  win=XCreateSimpleWindow(dis,DefaultRootWindow(dis),0,0, 
+  win=XCreateSimpleWindow(dis,DefaultRootWindow(dis),0,0,
                           300, 300, 5,black, white);
   XSetStandardProperties(dis,win,"Hello World","Hi",None,NULL,0,NULL);
   XSelectInput(dis, win, ExposureMask|ButtonPressMask|KeyPressMask);
   // get Graphics Context
-  gc=XCreateGC(dis, win, 0,0);        
+  gc=XCreateGC(dis, win, 0,0);
   XSetBackground(dis,gc,white);
   XSetForeground(dis,gc,black);
   XClearWindow(dis, win);
@@ -137,8 +137,8 @@ void Main::init_x() {
 void Main::close_x() {
   XFreeGC(dis, gc);
   XDestroyWindow(dis,win);
-  XCloseDisplay(dis);     
-  exit(1);                                
+  XCloseDisplay(dis);
+  exit(1);
 };
 
 void Main::redraw() {
diff --git a/Utilities/CMakeLists.txt b/Utilities/CMakeLists.txt
index 798c16397..8a52e22b3 100644
--- a/Utilities/CMakeLists.txt
+++ b/Utilities/CMakeLists.txt
@@ -96,7 +96,7 @@ ADD_DOCS(cmake-gui ${CMake_SOURCE_DIR}/Utilities/Doxygen/doxyfile.in)
 GET_TARGET_PROPERTY(CMD cmake LOCATION)
 ADD_CUSTOM_COMMAND(
   OUTPUT ${CMake_BINARY_DIR}/Docs/cmake.txt
-  COMMAND ${CMD} 
+  COMMAND ${CMD}
   ARGS --copyright ${CMake_BINARY_DIR}/Docs/Copyright.txt
        --help-full ${CMake_BINARY_DIR}/Docs/cmake.txt
        --help-full ${CMake_BINARY_DIR}/Docs/cmake.html
diff --git a/Utilities/Doxygen/doc_makeall.sh.in b/Utilities/Doxygen/doc_makeall.sh.in
index a1b00e7d0..ed7b521e4 100755
--- a/Utilities/Doxygen/doc_makeall.sh.in
+++ b/Utilities/Doxygen/doc_makeall.sh.in
@@ -4,7 +4,7 @@
 # -------------------------------------------------------------------------
 
 # Path to several tools (_PROG to avoid the typical GZIP env var pb)
-# Example: 
+# Example:
 #   DOXYGEN_PROG=@DOXYGEN@   (INCLUDE(${CMAKE_ROOT}/Modules/FindDoxygen.cmake))
 #   GZIP_PROG=@GZIP@         (INCLUDE(${CMAKE_ROOT}/Modules/FindCygwin.cmake))
 #   HHC_PROG=@HHC@           (INCLUDE(${CMAKE_ROOT}/Modules/FindHhc.cmake))
@@ -26,26 +26,26 @@ export WGET_PROG="@WGET@"              # wget (remote file retrieval)
 
 # PROJECT_NAME:
 # Documentation/project name. Used in some of the resulting file names and
-# xrefs to uniquify two or more projects linked together through their 
+# xrefs to uniquify two or more projects linked together through their
 # Doxygen's tag files. Mandatory for each documentation set.
 # Note: might be the same as the doxyfile's PROJECT_NAME
-# Example: 
+# Example:
 #   PROJECT_NAME=VTK
 #
 export PROJECT_NAME=CMake
 
 # PATH_TO_VTK_DOX_SCRIPTS:
 # Path to the directory holding the Perl scripts used to produce the VTK doc
-# in Doxygen format. You need the VTK source files or a local copy of 
+# in Doxygen format. You need the VTK source files or a local copy of
 # these scripts.
-# Example: 
+# Example:
 #   PATH_TO_VTK_DOX_SCRIPTS=@VTK_SOURCE_DIR@/Utilities/Doxygen
 #
 export PATH_TO_VTK_DOX_SCRIPTS="@VTK_SOURCE_DIR@/Utilities/Doxygen"
 
 # SOURCE_DIR:
 # Source directory. The top directory of the source files.
-# Example: 
+# Example:
 #   SOURCE_DIR=@VTK_SOURCE_DIR@
 #
 export SOURCE_DIR="@CMake_SOURCE_DIR@"
@@ -54,7 +54,7 @@ export SOURCE_DIR="@CMake_SOURCE_DIR@"
 # Relative path from the top directory of the source files to the directory
 # (or top directory) holding the files to document. Useful if several parts
 # of the same source directory should be documented separately.
-# Example: 
+# Example:
 #   REL_PATH_TO_TOP=.
 #   REL_PATH_TO_TOP=framework/src
 #
@@ -67,7 +67,7 @@ export REL_PATH_TO_TOP=.
 # This directory is erased at the end of this script, unless you comment
 # the corresponding line.
 # DOXTEMP might be used to simplify the syntax.
-# Example: 
+# Example:
 #   DOXTEMP=DOXTEMP=@VTK_BINARY_DIR@/Utilities/Doxygen
 #   INTERMEDIATE_DOX_DIR=$DOXTEMP/dox
 #
@@ -76,7 +76,7 @@ export INTERMEDIATE_DOX_DIR="$DOXTEMP/dox"
 
 # DOXYFILE:
 # Path to the Doxygen configuration file (i.e. doxyfile).
-# Example: 
+# Example:
 #   DOXYFILE=$DOXTEMP/doxyfile
 #
 export DOXYFILE="$DOXTEMP/doxyfile"
@@ -86,7 +86,7 @@ export DOXYFILE="$DOXTEMP/doxyfile"
 # Note: should be the same as your doxyfile's OUTPUT_DIRECTORY
 # If ON, allows the output directory to be erased when some advanced output
 # file have been produced (HTML Help, or TAR archive for example).
-# Example: 
+# Example:
 #   OUTPUT_DIRECTORY=$DOXTEMP/doc
 #   ALLOW_ERASE_OUTPUT_DIRECTORY=ON
 #
@@ -94,16 +94,16 @@ export OUTPUT_DIRECTORY="$DOXTEMP/doc"
 export ALLOW_ERASE_OUTPUT_DIRECTORY=ON
 
 # COMPILE_HTML_HELP RESULTING_HTML_HELP_FILE:
-# Compile the CHM (Compressed HTML) HTML Help file, name of the resulting 
-# file. If set to ON and name is non-empty these options will actually 
+# Compile the CHM (Compressed HTML) HTML Help file, name of the resulting
+# file. If set to ON and name is non-empty these options will actually
 # trigger the HTML-Help compiler to create the CHM. The resulting
 # file (usually index.chm) will be renamed to this name.
 # Note: if ON, the whole $OUTPUT_DIRECTORY will be erased at the end of
-#       this script, since this file is considered to be one of the 
+#       this script, since this file is considered to be one of the
 #       advanced final output, unless ALLOW_ERASE_OUTPUT_DIRECTORY is OFF
-# Note: your doxyfile should be configured to enable HTML Help creation 
+# Note: your doxyfile should be configured to enable HTML Help creation
 #       (using GENERATE_HTML = YES, GENERATE_HTMLHELP = YES)
-# Example: 
+# Example:
 #   COMPILE_HTML_HELP=ON
 #   COMPILE_HTML_HELP=@DOCUMENTATION_HTML_HELP@
 #   RESULTING_HTML_HELP_FILE=$DOXTEMP/vtk4.chm
@@ -113,10 +113,10 @@ export RESULTING_HTML_HELP_FILE="$DOXTEMP/$PROJECT_NAME.chm"
 
 # CREATE_HTML_TARZ_ARCHIVE RESULTING_HTML_TARZ_ARCHIVE_FILE:
 # Create a compressed (gzip) tar archive of the html directory (located
-# under the OUTPUT_DIRECTORY), and name of the resulting archive file. 
-# Note: your doxyfile should be configured to enable HTML creation 
+# under the OUTPUT_DIRECTORY), and name of the resulting archive file.
+# Note: your doxyfile should be configured to enable HTML creation
 #       (using GENERATE_HTML = YES)
-# Example: 
+# Example:
 #   CREATE_HTML_TARZ_ARCHIVE=ON
 #   CREATE_HTML_TARZ_ARCHIVE=@DOCUMENTATION_HTML_TARZ@
 #   RESULTING_HTML_TARZ_ARCHIVE_FILE=$DOXTEMP/vtk4-html.tar.gz
diff --git a/Utilities/KWStyle/CMakeLists.txt b/Utilities/KWStyle/CMakeLists.txt
index 5b0c84e8b..fbaa67b37 100644
--- a/Utilities/KWStyle/CMakeLists.txt
+++ b/Utilities/KWStyle/CMakeLists.txt
@@ -22,7 +22,7 @@ IF(NOT home)
 ENDIF()
 
 FIND_PROGRAM(KWSTYLE_EXECUTABLE
-  NAMES KWStyle 
+  NAMES KWStyle
   PATHS
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Kitware Inc.\\KWStyle 1.0.0]/bin"
   "${home}/Dashboards/Support/KWStyle/bin"
diff --git a/Utilities/KWStyle/CMakeMoreChecks.kws.xml.in b/Utilities/KWStyle/CMakeMoreChecks.kws.xml.in
index b7078e0cf..c48e92f77 100644
--- a/Utilities/KWStyle/CMakeMoreChecks.kws.xml.in
+++ b/Utilities/KWStyle/CMakeMoreChecks.kws.xml.in
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
 <Description>
-  <ErrorThreshold>10</ErrorThreshold> 
+  <ErrorThreshold>10</ErrorThreshold>
   <LineLength>79</LineLength>
   <Header>"@CMake_SOURCE_DIR@/Utilities/KWStyle/Headers",false,true</Header>
   <Functions>
diff --git a/Utilities/Release/Cygwin/CMakeLists.txt b/Utilities/Release/Cygwin/CMakeLists.txt
index 2420c97d9..565c9a4d6 100644
--- a/Utilities/Release/Cygwin/CMakeLists.txt
+++ b/Utilities/Release/Cygwin/CMakeLists.txt
@@ -4,7 +4,7 @@ FOREACH(f ${INSTALLED_CURSES})
   IF(NOT "${f}" MATCHES "\\+")
     STRING(REGEX REPLACE ".*-([0-9]*).dll" "\\1" NUMBER "${f}")
     IF(NUMBER GREATER MAX)
-      SET(MAX ${NUMBER}) 
+      SET(MAX ${NUMBER})
     ENDIF(NUMBER GREATER MAX)
   ENDIF(NOT "${f}" MATCHES "\\+")
 ENDFOREACH(f)
diff --git a/Utilities/Release/Cygwin/cygwin-package.sh.in b/Utilities/Release/Cygwin/cygwin-package.sh.in
index 9730b3332..dff27f14d 100755
--- a/Utilities/Release/Cygwin/cygwin-package.sh.in
+++ b/Utilities/Release/Cygwin/cygwin-package.sh.in
@@ -4,11 +4,11 @@ TOP_DIR=`cd \`echo "$0" | sed -n '/\//{s/\/[^\/]*$//;p;}'\`;pwd`
 mkdirs()
 {
   (
-  mkdir -p "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build" 
+  mkdir -p "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build"
   )
 }
 
-# cd into 
+# cd into
 # untar source tree and apply patch
 prep()
 {
@@ -23,7 +23,7 @@ prep()
 conf()
 {
   (
-  cd "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build" && 
+  cd "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build" &&
   ../bootstrap --parallel=2
   )
 }
@@ -49,8 +49,8 @@ pkg()
 {
   (
   cd "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build" &&
-  ./bin/cpack && 
-  mv @CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.tar.bz2 "$TOP_DIR"     
+  ./bin/cpack &&
+  mv @CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.tar.bz2 "$TOP_DIR"
   )
 }
 
@@ -59,7 +59,7 @@ spkg()
  (
   cd "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build" &&
   ./bin/cpack --config  CPackSourceConfig.cmake &&
-  mv @CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@-src.tar.bz2 "$TOP_DIR" 
+  mv @CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@-src.tar.bz2 "$TOP_DIR"
   )
 }
 
diff --git a/Utilities/Release/release_cmake.cmake b/Utilities/Release/release_cmake.cmake
index 0c9b3f9c5..b5b86aff0 100644
--- a/Utilities/Release/release_cmake.cmake
+++ b/Utilities/Release/release_cmake.cmake
@@ -48,7 +48,7 @@ endif(NOT HOST)
 if(NOT DEFINED MAKE)
   message(FATAL_ERROR "MAKE must be specified with -DMAKE=\"make -j2\"")
 endif(NOT DEFINED MAKE)
-  
+
 message("Creating CMake release ${CMAKE_CREATE_VERSION} on ${HOST} with parallel = ${PROCESSORS}")
 
 # define a macro to run a remote command
@@ -58,8 +58,8 @@ macro(remote_command comment command)
     message("ssh ${HOST} ${EXTRA_HOP} ${command}")
     execute_process(COMMAND ssh ${HOST} ${EXTRA_HOP} ${command} RESULT_VARIABLE result INPUT_FILE ${ARGV2})
   else(${ARGC} GREATER 2)
-    message("ssh ${HOST} ${EXTRA_HOP} ${command}") 
-    execute_process(COMMAND ssh ${HOST} ${EXTRA_HOP} ${command} RESULT_VARIABLE result) 
+    message("ssh ${HOST} ${EXTRA_HOP} ${command}")
+    execute_process(COMMAND ssh ${HOST} ${EXTRA_HOP} ${command} RESULT_VARIABLE result)
   endif(${ARGC} GREATER 2)
   if(${result} GREATER 0)
     message(FATAL_ERROR "Error running command: ${command}, return value = ${result}")
@@ -80,7 +80,7 @@ ELSE(RUN_LOCAL)
     "${RUN_SHELL}" ${SCRIPT_FILE})
 ENDIF(RUN_LOCAL)
 
-# now figure out which types of packages were created 
+# now figure out which types of packages were created
 set(generators ${CPACK_BINARY_GENERATORS} ${CPACK_SOURCE_GENERATORS})
 separate_arguments(generators)
 foreach(gen ${generators})
@@ -114,9 +114,9 @@ endforeach(gen)
 set(PROJECT_PREFIX cmake-)
 foreach(suffix ${SUFFIXES})
   message("scp ${HOST}:${FINAL_PATH}/${PROJECT_PREFIX}${suffix} .")
-  execute_process(COMMAND 
+  execute_process(COMMAND
     scp ${HOST}:${FINAL_PATH}/${PROJECT_PREFIX}${suffix} .
-    RESULT_VARIABLE result)   
+    RESULT_VARIABLE result)
   if(${result} GREATER 0)
     message("error getting file back scp ${HOST}:${FINAL_PATH}/${PROJECT_PREFIX}${suffix} .")
   endif(${result} GREATER 0)
@@ -126,7 +126,7 @@ endforeach(suffix)
 if(extra_files)
   foreach(f ${extra_files})
     message("scp ${HOST}:${FINAL_PATH}/${f} .")
-    execute_process(COMMAND 
+    execute_process(COMMAND
       scp ${HOST}:${FINAL_PATH}/${f} .
       RESULT_VARIABLE result)
     if(${result} GREATER 0)
diff --git a/Utilities/Release/release_cmake.sh.in b/Utilities/Release/release_cmake.sh.in
index b5ff6dd89..82c039b43 100755
--- a/Utilities/Release/release_cmake.sh.in
+++ b/Utilities/Release/release_cmake.sh.in
@@ -3,7 +3,7 @@ echo "Start release"
 date
 echo ""
 echo  "remove and create working directory @CMAKE_RELEASE_DIRECTORY@"
-rm -rf @CMAKE_RELEASE_DIRECTORY@ 
+rm -rf @CMAKE_RELEASE_DIRECTORY@
 mkdir @CMAKE_RELEASE_DIRECTORY@
 
 check_exit_value()
@@ -12,7 +12,7 @@ check_exit_value()
    if [ "$VALUE" != "0" ]; then
     echo "error in $2"
     exit 1
-   fi      
+   fi
 }
 
 if [ ! -z "@CC@" ]; then
@@ -77,7 +77,7 @@ if [ ! -z "@USER_OVERRIDE@" ]; then
 fi
 
 echo "Checkout the source for @CMAKE_CREATE_VERSION@"
-cd @CMAKE_RELEASE_DIRECTORY@ 
+cd @CMAKE_RELEASE_DIRECTORY@
 if [ ! -z "@GIT_COMMAND@" ]; then
    # clone the repo without creating any source files in the directory
    # matching the branch being built (i.e. master CMake-2-8, etc)
@@ -97,9 +97,9 @@ else
    exit 1
 fi
 
-cd @CMAKE_RELEASE_DIRECTORY@/@CMAKE_CREATE_VERSION@-build 
+cd @CMAKE_RELEASE_DIRECTORY@/@CMAKE_CREATE_VERSION@-build
 
-if [ ! -z "@CONFIGURE_WITH_CMAKE@" ]; then 
+if [ ! -z "@CONFIGURE_WITH_CMAKE@" ]; then
     echo  "Run cmake to configure cmake"
     @CMAKE_CONFIGURE_PATH@ ../@CMAKE_CREATE_VERSION@
     check_exit_value $? "Configure cmake" || exit 1
@@ -125,7 +125,7 @@ if [ -z "@SKIP_TESTS@" ]; then
     check_exit_value $? "Test cmake" || exit 1
 fi
 
-# loop over binary generators 
+# loop over binary generators
 generators="@CPACK_BINARY_GENERATORS@"
 for GEN in $generators; do
     echo "Create $GEN package"
@@ -133,7 +133,7 @@ for GEN in $generators; do
     check_exit_value $? "Create $GEN package" || exit 1
 done
 
-# loop over source generators 
+# loop over source generators
 generators="@CPACK_SOURCE_GENERATORS@"
 for GEN in $generators; do
     echo "Create $GEN package"
diff --git a/Utilities/Release/upload_release.cmake b/Utilities/Release/upload_release.cmake
index bd79296a1..827e683fd 100644
--- a/Utilities/Release/upload_release.cmake
+++ b/Utilities/Release/upload_release.cmake
@@ -19,7 +19,7 @@ set(count 0)
 foreach(file ${FILES})
   if(NOT IS_DIRECTORY ${file})
     message("upload ${file} ${UPLOAD_LOC}")
-    execute_process(COMMAND 
+    execute_process(COMMAND
       scp ${file} ${UPLOAD_LOC}
       RESULT_VARIABLE result)
     if("${result}" GREATER 0)
diff --git a/doxygen.config b/doxygen.config
index c22f2650d..82add731e 100644
--- a/doxygen.config
+++ b/doxygen.config
@@ -11,219 +11,219 @@
 # General configuration options
 #---------------------------------------------------------------------------
 
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
-# by quotes) that should identify the project. 
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
 
 PROJECT_NAME          = CMAKE
 
-# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
-# This could be handy for archiving the generated documentation or 
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
 # if some version control system is used.
 
 PROJECT_NUMBER        = 0.0.1
 
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
-# base path where the generated documentation will be put. 
-# If a relative path is entered, it will be relative to the location 
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
 # where doxygen was started. If left blank the current directory will be used.
 
 OUTPUT_DIRECTORY      = ./Doxygen
 
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
-# documentation generated by doxygen is written. Doxygen will use this 
-# information to generate all constant output in the proper language. 
-# The default language is English, other supported languages are: 
-# Dutch, French, Italian, Czech, Swedish, German, Finnish, Japanese, 
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Dutch, French, Italian, Czech, Swedish, German, Finnish, Japanese,
 # Spanish and Russian
 
 OUTPUT_LANGUAGE       = English
 
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
-# top of each HTML page. The value NO (the default) enables the index and 
-# the value YES disables it. 
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
 
 DISABLE_INDEX         = NO
 
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
-# documentation are documented, even if no documentation was available. 
-# Private class members and static file members will be hidden unless 
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES 
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
 
 EXTRACT_ALL           = YES
 
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
-# will be included in the documentation. 
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
 
 EXTRACT_PRIVATE       = NO
 
-# If the EXTRACT_STATIC tag is set to YES all static members of a file 
-# will be included in the documentation. 
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
 
 EXTRACT_STATIC        = YES
 
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
-# undocumented members of documented classes, files or namespaces. 
-# If set to NO (the default) these members will be included in the 
-# various overviews, but no documentation section is generated. 
-# This option has no effect if EXTRACT_ALL is enabled. 
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
 
 HIDE_UNDOC_MEMBERS    = NO
 
-# If the HIDE_UNDOC_CLASSESS tag is set to YES, Doxygen will hide all 
-# undocumented classes that are normally visible in the class hierarchy. 
-# If set to NO (the default) these class will be included in the various 
-# overviews. This option has no effect if EXTRACT_ALL is enabled. 
+# If the HIDE_UNDOC_CLASSESS tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these class will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
 
 HIDE_UNDOC_CLASSES    = NO
 
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
-# include brief member descriptions after the members that are listed in 
-# the file and class documentation (similar to JavaDoc). 
-# Set to NO to disable this. 
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
 
 BRIEF_MEMBER_DESC     = YES
 
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
-# the brief description of a member or function before the detailed description. 
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
-# brief descriptions will be completely suppressed. 
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
 
 REPEAT_BRIEF          = YES
 
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
-# Doxygen will generate a detailed section even if there is only a brief 
-# description. 
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
 
 ALWAYS_DETAILED_SEC   = NO
 
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
-# path before files name in the file list and in the header files. If set 
-# to NO the shortest path that makes the file name unique will be used. 
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
 
 FULL_PATH_NAMES       = NO
 
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
-# can be used to strip a user defined part of the path. Stripping is 
-# only done if one of the specified strings matches the left-hand part of 
-# the path. 
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path.
 
-STRIP_FROM_PATH       = 
+STRIP_FROM_PATH       =
 
-# The INTERNAL_DOCS tag determines if documentation 
-# that is typed after a \internal command is included. If the tag is set 
-# to NO (the default) then the documentation will be excluded. 
-# Set it to YES to include the internal documentation. 
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
 
 INTERNAL_DOCS         = NO
 
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
-# generate a class diagram (in Html and LaTeX) for classes with base or 
-# super classes. Setting the tag to NO turns the diagrams off. 
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a class diagram (in Html and LaTeX) for classes with base or
+# super classes. Setting the tag to NO turns the diagrams off.
 
 CLASS_DIAGRAMS        = YES
 
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
-# be generated. Documented entities will be cross-referenced with these sources. 
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
 
 SOURCE_BROWSER        = YES
 
-# Setting the INLINE_SOURCES tag to YES will include the body 
-# of functions and classes directly in the documentation. 
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
 
 INLINE_SOURCES        = NO
 
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
-# doxygen to hide any special comment blocks from generated source code 
-# fragments. Normal C and C++ comments will always remain visible. 
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
 
 STRIP_CODE_COMMENTS   = YES
 
-# If the CASE_SENSE_NAMES tag is set to NO (the default) then Doxygen 
-# will only generate file names in lower case letters. If set to 
-# YES upper case letters are also allowed. This is useful if you have 
-# classes or files whose names only differ in case and if your file system 
-# supports case sensitive file names. 
+# If the CASE_SENSE_NAMES tag is set to NO (the default) then Doxygen
+# will only generate file names in lower case letters. If set to
+# YES upper case letters are also allowed. This is useful if you have
+# classes or files whose names only differ in case and if your file system
+# supports case sensitive file names.
 
 CASE_SENSE_NAMES      = YES
 
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
-# will show members with their full class and namespace scopes in the 
-# documentation. If set to YES the scope will be hidden. 
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
 
 HIDE_SCOPE_NAMES      = NO
 
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
-# will generate a verbatim copy of the header file for each class for 
-# which an include is specified. Set to NO to disable this. 
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
 
 VERBATIM_HEADERS      = YES
 
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
-# will put list of the files that are included by a file in the documentation 
-# of that file. 
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put list of the files that are included by a file in the documentation
+# of that file.
 
 SHOW_INCLUDE_FILES    = YES
 
-# If the JAVADOC_AUTOBRIEF tag is set to YES (the default) then Doxygen 
-# will interpret the first line (until the first dot) of a JavaDoc-style 
-# comment as the brief description. If set to NO, the Javadoc-style will 
-# behave just like the Qt-style comments. 
+# If the JAVADOC_AUTOBRIEF tag is set to YES (the default) then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the Javadoc-style will
+# behave just like the Qt-style comments.
 
 JAVADOC_AUTOBRIEF     = NO
 
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
-# member inherits the documentation from any documented member that it 
-# reimplements. 
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# reimplements.
 
 INHERIT_DOCS          = YES
 
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
-# is inserted in the documentation for inline members. 
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
 
 INLINE_INFO           = YES
 
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
-# will sort the (detailed) documentation of file and class members 
-# alphabetically by member name. If set to NO the members will appear in 
-# declaration order. 
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
 
 SORT_MEMBER_DOCS      = YES
 
-# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
-# Doxygen uses this value to replace tabs by spaces in code fragments. 
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
 
 TAB_SIZE              = 8
 
-# The ENABLE_SECTIONS tag can be used to enable conditional 
-# documentation sections, marked by \if sectionname ... \endif. 
+# The ENABLE_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
 
-ENABLED_SECTIONS      = 
+ENABLED_SECTIONS      =
 
 #---------------------------------------------------------------------------
 # configuration options related to warning and progress messages
 #---------------------------------------------------------------------------
 
-# The QUIET tag can be used to turn on/off the messages that are generated 
-# by doxygen. Possible values are YES and NO. If left blank NO is used. 
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
 
 QUIET                 = NO
 
-# The WARNINGS tag can be used to turn on/off the warning messages that are 
-# generated by doxygen. Possible values are YES and NO. If left blank 
-# NO is used. 
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
 
 WARNINGS              = YES
 
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
-# automatically be disabled. 
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
 
 WARN_IF_UNDOCUMENTED  = YES
 
-# The WARN_FORMAT tag determines the format of the warning messages that 
-# doxygen can produce. The string should contain the $file, $line, and $text 
-# tags, which will be replaced by the file and line number from which the 
-# warning originated and the warning text. 
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text.
 
 WARN_FORMAT           = "$file:$line: $text"
 
@@ -231,133 +231,133 @@ WARN_FORMAT           = "$file:$line: $text"
 # configuration options related to the input files
 #---------------------------------------------------------------------------
 
-# The INPUT tag can be used to specify the files and/or directories that contain 
-# documented source files. You may enter file names like "myfile.cpp" or 
-# directories like "/usr/src/myproject". Separate the files or directories 
-# with spaces. 
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
 
 INPUT                 = "Source"
 
-# If the value of the INPUT tag contains directories, you can use the 
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
-# and *.h) to filter out the source-files in the directories. If left 
-# blank all files are included. 
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
 
 FILE_PATTERNS         = *.h *.txx *.cxx
 
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
-# should be searched for input files as well. Possible values are YES and NO. 
-# If left blank NO is used. 
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
 
 RECURSIVE             = YES
 
-# The EXCLUDE tag can be used to specify files and/or directories that should 
-# excluded from the INPUT source files. This way you can easily exclude a 
-# subdirectory from a directory tree whose root is specified with the INPUT tag. 
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
 
-EXCLUDE               = 
-                        
-# If the value of the INPUT tag contains directories, you can use the 
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
-# certain files from those directories. 
+EXCLUDE               =
 
-EXCLUDE_PATTERNS      = 
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories.
 
-# The EXAMPLE_PATH tag can be used to specify one or more files or 
-# directories that contain example code fragments that are included (see 
-# the \include command). 
+EXCLUDE_PATTERNS      =
 
-EXAMPLE_PATH          = 
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
 
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
-# and *.h) to filter out the source-files in the directories. If left 
-# blank all files are included. 
+EXAMPLE_PATH          =
 
-EXAMPLE_PATTERNS      = 
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
 
-# The IMAGE_PATH tag can be used to specify one or more files or 
-# directories that contain image that are included in the documentation (see 
-# the \image command). 
+EXAMPLE_PATTERNS      =
 
-IMAGE_PATH            = 
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
 
-# The INPUT_FILTER tag can be used to specify a program that doxygen should 
-# invoke to filter for each input file. Doxygen will invoke the filter program 
-# by executing (via popen()) the command <filter> <input-file>, where <filter> 
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
-# input file. Doxygen will then use the output that the filter program writes 
-# to standard output. 
+IMAGE_PATH            =
 
-INPUT_FILTER          = 
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+
+INPUT_FILTER          =
 
 #---------------------------------------------------------------------------
 # configuration options related to the alphabetical class index
 #---------------------------------------------------------------------------
 
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
-# of all compounds will be generated. Enable this if the project 
-# contains a lot of classes, structs, unions or interfaces. 
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
 
 ALPHABETICAL_INDEX    = YES
 
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
-# in which this list will be split (can be a number in the range [1..20]) 
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
 
 COLS_IN_ALPHA_INDEX   = 3
 
-# In case all classes in a project start with a common prefix, all 
-# classes will be put under the same header in the alphabetical index. 
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
-# should be ignored while generating the index headers. 
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
 
-IGNORE_PREFIX         = 
+IGNORE_PREFIX         =
 
 #---------------------------------------------------------------------------
 # configuration options related to the HTML output
 #---------------------------------------------------------------------------
 
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
-# generate HTML output. 
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
 
 GENERATE_HTML         = YES
 
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
-# put in front of it. If left blank `html' will be used as the default path. 
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
 
 HTML_OUTPUT           = html
 
-# The HTML_HEADER tag can be used to specify a personal HTML header for 
-# each generated HTML page. If it is left blank doxygen will generate a 
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
 # standard header.
 
-HTML_HEADER           = 
+HTML_HEADER           =
 
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
-# each generated HTML page. If it is left blank doxygen will generate a 
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
 # standard footer.
 
-HTML_FOOTER           = 
+HTML_FOOTER           =
 
-# The HTML_STYLESHEET tag can be used to specify a user defined cascading 
-# style sheet that is used by each HTML page. It can be used to 
-# fine-tune the look of the HTML output. If the tag is left blank doxygen 
-# will generate a default style sheet 
+# The HTML_STYLESHEET tag can be used to specify a user defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet
 
-HTML_STYLESHEET       = 
+HTML_STYLESHEET       =
 
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
-# files or namespaces will be aligned in HTML using tables. If set to 
-# NO a bullet list will be used. 
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
 
 HTML_ALIGN_MEMBERS    = YES
 
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
-# will be generated that can be used as input for tools like the 
-# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 
-# of the generated HTML documentation. 
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
+# of the generated HTML documentation.
 
 GENERATE_HTMLHELP     = NO
 
@@ -365,52 +365,52 @@ GENERATE_HTMLHELP     = NO
 # configuration options related to the LaTeX output
 #---------------------------------------------------------------------------
 
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
-# generate Latex output. 
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
 
 GENERATE_LATEX        = YES
 
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
-# put in front of it. If left blank `latex' will be used as the default path. 
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
 
 LATEX_OUTPUT          = latex
 
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
-# LaTeX documents. This may be useful for small projects and may help to 
-# save some trees in general. 
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
 
 COMPACT_LATEX         = NO
 
-# The PAPER_TYPE tag can be used to set the paper type that is used 
-# by the printer. Possible values are: a4, a4wide, letter, legal and 
-# executive. If left blank a4wide will be used. 
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
 
 PAPER_TYPE            = a4wide
 
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
-# packages that should be included in the LaTeX output. 
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
 
-EXTRA_PACKAGES        = 
+EXTRA_PACKAGES        =
 
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
-# the generated latex document. The header should contain everything until 
-# the first chapter. If it is left blank doxygen will generate a 
-# standard header. Notice: only use this tag if you know what you are doing! 
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
 
-LATEX_HEADER          = 
+LATEX_HEADER          =
 
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
-# contain links (just like the HTML output) instead of page references 
-# This makes the output suitable for online browsing using a pdf viewer. 
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
 
 PDF_HYPERLINKS        = NO
 
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
-# command to the generated LaTeX files. This will instruct LaTeX to keep 
-# running if errors occur, instead of asking the user for help. 
-# This option is also used when generating formulas in HTML. 
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
 
 LATEX_BATCHMODE       = NO
 
@@ -418,31 +418,31 @@ LATEX_BATCHMODE       = NO
 # configuration options related to the RTF output
 #---------------------------------------------------------------------------
 
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
-# For now this is experimental and is disabled by default. The RTF output 
-# is optimised for Word 97 and may not look too pretty with other readers 
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# For now this is experimental and is disabled by default. The RTF output
+# is optimised for Word 97 and may not look too pretty with other readers
 # or editors.
 
 GENERATE_RTF          = YES
 
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
-# put in front of it. If left blank `rtf' will be used as the default path. 
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
 
 RTF_OUTPUT            = rtf
 
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
-# RTF documents. This may be useful for small projects and may help to 
-# save some trees in general. 
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
 
 COMPACT_RTF           = NO
 
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
-# will contain hyperlink fields. The RTF file will 
-# contain links (just like the HTML output) instead of page references. 
-# This makes the output suitable for online browsing using a WORD or other. 
-# programs which support those fields. 
-# Note: wordpad (write) and others do not support links. 
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using a WORD or other.
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
 
 RTF_HYPERLINKS        = NO
 
@@ -450,54 +450,54 @@ RTF_HYPERLINKS        = NO
 # configuration options related to the man page output
 #---------------------------------------------------------------------------
 
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
-# generate man pages 
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
 
 GENERATE_MAN          = YES
 
-# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
-# put in front of it. If left blank `man' will be used as the default path. 
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
 
 MAN_OUTPUT            = man
 
-# The MAN_EXTENSION tag determines the extension that is added to 
-# the generated man pages (default is the subroutine's section .3) 
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
 
 MAN_EXTENSION         = .3
 
 #---------------------------------------------------------------------------
-# Configuration options related to the preprocessor   
+# Configuration options related to the preprocessor
 #---------------------------------------------------------------------------
 
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
-# evaluate all C-preprocessor directives found in the sources and include 
-# files. 
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
 
 ENABLE_PREPROCESSING  = YES
 
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
-# names in the source code. If set to NO (the default) only conditional 
-# compilation will be performed. 
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed.
 
 MACRO_EXPANSION       = YES
 
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
-# in the INCLUDE_PATH (see below) will be search if a #include is found. 
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
 
 SEARCH_INCLUDES       = NO
 
-# The INCLUDE_PATH tag can be used to specify one or more directories that 
-# contain include files that are not input files but should be processed by 
-# the preprocessor. 
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
 
-INCLUDE_PATH          = 
+INCLUDE_PATH          =
 
-# The PREDEFINED tag can be used to specify one or more macro names that 
-# are defined before the preprocessor is started (similar to the -D option of 
-# gcc). The argument of the tag is a list of macros of the form: name 
-# or name=definition (no spaces). If the definition and the = are 
-# omitted =1 is assumed. 
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed.
 
 PREDEFINED  =  "itkNotUsed(x)="\
                "itkSetMacro(name,type)= \
@@ -558,140 +558,140 @@ PREDEFINED  =  "itkNotUsed(x)="\
                "ITK_NUMERIC_LIMITS= \
                   std::numeric_limits"
 
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
-# then the macro expansion is limited to the macros specified with the 
-# PREDEFINED tag. 
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED tag.
 
 EXPAND_ONLY_PREDEF    = YES
 
 #---------------------------------------------------------------------------
-# Configuration::addtions related to external references   
+# Configuration::addtions related to external references
 #---------------------------------------------------------------------------
 
-# The TAGFILES tag can be used to specify one or more tagfiles. 
+# The TAGFILES tag can be used to specify one or more tagfiles.
 
-TAGFILES              = 
+TAGFILES              =
 
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
-# a tag file that is based on the input files it reads. 
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
 
-GENERATE_TAGFILE      = 
+GENERATE_TAGFILE      =
 
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
-# in the class index. If set to NO only the inherited external classes 
-# will be listed. 
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
 
 ALLEXTERNALS          = NO
 
-# The PERL_PATH should be the absolute path and name of the perl script 
-# interpreter (i.e. the result of `which perl'). 
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
 
 PERL_PATH             = /usr/bin/perl
 
 #---------------------------------------------------------------------------
-# Configuration options related to the dot tool   
+# Configuration options related to the dot tool
 #---------------------------------------------------------------------------
 
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
-# available from the path. This tool is part of Graphviz, a graph visualization 
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
-# have no effect if this option is set to NO (the default) 
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
 
 HAVE_DOT              = YES
 
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
-# will generate a graph for each documented class showing the direct and 
-# indirect inheritance relations. Setting this tag to YES will force the 
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
 # the CLASS_DIAGRAMS tag to NO.
 
 CLASS_GRAPH           = YES
 
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
-# will generate a graph for each documented class showing the direct and 
-# indirect implementation dependencies (inheritance, containment, and 
-# class references variables) of the class with other documented classes. 
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
 
 COLLABORATION_GRAPH   = YES
 
-# If the ENABLE_PREPROCESSING, INCLUDE_GRAPH, and HAVE_DOT tags are set to 
-# YES then doxygen will generate a graph for each documented file showing 
-# the direct and indirect include dependencies of the file with other 
-# documented files. 
+# If the ENABLE_PREPROCESSING, INCLUDE_GRAPH, and HAVE_DOT tags are set to
+# YES then doxygen will generate a graph for each documented file showing
+# the direct and indirect include dependencies of the file with other
+# documented files.
 
 INCLUDE_GRAPH         = YES
 
-# If the ENABLE_PREPROCESSING, INCLUDED_BY_GRAPH, and HAVE_DOT tags are set to 
-# YES then doxygen will generate a graph for each documented header file showing 
-# the documented files that directly or indirectly include this file 
+# If the ENABLE_PREPROCESSING, INCLUDED_BY_GRAPH, and HAVE_DOT tags are set to
+# YES then doxygen will generate a graph for each documented header file showing
+# the documented files that directly or indirectly include this file
 
 INCLUDED_BY_GRAPH     = YES
 
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
-# will graphical hierarchy of all classes instead of a textual one. 
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
 
 GRAPHICAL_HIERARCHY   = YES
 
-# The tag DOT_PATH can be used to specify the path where the dot tool can be 
-# found. If left blank, it is assumed the dot tool can be found on the path. 
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found on the path.
 
 DOT_PATH              =
 
-# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width 
-# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
-# this value, doxygen will try to truncate the graph, so that it fits within 
-# the specified constraint. Beware that most browsers cannot cope with very 
-# large images. 
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
 
 MAX_DOT_GRAPH_WIDTH   = 1024
 
-# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height 
-# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
-# this value, doxygen will try to truncate the graph, so that it fits within 
-# the specified constraint. Beware that most browsers cannot cope with very 
-# large images. 
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
 
 MAX_DOT_GRAPH_HEIGHT  = 1024
 
 #---------------------------------------------------------------------------
-# Configuration::addtions related to the search engine   
+# Configuration::addtions related to the search engine
 #---------------------------------------------------------------------------
 
-# The SEARCHENGINE tag specifies whether or not a search engine should be 
-# used. If set to NO the values of all tags below this one will be ignored. 
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
 
 SEARCHENGINE          = NO
 
-# The CGI_NAME tag should be the name of the CGI script that 
-# starts the search engine (doxysearch) with the correct parameters. 
-# A script with this name will be generated by doxygen. 
+# The CGI_NAME tag should be the name of the CGI script that
+# starts the search engine (doxysearch) with the correct parameters.
+# A script with this name will be generated by doxygen.
 
 CGI_NAME              = search.cgi
 
-# The CGI_URL tag should be the absolute URL to the directory where the 
-# cgi binaries are located. See the documentation of your http daemon for 
-# details. 
+# The CGI_URL tag should be the absolute URL to the directory where the
+# cgi binaries are located. See the documentation of your http daemon for
+# details.
 
-CGI_URL               = 
+CGI_URL               =
 
-# The DOC_URL tag should be the absolute URL to the directory where the 
-# documentation is located. If left blank the absolute path to the 
-# documentation, with file:// prepended to it, will be used. 
+# The DOC_URL tag should be the absolute URL to the directory where the
+# documentation is located. If left blank the absolute path to the
+# documentation, with file:// prepended to it, will be used.
 
-DOC_URL               = 
+DOC_URL               =
 
-# The DOC_ABSPATH tag should be the absolute path to the directory where the 
-# documentation is located. If left blank the directory on the local machine 
-# will be used. 
+# The DOC_ABSPATH tag should be the absolute path to the directory where the
+# documentation is located. If left blank the directory on the local machine
+# will be used.
 
-DOC_ABSPATH           = 
+DOC_ABSPATH           =
 
-# The BIN_ABSPATH tag must point to the directory where the doxysearch binary 
-# is installed. 
+# The BIN_ABSPATH tag must point to the directory where the doxysearch binary
+# is installed.
 
 BIN_ABSPATH           = /usr/local/bin/
 
-# The EXT_DOC_PATHS tag can be used to specify one or more paths to 
-# documentation generated for other projects. This allows doxysearch to search 
-# the documentation for these projects as well. 
+# The EXT_DOC_PATHS tag can be used to specify one or more paths to
+# documentation generated for other projects. This allows doxysearch to search
+# the documentation for these projects as well.
 
-EXT_DOC_PATHS         = 
+EXT_DOC_PATHS         =

From 77543bde41b0e52c3959016698b529835945d62d Mon Sep 17 00:00:00 2001
From: Kitware Robot <kwrobot@kitware.com>
Date: Mon, 13 Aug 2012 13:47:32 -0400
Subject: [PATCH 3/7] Convert CMake-language commands to lower case

Ancient CMake versions required upper-case commands.  Later command
names became case-insensitive.  Now the preferred style is lower-case.

Run the following shell code:

cmake --help-command-list |
grep -v "cmake version" |
while read c; do
    echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
---
 CMakeCPack.cmake                              |  134 +-
 CMakeCPackOptions.cmake.in                    |   28 +-
 CMakeGraphVizOptions.cmake                    |    2 +-
 CMakeLists.txt                                |  672 ++++----
 CTestConfig.cmake                             |    2 +-
 CTestCustom.cmake.in                          |   18 +-
 CompileFlags.cmake                            |   72 +-
 Docs/CMakeLists.txt                           |    2 +-
 Modules/AddFileDependencies.cmake             |   18 +-
 Modules/CMakeASM-ATTInformation.cmake         |   10 +-
 Modules/CMakeASMCompiler.cmake.in             |   20 +-
 Modules/CMakeASMInformation.cmake             |  148 +-
 Modules/CMakeASM_MASMInformation.cmake        |   10 +-
 Modules/CMakeASM_NASMInformation.cmake        |   12 +-
 Modules/CMakeBackwardCompatibilityC.cmake     |   82 +-
 Modules/CMakeBackwardCompatibilityCXX.cmake   |   58 +-
 Modules/CMakeBorlandFindMake.cmake            |    4 +-
 Modules/CMakeCCompiler.cmake.in               |   78 +-
 Modules/CMakeCInformation.cmake               |  200 +--
 Modules/CMakeCXXCompiler.cmake.in             |   80 +-
 Modules/CMakeCXXInformation.cmake             |  306 ++--
 Modules/CMakeClDeps.cmake                     |   28 +-
 Modules/CMakeCommonLanguageInclude.cmake      |   44 +-
 Modules/CMakeDependentOption.cmake            |   48 +-
 Modules/CMakeDetermineASM-ATTCompiler.cmake   |    8 +-
 Modules/CMakeDetermineASMCompiler.cmake       |  192 +--
 Modules/CMakeDetermineASM_MASMCompiler.cmake  |   16 +-
 Modules/CMakeDetermineASM_NASMCompiler.cmake  |   14 +-
 Modules/CMakeDetermineCCompiler.cmake         |  160 +-
 Modules/CMakeDetermineCXXCompiler.cmake       |  168 +-
 Modules/CMakeDetermineCompilerABI.cmake       |  134 +-
 Modules/CMakeDetermineCompilerId.cmake        |  310 ++--
 Modules/CMakeDetermineFortranCompiler.cmake   |  196 +--
 Modules/CMakeDetermineJavaCompiler.cmake      |   84 +-
 Modules/CMakeDetermineRCCompiler.cmake        |   70 +-
 Modules/CMakeDetermineSystem.cmake            |  168 +-
 Modules/CMakeExpandImportedTargets.cmake      |    2 +-
 Modules/CMakeExportBuildSettings.cmake        |   20 +-
 ...etermineCompilerMacrosAndIncludeDirs.cmake |  110 +-
 Modules/CMakeFindBinUtils.cmake               |   46 +-
 Modules/CMakeFindCodeBlocks.cmake             |   10 +-
 Modules/CMakeFindEclipseCDT4.cmake            |   78 +-
 Modules/CMakeFindFrameworks.cmake             |   26 +-
 Modules/CMakeFindKDevelop3.cmake              |    8 +-
 Modules/CMakeFindWMake.cmake                  |    4 +-
 Modules/CMakeFindXCode.cmake                  |    4 +-
 Modules/CMakeForceCompiler.cmake              |   64 +-
 Modules/CMakeFortranCompiler.cmake.in         |   84 +-
 Modules/CMakeFortranInformation.cmake         |  268 ++--
 Modules/CMakeGenericSystem.cmake              |   98 +-
 Modules/CMakeImportBuildSettings.cmake        |   12 +-
 Modules/CMakeJOMFindMake.cmake                |    4 +-
 Modules/CMakeJavaCompiler.cmake.in            |   24 +-
 Modules/CMakeJavaInformation.cmake            |   50 +-
 Modules/CMakeMSYSFindMake.cmake               |    4 +-
 Modules/CMakeMinGWFindMake.cmake              |   14 +-
 Modules/CMakeNMakeFindMake.cmake              |    4 +-
 Modules/CMakeNinjaFindMake.cmake              |    4 +-
 Modules/CMakePackageConfigHelpers.cmake       |   10 +-
 Modules/CMakePrintSystemInformation.cmake     |   46 +-
 Modules/CMakePushCheckState.cmake             |   38 +-
 Modules/CMakeRCCompiler.cmake.in              |   12 +-
 Modules/CMakeRCInformation.cmake              |   30 +-
 Modules/CMakeSystem.cmake.in                  |   20 +-
 Modules/CMakeSystemSpecificInformation.cmake  |   46 +-
 Modules/CMakeTestASM-ATTCompiler.cmake        |    6 +-
 Modules/CMakeTestASMCompiler.cmake            |   20 +-
 Modules/CMakeTestASM_MASMCompiler.cmake       |    6 +-
 Modules/CMakeTestASM_NASMCompiler.cmake       |    6 +-
 Modules/CMakeTestCCompiler.cmake              |   60 +-
 Modules/CMakeTestCXXCompiler.cmake            |   60 +-
 Modules/CMakeTestCompilerCommon.cmake         |   10 +-
 Modules/CMakeTestFortranCompiler.cmake        |   84 +-
 Modules/CMakeTestJavaCompiler.cmake           |    2 +-
 Modules/CMakeTestRCCompiler.cmake             |    2 +-
 Modules/CMakeUnixFindMake.cmake               |    4 +-
 Modules/CMakeVS10FindMake.cmake               |   14 +-
 Modules/CMakeVS11FindMake.cmake               |   14 +-
 Modules/CMakeVS6BackwardCompatibility.cmake   |   20 +-
 Modules/CMakeVS6FindMake.cmake                |    8 +-
 Modules/CMakeVS71FindMake.cmake               |    8 +-
 Modules/CMakeVS7BackwardCompatibility.cmake   |   20 +-
 Modules/CMakeVS7FindMake.cmake                |    8 +-
 Modules/CMakeVS8FindMake.cmake                |   16 +-
 Modules/CMakeVS9FindMake.cmake                |   16 +-
 Modules/CPack.cmake                           |  132 +-
 Modules/CPackComponent.cmake                  |  206 +--
 Modules/CPackDeb.cmake                        |  248 +--
 Modules/CPackRPM.cmake                        |  396 ++---
 Modules/CPackZIP.cmake                        |   46 +-
 Modules/CTest.cmake                           |  270 ++--
 Modules/CTestTargets.cmake                    |   78 +-
 Modules/CheckCCompilerFlag.cmake              |   12 +-
 Modules/CheckCSourceCompiles.cmake            |   88 +-
 Modules/CheckCSourceRuns.cmake                |   70 +-
 Modules/CheckCXXCompilerFlag.cmake            |   12 +-
 Modules/CheckCXXSourceCompiles.cmake          |   88 +-
 Modules/CheckCXXSourceRuns.cmake              |   70 +-
 Modules/CheckCXXSymbolExists.cmake            |    6 +-
 Modules/CheckFortranFunctionExists.cmake      |    4 +-
 Modules/CheckFunctionExists.cmake             |   54 +-
 Modules/CheckIncludeFile.cmake                |   60 +-
 Modules/CheckIncludeFileCXX.cmake             |   60 +-
 Modules/CheckIncludeFiles.cmake               |   74 +-
 Modules/CheckLibraryExists.cmake              |   42 +-
 Modules/CheckSizeOf.cmake                     |    2 +-
 Modules/CheckStructHasMember.cmake            |   16 +-
 Modules/CheckSymbolExists.cmake               |   70 +-
 Modules/CheckVariableExists.cmake             |   44 +-
 Modules/Compiler/Absoft-Fortran.cmake         |   16 +-
 Modules/Compiler/GNU-Fortran.cmake            |   10 +-
 Modules/Compiler/GNU.cmake                    |    2 +-
 Modules/Compiler/HP-ASM.cmake                 |    2 +-
 Modules/Compiler/HP-C.cmake                   |    6 +-
 Modules/Compiler/HP-CXX.cmake                 |    6 +-
 Modules/Compiler/HP-Fortran.cmake             |    2 +-
 Modules/Compiler/Intel-ASM.cmake              |   22 +-
 Modules/Compiler/Intel-C.cmake                |   16 +-
 Modules/Compiler/Intel-CXX.cmake              |   16 +-
 Modules/Compiler/Intel-Fortran.cmake          |   14 +-
 Modules/Compiler/MIPSpro-C.cmake              |    2 +-
 Modules/Compiler/MIPSpro-CXX.cmake            |    2 +-
 Modules/Compiler/MIPSpro-Fortran.cmake        |    2 +-
 Modules/Compiler/PGI-Fortran.cmake            |   10 +-
 Modules/Compiler/PathScale-Fortran.cmake      |    2 +-
 Modules/Compiler/SunPro-ASM.cmake             |   30 +-
 Modules/Compiler/SunPro-C.cmake               |   38 +-
 Modules/Compiler/SunPro-CXX.cmake             |   40 +-
 Modules/Compiler/SunPro-Fortran.cmake         |   26 +-
 Modules/Compiler/TinyCC-C.cmake               |   12 +-
 Modules/Compiler/XL-ASM.cmake                 |   14 +-
 Modules/Compiler/XL-C.cmake                   |    2 +-
 Modules/Compiler/XL-CXX.cmake                 |    4 +-
 Modules/Compiler/XL-Fortran.cmake             |   10 +-
 Modules/Dart.cmake                            |   78 +-
 Modules/DeployQt4.cmake                       |    4 +-
 Modules/Documentation.cmake                   |   26 +-
 Modules/FLTKCompatibility.cmake               |    2 +-
 Modules/FeatureSummary.cmake                  |  366 ++---
 Modules/FindASPELL.cmake                      |   10 +-
 Modules/FindAVIFile.cmake                     |   20 +-
 Modules/FindBISON.cmake                       |  130 +-
 Modules/FindBZip2.cmake                       |   32 +-
 Modules/FindBoost.cmake                       |    2 +-
 Modules/FindCABLE.cmake                       |   44 +-
 Modules/FindCUDA.cmake                        |    2 +-
 Modules/FindCURL.cmake                        |   38 +-
 Modules/FindCoin3D.cmake                      |   62 +-
 Modules/FindCurses.cmake                      |  134 +-
 Modules/FindCygwin.cmake                      |    8 +-
 Modules/FindDart.cmake                        |    6 +-
 Modules/FindDevIL.cmake                       |   18 +-
 Modules/FindDoxygen.cmake                     |   30 +-
 Modules/FindEXPAT.cmake                       |   16 +-
 Modules/FindFLEX.cmake                        |  104 +-
 Modules/FindFLTK.cmake                        |  288 ++--
 Modules/FindFLTK2.cmake                       |  248 +--
 Modules/FindFreetype.cmake                    |   54 +-
 Modules/FindGCCXML.cmake                      |    4 +-
 Modules/FindGDAL.cmake                        |    8 +-
 Modules/FindGIF.cmake                         |   32 +-
 Modules/FindGLU.cmake                         |   12 +-
 Modules/FindGLUT.cmake                        |   44 +-
 Modules/FindGTK.cmake                         |   68 +-
 Modules/FindGettext.cmake                     |  216 +--
 Modules/FindGnuTLS.cmake                      |   34 +-
 Modules/FindGnuplot.cmake                     |   22 +-
 Modules/FindHSPELL.cmake                      |   20 +-
 Modules/FindHTMLHelp.cmake                    |   14 +-
 Modules/FindITK.cmake                         |   28 +-
 Modules/FindImageMagick.cmake                 |  148 +-
 Modules/FindJNI.cmake                         |  194 +--
 Modules/FindJPEG.cmake                        |   24 +-
 Modules/FindJasper.cmake                      |   32 +-
 Modules/FindJava.cmake                        |   76 +-
 Modules/FindKDE3.cmake                        |  228 +--
 Modules/FindKDE4.cmake                        |   86 +-
 Modules/FindLATEX.cmake                       |   46 +-
 Modules/FindLibLZMA.cmake                     |   36 +-
 Modules/FindLibXml2.cmake                     |   32 +-
 Modules/FindLibXslt.cmake                     |   34 +-
 Modules/FindLua50.cmake                       |   34 +-
 Modules/FindLua51.cmake                       |   34 +-
 Modules/FindMFC.cmake                         |   50 +-
 Modules/FindMPEG.cmake                        |   16 +-
 Modules/FindMPEG2.cmake                       |   24 +-
 Modules/FindMatlab.cmake                      |   74 +-
 Modules/FindMotif.cmake                       |   14 +-
 Modules/FindOpenAL.cmake                      |    8 +-
 Modules/FindOpenGL.cmake                      |  118 +-
 Modules/FindOpenSSL.cmake                     |   80 +-
 Modules/FindOpenSceneGraph.cmake              |    2 +-
 Modules/FindPHP4.cmake                        |   38 +-
 Modules/FindPNG.cmake                         |    8 +-
 Modules/FindPackageHandleStandardArgs.cmake   |  288 ++--
 Modules/FindPackageMessage.cmake              |   26 +-
 Modules/FindPerl.cmake                        |   46 +-
 Modules/FindPerlLibs.cmake                    |    2 +-
 Modules/FindPhysFS.cmake                      |    6 +-
 Modules/FindPike.cmake                        |    8 +-
 Modules/FindPostgreSQL.cmake                  |    4 +-
 Modules/FindProducer.cmake                    |    4 +-
 Modules/FindPythonLibs.cmake                  |  236 +--
 Modules/FindQt.cmake                          |  166 +-
 Modules/FindQt3.cmake                         |  216 +--
 Modules/FindQt4.cmake                         |  822 +++++-----
 Modules/FindQuickTime.cmake                   |   16 +-
 Modules/FindRTI.cmake                         |   54 +-
 Modules/FindRuby.cmake                        |  208 +--
 Modules/FindSDL.cmake                         |   64 +-
 Modules/FindSDL_image.cmake                   |    6 +-
 Modules/FindSDL_mixer.cmake                   |    6 +-
 Modules/FindSDL_net.cmake                     |    6 +-
 Modules/FindSDL_sound.cmake                   |  152 +-
 Modules/FindSDL_ttf.cmake                     |    6 +-
 Modules/FindSWIG.cmake                        |   54 +-
 Modules/FindSelfPackers.cmake                 |   30 +-
 Modules/FindSquish.cmake                      |   94 +-
 Modules/FindSubversion.cmake                  |   80 +-
 Modules/FindTCL.cmake                         |  112 +-
 Modules/FindTIFF.cmake                        |   26 +-
 Modules/FindTclStub.cmake                     |   48 +-
 Modules/FindTclsh.cmake                       |   52 +-
 Modules/FindThreads.cmake                     |  180 +--
 Modules/FindUnixCommands.cmake                |   26 +-
 Modules/FindVTK.cmake                         |  100 +-
 Modules/FindWget.cmake                        |   10 +-
 Modules/FindWish.cmake                        |   44 +-
 Modules/FindX11.cmake                         |  538 +++----
 Modules/FindXMLRPC.cmake                      |  142 +-
 Modules/FindZLIB.cmake                        |   66 +-
 Modules/FindwxWidgets.cmake                   |  706 ++++-----
 Modules/FindwxWindows.cmake                   |  398 ++---
 Modules/ITKCompatibility.cmake                |    2 +-
 Modules/InstallRequiredSystemLibraries.cmake  |  314 ++--
 Modules/KDE3Macros.cmake                      |  388 ++---
 Modules/MacroAddFileDependencies.cmake        |   20 +-
 Modules/Platform/AIX.cmake                    |   20 +-
 Modules/Platform/BSDOS.cmake                  |    2 +-
 Modules/Platform/BeOS.cmake                   |   20 +-
 Modules/Platform/BlueGeneL.cmake              |   52 +-
 Modules/Platform/CYGWIN-GNU.cmake             |    8 +-
 Modules/Platform/CYGWIN-windres.cmake         |    2 +-
 Modules/Platform/CYGWIN.cmake                 |   26 +-
 Modules/Platform/Catamount.cmake              |   40 +-
 Modules/Platform/Darwin-GNU.cmake             |    2 +-
 Modules/Platform/Darwin-XL-C.cmake            |    6 +-
 Modules/Platform/Darwin-XL-CXX.cmake          |    6 +-
 Modules/Platform/Darwin-icc.cmake             |  148 +-
 Modules/Platform/Darwin-icpc.cmake            |    6 +-
 Modules/Platform/Darwin.cmake                 |  238 +--
 Modules/Platform/DragonFly.cmake              |    2 +-
 Modules/Platform/FreeBSD.cmake                |   38 +-
 Modules/Platform/GNU.cmake                    |   20 +-
 Modules/Platform/Generic-ADSP-ASM.cmake       |    8 +-
 Modules/Platform/Generic-ADSP-C.cmake         |   20 +-
 Modules/Platform/Generic-ADSP-CXX.cmake       |   20 +-
 Modules/Platform/Generic-ADSP-Common.cmake    |  130 +-
 Modules/Platform/Generic-SDCC-C.cmake         |   54 +-
 Modules/Platform/Generic.cmake                |    8 +-
 Modules/Platform/HP-UX.cmake                  |   48 +-
 Modules/Platform/Haiku.cmake                  |   40 +-
 Modules/Platform/IRIX.cmake                   |   54 +-
 Modules/Platform/IRIX64.cmake                 |   94 +-
 Modules/Platform/Linux-Clang-C.cmake          |    2 +-
 Modules/Platform/Linux-Clang-CXX.cmake        |    2 +-
 Modules/Platform/Linux-GNU-C.cmake            |    2 +-
 Modules/Platform/Linux-GNU-CXX.cmake          |    2 +-
 Modules/Platform/Linux-GNU-Fortran.cmake      |    2 +-
 Modules/Platform/Linux-Intel-C.cmake          |    2 +-
 Modules/Platform/Linux-Intel-CXX.cmake        |    2 +-
 Modules/Platform/Linux-Intel-Fortran.cmake    |    2 +-
 Modules/Platform/Linux-SunPro-CXX.cmake       |    2 +-
 Modules/Platform/Linux-TinyCC-C.cmake         |    8 +-
 Modules/Platform/Linux-XL-C.cmake             |    2 +-
 Modules/Platform/Linux-XL-CXX.cmake           |    2 +-
 Modules/Platform/Linux-XL-Fortran.cmake       |    2 +-
 Modules/Platform/Linux-como.cmake             |   10 +-
 Modules/Platform/Linux.cmake                  |   50 +-
 Modules/Platform/MP-RAS.cmake                 |   22 +-
 Modules/Platform/NetBSD.cmake                 |   28 +-
 Modules/Platform/OSF1.cmake                   |   76 +-
 Modules/Platform/OpenBSD.cmake                |   14 +-
 Modules/Platform/OpenVMS.cmake                |    8 +-
 Modules/Platform/QNX.cmake                    |   38 +-
 Modules/Platform/RISCos.cmake                 |   10 +-
 Modules/Platform/SCO_SV.cmake                 |    4 +-
 Modules/Platform/SINIX.cmake                  |    8 +-
 Modules/Platform/SunOS.cmake                  |   40 +-
 Modules/Platform/Tru64.cmake                  |    2 +-
 Modules/Platform/ULTRIX.cmake                 |   10 +-
 Modules/Platform/UNIX_SV.cmake                |   10 +-
 Modules/Platform/UnixPaths.cmake              |   30 +-
 Modules/Platform/UnixWare.cmake               |   10 +-
 Modules/Platform/Windows-Embarcadero.cmake    |   40 +-
 Modules/Platform/Windows-Intel-Fortran.cmake  |   10 +-
 Modules/Platform/Windows-Intel.cmake          |   98 +-
 Modules/Platform/Windows-cl.cmake             |  368 ++---
 Modules/Platform/Windows-cl.cmake.in          |   28 +-
 Modules/Platform/Windows-df.cmake             |   94 +-
 Modules/Platform/Windows-wcl386.cmake         |   90 +-
 Modules/Platform/Windows-windres.cmake        |    2 +-
 Modules/Platform/Windows.cmake                |   48 +-
 Modules/Platform/WindowsPaths.cmake           |   56 +-
 Modules/Platform/Xenix.cmake                  |    2 +-
 Modules/Platform/cl.cmake                     |   54 +-
 Modules/Platform/eCos.cmake                   |   88 +-
 Modules/Platform/gas.cmake                    |   20 +-
 Modules/Platform/kFreeBSD.cmake               |    4 +-
 Modules/Platform/syllable.cmake               |   28 +-
 Modules/Qt4ConfigDependentSettings.cmake      |  326 ++--
 Modules/Qt4Macros.cmake                       |  524 +++---
 Modules/SystemInformation.cmake               |  104 +-
 Modules/TestBigEndian.cmake                   |  112 +-
 Modules/TestCXXAcceptsFlag.cmake              |   26 +-
 Modules/TestForANSIForScope.cmake             |   26 +-
 Modules/TestForANSIStreamHeaders.cmake        |   18 +-
 Modules/TestForSSTREAM.cmake                  |   26 +-
 Modules/TestForSTDNamespace.cmake             |   26 +-
 Modules/UseEcos.cmake                         |  190 +--
 Modules/UsePkgConfig.cmake                    |   52 +-
 Modules/UseQt4.cmake                          |  148 +-
 Modules/UseSWIG.cmake                         |  252 +--
 Modules/UseVTK40.cmake                        |    8 +-
 Modules/UseVTKBuildSettings40.cmake           |   34 +-
 Modules/UseVTKConfig40.cmake                  |  376 ++---
 Modules/Use_wxWindows.cmake                   |   50 +-
 Modules/UsewxWidgets.cmake                    |   80 +-
 Modules/VTKCompatibility.cmake                |   32 +-
 Modules/kde3uic.cmake                         |   10 +-
 Source/CMakeLists.txt                         |  258 +--
 Source/CMakeVersion.cmake                     |   10 +-
 Source/CursesDialog/CMakeLists.txt            |   14 +-
 Source/CursesDialog/form/CMakeLists.txt       |   22 +-
 Source/QtDialog/CMakeLists.txt                |   82 +-
 Source/QtDialog/QtDialogCPack.cmake.in        |   22 +-
 .../CMakeVisualStudio6Configurations.cmake    |    2 +-
 Templates/CTestScript.cmake.in                |   30 +-
 Tests/BuildDepends/Project/CMakeLists.txt     |   14 +-
 Tests/BundleGeneratorTest/CMakeLists.txt      |   34 +-
 Tests/BundleTest/BundleSubDir/CMakeLists.txt  |   14 +-
 Tests/BundleTest/CMakeLists.txt               |  100 +-
 Tests/CMakeLists.txt                          | 1398 ++++++++---------
 .../CheckCXXSymbolExists/CMakeLists.txt       |   50 +-
 .../CheckSymbolExists/CMakeLists.txt          |   38 +-
 Tests/CMakeTests/CMakeLists.txt               |   14 +-
 Tests/CMakeTests/ListTest.cmake.in            |   90 +-
 Tests/CMakeTests/ToolchainTest.cmake.in       |    2 +-
 Tests/CMakeTests/VariableWatchTest.cmake.in   |   12 +-
 Tests/CTestTest/test.cmake.in                 |   28 +-
 Tests/CTestTest2/test.cmake.in                |   42 +-
 Tests/CTestTestBadExe/CMakeLists.txt          |    8 +-
 Tests/CTestTestBadExe/test.cmake.in           |   22 +-
 Tests/CTestTestChecksum/test.cmake.in         |   28 +-
 .../test1.cmake.in                            |   22 +-
 .../test2.cmake.in                            |   22 +-
 Tests/CTestTestCostSerial/CMakeLists.txt      |   20 +-
 Tests/CTestTestCostSerial/test.cmake.in       |   28 +-
 Tests/CTestTestCrash/CMakeLists.txt           |    8 +-
 Tests/CTestTestCrash/test.cmake.in            |   22 +-
 Tests/CTestTestCycle/test.cmake.in            |   22 +-
 Tests/CTestTestDepends/test.cmake.in          |   22 +-
 Tests/CTestTestFailedSubmits/test.cmake.in    |   22 +-
 Tests/CTestTestFailure/CMakeLists.txt         |   10 +-
 Tests/CTestTestFailure/testNoBuild.cmake.in   |   22 +-
 Tests/CTestTestFailure/testNoExe.cmake.in     |   22 +-
 Tests/CTestTestParallel/CMakeLists.txt        |   20 +-
 Tests/CTestTestParallel/test.cmake.in         |   22 +-
 Tests/CTestTestResourceLock/CMakeLists.txt    |   18 +-
 Tests/CTestTestResourceLock/test.cmake.in     |   22 +-
 Tests/CTestTestRunScript/hello.cmake.in       |    4 +-
 Tests/CTestTestRunScript/test.cmake.in        |    2 +-
 Tests/CTestTestScheduler/CMakeLists.txt       |   14 +-
 Tests/CTestTestScheduler/test.cmake.in        |   28 +-
 Tests/CTestTestStopTime/CMakeLists.txt        |   14 +-
 Tests/CTestTestStopTime/GetDate.cmake         |  226 +--
 Tests/CTestTestStopTime/test.cmake.in         |   24 +-
 Tests/CTestTestSubdir/CMakeLists.txt          |   10 +-
 Tests/CTestTestSubdir/subdir/CMakeLists.txt   |    4 +-
 Tests/CTestTestSubdir/subdir2/CMakeLists.txt  |    4 +-
 Tests/CTestTestSubdir/subdir3/CMakeLists.txt  |    4 +-
 Tests/CTestTestSubdir/test.cmake.in           |   22 +-
 Tests/CTestTestTimeout/CMakeLists.txt         |   30 +-
 Tests/CTestTestTimeout/test.cmake.in          |   24 +-
 Tests/CTestTestUpload/CMakeLists.txt          |    2 +-
 Tests/CTestTestUpload/test.cmake.in           |   16 +-
 Tests/CTestTestZeroTimeout/CMakeLists.txt     |   12 +-
 Tests/CTestTestZeroTimeout/test.cmake.in      |   24 +-
 Tests/CommandLineTest/CMakeLists.txt          |   86 +-
 Tests/CommandLineTest/PreLoad.cmake           |    2 +-
 Tests/CompileCommandOutput/CMakeLists.txt     |   22 +-
 Tests/Complex/CMakeLists.txt                  |  344 ++--
 Tests/Complex/Executable/CMakeLists.txt       |  166 +-
 Tests/Complex/Executable/Included.cmake       |    2 +-
 Tests/Complex/Executable/Temp/CMakeLists.txt  |    2 +-
 Tests/Complex/Library/CMakeLists.txt          |  120 +-
 Tests/Complex/Library/test_preprocess.cmake   |   14 +-
 Tests/Complex/VarTests.cmake                  |  294 ++--
 Tests/ComplexOneConfig/CMakeLists.txt         |  324 ++--
 .../Executable/CMakeLists.txt                 |  166 +-
 .../Executable/Included.cmake                 |    2 +-
 .../Executable/Temp/CMakeLists.txt            |    2 +-
 Tests/ComplexOneConfig/Library/CMakeLists.txt |  120 +-
 .../Library/test_preprocess.cmake             |   14 +-
 Tests/ComplexOneConfig/VarTests.cmake         |  294 ++--
 Tests/Contracts/Trilinos-10-6/Patch.cmake     |    8 +-
 Tests/Contracts/vtk542/RunTest.cmake          |    2 +-
 Tests/CrossCompile/CMakeLists.txt             |   10 +-
 Tests/CustomCommand/CMakeLists.txt            |  142 +-
 .../GeneratedHeader/CMakeLists.txt            |    6 +-
 .../GeneratorInExtraDir/CMakeLists.txt        |   10 +-
 Tests/CustomCommand/check_mark.cmake          |   10 +-
 .../CMakeLists.txt                            |   12 +-
 Tests/Dependency/1/CMakeLists.txt             |    4 +-
 Tests/Dependency/CMakeLists.txt               |   40 +-
 Tests/Dependency/Eight/CMakeLists.txt         |    4 +-
 Tests/Dependency/Exec/CMakeLists.txt          |    4 +-
 Tests/Dependency/Exec2/CMakeLists.txt         |    4 +-
 Tests/Dependency/Exec3/CMakeLists.txt         |    4 +-
 Tests/Dependency/Exec4/CMakeLists.txt         |    4 +-
 Tests/Dependency/Five/CMakeLists.txt          |    4 +-
 Tests/Dependency/Four/CMakeLists.txt          |    8 +-
 Tests/Dependency/NoDepA/CMakeLists.txt        |    2 +-
 Tests/Dependency/NoDepB/CMakeLists.txt        |    2 +-
 Tests/Dependency/NoDepC/CMakeLists.txt        |    2 +-
 Tests/Dependency/Seven/CMakeLists.txt         |    4 +-
 Tests/Dependency/Six/CMakeLists.txt           |   10 +-
 Tests/Dependency/Three/CMakeLists.txt         |    4 +-
 Tests/Dependency/Two/CMakeLists.txt           |   16 +-
 Tests/EnforceConfig.cmake.in                  |   42 +-
 Tests/ExportImport/InitialCache.cmake.in      |   30 +-
 Tests/ExternalOBJ/CMakeLists.txt              |   54 +-
 Tests/ExternalOBJ/Object/CMakeLists.txt       |   18 +-
 .../Baz 1.1/BazConfigVersion.cmake            |   14 +-
 .../Baz 1.2/CMake/BazConfigVersion.cmake      |   14 +-
 Tests/FindPackageTest/CMakeLists.txt          |  388 ++---
 ...akeTestExportPackageConfigVersion.cmake.in |   10 +-
 Tests/FindPackageTest/FindRecursiveA.cmake    |    2 +-
 Tests/FindPackageTest/FindRecursiveB.cmake    |    2 +-
 Tests/FindPackageTest/FindRecursiveC.cmake    |    2 +-
 Tests/FindPackageTest/FindVersionTestA.cmake  |   36 +-
 Tests/FindPackageTest/FindVersionTestB.cmake  |   36 +-
 Tests/FindPackageTest/FindVersionTestC.cmake  |   36 +-
 Tests/FindPackageTest/FindVersionTestD.cmake  |   36 +-
 .../FindPackageTest/lib/TApp/TAppConfig.cmake |    2 +-
 .../cmake/zot-4.0/zot-config-version.cmake    |   14 +-
 .../lib/arch/zot-3.1/zot-config-version.cmake |   14 +-
 .../cmake/zot-3.1/zot-config-version.cmake    |    6 +-
 .../cmake/zot-4.0/zot-config-version.cmake    |   14 +-
 .../suffix/test/SuffixTestConfigVersion.cmake |   14 +-
 .../lib/zot-2.0/zot-config-version.cmake      |    8 +-
 .../lib/zot-3.0/zot-config-version.cmake      |    8 +-
 .../lib/zot-3.1/zot-config-version.cmake      |   14 +-
 .../lib/zot/zot-config-version.cmake          |   16 +-
 .../FindPackageTest/lib/zot/zot-config.cmake  |    2 +-
 Tests/Fortran/Library/CMakeLists.txt          |   14 +-
 Tests/FunctionTest/CMakeLists.txt             |  132 +-
 Tests/FunctionTest/SubDirScope/CMakeLists.txt |   16 +-
 Tests/IPO/CMakeLists.txt                      |    2 +-
 Tests/Jump/CMakeLists.txt                     |    8 +-
 Tests/Jump/Executable/CMakeLists.txt          |   10 +-
 Tests/Jump/Library/CMakeLists.txt             |    4 +-
 Tests/Jump/Library/Shared/CMakeLists.txt      |   38 +-
 Tests/Jump/Library/Static/CMakeLists.txt      |    2 +-
 Tests/LibName/CMakeLists.txt                  |    4 +-
 Tests/LinkLine/CMakeLists.txt                 |   12 +-
 Tests/LinkLineOrder/CMakeLists.txt            |   34 +-
 .../LoadCommand/CMakeCommands/CMakeLists.txt  |   18 +-
 Tests/LoadCommand/CMakeLists.txt              |   44 +-
 .../CMakeCommands/CMakeLists.txt              |   24 +-
 Tests/LoadCommandOneConfig/CMakeLists.txt     |   48 +-
 Tests/MacroTest/CMakeLists.txt                |   84 +-
 Tests/MacroTest/context.cmake                 |    6 +-
 Tests/MakeClean/CMakeLists.txt                |   42 +-
 Tests/MakeClean/ToClean/CMakeLists.txt        |   24 +-
 Tests/MakeClean/ToClean/ToCleanFiles.cmake.in |    2 +-
 Tests/MathTest/CMakeLists.txt                 |   20 +-
 Tests/ObjC++/CMakeLists.txt                   |    6 +-
 Tests/OutOfBinary/CMakeLists.txt              |    2 +-
 Tests/OutOfSource/CMakeLists.txt              |    6 +-
 .../OutOfSourceSubdir/CMakeLists.txt          |   68 +-
 Tests/OutOfSource/SubDir/CMakeLists.txt       |    6 +-
 Tests/PerConfig/CMakeLists.txt                |   36 +-
 Tests/Plugin/CMakeLists.txt                   |   90 +-
 Tests/PreOrder/CMakeLists.txt                 |   10 +-
 Tests/PreOrder/Library/CMakeLists.txt         |    2 +-
 Tests/PrecompiledHeader/CMakeLists.txt        |   66 +-
 Tests/SameName/CMakeLists.txt                 |    8 +-
 Tests/SameName/Exe1/CMakeLists.txt            |   14 +-
 Tests/SameName/Lib1/CMakeLists.txt            |    2 +-
 Tests/SetLang/CMakeLists.txt                  |    2 +-
 Tests/SimpleInstall/CMakeLists.txt            |  394 ++---
 Tests/SimpleInstall/InstallScript1.cmake      |   10 +-
 Tests/SimpleInstall/InstallScript2.cmake      |   26 +-
 Tests/SimpleInstall/InstallScript3.cmake      |   22 +-
 Tests/SimpleInstall/InstallScript4.cmake      |   38 +-
 Tests/SimpleInstall/PackageScript.cmake       |   14 +-
 Tests/SimpleInstall/PostInstall.cmake         |   12 +-
 Tests/SimpleInstall/PreInstall.cmake          |    4 +-
 Tests/SimpleInstall/TestSubDir/CMakeLists.txt |    6 +-
 Tests/SimpleInstall/scripts/CMakeLists.txt    |    2 +-
 Tests/SimpleInstallS2/CMakeLists.txt          |  394 ++---
 Tests/SimpleInstallS2/InstallScript1.cmake    |   10 +-
 Tests/SimpleInstallS2/InstallScript2.cmake    |   26 +-
 Tests/SimpleInstallS2/InstallScript3.cmake    |   22 +-
 Tests/SimpleInstallS2/InstallScript4.cmake    |   38 +-
 Tests/SimpleInstallS2/PackageScript.cmake     |   14 +-
 Tests/SimpleInstallS2/PostInstall.cmake       |   12 +-
 Tests/SimpleInstallS2/PreInstall.cmake        |    4 +-
 .../SimpleInstallS2/TestSubDir/CMakeLists.txt |    6 +-
 Tests/SimpleInstallS2/scripts/CMakeLists.txt  |    2 +-
 Tests/StringFileTest/CMakeLists.txt           |  346 ++--
 Tests/SubDir/CMakeLists.txt                   |   64 +-
 Tests/SubDir/Examples/CMakeLists.txt          |    4 +-
 Tests/SubDir/Examples/example1/CMakeLists.txt |    6 +-
 Tests/SubDir/Examples/example2/CMakeLists.txt |    4 +-
 Tests/SubDir/Executable/CMakeLists.txt        |    2 +-
 Tests/SubDirSpaces/CMakeLists.txt             |   84 +-
 .../Executable Sources/CMakeLists.txt         |    2 +-
 Tests/SubDirSpaces/Executable/CMakeLists.txt  |    2 +-
 .../SubDirSpaces/Some Examples/CMakeLists.txt |    4 +-
 .../Some Examples/example1/CMakeLists.txt     |    6 +-
 .../Some Examples/example2/CMakeLists.txt     |    4 +-
 Tests/SwigTest/CMakeLists.txt                 |   78 +-
 Tests/SystemInformation/CMakeLists.txt        |   74 +-
 Tests/TarTest/CMakeLists.txt                  |   74 +-
 Tests/TestDriver/CMakeLists.txt               |   12 +-
 Tests/Testing/CMakeLists.txt                  |   38 +-
 Tests/Testing/DartConfig.cmake                |   30 +-
 Tests/Testing/Sub/Sub2/CMakeLists.txt         |    4 +-
 Tests/TryCompile/CMakeLists.txt               |  250 +--
 Tests/Tutorial/Step7/build1.cmake             |    8 +-
 Tests/Tutorial/Step7/build2.cmake             |    6 +-
 Tests/VSExternalInclude/CMakeLists.txt        |   52 +-
 Tests/VSExternalInclude/Lib1/CMakeLists.txt   |    6 +-
 Tests/VSExternalInclude/Lib2/CMakeLists.txt   |    8 +-
 Tests/Wrapping/CMakeLists.txt                 |   96 +-
 Tests/X11/CMakeLists.txt                      |   44 +-
 Tests/test_clean.cmake.in                     |    4 +-
 Utilities/CMakeLists.txt                      |   60 +-
 Utilities/Doxygen/CMakeLists.txt              |   18 +-
 Utilities/KWIML/CMakeLists.txt                |    8 +-
 Utilities/KWStyle/CMakeLists.txt              |   60 +-
 Utilities/Release/Cygwin/CMakeLists.txt       |   36 +-
 Utilities/Release/release_cmake.cmake         |    6 +-
 bootstrap                                     |   14 +-
 cmake_uninstall.cmake.in                      |   34 +-
 547 files changed, 15862 insertions(+), 15862 deletions(-)

diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake
index 9ee56af57..7a36d5d35 100644
--- a/CMakeCPack.cmake
+++ b/CMakeCPack.cmake
@@ -11,113 +11,113 @@
 #=============================================================================
 
 # If the cmake version includes cpack, use it
-IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
-  IF(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
-    OPTION(CMAKE_INSTALL_DEBUG_LIBRARIES
+if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
+  if(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
+    option(CMAKE_INSTALL_DEBUG_LIBRARIES
       "Install Microsoft runtime debug libraries with CMake." FALSE)
-    MARK_AS_ADVANCED(CMAKE_INSTALL_DEBUG_LIBRARIES)
+    mark_as_advanced(CMAKE_INSTALL_DEBUG_LIBRARIES)
 
     # By default, do not warn when built on machines using only VS Express:
-    IF(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
-      SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
-    ENDIF()
+    if(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
+      set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
+    endif()
 
-    INCLUDE(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake)
-  ENDIF(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
+    include(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake)
+  endif(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
 
-  SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool")
-  SET(CPACK_PACKAGE_VENDOR "Kitware")
-  SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
-  SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
-  SET(CPACK_PACKAGE_VERSION "${CMake_VERSION}")
-  SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
-  SET(CPACK_SOURCE_PACKAGE_FILE_NAME "cmake-${CMake_VERSION}")
+  set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool")
+  set(CPACK_PACKAGE_VENDOR "Kitware")
+  set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
+  set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
+  set(CPACK_PACKAGE_VERSION "${CMake_VERSION}")
+  set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
+  set(CPACK_SOURCE_PACKAGE_FILE_NAME "cmake-${CMake_VERSION}")
 
   # Make this explicit here, rather than accepting the CPack default value,
   # so we can refer to it:
-  SET(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
+  set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
 
   # Installers for 32- vs. 64-bit CMake:
   #  - Root install directory (displayed to end user at installer-run time)
   #  - "NSIS package/display name" (text used in the installer GUI)
   #  - Registry key used to store info about the installation
-  IF(CMAKE_CL_64)
-    SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
-    SET(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} (Win64)")
-    SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION} (Win64)")
-  ELSE()
-    SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
-    SET(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
-    SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
-  ENDIF()
+  if(CMAKE_CL_64)
+    set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
+    set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} (Win64)")
+    set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION} (Win64)")
+  else()
+    set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
+    set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
+    set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
+  endif()
 
-  IF(NOT DEFINED CPACK_SYSTEM_NAME)
+  if(NOT DEFINED CPACK_SYSTEM_NAME)
     # make sure package is not Cygwin-unknown, for Cygwin just
     # cygwin is good for the system name
-    IF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
-      SET(CPACK_SYSTEM_NAME Cygwin)
-    ELSE("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
-      SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
-    ENDIF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
-  ENDIF(NOT DEFINED CPACK_SYSTEM_NAME)
-  IF(${CPACK_SYSTEM_NAME} MATCHES Windows)
-    IF(CMAKE_CL_64)
-      SET(CPACK_SYSTEM_NAME win64-x64)
-    ELSE(CMAKE_CL_64)
-      SET(CPACK_SYSTEM_NAME win32-x86)
-    ENDIF(CMAKE_CL_64)
-  ENDIF(${CPACK_SYSTEM_NAME} MATCHES Windows)
+    if("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
+      set(CPACK_SYSTEM_NAME Cygwin)
+    else("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
+      set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
+    endif("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
+  endif(NOT DEFINED CPACK_SYSTEM_NAME)
+  if(${CPACK_SYSTEM_NAME} MATCHES Windows)
+    if(CMAKE_CL_64)
+      set(CPACK_SYSTEM_NAME win64-x64)
+    else(CMAKE_CL_64)
+      set(CPACK_SYSTEM_NAME win32-x86)
+    endif(CMAKE_CL_64)
+  endif(${CPACK_SYSTEM_NAME} MATCHES Windows)
 
-  IF(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
+  if(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
     # if the CPACK_PACKAGE_FILE_NAME is not defined by the cache
     # default to source package - system, on cygwin system is not
     # needed
-    IF(CYGWIN)
-      SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
-    ELSE(CYGWIN)
-      SET(CPACK_PACKAGE_FILE_NAME
+    if(CYGWIN)
+      set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
+    else(CYGWIN)
+      set(CPACK_PACKAGE_FILE_NAME
         "${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
-    ENDIF(CYGWIN)
-  ENDIF(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
+    endif(CYGWIN)
+  endif(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
 
-  SET(CPACK_PACKAGE_CONTACT "cmake@cmake.org")
+  set(CPACK_PACKAGE_CONTACT "cmake@cmake.org")
 
-  IF(UNIX)
-    SET(CPACK_STRIP_FILES "bin/ccmake;bin/cmake;bin/cpack;bin/ctest")
-    SET(CPACK_SOURCE_STRIP_FILES "")
-    SET(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake")
-  ENDIF(UNIX)
+  if(UNIX)
+    set(CPACK_STRIP_FILES "bin/ccmake;bin/cmake;bin/cpack;bin/ctest")
+    set(CPACK_SOURCE_STRIP_FILES "")
+    set(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake")
+  endif(UNIX)
 
   # cygwin specific packaging stuff
-  IF(CYGWIN)
+  if(CYGWIN)
     # setup the cygwin package name
-    SET(CPACK_PACKAGE_NAME cmake)
+    set(CPACK_PACKAGE_NAME cmake)
     # setup the name of the package for cygwin cmake-2.4.3
-    SET(CPACK_PACKAGE_FILE_NAME
+    set(CPACK_PACKAGE_FILE_NAME
       "${CPACK_PACKAGE_NAME}-${CMake_VERSION}")
     # the source has the same name as the binary
-    SET(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
+    set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
     # Create a cygwin version number in case there are changes for cygwin
     # that are not reflected upstream in CMake
-    SET(CPACK_CYGWIN_PATCH_NUMBER 1)
+    set(CPACK_CYGWIN_PATCH_NUMBER 1)
     # These files are required by the cmCPackCygwinSourceGenerator and the files
     # put into the release tar files.
-    SET(CPACK_CYGWIN_BUILD_SCRIPT
+    set(CPACK_CYGWIN_BUILD_SCRIPT
       "${CMake_BINARY_DIR}/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.sh")
-    SET(CPACK_CYGWIN_PATCH_FILE
+    set(CPACK_CYGWIN_PATCH_FILE
       "${CMake_BINARY_DIR}/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.patch")
     # include the sub directory cmake file for cygwin that
     # configures some files and adds some install targets
     # this file uses some of the package file name variables
-    INCLUDE(Utilities/Release/Cygwin/CMakeLists.txt)
-  ENDIF(CYGWIN)
+    include(Utilities/Release/Cygwin/CMakeLists.txt)
+  endif(CYGWIN)
 
   # Set the options file that needs to be included inside CMakeCPackOptions.cmake
-  SET(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake)
-  CONFIGURE_FILE("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in"
+  set(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake)
+  configure_file("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in"
     "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY)
-  SET(CPACK_PROJECT_CONFIG_FILE "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake")
+  set(CPACK_PROJECT_CONFIG_FILE "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake")
 
   # include CPack model once all variables are set
-  INCLUDE(CPack)
-ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
+  include(CPack)
+endif(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in
index 28b6ec046..868331f14 100644
--- a/CMakeCPackOptions.cmake.in
+++ b/CMakeCPackOptions.cmake.in
@@ -3,16 +3,16 @@
 # in this file.
 
 if(CPACK_GENERATOR MATCHES "NSIS")
-  SET(CPACK_NSIS_INSTALL_ROOT "@CPACK_NSIS_INSTALL_ROOT@")
+  set(CPACK_NSIS_INSTALL_ROOT "@CPACK_NSIS_INSTALL_ROOT@")
 
   # set the install/unistall icon used for the installer itself
   # There is a bug in NSI that does not handle full unix paths properly.
-  SET(CPACK_NSIS_MUI_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeLogo.ico")
-  SET(CPACK_NSIS_MUI_UNIICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeLogo.ico")
+  set(CPACK_NSIS_MUI_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeLogo.ico")
+  set(CPACK_NSIS_MUI_UNIICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeLogo.ico")
   # set the package header icon for MUI
-  SET(CPACK_PACKAGE_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeInstall.bmp")
+  set(CPACK_PACKAGE_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeInstall.bmp")
   # tell cpack to create links to the doc files
-  SET(CPACK_NSIS_MENU_LINKS
+  set(CPACK_NSIS_MENU_LINKS
     "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-gui.html" "cmake-gui Help"
     "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html" "CMake Help"
     "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-properties.html"
@@ -24,23 +24,23 @@ if(CPACK_GENERATOR MATCHES "NSIS")
     "http://www.cmake.org" "CMake Web Site"
     )
   # Use the icon from cmake-gui for add-remove programs
-  SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\cmake-gui.exe")
+  set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\cmake-gui.exe")
 
-  SET(CPACK_NSIS_PACKAGE_NAME "@CPACK_NSIS_PACKAGE_NAME@")
-  SET(CPACK_NSIS_DISPLAY_NAME "@CPACK_NSIS_PACKAGE_NAME@, a cross-platform, open-source build system")
-  SET(CPACK_NSIS_HELP_LINK "http://www.cmake.org")
-  SET(CPACK_NSIS_URL_INFO_ABOUT "http://www.kitware.com")
-  SET(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@)
-  SET(CPACK_NSIS_MODIFY_PATH ON)
+  set(CPACK_NSIS_PACKAGE_NAME "@CPACK_NSIS_PACKAGE_NAME@")
+  set(CPACK_NSIS_DISPLAY_NAME "@CPACK_NSIS_PACKAGE_NAME@, a cross-platform, open-source build system")
+  set(CPACK_NSIS_HELP_LINK "http://www.cmake.org")
+  set(CPACK_NSIS_URL_INFO_ABOUT "http://www.kitware.com")
+  set(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@)
+  set(CPACK_NSIS_MODIFY_PATH ON)
 endif(CPACK_GENERATOR MATCHES "NSIS")
 
 # include the cpack options for qt dialog if they exisit
 # they might not if qt was not enabled for the build
-INCLUDE("@QT_DIALOG_CPACK_OPTIONS_FILE@" OPTIONAL)
+include("@QT_DIALOG_CPACK_OPTIONS_FILE@" OPTIONAL)
 
 if(CPACK_GENERATOR MATCHES "CygwinSource")
   # when packaging source make sure the .build directory is not included
-    SET(CPACK_SOURCE_IGNORE_FILES
+    set(CPACK_SOURCE_IGNORE_FILES
       "/CVS/" "/\\.build/" "/\\.svn/" "\\.swp$" "\\.#" "/#" "~$")
 endif(CPACK_GENERATOR MATCHES "CygwinSource")
 
diff --git a/CMakeGraphVizOptions.cmake b/CMakeGraphVizOptions.cmake
index 038f17e9b..1add78c55 100644
--- a/CMakeGraphVizOptions.cmake
+++ b/CMakeGraphVizOptions.cmake
@@ -1 +1 @@
-SET(GRAPHVIZ_IGNORE_TARGETS "tartest;testSystemTools;testRegistry;testProcess;testIOS;testHashSTL;testFail;testCommandLineArguments;xrtest;LIBCURL;foo")
+set(GRAPHVIZ_IGNORE_TARGETS "tartest;testSystemTools;testRegistry;testProcess;testIOS;testHashSTL;testFail;testCommandLineArguments;xrtest;LIBCURL;foo")
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f8d17580d..0beed6267 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,71 +9,71 @@
 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 # See the License for more information.
 #=============================================================================
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.2 FATAL_ERROR)
-SET(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
-PROJECT(CMake)
+cmake_minimum_required(VERSION 2.8.2 FATAL_ERROR)
+set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
+project(CMake)
 
-IF(CMAKE_BOOTSTRAP)
+if(CMAKE_BOOTSTRAP)
   # Running from bootstrap script.  Set local variable and remove from cache.
-  SET(CMAKE_BOOTSTRAP 1)
-  UNSET(CMAKE_BOOTSTRAP CACHE)
-ENDIF()
+  set(CMAKE_BOOTSTRAP 1)
+  unset(CMAKE_BOOTSTRAP CACHE)
+endif()
 
-SET(CMake_BIN_DIR ${CMake_BINARY_DIR}/bin)
+set(CMake_BIN_DIR ${CMake_BINARY_DIR}/bin)
 
-IF("${CMake_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
+if("${CMake_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
   # Disallow architecture-specific try_run.  It may not run on the host.
-  MACRO(TRY_RUN)
-    IF(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
-      MESSAGE(FATAL_ERROR "TRY_RUN not allowed with CMAKE_TRY_COMPILE_OSX_ARCHITECTURES=[${CMAKE_TRY_COMPILE_OSX_ARCHITECTURES}]")
-    ELSE()
+  macro(TRY_RUN)
+    if(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
+      message(FATAL_ERROR "TRY_RUN not allowed with CMAKE_TRY_COMPILE_OSX_ARCHITECTURES=[${CMAKE_TRY_COMPILE_OSX_ARCHITECTURES}]")
+    else()
       _TRY_RUN(${ARGV})
-    ENDIF()
-  ENDMACRO()
-ENDIF()
+    endif()
+  endmacro()
+endif()
 
 #-----------------------------------------------------------------------
 # a macro to deal with system libraries, implemented as a macro
 # simply to improve readability of the main script
 #-----------------------------------------------------------------------
-MACRO(CMAKE_HANDLE_SYSTEM_LIBRARIES)
+macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
   # Options have dependencies.
-  INCLUDE(CMakeDependentOption)
+  include(CMakeDependentOption)
 
   # Optionally use system xmlrpc.  We no longer build or use it by default.
-  OPTION(CTEST_USE_XMLRPC "Enable xmlrpc submission method in CTest." OFF)
-  MARK_AS_ADVANCED(CTEST_USE_XMLRPC)
+  option(CTEST_USE_XMLRPC "Enable xmlrpc submission method in CTest." OFF)
+  mark_as_advanced(CTEST_USE_XMLRPC)
 
   # Allow the user to enable/disable all system utility library options by
   # defining CMAKE_USE_SYSTEM_LIBRARIES or CMAKE_USE_SYSTEM_LIBRARY_${util}.
-  SET(UTILITIES BZIP2 CURL EXPAT LIBARCHIVE ZLIB)
-  FOREACH(util ${UTILITIES})
-    IF(NOT DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util}
+  set(UTILITIES BZIP2 CURL EXPAT LIBARCHIVE ZLIB)
+  foreach(util ${UTILITIES})
+    if(NOT DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util}
         AND DEFINED CMAKE_USE_SYSTEM_LIBRARIES)
-      SET(CMAKE_USE_SYSTEM_LIBRARY_${util} "${CMAKE_USE_SYSTEM_LIBRARIES}")
-    ENDIF()
-    IF(DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util})
-      IF(CMAKE_USE_SYSTEM_LIBRARY_${util})
-        SET(CMAKE_USE_SYSTEM_LIBRARY_${util} ON)
-      ELSE()
-        SET(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF)
-      ENDIF()
-      IF(CMAKE_BOOTSTRAP)
-        UNSET(CMAKE_USE_SYSTEM_LIBRARY_${util} CACHE)
-      ENDIF()
-      STRING(TOLOWER "${util}" lutil)
-      SET(CMAKE_USE_SYSTEM_${util} "${CMAKE_USE_SYSTEM_LIBRARY_${util}}"
+      set(CMAKE_USE_SYSTEM_LIBRARY_${util} "${CMAKE_USE_SYSTEM_LIBRARIES}")
+    endif()
+    if(DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util})
+      if(CMAKE_USE_SYSTEM_LIBRARY_${util})
+        set(CMAKE_USE_SYSTEM_LIBRARY_${util} ON)
+      else()
+        set(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF)
+      endif()
+      if(CMAKE_BOOTSTRAP)
+        unset(CMAKE_USE_SYSTEM_LIBRARY_${util} CACHE)
+      endif()
+      string(TOLOWER "${util}" lutil)
+      set(CMAKE_USE_SYSTEM_${util} "${CMAKE_USE_SYSTEM_LIBRARY_${util}}"
         CACHE BOOL "Use system-installed ${lutil}" FORCE)
-    ELSE()
-      SET(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF)
-    ENDIF()
-  ENDFOREACH(util)
-  IF(CMAKE_BOOTSTRAP)
-    UNSET(CMAKE_USE_SYSTEM_LIBRARIES CACHE)
-  ENDIF()
+    else()
+      set(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF)
+    endif()
+  endforeach(util)
+  if(CMAKE_BOOTSTRAP)
+    unset(CMAKE_USE_SYSTEM_LIBRARIES CACHE)
+  endif()
 
   # Optionally use system utility libraries.
-  OPTION(CMAKE_USE_SYSTEM_LIBARCHIVE "Use system-installed libarchive" "${CMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE}")
+  option(CMAKE_USE_SYSTEM_LIBARCHIVE "Use system-installed libarchive" "${CMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE}")
   CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_CURL "Use system-installed curl"
     "${CMAKE_USE_SYSTEM_LIBRARY_CURL}" "NOT CTEST_USE_XMLRPC" ON)
   CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_EXPAT "Use system-installed expat"
@@ -84,155 +84,155 @@ MACRO(CMAKE_HANDLE_SYSTEM_LIBRARIES)
     "${CMAKE_USE_SYSTEM_LIBRARY_BZIP2}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE" ON)
 
   # Mention to the user what system libraries are being used.
-  FOREACH(util ${UTILITIES})
-    IF(CMAKE_USE_SYSTEM_${util})
-      MESSAGE(STATUS "Using system-installed ${util}")
-    ENDIF(CMAKE_USE_SYSTEM_${util})
-  ENDFOREACH(util)
+  foreach(util ${UTILITIES})
+    if(CMAKE_USE_SYSTEM_${util})
+      message(STATUS "Using system-installed ${util}")
+    endif(CMAKE_USE_SYSTEM_${util})
+  endforeach(util)
 
   # Inform utility library header wrappers whether to use system versions.
-  CONFIGURE_FILE(${CMake_SOURCE_DIR}/Utilities/cmThirdParty.h.in
+  configure_file(${CMake_SOURCE_DIR}/Utilities/cmThirdParty.h.in
     ${CMake_BINARY_DIR}/Utilities/cmThirdParty.h
     @ONLY)
 
-ENDMACRO(CMAKE_HANDLE_SYSTEM_LIBRARIES)
+endmacro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
 
 
 
 
-SET(CMAKE_BUILD_ON_VISUAL_STUDIO 0)
-IF(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
-  SET(CMAKE_BUILD_ON_VISUAL_STUDIO 1)
-ENDIF(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
+set(CMAKE_BUILD_ON_VISUAL_STUDIO 0)
+if(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
+  set(CMAKE_BUILD_ON_VISUAL_STUDIO 1)
+endif(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
 
 
 #-----------------------------------------------------------------------
 # a macro to determine the generator and ctest executable to use
 # for testing. Simply to improve readability of the main script.
 #-----------------------------------------------------------------------
-MACRO(CMAKE_SETUP_TESTING)
-  IF (NOT DART_ROOT)
-    SET(MAKEPROGRAM ${CMAKE_MAKE_PROGRAM})
-  ENDIF (NOT DART_ROOT)
+macro(CMAKE_SETUP_TESTING)
+  if (NOT DART_ROOT)
+    set(MAKEPROGRAM ${CMAKE_MAKE_PROGRAM})
+  endif (NOT DART_ROOT)
 
-  IF(BUILD_TESTING)
-    SET(CMAKE_TEST_GENERATOR "" CACHE STRING
+  if(BUILD_TESTING)
+    set(CMAKE_TEST_GENERATOR "" CACHE STRING
       "Generator used when running tests")
-    SET(CMAKE_TEST_MAKEPROGRAM "" CACHE FILEPATH
+    set(CMAKE_TEST_MAKEPROGRAM "" CACHE FILEPATH
       "Generator used when running tests")
-    IF(NOT CMAKE_TEST_GENERATOR)
-      SET(CMAKE_TEST_GENERATOR "${CMAKE_GENERATOR}")
-      SET(CMAKE_TEST_MAKEPROGRAM "${MAKEPROGRAM}")
-    ELSE(NOT CMAKE_TEST_GENERATOR)
-      SET(CMAKE_TEST_DIFFERENT_GENERATOR TRUE)
-    ENDIF(NOT CMAKE_TEST_GENERATOR)
+    if(NOT CMAKE_TEST_GENERATOR)
+      set(CMAKE_TEST_GENERATOR "${CMAKE_GENERATOR}")
+      set(CMAKE_TEST_MAKEPROGRAM "${MAKEPROGRAM}")
+    else(NOT CMAKE_TEST_GENERATOR)
+      set(CMAKE_TEST_DIFFERENT_GENERATOR TRUE)
+    endif(NOT CMAKE_TEST_GENERATOR)
 
     # Are we testing with the MSVC compiler?
-    SET(CMAKE_TEST_MSVC 0)
-    IF(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
-      SET(CMAKE_TEST_MSVC 1)
-    ELSE(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
-      IF("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
+    set(CMAKE_TEST_MSVC 0)
+    if(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
+      set(CMAKE_TEST_MSVC 1)
+    else(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
+      if("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
           "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio")
-        SET(CMAKE_TEST_MSVC 1)
-      ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
+        set(CMAKE_TEST_MSVC 1)
+      endif("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
         "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio")
-    ENDIF(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
+    endif(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
 
-    SET(CMAKE_TEST_SYSTEM_LIBRARIES 0)
-    FOREACH(util CURL EXPAT XMLRPC ZLIB)
-      IF(CMAKE_USE_SYSTEM_${util})
-        SET(CMAKE_TEST_SYSTEM_LIBRARIES 1)
-      ENDIF(CMAKE_USE_SYSTEM_${util})
-    ENDFOREACH(util)
+    set(CMAKE_TEST_SYSTEM_LIBRARIES 0)
+    foreach(util CURL EXPAT XMLRPC ZLIB)
+      if(CMAKE_USE_SYSTEM_${util})
+        set(CMAKE_TEST_SYSTEM_LIBRARIES 1)
+      endif(CMAKE_USE_SYSTEM_${util})
+    endforeach(util)
 
     # This variable is set by cmake, however to
     # test cmake we want to make sure that
     # the ctest from this cmake is used for testing
     # and not the ctest from the cmake building and testing
     # cmake.
-    SET(CMAKE_CTEST_COMMAND "${CMake_BIN_DIR}/ctest")
-    SET(CMAKE_CMAKE_COMMAND "${CMake_BIN_DIR}/cmake")
-    SET(CMAKE_CPACK_COMMAND "${CMake_BIN_DIR}/cpack")
-  ENDIF(BUILD_TESTING)
+    set(CMAKE_CTEST_COMMAND "${CMake_BIN_DIR}/ctest")
+    set(CMAKE_CMAKE_COMMAND "${CMake_BIN_DIR}/cmake")
+    set(CMAKE_CPACK_COMMAND "${CMake_BIN_DIR}/cpack")
+  endif(BUILD_TESTING)
 
   # configure some files for testing
-  CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/Templates/CTestScript.cmake.in"
+  configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Templates/CTestScript.cmake.in"
     "${CMAKE_CURRENT_BINARY_DIR}/CTestScript.cmake"
     @ONLY)
-  CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
+  configure_file(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
     ${CMake_BINARY_DIR}/Tests/.NoDartCoverage)
-  CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
+  configure_file(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
     ${CMake_BINARY_DIR}/Modules/.NoDartCoverage)
-  CONFIGURE_FILE(${CMake_SOURCE_DIR}/CTestCustom.cmake.in
+  configure_file(${CMake_SOURCE_DIR}/CTestCustom.cmake.in
     ${CMake_BINARY_DIR}/CTestCustom.cmake @ONLY)
-  CONFIGURE_FILE(${CMake_SOURCE_DIR}/CTestCustom.ctest.in
+  configure_file(${CMake_SOURCE_DIR}/CTestCustom.ctest.in
     ${CMake_BINARY_DIR}/CTestCustom.ctest @ONLY)
-  IF(BUILD_TESTING AND DART_ROOT)
-    CONFIGURE_FILE(${CMake_SOURCE_DIR}/CMakeLogo.gif
+  if(BUILD_TESTING AND DART_ROOT)
+    configure_file(${CMake_SOURCE_DIR}/CMakeLogo.gif
       ${CMake_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY)
-  ENDIF(BUILD_TESTING AND DART_ROOT)
-  MARK_AS_ADVANCED(DART_ROOT)
-  MARK_AS_ADVANCED(CURL_TESTING)
-ENDMACRO(CMAKE_SETUP_TESTING)
+  endif(BUILD_TESTING AND DART_ROOT)
+  mark_as_advanced(DART_ROOT)
+  mark_as_advanced(CURL_TESTING)
+endmacro(CMAKE_SETUP_TESTING)
 
 
 # Provide a way for Visual Studio Express users to turn OFF the new FOLDER
 # organization feature. Default to ON for non-Express users. Express users must
 # explicitly turn off this option to build CMake in the Express IDE...
 #
-OPTION(CMAKE_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON)
-MARK_AS_ADVANCED(CMAKE_USE_FOLDERS)
+option(CMAKE_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON)
+mark_as_advanced(CMAKE_USE_FOLDERS)
 
 
 #-----------------------------------------------------------------------
 # a macro that only sets the FOLDER target property if it's
 # "appropriate"
 #-----------------------------------------------------------------------
-MACRO(CMAKE_SET_TARGET_FOLDER tgt folder)
-  IF(CMAKE_USE_FOLDERS)
-    SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
+macro(CMAKE_SET_TARGET_FOLDER tgt folder)
+  if(CMAKE_USE_FOLDERS)
+    set_property(GLOBAL PROPERTY USE_FOLDERS ON)
 
     # Really, I just want this to be an "if(TARGET ${tgt})" ...
     # but I'm not sure that our min req'd., CMake 2.4.5 can handle
     # that... so I'm just activating this for now, with a version
     # compare, and only for MSVC builds.
-    IF(MSVC)
-      IF(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8)
-        SET_PROPERTY(TARGET "${tgt}" PROPERTY FOLDER "${folder}")
-      ENDIF()
-    ENDIF()
-  ELSE()
-    SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS OFF)
-  ENDIF()
-ENDMACRO(CMAKE_SET_TARGET_FOLDER)
+    if(MSVC)
+      if(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8)
+        set_property(TARGET "${tgt}" PROPERTY FOLDER "${folder}")
+      endif()
+    endif()
+  else()
+    set_property(GLOBAL PROPERTY USE_FOLDERS OFF)
+  endif()
+endmacro(CMAKE_SET_TARGET_FOLDER)
 
 
 #-----------------------------------------------------------------------
 # a macro to build the utilities used by CMake
 # Simply to improve readability of the main script.
 #-----------------------------------------------------------------------
-MACRO (CMAKE_BUILD_UTILITIES)
+macro (CMAKE_BUILD_UTILITIES)
   #---------------------------------------------------------------------
   # Create the KWIML library for CMake.
-  SET(KWIML cmIML)
-  SET(KWIML_HEADER_ROOT ${CMake_BINARY_DIR}/Utilities)
-  ADD_SUBDIRECTORY(Utilities/KWIML)
+  set(KWIML cmIML)
+  set(KWIML_HEADER_ROOT ${CMake_BINARY_DIR}/Utilities)
+  add_subdirectory(Utilities/KWIML)
 
   #---------------------------------------------------------------------
   # Create the kwsys library for CMake.
-  SET(KWSYS_NAMESPACE cmsys)
-  SET(KWSYS_USE_SystemTools 1)
-  SET(KWSYS_USE_Directory 1)
-  SET(KWSYS_USE_RegularExpression 1)
-  SET(KWSYS_USE_Base64 1)
-  SET(KWSYS_USE_MD5 1)
-  SET(KWSYS_USE_Process 1)
-  SET(KWSYS_USE_CommandLineArguments 1)
-  SET(KWSYS_HEADER_ROOT ${CMake_BINARY_DIR}/Source)
-  SET(KWSYS_INSTALL_DOC_DIR "${CMake_DOC_DEST}")
-  ADD_SUBDIRECTORY(Source/kwsys)
-  SET(kwsys_folder "Utilities/KWSys")
+  set(KWSYS_NAMESPACE cmsys)
+  set(KWSYS_USE_SystemTools 1)
+  set(KWSYS_USE_Directory 1)
+  set(KWSYS_USE_RegularExpression 1)
+  set(KWSYS_USE_Base64 1)
+  set(KWSYS_USE_MD5 1)
+  set(KWSYS_USE_Process 1)
+  set(KWSYS_USE_CommandLineArguments 1)
+  set(KWSYS_HEADER_ROOT ${CMake_BINARY_DIR}/Source)
+  set(KWSYS_INSTALL_DOC_DIR "${CMake_DOC_DEST}")
+  add_subdirectory(Source/kwsys)
+  set(kwsys_folder "Utilities/KWSys")
   CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE} "${kwsys_folder}")
   CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}_c "${kwsys_folder}")
   CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}EncodeExecutable "${kwsys_folder}")
@@ -249,7 +249,7 @@ MACRO (CMAKE_BUILD_UTILITIES)
   # Setup third-party libraries.
   # Everything in the tree should be able to include files from the
   # Utilities directory.
-  INCLUDE_DIRECTORIES(
+  include_directories(
     ${CMake_BINARY_DIR}/Utilities
     ${CMake_SOURCE_DIR}/Utilities
     )
@@ -260,237 +260,237 @@ MACRO (CMAKE_BUILD_UTILITIES)
 
   #---------------------------------------------------------------------
   # Build zlib library for Curl, CMake, and CTest.
-  SET(CMAKE_ZLIB_HEADER "cm_zlib.h")
-  IF(CMAKE_USE_SYSTEM_ZLIB)
-    FIND_PACKAGE(ZLIB)
-    IF(NOT ZLIB_FOUND)
-      MESSAGE(FATAL_ERROR
+  set(CMAKE_ZLIB_HEADER "cm_zlib.h")
+  if(CMAKE_USE_SYSTEM_ZLIB)
+    find_package(ZLIB)
+    if(NOT ZLIB_FOUND)
+      message(FATAL_ERROR
         "CMAKE_USE_SYSTEM_ZLIB is ON but a zlib is not found!")
-    ENDIF(NOT ZLIB_FOUND)
-    SET(CMAKE_ZLIB_INCLUDES ${ZLIB_INCLUDE_DIR})
-    SET(CMAKE_ZLIB_LIBRARIES ${ZLIB_LIBRARIES})
-  ELSE(CMAKE_USE_SYSTEM_ZLIB)
-    SET(CMAKE_ZLIB_INCLUDES ${CMake_SOURCE_DIR}/Utilities)
-    SET(CMAKE_ZLIB_LIBRARIES cmzlib)
-    ADD_SUBDIRECTORY(Utilities/cmzlib)
+    endif(NOT ZLIB_FOUND)
+    set(CMAKE_ZLIB_INCLUDES ${ZLIB_INCLUDE_DIR})
+    set(CMAKE_ZLIB_LIBRARIES ${ZLIB_LIBRARIES})
+  else(CMAKE_USE_SYSTEM_ZLIB)
+    set(CMAKE_ZLIB_INCLUDES ${CMake_SOURCE_DIR}/Utilities)
+    set(CMAKE_ZLIB_LIBRARIES cmzlib)
+    add_subdirectory(Utilities/cmzlib)
     CMAKE_SET_TARGET_FOLDER(cmzlib "Utilities/3rdParty")
-  ENDIF(CMAKE_USE_SYSTEM_ZLIB)
+  endif(CMAKE_USE_SYSTEM_ZLIB)
 
   #---------------------------------------------------------------------
   # Build Curl library for CTest.
-  IF(CMAKE_USE_SYSTEM_CURL)
-    FIND_PACKAGE(CURL)
-    IF(NOT CURL_FOUND)
-      MESSAGE(FATAL_ERROR
+  if(CMAKE_USE_SYSTEM_CURL)
+    find_package(CURL)
+    if(NOT CURL_FOUND)
+      message(FATAL_ERROR
         "CMAKE_USE_SYSTEM_CURL is ON but a curl is not found!")
-    ENDIF(NOT CURL_FOUND)
-    SET(CMAKE_CURL_INCLUDES ${CURL_INCLUDE_DIRS})
-    SET(CMAKE_CURL_LIBRARIES ${CURL_LIBRARIES})
-  ELSE(CMAKE_USE_SYSTEM_CURL)
-    SET(CURL_SPECIAL_ZLIB_H ${CMAKE_ZLIB_HEADER})
-    SET(CURL_SPECIAL_LIBZ_INCLUDES ${CMAKE_ZLIB_INCLUDES})
-    SET(CURL_SPECIAL_LIBZ ${CMAKE_ZLIB_LIBRARIES})
-    OPTION(CMAKE_BUILD_CURL_SHARED "Should curl be built shared" FALSE)
-    IF(NOT CMAKE_BUILD_CURL_SHARED)
-      ADD_DEFINITIONS(-DCURL_STATICLIB)
-    ENDIF(NOT CMAKE_BUILD_CURL_SHARED)
-    SET(CMAKE_CURL_INCLUDES)
-    SET(CMAKE_CURL_LIBRARIES cmcurl)
-    IF(CMAKE_TESTS_CDASH_SERVER)
-      SET(CMAKE_CURL_TEST_URL "${CMAKE_TESTS_CDASH_SERVER}/user.php")
-    ENDIF(CMAKE_TESTS_CDASH_SERVER)
-    ADD_SUBDIRECTORY(Utilities/cmcurl)
+    endif(NOT CURL_FOUND)
+    set(CMAKE_CURL_INCLUDES ${CURL_INCLUDE_DIRS})
+    set(CMAKE_CURL_LIBRARIES ${CURL_LIBRARIES})
+  else(CMAKE_USE_SYSTEM_CURL)
+    set(CURL_SPECIAL_ZLIB_H ${CMAKE_ZLIB_HEADER})
+    set(CURL_SPECIAL_LIBZ_INCLUDES ${CMAKE_ZLIB_INCLUDES})
+    set(CURL_SPECIAL_LIBZ ${CMAKE_ZLIB_LIBRARIES})
+    option(CMAKE_BUILD_CURL_SHARED "Should curl be built shared" FALSE)
+    if(NOT CMAKE_BUILD_CURL_SHARED)
+      add_definitions(-DCURL_STATICLIB)
+    endif(NOT CMAKE_BUILD_CURL_SHARED)
+    set(CMAKE_CURL_INCLUDES)
+    set(CMAKE_CURL_LIBRARIES cmcurl)
+    if(CMAKE_TESTS_CDASH_SERVER)
+      set(CMAKE_CURL_TEST_URL "${CMAKE_TESTS_CDASH_SERVER}/user.php")
+    endif(CMAKE_TESTS_CDASH_SERVER)
+    add_subdirectory(Utilities/cmcurl)
     CMAKE_SET_TARGET_FOLDER(cmcurl "Utilities/3rdParty")
     CMAKE_SET_TARGET_FOLDER(LIBCURL "Utilities/3rdParty")
-  ENDIF(CMAKE_USE_SYSTEM_CURL)
+  endif(CMAKE_USE_SYSTEM_CURL)
 
   #---------------------------------------------------------------------
   # Build Compress library for CTest.
-  SET(CMAKE_COMPRESS_INCLUDES
+  set(CMAKE_COMPRESS_INCLUDES
     "${CMAKE_CURRENT_BINARY_DIR}/Utilities/cmcompress")
-  SET(CMAKE_COMPRESS_LIBRARIES "cmcompress")
-  ADD_SUBDIRECTORY(Utilities/cmcompress)
+  set(CMAKE_COMPRESS_LIBRARIES "cmcompress")
+  add_subdirectory(Utilities/cmcompress)
   CMAKE_SET_TARGET_FOLDER(cmcompress "Utilities/3rdParty")
-  IF(CMAKE_USE_SYSTEM_BZIP2)
-    FIND_PACKAGE(BZip2)
-  ELSE()
-    SET(BZIP2_INCLUDE_DIR
+  if(CMAKE_USE_SYSTEM_BZIP2)
+    find_package(BZip2)
+  else()
+    set(BZIP2_INCLUDE_DIR
       "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmbzip2")
-    SET(BZIP2_LIBRARIES cmbzip2)
-    ADD_SUBDIRECTORY(Utilities/cmbzip2)
+    set(BZIP2_LIBRARIES cmbzip2)
+    add_subdirectory(Utilities/cmbzip2)
     CMAKE_SET_TARGET_FOLDER(cmbzip2 "Utilities/3rdParty")
-  ENDIF()
+  endif()
 
   #---------------------------------------------------------------------
   # Build or use system libarchive for CMake and CTest.
-  IF(CMAKE_USE_SYSTEM_LIBARCHIVE)
-    IF(EXISTS ${CMAKE_ROOT}/Modules/FindLibArchive.cmake) # added in 2.8.3
-      FIND_PACKAGE(LibArchive)
-    ELSE()
-      INCLUDE(${CMake_SOURCE_DIR}/Modules/FindLibArchive.cmake)
-    ENDIF()
-    IF(NOT LibArchive_FOUND)
-      MESSAGE(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBARCHIVE is ON but LibArchive is not found!")
-    ENDIF()
-    SET(CMAKE_TAR_INCLUDES ${LibArchive_INCLUDE_DIRS})
-    SET(CMAKE_TAR_LIBRARIES ${LibArchive_LIBRARIES})
-  ELSE(CMAKE_USE_SYSTEM_LIBARCHIVE)
-    SET(ZLIB_INCLUDE_DIR ${CMAKE_ZLIB_INCLUDES})
-    SET(ZLIB_LIBRARY ${CMAKE_ZLIB_LIBRARIES})
-    ADD_DEFINITIONS(-DLIBARCHIVE_STATIC)
-    SET(ENABLE_NETTLE OFF CACHE INTERNAL "Enable use of Nettle")
-    SET(ENABLE_OPENSSL ${CMAKE_USE_OPENSSL} CACHE INTERNAL "Enable use of OpenSSL")
-    SET(ENABLE_XATTR OFF CACHE INTERNAL "Enable extended attribute support")
-    SET(ENABLE_ACL OFF CACHE INTERNAL "Enable ACL support")
-    SET(ENABLE_ICONV OFF CACHE INTERNAL "Enable iconv support")
-    ADD_SUBDIRECTORY(Utilities/cmlibarchive)
+  if(CMAKE_USE_SYSTEM_LIBARCHIVE)
+    if(EXISTS ${CMAKE_ROOT}/Modules/FindLibArchive.cmake) # added in 2.8.3
+      find_package(LibArchive)
+    else()
+      include(${CMake_SOURCE_DIR}/Modules/FindLibArchive.cmake)
+    endif()
+    if(NOT LibArchive_FOUND)
+      message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBARCHIVE is ON but LibArchive is not found!")
+    endif()
+    set(CMAKE_TAR_INCLUDES ${LibArchive_INCLUDE_DIRS})
+    set(CMAKE_TAR_LIBRARIES ${LibArchive_LIBRARIES})
+  else(CMAKE_USE_SYSTEM_LIBARCHIVE)
+    set(ZLIB_INCLUDE_DIR ${CMAKE_ZLIB_INCLUDES})
+    set(ZLIB_LIBRARY ${CMAKE_ZLIB_LIBRARIES})
+    add_definitions(-DLIBARCHIVE_STATIC)
+    set(ENABLE_NETTLE OFF CACHE INTERNAL "Enable use of Nettle")
+    set(ENABLE_OPENSSL ${CMAKE_USE_OPENSSL} CACHE INTERNAL "Enable use of OpenSSL")
+    set(ENABLE_XATTR OFF CACHE INTERNAL "Enable extended attribute support")
+    set(ENABLE_ACL OFF CACHE INTERNAL "Enable ACL support")
+    set(ENABLE_ICONV OFF CACHE INTERNAL "Enable iconv support")
+    add_subdirectory(Utilities/cmlibarchive)
     CMAKE_SET_TARGET_FOLDER(cmlibarchive "Utilities/3rdParty")
-    SET(CMAKE_TAR_LIBRARIES cmlibarchive ${BZIP2_LIBRARIES})
-  ENDIF(CMAKE_USE_SYSTEM_LIBARCHIVE)
+    set(CMAKE_TAR_LIBRARIES cmlibarchive ${BZIP2_LIBRARIES})
+  endif(CMAKE_USE_SYSTEM_LIBARCHIVE)
 
   #---------------------------------------------------------------------
   # Build expat library for CMake and CTest.
-  IF(CMAKE_USE_SYSTEM_EXPAT)
-    FIND_PACKAGE(EXPAT)
-    IF(NOT EXPAT_FOUND)
-      MESSAGE(FATAL_ERROR
+  if(CMAKE_USE_SYSTEM_EXPAT)
+    find_package(EXPAT)
+    if(NOT EXPAT_FOUND)
+      message(FATAL_ERROR
         "CMAKE_USE_SYSTEM_EXPAT is ON but a expat is not found!")
-    ENDIF(NOT EXPAT_FOUND)
-    SET(CMAKE_EXPAT_INCLUDES ${EXPAT_INCLUDE_DIRS})
-    SET(CMAKE_EXPAT_LIBRARIES ${EXPAT_LIBRARIES})
-  ELSE(CMAKE_USE_SYSTEM_EXPAT)
-    SET(CMAKE_EXPAT_INCLUDES)
-    SET(CMAKE_EXPAT_LIBRARIES cmexpat)
-    ADD_SUBDIRECTORY(Utilities/cmexpat)
+    endif(NOT EXPAT_FOUND)
+    set(CMAKE_EXPAT_INCLUDES ${EXPAT_INCLUDE_DIRS})
+    set(CMAKE_EXPAT_LIBRARIES ${EXPAT_LIBRARIES})
+  else(CMAKE_USE_SYSTEM_EXPAT)
+    set(CMAKE_EXPAT_INCLUDES)
+    set(CMAKE_EXPAT_LIBRARIES cmexpat)
+    add_subdirectory(Utilities/cmexpat)
     CMAKE_SET_TARGET_FOLDER(cmexpat "Utilities/3rdParty")
-  ENDIF(CMAKE_USE_SYSTEM_EXPAT)
+  endif(CMAKE_USE_SYSTEM_EXPAT)
 
   #---------------------------------------------------------------------
   # Build XMLRPC library for CMake and CTest.
-  IF(CTEST_USE_XMLRPC)
-    FIND_PACKAGE(XMLRPC QUIET REQUIRED libwww-client)
-    IF(NOT XMLRPC_FOUND)
-      MESSAGE(FATAL_ERROR
+  if(CTEST_USE_XMLRPC)
+    find_package(XMLRPC QUIET REQUIRED libwww-client)
+    if(NOT XMLRPC_FOUND)
+      message(FATAL_ERROR
         "CTEST_USE_XMLRPC is ON but xmlrpc is not found!")
-    ENDIF(NOT XMLRPC_FOUND)
-    SET(CMAKE_XMLRPC_INCLUDES ${XMLRPC_INCLUDE_DIRS})
-    SET(CMAKE_XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES})
-  ENDIF(CTEST_USE_XMLRPC)
+    endif(NOT XMLRPC_FOUND)
+    set(CMAKE_XMLRPC_INCLUDES ${XMLRPC_INCLUDE_DIRS})
+    set(CMAKE_XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES})
+  endif(CTEST_USE_XMLRPC)
 
   #---------------------------------------------------------------------
   # Use curses?
-  IF (UNIX)
+  if (UNIX)
     # there is a bug in the Syllable libraries which makes linking ccmake fail, Alex
-    IF(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
-      SET(CURSES_NEED_NCURSES TRUE)
-      FIND_PACKAGE(Curses QUIET)
-      IF (CURSES_LIBRARY)
-        OPTION(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" ON)
-      ELSE (CURSES_LIBRARY)
-        MESSAGE("Curses libraries were not found. Curses GUI for CMake will not be built.")
-        SET(BUILD_CursesDialog 0)
-      ENDIF (CURSES_LIBRARY)
-    ELSE(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
-      SET(BUILD_CursesDialog 0)
-    ENDIF(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
-  ELSE (UNIX)
-    SET(BUILD_CursesDialog 0)
-  ENDIF (UNIX)
-  IF(BUILD_CursesDialog)
-    ADD_SUBDIRECTORY(Source/CursesDialog/form)
-  ENDIF(BUILD_CursesDialog)
-ENDMACRO (CMAKE_BUILD_UTILITIES)
+    if(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
+      set(CURSES_NEED_NCURSES TRUE)
+      find_package(Curses QUIET)
+      if (CURSES_LIBRARY)
+        option(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" ON)
+      else (CURSES_LIBRARY)
+        message("Curses libraries were not found. Curses GUI for CMake will not be built.")
+        set(BUILD_CursesDialog 0)
+      endif (CURSES_LIBRARY)
+    else(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
+      set(BUILD_CursesDialog 0)
+    endif(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
+  else (UNIX)
+    set(BUILD_CursesDialog 0)
+  endif (UNIX)
+  if(BUILD_CursesDialog)
+    add_subdirectory(Source/CursesDialog/form)
+  endif(BUILD_CursesDialog)
+endmacro (CMAKE_BUILD_UTILITIES)
 
 #-----------------------------------------------------------------------
-IF(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
-  EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER}
+if(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
+  execute_process(COMMAND ${CMAKE_CXX_COMPILER}
     ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
     OUTPUT_VARIABLE _GXX_VERSION
   )
-  STRING(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2"
+  string(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2"
     _GXX_VERSION_SHORT ${_GXX_VERSION})
-  IF(_GXX_VERSION_SHORT EQUAL 33)
-    MESSAGE(FATAL_ERROR
+  if(_GXX_VERSION_SHORT EQUAL 33)
+    message(FATAL_ERROR
       "GXX 3.3 on OpenBSD is known to cause CPack to Crash.\n"
       "Please use GXX 4.2 or greater to build CMake on OpenBSD\n"
       "${CMAKE_CXX_COMPILER} version is: ${_GXX_VERSION}")
-  ENDIF()
-ENDIF()
+  endif()
+endif()
 
 #-----------------------------------------------------------------------
 # The main section of the CMakeLists file
 #
 #-----------------------------------------------------------------------
-INCLUDE(Source/CMakeVersion.cmake)
+include(Source/CMakeVersion.cmake)
 # Releases define a small tweak level.
-IF("${CMake_VERSION_TWEAK}" VERSION_LESS 20000000)
-  SET(CMake_VERSION_IS_RELEASE 1)
-  SET(CMake_VERSION_SOURCE "")
-ELSE()
-  SET(CMake_VERSION_IS_RELEASE 0)
-  INCLUDE(${CMake_SOURCE_DIR}/Source/CMakeVersionSource.cmake)
-ENDIF()
+if("${CMake_VERSION_TWEAK}" VERSION_LESS 20000000)
+  set(CMake_VERSION_IS_RELEASE 1)
+  set(CMake_VERSION_SOURCE "")
+else()
+  set(CMake_VERSION_IS_RELEASE 0)
+  include(${CMake_SOURCE_DIR}/Source/CMakeVersionSource.cmake)
+endif()
 
 # Compute the full version string.
-SET(CMake_VERSION ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH})
-IF(${CMake_VERSION_TWEAK} GREATER 0)
-  SET(CMake_VERSION ${CMake_VERSION}.${CMake_VERSION_TWEAK})
-ENDIF()
-IF(CMake_VERSION_RC)
-  SET(CMake_VERSION ${CMake_VERSION}-rc${CMake_VERSION_RC})
-ENDIF()
-IF(CMake_VERSION_SOURCE)
-  SET(CMake_VERSION ${CMake_VERSION}-${CMake_VERSION_SOURCE})
-ENDIF()
+set(CMake_VERSION ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH})
+if(${CMake_VERSION_TWEAK} GREATER 0)
+  set(CMake_VERSION ${CMake_VERSION}.${CMake_VERSION_TWEAK})
+endif()
+if(CMake_VERSION_RC)
+  set(CMake_VERSION ${CMake_VERSION}-rc${CMake_VERSION_RC})
+endif()
+if(CMake_VERSION_SOURCE)
+  set(CMake_VERSION ${CMake_VERSION}-${CMake_VERSION_SOURCE})
+endif()
 
 # Include the standard Dart testing module
-ENABLE_TESTING()
-INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake)
+enable_testing()
+include (${CMAKE_ROOT}/Modules/Dart.cmake)
 
 # Set up test-time configuration.
-SET_DIRECTORY_PROPERTIES(PROPERTIES
+set_directory_properties(PROPERTIES
   TEST_INCLUDE_FILE "${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake")
 
 # where to write the resulting executables and libraries
-SET(BUILD_SHARED_LIBS OFF)
-SET(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL "No configurable exe dir.")
-SET(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL
+set(BUILD_SHARED_LIBS OFF)
+set(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL "No configurable exe dir.")
+set(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL
   "Where to put the libraries for CMake")
 
 # The CMake executables usually do not need any rpath to run in the build or
 # install tree.
-SET(CMAKE_SKIP_RPATH ON CACHE INTERNAL "CMake does not need RPATHs.")
+set(CMAKE_SKIP_RPATH ON CACHE INTERNAL "CMake does not need RPATHs.")
 
-SET(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" CACHE STRING
+set(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" CACHE STRING
   "Install location for data (relative to prefix).")
-SET(CMAKE_DOC_DIR "/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" CACHE STRING
+set(CMAKE_DOC_DIR "/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" CACHE STRING
   "Install location for documentation (relative to prefix).")
-SET(CMAKE_MAN_DIR "/man" CACHE STRING
+set(CMAKE_MAN_DIR "/man" CACHE STRING
   "Install location for man pages (relative to prefix).")
-MARK_AS_ADVANCED(CMAKE_DATA_DIR CMAKE_DOC_DIR CMAKE_MAN_DIR)
-IF(CYGWIN AND EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
+mark_as_advanced(CMAKE_DATA_DIR CMAKE_DOC_DIR CMAKE_MAN_DIR)
+if(CYGWIN AND EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
   # Force doc, data and man dirs to conform to cygwin layout.
-  SET(CMAKE_DOC_DIR  "/share/doc/cmake-${CMake_VERSION}")
-  SET(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION}")
-  SET(CMAKE_MAN_DIR  "/share/man")
+  set(CMAKE_DOC_DIR  "/share/doc/cmake-${CMake_VERSION}")
+  set(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION}")
+  set(CMAKE_MAN_DIR  "/share/man")
   # let the user know we just forced these values
-  MESSAGE(STATUS "Setup for Cygwin packaging")
-  MESSAGE(STATUS "Override cache CMAKE_DOC_DIR = ${CMAKE_DOC_DIR}")
-  MESSAGE(STATUS "Override cache CMAKE_DATA_DIR = ${CMAKE_DATA_DIR}")
-  MESSAGE(STATUS "Override cache CMAKE_MAN_DIR = ${CMAKE_MAN_DIR}")
-ENDIF()
-STRING(REGEX REPLACE "^/" "" CMake_DATA_DEST "${CMAKE_DATA_DIR}")
-STRING(REGEX REPLACE "^/" "" CMake_DOC_DEST "${CMAKE_DOC_DIR}")
+  message(STATUS "Setup for Cygwin packaging")
+  message(STATUS "Override cache CMAKE_DOC_DIR = ${CMAKE_DOC_DIR}")
+  message(STATUS "Override cache CMAKE_DATA_DIR = ${CMAKE_DATA_DIR}")
+  message(STATUS "Override cache CMAKE_MAN_DIR = ${CMAKE_MAN_DIR}")
+endif()
+string(REGEX REPLACE "^/" "" CMake_DATA_DEST "${CMAKE_DATA_DIR}")
+string(REGEX REPLACE "^/" "" CMake_DOC_DEST "${CMAKE_DOC_DIR}")
 
-IF(BUILD_TESTING)
-  INCLUDE(${CMake_SOURCE_DIR}/Tests/CMakeInstall.cmake)
-ENDIF()
+if(BUILD_TESTING)
+  include(${CMake_SOURCE_DIR}/Tests/CMakeInstall.cmake)
+endif()
 
 # include special compile flags for some compilers
-INCLUDE(CompileFlags.cmake)
+include(CompileFlags.cmake)
 
 # no clue why we are testing for this here
-INCLUDE(CheckSymbolExists)
+include(CheckSymbolExists)
 CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV)
 CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
 
@@ -507,9 +507,9 @@ CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
 # to a cdash4simpletest database. In these cases, the CDash dashboards
 # should be run first.
 #
-IF("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x")
-  SET(CMAKE_TESTS_CDASH_SERVER "http://www.cdash.org/CDash")
-ENDIF("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x")
+if("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x")
+  set(CMAKE_TESTS_CDASH_SERVER "http://www.cdash.org/CDash")
+endif("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x")
 
 # build the utilities (a macro defined in this file)
 CMAKE_BUILD_UTILITIES()
@@ -519,35 +519,35 @@ CMAKE_BUILD_UTILITIES()
 # which isn't in the default linker search path. So without RPATH ccmake
 # doesn't run and the build doesn't succeed since ccmake is executed for
 # generating the documentation.
-IF(BUILD_CursesDialog)
-  GET_FILENAME_COMPONENT(_CURSES_DIR "${CURSES_LIBRARY}" PATH)
-  SET(CURSES_NEED_RPATH FALSE)
-  IF(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64")
-    SET(CURSES_NEED_RPATH TRUE)
-  ENDIF(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64")
-ENDIF(BUILD_CursesDialog)
+if(BUILD_CursesDialog)
+  get_filename_component(_CURSES_DIR "${CURSES_LIBRARY}" PATH)
+  set(CURSES_NEED_RPATH FALSE)
+  if(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64")
+    set(CURSES_NEED_RPATH TRUE)
+  endif(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64")
+endif(BUILD_CursesDialog)
 
-IF(BUILD_QtDialog)
-  IF(APPLE)
-    SET(CMAKE_BUNDLE_NAME
+if(BUILD_QtDialog)
+  if(APPLE)
+    set(CMAKE_BUNDLE_NAME
       "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}-${CMake_VERSION_PATCH}")
-    SET(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}")
+    set(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}")
     # make sure CMAKE_INSTALL_PREFIX ends in /
-    STRING(LENGTH "${CMAKE_INSTALL_PREFIX}" LEN)
-    MATH(EXPR LEN "${LEN} -1" )
-    STRING(SUBSTRING "${CMAKE_INSTALL_PREFIX}" ${LEN} 1 ENDCH)
-    IF(NOT "${ENDCH}" STREQUAL "/")
-      SET(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
-    ENDIF(NOT "${ENDCH}" STREQUAL "/")
-    SET(CMAKE_INSTALL_PREFIX
+    string(LENGTH "${CMAKE_INSTALL_PREFIX}" LEN)
+    math(EXPR LEN "${LEN} -1" )
+    string(SUBSTRING "${CMAKE_INSTALL_PREFIX}" ${LEN} 1 ENDCH)
+    if(NOT "${ENDCH}" STREQUAL "/")
+      set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
+    endif(NOT "${ENDCH}" STREQUAL "/")
+    set(CMAKE_INSTALL_PREFIX
       "${CMAKE_INSTALL_PREFIX}${CMAKE_BUNDLE_NAME}.app/Contents")
-  ENDIF(APPLE)
+  endif(APPLE)
 
-  SET(QT_NEED_RPATH FALSE)
-  IF(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64")
-    SET(QT_NEED_RPATH TRUE)
-  ENDIF(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64")
-ENDIF(BUILD_QtDialog)
+  set(QT_NEED_RPATH FALSE)
+  if(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64")
+    set(QT_NEED_RPATH TRUE)
+  endif(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64")
+endif(BUILD_QtDialog)
 
 
 # The same might be true on other systems for other libraries.
@@ -555,43 +555,43 @@ ENDIF(BUILD_QtDialog)
 # since this one has much better RPATH features than cmake 2.2.
 # The executables are then built with the RPATH for the libraries outside
 # the build tree, which is both the build and the install RPATH.
-IF (UNIX)
-  IF(   CMAKE_USE_SYSTEM_CURL   OR  CMAKE_USE_SYSTEM_ZLIB
+if (UNIX)
+  if(   CMAKE_USE_SYSTEM_CURL   OR  CMAKE_USE_SYSTEM_ZLIB
         OR  CMAKE_USE_SYSTEM_EXPAT  OR  CTEST_USE_XMLRPC  OR  CURSES_NEED_RPATH  OR  QT_NEED_RPATH)
-    SET(CMAKE_SKIP_RPATH OFF CACHE INTERNAL "CMake built with RPATH.")
-    SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
-    SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
-  ENDIF(CMAKE_USE_SYSTEM_CURL   OR  CMAKE_USE_SYSTEM_ZLIB
+    set(CMAKE_SKIP_RPATH OFF CACHE INTERNAL "CMake built with RPATH.")
+    set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+    set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
+  endif(CMAKE_USE_SYSTEM_CURL   OR  CMAKE_USE_SYSTEM_ZLIB
         OR  CMAKE_USE_SYSTEM_EXPAT  OR  CTEST_USE_XMLRPC  OR  CURSES_NEED_RPATH  OR  QT_NEED_RPATH)
-ENDIF (UNIX)
+endif (UNIX)
 
 
 # add the uninstall support
-CONFIGURE_FILE(
+configure_file(
   "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
   "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
   @ONLY)
-ADD_CUSTOM_TARGET(uninstall
+add_custom_target(uninstall
   "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
 
-INCLUDE (CMakeCPack.cmake)
+include (CMakeCPack.cmake)
 
 # setup some Testing support (a macro defined in this file)
 CMAKE_SETUP_TESTING()
-CONFIGURE_FILE(
+configure_file(
   "${CMAKE_CURRENT_SOURCE_DIR}/DartLocal.conf.in"
   "${CMAKE_CURRENT_BINARY_DIR}/DartLocal.conf"
   COPYONLY)
 
-OPTION(CMAKE_STRICT
+option(CMAKE_STRICT
   "Perform strict testing to record property and variable access. Can be used to report any undefined properties or variables" OFF)
-MARK_AS_ADVANCED(CMAKE_STRICT)
+mark_as_advanced(CMAKE_STRICT)
 
 
 # build the remaining subdirectories
-ADD_SUBDIRECTORY(Source)
-ADD_SUBDIRECTORY(Utilities)
-ADD_SUBDIRECTORY(Tests)
+add_subdirectory(Source)
+add_subdirectory(Utilities)
+add_subdirectory(Tests)
 
 if(BUILD_TESTING)
   CMAKE_SET_TARGET_FOLDER(CMakeLibTests "Tests")
@@ -600,14 +600,14 @@ CMAKE_SET_TARGET_FOLDER(cmw9xcom "Utilities/Win9xCompat")
 CMAKE_SET_TARGET_FOLDER(documentation "Documentation")
 
 # add a test
-ADD_TEST(SystemInformationNew "${CMAKE_CMAKE_COMMAND}"
+add_test(SystemInformationNew "${CMAKE_CMAKE_COMMAND}"
   --system-information  -G "${CMAKE_TEST_GENERATOR}" )
 
 # Install license file as it requires.
-INSTALL(FILES Copyright.txt DESTINATION ${CMake_DOC_DEST})
+install(FILES Copyright.txt DESTINATION ${CMake_DOC_DEST})
 
 # Install script directories.
-INSTALL(
+install(
   DIRECTORY Modules Templates
   DESTINATION "${CMake_DATA_DEST}"
   FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
@@ -620,7 +620,7 @@ INSTALL(
   )
 
 # process docs related install
-ADD_SUBDIRECTORY(Docs)
+add_subdirectory(Docs)
 
 #-----------------------------------------------------------------------
 # End of the main section of the CMakeLists file
@@ -631,4 +631,4 @@ ADD_SUBDIRECTORY(Docs)
 # to compute the location of the "cmake" executable.  We set it here
 # so that those CMake versions can find it.  We wait until after all
 # the add_subdirectory() calls to avoid affecting the subdirectories.
-SET(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR})
+set(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR})
diff --git a/CTestConfig.cmake b/CTestConfig.cmake
index aaf551a85..92eacd8e3 100644
--- a/CTestConfig.cmake
+++ b/CTestConfig.cmake
@@ -21,5 +21,5 @@ set(CTEST_CDASH_QUERY_VERSION TRUE)
 
 # use old trigger stuff so that cmake 2.4 and below will not
 # get errors on trigger
-SET (TRIGGER_SITE
+set (TRIGGER_SITE
   "http://public.kitware.com/cgi-bin/Submit-CMake-TestingResults.cgi")
diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in
index 982919198..52173f3e2 100644
--- a/CTestCustom.cmake.in
+++ b/CTestCustom.cmake.in
@@ -1,8 +1,8 @@
-SET(CTEST_CUSTOM_ERROR_MATCH
+set(CTEST_CUSTOM_ERROR_MATCH
   ${CTEST_CUSTOM_ERROR_MATCH}
   "ERROR:")
 
-SET(CTEST_CUSTOM_WARNING_EXCEPTION
+set(CTEST_CUSTOM_WARNING_EXCEPTION
   ${CTEST_CUSTOM_WARNING_EXCEPTION}
   "xtree.[0-9]+. : warning C4702: unreachable code"
   "warning LNK4221"
@@ -56,21 +56,21 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
   "[0-9,]+ warnings? generated."
   )
 
-IF(NOT "@CMAKE_GENERATOR@" MATCHES "Xcode")
-  SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
+if(NOT "@CMAKE_GENERATOR@" MATCHES "Xcode")
+  set(CTEST_CUSTOM_COVERAGE_EXCLUDE
     ${CTEST_CUSTOM_COVERAGE_EXCLUDE}
     "XCode"
     )
-ENDIF (NOT "@CMAKE_GENERATOR@" MATCHES "Xcode")
+endif (NOT "@CMAKE_GENERATOR@" MATCHES "Xcode")
 
-IF(NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop")
-  SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
+if(NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop")
+  set(CTEST_CUSTOM_COVERAGE_EXCLUDE
     ${CTEST_CUSTOM_COVERAGE_EXCLUDE}
     "Kdevelop"
     )
-ENDIF (NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop")
+endif (NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop")
 
-SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
+set(CTEST_CUSTOM_COVERAGE_EXCLUDE
   ${CTEST_CUSTOM_COVERAGE_EXCLUDE}
 
   # Exclude kwsys files from coverage results. They are reported
diff --git a/CompileFlags.cmake b/CompileFlags.cmake
index 65f4c693c..f144337c3 100644
--- a/CompileFlags.cmake
+++ b/CompileFlags.cmake
@@ -13,52 +13,52 @@
 #-----------------------------------------------------------------------------
 # set some special flags for different compilers
 #
-IF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
-  SET(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
-ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
-IF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
-  SET(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
-ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
-INCLUDE (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake)
+if(CMAKE_GENERATOR MATCHES "Visual Studio 7")
+  set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
+endif(CMAKE_GENERATOR MATCHES "Visual Studio 7")
+if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
+  set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
+endif(CMAKE_GENERATOR MATCHES "Visual Studio 6")
+include (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake)
 
-IF(WIN32 AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$")
-  SET(_INTEL_WINDOWS 1)
-ENDIF()
+if(WIN32 AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$")
+  set(_INTEL_WINDOWS 1)
+endif()
 
 # Disable deprecation warnings for standard C functions.
 # really only needed for newer versions of VS, but should
 # not hurt other versions, and this will work into the
 # future
-IF(MSVC OR _INTEL_WINDOWS)
-  ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
-ELSE()
-ENDIF()
+if(MSVC OR _INTEL_WINDOWS)
+  add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
+else()
+endif()
 
 #silence duplicate symbol warnings on AIX
-IF(CMAKE_SYSTEM MATCHES "AIX.*")
-  IF(NOT CMAKE_COMPILER_IS_GNUCXX)
-    SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bhalt:5 ")
-  ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
-ENDIF(CMAKE_SYSTEM MATCHES "AIX.*")
+if(CMAKE_SYSTEM MATCHES "AIX.*")
+  if(NOT CMAKE_COMPILER_IS_GNUCXX)
+    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bhalt:5 ")
+  endif(NOT CMAKE_COMPILER_IS_GNUCXX)
+endif(CMAKE_SYSTEM MATCHES "AIX.*")
 
-IF(CMAKE_SYSTEM MATCHES "IRIX.*")
-  IF(NOT CMAKE_COMPILER_IS_GNUCXX)
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-woff84 -no_auto_include")
-    SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-woff15")
-  ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
-ENDIF(CMAKE_SYSTEM MATCHES "IRIX.*")
+if(CMAKE_SYSTEM MATCHES "IRIX.*")
+  if(NOT CMAKE_COMPILER_IS_GNUCXX)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-woff84 -no_auto_include")
+    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-woff15")
+  endif(NOT CMAKE_COMPILER_IS_GNUCXX)
+endif(CMAKE_SYSTEM MATCHES "IRIX.*")
 
-IF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
-  IF(NOT CMAKE_COMPILER_IS_GNUCXX)
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ")
-  ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
-ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
+if(CMAKE_SYSTEM MATCHES "OSF1-V.*")
+  if(NOT CMAKE_COMPILER_IS_GNUCXX)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ")
+  endif(NOT CMAKE_COMPILER_IS_GNUCXX)
+endif(CMAKE_SYSTEM MATCHES "OSF1-V.*")
 
 # use the ansi CXX compile flag for building cmake
-IF (CMAKE_ANSI_CXXFLAGS)
-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
-ENDIF (CMAKE_ANSI_CXXFLAGS)
+if (CMAKE_ANSI_CXXFLAGS)
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
+endif (CMAKE_ANSI_CXXFLAGS)
 
-IF (CMAKE_ANSI_CFLAGS)
-  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
-ENDIF (CMAKE_ANSI_CFLAGS)
+if (CMAKE_ANSI_CFLAGS)
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
+endif (CMAKE_ANSI_CFLAGS)
diff --git a/Docs/CMakeLists.txt b/Docs/CMakeLists.txt
index b04b32d5e..a5e91c9d1 100644
--- a/Docs/CMakeLists.txt
+++ b/Docs/CMakeLists.txt
@@ -1,4 +1,4 @@
 string(REGEX REPLACE "^/(.*)" "\\1" REL_CMAKE_DATA_DIR "${CMAKE_DATA_DIR}")
 install(FILES cmake-help.vim cmake-indent.vim cmake-syntax.vim DESTINATION ${REL_CMAKE_DATA_DIR}/editors/vim)
 install(FILES cmake-mode.el DESTINATION ${REL_CMAKE_DATA_DIR}/editors/emacs)
-ADD_SUBDIRECTORY (bash-completion)
+add_subdirectory (bash-completion)
diff --git a/Modules/AddFileDependencies.cmake b/Modules/AddFileDependencies.cmake
index f971e37f5..af7f42f53 100644
--- a/Modules/AddFileDependencies.cmake
+++ b/Modules/AddFileDependencies.cmake
@@ -15,15 +15,15 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-MACRO(ADD_FILE_DEPENDENCIES _file)
+macro(ADD_FILE_DEPENDENCIES _file)
 
-   GET_SOURCE_FILE_PROPERTY(_deps ${_file} OBJECT_DEPENDS)
-   IF (_deps)
-      SET(_deps ${_deps} ${ARGN})
-   ELSE (_deps)
-      SET(_deps ${ARGN})
-   ENDIF (_deps)
+   get_source_file_property(_deps ${_file} OBJECT_DEPENDS)
+   if (_deps)
+      set(_deps ${_deps} ${ARGN})
+   else (_deps)
+      set(_deps ${ARGN})
+   endif (_deps)
 
-   SET_SOURCE_FILES_PROPERTIES(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}")
+   set_source_files_properties(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}")
 
-ENDMACRO(ADD_FILE_DEPENDENCIES)
+endmacro(ADD_FILE_DEPENDENCIES)
diff --git a/Modules/CMakeASM-ATTInformation.cmake b/Modules/CMakeASM-ATTInformation.cmake
index cb1f5d69c..675c13bb3 100644
--- a/Modules/CMakeASM-ATTInformation.cmake
+++ b/Modules/CMakeASM-ATTInformation.cmake
@@ -14,12 +14,12 @@
 
 # support for AT&T syntax assemblers, e.g. GNU as
 
-SET(ASM_DIALECT "-ATT")
+set(ASM_DIALECT "-ATT")
 # *.S files are supposed to be preprocessed, so they should not be passed to
 # assembler but should be processed by gcc
-SET(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;asm)
+set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;asm)
 
-SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> -o <OBJECT> <SOURCE>")
+set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> -o <OBJECT> <SOURCE>")
 
-INCLUDE(CMakeASMInformation)
-SET(ASM_DIALECT)
+include(CMakeASMInformation)
+set(ASM_DIALECT)
diff --git a/Modules/CMakeASMCompiler.cmake.in b/Modules/CMakeASMCompiler.cmake.in
index 2dc24b06d..8e58307e9 100644
--- a/Modules/CMakeASMCompiler.cmake.in
+++ b/Modules/CMakeASMCompiler.cmake.in
@@ -1,12 +1,12 @@
-SET(CMAKE_ASM@ASM_DIALECT@_COMPILER "@_CMAKE_ASM_COMPILER@")
-SET(CMAKE_ASM@ASM_DIALECT@_COMPILER_ARG1 "@_CMAKE_ASM_COMPILER_ARG1@")
-SET(CMAKE_AR "@CMAKE_AR@")
-SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
-SET(CMAKE_LINKER "@CMAKE_LINKER@")
-SET(CMAKE_ASM@ASM_DIALECT@_COMPILER_LOADED 1)
-SET(CMAKE_ASM@ASM_DIALECT@_COMPILER_ID "@_CMAKE_ASM_COMPILER_ID@")
-SET(CMAKE_ASM@ASM_DIALECT@_COMPILER_ENV_VAR "@_CMAKE_ASM_COMPILER_ENV_VAR@")
+set(CMAKE_ASM@ASM_DIALECT@_COMPILER "@_CMAKE_ASM_COMPILER@")
+set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ARG1 "@_CMAKE_ASM_COMPILER_ARG1@")
+set(CMAKE_AR "@CMAKE_AR@")
+set(CMAKE_RANLIB "@CMAKE_RANLIB@")
+set(CMAKE_LINKER "@CMAKE_LINKER@")
+set(CMAKE_ASM@ASM_DIALECT@_COMPILER_LOADED 1)
+set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ID "@_CMAKE_ASM_COMPILER_ID@")
+set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ENV_VAR "@_CMAKE_ASM_COMPILER_ENV_VAR@")
 
-SET(CMAKE_ASM@ASM_DIALECT@_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
-SET(CMAKE_ASM@ASM_DIALECT@_LINKER_PREFERENCE 0)
+set(CMAKE_ASM@ASM_DIALECT@_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
+set(CMAKE_ASM@ASM_DIALECT@_LINKER_PREFERENCE 0)
 
diff --git a/Modules/CMakeASMInformation.cmake b/Modules/CMakeASMInformation.cmake
index b5f242033..69554e4cc 100644
--- a/Modules/CMakeASMInformation.cmake
+++ b/Modules/CMakeASMInformation.cmake
@@ -12,76 +12,76 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-IF(UNIX)
-  SET(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .o)
-ELSE(UNIX)
-  SET(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .obj)
-ENDIF(UNIX)
+if(UNIX)
+  set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .o)
+else(UNIX)
+  set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .obj)
+endif(UNIX)
 
-SET(CMAKE_INCLUDE_FLAG_ASM${ASM_DIALECT} "-I")       # -I
-SET(CMAKE_BASE_NAME)
-GET_FILENAME_COMPONENT(CMAKE_BASE_NAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME_WE)
+set(CMAKE_INCLUDE_FLAG_ASM${ASM_DIALECT} "-I")       # -I
+set(CMAKE_BASE_NAME)
+get_filename_component(CMAKE_BASE_NAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME_WE)
 
-IF("${CMAKE_BASE_NAME}" STREQUAL "as")
-  SET(CMAKE_BASE_NAME gas)
-ENDIF("${CMAKE_BASE_NAME}" STREQUAL "as")
+if("${CMAKE_BASE_NAME}" STREQUAL "as")
+  set(CMAKE_BASE_NAME gas)
+endif("${CMAKE_BASE_NAME}" STREQUAL "as")
 
 # Load compiler-specific information.
-SET(_INCLUDED_FILE "")
-IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
-  INCLUDE(Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL  RESULT_VARIABLE _INCLUDED_FILE)
-ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
-IF(NOT _INCLUDED_FILE)
-  IF("ASM${ASM_DIALECT}" STREQUAL "ASM")
-    MESSAGE(STATUS "Warning: Did not find file Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}")
-  ENDIF("ASM${ASM_DIALECT}" STREQUAL "ASM")
-  INCLUDE(Platform/${CMAKE_BASE_NAME} OPTIONAL)
-ENDIF(NOT _INCLUDED_FILE)
+set(_INCLUDED_FILE "")
+if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
+  include(Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL  RESULT_VARIABLE _INCLUDED_FILE)
+endif(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
+if(NOT _INCLUDED_FILE)
+  if("ASM${ASM_DIALECT}" STREQUAL "ASM")
+    message(STATUS "Warning: Did not find file Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}")
+  endif("ASM${ASM_DIALECT}" STREQUAL "ASM")
+  include(Platform/${CMAKE_BASE_NAME} OPTIONAL)
+endif(NOT _INCLUDED_FILE)
 
-IF(CMAKE_SYSTEM_PROCESSOR)
-  INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL  RESULT_VARIABLE _INCLUDED_FILE)
-  IF(NOT _INCLUDED_FILE)
-    INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
-  ENDIF(NOT _INCLUDED_FILE)
-ENDIF(CMAKE_SYSTEM_PROCESSOR)
+if(CMAKE_SYSTEM_PROCESSOR)
+  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL  RESULT_VARIABLE _INCLUDED_FILE)
+  if(NOT _INCLUDED_FILE)
+    include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
+  endif(NOT _INCLUDED_FILE)
+endif(CMAKE_SYSTEM_PROCESSOR)
 
-INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL  RESULT_VARIABLE _INCLUDED_FILE)
-IF(NOT _INCLUDED_FILE)
-  INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
-ENDIF(NOT _INCLUDED_FILE)
+include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL  RESULT_VARIABLE _INCLUDED_FILE)
+if(NOT _INCLUDED_FILE)
+  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
+endif(NOT _INCLUDED_FILE)
 
 # Set default assembler file extensions:
-IF(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS)
-  SET(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;S;asm)
-ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS)
+if(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS)
+  set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;S;asm)
+endif(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS)
 
 
 # Support for CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT and friends:
-SET(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT "$ENV{ASM${ASM_DIALECT}FLAGS} ${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}")
+set(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT "$ENV{ASM${ASM_DIALECT}FLAGS} ${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}")
 # avoid just having a space as the initial value for the cache
-IF(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ")
-  SET(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT)
-ENDIF(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ")
-SET (CMAKE_ASM${ASM_DIALECT}_FLAGS "${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}" CACHE STRING
+if(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ")
+  set(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT)
+endif(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ")
+set (CMAKE_ASM${ASM_DIALECT}_FLAGS "${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}" CACHE STRING
      "Flags used by the assembler during all build types.")
 
-IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
 # default build type is none
-  IF(NOT CMAKE_NO_BUILD_TYPE)
-    SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
+  if(NOT CMAKE_NO_BUILD_TYPE)
+    set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
       "Choose the type of build, options are: None, Debug Release RelWithDebInfo MinSizeRel.")
-  ENDIF(NOT CMAKE_NO_BUILD_TYPE)
-  SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG "${CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG_INIT}" CACHE STRING
+  endif(NOT CMAKE_NO_BUILD_TYPE)
+  set (CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG "${CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG_INIT}" CACHE STRING
     "Flags used by the assembler during debug builds.")
-  SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL "${CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL_INIT}" CACHE STRING
+  set (CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL "${CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL_INIT}" CACHE STRING
     "Flags used by the assembler during release minsize builds.")
-  SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE_INIT}" CACHE STRING
+  set (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE_INIT}" CACHE STRING
     "Flags used by the assembler during release builds.")
-  SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
+  set (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
     "Flags used by the assembler during Release with Debug Info builds.")
-ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+endif(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
 
-MARK_AS_ADVANCED(CMAKE_ASM${ASM_DIALECT}_FLAGS
+mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_FLAGS
                  CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG
                  CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL
                  CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE
@@ -89,42 +89,42 @@ MARK_AS_ADVANCED(CMAKE_ASM${ASM_DIALECT}_FLAGS
                 )
 
 
-IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT)
-  SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
-ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT)
+if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT)
+  set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
+endif(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT)
 
-IF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY)
-  SET(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY
+if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY)
+  set(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY
       "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> "
       "<CMAKE_RANLIB> <TARGET> ")
-ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY)
+endif(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY)
 
-IF(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE)
-  SET(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE
+if(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE)
+  set(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE
     "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> <CMAKE_ASM${ASM_DIALECT}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS>  -o <TARGET> <LINK_LIBRARIES>")
-ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE)
+endif(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE)
 
-IF(NOT CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG)
-  SET(CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_ASM${ASM_DIALECT}_FLAG})
-ENDIF()
+if(NOT CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG)
+  set(CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_ASM${ASM_DIALECT}_FLAG})
+endif()
 
-IF(NOT CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP)
-  SET(CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP})
-ENDIF()
+if(NOT CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP)
+  set(CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP})
+endif()
 
-IF(NOT CMAKE_EXECUTABLE_RPATH_LINK_ASM${ASM_DIALECT}_FLAG)
-  SET(CMAKE_EXECUTABLE_RPATH_LINK_ASM${ASM_DIALECT}_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_ASM${ASM_DIALECT}_FLAG})
-ENDIF()
+if(NOT CMAKE_EXECUTABLE_RPATH_LINK_ASM${ASM_DIALECT}_FLAG)
+  set(CMAKE_EXECUTABLE_RPATH_LINK_ASM${ASM_DIALECT}_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_ASM${ASM_DIALECT}_FLAG})
+endif()
 
 # to be done
-IF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
-  SET(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
-ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
+if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
+  set(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
+endif(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
 
-IF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
-  SET(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
-ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
+if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
+  set(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
+endif(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
 
 
-SET(CMAKE_ASM${ASM_DIALECT}_INFOMATION_LOADED 1)
+set(CMAKE_ASM${ASM_DIALECT}_INFOMATION_LOADED 1)
 
diff --git a/Modules/CMakeASM_MASMInformation.cmake b/Modules/CMakeASM_MASMInformation.cmake
index 4e1386fab..eb105ab10 100644
--- a/Modules/CMakeASM_MASMInformation.cmake
+++ b/Modules/CMakeASM_MASMInformation.cmake
@@ -14,11 +14,11 @@
 
 # support for the MS assembler, masm and masm64
 
-SET(ASM_DIALECT "_MASM")
+set(ASM_DIALECT "_MASM")
 
-SET(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS asm)
+set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS asm)
 
-SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> /c  /Fo <OBJECT> <SOURCE>")
+set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> /c  /Fo <OBJECT> <SOURCE>")
 
-INCLUDE(CMakeASMInformation)
-SET(ASM_DIALECT)
+include(CMakeASMInformation)
+set(ASM_DIALECT)
diff --git a/Modules/CMakeASM_NASMInformation.cmake b/Modules/CMakeASM_NASMInformation.cmake
index 9da7d306c..7058fc7ae 100644
--- a/Modules/CMakeASM_NASMInformation.cmake
+++ b/Modules/CMakeASM_NASMInformation.cmake
@@ -19,21 +19,21 @@ set(CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS nasm asm)
 if(NOT CMAKE_ASM_NASM_OBJECT_FORMAT)
   if(WIN32)
     if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
-      SET(CMAKE_ASM_NASM_OBJECT_FORMAT win64)
+      set(CMAKE_ASM_NASM_OBJECT_FORMAT win64)
     else()
-      SET(CMAKE_ASM_NASM_OBJECT_FORMAT win32)
+      set(CMAKE_ASM_NASM_OBJECT_FORMAT win32)
     endif()
   elseif(APPLE)
     if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
-      SET(CMAKE_ASM_NASM_OBJECT_FORMAT macho64)
+      set(CMAKE_ASM_NASM_OBJECT_FORMAT macho64)
     else()
-      SET(CMAKE_ASM_NASM_OBJECT_FORMAT macho)
+      set(CMAKE_ASM_NASM_OBJECT_FORMAT macho)
     endif()
   else()
     if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
-      SET(CMAKE_ASM_NASM_OBJECT_FORMAT elf64)
+      set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64)
     else()
-      SET(CMAKE_ASM_NASM_OBJECT_FORMAT elf)
+      set(CMAKE_ASM_NASM_OBJECT_FORMAT elf)
     endif()
   endif()
 endif()
diff --git a/Modules/CMakeBackwardCompatibilityC.cmake b/Modules/CMakeBackwardCompatibilityC.cmake
index 60dcb6c08..90ad12e02 100644
--- a/Modules/CMakeBackwardCompatibilityC.cmake
+++ b/Modules/CMakeBackwardCompatibilityC.cmake
@@ -13,28 +13,28 @@
 #  License text for the above reference.)
 
 # Nothing here yet
-IF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
-  INCLUDE(CMakeVS7BackwardCompatibility)
-  SET(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
-ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
-IF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
-  INCLUDE(CMakeVS6BackwardCompatibility)
-  SET(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
-ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
+if(CMAKE_GENERATOR MATCHES "Visual Studio 7")
+  include(CMakeVS7BackwardCompatibility)
+  set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
+endif(CMAKE_GENERATOR MATCHES "Visual Studio 7")
+if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
+  include(CMakeVS6BackwardCompatibility)
+  set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
+endif(CMAKE_GENERATOR MATCHES "Visual Studio 6")
 
-IF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
+if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
   # Old CMake versions did not support OS X universal binaries anyway,
   # so just get through this with at least some size for the types.
-  LIST(LENGTH CMAKE_OSX_ARCHITECTURES NUM_ARCHS)
-  IF(${NUM_ARCHS} GREATER 1)
-    IF(NOT DEFINED CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
-      MESSAGE(WARNING "This module does not work with OS X universal binaries.")
-      SET(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES 1)
-      LIST(GET CMAKE_OSX_ARCHITECTURES 0 CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
-    ENDIF()
-  ENDIF()
+  list(LENGTH CMAKE_OSX_ARCHITECTURES NUM_ARCHS)
+  if(${NUM_ARCHS} GREATER 1)
+    if(NOT DEFINED CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
+      message(WARNING "This module does not work with OS X universal binaries.")
+      set(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES 1)
+      list(GET CMAKE_OSX_ARCHITECTURES 0 CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
+    endif()
+  endif()
 
-  INCLUDE (CheckTypeSize)
+  include (CheckTypeSize)
   CHECK_TYPE_SIZE(int      CMAKE_SIZEOF_INT)
   CHECK_TYPE_SIZE(long     CMAKE_SIZEOF_LONG)
   CHECK_TYPE_SIZE("void*"  CMAKE_SIZEOF_VOID_P)
@@ -43,52 +43,52 @@ IF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
   CHECK_TYPE_SIZE(float    CMAKE_SIZEOF_FLOAT)
   CHECK_TYPE_SIZE(double   CMAKE_SIZEOF_DOUBLE)
 
-  INCLUDE (CheckIncludeFile)
+  include (CheckIncludeFile)
   CHECK_INCLUDE_FILE("limits.h"       CMAKE_HAVE_LIMITS_H)
   CHECK_INCLUDE_FILE("unistd.h"       CMAKE_HAVE_UNISTD_H)
   CHECK_INCLUDE_FILE("pthread.h"      CMAKE_HAVE_PTHREAD_H)
 
-  INCLUDE (CheckIncludeFiles)
+  include (CheckIncludeFiles)
   CHECK_INCLUDE_FILES("sys/types.h;sys/prctl.h"    CMAKE_HAVE_SYS_PRCTL_H)
 
-  INCLUDE (TestBigEndian)
+  include (TestBigEndian)
   TEST_BIG_ENDIAN(CMAKE_WORDS_BIGENDIAN)
-  INCLUDE (FindX11)
+  include (FindX11)
 
-  IF("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
-    SET (CMAKE_X_CFLAGS "" CACHE STRING "X11 extra flags.")
-  ELSE("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
-    SET (CMAKE_X_CFLAGS "-I${X11_X11_INCLUDE_PATH}" CACHE STRING
+  if("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
+    set (CMAKE_X_CFLAGS "" CACHE STRING "X11 extra flags.")
+  else("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
+    set (CMAKE_X_CFLAGS "-I${X11_X11_INCLUDE_PATH}" CACHE STRING
          "X11 extra flags.")
-  ENDIF("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
-  SET (CMAKE_X_LIBS "${X11_LIBRARIES}" CACHE STRING
+  endif("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
+  set (CMAKE_X_LIBS "${X11_LIBRARIES}" CACHE STRING
        "Libraries and options used in X11 programs.")
-  SET (CMAKE_HAS_X "${X11_FOUND}" CACHE INTERNAL "Is X11 around.")
+  set (CMAKE_HAS_X "${X11_FOUND}" CACHE INTERNAL "Is X11 around.")
 
-  INCLUDE (FindThreads)
+  include (FindThreads)
 
-  SET (CMAKE_THREAD_LIBS        "${CMAKE_THREAD_LIBS_INIT}" CACHE STRING
+  set (CMAKE_THREAD_LIBS        "${CMAKE_THREAD_LIBS_INIT}" CACHE STRING
     "Thread library used.")
 
-  SET (CMAKE_USE_PTHREADS       "${CMAKE_USE_PTHREADS_INIT}" CACHE BOOL
+  set (CMAKE_USE_PTHREADS       "${CMAKE_USE_PTHREADS_INIT}" CACHE BOOL
      "Use the pthreads library.")
 
-  SET (CMAKE_USE_WIN32_THREADS  "${CMAKE_USE_WIN32_THREADS_INIT}" CACHE BOOL
+  set (CMAKE_USE_WIN32_THREADS  "${CMAKE_USE_WIN32_THREADS_INIT}" CACHE BOOL
        "Use the win32 thread library.")
 
-  SET (CMAKE_HP_PTHREADS        ${CMAKE_HP_PTHREADS_INIT} CACHE BOOL
+  set (CMAKE_HP_PTHREADS        ${CMAKE_HP_PTHREADS_INIT} CACHE BOOL
      "Use HP pthreads.")
 
-  SET (CMAKE_USE_SPROC          ${CMAKE_USE_SPROC_INIT} CACHE BOOL
+  set (CMAKE_USE_SPROC          ${CMAKE_USE_SPROC_INIT} CACHE BOOL
      "Use sproc libs.")
 
-  IF(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
-    SET(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
-    SET(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
-  ENDIF()
-ENDIF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
+  if(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
+    set(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
+    set(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
+  endif()
+endif(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
 
-MARK_AS_ADVANCED(
+mark_as_advanced(
 CMAKE_HP_PTHREADS
 CMAKE_THREAD_LIBS
 CMAKE_USE_PTHREADS
diff --git a/Modules/CMakeBackwardCompatibilityCXX.cmake b/Modules/CMakeBackwardCompatibilityCXX.cmake
index 839c21d5a..6888636b9 100644
--- a/Modules/CMakeBackwardCompatibilityCXX.cmake
+++ b/Modules/CMakeBackwardCompatibilityCXX.cmake
@@ -1,10 +1,10 @@
 # - define a bunch of backwards compatibility variables
 #  CMAKE_ANSI_CXXFLAGS - flag for ansi c++
 #  CMAKE_HAS_ANSI_STRING_STREAM - has <strstream>
-#  INCLUDE(TestForANSIStreamHeaders)
-#  INCLUDE(CheckIncludeFileCXX)
-#  INCLUDE(TestForSTDNamespace)
-#  INCLUDE(TestForANSIForScope)
+#  include(TestForANSIStreamHeaders)
+#  include(CheckIncludeFileCXX)
+#  include(TestForSTDNamespace)
+#  include(TestForANSIForScope)
 
 #=============================================================================
 # Copyright 2002-2009 Kitware, Inc.
@@ -19,36 +19,36 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-IF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
+if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
   # check for some ANSI flags in the CXX compiler if it is not gnu
-  IF(NOT CMAKE_COMPILER_IS_GNUCXX)
-    INCLUDE(TestCXXAcceptsFlag)
-    SET(CMAKE_TRY_ANSI_CXX_FLAGS "")
-    IF(CMAKE_SYSTEM MATCHES "IRIX.*")
-      SET(CMAKE_TRY_ANSI_CXX_FLAGS "-LANG:std")
-    ENDIF(CMAKE_SYSTEM MATCHES "IRIX.*")
-    IF(CMAKE_SYSTEM MATCHES "OSF.*")
-      SET(CMAKE_TRY_ANSI_CXX_FLAGS "-std strict_ansi -nopure_cname")
-    ENDIF(CMAKE_SYSTEM MATCHES "OSF.*")
+  if(NOT CMAKE_COMPILER_IS_GNUCXX)
+    include(TestCXXAcceptsFlag)
+    set(CMAKE_TRY_ANSI_CXX_FLAGS "")
+    if(CMAKE_SYSTEM MATCHES "IRIX.*")
+      set(CMAKE_TRY_ANSI_CXX_FLAGS "-LANG:std")
+    endif(CMAKE_SYSTEM MATCHES "IRIX.*")
+    if(CMAKE_SYSTEM MATCHES "OSF.*")
+      set(CMAKE_TRY_ANSI_CXX_FLAGS "-std strict_ansi -nopure_cname")
+    endif(CMAKE_SYSTEM MATCHES "OSF.*")
     # if CMAKE_TRY_ANSI_CXX_FLAGS has something in it, see
     # if the compiler accepts it
-    IF( CMAKE_TRY_ANSI_CXX_FLAGS MATCHES ".+")
+    if( CMAKE_TRY_ANSI_CXX_FLAGS MATCHES ".+")
       CHECK_CXX_ACCEPTS_FLAG(${CMAKE_TRY_ANSI_CXX_FLAGS} CMAKE_CXX_ACCEPTS_FLAGS)
       # if the compiler liked the flag then set CMAKE_ANSI_CXXFLAGS
       # to the flag
-      IF(CMAKE_CXX_ACCEPTS_FLAGS)
-        SET(CMAKE_ANSI_CXXFLAGS ${CMAKE_TRY_ANSI_CXX_FLAGS} CACHE INTERNAL
+      if(CMAKE_CXX_ACCEPTS_FLAGS)
+        set(CMAKE_ANSI_CXXFLAGS ${CMAKE_TRY_ANSI_CXX_FLAGS} CACHE INTERNAL
         "What flags are required by the c++ compiler to make it ansi." )
-      ENDIF(CMAKE_CXX_ACCEPTS_FLAGS)
-    ENDIF( CMAKE_TRY_ANSI_CXX_FLAGS MATCHES ".+")
-  ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
-  SET(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS})
-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
-  INCLUDE(TestForANSIStreamHeaders)
-  INCLUDE(CheckIncludeFileCXX)
-  INCLUDE(TestForSTDNamespace)
-  INCLUDE(TestForANSIForScope)
-  INCLUDE(TestForSSTREAM)
-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_SAVE}")
-ENDIF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
+      endif(CMAKE_CXX_ACCEPTS_FLAGS)
+    endif( CMAKE_TRY_ANSI_CXX_FLAGS MATCHES ".+")
+  endif(NOT CMAKE_COMPILER_IS_GNUCXX)
+  set(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS})
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
+  include(TestForANSIStreamHeaders)
+  include(CheckIncludeFileCXX)
+  include(TestForSTDNamespace)
+  include(TestForANSIForScope)
+  include(TestForSSTREAM)
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_SAVE}")
+endif(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
 
diff --git a/Modules/CMakeBorlandFindMake.cmake b/Modules/CMakeBorlandFindMake.cmake
index 1ef28df83..43b31c695 100644
--- a/Modules/CMakeBorlandFindMake.cmake
+++ b/Modules/CMakeBorlandFindMake.cmake
@@ -12,6 +12,6 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-SET (CMAKE_MAKE_PROGRAM "make" CACHE STRING
+set (CMAKE_MAKE_PROGRAM "make" CACHE STRING
      "Program used to build from makefiles.")
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in
index ded8cf6ab..6166ec0c1 100644
--- a/Modules/CMakeCCompiler.cmake.in
+++ b/Modules/CMakeCCompiler.cmake.in
@@ -1,53 +1,53 @@
-SET(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@")
-SET(CMAKE_C_COMPILER_ARG1 "@CMAKE_C_COMPILER_ARG1@")
-SET(CMAKE_C_COMPILER_ID "@CMAKE_C_COMPILER_ID@")
-SET(CMAKE_C_COMPILER_VERSION "@CMAKE_C_COMPILER_VERSION@")
-SET(CMAKE_C_PLATFORM_ID "@CMAKE_C_PLATFORM_ID@")
+set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@")
+set(CMAKE_C_COMPILER_ARG1 "@CMAKE_C_COMPILER_ARG1@")
+set(CMAKE_C_COMPILER_ID "@CMAKE_C_COMPILER_ID@")
+set(CMAKE_C_COMPILER_VERSION "@CMAKE_C_COMPILER_VERSION@")
+set(CMAKE_C_PLATFORM_ID "@CMAKE_C_PLATFORM_ID@")
 @SET_MSVC_C_ARCHITECTURE_ID@
-SET(CMAKE_AR "@CMAKE_AR@")
-SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
-SET(CMAKE_LINKER "@CMAKE_LINKER@")
-SET(CMAKE_COMPILER_IS_GNUCC @CMAKE_COMPILER_IS_GNUCC@)
-SET(CMAKE_C_COMPILER_LOADED 1)
-SET(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
-SET(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
-IF(CMAKE_COMPILER_IS_CYGWIN)
-  SET(CYGWIN 1)
-  SET(UNIX 1)
-ENDIF(CMAKE_COMPILER_IS_CYGWIN)
+set(CMAKE_AR "@CMAKE_AR@")
+set(CMAKE_RANLIB "@CMAKE_RANLIB@")
+set(CMAKE_LINKER "@CMAKE_LINKER@")
+set(CMAKE_COMPILER_IS_GNUCC @CMAKE_COMPILER_IS_GNUCC@)
+set(CMAKE_C_COMPILER_LOADED 1)
+set(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
+set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
+if(CMAKE_COMPILER_IS_CYGWIN)
+  set(CYGWIN 1)
+  set(UNIX 1)
+endif(CMAKE_COMPILER_IS_CYGWIN)
 
-SET(CMAKE_C_COMPILER_ENV_VAR "CC")
+set(CMAKE_C_COMPILER_ENV_VAR "CC")
 
-IF(CMAKE_COMPILER_IS_MINGW)
-  SET(MINGW 1)
-ENDIF(CMAKE_COMPILER_IS_MINGW)
-SET(CMAKE_C_COMPILER_ID_RUN 1)
-SET(CMAKE_C_SOURCE_FILE_EXTENSIONS c)
-SET(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
-SET(CMAKE_C_LINKER_PREFERENCE 10)
+if(CMAKE_COMPILER_IS_MINGW)
+  set(MINGW 1)
+endif(CMAKE_COMPILER_IS_MINGW)
+set(CMAKE_C_COMPILER_ID_RUN 1)
+set(CMAKE_C_SOURCE_FILE_EXTENSIONS c)
+set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
+set(CMAKE_C_LINKER_PREFERENCE 10)
 
 # Save compiler ABI information.
-SET(CMAKE_C_SIZEOF_DATA_PTR "@CMAKE_C_SIZEOF_DATA_PTR@")
-SET(CMAKE_C_COMPILER_ABI "@CMAKE_C_COMPILER_ABI@")
-SET(CMAKE_C_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
+set(CMAKE_C_SIZEOF_DATA_PTR "@CMAKE_C_SIZEOF_DATA_PTR@")
+set(CMAKE_C_COMPILER_ABI "@CMAKE_C_COMPILER_ABI@")
+set(CMAKE_C_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
 
-IF(CMAKE_C_SIZEOF_DATA_PTR)
-  SET(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
-ENDIF(CMAKE_C_SIZEOF_DATA_PTR)
+if(CMAKE_C_SIZEOF_DATA_PTR)
+  set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
+endif(CMAKE_C_SIZEOF_DATA_PTR)
 
-IF(CMAKE_C_COMPILER_ABI)
-  SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
-ENDIF(CMAKE_C_COMPILER_ABI)
+if(CMAKE_C_COMPILER_ABI)
+  set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
+endif(CMAKE_C_COMPILER_ABI)
 
-IF(CMAKE_C_LIBRARY_ARCHITECTURE)
-  SET(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
-ENDIF()
+if(CMAKE_C_LIBRARY_ARCHITECTURE)
+  set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
+endif()
 
-SET(CMAKE_C_HAS_ISYSROOT "@CMAKE_C_HAS_ISYSROOT@")
+set(CMAKE_C_HAS_ISYSROOT "@CMAKE_C_HAS_ISYSROOT@")
 @CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
 
-SET(CMAKE_C_IMPLICIT_LINK_LIBRARIES "@CMAKE_C_IMPLICIT_LINK_LIBRARIES@")
-SET(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_DIRECTORIES@")
+set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "@CMAKE_C_IMPLICIT_LINK_LIBRARIES@")
+set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_DIRECTORIES@")
 
 @SET_CMAKE_CMCLDEPS_EXECUTABLE@
 @SET_CMAKE_CL_SHOWINCLUDE_PREFIX@
diff --git a/Modules/CMakeCInformation.cmake b/Modules/CMakeCInformation.cmake
index fab580731..f0b7fe87b 100644
--- a/Modules/CMakeCInformation.cmake
+++ b/Modules/CMakeCInformation.cmake
@@ -20,60 +20,60 @@
 
 # some compilers use different extensions (e.g. sdcc uses .rel)
 # so set the extension here first so it can be overridden by the compiler specific file
-IF(UNIX)
-  SET(CMAKE_C_OUTPUT_EXTENSION .o)
-ELSE(UNIX)
-  SET(CMAKE_C_OUTPUT_EXTENSION .obj)
-ENDIF(UNIX)
+if(UNIX)
+  set(CMAKE_C_OUTPUT_EXTENSION .o)
+else(UNIX)
+  set(CMAKE_C_OUTPUT_EXTENSION .obj)
+endif(UNIX)
 
-SET(_INCLUDED_FILE 0)
+set(_INCLUDED_FILE 0)
 
 # Load compiler-specific information.
-IF(CMAKE_C_COMPILER_ID)
-  INCLUDE(Compiler/${CMAKE_C_COMPILER_ID}-C OPTIONAL)
-ENDIF(CMAKE_C_COMPILER_ID)
+if(CMAKE_C_COMPILER_ID)
+  include(Compiler/${CMAKE_C_COMPILER_ID}-C OPTIONAL)
+endif(CMAKE_C_COMPILER_ID)
 
-SET(CMAKE_BASE_NAME)
-GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_C_COMPILER} NAME_WE)
-IF(CMAKE_COMPILER_IS_GNUCC)
-  SET(CMAKE_BASE_NAME gcc)
-ENDIF(CMAKE_COMPILER_IS_GNUCC)
+set(CMAKE_BASE_NAME)
+get_filename_component(CMAKE_BASE_NAME ${CMAKE_C_COMPILER} NAME_WE)
+if(CMAKE_COMPILER_IS_GNUCC)
+  set(CMAKE_BASE_NAME gcc)
+endif(CMAKE_COMPILER_IS_GNUCC)
 
 
 # load a hardware specific file, mostly useful for embedded compilers
-IF(CMAKE_SYSTEM_PROCESSOR)
-  IF(CMAKE_C_COMPILER_ID)
-    INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
-  ENDIF(CMAKE_C_COMPILER_ID)
-  IF (NOT _INCLUDED_FILE)
-    INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
-  ENDIF (NOT _INCLUDED_FILE)
-ENDIF(CMAKE_SYSTEM_PROCESSOR)
+if(CMAKE_SYSTEM_PROCESSOR)
+  if(CMAKE_C_COMPILER_ID)
+    include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
+  endif(CMAKE_C_COMPILER_ID)
+  if (NOT _INCLUDED_FILE)
+    include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
+  endif (NOT _INCLUDED_FILE)
+endif(CMAKE_SYSTEM_PROCESSOR)
 
 
 # load the system- and compiler specific files
-IF(CMAKE_C_COMPILER_ID)
-  INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C
+if(CMAKE_C_COMPILER_ID)
+  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C
     OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
-ENDIF(CMAKE_C_COMPILER_ID)
-IF (NOT _INCLUDED_FILE)
-  INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}
+endif(CMAKE_C_COMPILER_ID)
+if (NOT _INCLUDED_FILE)
+  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}
     OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
-ENDIF (NOT _INCLUDED_FILE)
+endif (NOT _INCLUDED_FILE)
 # We specify the compiler information in the system file for some
 # platforms, but this language may not have been enabled when the file
 # was first included.  Include it again to get the language info.
 # Remove this when all compiler info is removed from system files.
-IF (NOT _INCLUDED_FILE)
-  INCLUDE(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
-ENDIF (NOT _INCLUDED_FILE)
+if (NOT _INCLUDED_FILE)
+  include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
+endif (NOT _INCLUDED_FILE)
 
-IF(CMAKE_C_SIZEOF_DATA_PTR)
-  FOREACH(f ${CMAKE_C_ABI_FILES})
-    INCLUDE(${f})
-  ENDFOREACH()
-  UNSET(CMAKE_C_ABI_FILES)
-ENDIF()
+if(CMAKE_C_SIZEOF_DATA_PTR)
+  foreach(f ${CMAKE_C_ABI_FILES})
+    include(${f})
+  endforeach()
+  unset(CMAKE_C_ABI_FILES)
+endif()
 
 # This should be included before the _INIT variables are
 # used to initialize the cache.  Since the rule variables
@@ -81,58 +81,58 @@ ENDIF()
 # But, it should still be after the platform file so changes can
 # be made to those values.
 
-IF(CMAKE_USER_MAKE_RULES_OVERRIDE)
+if(CMAKE_USER_MAKE_RULES_OVERRIDE)
   # Save the full path of the file so try_compile can use it.
-  INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
-  SET(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
-ENDIF()
+  include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
+  set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
+endif()
 
-IF(CMAKE_USER_MAKE_RULES_OVERRIDE_C)
+if(CMAKE_USER_MAKE_RULES_OVERRIDE_C)
   # Save the full path of the file so try_compile can use it.
-  INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_C} RESULT_VARIABLE _override)
-  SET(CMAKE_USER_MAKE_RULES_OVERRIDE_C "${_override}")
-ENDIF()
+  include(${CMAKE_USER_MAKE_RULES_OVERRIDE_C} RESULT_VARIABLE _override)
+  set(CMAKE_USER_MAKE_RULES_OVERRIDE_C "${_override}")
+endif()
 
 
 # for most systems a module is the same as a shared library
 # so unless the variable CMAKE_MODULE_EXISTS is set just
 # copy the values from the LIBRARY variables
-IF(NOT CMAKE_MODULE_EXISTS)
-  SET(CMAKE_SHARED_MODULE_C_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
-  SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
-ENDIF(NOT CMAKE_MODULE_EXISTS)
+if(NOT CMAKE_MODULE_EXISTS)
+  set(CMAKE_SHARED_MODULE_C_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
+  set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
+endif(NOT CMAKE_MODULE_EXISTS)
 
-SET(CMAKE_C_FLAGS_INIT "$ENV{CFLAGS} ${CMAKE_C_FLAGS_INIT}")
+set(CMAKE_C_FLAGS_INIT "$ENV{CFLAGS} ${CMAKE_C_FLAGS_INIT}")
 # avoid just having a space as the initial value for the cache
-IF(CMAKE_C_FLAGS_INIT STREQUAL " ")
-  SET(CMAKE_C_FLAGS_INIT)
-ENDIF(CMAKE_C_FLAGS_INIT STREQUAL " ")
-SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT}" CACHE STRING
+if(CMAKE_C_FLAGS_INIT STREQUAL " ")
+  set(CMAKE_C_FLAGS_INIT)
+endif(CMAKE_C_FLAGS_INIT STREQUAL " ")
+set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT}" CACHE STRING
      "Flags used by the compiler during all build types.")
 
-IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
 # default build type is none
-  IF(NOT CMAKE_NO_BUILD_TYPE)
-    SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
+  if(NOT CMAKE_NO_BUILD_TYPE)
+    set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
       "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
-  ENDIF(NOT CMAKE_NO_BUILD_TYPE)
-  SET (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG_INIT}" CACHE STRING
+  endif(NOT CMAKE_NO_BUILD_TYPE)
+  set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG_INIT}" CACHE STRING
     "Flags used by the compiler during debug builds.")
-  SET (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL_INIT}" CACHE STRING
+  set (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL_INIT}" CACHE STRING
     "Flags used by the compiler during release minsize builds.")
-  SET (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE_INIT}" CACHE STRING
+  set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE_INIT}" CACHE STRING
     "Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
-  SET (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
+  set (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
     "Flags used by the compiler during Release with Debug Info builds.")
-ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+endif(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
 
-IF(CMAKE_C_STANDARD_LIBRARIES_INIT)
-  SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES_INIT}"
+if(CMAKE_C_STANDARD_LIBRARIES_INIT)
+  set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES_INIT}"
     CACHE STRING "Libraries linked by defalut with all C applications.")
-  MARK_AS_ADVANCED(CMAKE_C_STANDARD_LIBRARIES)
-ENDIF(CMAKE_C_STANDARD_LIBRARIES_INIT)
+  mark_as_advanced(CMAKE_C_STANDARD_LIBRARIES)
+endif(CMAKE_C_STANDARD_LIBRARIES_INIT)
 
-INCLUDE(CMakeCommonLanguageInclude)
+include(CMakeCommonLanguageInclude)
 
 # now define the following rule variables
 
@@ -162,58 +162,58 @@ INCLUDE(CMakeCommonLanguageInclude)
 
 
 # create a C shared library
-IF(NOT CMAKE_C_CREATE_SHARED_LIBRARY)
-  SET(CMAKE_C_CREATE_SHARED_LIBRARY
+if(NOT CMAKE_C_CREATE_SHARED_LIBRARY)
+  set(CMAKE_C_CREATE_SHARED_LIBRARY
       "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
-ENDIF(NOT CMAKE_C_CREATE_SHARED_LIBRARY)
+endif(NOT CMAKE_C_CREATE_SHARED_LIBRARY)
 
 # create a C shared module just copy the shared library rule
-IF(NOT CMAKE_C_CREATE_SHARED_MODULE)
-  SET(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY})
-ENDIF(NOT CMAKE_C_CREATE_SHARED_MODULE)
+if(NOT CMAKE_C_CREATE_SHARED_MODULE)
+  set(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY})
+endif(NOT CMAKE_C_CREATE_SHARED_MODULE)
 
 # Create a static archive incrementally for large object file counts.
 # If CMAKE_C_CREATE_STATIC_LIBRARY is set it will override these.
-IF(NOT DEFINED CMAKE_C_ARCHIVE_CREATE)
-  SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
-ENDIF()
-IF(NOT DEFINED CMAKE_C_ARCHIVE_APPEND)
-  SET(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> r  <TARGET> <LINK_FLAGS> <OBJECTS>")
-ENDIF()
-IF(NOT DEFINED CMAKE_C_ARCHIVE_FINISH)
-  SET(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
-ENDIF()
+if(NOT DEFINED CMAKE_C_ARCHIVE_CREATE)
+  set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
+endif()
+if(NOT DEFINED CMAKE_C_ARCHIVE_APPEND)
+  set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> r  <TARGET> <LINK_FLAGS> <OBJECTS>")
+endif()
+if(NOT DEFINED CMAKE_C_ARCHIVE_FINISH)
+  set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
+endif()
 
 # compile a C file into an object file
-IF(NOT CMAKE_C_COMPILE_OBJECT)
-  SET(CMAKE_C_COMPILE_OBJECT
+if(NOT CMAKE_C_COMPILE_OBJECT)
+  set(CMAKE_C_COMPILE_OBJECT
     "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -o <OBJECT>   -c <SOURCE>")
-ENDIF(NOT CMAKE_C_COMPILE_OBJECT)
+endif(NOT CMAKE_C_COMPILE_OBJECT)
 
-IF(NOT CMAKE_C_LINK_EXECUTABLE)
-  SET(CMAKE_C_LINK_EXECUTABLE
+if(NOT CMAKE_C_LINK_EXECUTABLE)
+  set(CMAKE_C_LINK_EXECUTABLE
     "<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS>  -o <TARGET> <LINK_LIBRARIES>")
-ENDIF(NOT CMAKE_C_LINK_EXECUTABLE)
+endif(NOT CMAKE_C_LINK_EXECUTABLE)
 
-IF(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG)
-  SET(CMAKE_EXECUTABLE_RUNTIME_C_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
-ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG)
+if(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG)
+  set(CMAKE_EXECUTABLE_RUNTIME_C_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
+endif(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG)
 
-IF(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP)
-  SET(CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
-ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP)
+if(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP)
+  set(CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
+endif(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP)
 
-IF(NOT CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG)
-  SET(CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
-ENDIF(NOT CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG)
+if(NOT CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG)
+  set(CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
+endif(NOT CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG)
 
-MARK_AS_ADVANCED(
+mark_as_advanced(
 CMAKE_C_FLAGS
 CMAKE_C_FLAGS_DEBUG
 CMAKE_C_FLAGS_MINSIZEREL
 CMAKE_C_FLAGS_RELEASE
 CMAKE_C_FLAGS_RELWITHDEBINFO
 )
-SET(CMAKE_C_INFORMATION_LOADED 1)
+set(CMAKE_C_INFORMATION_LOADED 1)
 
 
diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in
index 5b6376a32..3cef7f82d 100644
--- a/Modules/CMakeCXXCompiler.cmake.in
+++ b/Modules/CMakeCXXCompiler.cmake.in
@@ -1,54 +1,54 @@
-SET(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@")
-SET(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@")
-SET(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@")
-SET(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@")
-SET(CMAKE_CXX_PLATFORM_ID "@CMAKE_CXX_PLATFORM_ID@")
+set(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@")
+set(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@")
+set(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@")
+set(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@")
+set(CMAKE_CXX_PLATFORM_ID "@CMAKE_CXX_PLATFORM_ID@")
 @SET_MSVC_CXX_ARCHITECTURE_ID@
-SET(CMAKE_AR "@CMAKE_AR@")
-SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
-SET(CMAKE_LINKER "@CMAKE_LINKER@")
-SET(CMAKE_COMPILER_IS_GNUCXX @CMAKE_COMPILER_IS_GNUCXX@)
-SET(CMAKE_CXX_COMPILER_LOADED 1)
-SET(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
-SET(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
-IF(CMAKE_COMPILER_IS_CYGWIN)
-  SET(CYGWIN 1)
-  SET(UNIX 1)
-ENDIF(CMAKE_COMPILER_IS_CYGWIN)
+set(CMAKE_AR "@CMAKE_AR@")
+set(CMAKE_RANLIB "@CMAKE_RANLIB@")
+set(CMAKE_LINKER "@CMAKE_LINKER@")
+set(CMAKE_COMPILER_IS_GNUCXX @CMAKE_COMPILER_IS_GNUCXX@)
+set(CMAKE_CXX_COMPILER_LOADED 1)
+set(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
+set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
+if(CMAKE_COMPILER_IS_CYGWIN)
+  set(CYGWIN 1)
+  set(UNIX 1)
+endif(CMAKE_COMPILER_IS_CYGWIN)
 
-SET(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
+set(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
 
-IF(CMAKE_COMPILER_IS_MINGW)
-  SET(MINGW 1)
-ENDIF(CMAKE_COMPILER_IS_MINGW)
-SET(CMAKE_CXX_COMPILER_ID_RUN 1)
-SET(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
-SET(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP)
-SET(CMAKE_CXX_LINKER_PREFERENCE 30)
-SET(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1)
+if(CMAKE_COMPILER_IS_MINGW)
+  set(MINGW 1)
+endif(CMAKE_COMPILER_IS_MINGW)
+set(CMAKE_CXX_COMPILER_ID_RUN 1)
+set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
+set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP)
+set(CMAKE_CXX_LINKER_PREFERENCE 30)
+set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1)
 
 # Save compiler ABI information.
-SET(CMAKE_CXX_SIZEOF_DATA_PTR "@CMAKE_CXX_SIZEOF_DATA_PTR@")
-SET(CMAKE_CXX_COMPILER_ABI "@CMAKE_CXX_COMPILER_ABI@")
-SET(CMAKE_CXX_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
+set(CMAKE_CXX_SIZEOF_DATA_PTR "@CMAKE_CXX_SIZEOF_DATA_PTR@")
+set(CMAKE_CXX_COMPILER_ABI "@CMAKE_CXX_COMPILER_ABI@")
+set(CMAKE_CXX_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
 
-IF(CMAKE_CXX_SIZEOF_DATA_PTR)
-  SET(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
-ENDIF(CMAKE_CXX_SIZEOF_DATA_PTR)
+if(CMAKE_CXX_SIZEOF_DATA_PTR)
+  set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
+endif(CMAKE_CXX_SIZEOF_DATA_PTR)
 
-IF(CMAKE_CXX_COMPILER_ABI)
-  SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}")
-ENDIF(CMAKE_CXX_COMPILER_ABI)
+if(CMAKE_CXX_COMPILER_ABI)
+  set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}")
+endif(CMAKE_CXX_COMPILER_ABI)
 
-IF(CMAKE_CXX_LIBRARY_ARCHITECTURE)
-  SET(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
-ENDIF()
+if(CMAKE_CXX_LIBRARY_ARCHITECTURE)
+  set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
+endif()
 
-SET(CMAKE_CXX_HAS_ISYSROOT "@CMAKE_CXX_HAS_ISYSROOT@")
+set(CMAKE_CXX_HAS_ISYSROOT "@CMAKE_CXX_HAS_ISYSROOT@")
 @CMAKE_CXX_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
 
-SET(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "@CMAKE_CXX_IMPLICIT_LINK_LIBRARIES@")
-SET(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES@")
+set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "@CMAKE_CXX_IMPLICIT_LINK_LIBRARIES@")
+set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES@")
 
 @SET_CMAKE_CMCLDEPS_EXECUTABLE@
 @SET_CMAKE_CL_SHOWINCLUDE_PREFIX@
diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake
index 7d38c64b8..961d9cddf 100644
--- a/Modules/CMakeCXXInformation.cmake
+++ b/Modules/CMakeCXXInformation.cmake
@@ -20,59 +20,59 @@
 
 # some compilers use different extensions (e.g. sdcc uses .rel)
 # so set the extension here first so it can be overridden by the compiler specific file
-IF(UNIX)
-  SET(CMAKE_CXX_OUTPUT_EXTENSION .o)
-ELSE(UNIX)
-  SET(CMAKE_CXX_OUTPUT_EXTENSION .obj)
-ENDIF(UNIX)
+if(UNIX)
+  set(CMAKE_CXX_OUTPUT_EXTENSION .o)
+else(UNIX)
+  set(CMAKE_CXX_OUTPUT_EXTENSION .obj)
+endif(UNIX)
 
-SET(_INCLUDED_FILE 0)
+set(_INCLUDED_FILE 0)
 
 # Load compiler-specific information.
-IF(CMAKE_CXX_COMPILER_ID)
-  INCLUDE(Compiler/${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL)
-ENDIF(CMAKE_CXX_COMPILER_ID)
+if(CMAKE_CXX_COMPILER_ID)
+  include(Compiler/${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL)
+endif(CMAKE_CXX_COMPILER_ID)
 
-SET(CMAKE_BASE_NAME)
-GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER} NAME_WE)
+set(CMAKE_BASE_NAME)
+get_filename_component(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER} NAME_WE)
 # since the gnu compiler has several names force g++
-IF(CMAKE_COMPILER_IS_GNUCXX)
-  SET(CMAKE_BASE_NAME g++)
-ENDIF(CMAKE_COMPILER_IS_GNUCXX)
+if(CMAKE_COMPILER_IS_GNUCXX)
+  set(CMAKE_BASE_NAME g++)
+endif(CMAKE_COMPILER_IS_GNUCXX)
 
 
 # load a hardware specific file, mostly useful for embedded compilers
-IF(CMAKE_SYSTEM_PROCESSOR)
-  IF(CMAKE_CXX_COMPILER_ID)
-    INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
-  ENDIF(CMAKE_CXX_COMPILER_ID)
-  IF (NOT _INCLUDED_FILE)
-    INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
-  ENDIF (NOT _INCLUDED_FILE)
-ENDIF(CMAKE_SYSTEM_PROCESSOR)
+if(CMAKE_SYSTEM_PROCESSOR)
+  if(CMAKE_CXX_COMPILER_ID)
+    include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
+  endif(CMAKE_CXX_COMPILER_ID)
+  if (NOT _INCLUDED_FILE)
+    include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
+  endif (NOT _INCLUDED_FILE)
+endif(CMAKE_SYSTEM_PROCESSOR)
 
 # load the system- and compiler specific files
-IF(CMAKE_CXX_COMPILER_ID)
-  INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
-ENDIF(CMAKE_CXX_COMPILER_ID)
-IF (NOT _INCLUDED_FILE)
-  INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
+if(CMAKE_CXX_COMPILER_ID)
+  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
+endif(CMAKE_CXX_COMPILER_ID)
+if (NOT _INCLUDED_FILE)
+  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
           RESULT_VARIABLE _INCLUDED_FILE)
-ENDIF (NOT _INCLUDED_FILE)
+endif (NOT _INCLUDED_FILE)
 # We specify the compiler information in the system file for some
 # platforms, but this language may not have been enabled when the file
 # was first included.  Include it again to get the language info.
 # Remove this when all compiler info is removed from system files.
-IF (NOT _INCLUDED_FILE)
-  INCLUDE(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
-ENDIF (NOT _INCLUDED_FILE)
+if (NOT _INCLUDED_FILE)
+  include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
+endif (NOT _INCLUDED_FILE)
 
-IF(CMAKE_CXX_SIZEOF_DATA_PTR)
-  FOREACH(f ${CMAKE_CXX_ABI_FILES})
-    INCLUDE(${f})
-  ENDFOREACH()
-  UNSET(CMAKE_CXX_ABI_FILES)
-ENDIF()
+if(CMAKE_CXX_SIZEOF_DATA_PTR)
+  foreach(f ${CMAKE_CXX_ABI_FILES})
+    include(${f})
+  endforeach()
+  unset(CMAKE_CXX_ABI_FILES)
+endif()
 
 # This should be included before the _INIT variables are
 # used to initialize the cache.  Since the rule variables
@@ -80,150 +80,150 @@ ENDIF()
 # But, it should still be after the platform file so changes can
 # be made to those values.
 
-IF(CMAKE_USER_MAKE_RULES_OVERRIDE)
+if(CMAKE_USER_MAKE_RULES_OVERRIDE)
   # Save the full path of the file so try_compile can use it.
-  INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
-  SET(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
-ENDIF()
+  include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
+  set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
+endif()
 
-IF(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX)
+if(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX)
   # Save the full path of the file so try_compile can use it.
-  INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_CXX} RESULT_VARIABLE _override)
-  SET(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX "${_override}")
-ENDIF()
+  include(${CMAKE_USER_MAKE_RULES_OVERRIDE_CXX} RESULT_VARIABLE _override)
+  set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX "${_override}")
+endif()
 
 
 # Create a set of shared library variable specific to C++
 # For 90% of the systems, these are the same flags as the C versions
 # so if these are not set just copy the flags from the c version
-IF(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS)
-  SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
-ENDIF(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS)
+if(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS)
+  set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
+endif(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS)
 
-IF(NOT CMAKE_CXX_COMPILE_OPTIONS_PIC)
-  SET(CMAKE_CXX_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC})
-ENDIF(NOT CMAKE_CXX_COMPILE_OPTIONS_PIC)
+if(NOT CMAKE_CXX_COMPILE_OPTIONS_PIC)
+  set(CMAKE_CXX_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC})
+endif(NOT CMAKE_CXX_COMPILE_OPTIONS_PIC)
 
-IF(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE)
-  SET(CMAKE_CXX_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
-ENDIF(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE)
+if(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE)
+  set(CMAKE_CXX_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
+endif(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE)
 
-IF(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL)
-  SET(CMAKE_CXX_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
-ENDIF(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL)
+if(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL)
+  set(CMAKE_CXX_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
+endif(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL)
 
-IF(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS)
-  SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
-ENDIF(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS)
+if(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS)
+  set(CMAKE_SHARED_LIBRARY_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
+endif(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS)
 
-IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
-  SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
-ENDIF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
+if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
+  set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
+endif(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
 
-IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG)
-  SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
-ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG)
+if(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG)
+  set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
+endif(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG)
 
-IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP)
-  SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
-ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP)
+if(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP)
+  set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
+endif(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP)
 
-IF(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG)
-  SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
-ENDIF(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG)
+if(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG)
+  set(CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
+endif(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG)
 
-IF(NOT DEFINED CMAKE_EXE_EXPORTS_CXX_FLAG)
-  SET(CMAKE_EXE_EXPORTS_CXX_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG})
-ENDIF()
+if(NOT DEFINED CMAKE_EXE_EXPORTS_CXX_FLAG)
+  set(CMAKE_EXE_EXPORTS_CXX_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG})
+endif()
 
-IF(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG)
-  SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
-ENDIF()
+if(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG)
+  set(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
+endif()
 
-IF(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG)
-  SET(CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG})
-ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG)
+if(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG)
+  set(CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG})
+endif(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG)
 
-IF(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP)
-  SET(CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP})
-ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP)
+if(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP)
+  set(CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP})
+endif(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP)
 
-IF(NOT CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG)
-  SET(CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG})
-ENDIF(NOT CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG)
+if(NOT CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG)
+  set(CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG})
+endif(NOT CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG)
 
-IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH)
-  SET(CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH})
-ENDIF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH)
+if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH)
+  set(CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH})
+endif(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH)
 
-IF(NOT CMAKE_INCLUDE_FLAG_CXX)
-  SET(CMAKE_INCLUDE_FLAG_CXX ${CMAKE_INCLUDE_FLAG_C})
-ENDIF(NOT CMAKE_INCLUDE_FLAG_CXX)
+if(NOT CMAKE_INCLUDE_FLAG_CXX)
+  set(CMAKE_INCLUDE_FLAG_CXX ${CMAKE_INCLUDE_FLAG_C})
+endif(NOT CMAKE_INCLUDE_FLAG_CXX)
 
-IF(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
-  SET(CMAKE_INCLUDE_FLAG_SEP_CXX ${CMAKE_INCLUDE_FLAG_SEP_C})
-ENDIF(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
+if(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
+  set(CMAKE_INCLUDE_FLAG_SEP_CXX ${CMAKE_INCLUDE_FLAG_SEP_C})
+endif(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
 
 # for most systems a module is the same as a shared library
 # so unless the variable CMAKE_MODULE_EXISTS is set just
 # copy the values from the LIBRARY variables
-IF(NOT CMAKE_MODULE_EXISTS)
-  SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
-  SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS})
-ENDIF(NOT CMAKE_MODULE_EXISTS)
+if(NOT CMAKE_MODULE_EXISTS)
+  set(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
+  set(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS})
+endif(NOT CMAKE_MODULE_EXISTS)
 
 # repeat for modules
-IF(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS)
-  SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
-ENDIF(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS)
+if(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS)
+  set(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
+endif(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS)
 
-IF(NOT CMAKE_SHARED_MODULE_CXX_FLAGS)
-  SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
-ENDIF(NOT CMAKE_SHARED_MODULE_CXX_FLAGS)
+if(NOT CMAKE_SHARED_MODULE_CXX_FLAGS)
+  set(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
+endif(NOT CMAKE_SHARED_MODULE_CXX_FLAGS)
 
 # Initialize CXX link type selection flags from C versions.
-FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
-  IF(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS)
-    SET(CMAKE_${type}_LINK_STATIC_CXX_FLAGS
+foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+  if(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS)
+    set(CMAKE_${type}_LINK_STATIC_CXX_FLAGS
       ${CMAKE_${type}_LINK_STATIC_C_FLAGS})
-  ENDIF(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS)
-  IF(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS)
-    SET(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS
+  endif(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS)
+  if(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS)
+    set(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS
       ${CMAKE_${type}_LINK_DYNAMIC_C_FLAGS})
-  ENDIF(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS)
-ENDFOREACH(type)
+  endif(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS)
+endforeach(type)
 
 # add the flags to the cache based
 # on the initial values computed in the platform/*.cmake files
 # use _INIT variables so that this only happens the first time
 # and you can set these flags in the cmake cache
-SET(CMAKE_CXX_FLAGS_INIT "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_INIT}")
+set(CMAKE_CXX_FLAGS_INIT "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_INIT}")
 # avoid just having a space as the initial value for the cache
-IF(CMAKE_CXX_FLAGS_INIT STREQUAL " ")
-  SET(CMAKE_CXX_FLAGS_INIT)
-ENDIF(CMAKE_CXX_FLAGS_INIT STREQUAL " ")
-SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT}" CACHE STRING
+if(CMAKE_CXX_FLAGS_INIT STREQUAL " ")
+  set(CMAKE_CXX_FLAGS_INIT)
+endif(CMAKE_CXX_FLAGS_INIT STREQUAL " ")
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT}" CACHE STRING
      "Flags used by the compiler during all build types.")
 
-IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
-  SET (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG_INIT}" CACHE STRING
+if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+  set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG_INIT}" CACHE STRING
      "Flags used by the compiler during debug builds.")
-  SET (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL_INIT}" CACHE STRING
+  set (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL_INIT}" CACHE STRING
       "Flags used by the compiler during release minsize builds.")
-  SET (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE_INIT}" CACHE STRING
+  set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE_INIT}" CACHE STRING
      "Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
-  SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
+  set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
      "Flags used by the compiler during Release with Debug Info builds.")
 
-ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+endif(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
 
-IF(CMAKE_CXX_STANDARD_LIBRARIES_INIT)
-  SET(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES_INIT}"
+if(CMAKE_CXX_STANDARD_LIBRARIES_INIT)
+  set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES_INIT}"
     CACHE STRING "Libraries linked by defalut with all C++ applications.")
-  MARK_AS_ADVANCED(CMAKE_CXX_STANDARD_LIBRARIES)
-ENDIF(CMAKE_CXX_STANDARD_LIBRARIES_INIT)
+  mark_as_advanced(CMAKE_CXX_STANDARD_LIBRARIES)
+endif(CMAKE_CXX_STANDARD_LIBRARIES_INIT)
 
-INCLUDE(CMakeCommonLanguageInclude)
+include(CMakeCommonLanguageInclude)
 
 # now define the following rules:
 # CMAKE_CXX_CREATE_SHARED_LIBRARY
@@ -252,41 +252,41 @@ INCLUDE(CMakeCommonLanguageInclude)
 
 
 # create a shared C++ library
-IF(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY)
-  SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
+if(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY)
+  set(CMAKE_CXX_CREATE_SHARED_LIBRARY
       "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
-ENDIF(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY)
+endif(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY)
 
 # create a c++ shared module copy the shared library rule by default
-IF(NOT CMAKE_CXX_CREATE_SHARED_MODULE)
-  SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
-ENDIF(NOT CMAKE_CXX_CREATE_SHARED_MODULE)
+if(NOT CMAKE_CXX_CREATE_SHARED_MODULE)
+  set(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
+endif(NOT CMAKE_CXX_CREATE_SHARED_MODULE)
 
 
 # Create a static archive incrementally for large object file counts.
 # If CMAKE_CXX_CREATE_STATIC_LIBRARY is set it will override these.
-IF(NOT DEFINED CMAKE_CXX_ARCHIVE_CREATE)
-  SET(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
-ENDIF()
-IF(NOT DEFINED CMAKE_CXX_ARCHIVE_APPEND)
-  SET(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> r  <TARGET> <LINK_FLAGS> <OBJECTS>")
-ENDIF()
-IF(NOT DEFINED CMAKE_CXX_ARCHIVE_FINISH)
-  SET(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
-ENDIF()
+if(NOT DEFINED CMAKE_CXX_ARCHIVE_CREATE)
+  set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
+endif()
+if(NOT DEFINED CMAKE_CXX_ARCHIVE_APPEND)
+  set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> r  <TARGET> <LINK_FLAGS> <OBJECTS>")
+endif()
+if(NOT DEFINED CMAKE_CXX_ARCHIVE_FINISH)
+  set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
+endif()
 
 # compile a C++ file into an object file
-IF(NOT CMAKE_CXX_COMPILE_OBJECT)
-  SET(CMAKE_CXX_COMPILE_OBJECT
+if(NOT CMAKE_CXX_COMPILE_OBJECT)
+  set(CMAKE_CXX_COMPILE_OBJECT
     "<CMAKE_CXX_COMPILER>  <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
-ENDIF(NOT CMAKE_CXX_COMPILE_OBJECT)
+endif(NOT CMAKE_CXX_COMPILE_OBJECT)
 
-IF(NOT CMAKE_CXX_LINK_EXECUTABLE)
-  SET(CMAKE_CXX_LINK_EXECUTABLE
+if(NOT CMAKE_CXX_LINK_EXECUTABLE)
+  set(CMAKE_CXX_LINK_EXECUTABLE
     "<CMAKE_CXX_COMPILER>  <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS>  -o <TARGET> <LINK_LIBRARIES>")
-ENDIF(NOT CMAKE_CXX_LINK_EXECUTABLE)
+endif(NOT CMAKE_CXX_LINK_EXECUTABLE)
 
-MARK_AS_ADVANCED(
+mark_as_advanced(
 CMAKE_BUILD_TOOL
 CMAKE_VERBOSE_MAKEFILE
 CMAKE_CXX_FLAGS
@@ -295,5 +295,5 @@ CMAKE_CXX_FLAGS_RELWITHDEBINFO
 CMAKE_CXX_FLAGS_MINSIZEREL
 CMAKE_CXX_FLAGS_DEBUG)
 
-SET(CMAKE_CXX_INFORMATION_LOADED 1)
+set(CMAKE_CXX_INFORMATION_LOADED 1)
 
diff --git a/Modules/CMakeClDeps.cmake b/Modules/CMakeClDeps.cmake
index 6815e2b75..b52641c53 100644
--- a/Modules/CMakeClDeps.cmake
+++ b/Modules/CMakeClDeps.cmake
@@ -20,18 +20,18 @@
 # in front of each include path, so it can remove it.
 #
 
-IF(MSVC_C_ARCHITECTURE_ID AND CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_C_COMPILER AND CMAKE_COMMAND)
-  STRING(REPLACE "cmake.exe" "cmcldeps.exe"  CMAKE_CMCLDEPS_EXECUTABLE ${CMAKE_COMMAND})
-  SET(showdir ${CMAKE_BINARY_DIR}/CMakeFiles/ShowIncludes)
-  FILE(WRITE ${showdir}/foo.h "\n")
-  FILE(WRITE ${showdir}/main.c "#include \"foo.h\" \nint main(){}\n")
-  EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} /nologo /showIncludes ${showdir}/main.c
+if(MSVC_C_ARCHITECTURE_ID AND CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_C_COMPILER AND CMAKE_COMMAND)
+  string(REPLACE "cmake.exe" "cmcldeps.exe"  CMAKE_CMCLDEPS_EXECUTABLE ${CMAKE_COMMAND})
+  set(showdir ${CMAKE_BINARY_DIR}/CMakeFiles/ShowIncludes)
+  file(WRITE ${showdir}/foo.h "\n")
+  file(WRITE ${showdir}/main.c "#include \"foo.h\" \nint main(){}\n")
+  execute_process(COMMAND ${CMAKE_C_COMPILER} /nologo /showIncludes ${showdir}/main.c
                   WORKING_DIRECTORY ${showdir} OUTPUT_VARIABLE showOut)
-  STRING(REPLACE main.c "" showOut1 ${showOut})
-  STRING(REPLACE "/" "\\" header1 ${showdir}/foo.h)
-  STRING(TOLOWER ${header1} header2)
-  STRING(REPLACE ${header2} "" showOut2 ${showOut1})
-  STRING(REPLACE "\n" "" showOut3 ${showOut2})
-  SET(SET_CMAKE_CMCLDEPS_EXECUTABLE   "SET(CMAKE_CMCLDEPS_EXECUTABLE \"${CMAKE_CMCLDEPS_EXECUTABLE}\")")
-  SET(SET_CMAKE_CL_SHOWINCLUDE_PREFIX "SET(CMAKE_CL_SHOWINCLUDE_PREFIX \"${showOut3}\")")
-ENDIF()
+  string(REPLACE main.c "" showOut1 ${showOut})
+  string(REPLACE "/" "\\" header1 ${showdir}/foo.h)
+  string(TOLOWER ${header1} header2)
+  string(REPLACE ${header2} "" showOut2 ${showOut1})
+  string(REPLACE "\n" "" showOut3 ${showOut2})
+  set(SET_CMAKE_CMCLDEPS_EXECUTABLE   "set(CMAKE_CMCLDEPS_EXECUTABLE \"${CMAKE_CMCLDEPS_EXECUTABLE}\")")
+  set(SET_CMAKE_CL_SHOWINCLUDE_PREFIX "set(CMAKE_CL_SHOWINCLUDE_PREFIX \"${showOut3}\")")
+endif()
diff --git a/Modules/CMakeCommonLanguageInclude.cmake b/Modules/CMakeCommonLanguageInclude.cmake
index aa129de68..99b5f1177 100644
--- a/Modules/CMakeCommonLanguageInclude.cmake
+++ b/Modules/CMakeCommonLanguageInclude.cmake
@@ -16,72 +16,72 @@
 # cache values that can be initialized in the platform-compiler.cmake file
 # it may be included by more than one language.
 
-SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
+set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
      CACHE STRING "Flags used by the linker.")
 
 
-IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
 # default build type is none
-  IF(NOT CMAKE_NO_BUILD_TYPE)
-    SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
+  if(NOT CMAKE_NO_BUILD_TYPE)
+    set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
       "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
-  ENDIF(NOT CMAKE_NO_BUILD_TYPE)
+  endif(NOT CMAKE_NO_BUILD_TYPE)
 
-  SET (CMAKE_EXE_LINKER_FLAGS_DEBUG ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
+  set (CMAKE_EXE_LINKER_FLAGS_DEBUG ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
      "Flags used by the linker during debug builds.")
 
-  SET (CMAKE_EXE_LINKER_FLAGS_MINSIZEREL ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT} CACHE STRING
+  set (CMAKE_EXE_LINKER_FLAGS_MINSIZEREL ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT} CACHE STRING
      "Flags used by the linker during release minsize builds.")
 
-  SET (CMAKE_EXE_LINKER_FLAGS_RELEASE ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
+  set (CMAKE_EXE_LINKER_FLAGS_RELEASE ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
      "Flags used by the linker during release builds.")
 
-  SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
+  set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
      ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
      "Flags used by the linker during Release with Debug Info builds.")
 
-  SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
+  set (CMAKE_SHARED_LINKER_FLAGS_DEBUG ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
      "Flags used by the linker during debug builds.")
 
-  SET (CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL ${CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL_INIT}
+  set (CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL ${CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL_INIT}
      CACHE STRING
      "Flags used by the linker during release minsize builds.")
 
-  SET (CMAKE_SHARED_LINKER_FLAGS_RELEASE ${CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
+  set (CMAKE_SHARED_LINKER_FLAGS_RELEASE ${CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
      "Flags used by the linker during release builds.")
 
-  SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
+  set (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
      ${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
      "Flags used by the linker during Release with Debug Info builds.")
 
-  SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG ${CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
+  set (CMAKE_MODULE_LINKER_FLAGS_DEBUG ${CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
      "Flags used by the linker during debug builds.")
 
-  SET (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL ${CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT}
+  set (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL ${CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT}
      CACHE STRING
      "Flags used by the linker during release minsize builds.")
 
-  SET (CMAKE_MODULE_LINKER_FLAGS_RELEASE ${CMAKE_MODULE_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
+  set (CMAKE_MODULE_LINKER_FLAGS_RELEASE ${CMAKE_MODULE_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
      "Flags used by the linker during release builds.")
 
-  SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
+  set (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
      ${CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
      "Flags used by the linker during Release with Debug Info builds.")
 
-ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+endif(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
 # shared linker flags
-SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
+set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
      CACHE STRING "Flags used by the linker during the creation of dll's.")
 
 # module linker flags
-SET (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
+set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
      CACHE STRING "Flags used by the linker during the creation of modules.")
 
-SET(CMAKE_BUILD_TOOL ${CMAKE_MAKE_PROGRAM} CACHE INTERNAL
+set(CMAKE_BUILD_TOOL ${CMAKE_MAKE_PROGRAM} CACHE INTERNAL
      "What is the target build tool cmake is generating for.")
 
 
-MARK_AS_ADVANCED(
+mark_as_advanced(
 CMAKE_BUILD_TOOL
 CMAKE_VERBOSE_MAKEFILE
 
diff --git a/Modules/CMakeDependentOption.cmake b/Modules/CMakeDependentOption.cmake
index 8b8dc07fb..98cae45e5 100644
--- a/Modules/CMakeDependentOption.cmake
+++ b/Modules/CMakeDependentOption.cmake
@@ -25,27 +25,27 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-MACRO(CMAKE_DEPENDENT_OPTION option doc default depends force)
-  IF(${option}_ISSET MATCHES "^${option}_ISSET$")
-    SET(${option}_AVAILABLE 1)
-    FOREACH(d ${depends})
-      STRING(REGEX REPLACE " +" ";" CMAKE_DEPENDENT_OPTION_DEP "${d}")
-      IF(${CMAKE_DEPENDENT_OPTION_DEP})
-      ELSE(${CMAKE_DEPENDENT_OPTION_DEP})
-        SET(${option}_AVAILABLE 0)
-      ENDIF(${CMAKE_DEPENDENT_OPTION_DEP})
-    ENDFOREACH(d)
-    IF(${option}_AVAILABLE)
-      OPTION(${option} "${doc}" "${default}")
-      SET(${option} "${${option}}" CACHE BOOL "${doc}" FORCE)
-    ELSE(${option}_AVAILABLE)
-      IF(${option} MATCHES "^${option}$")
-      ELSE(${option} MATCHES "^${option}$")
-        SET(${option} "${${option}}" CACHE INTERNAL "${doc}")
-      ENDIF(${option} MATCHES "^${option}$")
-      SET(${option} ${force})
-    ENDIF(${option}_AVAILABLE)
-  ELSE(${option}_ISSET MATCHES "^${option}_ISSET$")
-    SET(${option} "${${option}_ISSET}")
-  ENDIF(${option}_ISSET MATCHES "^${option}_ISSET$")
-ENDMACRO(CMAKE_DEPENDENT_OPTION)
+macro(CMAKE_DEPENDENT_OPTION option doc default depends force)
+  if(${option}_ISSET MATCHES "^${option}_ISSET$")
+    set(${option}_AVAILABLE 1)
+    foreach(d ${depends})
+      string(REGEX REPLACE " +" ";" CMAKE_DEPENDENT_OPTION_DEP "${d}")
+      if(${CMAKE_DEPENDENT_OPTION_DEP})
+      else(${CMAKE_DEPENDENT_OPTION_DEP})
+        set(${option}_AVAILABLE 0)
+      endif(${CMAKE_DEPENDENT_OPTION_DEP})
+    endforeach(d)
+    if(${option}_AVAILABLE)
+      option(${option} "${doc}" "${default}")
+      set(${option} "${${option}}" CACHE BOOL "${doc}" FORCE)
+    else(${option}_AVAILABLE)
+      if(${option} MATCHES "^${option}$")
+      else(${option} MATCHES "^${option}$")
+        set(${option} "${${option}}" CACHE INTERNAL "${doc}")
+      endif(${option} MATCHES "^${option}$")
+      set(${option} ${force})
+    endif(${option}_AVAILABLE)
+  else(${option}_ISSET MATCHES "^${option}_ISSET$")
+    set(${option} "${${option}_ISSET}")
+  endif(${option}_ISSET MATCHES "^${option}_ISSET$")
+endmacro(CMAKE_DEPENDENT_OPTION)
diff --git a/Modules/CMakeDetermineASM-ATTCompiler.cmake b/Modules/CMakeDetermineASM-ATTCompiler.cmake
index 9dd2f11de..cec09e985 100644
--- a/Modules/CMakeDetermineASM-ATTCompiler.cmake
+++ b/Modules/CMakeDetermineASM-ATTCompiler.cmake
@@ -14,7 +14,7 @@
 
 # determine the compiler to use for ASM using AT&T syntax, e.g. GNU as
 
-SET(ASM_DIALECT "-ATT")
-SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ${_CMAKE_TOOLCHAIN_PREFIX}gas ${_CMAKE_TOOLCHAIN_PREFIX}as)
-INCLUDE(CMakeDetermineASMCompiler)
-SET(ASM_DIALECT)
+set(ASM_DIALECT "-ATT")
+set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ${_CMAKE_TOOLCHAIN_PREFIX}gas ${_CMAKE_TOOLCHAIN_PREFIX}as)
+include(CMakeDetermineASMCompiler)
+set(ASM_DIALECT)
diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake
index 7da6ac04a..ad6616cbc 100644
--- a/Modules/CMakeDetermineASMCompiler.cmake
+++ b/Modules/CMakeDetermineASMCompiler.cmake
@@ -14,40 +14,40 @@
 
 # determine the compiler to use for ASM programs
 
-INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
+include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
 
-IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
+if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
   # prefer the environment variable ASM
-  IF($ENV{ASM${ASM_DIALECT}} MATCHES ".+")
-    SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT "$ENV{ASM${ASM_DIALECT}}")
-  ENDIF($ENV{ASM${ASM_DIALECT}} MATCHES ".+")
+  if($ENV{ASM${ASM_DIALECT}} MATCHES ".+")
+    set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT "$ENV{ASM${ASM_DIALECT}}")
+  endif($ENV{ASM${ASM_DIALECT}} MATCHES ".+")
 
   # finally list compilers to try
-  IF("ASM${ASM_DIALECT}" STREQUAL "ASM") # the generic assembler support
-    IF(NOT CMAKE_ASM_COMPILER_INIT)
-      IF(CMAKE_C_COMPILER)
-        SET(CMAKE_ASM_COMPILER "${CMAKE_C_COMPILER}" CACHE FILEPATH "The ASM compiler")
-        SET(CMAKE_ASM_COMPILER_ID "${CMAKE_C_COMPILER_ID}")
-      ELSEIF(CMAKE_CXX_COMPILER)
-        SET(CMAKE_ASM_COMPILER "${CMAKE_CXX_COMPILER}" CACHE FILEPATH "The ASM compiler")
-        SET(CMAKE_ASM_COMPILER_ID "${CMAKE_CXX_COMPILER_ID}")
-      ELSE()
+  if("ASM${ASM_DIALECT}" STREQUAL "ASM") # the generic assembler support
+    if(NOT CMAKE_ASM_COMPILER_INIT)
+      if(CMAKE_C_COMPILER)
+        set(CMAKE_ASM_COMPILER "${CMAKE_C_COMPILER}" CACHE FILEPATH "The ASM compiler")
+        set(CMAKE_ASM_COMPILER_ID "${CMAKE_C_COMPILER_ID}")
+      elseif(CMAKE_CXX_COMPILER)
+        set(CMAKE_ASM_COMPILER "${CMAKE_CXX_COMPILER}" CACHE FILEPATH "The ASM compiler")
+        set(CMAKE_ASM_COMPILER_ID "${CMAKE_CXX_COMPILER_ID}")
+      else()
         # List all default C and CXX compilers
-        SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST
+        set(CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST
              ${_CMAKE_TOOLCHAIN_PREFIX}cc  ${_CMAKE_TOOLCHAIN_PREFIX}gcc cl bcc xlc
           CC ${_CMAKE_TOOLCHAIN_PREFIX}c++ ${_CMAKE_TOOLCHAIN_PREFIX}g++ aCC cl bcc xlC)
-      ENDIF()
-    ENDIF()
-  ELSE() # some specific assembler "dialect"
-    IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT)
-      MESSAGE(FATAL_ERROR "CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT must be preset !")
-    ENDIF()
-  ENDIF()
+      endif()
+    endif()
+  else() # some specific assembler "dialect"
+    if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT)
+      message(FATAL_ERROR "CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT must be preset !")
+    endif()
+  endif()
 
   # Find the compiler.
   _cmake_find_compiler(ASM${ASM_DIALECT})
 
-ELSE(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
+else(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
 
   # we only get here if CMAKE_ASM${ASM_DIALECT}_COMPILER was specified using -D or a pre-made CMakeCache.txt
   # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
@@ -56,63 +56,63 @@ ELSE(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
   # now try to find it with the full path
   # if it is found, force it into the cache,
   # if not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
-  GET_FILENAME_COMPONENT(_CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" PATH)
-  IF(NOT _CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH)
-    FIND_PROGRAM(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH NAMES ${CMAKE_ASM${ASM_DIALECT}_COMPILER})
-    MARK_AS_ADVANCED(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH)
-    IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH)
-      SET(CMAKE_ASM${ASM_DIALECT}_COMPILER ${CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH} CACHE FILEPATH "Assembler" FORCE)
-    ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH)
-  ENDIF(NOT _CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH)
-ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
-MARK_AS_ADVANCED(CMAKE_ASM${ASM_DIALECT}_COMPILER)
+  get_filename_component(_CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" PATH)
+  if(NOT _CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH)
+    find_program(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH NAMES ${CMAKE_ASM${ASM_DIALECT}_COMPILER})
+    mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH)
+    if(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH)
+      set(CMAKE_ASM${ASM_DIALECT}_COMPILER ${CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH} CACHE FILEPATH "Assembler" FORCE)
+    endif(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH)
+  endif(NOT _CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH)
+endif(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
+mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_COMPILER)
 
-IF (NOT _CMAKE_TOOLCHAIN_LOCATION)
-  GET_FILENAME_COMPONENT(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" PATH)
-ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
+if (NOT _CMAKE_TOOLCHAIN_LOCATION)
+  get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" PATH)
+endif (NOT _CMAKE_TOOLCHAIN_LOCATION)
 
 
-IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
+if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
 
   # Table of per-vendor compiler id flags with expected output.
-  LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS GNU )
-  SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_GNU "--version")
-  SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_GNU "(GNU assembler)|(GCC)|(Free Software Foundation)")
+  list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS GNU )
+  set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_GNU "--version")
+  set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_GNU "(GNU assembler)|(GCC)|(Free Software Foundation)")
 
-  LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS HP )
-  SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_HP "-V")
-  SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_HP "HP C")
+  list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS HP )
+  set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_HP "-V")
+  set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_HP "HP C")
 
-  LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS Intel )
-  SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_Intel "--version")
-  SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_Intel "(ICC)")
+  list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS Intel )
+  set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_Intel "--version")
+  set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_Intel "(ICC)")
 
-  LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS SunPro )
-  SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_SunPro "-V")
-  SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_SunPro "Sun C")
+  list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS SunPro )
+  set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_SunPro "-V")
+  set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_SunPro "Sun C")
 
-  LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS XL )
-  SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_XL "-qversion")
-  SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_XL "XL C")
+  list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS XL )
+  set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_XL "-qversion")
+  set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_XL "XL C")
 
-  LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS MSVC )
-  SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_MSVC "/?")
-  SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_MSVC "Microsoft")
+  list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS MSVC )
+  set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_MSVC "/?")
+  set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_MSVC "Microsoft")
 
-  LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS TI_DSP )
-  SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_TI_DSP "-h")
-  SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_TI_DSP "Texas Instruments")
+  list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS TI_DSP )
+  set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_TI_DSP "-h")
+  set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_TI_DSP "Texas Instruments")
 
-  INCLUDE(CMakeDetermineCompilerId)
+  include(CMakeDetermineCompilerId)
   CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT})
 
-ENDIF()
+endif()
 
-IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
-  MESSAGE(STATUS "The ASM${ASM_DIALECT} compiler identification is ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}")
-ELSE(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
-  MESSAGE(STATUS "The ASM${ASM_DIALECT} compiler identification is unknown")
-ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
+if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
+  message(STATUS "The ASM${ASM_DIALECT} compiler identification is ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}")
+else(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
+  message(STATUS "The ASM${ASM_DIALECT} compiler identification is unknown")
+endif(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
 
 
 
@@ -123,48 +123,48 @@ ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
 # NAME_WE cannot be used since then this test will fail for names lile
 # "arm-unknown-nto-qnx6.3.0-gas.exe", where BASENAME would be
 # "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-"
-IF (NOT _CMAKE_TOOLCHAIN_PREFIX)
-  GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME)
-  IF (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
-    SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
-  ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
-ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX)
+if (NOT _CMAKE_TOOLCHAIN_PREFIX)
+  get_filename_component(COMPILER_BASENAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME)
+  if (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
+    set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
+  endif (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
+endif (NOT _CMAKE_TOOLCHAIN_PREFIX)
 
 # Now try the C compiler regexp:
-IF (NOT _CMAKE_TOOLCHAIN_PREFIX)
-  IF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
-    SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
-  ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
-ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX)
+if (NOT _CMAKE_TOOLCHAIN_PREFIX)
+  if (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
+    set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
+  endif (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
+endif (NOT _CMAKE_TOOLCHAIN_PREFIX)
 
 # Finally try the CXX compiler regexp:
-IF (NOT _CMAKE_TOOLCHAIN_PREFIX)
-  IF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
-    SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
-  ENDIF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
-ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX)
+if (NOT _CMAKE_TOOLCHAIN_PREFIX)
+  if (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
+    set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
+  endif (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
+endif (NOT _CMAKE_TOOLCHAIN_PREFIX)
 
 
-INCLUDE(CMakeFindBinUtils)
+include(CMakeFindBinUtils)
 
-SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR "ASM${ASM_DIALECT}")
+set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR "ASM${ASM_DIALECT}")
 
-IF(CMAKE_ASM${ASM_DIALECT}_COMPILER)
-  MESSAGE(STATUS "Found assembler: ${CMAKE_ASM${ASM_DIALECT}_COMPILER}")
-ELSE(CMAKE_ASM${ASM_DIALECT}_COMPILER)
-  MESSAGE(STATUS "Didn't find assembler")
-ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER)
+if(CMAKE_ASM${ASM_DIALECT}_COMPILER)
+  message(STATUS "Found assembler: ${CMAKE_ASM${ASM_DIALECT}_COMPILER}")
+else(CMAKE_ASM${ASM_DIALECT}_COMPILER)
+  message(STATUS "Didn't find assembler")
+endif(CMAKE_ASM${ASM_DIALECT}_COMPILER)
 
 
-SET(_CMAKE_ASM_COMPILER "${CMAKE_ASM${ASM_DIALECT}_COMPILER}")
-SET(_CMAKE_ASM_COMPILER_ID "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}")
-SET(_CMAKE_ASM_COMPILER_ARG1 "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARG1}")
-SET(_CMAKE_ASM_COMPILER_ENV_VAR "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR}")
+set(_CMAKE_ASM_COMPILER "${CMAKE_ASM${ASM_DIALECT}_COMPILER}")
+set(_CMAKE_ASM_COMPILER_ID "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}")
+set(_CMAKE_ASM_COMPILER_ARG1 "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARG1}")
+set(_CMAKE_ASM_COMPILER_ENV_VAR "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR}")
 
 # configure variables set in this file for fast reload later on
-CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeASMCompiler.cmake.in
+configure_file(${CMAKE_ROOT}/Modules/CMakeASMCompiler.cmake.in
   ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeASM${ASM_DIALECT}Compiler.cmake IMMEDIATE @ONLY)
 
-SET(_CMAKE_ASM_COMPILER)
-SET(_CMAKE_ASM_COMPILER_ARG1)
-SET(_CMAKE_ASM_COMPILER_ENV_VAR)
+set(_CMAKE_ASM_COMPILER)
+set(_CMAKE_ASM_COMPILER_ARG1)
+set(_CMAKE_ASM_COMPILER_ENV_VAR)
diff --git a/Modules/CMakeDetermineASM_MASMCompiler.cmake b/Modules/CMakeDetermineASM_MASMCompiler.cmake
index e23f7db4c..364953791 100644
--- a/Modules/CMakeDetermineASM_MASMCompiler.cmake
+++ b/Modules/CMakeDetermineASM_MASMCompiler.cmake
@@ -14,14 +14,14 @@
 
 # Find the MS assembler (masm or masm64)
 
-SET(ASM_DIALECT "_MASM")
+set(ASM_DIALECT "_MASM")
 
 # if we are using the 64bit cl compiler, assume we also want the 64bit assembler
-IF(CMAKE_CL_64)
-   SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml64)
-ELSE(CMAKE_CL_64)
-   SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml)
-ENDIF(CMAKE_CL_64)
+if(CMAKE_CL_64)
+   set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml64)
+else(CMAKE_CL_64)
+   set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml)
+endif(CMAKE_CL_64)
 
-INCLUDE(CMakeDetermineASMCompiler)
-SET(ASM_DIALECT)
+include(CMakeDetermineASMCompiler)
+set(ASM_DIALECT)
diff --git a/Modules/CMakeDetermineASM_NASMCompiler.cmake b/Modules/CMakeDetermineASM_NASMCompiler.cmake
index d184c0a81..a9a9e052a 100644
--- a/Modules/CMakeDetermineASM_NASMCompiler.cmake
+++ b/Modules/CMakeDetermineASM_NASMCompiler.cmake
@@ -14,14 +14,14 @@
 
 # Find the nasm assembler. yasm (http://www.tortall.net/projects/yasm/) is nasm compatible
 
-SET(CMAKE_ASM_NASM_COMPILER_INIT nasm yasm)
+set(CMAKE_ASM_NASM_COMPILER_INIT nasm yasm)
 
-IF(NOT CMAKE_ASM_NASM_COMPILER)
-  FIND_PROGRAM(CMAKE_ASM_NASM_COMPILER nasm
+if(NOT CMAKE_ASM_NASM_COMPILER)
+  find_program(CMAKE_ASM_NASM_COMPILER nasm
     "$ENV{ProgramFiles}/NASM")
-ENDIF(NOT CMAKE_ASM_NASM_COMPILER)
+endif(NOT CMAKE_ASM_NASM_COMPILER)
 
 # Load the generic DetermineASM compiler file with the DIALECT set properly:
-SET(ASM_DIALECT "_NASM")
-INCLUDE(CMakeDetermineASMCompiler)
-SET(ASM_DIALECT)
+set(ASM_DIALECT "_NASM")
+include(CMakeDetermineASMCompiler)
+set(ASM_DIALECT)
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 3ce968c02..6bed02168 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -31,89 +31,89 @@
 # If not already set before, it also sets
 #   _CMAKE_TOOLCHAIN_PREFIX
 
-INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
+include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
 
 # Load system-specific compiler preferences for this language.
-INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-C OPTIONAL)
-IF(NOT CMAKE_C_COMPILER_NAMES)
-  SET(CMAKE_C_COMPILER_NAMES cc)
-ENDIF()
+include(Platform/${CMAKE_SYSTEM_NAME}-C OPTIONAL)
+if(NOT CMAKE_C_COMPILER_NAMES)
+  set(CMAKE_C_COMPILER_NAMES cc)
+endif()
 
-IF(NOT CMAKE_C_COMPILER)
-  SET(CMAKE_C_COMPILER_INIT NOTFOUND)
+if(NOT CMAKE_C_COMPILER)
+  set(CMAKE_C_COMPILER_INIT NOTFOUND)
 
   # prefer the environment variable CC
-  IF($ENV{CC} MATCHES ".+")
-    GET_FILENAME_COMPONENT(CMAKE_C_COMPILER_INIT $ENV{CC} PROGRAM PROGRAM_ARGS CMAKE_C_FLAGS_ENV_INIT)
-    IF(CMAKE_C_FLAGS_ENV_INIT)
-      SET(CMAKE_C_COMPILER_ARG1 "${CMAKE_C_FLAGS_ENV_INIT}" CACHE STRING "First argument to C compiler")
-    ENDIF(CMAKE_C_FLAGS_ENV_INIT)
-    IF(NOT EXISTS ${CMAKE_C_COMPILER_INIT})
-      MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable CC:\n$ENV{CC}.")
-    ENDIF(NOT EXISTS ${CMAKE_C_COMPILER_INIT})
-  ENDIF($ENV{CC} MATCHES ".+")
+  if($ENV{CC} MATCHES ".+")
+    get_filename_component(CMAKE_C_COMPILER_INIT $ENV{CC} PROGRAM PROGRAM_ARGS CMAKE_C_FLAGS_ENV_INIT)
+    if(CMAKE_C_FLAGS_ENV_INIT)
+      set(CMAKE_C_COMPILER_ARG1 "${CMAKE_C_FLAGS_ENV_INIT}" CACHE STRING "First argument to C compiler")
+    endif(CMAKE_C_FLAGS_ENV_INIT)
+    if(NOT EXISTS ${CMAKE_C_COMPILER_INIT})
+      message(FATAL_ERROR "Could not find compiler set in environment variable CC:\n$ENV{CC}.")
+    endif(NOT EXISTS ${CMAKE_C_COMPILER_INIT})
+  endif($ENV{CC} MATCHES ".+")
 
   # next try prefer the compiler specified by the generator
-  IF(CMAKE_GENERATOR_CC)
-    IF(NOT CMAKE_C_COMPILER_INIT)
-      SET(CMAKE_C_COMPILER_INIT ${CMAKE_GENERATOR_CC})
-    ENDIF(NOT CMAKE_C_COMPILER_INIT)
-  ENDIF(CMAKE_GENERATOR_CC)
+  if(CMAKE_GENERATOR_CC)
+    if(NOT CMAKE_C_COMPILER_INIT)
+      set(CMAKE_C_COMPILER_INIT ${CMAKE_GENERATOR_CC})
+    endif(NOT CMAKE_C_COMPILER_INIT)
+  endif(CMAKE_GENERATOR_CC)
 
   # finally list compilers to try
-  IF(NOT CMAKE_C_COMPILER_INIT)
-    SET(CMAKE_C_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}cc ${_CMAKE_TOOLCHAIN_PREFIX}gcc cl bcc xlc clang)
-  ENDIF()
+  if(NOT CMAKE_C_COMPILER_INIT)
+    set(CMAKE_C_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}cc ${_CMAKE_TOOLCHAIN_PREFIX}gcc cl bcc xlc clang)
+  endif()
 
   _cmake_find_compiler(C)
 
-ELSE(NOT CMAKE_C_COMPILER)
+else(NOT CMAKE_C_COMPILER)
 
   # we only get here if CMAKE_C_COMPILER was specified using -D or a pre-made CMakeCache.txt
   # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
   # if CMAKE_C_COMPILER is a list of length 2, use the first item as
   # CMAKE_C_COMPILER and the 2nd one as CMAKE_C_COMPILER_ARG1
 
-  LIST(LENGTH CMAKE_C_COMPILER _CMAKE_C_COMPILER_LIST_LENGTH)
-  IF("${_CMAKE_C_COMPILER_LIST_LENGTH}" EQUAL 2)
-    LIST(GET CMAKE_C_COMPILER 1 CMAKE_C_COMPILER_ARG1)
-    LIST(GET CMAKE_C_COMPILER 0 CMAKE_C_COMPILER)
-  ENDIF("${_CMAKE_C_COMPILER_LIST_LENGTH}" EQUAL 2)
+  list(LENGTH CMAKE_C_COMPILER _CMAKE_C_COMPILER_LIST_LENGTH)
+  if("${_CMAKE_C_COMPILER_LIST_LENGTH}" EQUAL 2)
+    list(GET CMAKE_C_COMPILER 1 CMAKE_C_COMPILER_ARG1)
+    list(GET CMAKE_C_COMPILER 0 CMAKE_C_COMPILER)
+  endif("${_CMAKE_C_COMPILER_LIST_LENGTH}" EQUAL 2)
 
   # if a compiler was specified by the user but without path,
   # now try to find it with the full path
   # if it is found, force it into the cache,
   # if not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
   # if the C compiler already had a path, reuse it for searching the CXX compiler
-  GET_FILENAME_COMPONENT(_CMAKE_USER_C_COMPILER_PATH "${CMAKE_C_COMPILER}" PATH)
-  IF(NOT _CMAKE_USER_C_COMPILER_PATH)
-    FIND_PROGRAM(CMAKE_C_COMPILER_WITH_PATH NAMES ${CMAKE_C_COMPILER})
-    MARK_AS_ADVANCED(CMAKE_C_COMPILER_WITH_PATH)
-    IF(CMAKE_C_COMPILER_WITH_PATH)
-      SET(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_WITH_PATH} CACHE STRING "C compiler" FORCE)
-    ENDIF(CMAKE_C_COMPILER_WITH_PATH)
-  ENDIF(NOT _CMAKE_USER_C_COMPILER_PATH)
-ENDIF(NOT CMAKE_C_COMPILER)
-MARK_AS_ADVANCED(CMAKE_C_COMPILER)
+  get_filename_component(_CMAKE_USER_C_COMPILER_PATH "${CMAKE_C_COMPILER}" PATH)
+  if(NOT _CMAKE_USER_C_COMPILER_PATH)
+    find_program(CMAKE_C_COMPILER_WITH_PATH NAMES ${CMAKE_C_COMPILER})
+    mark_as_advanced(CMAKE_C_COMPILER_WITH_PATH)
+    if(CMAKE_C_COMPILER_WITH_PATH)
+      set(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_WITH_PATH} CACHE STRING "C compiler" FORCE)
+    endif(CMAKE_C_COMPILER_WITH_PATH)
+  endif(NOT _CMAKE_USER_C_COMPILER_PATH)
+endif(NOT CMAKE_C_COMPILER)
+mark_as_advanced(CMAKE_C_COMPILER)
 
-IF (NOT _CMAKE_TOOLCHAIN_LOCATION)
-  GET_FILENAME_COMPONENT(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_C_COMPILER}" PATH)
-ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
+if (NOT _CMAKE_TOOLCHAIN_LOCATION)
+  get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_C_COMPILER}" PATH)
+endif (NOT _CMAKE_TOOLCHAIN_LOCATION)
 
 # Build a small source file to identify the compiler.
-IF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
-  SET(CMAKE_C_COMPILER_ID_RUN 1)
-  SET(CMAKE_C_PLATFORM_ID "Windows")
-  SET(CMAKE_C_COMPILER_ID "MSVC")
-ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
+if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
+  set(CMAKE_C_COMPILER_ID_RUN 1)
+  set(CMAKE_C_PLATFORM_ID "Windows")
+  set(CMAKE_C_COMPILER_ID "MSVC")
+endif(${CMAKE_GENERATOR} MATCHES "Visual Studio")
 
-IF(NOT CMAKE_C_COMPILER_ID_RUN)
-  SET(CMAKE_C_COMPILER_ID_RUN 1)
+if(NOT CMAKE_C_COMPILER_ID_RUN)
+  set(CMAKE_C_COMPILER_ID_RUN 1)
 
   # Each entry in this list is a set of extra flags to try
   # adding to the compile line to see if it helps produce
   # a valid identification file.
-  SET(CMAKE_C_COMPILER_ID_TEST_FLAGS
+  set(CMAKE_C_COMPILER_ID_TEST_FLAGS
     # Try compiling to an object file only.
     "-c"
 
@@ -122,22 +122,22 @@ IF(NOT CMAKE_C_COMPILER_ID_RUN)
     )
 
   # Try to identify the compiler.
-  SET(CMAKE_C_COMPILER_ID)
-  FILE(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in
+  set(CMAKE_C_COMPILER_ID)
+  file(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in
     CMAKE_C_COMPILER_ID_PLATFORM_CONTENT)
-  INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
+  include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
   CMAKE_DETERMINE_COMPILER_ID(C CFLAGS CMakeCCompilerId.c)
 
   # Set old compiler and platform id variables.
-  IF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
-    SET(CMAKE_COMPILER_IS_GNUCC 1)
-  ENDIF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
-  IF("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW")
-    SET(CMAKE_COMPILER_IS_MINGW 1)
-  ELSEIF("${CMAKE_C_PLATFORM_ID}" MATCHES "Cygwin")
-    SET(CMAKE_COMPILER_IS_CYGWIN 1)
-  ENDIF("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW")
-ENDIF(NOT CMAKE_C_COMPILER_ID_RUN)
+  if("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
+    set(CMAKE_COMPILER_IS_GNUCC 1)
+  endif("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
+  if("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW")
+    set(CMAKE_COMPILER_IS_MINGW 1)
+  elseif("${CMAKE_C_PLATFORM_ID}" MATCHES "Cygwin")
+    set(CMAKE_COMPILER_IS_CYGWIN 1)
+  endif("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW")
+endif(NOT CMAKE_C_COMPILER_ID_RUN)
 
 # If we have a gcc cross compiler, they have usually some prefix, like
 # e.g. powerpc-linux-gcc, arm-elf-gcc or i586-mingw32msvc-gcc, optionally
@@ -146,33 +146,33 @@ ENDIF(NOT CMAKE_C_COMPILER_ID_RUN)
 # NAME_WE cannot be used since then this test will fail for names lile
 # "arm-unknown-nto-qnx6.3.0-gcc.exe", where BASENAME would be
 # "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-"
-IF (CMAKE_CROSSCOMPILING
+if (CMAKE_CROSSCOMPILING
     AND "${CMAKE_C_COMPILER_ID}" MATCHES "GNU"
     AND NOT _CMAKE_TOOLCHAIN_PREFIX)
-  GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME)
-  IF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
-    SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
-  ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
+  get_filename_component(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME)
+  if (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
+    set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
+  endif (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
 
   # if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils
   # but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.)
-  IF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
-    SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
-  ENDIF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
+  if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
+    set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
+  endif ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
 
-ENDIF (CMAKE_CROSSCOMPILING
+endif (CMAKE_CROSSCOMPILING
     AND "${CMAKE_C_COMPILER_ID}" MATCHES "GNU"
     AND NOT _CMAKE_TOOLCHAIN_PREFIX)
 
-INCLUDE(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake)
-INCLUDE(CMakeFindBinUtils)
-IF(MSVC_C_ARCHITECTURE_ID)
-  SET(SET_MSVC_C_ARCHITECTURE_ID
-    "SET(MSVC_C_ARCHITECTURE_ID ${MSVC_C_ARCHITECTURE_ID})")
-ENDIF(MSVC_C_ARCHITECTURE_ID)
+include(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake)
+include(CMakeFindBinUtils)
+if(MSVC_C_ARCHITECTURE_ID)
+  set(SET_MSVC_C_ARCHITECTURE_ID
+    "set(MSVC_C_ARCHITECTURE_ID ${MSVC_C_ARCHITECTURE_ID})")
+endif(MSVC_C_ARCHITECTURE_ID)
 # configure variables set in this file for fast reload later on
-CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
+configure_file(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
   "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCCompiler.cmake"
   @ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
   )
-SET(CMAKE_C_COMPILER_ENV_VAR "CC")
+set(CMAKE_C_COMPILER_ENV_VAR "CC")
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index 0116d341a..aaabb201c 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -30,42 +30,42 @@
 # If not already set before, it also sets
 #   _CMAKE_TOOLCHAIN_PREFIX
 
-INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
+include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
 
 # Load system-specific compiler preferences for this language.
-INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-CXX OPTIONAL)
-IF(NOT CMAKE_CXX_COMPILER_NAMES)
-  SET(CMAKE_CXX_COMPILER_NAMES CC)
-ENDIF()
+include(Platform/${CMAKE_SYSTEM_NAME}-CXX OPTIONAL)
+if(NOT CMAKE_CXX_COMPILER_NAMES)
+  set(CMAKE_CXX_COMPILER_NAMES CC)
+endif()
 
-IF(NOT CMAKE_CXX_COMPILER)
-  SET(CMAKE_CXX_COMPILER_INIT NOTFOUND)
+if(NOT CMAKE_CXX_COMPILER)
+  set(CMAKE_CXX_COMPILER_INIT NOTFOUND)
 
   # prefer the environment variable CXX
-  IF($ENV{CXX} MATCHES ".+")
-    GET_FILENAME_COMPONENT(CMAKE_CXX_COMPILER_INIT $ENV{CXX} PROGRAM PROGRAM_ARGS CMAKE_CXX_FLAGS_ENV_INIT)
-    IF(CMAKE_CXX_FLAGS_ENV_INIT)
-      SET(CMAKE_CXX_COMPILER_ARG1 "${CMAKE_CXX_FLAGS_ENV_INIT}" CACHE STRING "First argument to CXX compiler")
-    ENDIF(CMAKE_CXX_FLAGS_ENV_INIT)
-    IF(NOT EXISTS ${CMAKE_CXX_COMPILER_INIT})
-      MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable CXX:\n$ENV{CXX}.\n${CMAKE_CXX_COMPILER_INIT}")
-    ENDIF(NOT EXISTS ${CMAKE_CXX_COMPILER_INIT})
-  ENDIF($ENV{CXX} MATCHES ".+")
+  if($ENV{CXX} MATCHES ".+")
+    get_filename_component(CMAKE_CXX_COMPILER_INIT $ENV{CXX} PROGRAM PROGRAM_ARGS CMAKE_CXX_FLAGS_ENV_INIT)
+    if(CMAKE_CXX_FLAGS_ENV_INIT)
+      set(CMAKE_CXX_COMPILER_ARG1 "${CMAKE_CXX_FLAGS_ENV_INIT}" CACHE STRING "First argument to CXX compiler")
+    endif(CMAKE_CXX_FLAGS_ENV_INIT)
+    if(NOT EXISTS ${CMAKE_CXX_COMPILER_INIT})
+      message(FATAL_ERROR "Could not find compiler set in environment variable CXX:\n$ENV{CXX}.\n${CMAKE_CXX_COMPILER_INIT}")
+    endif(NOT EXISTS ${CMAKE_CXX_COMPILER_INIT})
+  endif($ENV{CXX} MATCHES ".+")
 
   # next prefer the generator specified compiler
-  IF(CMAKE_GENERATOR_CXX)
-    IF(NOT CMAKE_CXX_COMPILER_INIT)
-      SET(CMAKE_CXX_COMPILER_INIT ${CMAKE_GENERATOR_CXX})
-    ENDIF(NOT CMAKE_CXX_COMPILER_INIT)
-  ENDIF(CMAKE_GENERATOR_CXX)
+  if(CMAKE_GENERATOR_CXX)
+    if(NOT CMAKE_CXX_COMPILER_INIT)
+      set(CMAKE_CXX_COMPILER_INIT ${CMAKE_GENERATOR_CXX})
+    endif(NOT CMAKE_CXX_COMPILER_INIT)
+  endif(CMAKE_GENERATOR_CXX)
 
   # finally list compilers to try
-  IF(NOT CMAKE_CXX_COMPILER_INIT)
-    SET(CMAKE_CXX_COMPILER_LIST CC ${_CMAKE_TOOLCHAIN_PREFIX}c++ ${_CMAKE_TOOLCHAIN_PREFIX}g++ aCC cl bcc xlC clang++)
-  ENDIF()
+  if(NOT CMAKE_CXX_COMPILER_INIT)
+    set(CMAKE_CXX_COMPILER_LIST CC ${_CMAKE_TOOLCHAIN_PREFIX}c++ ${_CMAKE_TOOLCHAIN_PREFIX}g++ aCC cl bcc xlC clang++)
+  endif()
 
   _cmake_find_compiler(CXX)
-ELSE(NOT CMAKE_CXX_COMPILER)
+else(NOT CMAKE_CXX_COMPILER)
 
 # we only get here if CMAKE_CXX_COMPILER was specified using -D or a pre-made CMakeCache.txt
 # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
@@ -73,31 +73,31 @@ ELSE(NOT CMAKE_CXX_COMPILER)
 # if CMAKE_CXX_COMPILER is a list of length 2, use the first item as
 # CMAKE_CXX_COMPILER and the 2nd one as CMAKE_CXX_COMPILER_ARG1
 
-  LIST(LENGTH CMAKE_CXX_COMPILER _CMAKE_CXX_COMPILER_LIST_LENGTH)
-  IF("${_CMAKE_CXX_COMPILER_LIST_LENGTH}" EQUAL 2)
-    LIST(GET CMAKE_CXX_COMPILER 1 CMAKE_CXX_COMPILER_ARG1)
-    LIST(GET CMAKE_CXX_COMPILER 0 CMAKE_CXX_COMPILER)
-  ENDIF("${_CMAKE_CXX_COMPILER_LIST_LENGTH}" EQUAL 2)
+  list(LENGTH CMAKE_CXX_COMPILER _CMAKE_CXX_COMPILER_LIST_LENGTH)
+  if("${_CMAKE_CXX_COMPILER_LIST_LENGTH}" EQUAL 2)
+    list(GET CMAKE_CXX_COMPILER 1 CMAKE_CXX_COMPILER_ARG1)
+    list(GET CMAKE_CXX_COMPILER 0 CMAKE_CXX_COMPILER)
+  endif("${_CMAKE_CXX_COMPILER_LIST_LENGTH}" EQUAL 2)
 
 # if a compiler was specified by the user but without path,
 # now try to find it with the full path
 # if it is found, force it into the cache,
 # if not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
 # if the CXX compiler already had a path, reuse it for searching the C compiler
-  GET_FILENAME_COMPONENT(_CMAKE_USER_CXX_COMPILER_PATH "${CMAKE_CXX_COMPILER}" PATH)
-  IF(NOT _CMAKE_USER_CXX_COMPILER_PATH)
-    FIND_PROGRAM(CMAKE_CXX_COMPILER_WITH_PATH NAMES ${CMAKE_CXX_COMPILER})
-    MARK_AS_ADVANCED(CMAKE_CXX_COMPILER_WITH_PATH)
-    IF(CMAKE_CXX_COMPILER_WITH_PATH)
-      SET(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER_WITH_PATH} CACHE STRING "CXX compiler" FORCE)
-    ENDIF(CMAKE_CXX_COMPILER_WITH_PATH)
-  ENDIF(NOT _CMAKE_USER_CXX_COMPILER_PATH)
-ENDIF(NOT CMAKE_CXX_COMPILER)
-MARK_AS_ADVANCED(CMAKE_CXX_COMPILER)
+  get_filename_component(_CMAKE_USER_CXX_COMPILER_PATH "${CMAKE_CXX_COMPILER}" PATH)
+  if(NOT _CMAKE_USER_CXX_COMPILER_PATH)
+    find_program(CMAKE_CXX_COMPILER_WITH_PATH NAMES ${CMAKE_CXX_COMPILER})
+    mark_as_advanced(CMAKE_CXX_COMPILER_WITH_PATH)
+    if(CMAKE_CXX_COMPILER_WITH_PATH)
+      set(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER_WITH_PATH} CACHE STRING "CXX compiler" FORCE)
+    endif(CMAKE_CXX_COMPILER_WITH_PATH)
+  endif(NOT _CMAKE_USER_CXX_COMPILER_PATH)
+endif(NOT CMAKE_CXX_COMPILER)
+mark_as_advanced(CMAKE_CXX_COMPILER)
 
-IF (NOT _CMAKE_TOOLCHAIN_LOCATION)
-  GET_FILENAME_COMPONENT(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_CXX_COMPILER}" PATH)
-ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
+if (NOT _CMAKE_TOOLCHAIN_LOCATION)
+  get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_CXX_COMPILER}" PATH)
+endif (NOT _CMAKE_TOOLCHAIN_LOCATION)
 
 # This block was used before the compiler was identified by building a
 # source file.  Unless g++ crashes when building a small C++
@@ -106,45 +106,45 @@ ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
 # The g++ that comes with BeOS 5 segfaults if you run "g++ -E"
 #  ("gcc -E" is fine), which throws up a system dialog box that hangs cmake
 #  until the user clicks "OK"...so for now, we just assume it's g++.
-# IF(BEOS)
-#   SET(CMAKE_COMPILER_IS_GNUCXX 1)
-#   SET(CMAKE_COMPILER_IS_GNUCXX_RUN 1)
-# ENDIF(BEOS)
+# if(BEOS)
+#   set(CMAKE_COMPILER_IS_GNUCXX 1)
+#   set(CMAKE_COMPILER_IS_GNUCXX_RUN 1)
+# endif(BEOS)
 
 # Build a small source file to identify the compiler.
-IF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
-  SET(CMAKE_CXX_COMPILER_ID_RUN 1)
-  SET(CMAKE_CXX_PLATFORM_ID "Windows")
-  SET(CMAKE_CXX_COMPILER_ID "MSVC")
-ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
-IF(NOT CMAKE_CXX_COMPILER_ID_RUN)
-  SET(CMAKE_CXX_COMPILER_ID_RUN 1)
+if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
+  set(CMAKE_CXX_COMPILER_ID_RUN 1)
+  set(CMAKE_CXX_PLATFORM_ID "Windows")
+  set(CMAKE_CXX_COMPILER_ID "MSVC")
+endif(${CMAKE_GENERATOR} MATCHES "Visual Studio")
+if(NOT CMAKE_CXX_COMPILER_ID_RUN)
+  set(CMAKE_CXX_COMPILER_ID_RUN 1)
 
   # Each entry in this list is a set of extra flags to try
   # adding to the compile line to see if it helps produce
   # a valid identification file.
-  SET(CMAKE_CXX_COMPILER_ID_TEST_FLAGS
+  set(CMAKE_CXX_COMPILER_ID_TEST_FLAGS
     # Try compiling to an object file only.
     "-c"
     )
 
   # Try to identify the compiler.
-  SET(CMAKE_CXX_COMPILER_ID)
-  FILE(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in
+  set(CMAKE_CXX_COMPILER_ID)
+  file(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in
     CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT)
-  INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
+  include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
   CMAKE_DETERMINE_COMPILER_ID(CXX CXXFLAGS CMakeCXXCompilerId.cpp)
 
   # Set old compiler and platform id variables.
-  IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
-    SET(CMAKE_COMPILER_IS_GNUCXX 1)
-  ENDIF("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
-  IF("${CMAKE_CXX_PLATFORM_ID}" MATCHES "MinGW")
-    SET(CMAKE_COMPILER_IS_MINGW 1)
-  ELSEIF("${CMAKE_CXX_PLATFORM_ID}" MATCHES "Cygwin")
-    SET(CMAKE_COMPILER_IS_CYGWIN 1)
-  ENDIF("${CMAKE_CXX_PLATFORM_ID}" MATCHES "MinGW")
-ENDIF(NOT CMAKE_CXX_COMPILER_ID_RUN)
+  if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
+    set(CMAKE_COMPILER_IS_GNUCXX 1)
+  endif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
+  if("${CMAKE_CXX_PLATFORM_ID}" MATCHES "MinGW")
+    set(CMAKE_COMPILER_IS_MINGW 1)
+  elseif("${CMAKE_CXX_PLATFORM_ID}" MATCHES "Cygwin")
+    set(CMAKE_COMPILER_IS_CYGWIN 1)
+  endif("${CMAKE_CXX_PLATFORM_ID}" MATCHES "MinGW")
+endif(NOT CMAKE_CXX_COMPILER_ID_RUN)
 
 # if we have a g++ cross compiler, they have usually some prefix, like
 # e.g. powerpc-linux-g++, arm-elf-g++ or i586-mingw32msvc-g++ , optionally
@@ -153,34 +153,34 @@ ENDIF(NOT CMAKE_CXX_COMPILER_ID_RUN)
 # NAME_WE cannot be used since then this test will fail for names lile
 # "arm-unknown-nto-qnx6.3.0-gcc.exe", where BASENAME would be
 # "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-"
-IF (CMAKE_CROSSCOMPILING
+if (CMAKE_CROSSCOMPILING
     AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU"
     AND NOT _CMAKE_TOOLCHAIN_PREFIX)
-  GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME)
-  IF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
-    SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
-  ENDIF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
+  get_filename_component(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME)
+  if (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
+    set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
+  endif (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
 
   # if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils
   # but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.)
-  IF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
-    SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
-  ENDIF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
+  if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
+    set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
+  endif ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
 
-ENDIF (CMAKE_CROSSCOMPILING
+endif (CMAKE_CROSSCOMPILING
     AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU"
     AND NOT _CMAKE_TOOLCHAIN_PREFIX)
 
-INCLUDE(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake)
-INCLUDE(CMakeFindBinUtils)
-IF(MSVC_CXX_ARCHITECTURE_ID)
-  SET(SET_MSVC_CXX_ARCHITECTURE_ID
-    "SET(MSVC_CXX_ARCHITECTURE_ID ${MSVC_CXX_ARCHITECTURE_ID})")
-ENDIF(MSVC_CXX_ARCHITECTURE_ID)
+include(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake)
+include(CMakeFindBinUtils)
+if(MSVC_CXX_ARCHITECTURE_ID)
+  set(SET_MSVC_CXX_ARCHITECTURE_ID
+    "set(MSVC_CXX_ARCHITECTURE_ID ${MSVC_CXX_ARCHITECTURE_ID})")
+endif(MSVC_CXX_ARCHITECTURE_ID)
 # configure all variables set in this file
-CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in
+configure_file(${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in
   ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake
   @ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
   )
 
-SET(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
+set(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake
index 1c9899e64..b79afdf54 100644
--- a/Modules/CMakeDetermineCompilerABI.cmake
+++ b/Modules/CMakeDetermineCompilerABI.cmake
@@ -16,19 +16,19 @@
 # This is used internally by CMake and should not be included by user
 # code.
 
-INCLUDE(${CMAKE_ROOT}/Modules/CMakeParseImplicitLinkInfo.cmake)
+include(${CMAKE_ROOT}/Modules/CMakeParseImplicitLinkInfo.cmake)
 
-FUNCTION(CMAKE_DETERMINE_COMPILER_ABI lang src)
-  IF(NOT DEFINED CMAKE_DETERMINE_${lang}_ABI_COMPILED)
-    MESSAGE(STATUS "Detecting ${lang} compiler ABI info")
+function(CMAKE_DETERMINE_COMPILER_ABI lang src)
+  if(NOT DEFINED CMAKE_DETERMINE_${lang}_ABI_COMPILED)
+    message(STATUS "Detecting ${lang} compiler ABI info")
 
     # Compile the ABI identification source.
-    SET(BIN "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeDetermineCompilerABI_${lang}.bin")
-    SET(CMAKE_FLAGS )
-    IF(DEFINED CMAKE_${lang}_VERBOSE_FLAG)
-      SET(CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_${lang}_VERBOSE_FLAG}")
-    ENDIF()
-    TRY_COMPILE(CMAKE_DETERMINE_${lang}_ABI_COMPILED
+    set(BIN "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeDetermineCompilerABI_${lang}.bin")
+    set(CMAKE_FLAGS )
+    if(DEFINED CMAKE_${lang}_VERBOSE_FLAG)
+      set(CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_${lang}_VERBOSE_FLAG}")
+    endif()
+    try_compile(CMAKE_DETERMINE_${lang}_ABI_COMPILED
       ${CMAKE_BINARY_DIR} ${src}
       CMAKE_FLAGS "${CMAKE_FLAGS}"
                   "-DCMAKE_${lang}_STANDARD_LIBRARIES="
@@ -41,40 +41,40 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ABI lang src)
       )
 
     # Load the resulting information strings.
-    IF(CMAKE_DETERMINE_${lang}_ABI_COMPILED)
-      MESSAGE(STATUS "Detecting ${lang} compiler ABI info - done")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    if(CMAKE_DETERMINE_${lang}_ABI_COMPILED)
+      message(STATUS "Detecting ${lang} compiler ABI info - done")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Detecting ${lang} compiler ABI info compiled with the following output:\n${OUTPUT}\n\n")
-      FILE(STRINGS "${BIN}" ABI_STRINGS LIMIT_COUNT 2 REGEX "INFO:[^[]*\\[")
-      FOREACH(info ${ABI_STRINGS})
-        IF("${info}" MATCHES ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*")
-          STRING(REGEX REPLACE ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*" "\\1" ABI_SIZEOF_DPTR "${info}")
-        ENDIF("${info}" MATCHES ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*")
-        IF("${info}" MATCHES ".*INFO:abi\\[([^]]*)\\].*")
-          STRING(REGEX REPLACE ".*INFO:abi\\[([^]]*)\\].*" "\\1" ABI_NAME "${info}")
-        ENDIF("${info}" MATCHES ".*INFO:abi\\[([^]]*)\\].*")
-      ENDFOREACH(info)
+      file(STRINGS "${BIN}" ABI_STRINGS LIMIT_COUNT 2 REGEX "INFO:[^[]*\\[")
+      foreach(info ${ABI_STRINGS})
+        if("${info}" MATCHES ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*")
+          string(REGEX REPLACE ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*" "\\1" ABI_SIZEOF_DPTR "${info}")
+        endif("${info}" MATCHES ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*")
+        if("${info}" MATCHES ".*INFO:abi\\[([^]]*)\\].*")
+          string(REGEX REPLACE ".*INFO:abi\\[([^]]*)\\].*" "\\1" ABI_NAME "${info}")
+        endif("${info}" MATCHES ".*INFO:abi\\[([^]]*)\\].*")
+      endforeach(info)
 
-      IF(ABI_SIZEOF_DPTR)
-        SET(CMAKE_${lang}_SIZEOF_DATA_PTR "${ABI_SIZEOF_DPTR}" PARENT_SCOPE)
-      ELSEIF(CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT)
-        SET(CMAKE_${lang}_SIZEOF_DATA_PTR "${CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT}" PARENT_SCOPE)
-      ENDIF(ABI_SIZEOF_DPTR)
+      if(ABI_SIZEOF_DPTR)
+        set(CMAKE_${lang}_SIZEOF_DATA_PTR "${ABI_SIZEOF_DPTR}" PARENT_SCOPE)
+      elseif(CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT)
+        set(CMAKE_${lang}_SIZEOF_DATA_PTR "${CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT}" PARENT_SCOPE)
+      endif(ABI_SIZEOF_DPTR)
 
-      IF(ABI_NAME)
-        SET(CMAKE_${lang}_COMPILER_ABI "${ABI_NAME}" PARENT_SCOPE)
-      ENDIF(ABI_NAME)
+      if(ABI_NAME)
+        set(CMAKE_${lang}_COMPILER_ABI "${ABI_NAME}" PARENT_SCOPE)
+      endif(ABI_NAME)
 
       # Parse implicit linker information for this language, if available.
-      SET(implicit_dirs "")
-      SET(implicit_libs "")
-      SET(MULTI_ARCH FALSE)
-      IF(DEFINED CMAKE_OSX_ARCHITECTURES)
-        IF( "${CMAKE_OSX_ARCHITECTURES}" MATCHES ";" )
-          SET(MULTI_ARCH TRUE)
-        ENDIF()
-      ENDIF()
-      IF(CMAKE_${lang}_VERBOSE_FLAG
+      set(implicit_dirs "")
+      set(implicit_libs "")
+      set(MULTI_ARCH FALSE)
+      if(DEFINED CMAKE_OSX_ARCHITECTURES)
+        if( "${CMAKE_OSX_ARCHITECTURES}" MATCHES ";" )
+          set(MULTI_ARCH TRUE)
+        endif()
+      endif()
+      if(CMAKE_${lang}_VERBOSE_FLAG
           # Implicit link information cannot be used explicitly for
           # multiple OS X architectures, so we skip it.
           AND NOT MULTI_ARCH
@@ -82,50 +82,50 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ABI lang src)
           AND NOT "${CMAKE_GENERATOR}" MATCHES Xcode)
         CMAKE_PARSE_IMPLICIT_LINK_INFO("${OUTPUT}" implicit_libs implicit_dirs log
           "${CMAKE_${lang}_IMPLICIT_OBJECT_REGEX}")
-        FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+        file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
           "Parsed ${lang} implicit link information from above output:\n${log}\n\n")
-      ENDIF()
+      endif()
       # for VS IDE Intel Fortran we have to figure out the
       # implicit link path for the fortran run time using
       # a try-compile
-      IF("${lang}" MATCHES "Fortran"
+      if("${lang}" MATCHES "Fortran"
           AND "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
-        SET(_desc "Determine Intel Fortran Compiler Implicit Link Path")
-        MESSAGE(STATUS "${_desc}")
+        set(_desc "Determine Intel Fortran Compiler Implicit Link Path")
+        message(STATUS "${_desc}")
         # Build a sample project which reports symbols.
-        TRY_COMPILE(IFORT_LIB_PATH_COMPILED
+        try_compile(IFORT_LIB_PATH_COMPILED
           ${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath
           ${CMAKE_ROOT}/Modules/IntelVSImplicitPath
           IntelFortranImplicit
           CMAKE_FLAGS
           "-DCMAKE_Fortran_FLAGS:STRING=${CMAKE_Fortran_FLAGS}"
           OUTPUT_VARIABLE _output)
-        FILE(WRITE
+        file(WRITE
           "${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath/output.txt"
           "${_output}")
-        INCLUDE(${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath/output.cmake OPTIONAL)
-        SET(_desc "Determine Intel Fortran Compiler Implicit Link Path -- done")
-        MESSAGE(STATUS "${_desc}")
-      ENDIF()
+        include(${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath/output.cmake OPTIONAL)
+        set(_desc "Determine Intel Fortran Compiler Implicit Link Path -- done")
+        message(STATUS "${_desc}")
+      endif()
 
-      SET(CMAKE_${lang}_IMPLICIT_LINK_LIBRARIES "${implicit_libs}" PARENT_SCOPE)
-      SET(CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES "${implicit_dirs}" PARENT_SCOPE)
+      set(CMAKE_${lang}_IMPLICIT_LINK_LIBRARIES "${implicit_libs}" PARENT_SCOPE)
+      set(CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES "${implicit_dirs}" PARENT_SCOPE)
 
       # Detect library architecture directory name.
-      IF(CMAKE_LIBRARY_ARCHITECTURE_REGEX)
-        FOREACH(dir ${implicit_dirs})
-          IF("${dir}" MATCHES "/lib/${CMAKE_LIBRARY_ARCHITECTURE_REGEX}$")
-            GET_FILENAME_COMPONENT(arch "${dir}" NAME)
-            SET(CMAKE_${lang}_LIBRARY_ARCHITECTURE "${arch}" PARENT_SCOPE)
-            BREAK()
-          ENDIF()
-        ENDFOREACH()
-      ENDIF()
+      if(CMAKE_LIBRARY_ARCHITECTURE_REGEX)
+        foreach(dir ${implicit_dirs})
+          if("${dir}" MATCHES "/lib/${CMAKE_LIBRARY_ARCHITECTURE_REGEX}$")
+            get_filename_component(arch "${dir}" NAME)
+            set(CMAKE_${lang}_LIBRARY_ARCHITECTURE "${arch}" PARENT_SCOPE)
+            break()
+          endif()
+        endforeach()
+      endif()
 
-    ELSE(CMAKE_DETERMINE_${lang}_ABI_COMPILED)
-      MESSAGE(STATUS "Detecting ${lang} compiler ABI info - failed")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+    else(CMAKE_DETERMINE_${lang}_ABI_COMPILED)
+      message(STATUS "Detecting ${lang} compiler ABI info - failed")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Detecting ${lang} compiler ABI info failed to compile with the following output:\n${OUTPUT}\n\n")
-    ENDIF(CMAKE_DETERMINE_${lang}_ABI_COMPILED)
-  ENDIF(NOT DEFINED CMAKE_DETERMINE_${lang}_ABI_COMPILED)
-ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ABI)
+    endif(CMAKE_DETERMINE_${lang}_ABI_COMPILED)
+  endif(NOT DEFINED CMAKE_DETERMINE_${lang}_ABI_COMPILED)
+endfunction(CMAKE_DETERMINE_COMPILER_ABI)
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 67f5a5906..6fd0add59 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -16,90 +16,90 @@
 # used internally by CMake and should not be included by user code.
 # If successful, sets CMAKE_<lang>_COMPILER_ID and CMAKE_<lang>_PLATFORM_ID
 
-FUNCTION(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
+function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
   # Make sure the compiler arguments are clean.
-  STRING(STRIP "${CMAKE_${lang}_COMPILER_ARG1}" CMAKE_${lang}_COMPILER_ID_ARG1)
-  STRING(REGEX REPLACE " +" ";" CMAKE_${lang}_COMPILER_ID_ARG1 "${CMAKE_${lang}_COMPILER_ID_ARG1}")
+  string(STRIP "${CMAKE_${lang}_COMPILER_ARG1}" CMAKE_${lang}_COMPILER_ID_ARG1)
+  string(REGEX REPLACE " +" ";" CMAKE_${lang}_COMPILER_ID_ARG1 "${CMAKE_${lang}_COMPILER_ID_ARG1}")
 
   # Make sure user-specified compiler flags are used.
-  IF(CMAKE_${lang}_FLAGS)
-    SET(CMAKE_${lang}_COMPILER_ID_FLAGS ${CMAKE_${lang}_FLAGS})
-  ELSE(CMAKE_${lang}_FLAGS)
-    SET(CMAKE_${lang}_COMPILER_ID_FLAGS $ENV{${flagvar}})
-  ENDIF(CMAKE_${lang}_FLAGS)
-  STRING(REGEX REPLACE " " ";" CMAKE_${lang}_COMPILER_ID_FLAGS_LIST "${CMAKE_${lang}_COMPILER_ID_FLAGS}")
+  if(CMAKE_${lang}_FLAGS)
+    set(CMAKE_${lang}_COMPILER_ID_FLAGS ${CMAKE_${lang}_FLAGS})
+  else(CMAKE_${lang}_FLAGS)
+    set(CMAKE_${lang}_COMPILER_ID_FLAGS $ENV{${flagvar}})
+  endif(CMAKE_${lang}_FLAGS)
+  string(REGEX REPLACE " " ";" CMAKE_${lang}_COMPILER_ID_FLAGS_LIST "${CMAKE_${lang}_COMPILER_ID_FLAGS}")
 
   # Compute the directory in which to run the test.
-  SET(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CompilerId${lang})
+  set(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CompilerId${lang})
 
   # Try building with no extra flags and then try each set
   # of helper flags.  Stop when the compiler is identified.
-  FOREACH(flags "" ${CMAKE_${lang}_COMPILER_ID_TEST_FLAGS})
-    IF(NOT CMAKE_${lang}_COMPILER_ID)
+  foreach(flags "" ${CMAKE_${lang}_COMPILER_ID_TEST_FLAGS})
+    if(NOT CMAKE_${lang}_COMPILER_ID)
       CMAKE_DETERMINE_COMPILER_ID_BUILD("${lang}" "${flags}" "${src}")
-      FOREACH(file ${COMPILER_${lang}_PRODUCED_FILES})
+      foreach(file ${COMPILER_${lang}_PRODUCED_FILES})
         CMAKE_DETERMINE_COMPILER_ID_CHECK("${lang}" "${CMAKE_${lang}_COMPILER_ID_DIR}/${file}" "${src}")
-      ENDFOREACH(file)
-    ENDIF(NOT CMAKE_${lang}_COMPILER_ID)
-  ENDFOREACH(flags)
+      endforeach(file)
+    endif(NOT CMAKE_${lang}_COMPILER_ID)
+  endforeach(flags)
 
   # If the compiler is still unknown, try to query its vendor.
-  IF(NOT CMAKE_${lang}_COMPILER_ID)
+  if(NOT CMAKE_${lang}_COMPILER_ID)
     CMAKE_DETERMINE_COMPILER_ID_VENDOR(${lang})
-  ENDIF()
+  endif()
 
   # if the format is unknown after all files have been checked, put "Unknown" in the cache
-  IF(NOT CMAKE_EXECUTABLE_FORMAT)
-    SET(CMAKE_EXECUTABLE_FORMAT "Unknown" CACHE INTERNAL "Executable file format")
-  ENDIF(NOT CMAKE_EXECUTABLE_FORMAT)
+  if(NOT CMAKE_EXECUTABLE_FORMAT)
+    set(CMAKE_EXECUTABLE_FORMAT "Unknown" CACHE INTERNAL "Executable file format")
+  endif(NOT CMAKE_EXECUTABLE_FORMAT)
 
   # Display the final identification result.
-  IF(CMAKE_${lang}_COMPILER_ID)
-    IF(CMAKE_${lang}_COMPILER_VERSION)
-      SET(_version " ${CMAKE_${lang}_COMPILER_VERSION}")
-    ELSE()
-      SET(_version "")
-    ENDIF()
-    MESSAGE(STATUS "The ${lang} compiler identification is "
+  if(CMAKE_${lang}_COMPILER_ID)
+    if(CMAKE_${lang}_COMPILER_VERSION)
+      set(_version " ${CMAKE_${lang}_COMPILER_VERSION}")
+    else()
+      set(_version "")
+    endif()
+    message(STATUS "The ${lang} compiler identification is "
       "${CMAKE_${lang}_COMPILER_ID}${_version}")
-  ELSE(CMAKE_${lang}_COMPILER_ID)
-    MESSAGE(STATUS "The ${lang} compiler identification is unknown")
-  ENDIF(CMAKE_${lang}_COMPILER_ID)
+  else(CMAKE_${lang}_COMPILER_ID)
+    message(STATUS "The ${lang} compiler identification is unknown")
+  endif(CMAKE_${lang}_COMPILER_ID)
 
-  SET(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE)
-  SET(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
-  SET(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
+  set(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE)
+  set(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
+  set(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
     PARENT_SCOPE)
-  SET(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
-ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID)
+  set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
+endfunction(CMAKE_DETERMINE_COMPILER_ID)
 
 #-----------------------------------------------------------------------------
 # Function to write the compiler id source file.
-FUNCTION(CMAKE_DETERMINE_COMPILER_ID_WRITE lang src)
-  FILE(READ ${CMAKE_ROOT}/Modules/${src}.in ID_CONTENT_IN)
-  STRING(CONFIGURE "${ID_CONTENT_IN}" ID_CONTENT_OUT @ONLY)
-  FILE(WRITE ${CMAKE_${lang}_COMPILER_ID_DIR}/${src} "${ID_CONTENT_OUT}")
-ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_WRITE)
+function(CMAKE_DETERMINE_COMPILER_ID_WRITE lang src)
+  file(READ ${CMAKE_ROOT}/Modules/${src}.in ID_CONTENT_IN)
+  string(CONFIGURE "${ID_CONTENT_IN}" ID_CONTENT_OUT @ONLY)
+  file(WRITE ${CMAKE_${lang}_COMPILER_ID_DIR}/${src} "${ID_CONTENT_OUT}")
+endfunction(CMAKE_DETERMINE_COMPILER_ID_WRITE)
 
 #-----------------------------------------------------------------------------
 # Function to build the compiler id source file and look for output
 # files.
-FUNCTION(CMAKE_DETERMINE_COMPILER_ID_BUILD lang testflags src)
+function(CMAKE_DETERMINE_COMPILER_ID_BUILD lang testflags src)
   # Create a clean working directory.
-  FILE(REMOVE_RECURSE ${CMAKE_${lang}_COMPILER_ID_DIR})
-  FILE(MAKE_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR})
+  file(REMOVE_RECURSE ${CMAKE_${lang}_COMPILER_ID_DIR})
+  file(MAKE_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR})
   CMAKE_DETERMINE_COMPILER_ID_WRITE("${lang}" "${src}")
 
   # Construct a description of this test case.
-  SET(COMPILER_DESCRIPTION
+  set(COMPILER_DESCRIPTION
     "Compiler: ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_COMPILER_ID_ARG1}
 Build flags: ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
 Id flags: ${testflags}
 ")
 
   # Compile the compiler identification source.
-  IF(COMMAND EXECUTE_PROCESS)
-    EXECUTE_PROCESS(
+  if(COMMAND EXECUTE_PROCESS)
+    execute_process(
       COMMAND ${CMAKE_${lang}_COMPILER}
               ${CMAKE_${lang}_COMPILER_ID_ARG1}
               ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
@@ -110,8 +110,8 @@ Id flags: ${testflags}
       ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
       RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT
       )
-  ELSE(COMMAND EXECUTE_PROCESS)
-    EXEC_PROGRAM(
+  else(COMMAND EXECUTE_PROCESS)
+    exec_program(
       ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_COMPILER_ID_DIR}
       ARGS ${CMAKE_${lang}_COMPILER_ID_ARG1}
            ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
@@ -120,12 +120,12 @@ Id flags: ${testflags}
       OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
       RETURN_VALUE CMAKE_${lang}_COMPILER_ID_RESULT
       )
-  ENDIF(COMMAND EXECUTE_PROCESS)
+  endif(COMMAND EXECUTE_PROCESS)
 
   # Check the result of compilation.
-  IF(CMAKE_${lang}_COMPILER_ID_RESULT)
+  if(CMAKE_${lang}_COMPILER_ID_RESULT)
     # Compilation failed.
-    SET(MSG
+    set(MSG
       "Compiling the ${lang} compiler identification source file \"${src}\" failed.
 ${COMPILER_DESCRIPTION}
 The output was:
@@ -133,16 +133,16 @@ ${CMAKE_${lang}_COMPILER_ID_RESULT}
 ${CMAKE_${lang}_COMPILER_ID_OUTPUT}
 
 ")
-    FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "${MSG}")
-    #IF(NOT CMAKE_${lang}_COMPILER_ID_ALLOW_FAIL)
-    #  MESSAGE(FATAL_ERROR "${MSG}")
-    #ENDIF(NOT CMAKE_${lang}_COMPILER_ID_ALLOW_FAIL)
+    file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "${MSG}")
+    #if(NOT CMAKE_${lang}_COMPILER_ID_ALLOW_FAIL)
+    #  message(FATAL_ERROR "${MSG}")
+    #endif(NOT CMAKE_${lang}_COMPILER_ID_ALLOW_FAIL)
 
     # No output files should be inspected.
-    SET(COMPILER_${lang}_PRODUCED_FILES)
-  ELSE(CMAKE_${lang}_COMPILER_ID_RESULT)
+    set(COMPILER_${lang}_PRODUCED_FILES)
+  else(CMAKE_${lang}_COMPILER_ID_RESULT)
     # Compilation succeeded.
-    FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Compiling the ${lang} compiler identification source file \"${src}\" succeeded.
 ${COMPILER_DESCRIPTION}
 The output was:
@@ -153,120 +153,120 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT}
 
     # Find the executable produced by the compiler, try all files in the
     # binary dir.
-    FILE(GLOB COMPILER_${lang}_PRODUCED_FILES
+    file(GLOB COMPILER_${lang}_PRODUCED_FILES
       RELATIVE ${CMAKE_${lang}_COMPILER_ID_DIR}
       ${CMAKE_${lang}_COMPILER_ID_DIR}/*)
-    LIST(REMOVE_ITEM COMPILER_${lang}_PRODUCED_FILES "${src}")
-    FOREACH(file ${COMPILER_${lang}_PRODUCED_FILES})
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    list(REMOVE_ITEM COMPILER_${lang}_PRODUCED_FILES "${src}")
+    foreach(file ${COMPILER_${lang}_PRODUCED_FILES})
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Compilation of the ${lang} compiler identification source \""
         "${src}\" produced \"${file}\"\n\n")
-    ENDFOREACH(file)
+    endforeach(file)
 
-    IF(NOT COMPILER_${lang}_PRODUCED_FILES)
+    if(NOT COMPILER_${lang}_PRODUCED_FILES)
       # No executable was found.
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Compilation of the ${lang} compiler identification source \""
         "${src}\" did not produce an executable in \""
         "${CMAKE_${lang}_COMPILER_ID_DIR}\".\n\n")
-    ENDIF(NOT COMPILER_${lang}_PRODUCED_FILES)
-  ENDIF(CMAKE_${lang}_COMPILER_ID_RESULT)
+    endif(NOT COMPILER_${lang}_PRODUCED_FILES)
+  endif(CMAKE_${lang}_COMPILER_ID_RESULT)
 
   # Return the files produced by the compilation.
-  SET(COMPILER_${lang}_PRODUCED_FILES "${COMPILER_${lang}_PRODUCED_FILES}" PARENT_SCOPE)
-ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_BUILD lang testflags src)
+  set(COMPILER_${lang}_PRODUCED_FILES "${COMPILER_${lang}_PRODUCED_FILES}" PARENT_SCOPE)
+endfunction(CMAKE_DETERMINE_COMPILER_ID_BUILD lang testflags src)
 
 #-----------------------------------------------------------------------------
 # Function to extract the compiler id from an executable.
-FUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
+function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
   # Look for a compiler id if not yet known.
-  IF(NOT CMAKE_${lang}_COMPILER_ID)
+  if(NOT CMAKE_${lang}_COMPILER_ID)
     # Read the compiler identification string from the executable file.
-    SET(COMPILER_ID)
-    SET(COMPILER_VERSION)
-    SET(PLATFORM_ID)
-    FILE(STRINGS ${file}
+    set(COMPILER_ID)
+    set(COMPILER_VERSION)
+    set(PLATFORM_ID)
+    file(STRINGS ${file}
       CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 4 REGEX "INFO:")
-    SET(HAVE_COMPILER_TWICE 0)
-    FOREACH(info ${CMAKE_${lang}_COMPILER_ID_STRINGS})
-      IF("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*")
-        IF(COMPILER_ID)
-          SET(COMPILER_ID_TWICE 1)
-        ENDIF(COMPILER_ID)
-        STRING(REGEX REPLACE ".*INFO:compiler\\[([^]]*)\\].*" "\\1"
+    set(HAVE_COMPILER_TWICE 0)
+    foreach(info ${CMAKE_${lang}_COMPILER_ID_STRINGS})
+      if("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*")
+        if(COMPILER_ID)
+          set(COMPILER_ID_TWICE 1)
+        endif(COMPILER_ID)
+        string(REGEX REPLACE ".*INFO:compiler\\[([^]]*)\\].*" "\\1"
           COMPILER_ID "${info}")
-      ENDIF("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*")
-      IF("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*")
-        STRING(REGEX REPLACE ".*INFO:platform\\[([^]]*)\\].*" "\\1"
+      endif("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*")
+      if("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*")
+        string(REGEX REPLACE ".*INFO:platform\\[([^]]*)\\].*" "\\1"
           PLATFORM_ID "${info}")
-      ENDIF("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*")
-      IF("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*")
-        STRING(REGEX REPLACE ".*INFO:arch\\[([^]]*)\\].*" "\\1"
+      endif("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*")
+      if("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*")
+        string(REGEX REPLACE ".*INFO:arch\\[([^]]*)\\].*" "\\1"
           ARCHITECTURE_ID "${info}")
-      ENDIF("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*")
-      IF("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*")
-        STRING(REGEX REPLACE ".*INFO:compiler_version\\[([^]]*)\\].*" "\\1" COMPILER_VERSION "${info}")
-        STRING(REGEX REPLACE "^0+([0-9])" "\\1" COMPILER_VERSION "${COMPILER_VERSION}")
-        STRING(REGEX REPLACE "\\.0+([0-9])" ".\\1" COMPILER_VERSION "${COMPILER_VERSION}")
-      ENDIF("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*")
-    ENDFOREACH(info)
+      endif("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*")
+      if("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*")
+        string(REGEX REPLACE ".*INFO:compiler_version\\[([^]]*)\\].*" "\\1" COMPILER_VERSION "${info}")
+        string(REGEX REPLACE "^0+([0-9])" "\\1" COMPILER_VERSION "${COMPILER_VERSION}")
+        string(REGEX REPLACE "\\.0+([0-9])" ".\\1" COMPILER_VERSION "${COMPILER_VERSION}")
+      endif("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*")
+    endforeach(info)
 
     # Check if a valid compiler and platform were found.
-    IF(COMPILER_ID AND NOT COMPILER_ID_TWICE)
-      SET(CMAKE_${lang}_COMPILER_ID "${COMPILER_ID}")
-      SET(CMAKE_${lang}_PLATFORM_ID "${PLATFORM_ID}")
-      SET(MSVC_${lang}_ARCHITECTURE_ID "${ARCHITECTURE_ID}")
-      SET(CMAKE_${lang}_COMPILER_VERSION "${COMPILER_VERSION}")
-    ENDIF(COMPILER_ID AND NOT COMPILER_ID_TWICE)
+    if(COMPILER_ID AND NOT COMPILER_ID_TWICE)
+      set(CMAKE_${lang}_COMPILER_ID "${COMPILER_ID}")
+      set(CMAKE_${lang}_PLATFORM_ID "${PLATFORM_ID}")
+      set(MSVC_${lang}_ARCHITECTURE_ID "${ARCHITECTURE_ID}")
+      set(CMAKE_${lang}_COMPILER_VERSION "${COMPILER_VERSION}")
+    endif(COMPILER_ID AND NOT COMPILER_ID_TWICE)
 
     # Check the compiler identification string.
-    IF(CMAKE_${lang}_COMPILER_ID)
+    if(CMAKE_${lang}_COMPILER_ID)
       # The compiler identification was found.
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "The ${lang} compiler identification is ${CMAKE_${lang}_COMPILER_ID}, found in \""
         "${file}\"\n\n")
-    ELSE(CMAKE_${lang}_COMPILER_ID)
+    else(CMAKE_${lang}_COMPILER_ID)
       # The compiler identification could not be found.
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "The ${lang} compiler identification could not be found in \""
         "${file}\"\n\n")
-    ENDIF(CMAKE_${lang}_COMPILER_ID)
-  ENDIF(NOT CMAKE_${lang}_COMPILER_ID)
+    endif(CMAKE_${lang}_COMPILER_ID)
+  endif(NOT CMAKE_${lang}_COMPILER_ID)
 
   # try to figure out the executable format: ELF, COFF, Mach-O
-  IF(NOT CMAKE_EXECUTABLE_FORMAT)
-    FILE(READ ${file} CMAKE_EXECUTABLE_MAGIC LIMIT 4 HEX)
+  if(NOT CMAKE_EXECUTABLE_FORMAT)
+    file(READ ${file} CMAKE_EXECUTABLE_MAGIC LIMIT 4 HEX)
 
     # ELF files start with 0x7f"ELF"
-    IF("${CMAKE_EXECUTABLE_MAGIC}" STREQUAL "7f454c46")
-      SET(CMAKE_EXECUTABLE_FORMAT "ELF" CACHE INTERNAL "Executable file format")
-    ENDIF("${CMAKE_EXECUTABLE_MAGIC}" STREQUAL "7f454c46")
+    if("${CMAKE_EXECUTABLE_MAGIC}" STREQUAL "7f454c46")
+      set(CMAKE_EXECUTABLE_FORMAT "ELF" CACHE INTERNAL "Executable file format")
+    endif("${CMAKE_EXECUTABLE_MAGIC}" STREQUAL "7f454c46")
 
 #    # COFF (.exe) files start with "MZ"
-#    IF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "4d5a....")
-#      SET(CMAKE_EXECUTABLE_FORMAT "COFF" CACHE STRING "Executable file format")
-#    ENDIF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "4d5a....")
+#    if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "4d5a....")
+#      set(CMAKE_EXECUTABLE_FORMAT "COFF" CACHE STRING "Executable file format")
+#    endif("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "4d5a....")
 #
 #    # Mach-O files start with CAFEBABE or FEEDFACE, according to http://radio.weblogs.com/0100490/2003/01/28.html
-#    IF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "cafebabe")
-#      SET(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
-#    ENDIF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "cafebabe")
-#    IF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface")
-#      SET(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
-#    ENDIF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface")
+#    if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "cafebabe")
+#      set(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
+#    endif("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "cafebabe")
+#    if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface")
+#      set(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
+#    endif("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface")
 
-  ENDIF(NOT CMAKE_EXECUTABLE_FORMAT)
-  IF(NOT DEFINED CMAKE_EXECUTABLE_FORMAT)
-    SET(CMAKE_EXECUTABLE_FORMAT)
-  ENDIF()
+  endif(NOT CMAKE_EXECUTABLE_FORMAT)
+  if(NOT DEFINED CMAKE_EXECUTABLE_FORMAT)
+    set(CMAKE_EXECUTABLE_FORMAT)
+  endif()
   # Return the information extracted.
-  SET(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE)
-  SET(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
-  SET(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
+  set(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE)
+  set(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
+  set(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
     PARENT_SCOPE)
-  SET(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
-  SET(CMAKE_EXECUTABLE_FORMAT "${CMAKE_EXECUTABLE_FORMAT}" PARENT_SCOPE)
-ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang)
+  set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
+  set(CMAKE_EXECUTABLE_FORMAT "${CMAKE_EXECUTABLE_FORMAT}" PARENT_SCOPE)
+endfunction(CMAKE_DETERMINE_COMPILER_ID_CHECK lang)
 
 #-----------------------------------------------------------------------------
 # Function to query the compiler vendor.
@@ -276,22 +276,22 @@ ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang)
 #   set(CMAKE_${lang}_COMPILER_ID_VENDOR_REGEX_${vendor} "Some Vendor Output")
 # We try running the compiler with the flag for each vendor and
 # matching its regular expression in the output.
-FUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
+function(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
 
-  IF(NOT CMAKE_${lang}_COMPILER_ID_DIR)
+  if(NOT CMAKE_${lang}_COMPILER_ID_DIR)
     # We get here when this function is called not from within CMAKE_DETERMINE_COMPILER_ID()
     # This is done e.g. for detecting the compiler ID for assemblers.
     # Compute the directory in which to run the test and Create a clean working directory.
-    SET(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CompilerId${lang})
-    FILE(REMOVE_RECURSE ${CMAKE_${lang}_COMPILER_ID_DIR})
-    FILE(MAKE_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR})
-  ENDIF(NOT CMAKE_${lang}_COMPILER_ID_DIR)
+    set(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CompilerId${lang})
+    file(REMOVE_RECURSE ${CMAKE_${lang}_COMPILER_ID_DIR})
+    file(MAKE_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR})
+  endif(NOT CMAKE_${lang}_COMPILER_ID_DIR)
 
 
-  FOREACH(vendor ${CMAKE_${lang}_COMPILER_ID_VENDORS})
-    SET(flags ${CMAKE_${lang}_COMPILER_ID_VENDOR_FLAGS_${vendor}})
-    SET(regex ${CMAKE_${lang}_COMPILER_ID_VENDOR_REGEX_${vendor}})
-    EXECUTE_PROCESS(
+  foreach(vendor ${CMAKE_${lang}_COMPILER_ID_VENDORS})
+    set(flags ${CMAKE_${lang}_COMPILER_ID_VENDOR_FLAGS_${vendor}})
+    set(regex ${CMAKE_${lang}_COMPILER_ID_VENDOR_REGEX_${vendor}})
+    execute_process(
       COMMAND ${CMAKE_${lang}_COMPILER}
       ${CMAKE_${lang}_COMPILER_ID_ARG1}
       ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
@@ -302,22 +302,22 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
       TIMEOUT 10
       )
 
-    IF("${output}" MATCHES "${regex}")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    if("${output}" MATCHES "${regex}")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
         "matched \"${regex}\":\n${output}")
-      SET(CMAKE_${lang}_COMPILER_ID "${vendor}" PARENT_SCOPE)
-      BREAK()
-    ELSE()
-      IF("${result}" MATCHES  "timeout")
-        FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+      set(CMAKE_${lang}_COMPILER_ID "${vendor}" PARENT_SCOPE)
+      break()
+    else()
+      if("${result}" MATCHES  "timeout")
+        file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
           "Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
           "terminated after 10 s due to timeout.")
-      ELSE()
-        FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+      else()
+        file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
           "Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
           "did not match \"${regex}\":\n${output}")
-       ENDIF()
-    ENDIF()
-  ENDFOREACH()
-ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR)
+       endif()
+    endif()
+  endforeach()
+endfunction(CMAKE_DETERMINE_COMPILER_ID_VENDOR)
diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake
index 766289ec3..c8e561256 100644
--- a/Modules/CMakeDetermineFortranCompiler.cmake
+++ b/Modules/CMakeDetermineFortranCompiler.cmake
@@ -19,34 +19,34 @@
 # the cmake variable CMAKE_GENERATOR_FC which can be defined by a generator
 # as a default compiler
 
-INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
-INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-Fortran OPTIONAL)
-IF(NOT CMAKE_Fortran_COMPILER_NAMES)
-  SET(CMAKE_Fortran_COMPILER_NAMES f95)
-ENDIF()
+include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
+include(Platform/${CMAKE_SYSTEM_NAME}-Fortran OPTIONAL)
+if(NOT CMAKE_Fortran_COMPILER_NAMES)
+  set(CMAKE_Fortran_COMPILER_NAMES f95)
+endif()
 
-IF(NOT CMAKE_Fortran_COMPILER)
+if(NOT CMAKE_Fortran_COMPILER)
   # prefer the environment variable CC
-  IF($ENV{FC} MATCHES ".+")
-    GET_FILENAME_COMPONENT(CMAKE_Fortran_COMPILER_INIT $ENV{FC} PROGRAM PROGRAM_ARGS CMAKE_Fortran_FLAGS_ENV_INIT)
-    IF(CMAKE_Fortran_FLAGS_ENV_INIT)
-      SET(CMAKE_Fortran_COMPILER_ARG1 "${CMAKE_Fortran_FLAGS_ENV_INIT}" CACHE STRING "First argument to Fortran compiler")
-    ENDIF(CMAKE_Fortran_FLAGS_ENV_INIT)
-    IF(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
-    ELSE(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
-      MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable FC:\n$ENV{FC}.")
-    ENDIF(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
-  ENDIF($ENV{FC} MATCHES ".+")
+  if($ENV{FC} MATCHES ".+")
+    get_filename_component(CMAKE_Fortran_COMPILER_INIT $ENV{FC} PROGRAM PROGRAM_ARGS CMAKE_Fortran_FLAGS_ENV_INIT)
+    if(CMAKE_Fortran_FLAGS_ENV_INIT)
+      set(CMAKE_Fortran_COMPILER_ARG1 "${CMAKE_Fortran_FLAGS_ENV_INIT}" CACHE STRING "First argument to Fortran compiler")
+    endif(CMAKE_Fortran_FLAGS_ENV_INIT)
+    if(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
+    else(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
+      message(FATAL_ERROR "Could not find compiler set in environment variable FC:\n$ENV{FC}.")
+    endif(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
+  endif($ENV{FC} MATCHES ".+")
 
   # next try prefer the compiler specified by the generator
-  IF(CMAKE_GENERATOR_FC)
-    IF(NOT CMAKE_Fortran_COMPILER_INIT)
-      SET(CMAKE_Fortran_COMPILER_INIT ${CMAKE_GENERATOR_FC})
-    ENDIF(NOT CMAKE_Fortran_COMPILER_INIT)
-  ENDIF(CMAKE_GENERATOR_FC)
+  if(CMAKE_GENERATOR_FC)
+    if(NOT CMAKE_Fortran_COMPILER_INIT)
+      set(CMAKE_Fortran_COMPILER_INIT ${CMAKE_GENERATOR_FC})
+    endif(NOT CMAKE_Fortran_COMPILER_INIT)
+  endif(CMAKE_GENERATOR_FC)
 
   # finally list compilers to try
-  IF(NOT CMAKE_Fortran_COMPILER_INIT)
+  if(NOT CMAKE_Fortran_COMPILER_INIT)
     # Known compilers:
     #  f77/f90/f95: generic compiler names
     #  g77: GNU Fortran 77 compiler
@@ -67,68 +67,68 @@ IF(NOT CMAKE_Fortran_COMPILER)
     #  The order is 95 or newer compilers first, then 90,
     #  then 77 or older compilers, gnu is always last in the group,
     #  so if you paid for a compiler it is picked by default.
-    SET(CMAKE_Fortran_COMPILER_LIST
+    set(CMAKE_Fortran_COMPILER_LIST
       ifort ifc af95 af90 efc f95 pathf2003 pathf95 pgf95 pgfortran lf95 xlf95
       fort gfortran gfortran-4 g95 f90 pathf90 pgf90 xlf90 epcf90 fort77
       frt pgf77 xlf fl32 af77 g77 f77
       )
 
     # Vendor-specific compiler names.
-    SET(_Fortran_COMPILER_NAMES_GNU       gfortran gfortran-4 g95 g77)
-    SET(_Fortran_COMPILER_NAMES_Intel     ifort ifc efc)
-    SET(_Fortran_COMPILER_NAMES_Absoft    af95 af90 af77)
-    SET(_Fortran_COMPILER_NAMES_PGI       pgf95 pgfortran pgf90 pgf77)
-    SET(_Fortran_COMPILER_NAMES_PathScale pathf2003 pathf95 pathf90)
-    SET(_Fortran_COMPILER_NAMES_XL        xlf)
-    SET(_Fortran_COMPILER_NAMES_VisualAge xlf95 xlf90 xlf)
-  ENDIF()
+    set(_Fortran_COMPILER_NAMES_GNU       gfortran gfortran-4 g95 g77)
+    set(_Fortran_COMPILER_NAMES_Intel     ifort ifc efc)
+    set(_Fortran_COMPILER_NAMES_Absoft    af95 af90 af77)
+    set(_Fortran_COMPILER_NAMES_PGI       pgf95 pgfortran pgf90 pgf77)
+    set(_Fortran_COMPILER_NAMES_PathScale pathf2003 pathf95 pathf90)
+    set(_Fortran_COMPILER_NAMES_XL        xlf)
+    set(_Fortran_COMPILER_NAMES_VisualAge xlf95 xlf90 xlf)
+  endif()
 
   _cmake_find_compiler(Fortran)
 
-ELSE(NOT CMAKE_Fortran_COMPILER)
+else(NOT CMAKE_Fortran_COMPILER)
    # we only get here if CMAKE_Fortran_COMPILER was specified using -D or a pre-made CMakeCache.txt
   # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
   # if CMAKE_Fortran_COMPILER is a list of length 2, use the first item as
   # CMAKE_Fortran_COMPILER and the 2nd one as CMAKE_Fortran_COMPILER_ARG1
 
-  LIST(LENGTH CMAKE_Fortran_COMPILER _CMAKE_Fortran_COMPILER_LIST_LENGTH)
-  IF("${_CMAKE_Fortran_COMPILER_LIST_LENGTH}" EQUAL 2)
-    LIST(GET CMAKE_Fortran_COMPILER 1 CMAKE_Fortran_COMPILER_ARG1)
-    LIST(GET CMAKE_Fortran_COMPILER 0 CMAKE_Fortran_COMPILER)
-  ENDIF("${_CMAKE_Fortran_COMPILER_LIST_LENGTH}" EQUAL 2)
+  list(LENGTH CMAKE_Fortran_COMPILER _CMAKE_Fortran_COMPILER_LIST_LENGTH)
+  if("${_CMAKE_Fortran_COMPILER_LIST_LENGTH}" EQUAL 2)
+    list(GET CMAKE_Fortran_COMPILER 1 CMAKE_Fortran_COMPILER_ARG1)
+    list(GET CMAKE_Fortran_COMPILER 0 CMAKE_Fortran_COMPILER)
+  endif("${_CMAKE_Fortran_COMPILER_LIST_LENGTH}" EQUAL 2)
 
   # if a compiler was specified by the user but without path,
   # now try to find it with the full path
   # if it is found, force it into the cache,
   # if not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
   # if the C compiler already had a path, reuse it for searching the CXX compiler
-  GET_FILENAME_COMPONENT(_CMAKE_USER_Fortran_COMPILER_PATH "${CMAKE_Fortran_COMPILER}" PATH)
-  IF(NOT _CMAKE_USER_Fortran_COMPILER_PATH)
-    FIND_PROGRAM(CMAKE_Fortran_COMPILER_WITH_PATH NAMES ${CMAKE_Fortran_COMPILER})
-    MARK_AS_ADVANCED(CMAKE_Fortran_COMPILER_WITH_PATH)
-    IF(CMAKE_Fortran_COMPILER_WITH_PATH)
-      SET(CMAKE_Fortran_COMPILER ${CMAKE_Fortran_COMPILER_WITH_PATH}
+  get_filename_component(_CMAKE_USER_Fortran_COMPILER_PATH "${CMAKE_Fortran_COMPILER}" PATH)
+  if(NOT _CMAKE_USER_Fortran_COMPILER_PATH)
+    find_program(CMAKE_Fortran_COMPILER_WITH_PATH NAMES ${CMAKE_Fortran_COMPILER})
+    mark_as_advanced(CMAKE_Fortran_COMPILER_WITH_PATH)
+    if(CMAKE_Fortran_COMPILER_WITH_PATH)
+      set(CMAKE_Fortran_COMPILER ${CMAKE_Fortran_COMPILER_WITH_PATH}
         CACHE STRING "Fortran compiler" FORCE)
-    ENDIF(CMAKE_Fortran_COMPILER_WITH_PATH)
-  ENDIF(NOT _CMAKE_USER_Fortran_COMPILER_PATH)
-ENDIF(NOT CMAKE_Fortran_COMPILER)
+    endif(CMAKE_Fortran_COMPILER_WITH_PATH)
+  endif(NOT _CMAKE_USER_Fortran_COMPILER_PATH)
+endif(NOT CMAKE_Fortran_COMPILER)
 
-MARK_AS_ADVANCED(CMAKE_Fortran_COMPILER)
+mark_as_advanced(CMAKE_Fortran_COMPILER)
 
 # Build a small source file to identify the compiler.
-IF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
-  SET(CMAKE_Fortran_COMPILER_ID_RUN 1)
-  SET(CMAKE_Fortran_PLATFORM_ID "Windows")
-  SET(CMAKE_Fortran_COMPILER_ID "Intel")
-ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
+if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
+  set(CMAKE_Fortran_COMPILER_ID_RUN 1)
+  set(CMAKE_Fortran_PLATFORM_ID "Windows")
+  set(CMAKE_Fortran_COMPILER_ID "Intel")
+endif(${CMAKE_GENERATOR} MATCHES "Visual Studio")
 
-IF(NOT CMAKE_Fortran_COMPILER_ID_RUN)
-  SET(CMAKE_Fortran_COMPILER_ID_RUN 1)
+if(NOT CMAKE_Fortran_COMPILER_ID_RUN)
+  set(CMAKE_Fortran_COMPILER_ID_RUN 1)
 
   # Each entry in this list is a set of extra flags to try
   # adding to the compile line to see if it helps produce
   # a valid identification executable.
-  SET(CMAKE_Fortran_COMPILER_ID_TEST_FLAGS
+  set(CMAKE_Fortran_COMPILER_ID_TEST_FLAGS
     # Try compiling to an object file only.
     "-c"
 
@@ -137,65 +137,65 @@ IF(NOT CMAKE_Fortran_COMPILER_ID_RUN)
     )
 
   # Table of per-vendor compiler id flags with expected output.
-  LIST(APPEND CMAKE_Fortran_COMPILER_ID_VENDORS Compaq)
-  SET(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_Compaq "-what")
-  SET(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_Compaq "Compaq Visual Fortran")
-  LIST(APPEND CMAKE_Fortran_COMPILER_ID_VENDORS NAG) # Numerical Algorithms Group
-  SET(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_NAG "-V")
-  SET(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_NAG "NAG Fortran Compiler")
+  list(APPEND CMAKE_Fortran_COMPILER_ID_VENDORS Compaq)
+  set(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_Compaq "-what")
+  set(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_Compaq "Compaq Visual Fortran")
+  list(APPEND CMAKE_Fortran_COMPILER_ID_VENDORS NAG) # Numerical Algorithms Group
+  set(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_NAG "-V")
+  set(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_NAG "NAG Fortran Compiler")
 
   # Try to identify the compiler.
-  SET(CMAKE_Fortran_COMPILER_ID)
-  INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
+  set(CMAKE_Fortran_COMPILER_ID)
+  include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
   CMAKE_DETERMINE_COMPILER_ID(Fortran FFLAGS CMakeFortranCompilerId.F)
 
   # Fall back to old is-GNU test.
-  IF(NOT CMAKE_Fortran_COMPILER_ID)
-    EXEC_PROGRAM(${CMAKE_Fortran_COMPILER}
+  if(NOT CMAKE_Fortran_COMPILER_ID)
+    exec_program(${CMAKE_Fortran_COMPILER}
       ARGS ${CMAKE_Fortran_COMPILER_ID_FLAGS_LIST} -E "\"${CMAKE_ROOT}/Modules/CMakeTestGNU.c\""
       OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT RETURN_VALUE CMAKE_COMPILER_RETURN)
-    IF(NOT CMAKE_COMPILER_RETURN)
-      IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
-        SET(CMAKE_Fortran_COMPILER_ID "GNU")
-        FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    if(NOT CMAKE_COMPILER_RETURN)
+      if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
+        set(CMAKE_Fortran_COMPILER_ID "GNU")
+        file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
           "Determining if the Fortran compiler is GNU succeeded with "
           "the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n")
-      ELSE("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
-        FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+      else("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
+        file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
           "Determining if the Fortran compiler is GNU failed with "
           "the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n")
-      ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
-      IF(NOT CMAKE_Fortran_PLATFORM_ID)
-        IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" )
-          SET(CMAKE_Fortran_PLATFORM_ID "MinGW")
-        ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" )
-        IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" )
-          SET(CMAKE_Fortran_PLATFORM_ID "Cygwin")
-        ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" )
-      ENDIF(NOT CMAKE_Fortran_PLATFORM_ID)
-    ENDIF(NOT CMAKE_COMPILER_RETURN)
-  ENDIF(NOT CMAKE_Fortran_COMPILER_ID)
+      endif("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
+      if(NOT CMAKE_Fortran_PLATFORM_ID)
+        if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" )
+          set(CMAKE_Fortran_PLATFORM_ID "MinGW")
+        endif("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" )
+        if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" )
+          set(CMAKE_Fortran_PLATFORM_ID "Cygwin")
+        endif("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" )
+      endif(NOT CMAKE_Fortran_PLATFORM_ID)
+    endif(NOT CMAKE_COMPILER_RETURN)
+  endif(NOT CMAKE_Fortran_COMPILER_ID)
 
   # Set old compiler and platform id variables.
-  IF("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
-    SET(CMAKE_COMPILER_IS_GNUG77 1)
-  ENDIF("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
-  IF("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "MinGW")
-    SET(CMAKE_COMPILER_IS_MINGW 1)
-  ELSEIF("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "Cygwin")
-    SET(CMAKE_COMPILER_IS_CYGWIN 1)
-  ENDIF("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "MinGW")
-ENDIF(NOT CMAKE_Fortran_COMPILER_ID_RUN)
+  if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
+    set(CMAKE_COMPILER_IS_GNUG77 1)
+  endif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
+  if("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "MinGW")
+    set(CMAKE_COMPILER_IS_MINGW 1)
+  elseif("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "Cygwin")
+    set(CMAKE_COMPILER_IS_CYGWIN 1)
+  endif("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "MinGW")
+endif(NOT CMAKE_Fortran_COMPILER_ID_RUN)
 
-INCLUDE(CMakeFindBinUtils)
+include(CMakeFindBinUtils)
 
-IF(MSVC_Fortran_ARCHITECTURE_ID)
-  SET(SET_MSVC_Fortran_ARCHITECTURE_ID
-    "SET(MSVC_Fortran_ARCHITECTURE_ID ${MSVC_Fortran_ARCHITECTURE_ID})")
-ENDIF()
+if(MSVC_Fortran_ARCHITECTURE_ID)
+  set(SET_MSVC_Fortran_ARCHITECTURE_ID
+    "set(MSVC_Fortran_ARCHITECTURE_ID ${MSVC_Fortran_ARCHITECTURE_ID})")
+endif()
 # configure variables set in this file for fast reload later on
-CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in
+configure_file(${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in
   ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake
   @ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
   )
-SET(CMAKE_Fortran_COMPILER_ENV_VAR "FC")
+set(CMAKE_Fortran_COMPILER_ENV_VAR "FC")
diff --git a/Modules/CMakeDetermineJavaCompiler.cmake b/Modules/CMakeDetermineJavaCompiler.cmake
index e899a1e60..f35b9ff5e 100644
--- a/Modules/CMakeDetermineJavaCompiler.cmake
+++ b/Modules/CMakeDetermineJavaCompiler.cmake
@@ -16,33 +16,33 @@
 # NOTE, a generator may set CMAKE_Java_COMPILER before
 # loading this file to force a compiler.
 
-IF(NOT CMAKE_Java_COMPILER)
+if(NOT CMAKE_Java_COMPILER)
   # prefer the environment variable CC
-  IF($ENV{JAVA_COMPILER} MATCHES ".+")
-    GET_FILENAME_COMPONENT(CMAKE_Java_COMPILER_INIT $ENV{JAVA_COMPILER} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
-    IF(CMAKE_Java_FLAGS_ENV_INIT)
-      SET(CMAKE_Java_COMPILER_ARG1 "${CMAKE_Java_FLAGS_ENV_INIT}" CACHE STRING "First argument to Java compiler")
-    ENDIF(CMAKE_Java_FLAGS_ENV_INIT)
-    IF(NOT EXISTS ${CMAKE_Java_COMPILER_INIT})
-      MESSAGE(SEND_ERROR "Could not find compiler set in environment variable JAVA_COMPILER:\n$ENV{JAVA_COMPILER}.")
-    ENDIF(NOT EXISTS ${CMAKE_Java_COMPILER_INIT})
-  ENDIF($ENV{JAVA_COMPILER} MATCHES ".+")
+  if($ENV{JAVA_COMPILER} MATCHES ".+")
+    get_filename_component(CMAKE_Java_COMPILER_INIT $ENV{JAVA_COMPILER} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
+    if(CMAKE_Java_FLAGS_ENV_INIT)
+      set(CMAKE_Java_COMPILER_ARG1 "${CMAKE_Java_FLAGS_ENV_INIT}" CACHE STRING "First argument to Java compiler")
+    endif(CMAKE_Java_FLAGS_ENV_INIT)
+    if(NOT EXISTS ${CMAKE_Java_COMPILER_INIT})
+      message(SEND_ERROR "Could not find compiler set in environment variable JAVA_COMPILER:\n$ENV{JAVA_COMPILER}.")
+    endif(NOT EXISTS ${CMAKE_Java_COMPILER_INIT})
+  endif($ENV{JAVA_COMPILER} MATCHES ".+")
 
-  IF($ENV{JAVA_RUNTIME} MATCHES ".+")
-    GET_FILENAME_COMPONENT(CMAKE_Java_RUNTIME_INIT $ENV{JAVA_RUNTIME} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
-    IF(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT})
-      MESSAGE(SEND_ERROR "Could not find compiler set in environment variable JAVA_RUNTIME:\n$ENV{JAVA_RUNTIME}.")
-    ENDIF(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT})
-  ENDIF($ENV{JAVA_RUNTIME} MATCHES ".+")
+  if($ENV{JAVA_RUNTIME} MATCHES ".+")
+    get_filename_component(CMAKE_Java_RUNTIME_INIT $ENV{JAVA_RUNTIME} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
+    if(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT})
+      message(SEND_ERROR "Could not find compiler set in environment variable JAVA_RUNTIME:\n$ENV{JAVA_RUNTIME}.")
+    endif(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT})
+  endif($ENV{JAVA_RUNTIME} MATCHES ".+")
 
-  IF($ENV{JAVA_ARCHIVE} MATCHES ".+")
-    GET_FILENAME_COMPONENT(CMAKE_Java_ARCHIVE_INIT $ENV{JAVA_ARCHIVE} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
-    IF(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT})
-      MESSAGE(SEND_ERROR "Could not find compiler set in environment variable JAVA_ARCHIVE:\n$ENV{JAVA_ARCHIVE}.")
-    ENDIF(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT})
-  ENDIF($ENV{JAVA_ARCHIVE} MATCHES ".+")
+  if($ENV{JAVA_ARCHIVE} MATCHES ".+")
+    get_filename_component(CMAKE_Java_ARCHIVE_INIT $ENV{JAVA_ARCHIVE} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
+    if(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT})
+      message(SEND_ERROR "Could not find compiler set in environment variable JAVA_ARCHIVE:\n$ENV{JAVA_ARCHIVE}.")
+    endif(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT})
+  endif($ENV{JAVA_ARCHIVE} MATCHES ".+")
 
-  SET(Java_BIN_PATH
+  set(Java_BIN_PATH
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\2.0;JavaHome]/bin"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.9;JavaHome]/bin"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.8;JavaHome]/bin"
@@ -65,38 +65,38 @@ IF(NOT CMAKE_Java_COMPILER)
     /opt/sun-jdk-1.5.0.04/bin
     )
   # if no compiler has been specified yet, then look for one
-  IF(CMAKE_Java_COMPILER_INIT)
-    SET(CMAKE_Java_COMPILER ${CMAKE_Java_COMPILER_INIT} CACHE PATH "Java Compiler")
-  ELSE(CMAKE_Java_COMPILER_INIT)
-    FIND_PROGRAM(CMAKE_Java_COMPILER
+  if(CMAKE_Java_COMPILER_INIT)
+    set(CMAKE_Java_COMPILER ${CMAKE_Java_COMPILER_INIT} CACHE PATH "Java Compiler")
+  else(CMAKE_Java_COMPILER_INIT)
+    find_program(CMAKE_Java_COMPILER
       NAMES javac
       PATHS ${Java_BIN_PATH}
     )
-  ENDIF(CMAKE_Java_COMPILER_INIT)
+  endif(CMAKE_Java_COMPILER_INIT)
 
   # if no runtime has been specified yet, then look for one
-  IF(CMAKE_Java_RUNTIME_INIT)
-    SET(CMAKE_Java_RUNTIME ${CMAKE_Java_RUNTIME_INIT} CACHE PATH "Java Compiler")
-  ELSE(CMAKE_Java_RUNTIME_INIT)
-    FIND_PROGRAM(CMAKE_Java_RUNTIME
+  if(CMAKE_Java_RUNTIME_INIT)
+    set(CMAKE_Java_RUNTIME ${CMAKE_Java_RUNTIME_INIT} CACHE PATH "Java Compiler")
+  else(CMAKE_Java_RUNTIME_INIT)
+    find_program(CMAKE_Java_RUNTIME
       NAMES java
       PATHS ${Java_BIN_PATH}
     )
-  ENDIF(CMAKE_Java_RUNTIME_INIT)
+  endif(CMAKE_Java_RUNTIME_INIT)
 
   # if no archive has been specified yet, then look for one
-  IF(CMAKE_Java_ARCHIVE_INIT)
-    SET(CMAKE_Java_ARCHIVE ${CMAKE_Java_ARCHIVE_INIT} CACHE PATH "Java Compiler")
-  ELSE(CMAKE_Java_ARCHIVE_INIT)
-    FIND_PROGRAM(CMAKE_Java_ARCHIVE
+  if(CMAKE_Java_ARCHIVE_INIT)
+    set(CMAKE_Java_ARCHIVE ${CMAKE_Java_ARCHIVE_INIT} CACHE PATH "Java Compiler")
+  else(CMAKE_Java_ARCHIVE_INIT)
+    find_program(CMAKE_Java_ARCHIVE
       NAMES jar
       PATHS ${Java_BIN_PATH}
     )
-  ENDIF(CMAKE_Java_ARCHIVE_INIT)
-ENDIF(NOT CMAKE_Java_COMPILER)
-MARK_AS_ADVANCED(CMAKE_Java_COMPILER)
+  endif(CMAKE_Java_ARCHIVE_INIT)
+endif(NOT CMAKE_Java_COMPILER)
+mark_as_advanced(CMAKE_Java_COMPILER)
 
 # configure variables set in this file for fast reload later on
-CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeJavaCompiler.cmake.in
+configure_file(${CMAKE_ROOT}/Modules/CMakeJavaCompiler.cmake.in
   ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeJavaCompiler.cmake IMMEDIATE @ONLY)
-SET(CMAKE_Java_COMPILER_ENV_VAR "JAVA_COMPILER")
+set(CMAKE_Java_COMPILER_ENV_VAR "JAVA_COMPILER")
diff --git a/Modules/CMakeDetermineRCCompiler.cmake b/Modules/CMakeDetermineRCCompiler.cmake
index 4662e3ad2..41a7af5f4 100644
--- a/Modules/CMakeDetermineRCCompiler.cmake
+++ b/Modules/CMakeDetermineRCCompiler.cmake
@@ -18,50 +18,50 @@
 # use environment variable CCC first if defined by user, next use
 # the cmake variable CMAKE_GENERATOR_CC which can be defined by a generator
 # as a default compiler
-IF(NOT CMAKE_RC_COMPILER)
+if(NOT CMAKE_RC_COMPILER)
   # prefer the environment variable CC
-  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)
-      SET(CMAKE_RC_COMPILER_ARG1 "${CMAKE_RC_FLAGS_ENV_INIT}" CACHE STRING "First argument to RC compiler")
-    ENDIF(CMAKE_RC_FLAGS_ENV_INIT)
-    IF(EXISTS ${CMAKE_RC_COMPILER_INIT})
-    ELSE(EXISTS ${CMAKE_RC_COMPILER_INIT})
-      MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable RC:\n$ENV{RC}.")
-    ENDIF(EXISTS ${CMAKE_RC_COMPILER_INIT})
-  ENDIF($ENV{RC} MATCHES ".+")
+  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)
+      set(CMAKE_RC_COMPILER_ARG1 "${CMAKE_RC_FLAGS_ENV_INIT}" CACHE STRING "First argument to RC compiler")
+    endif(CMAKE_RC_FLAGS_ENV_INIT)
+    if(EXISTS ${CMAKE_RC_COMPILER_INIT})
+    else(EXISTS ${CMAKE_RC_COMPILER_INIT})
+      message(FATAL_ERROR "Could not find compiler set in environment variable RC:\n$ENV{RC}.")
+    endif(EXISTS ${CMAKE_RC_COMPILER_INIT})
+  endif($ENV{RC} MATCHES ".+")
 
   # next try prefer the compiler specified by the generator
-  IF(CMAKE_GENERATOR_RC)
-    IF(NOT CMAKE_RC_COMPILER_INIT)
-      SET(CMAKE_RC_COMPILER_INIT ${CMAKE_GENERATOR_RC})
-    ENDIF(NOT CMAKE_RC_COMPILER_INIT)
-  ENDIF(CMAKE_GENERATOR_RC)
+  if(CMAKE_GENERATOR_RC)
+    if(NOT CMAKE_RC_COMPILER_INIT)
+      set(CMAKE_RC_COMPILER_INIT ${CMAKE_GENERATOR_RC})
+    endif(NOT CMAKE_RC_COMPILER_INIT)
+  endif(CMAKE_GENERATOR_RC)
 
   # finally list compilers to try
-  IF(CMAKE_RC_COMPILER_INIT)
-    SET(CMAKE_RC_COMPILER_LIST ${CMAKE_RC_COMPILER_INIT})
-  ELSE(CMAKE_RC_COMPILER_INIT)
-    SET(CMAKE_RC_COMPILER_LIST rc)
-  ENDIF(CMAKE_RC_COMPILER_INIT)
+  if(CMAKE_RC_COMPILER_INIT)
+    set(CMAKE_RC_COMPILER_LIST ${CMAKE_RC_COMPILER_INIT})
+  else(CMAKE_RC_COMPILER_INIT)
+    set(CMAKE_RC_COMPILER_LIST rc)
+  endif(CMAKE_RC_COMPILER_INIT)
 
   # Find the compiler.
-  FIND_PROGRAM(CMAKE_RC_COMPILER NAMES ${CMAKE_RC_COMPILER_LIST} DOC "RC compiler")
-  IF(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER)
-    SET(CMAKE_RC_COMPILER "${CMAKE_RC_COMPILER_INIT}" CACHE FILEPATH "RC compiler" FORCE)
-  ENDIF(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER)
-ENDIF(NOT CMAKE_RC_COMPILER)
+  find_program(CMAKE_RC_COMPILER NAMES ${CMAKE_RC_COMPILER_LIST} DOC "RC compiler")
+  if(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER)
+    set(CMAKE_RC_COMPILER "${CMAKE_RC_COMPILER_INIT}" CACHE FILEPATH "RC compiler" FORCE)
+  endif(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER)
+endif(NOT CMAKE_RC_COMPILER)
 
-MARK_AS_ADVANCED(CMAKE_RC_COMPILER)
+mark_as_advanced(CMAKE_RC_COMPILER)
 
-GET_FILENAME_COMPONENT(_CMAKE_RC_COMPILER_NAME_WE ${CMAKE_RC_COMPILER} NAME_WE)
-IF(_CMAKE_RC_COMPILER_NAME_WE STREQUAL "windres")
-  SET(CMAKE_RC_OUTPUT_EXTENSION .obj)
-ELSE()
-  SET(CMAKE_RC_OUTPUT_EXTENSION .res)
-ENDIF()
+get_filename_component(_CMAKE_RC_COMPILER_NAME_WE ${CMAKE_RC_COMPILER} NAME_WE)
+if(_CMAKE_RC_COMPILER_NAME_WE STREQUAL "windres")
+  set(CMAKE_RC_OUTPUT_EXTENSION .obj)
+else()
+  set(CMAKE_RC_OUTPUT_EXTENSION .res)
+endif()
 
 # configure variables set in this file for fast reload later on
-CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeRCCompiler.cmake.in
+configure_file(${CMAKE_ROOT}/Modules/CMakeRCCompiler.cmake.in
                ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeRCCompiler.cmake IMMEDIATE)
-SET(CMAKE_RC_COMPILER_ENV_VAR "RC")
+set(CMAKE_RC_COMPILER_ENV_VAR "RC")
diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake
index c89ccd17d..a72bd5f96 100644
--- a/Modules/CMakeDetermineSystem.cmake
+++ b/Modules/CMakeDetermineSystem.cmake
@@ -42,135 +42,135 @@
 
 
 # find out on which system cmake runs
-IF(CMAKE_HOST_UNIX)
-  FIND_PROGRAM(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
-  IF(CMAKE_UNAME)
-    EXEC_PROGRAM(uname ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_NAME)
-    EXEC_PROGRAM(uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION)
-    IF(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*")
-      EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
+if(CMAKE_HOST_UNIX)
+  find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
+  if(CMAKE_UNAME)
+    exec_program(uname ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_NAME)
+    exec_program(uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION)
+    if(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*")
+      exec_program(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
         RETURN_VALUE val)
-    ELSEIF(CMAKE_HOST_SYSTEM_NAME MATCHES "OpenBSD")
-      EXEC_PROGRAM(arch ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
+    elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "OpenBSD")
+      exec_program(arch ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
         RETURN_VALUE val)
-    ELSE()
-      EXEC_PROGRAM(uname ARGS -p OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
+    else()
+      exec_program(uname ARGS -p OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
         RETURN_VALUE val)
-      IF("${val}" GREATER 0)
-        EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
+      if("${val}" GREATER 0)
+        exec_program(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
           RETURN_VALUE val)
-      ENDIF("${val}" GREATER 0)
-    ENDIF()
+      endif("${val}" GREATER 0)
+    endif()
     # check the return of the last uname -m or -p
-    IF("${val}" GREATER 0)
-        SET(CMAKE_HOST_SYSTEM_PROCESSOR "unknown")
-    ENDIF("${val}" GREATER 0)
-    SET(CMAKE_UNAME ${CMAKE_UNAME} CACHE INTERNAL "uname command")
+    if("${val}" GREATER 0)
+        set(CMAKE_HOST_SYSTEM_PROCESSOR "unknown")
+    endif("${val}" GREATER 0)
+    set(CMAKE_UNAME ${CMAKE_UNAME} CACHE INTERNAL "uname command")
     # processor may have double quote in the name, and that needs to be removed
-    STRING(REGEX REPLACE "\"" "" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
-    STRING(REGEX REPLACE "/" "_" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
-  ENDIF(CMAKE_UNAME)
-ELSE(CMAKE_HOST_UNIX)
-  IF(CMAKE_HOST_WIN32)
-    SET (CMAKE_HOST_SYSTEM_NAME "Windows")
-    SET (CMAKE_HOST_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITECTURE}")
-  ENDIF(CMAKE_HOST_WIN32)
-ENDIF(CMAKE_HOST_UNIX)
+    string(REGEX REPLACE "\"" "" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
+    string(REGEX REPLACE "/" "_" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
+  endif(CMAKE_UNAME)
+else(CMAKE_HOST_UNIX)
+  if(CMAKE_HOST_WIN32)
+    set (CMAKE_HOST_SYSTEM_NAME "Windows")
+    set (CMAKE_HOST_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITECTURE}")
+  endif(CMAKE_HOST_WIN32)
+endif(CMAKE_HOST_UNIX)
 
 # if a toolchain file is used, the user wants to cross compile.
 # in this case read the toolchain file and keep the CMAKE_HOST_SYSTEM_*
 # variables around so they can be used in CMakeLists.txt.
 # In all other cases, the host and target platform are the same.
-IF(CMAKE_TOOLCHAIN_FILE)
+if(CMAKE_TOOLCHAIN_FILE)
   # at first try to load it as path relative to the directory from which cmake has been run
-  INCLUDE("${CMAKE_BINARY_DIR}/${CMAKE_TOOLCHAIN_FILE}" OPTIONAL RESULT_VARIABLE _INCLUDED_TOOLCHAIN_FILE)
-  IF(NOT _INCLUDED_TOOLCHAIN_FILE)
+  include("${CMAKE_BINARY_DIR}/${CMAKE_TOOLCHAIN_FILE}" OPTIONAL RESULT_VARIABLE _INCLUDED_TOOLCHAIN_FILE)
+  if(NOT _INCLUDED_TOOLCHAIN_FILE)
      # if the file isn't found there, check the default locations
-     INCLUDE("${CMAKE_TOOLCHAIN_FILE}" OPTIONAL RESULT_VARIABLE _INCLUDED_TOOLCHAIN_FILE)
-  ENDIF(NOT _INCLUDED_TOOLCHAIN_FILE)
+     include("${CMAKE_TOOLCHAIN_FILE}" OPTIONAL RESULT_VARIABLE _INCLUDED_TOOLCHAIN_FILE)
+  endif(NOT _INCLUDED_TOOLCHAIN_FILE)
 
-  IF(_INCLUDED_TOOLCHAIN_FILE)
-    SET(CMAKE_TOOLCHAIN_FILE "${_INCLUDED_TOOLCHAIN_FILE}" CACHE FILEPATH "The CMake toolchain file" FORCE)
-  ELSE(_INCLUDED_TOOLCHAIN_FILE)
-    MESSAGE(FATAL_ERROR "Could not find toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
-    SET(CMAKE_TOOLCHAIN_FILE "NOTFOUND" CACHE FILEPATH "The CMake toolchain file" FORCE)
-  ENDIF(_INCLUDED_TOOLCHAIN_FILE)
-ENDIF(CMAKE_TOOLCHAIN_FILE)
+  if(_INCLUDED_TOOLCHAIN_FILE)
+    set(CMAKE_TOOLCHAIN_FILE "${_INCLUDED_TOOLCHAIN_FILE}" CACHE FILEPATH "The CMake toolchain file" FORCE)
+  else(_INCLUDED_TOOLCHAIN_FILE)
+    message(FATAL_ERROR "Could not find toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
+    set(CMAKE_TOOLCHAIN_FILE "NOTFOUND" CACHE FILEPATH "The CMake toolchain file" FORCE)
+  endif(_INCLUDED_TOOLCHAIN_FILE)
+endif(CMAKE_TOOLCHAIN_FILE)
 
 
 # if CMAKE_SYSTEM_NAME is here already set, either it comes from a toolchain file
 # or it was set via -DCMAKE_SYSTEM_NAME=...
 # if that's the case, assume we are crosscompiling
-IF(CMAKE_SYSTEM_NAME)
-  IF(NOT DEFINED CMAKE_CROSSCOMPILING)
-    SET(CMAKE_CROSSCOMPILING TRUE)
-  ENDIF(NOT DEFINED CMAKE_CROSSCOMPILING)
-  SET(PRESET_CMAKE_SYSTEM_NAME TRUE)
-ELSE(CMAKE_SYSTEM_NAME)
-  SET(CMAKE_SYSTEM_NAME      "${CMAKE_HOST_SYSTEM_NAME}")
-  SET(CMAKE_SYSTEM_VERSION   "${CMAKE_HOST_SYSTEM_VERSION}")
-  SET(CMAKE_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
-  SET(CMAKE_CROSSCOMPILING FALSE)
-  SET(PRESET_CMAKE_SYSTEM_NAME FALSE)
-ENDIF(CMAKE_SYSTEM_NAME)
+if(CMAKE_SYSTEM_NAME)
+  if(NOT DEFINED CMAKE_CROSSCOMPILING)
+    set(CMAKE_CROSSCOMPILING TRUE)
+  endif(NOT DEFINED CMAKE_CROSSCOMPILING)
+  set(PRESET_CMAKE_SYSTEM_NAME TRUE)
+else(CMAKE_SYSTEM_NAME)
+  set(CMAKE_SYSTEM_NAME      "${CMAKE_HOST_SYSTEM_NAME}")
+  set(CMAKE_SYSTEM_VERSION   "${CMAKE_HOST_SYSTEM_VERSION}")
+  set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
+  set(CMAKE_CROSSCOMPILING FALSE)
+  set(PRESET_CMAKE_SYSTEM_NAME FALSE)
+endif(CMAKE_SYSTEM_NAME)
 
 
-MACRO(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX)
-  IF(NOT ${_PREFIX}_NAME)
-    SET(${_PREFIX}_NAME "UnknownOS")
-  ENDIF(NOT ${_PREFIX}_NAME)
+macro(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX)
+  if(NOT ${_PREFIX}_NAME)
+    set(${_PREFIX}_NAME "UnknownOS")
+  endif(NOT ${_PREFIX}_NAME)
 
   # fix for BSD/OS , remove the /
-  IF(${_PREFIX}_NAME MATCHES BSD.OS)
-    SET(${_PREFIX}_NAME BSDOS)
-  ENDIF(${_PREFIX}_NAME MATCHES BSD.OS)
+  if(${_PREFIX}_NAME MATCHES BSD.OS)
+    set(${_PREFIX}_NAME BSDOS)
+  endif(${_PREFIX}_NAME MATCHES BSD.OS)
 
   # fix for GNU/kFreeBSD, remove the GNU/
-  IF(${_PREFIX}_NAME MATCHES kFreeBSD)
-    SET(${_PREFIX}_NAME kFreeBSD)
-  ENDIF(${_PREFIX}_NAME MATCHES kFreeBSD)
+  if(${_PREFIX}_NAME MATCHES kFreeBSD)
+    set(${_PREFIX}_NAME kFreeBSD)
+  endif(${_PREFIX}_NAME MATCHES kFreeBSD)
 
   # fix for CYGWIN which has windows version in it
-  IF(${_PREFIX}_NAME MATCHES CYGWIN)
-    SET(${_PREFIX}_NAME CYGWIN)
-  ENDIF(${_PREFIX}_NAME MATCHES CYGWIN)
+  if(${_PREFIX}_NAME MATCHES CYGWIN)
+    set(${_PREFIX}_NAME CYGWIN)
+  endif(${_PREFIX}_NAME MATCHES CYGWIN)
 
   # set CMAKE_SYSTEM to the CMAKE_SYSTEM_NAME
-  SET(${_PREFIX}  ${${_PREFIX}_NAME})
+  set(${_PREFIX}  ${${_PREFIX}_NAME})
   # if there is a CMAKE_SYSTEM_VERSION then add a -${CMAKE_SYSTEM_VERSION}
-  IF(${_PREFIX}_VERSION)
-    SET(${_PREFIX} ${${_PREFIX}}-${${_PREFIX}_VERSION})
-  ENDIF(${_PREFIX}_VERSION)
+  if(${_PREFIX}_VERSION)
+    set(${_PREFIX} ${${_PREFIX}}-${${_PREFIX}_VERSION})
+  endif(${_PREFIX}_VERSION)
 
-ENDMACRO(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX)
+endmacro(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX)
 
 ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_SYSTEM)
 ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_HOST_SYSTEM)
 
 # this file is also executed from cpack, then we don't need to generate these files
 # in this case there is no CMAKE_BINARY_DIR
-IF(CMAKE_BINARY_DIR)
+if(CMAKE_BINARY_DIR)
   # write entry to the log file
-  IF(PRESET_CMAKE_SYSTEM_NAME)
-    FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+  if(PRESET_CMAKE_SYSTEM_NAME)
+    file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
                 "The target system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n")
-    FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
                 "The host system is: ${CMAKE_HOST_SYSTEM_NAME} - ${CMAKE_HOST_SYSTEM_VERSION} - ${CMAKE_HOST_SYSTEM_PROCESSOR}\n")
-  ELSE(PRESET_CMAKE_SYSTEM_NAME)
-    FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+  else(PRESET_CMAKE_SYSTEM_NAME)
+    file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
                 "The system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n")
-  ENDIF(PRESET_CMAKE_SYSTEM_NAME)
+  endif(PRESET_CMAKE_SYSTEM_NAME)
 
   # if a toolchain file is used, it needs to be included in the configured file,
-  # so settings done there are also available if they don't go in the cache and in TRY_COMPILE()
-  SET(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED)
-  IF(DEFINED CMAKE_TOOLCHAIN_FILE)
-    SET(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED "INCLUDE(\"${CMAKE_TOOLCHAIN_FILE}\")")
-  ENDIF(DEFINED CMAKE_TOOLCHAIN_FILE)
+  # so settings done there are also available if they don't go in the cache and in try_compile()
+  set(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED)
+  if(DEFINED CMAKE_TOOLCHAIN_FILE)
+    set(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED "include(\"${CMAKE_TOOLCHAIN_FILE}\")")
+  endif(DEFINED CMAKE_TOOLCHAIN_FILE)
 
   # configure variables set in this file for fast reload, the template file is defined at the top of this file
-  CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeSystem.cmake.in
+  configure_file(${CMAKE_ROOT}/Modules/CMakeSystem.cmake.in
                 ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake
                 IMMEDIATE @ONLY)
 
-ENDIF(CMAKE_BINARY_DIR)
+endif(CMAKE_BINARY_DIR)
diff --git a/Modules/CMakeExpandImportedTargets.cmake b/Modules/CMakeExpandImportedTargets.cmake
index fba071a06..d698ad8b6 100644
--- a/Modules/CMakeExpandImportedTargets.cmake
+++ b/Modules/CMakeExpandImportedTargets.cmake
@@ -10,7 +10,7 @@
 # the first configuration from ${CMAKE_CONFIGURATION_TYPES} if set, otherwise
 # ${CMAKE_BUILD_TYPE}.
 # This macro is used by all Check*.cmake files which use
-# TRY_COMPILE() or TRY_RUN() and support CMAKE_REQUIRED_LIBRARIES , so that
+# try_compile() or try_run() and support CMAKE_REQUIRED_LIBRARIES , so that
 # these checks support imported targets in CMAKE_REQUIRED_LIBRARIES:
 #    cmake_expand_imported_targets(expandedLibs LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
 #                                               CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}" )
diff --git a/Modules/CMakeExportBuildSettings.cmake b/Modules/CMakeExportBuildSettings.cmake
index 8d316b941..7392e6bec 100644
--- a/Modules/CMakeExportBuildSettings.cmake
+++ b/Modules/CMakeExportBuildSettings.cmake
@@ -13,24 +13,24 @@
 #  License text for the above reference.)
 
 # This module is purposely no longer documented.  It does nothing useful.
-IF(NOT "${CMAKE_MINIMUM_REQUIRED_VERSION}" VERSION_LESS 2.7)
-  MESSAGE(FATAL_ERROR
+if(NOT "${CMAKE_MINIMUM_REQUIRED_VERSION}" VERSION_LESS 2.7)
+  message(FATAL_ERROR
     "The functionality of this module has been dropped as of CMake 2.8.  "
     "It was deemed harmful (confusing users by changing their compiler).  "
     "Please remove calls to the CMAKE_EXPORT_BUILD_SETTINGS macro and "
     "stop including this module.  "
     "If this project generates any files for use by external projects, "
     "remove any use of the CMakeImportBuildSettings module from them.")
-ENDIF()
+endif()
 
 # This macro used to store build settings of a project in a file to be
 # loaded by another project using CMAKE_IMPORT_BUILD_SETTINGS.  Now it
 # creates a file that refuses to load (with comment explaining why).
-MACRO(CMAKE_EXPORT_BUILD_SETTINGS SETTINGS_FILE)
-  IF(${SETTINGS_FILE} MATCHES ".+")
-    CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeBuildSettings.cmake.in
+macro(CMAKE_EXPORT_BUILD_SETTINGS SETTINGS_FILE)
+  if(${SETTINGS_FILE} MATCHES ".+")
+    configure_file(${CMAKE_ROOT}/Modules/CMakeBuildSettings.cmake.in
                    ${SETTINGS_FILE} @ONLY IMMEDIATE)
-  ELSE(${SETTINGS_FILE} MATCHES ".+")
-    MESSAGE(SEND_ERROR "CMAKE_EXPORT_BUILD_SETTINGS called with no argument.")
-  ENDIF(${SETTINGS_FILE} MATCHES ".+")
-ENDMACRO(CMAKE_EXPORT_BUILD_SETTINGS)
+  else(${SETTINGS_FILE} MATCHES ".+")
+    message(SEND_ERROR "CMAKE_EXPORT_BUILD_SETTINGS called with no argument.")
+  endif(${SETTINGS_FILE} MATCHES ".+")
+endmacro(CMAKE_EXPORT_BUILD_SETTINGS)
diff --git a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake
index 455f95fe3..0fe2abbe5 100644
--- a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake
+++ b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake
@@ -18,39 +18,39 @@
 # so that they can find the headers at runtime and parsing etc. works better
 # This is done here by actually running gcc with the options so it prints its
 # system include directories, which are parsed then and stored in the cache.
-MACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines)
-  SET(${_resultIncludeDirs})
-  SET(_gccOutput)
-  FILE(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy" "\n" )
+macro(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines)
+  set(${_resultIncludeDirs})
+  set(_gccOutput)
+  file(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy" "\n" )
 
-  IF (${_lang} STREQUAL "c++")
-    SET(_compilerExecutable "${CMAKE_CXX_COMPILER}")
-    SET(_arg1 "${CMAKE_CXX_COMPILER_ARG1}")
-  ELSE ()
-    SET(_compilerExecutable "${CMAKE_C_COMPILER}")
-    SET(_arg1 "${CMAKE_C_COMPILER_ARG1}")
-  ENDIF ()
-  EXECUTE_PROCESS(COMMAND ${_compilerExecutable} ${_arg1} -v -E -x ${_lang} -dD dummy
+  if (${_lang} STREQUAL "c++")
+    set(_compilerExecutable "${CMAKE_CXX_COMPILER}")
+    set(_arg1 "${CMAKE_CXX_COMPILER_ARG1}")
+  else ()
+    set(_compilerExecutable "${CMAKE_C_COMPILER}")
+    set(_arg1 "${CMAKE_C_COMPILER_ARG1}")
+  endif ()
+  execute_process(COMMAND ${_compilerExecutable} ${_arg1} -v -E -x ${_lang} -dD dummy
                   WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/CMakeFiles
                   ERROR_VARIABLE _gccOutput
                   OUTPUT_VARIABLE _gccStdout )
-  FILE(REMOVE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy")
+  file(REMOVE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy")
 
   # First find the system include dirs:
-  IF( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+ *\n) *End of (search) list" )
+  if( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+ *\n) *End of (search) list" )
 
     # split the output into lines and then remove leading and trailing spaces from each of them:
-    STRING(REGEX MATCHALL "[^\n]+\n" _includeLines "${CMAKE_MATCH_1}")
-    FOREACH(nextLine ${_includeLines})
-      STRING(STRIP "${nextLine}" _includePath)
-      LIST(APPEND ${_resultIncludeDirs} "${_includePath}")
-    ENDFOREACH(nextLine)
+    string(REGEX MATCHALL "[^\n]+\n" _includeLines "${CMAKE_MATCH_1}")
+    foreach(nextLine ${_includeLines})
+      string(STRIP "${nextLine}" _includePath)
+      list(APPEND ${_resultIncludeDirs} "${_includePath}")
+    endforeach(nextLine)
 
-  ENDIF()
+  endif()
 
 
   # now find the builtin macros:
-  STRING(REGEX MATCHALL "#define[^\n]+\n" _defineLines "${_gccStdout}")
+  string(REGEX MATCHALL "#define[^\n]+\n" _defineLines "${_gccStdout}")
 # A few example lines which the regexp below has to match properly:
 #  #define   MAX(a,b) ((a) > (b) ? (a) : (b))
 #  #define __fastcall __attribute__((__fastcall__))
@@ -59,51 +59,51 @@ MACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines
 #  #define __UINTMAX_TYPE__ long long unsigned int
 #  #define __i386__  1
 
-  FOREACH(nextLine ${_defineLines})
-    STRING(REGEX MATCH "^#define +([A-Za-z_][A-Za-z0-9_]*)(\\([^\\)]+\\))? +(.+) *$" _dummy "${nextLine}")
-    SET(_name "${CMAKE_MATCH_1}${CMAKE_MATCH_2}")
-    STRING(STRIP "${CMAKE_MATCH_3}" _value)
-    #MESSAGE(STATUS "m1: -${CMAKE_MATCH_1}- m2: -${CMAKE_MATCH_2}- m3: -${CMAKE_MATCH_3}-")
+  foreach(nextLine ${_defineLines})
+    string(REGEX MATCH "^#define +([A-Za-z_][A-Za-z0-9_]*)(\\([^\\)]+\\))? +(.+) *$" _dummy "${nextLine}")
+    set(_name "${CMAKE_MATCH_1}${CMAKE_MATCH_2}")
+    string(STRIP "${CMAKE_MATCH_3}" _value)
+    #message(STATUS "m1: -${CMAKE_MATCH_1}- m2: -${CMAKE_MATCH_2}- m3: -${CMAKE_MATCH_3}-")
 
-    LIST(APPEND ${_resultDefines} "${_name}")
-    IF(_value)
-      LIST(APPEND ${_resultDefines} "${_value}")
-    ELSE()
-      LIST(APPEND ${_resultDefines} " ")
-    ENDIF()
-  ENDFOREACH(nextLine)
+    list(APPEND ${_resultDefines} "${_name}")
+    if(_value)
+      list(APPEND ${_resultDefines} "${_value}")
+    else()
+      list(APPEND ${_resultDefines} " ")
+    endif()
+  endforeach(nextLine)
 
-ENDMACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang)
+endmacro(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang)
 
 # Save the current LC_ALL, LC_MESSAGES, and LANG environment variables and set them
 # to "C" that way GCC's "search starts here" text is in English and we can grok it.
-SET(_orig_lc_all      $ENV{LC_ALL})
-SET(_orig_lc_messages $ENV{LC_MESSAGES})
-SET(_orig_lang        $ENV{LANG})
+set(_orig_lc_all      $ENV{LC_ALL})
+set(_orig_lc_messages $ENV{LC_MESSAGES})
+set(_orig_lang        $ENV{LANG})
 
-SET(ENV{LC_ALL}      C)
-SET(ENV{LC_MESSAGES} C)
-SET(ENV{LANG}        C)
+set(ENV{LC_ALL}      C)
+set(ENV{LC_MESSAGES} C)
+set(ENV{LANG}        C)
 
 # Now check for C, works for gcc and Intel compiler at least
-IF (NOT CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS)
-  IF ("${CMAKE_C_COMPILER_ID}" MATCHES GNU  OR  "${CMAKE_C_COMPILER_ID}" MATCHES Intel)
+if (NOT CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS)
+  if ("${CMAKE_C_COMPILER_ID}" MATCHES GNU  OR  "${CMAKE_C_COMPILER_ID}" MATCHES Intel)
     _DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c _dirs _defines)
-    SET(CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS "${_dirs}" CACHE INTERNAL "C compiler system include directories")
-    SET(CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS "${_defines}" CACHE INTERNAL "C compiler system defined macros")
-  ENDIF ()
-ENDIF ()
+    set(CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS "${_dirs}" CACHE INTERNAL "C compiler system include directories")
+    set(CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS "${_defines}" CACHE INTERNAL "C compiler system defined macros")
+  endif ()
+endif ()
 
 # And now the same for C++
-IF (NOT CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS)
-  IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES GNU  OR  "${CMAKE_CXX_COMPILER_ID}" MATCHES Intel)
+if (NOT CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS)
+  if ("${CMAKE_CXX_COMPILER_ID}" MATCHES GNU  OR  "${CMAKE_CXX_COMPILER_ID}" MATCHES Intel)
     _DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c++ _dirs _defines)
-    SET(CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS "${_dirs}" CACHE INTERNAL "CXX compiler system include directories")
-    SET(CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS "${_defines}" CACHE INTERNAL "CXX compiler system defined macros")
-  ENDIF ()
-ENDIF ()
+    set(CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS "${_dirs}" CACHE INTERNAL "CXX compiler system include directories")
+    set(CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS "${_defines}" CACHE INTERNAL "CXX compiler system defined macros")
+  endif ()
+endif ()
 
 # Restore original LC_ALL, LC_MESSAGES, and LANG
-SET(ENV{LC_ALL}      ${_orig_lc_all})
-SET(ENV{LC_MESSAGES} ${_orig_lc_messages})
-SET(ENV{LANG}        ${_orig_lang})
+set(ENV{LC_ALL}      ${_orig_lc_all})
+set(ENV{LC_MESSAGES} ${_orig_lc_messages})
+set(ENV{LANG}        ${_orig_lang})
diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake
index a5202f402..71537fff3 100644
--- a/Modules/CMakeFindBinUtils.cmake
+++ b/Modules/CMakeFindBinUtils.cmake
@@ -30,46 +30,46 @@
 #  License text for the above reference.)
 
 # if it's the MS C/CXX compiler, search for link
-IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
+if("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
    OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
    OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
 
-  FIND_PROGRAM(CMAKE_LINKER NAMES link HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
+  find_program(CMAKE_LINKER NAMES link HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
 
-  MARK_AS_ADVANCED(CMAKE_LINKER)
+  mark_as_advanced(CMAKE_LINKER)
 
 # in all other cases search for ar, ranlib, etc.
-ELSE("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
+else("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
    OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
    OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
 
-  FIND_PROGRAM(CMAKE_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ar HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
+  find_program(CMAKE_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ar HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
 
-  FIND_PROGRAM(CMAKE_RANLIB NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ranlib HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
-  IF(NOT CMAKE_RANLIB)
-    SET(CMAKE_RANLIB : CACHE INTERNAL "noop for ranlib")
-  ENDIF(NOT CMAKE_RANLIB)
+  find_program(CMAKE_RANLIB NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ranlib HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
+  if(NOT CMAKE_RANLIB)
+    set(CMAKE_RANLIB : CACHE INTERNAL "noop for ranlib")
+  endif(NOT CMAKE_RANLIB)
 
-  FIND_PROGRAM(CMAKE_STRIP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}strip HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
-  FIND_PROGRAM(CMAKE_LINKER NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ld HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
-  FIND_PROGRAM(CMAKE_NM NAMES ${_CMAKE_TOOLCHAIN_PREFIX}nm HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
-  FIND_PROGRAM(CMAKE_OBJDUMP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objdump HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
-  FIND_PROGRAM(CMAKE_OBJCOPY NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objcopy HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
+  find_program(CMAKE_STRIP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}strip HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
+  find_program(CMAKE_LINKER NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ld HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
+  find_program(CMAKE_NM NAMES ${_CMAKE_TOOLCHAIN_PREFIX}nm HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
+  find_program(CMAKE_OBJDUMP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objdump HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
+  find_program(CMAKE_OBJCOPY NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objcopy HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
 
-  MARK_AS_ADVANCED(CMAKE_AR CMAKE_RANLIB CMAKE_STRIP CMAKE_LINKER CMAKE_NM CMAKE_OBJDUMP CMAKE_OBJCOPY)
+  mark_as_advanced(CMAKE_AR CMAKE_RANLIB CMAKE_STRIP CMAKE_LINKER CMAKE_NM CMAKE_OBJDUMP CMAKE_OBJCOPY)
 
-ENDIF("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
+endif("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
    OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
    OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
 
 
 # on Apple there really should be install_name_tool
-IF(APPLE)
-  FIND_PROGRAM(CMAKE_INSTALL_NAME_TOOL NAMES install_name_tool HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
+if(APPLE)
+  find_program(CMAKE_INSTALL_NAME_TOOL NAMES install_name_tool HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
 
-  IF(NOT CMAKE_INSTALL_NAME_TOOL)
-    MESSAGE(FATAL_ERROR "Could not find install_name_tool, please check your installation.")
-  ENDIF(NOT CMAKE_INSTALL_NAME_TOOL)
+  if(NOT CMAKE_INSTALL_NAME_TOOL)
+    message(FATAL_ERROR "Could not find install_name_tool, please check your installation.")
+  endif(NOT CMAKE_INSTALL_NAME_TOOL)
 
-  MARK_AS_ADVANCED(CMAKE_INSTALL_NAME_TOOL)
-ENDIF(APPLE)
+  mark_as_advanced(CMAKE_INSTALL_NAME_TOOL)
+endif(APPLE)
diff --git a/Modules/CMakeFindCodeBlocks.cmake b/Modules/CMakeFindCodeBlocks.cmake
index 23f2c821d..6ca7c1983 100644
--- a/Modules/CMakeFindCodeBlocks.cmake
+++ b/Modules/CMakeFindCodeBlocks.cmake
@@ -15,11 +15,11 @@
 # This file is included in CMakeSystemSpecificInformation.cmake if
 # the CodeBlocks extra generator has been selected.
 
-FIND_PROGRAM(CMAKE_CODEBLOCKS_EXECUTABLE NAMES codeblocks DOC "The CodeBlocks executable")
+find_program(CMAKE_CODEBLOCKS_EXECUTABLE NAMES codeblocks DOC "The CodeBlocks executable")
 
-IF(CMAKE_CODEBLOCKS_EXECUTABLE)
-   SET(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_CODEBLOCKS_EXECUTABLE} <PROJECT_FILE>" )
-ENDIF(CMAKE_CODEBLOCKS_EXECUTABLE)
+if(CMAKE_CODEBLOCKS_EXECUTABLE)
+   set(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_CODEBLOCKS_EXECUTABLE} <PROJECT_FILE>" )
+endif(CMAKE_CODEBLOCKS_EXECUTABLE)
 
 # Determine builtin macros and include dirs:
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake)
diff --git a/Modules/CMakeFindEclipseCDT4.cmake b/Modules/CMakeFindEclipseCDT4.cmake
index 86c1a1bc2..37b72fa38 100644
--- a/Modules/CMakeFindEclipseCDT4.cmake
+++ b/Modules/CMakeFindEclipseCDT4.cmake
@@ -15,42 +15,42 @@
 # This file is included in CMakeSystemSpecificInformation.cmake if
 # the Eclipse CDT4 extra generator has been selected.
 
-FIND_PROGRAM(CMAKE_ECLIPSE_EXECUTABLE NAMES eclipse DOC "The Eclipse executable")
+find_program(CMAKE_ECLIPSE_EXECUTABLE NAMES eclipse DOC "The Eclipse executable")
 
-FUNCTION(_FIND_ECLIPSE_VERSION)
+function(_FIND_ECLIPSE_VERSION)
   # This code is in a function so the variables used here have only local scope
-  IF(CMAKE_ECLIPSE_EXECUTABLE)
+  if(CMAKE_ECLIPSE_EXECUTABLE)
     # use REALPATH to resolve symlinks (http://public.kitware.com/Bug/view.php?id=13036)
-    GET_FILENAME_COMPONENT(_REALPATH_CMAKE_ECLIPSE_EXECUTABLE "${CMAKE_ECLIPSE_EXECUTABLE}" REALPATH)
-    GET_FILENAME_COMPONENT(_ECLIPSE_DIR "${_REALPATH_CMAKE_ECLIPSE_EXECUTABLE}" PATH)
-    FILE(GLOB _ECLIPSE_FEATURE_DIR "${_ECLIPSE_DIR}/features/org.eclipse.platform*")
-    IF(APPLE AND NOT _ECLIPSE_FEATURE_DIR)
-      FILE(GLOB _ECLIPSE_FEATURE_DIR "${_ECLIPSE_DIR}/../../../features/org.eclipse.platform*")
-    ENDIF()
-    IF("${_ECLIPSE_FEATURE_DIR}" MATCHES ".+org.eclipse.platform_([0-9]+\\.[0-9]+).+")
-      SET(_ECLIPSE_VERSION ${CMAKE_MATCH_1})
-    ENDIF()
-  ENDIF()
+    get_filename_component(_REALPATH_CMAKE_ECLIPSE_EXECUTABLE "${CMAKE_ECLIPSE_EXECUTABLE}" REALPATH)
+    get_filename_component(_ECLIPSE_DIR "${_REALPATH_CMAKE_ECLIPSE_EXECUTABLE}" PATH)
+    file(GLOB _ECLIPSE_FEATURE_DIR "${_ECLIPSE_DIR}/features/org.eclipse.platform*")
+    if(APPLE AND NOT _ECLIPSE_FEATURE_DIR)
+      file(GLOB _ECLIPSE_FEATURE_DIR "${_ECLIPSE_DIR}/../../../features/org.eclipse.platform*")
+    endif()
+    if("${_ECLIPSE_FEATURE_DIR}" MATCHES ".+org.eclipse.platform_([0-9]+\\.[0-9]+).+")
+      set(_ECLIPSE_VERSION ${CMAKE_MATCH_1})
+    endif()
+  endif()
 
   # Set up a map with the names of the Eclipse releases:
-  SET(_ECLIPSE_VERSION_NAME_    "Unknown" )
-  SET(_ECLIPSE_VERSION_NAME_3.2 "Callisto" )
-  SET(_ECLIPSE_VERSION_NAME_3.3 "Europa" )
-  SET(_ECLIPSE_VERSION_NAME_3.4 "Ganymede" )
-  SET(_ECLIPSE_VERSION_NAME_3.5 "Galileo" )
-  SET(_ECLIPSE_VERSION_NAME_3.6 "Helios" )
-  SET(_ECLIPSE_VERSION_NAME_3.7 "Indigo" )
-  SET(_ECLIPSE_VERSION_NAME_4.2 "Juno" )
+  set(_ECLIPSE_VERSION_NAME_    "Unknown" )
+  set(_ECLIPSE_VERSION_NAME_3.2 "Callisto" )
+  set(_ECLIPSE_VERSION_NAME_3.3 "Europa" )
+  set(_ECLIPSE_VERSION_NAME_3.4 "Ganymede" )
+  set(_ECLIPSE_VERSION_NAME_3.5 "Galileo" )
+  set(_ECLIPSE_VERSION_NAME_3.6 "Helios" )
+  set(_ECLIPSE_VERSION_NAME_3.7 "Indigo" )
+  set(_ECLIPSE_VERSION_NAME_4.2 "Juno" )
 
-  IF(_ECLIPSE_VERSION)
-    MESSAGE(STATUS "Found Eclipse version ${_ECLIPSE_VERSION} (${_ECLIPSE_VERSION_NAME_${_ECLIPSE_VERSION}})")
-  ELSE()
-    SET(_ECLIPSE_VERSION "3.6" )
-    MESSAGE(STATUS "Could not determine Eclipse version, assuming at least ${_ECLIPSE_VERSION} (${_ECLIPSE_VERSION_NAME_${_ECLIPSE_VERSION}}). Adjust CMAKE_ECLIPSE_VERSION if this is wrong.")
-  ENDIF()
+  if(_ECLIPSE_VERSION)
+    message(STATUS "Found Eclipse version ${_ECLIPSE_VERSION} (${_ECLIPSE_VERSION_NAME_${_ECLIPSE_VERSION}})")
+  else()
+    set(_ECLIPSE_VERSION "3.6" )
+    message(STATUS "Could not determine Eclipse version, assuming at least ${_ECLIPSE_VERSION} (${_ECLIPSE_VERSION_NAME_${_ECLIPSE_VERSION}}). Adjust CMAKE_ECLIPSE_VERSION if this is wrong.")
+  endif()
 
-  SET(CMAKE_ECLIPSE_VERSION "${_ECLIPSE_VERSION} (${_ECLIPSE_VERSION_NAME_${_ECLIPSE_VERSION}})" CACHE STRING "The version of Eclipse. If Eclipse has not been found, 3.6 (Helios) is assumed.")
-  SET_PROPERTY(CACHE CMAKE_ECLIPSE_VERSION PROPERTY STRINGS "3.2 (${_ECLIPSE_VERSION_NAME_3.2})"
+  set(CMAKE_ECLIPSE_VERSION "${_ECLIPSE_VERSION} (${_ECLIPSE_VERSION_NAME_${_ECLIPSE_VERSION}})" CACHE STRING "The version of Eclipse. If Eclipse has not been found, 3.6 (Helios) is assumed.")
+  set_property(CACHE CMAKE_ECLIPSE_VERSION PROPERTY STRINGS "3.2 (${_ECLIPSE_VERSION_NAME_3.2})"
                                                             "3.3 (${_ECLIPSE_VERSION_NAME_3.3})"
                                                             "3.4 (${_ECLIPSE_VERSION_NAME_3.4})"
                                                             "3.5 (${_ECLIPSE_VERSION_NAME_3.5})"
@@ -58,28 +58,28 @@ FUNCTION(_FIND_ECLIPSE_VERSION)
                                                             "3.7 (${_ECLIPSE_VERSION_NAME_3.7})"
                                                             "4.2 (${_ECLIPSE_VERSION_NAME_4.2})"
               )
-ENDFUNCTION()
+endfunction()
 
 _FIND_ECLIPSE_VERSION()
 
 # Try to find out how many CPUs we have and set the -j argument for make accordingly
-SET(_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS "")
+set(_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS "")
 
-INCLUDE(ProcessorCount)
+include(ProcessorCount)
 PROCESSORCOUNT(_CMAKE_ECLIPSE_PROCESSOR_COUNT)
 
 # Only set -j if we are under UNIX and if the make-tool used actually has "make" in the name
 # (we may also get here in the future e.g. for ninja)
-IF("${_CMAKE_ECLIPSE_PROCESSOR_COUNT}" GREATER 1  AND  UNIX  AND  "${CMAKE_MAKE_PROGRAM}" MATCHES make)
-  SET(_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS "-j${_CMAKE_ECLIPSE_PROCESSOR_COUNT}")
-ENDIF()
+if("${_CMAKE_ECLIPSE_PROCESSOR_COUNT}" GREATER 1  AND  UNIX  AND  "${CMAKE_MAKE_PROGRAM}" MATCHES make)
+  set(_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS "-j${_CMAKE_ECLIPSE_PROCESSOR_COUNT}")
+endif()
 
 # This variable is used by the Eclipse generator and appended to the make invocation commands.
-SET(CMAKE_ECLIPSE_MAKE_ARGUMENTS "${_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS}" CACHE STRING "Additional command line arguments when Eclipse invokes make. Enter e.g. -j<some_number> to get parallel builds")
+set(CMAKE_ECLIPSE_MAKE_ARGUMENTS "${_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS}" CACHE STRING "Additional command line arguments when Eclipse invokes make. Enter e.g. -j<some_number> to get parallel builds")
 
 # This variable is used by the Eclipse generator in out-of-source builds only.
-SET(CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT FALSE CACHE BOOL "If enabled, CMake will generate a source project for Eclipse in CMAKE_SOURCE_DIR")
-MARK_AS_ADVANCED(CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT)
+set(CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT FALSE CACHE BOOL "If enabled, CMake will generate a source project for Eclipse in CMAKE_SOURCE_DIR")
+mark_as_advanced(CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT)
 
 # Determine builtin macros and include dirs:
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake)
diff --git a/Modules/CMakeFindFrameworks.cmake b/Modules/CMakeFindFrameworks.cmake
index 001da20f3..b47f44448 100644
--- a/Modules/CMakeFindFrameworks.cmake
+++ b/Modules/CMakeFindFrameworks.cmake
@@ -13,20 +13,20 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-IF(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
-  SET(CMAKE_FIND_FRAMEWORKS_INCLUDED 1)
-  MACRO(CMAKE_FIND_FRAMEWORKS fwk)
-    SET(${fwk}_FRAMEWORKS)
-    IF(APPLE)
-      FOREACH(dir
+if(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
+  set(CMAKE_FIND_FRAMEWORKS_INCLUDED 1)
+  macro(CMAKE_FIND_FRAMEWORKS fwk)
+    set(${fwk}_FRAMEWORKS)
+    if(APPLE)
+      foreach(dir
           ~/Library/Frameworks/${fwk}.framework
           /Library/Frameworks/${fwk}.framework
           /System/Library/Frameworks/${fwk}.framework
           /Network/Library/Frameworks/${fwk}.framework)
-        IF(EXISTS ${dir})
-          SET(${fwk}_FRAMEWORKS ${${fwk}_FRAMEWORKS} ${dir})
-        ENDIF(EXISTS ${dir})
-      ENDFOREACH(dir)
-    ENDIF(APPLE)
-  ENDMACRO(CMAKE_FIND_FRAMEWORKS)
-ENDIF(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
+        if(EXISTS ${dir})
+          set(${fwk}_FRAMEWORKS ${${fwk}_FRAMEWORKS} ${dir})
+        endif(EXISTS ${dir})
+      endforeach(dir)
+    endif(APPLE)
+  endmacro(CMAKE_FIND_FRAMEWORKS)
+endif(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
diff --git a/Modules/CMakeFindKDevelop3.cmake b/Modules/CMakeFindKDevelop3.cmake
index 331dc6ef9..dd144842c 100644
--- a/Modules/CMakeFindKDevelop3.cmake
+++ b/Modules/CMakeFindKDevelop3.cmake
@@ -15,9 +15,9 @@
 # This file is included in CMakeSystemSpecificInformation.cmake if
 # the KDevelop3 extra generator has been selected.
 
-FIND_PROGRAM(CMAKE_KDEVELOP3_EXECUTABLE NAMES kdevelop DOC "The KDevelop3 executable")
+find_program(CMAKE_KDEVELOP3_EXECUTABLE NAMES kdevelop DOC "The KDevelop3 executable")
 
-IF(CMAKE_KDEVELOP3_EXECUTABLE)
-   SET(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_KDEVELOP3_EXECUTABLE} <PROJECT_FILE>" )
-ENDIF(CMAKE_KDEVELOP3_EXECUTABLE)
+if(CMAKE_KDEVELOP3_EXECUTABLE)
+   set(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_KDEVELOP3_EXECUTABLE} <PROJECT_FILE>" )
+endif(CMAKE_KDEVELOP3_EXECUTABLE)
 
diff --git a/Modules/CMakeFindWMake.cmake b/Modules/CMakeFindWMake.cmake
index 6972c4c40..60275aea4 100644
--- a/Modules/CMakeFindWMake.cmake
+++ b/Modules/CMakeFindWMake.cmake
@@ -12,6 +12,6 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-SET (CMAKE_MAKE_PROGRAM "wmake" CACHE STRING
+set (CMAKE_MAKE_PROGRAM "wmake" CACHE STRING
      "Program used to build from makefiles.")
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
diff --git a/Modules/CMakeFindXCode.cmake b/Modules/CMakeFindXCode.cmake
index 53967b52a..5c4f59639 100644
--- a/Modules/CMakeFindXCode.cmake
+++ b/Modules/CMakeFindXCode.cmake
@@ -12,9 +12,9 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PROGRAM(CMAKE_MAKE_PROGRAM
+find_program(CMAKE_MAKE_PROGRAM
   NAMES xcodebuild
   PATHS
   /usr/bin
   )
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
diff --git a/Modules/CMakeForceCompiler.cmake b/Modules/CMakeForceCompiler.cmake
index 2a839fd93..c56406bb8 100644
--- a/Modules/CMakeForceCompiler.cmake
+++ b/Modules/CMakeForceCompiler.cmake
@@ -24,8 +24,8 @@
 # information tests.
 #
 # So a simple toolchain file could look like this:
-#   INCLUDE (CMakeForceCompiler)
-#   SET(CMAKE_SYSTEM_NAME Generic)
+#   include (CMakeForceCompiler)
+#   set(CMAKE_SYSTEM_NAME Generic)
 #   CMAKE_FORCE_C_COMPILER   (chc12 MetrowerksHicross)
 #   CMAKE_FORCE_CXX_COMPILER (chc12 MetrowerksHicross)
 
@@ -42,41 +42,41 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-MACRO(CMAKE_FORCE_C_COMPILER compiler id)
-  SET(CMAKE_C_COMPILER "${compiler}")
-  SET(CMAKE_C_COMPILER_ID_RUN TRUE)
-  SET(CMAKE_C_COMPILER_ID ${id})
-  SET(CMAKE_C_COMPILER_WORKS TRUE)
-  SET(CMAKE_C_COMPILER_FORCED TRUE)
+macro(CMAKE_FORCE_C_COMPILER compiler id)
+  set(CMAKE_C_COMPILER "${compiler}")
+  set(CMAKE_C_COMPILER_ID_RUN TRUE)
+  set(CMAKE_C_COMPILER_ID ${id})
+  set(CMAKE_C_COMPILER_WORKS TRUE)
+  set(CMAKE_C_COMPILER_FORCED TRUE)
 
   # Set old compiler id variables.
-  IF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
-    SET(CMAKE_COMPILER_IS_GNUCC 1)
-  ENDIF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
-ENDMACRO(CMAKE_FORCE_C_COMPILER)
+  if("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
+    set(CMAKE_COMPILER_IS_GNUCC 1)
+  endif("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
+endmacro(CMAKE_FORCE_C_COMPILER)
 
-MACRO(CMAKE_FORCE_CXX_COMPILER compiler id)
-  SET(CMAKE_CXX_COMPILER "${compiler}")
-  SET(CMAKE_CXX_COMPILER_ID_RUN TRUE)
-  SET(CMAKE_CXX_COMPILER_ID ${id})
-  SET(CMAKE_CXX_COMPILER_WORKS TRUE)
-  SET(CMAKE_CXX_COMPILER_FORCED TRUE)
+macro(CMAKE_FORCE_CXX_COMPILER compiler id)
+  set(CMAKE_CXX_COMPILER "${compiler}")
+  set(CMAKE_CXX_COMPILER_ID_RUN TRUE)
+  set(CMAKE_CXX_COMPILER_ID ${id})
+  set(CMAKE_CXX_COMPILER_WORKS TRUE)
+  set(CMAKE_CXX_COMPILER_FORCED TRUE)
 
   # Set old compiler id variables.
-  IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
-    SET(CMAKE_COMPILER_IS_GNUCXX 1)
-  ENDIF("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
-ENDMACRO(CMAKE_FORCE_CXX_COMPILER)
+  if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
+    set(CMAKE_COMPILER_IS_GNUCXX 1)
+  endif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
+endmacro(CMAKE_FORCE_CXX_COMPILER)
 
-MACRO(CMAKE_FORCE_Fortran_COMPILER compiler id)
-  SET(CMAKE_Fortran_COMPILER "${compiler}")
-  SET(CMAKE_Fortran_COMPILER_ID_RUN TRUE)
-  SET(CMAKE_Fortran_COMPILER_ID ${id})
-  SET(CMAKE_Fortran_COMPILER_WORKS TRUE)
-  SET(CMAKE_Fortran_COMPILER_FORCED TRUE)
+macro(CMAKE_FORCE_Fortran_COMPILER compiler id)
+  set(CMAKE_Fortran_COMPILER "${compiler}")
+  set(CMAKE_Fortran_COMPILER_ID_RUN TRUE)
+  set(CMAKE_Fortran_COMPILER_ID ${id})
+  set(CMAKE_Fortran_COMPILER_WORKS TRUE)
+  set(CMAKE_Fortran_COMPILER_FORCED TRUE)
 
   # Set old compiler id variables.
-  IF("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
-    SET(CMAKE_COMPILER_IS_GNUG77 1)
-  ENDIF("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
-ENDMACRO(CMAKE_FORCE_Fortran_COMPILER)
+  if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
+    set(CMAKE_COMPILER_IS_GNUG77 1)
+  endif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
+endmacro(CMAKE_FORCE_Fortran_COMPILER)
diff --git a/Modules/CMakeFortranCompiler.cmake.in b/Modules/CMakeFortranCompiler.cmake.in
index 53d95525f..d5905123c 100644
--- a/Modules/CMakeFortranCompiler.cmake.in
+++ b/Modules/CMakeFortranCompiler.cmake.in
@@ -1,52 +1,52 @@
-SET(CMAKE_Fortran_COMPILER "@CMAKE_Fortran_COMPILER@")
-SET(CMAKE_Fortran_COMPILER_ARG1 "@CMAKE_Fortran_COMPILER_ARG1@")
-SET(CMAKE_Fortran_COMPILER_ID "@CMAKE_Fortran_COMPILER_ID@")
-SET(CMAKE_Fortran_PLATFORM_ID "@CMAKE_Fortran_PLATFORM_ID@")
+set(CMAKE_Fortran_COMPILER "@CMAKE_Fortran_COMPILER@")
+set(CMAKE_Fortran_COMPILER_ARG1 "@CMAKE_Fortran_COMPILER_ARG1@")
+set(CMAKE_Fortran_COMPILER_ID "@CMAKE_Fortran_COMPILER_ID@")
+set(CMAKE_Fortran_PLATFORM_ID "@CMAKE_Fortran_PLATFORM_ID@")
 @SET_MSVC_Fortran_ARCHITECTURE_ID@
-SET(CMAKE_AR "@CMAKE_AR@")
-SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
-SET(CMAKE_COMPILER_IS_GNUG77 @CMAKE_COMPILER_IS_GNUG77@)
-SET(CMAKE_Fortran_COMPILER_LOADED 1)
-SET(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
-SET(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
-IF(CMAKE_COMPILER_IS_CYGWIN)
-  SET(CYGWIN 1)
-  SET(UNIX 1)
-ENDIF(CMAKE_COMPILER_IS_CYGWIN)
+set(CMAKE_AR "@CMAKE_AR@")
+set(CMAKE_RANLIB "@CMAKE_RANLIB@")
+set(CMAKE_COMPILER_IS_GNUG77 @CMAKE_COMPILER_IS_GNUG77@)
+set(CMAKE_Fortran_COMPILER_LOADED 1)
+set(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
+set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
+if(CMAKE_COMPILER_IS_CYGWIN)
+  set(CYGWIN 1)
+  set(UNIX 1)
+endif(CMAKE_COMPILER_IS_CYGWIN)
 
-SET(CMAKE_Fortran_COMPILER_ENV_VAR "FC")
+set(CMAKE_Fortran_COMPILER_ENV_VAR "FC")
 
-SET(CMAKE_Fortran_COMPILER_SUPPORTS_F90 @CMAKE_Fortran_COMPILER_SUPPORTS_F90@)
+set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 @CMAKE_Fortran_COMPILER_SUPPORTS_F90@)
 
-IF(CMAKE_COMPILER_IS_MINGW)
-  SET(MINGW 1)
-ENDIF(CMAKE_COMPILER_IS_MINGW)
-SET(CMAKE_Fortran_COMPILER_ID_RUN 1)
-SET(CMAKE_Fortran_SOURCE_FILE_EXTENSIONS f;F;f77;F77;f90;F90;for;For;FOR;f95;F95)
-SET(CMAKE_Fortran_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
-SET(CMAKE_Fortran_LINKER_PREFERENCE 20)
-IF(UNIX)
-  SET(CMAKE_Fortran_OUTPUT_EXTENSION .o)
-ELSE(UNIX)
-  SET(CMAKE_Fortran_OUTPUT_EXTENSION .obj)
-ENDIF(UNIX)
+if(CMAKE_COMPILER_IS_MINGW)
+  set(MINGW 1)
+endif(CMAKE_COMPILER_IS_MINGW)
+set(CMAKE_Fortran_COMPILER_ID_RUN 1)
+set(CMAKE_Fortran_SOURCE_FILE_EXTENSIONS f;F;f77;F77;f90;F90;for;For;FOR;f95;F95)
+set(CMAKE_Fortran_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
+set(CMAKE_Fortran_LINKER_PREFERENCE 20)
+if(UNIX)
+  set(CMAKE_Fortran_OUTPUT_EXTENSION .o)
+else(UNIX)
+  set(CMAKE_Fortran_OUTPUT_EXTENSION .obj)
+endif(UNIX)
 
 # Save compiler ABI information.
-SET(CMAKE_Fortran_SIZEOF_DATA_PTR "@CMAKE_Fortran_SIZEOF_DATA_PTR@")
-SET(CMAKE_Fortran_COMPILER_ABI "@CMAKE_Fortran_COMPILER_ABI@")
-SET(CMAKE_Fortran_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@")
+set(CMAKE_Fortran_SIZEOF_DATA_PTR "@CMAKE_Fortran_SIZEOF_DATA_PTR@")
+set(CMAKE_Fortran_COMPILER_ABI "@CMAKE_Fortran_COMPILER_ABI@")
+set(CMAKE_Fortran_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@")
 
-IF(CMAKE_Fortran_SIZEOF_DATA_PTR AND NOT CMAKE_SIZEOF_VOID_P)
-  SET(CMAKE_SIZEOF_VOID_P "${CMAKE_Fortran_SIZEOF_DATA_PTR}")
-ENDIF()
+if(CMAKE_Fortran_SIZEOF_DATA_PTR AND NOT CMAKE_SIZEOF_VOID_P)
+  set(CMAKE_SIZEOF_VOID_P "${CMAKE_Fortran_SIZEOF_DATA_PTR}")
+endif()
 
-IF(CMAKE_Fortran_COMPILER_ABI)
-  SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_Fortran_COMPILER_ABI}")
-ENDIF(CMAKE_Fortran_COMPILER_ABI)
+if(CMAKE_Fortran_COMPILER_ABI)
+  set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_Fortran_COMPILER_ABI}")
+endif(CMAKE_Fortran_COMPILER_ABI)
 
-IF(CMAKE_Fortran_LIBRARY_ARCHITECTURE)
-  SET(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@")
-ENDIF()
+if(CMAKE_Fortran_LIBRARY_ARCHITECTURE)
+  set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@")
+endif()
 
-SET(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "@CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES@")
-SET(CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES "@CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES@")
+set(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "@CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES@")
+set(CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES "@CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES@")
diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake
index b965e8368..c63b3dced 100644
--- a/Modules/CMakeFortranInformation.cmake
+++ b/Modules/CMakeFortranInformation.cmake
@@ -16,40 +16,40 @@
 # It also loads the available platform file for the system-compiler
 # if it exists.
 
-SET(_INCLUDED_FILE 0)
+set(_INCLUDED_FILE 0)
 
 # Load compiler-specific information.
-IF(CMAKE_Fortran_COMPILER_ID)
-  INCLUDE(Compiler/${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL)
-ENDIF(CMAKE_Fortran_COMPILER_ID)
+if(CMAKE_Fortran_COMPILER_ID)
+  include(Compiler/${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL)
+endif(CMAKE_Fortran_COMPILER_ID)
 
-SET(CMAKE_BASE_NAME)
-GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_Fortran_COMPILER} NAME_WE)
+set(CMAKE_BASE_NAME)
+get_filename_component(CMAKE_BASE_NAME ${CMAKE_Fortran_COMPILER} NAME_WE)
 # since the gnu compiler has several names force g++
-IF(CMAKE_COMPILER_IS_GNUG77)
-  SET(CMAKE_BASE_NAME g77)
-ENDIF(CMAKE_COMPILER_IS_GNUG77)
-IF(CMAKE_Fortran_COMPILER_ID)
-  INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
-ENDIF(CMAKE_Fortran_COMPILER_ID)
-IF (NOT _INCLUDED_FILE)
-  INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
+if(CMAKE_COMPILER_IS_GNUG77)
+  set(CMAKE_BASE_NAME g77)
+endif(CMAKE_COMPILER_IS_GNUG77)
+if(CMAKE_Fortran_COMPILER_ID)
+  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
+endif(CMAKE_Fortran_COMPILER_ID)
+if (NOT _INCLUDED_FILE)
+  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
           RESULT_VARIABLE _INCLUDED_FILE)
-ENDIF (NOT _INCLUDED_FILE)
+endif (NOT _INCLUDED_FILE)
 # We specify the compiler information in the system file for some
 # platforms, but this language may not have been enabled when the file
 # was first included.  Include it again to get the language info.
 # Remove this when all compiler info is removed from system files.
-IF (NOT _INCLUDED_FILE)
-  INCLUDE(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
-ENDIF (NOT _INCLUDED_FILE)
+if (NOT _INCLUDED_FILE)
+  include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
+endif (NOT _INCLUDED_FILE)
 
-IF(CMAKE_Fortran_SIZEOF_DATA_PTR)
-  FOREACH(f ${CMAKE_Fortran_ABI_FILES})
-    INCLUDE(${f})
-  ENDFOREACH()
-  UNSET(CMAKE_Fortran_ABI_FILES)
-ENDIF()
+if(CMAKE_Fortran_SIZEOF_DATA_PTR)
+  foreach(f ${CMAKE_Fortran_ABI_FILES})
+    include(${f})
+  endforeach()
+  unset(CMAKE_Fortran_ABI_FILES)
+endif()
 
 # This should be included before the _INIT variables are
 # used to initialize the cache.  Since the rule variables
@@ -57,122 +57,122 @@ ENDIF()
 # But, it should still be after the platform file so changes can
 # be made to those values.
 
-IF(CMAKE_USER_MAKE_RULES_OVERRIDE)
+if(CMAKE_USER_MAKE_RULES_OVERRIDE)
   # Save the full path of the file so try_compile can use it.
-  INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
-  SET(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
-ENDIF()
+  include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
+  set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
+endif()
 
-IF(CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran)
+if(CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran)
   # Save the full path of the file so try_compile can use it.
-  INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran} RESULT_VARIABLE _override)
-  SET(CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran "${_override}")
-ENDIF()
+  include(${CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran} RESULT_VARIABLE _override)
+  set(CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran "${_override}")
+endif()
 
 
 # Fortran needs cmake to do a requires step during its build process to
 # catch any modules
-SET(CMAKE_NEEDS_REQUIRES_STEP_Fortran_FLAG 1)
+set(CMAKE_NEEDS_REQUIRES_STEP_Fortran_FLAG 1)
 
-IF(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIC)
-  SET(CMAKE_Fortran_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC})
-ENDIF(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIC)
+if(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIC)
+  set(CMAKE_Fortran_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC})
+endif(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIC)
 
-IF(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE)
-  SET(CMAKE_Fortran_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
-ENDIF(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE)
+if(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE)
+  set(CMAKE_Fortran_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
+endif(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE)
 
-IF(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL)
-  SET(CMAKE_Fortran_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
-ENDIF(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL)
+if(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL)
+  set(CMAKE_Fortran_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
+endif(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL)
 
 # Create a set of shared library variable specific to Fortran
 # For 90% of the systems, these are the same flags as the C versions
 # so if these are not set just copy the flags from the c version
-IF(NOT DEFINED CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS)
-  SET(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
-ENDIF()
+if(NOT DEFINED CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS)
+  set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
+endif()
 
-IF(NOT DEFINED CMAKE_SHARED_LIBRARY_Fortran_FLAGS)
-  SET(CMAKE_SHARED_LIBRARY_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
-ENDIF()
+if(NOT DEFINED CMAKE_SHARED_LIBRARY_Fortran_FLAGS)
+  set(CMAKE_SHARED_LIBRARY_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
+endif()
 
-IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS)
-  SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
-ENDIF()
+if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS)
+  set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
+endif()
 
-IF(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG)
-  SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
-ENDIF()
+if(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG)
+  set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
+endif()
 
-IF(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP)
-  SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
-ENDIF()
+if(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP)
+  set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
+endif()
 
-IF(NOT DEFINED CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG)
-  SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
-ENDIF()
+if(NOT DEFINED CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG)
+  set(CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
+endif()
 
-IF(NOT DEFINED CMAKE_EXE_EXPORTS_Fortran_FLAG)
-  SET(CMAKE_EXE_EXPORTS_Fortran_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG})
-ENDIF()
+if(NOT DEFINED CMAKE_EXE_EXPORTS_Fortran_FLAG)
+  set(CMAKE_EXE_EXPORTS_Fortran_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG})
+endif()
 
-IF(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG)
-  SET(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
-ENDIF()
+if(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG)
+  set(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
+endif()
 
 # for most systems a module is the same as a shared library
 # so unless the variable CMAKE_MODULE_EXISTS is set just
 # copy the values from the LIBRARY variables
-IF(NOT CMAKE_MODULE_EXISTS)
-  SET(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_Fortran_FLAGS})
-  SET(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS})
-ENDIF(NOT CMAKE_MODULE_EXISTS)
+if(NOT CMAKE_MODULE_EXISTS)
+  set(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_Fortran_FLAGS})
+  set(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS})
+endif(NOT CMAKE_MODULE_EXISTS)
 
 # repeat for modules
-IF(NOT DEFINED CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS)
-  SET(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
-ENDIF()
+if(NOT DEFINED CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS)
+  set(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
+endif()
 
-IF(NOT DEFINED CMAKE_SHARED_MODULE_Fortran_FLAGS)
-  SET(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
-ENDIF()
+if(NOT DEFINED CMAKE_SHARED_MODULE_Fortran_FLAGS)
+  set(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
+endif()
 
-IF(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG)
-  SET(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG})
-ENDIF()
+if(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG)
+  set(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG})
+endif()
 
-IF(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP)
-  SET(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP})
-ENDIF()
+if(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP)
+  set(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP})
+endif()
 
-IF(NOT DEFINED CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG)
-  SET(CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG})
-ENDIF()
+if(NOT DEFINED CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG)
+  set(CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG})
+endif()
 
-IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH)
-  SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH})
-ENDIF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH)
+if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH)
+  set(CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH})
+endif(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH)
 
-IF(NOT CMAKE_INCLUDE_FLAG_Fortran)
-  SET(CMAKE_INCLUDE_FLAG_Fortran ${CMAKE_INCLUDE_FLAG_C})
-ENDIF(NOT CMAKE_INCLUDE_FLAG_Fortran)
+if(NOT CMAKE_INCLUDE_FLAG_Fortran)
+  set(CMAKE_INCLUDE_FLAG_Fortran ${CMAKE_INCLUDE_FLAG_C})
+endif(NOT CMAKE_INCLUDE_FLAG_Fortran)
 
-IF(NOT CMAKE_INCLUDE_FLAG_SEP_Fortran)
-  SET(CMAKE_INCLUDE_FLAG_SEP_Fortran ${CMAKE_INCLUDE_FLAG_SEP_C})
-ENDIF(NOT CMAKE_INCLUDE_FLAG_SEP_Fortran)
+if(NOT CMAKE_INCLUDE_FLAG_SEP_Fortran)
+  set(CMAKE_INCLUDE_FLAG_SEP_Fortran ${CMAKE_INCLUDE_FLAG_SEP_C})
+endif(NOT CMAKE_INCLUDE_FLAG_SEP_Fortran)
 
-SET(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make.  This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")
+set(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make.  This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")
 
-SET(CMAKE_Fortran_FLAGS_INIT "$ENV{FFLAGS} ${CMAKE_Fortran_FLAGS_INIT}")
+set(CMAKE_Fortran_FLAGS_INIT "$ENV{FFLAGS} ${CMAKE_Fortran_FLAGS_INIT}")
 # avoid just having a space as the initial value for the cache
-IF(CMAKE_Fortran_FLAGS_INIT STREQUAL " ")
-  SET(CMAKE_Fortran_FLAGS_INIT)
-ENDIF(CMAKE_Fortran_FLAGS_INIT STREQUAL " ")
-SET (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_INIT}" CACHE STRING
+if(CMAKE_Fortran_FLAGS_INIT STREQUAL " ")
+  set(CMAKE_Fortran_FLAGS_INIT)
+endif(CMAKE_Fortran_FLAGS_INIT STREQUAL " ")
+set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_INIT}" CACHE STRING
      "Flags for Fortran compiler.")
 
-INCLUDE(CMakeCommonLanguageInclude)
+include(CMakeCommonLanguageInclude)
 
 # now define the following rule variables
 # CMAKE_Fortran_CREATE_SHARED_LIBRARY
@@ -181,60 +181,60 @@ INCLUDE(CMakeCommonLanguageInclude)
 # CMAKE_Fortran_LINK_EXECUTABLE
 
 # create a Fortran shared library
-IF(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY)
-  SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY
+if(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY)
+  set(CMAKE_Fortran_CREATE_SHARED_LIBRARY
       "<CMAKE_Fortran_COMPILER> <CMAKE_SHARED_LIBRARY_Fortran_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
-ENDIF(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY)
+endif(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY)
 
 # create a Fortran shared module just copy the shared library rule
-IF(NOT CMAKE_Fortran_CREATE_SHARED_MODULE)
-  SET(CMAKE_Fortran_CREATE_SHARED_MODULE ${CMAKE_Fortran_CREATE_SHARED_LIBRARY})
-ENDIF(NOT CMAKE_Fortran_CREATE_SHARED_MODULE)
+if(NOT CMAKE_Fortran_CREATE_SHARED_MODULE)
+  set(CMAKE_Fortran_CREATE_SHARED_MODULE ${CMAKE_Fortran_CREATE_SHARED_LIBRARY})
+endif(NOT CMAKE_Fortran_CREATE_SHARED_MODULE)
 
 # Create a static archive incrementally for large object file counts.
 # If CMAKE_Fortran_CREATE_STATIC_LIBRARY is set it will override these.
-IF(NOT DEFINED CMAKE_Fortran_ARCHIVE_CREATE)
-  SET(CMAKE_Fortran_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
-ENDIF()
-IF(NOT DEFINED CMAKE_Fortran_ARCHIVE_APPEND)
-  SET(CMAKE_Fortran_ARCHIVE_APPEND "<CMAKE_AR> r  <TARGET> <LINK_FLAGS> <OBJECTS>")
-ENDIF()
-IF(NOT DEFINED CMAKE_Fortran_ARCHIVE_FINISH)
-  SET(CMAKE_Fortran_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
-ENDIF()
+if(NOT DEFINED CMAKE_Fortran_ARCHIVE_CREATE)
+  set(CMAKE_Fortran_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
+endif()
+if(NOT DEFINED CMAKE_Fortran_ARCHIVE_APPEND)
+  set(CMAKE_Fortran_ARCHIVE_APPEND "<CMAKE_AR> r  <TARGET> <LINK_FLAGS> <OBJECTS>")
+endif()
+if(NOT DEFINED CMAKE_Fortran_ARCHIVE_FINISH)
+  set(CMAKE_Fortran_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
+endif()
 
 # compile a Fortran file into an object file
 # (put -o after -c to workaround bug in at least one mpif77 wrapper)
-IF(NOT CMAKE_Fortran_COMPILE_OBJECT)
-  SET(CMAKE_Fortran_COMPILE_OBJECT
+if(NOT CMAKE_Fortran_COMPILE_OBJECT)
+  set(CMAKE_Fortran_COMPILE_OBJECT
     "<CMAKE_Fortran_COMPILER> <DEFINES> <FLAGS> -c <SOURCE> -o <OBJECT>")
-ENDIF(NOT CMAKE_Fortran_COMPILE_OBJECT)
+endif(NOT CMAKE_Fortran_COMPILE_OBJECT)
 
 # link a fortran program
-IF(NOT CMAKE_Fortran_LINK_EXECUTABLE)
-  SET(CMAKE_Fortran_LINK_EXECUTABLE
+if(NOT CMAKE_Fortran_LINK_EXECUTABLE)
+  set(CMAKE_Fortran_LINK_EXECUTABLE
     "<CMAKE_Fortran_COMPILER> <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <FLAGS> <OBJECTS>  -o <TARGET> <LINK_LIBRARIES>")
-ENDIF(NOT CMAKE_Fortran_LINK_EXECUTABLE)
+endif(NOT CMAKE_Fortran_LINK_EXECUTABLE)
 
-IF(CMAKE_Fortran_STANDARD_LIBRARIES_INIT)
-  SET(CMAKE_Fortran_STANDARD_LIBRARIES "${CMAKE_Fortran_STANDARD_LIBRARIES_INIT}"
+if(CMAKE_Fortran_STANDARD_LIBRARIES_INIT)
+  set(CMAKE_Fortran_STANDARD_LIBRARIES "${CMAKE_Fortran_STANDARD_LIBRARIES_INIT}"
     CACHE STRING "Libraries linked by defalut with all Fortran applications.")
-  MARK_AS_ADVANCED(CMAKE_Fortran_STANDARD_LIBRARIES)
-ENDIF(CMAKE_Fortran_STANDARD_LIBRARIES_INIT)
+  mark_as_advanced(CMAKE_Fortran_STANDARD_LIBRARIES)
+endif(CMAKE_Fortran_STANDARD_LIBRARIES_INIT)
 
-IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
-  SET (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG_INIT}" CACHE STRING
+if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+  set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG_INIT}" CACHE STRING
      "Flags used by the compiler during debug builds.")
-  SET (CMAKE_Fortran_FLAGS_MINSIZEREL "${CMAKE_Fortran_FLAGS_MINSIZEREL_INIT}" CACHE STRING
+  set (CMAKE_Fortran_FLAGS_MINSIZEREL "${CMAKE_Fortran_FLAGS_MINSIZEREL_INIT}" CACHE STRING
       "Flags used by the compiler during release minsize builds.")
-  SET (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE_INIT}" CACHE STRING
+  set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE_INIT}" CACHE STRING
      "Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
-  SET (CMAKE_Fortran_FLAGS_RELWITHDEBINFO "${CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
+  set (CMAKE_Fortran_FLAGS_RELWITHDEBINFO "${CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
      "Flags used by the compiler during Release with Debug Info builds.")
 
-ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+endif(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
 
-MARK_AS_ADVANCED(
+mark_as_advanced(
 CMAKE_Fortran_FLAGS
 CMAKE_Fortran_FLAGS_DEBUG
 CMAKE_Fortran_FLAGS_MINSIZEREL
@@ -242,4 +242,4 @@ CMAKE_Fortran_FLAGS_RELEASE
 CMAKE_Fortran_FLAGS_RELWITHDEBINFO)
 
 # set this variable so we can avoid loading this more than once.
-SET(CMAKE_Fortran_INFORMATION_LOADED 1)
+set(CMAKE_Fortran_INFORMATION_LOADED 1)
diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake
index 0ccbfac56..91904d7a5 100644
--- a/Modules/CMakeGenericSystem.cmake
+++ b/Modules/CMakeGenericSystem.cmake
@@ -12,60 +12,60 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "")            # -pic
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")       # -shared
-SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")         # +s, flag for exe link to use shared lib
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "")       # -rpath
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "")   # : or empty
-SET(CMAKE_INCLUDE_FLAG_C "-I")       # -I
-SET(CMAKE_INCLUDE_FLAG_C_SEP "")     # , or empty
-SET(CMAKE_LIBRARY_PATH_FLAG "-L")
-SET(CMAKE_LIBRARY_PATH_TERMINATOR "")  # for the Digital Mars D compiler the link paths have to be terminated with a "/"
-SET(CMAKE_LINK_LIBRARY_FLAG "-l")
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "")            # -pic
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")       # -shared
+set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")         # +s, flag for exe link to use shared lib
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "")       # -rpath
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "")   # : or empty
+set(CMAKE_INCLUDE_FLAG_C "-I")       # -I
+set(CMAKE_INCLUDE_FLAG_C_SEP "")     # , or empty
+set(CMAKE_LIBRARY_PATH_FLAG "-L")
+set(CMAKE_LIBRARY_PATH_TERMINATOR "")  # for the Digital Mars D compiler the link paths have to be terminated with a "/"
+set(CMAKE_LINK_LIBRARY_FLAG "-l")
 
-SET(CMAKE_LINK_LIBRARY_SUFFIX "")
-SET(CMAKE_STATIC_LIBRARY_PREFIX "lib")
-SET(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
-SET(CMAKE_SHARED_LIBRARY_PREFIX "lib")          # lib
-SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so")          # .so
-SET(CMAKE_EXECUTABLE_SUFFIX "")          # .exe
-SET(CMAKE_DL_LIBS "dl")
+set(CMAKE_LINK_LIBRARY_SUFFIX "")
+set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
+set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
+set(CMAKE_SHARED_LIBRARY_PREFIX "lib")          # lib
+set(CMAKE_SHARED_LIBRARY_SUFFIX ".so")          # .so
+set(CMAKE_EXECUTABLE_SUFFIX "")          # .exe
+set(CMAKE_DL_LIBS "dl")
 
-SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
-SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
+set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
 
 # basically all general purpose OSs support shared libs
-SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
+set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
 
-SET (CMAKE_SKIP_RPATH "NO" CACHE BOOL
+set (CMAKE_SKIP_RPATH "NO" CACHE BOOL
      "If set, runtime paths are not added when using shared libraries.")
-SET (CMAKE_SKIP_INSTALL_RPATH "NO" CACHE BOOL
+set (CMAKE_SKIP_INSTALL_RPATH "NO" CACHE BOOL
      "If set, runtime paths are not added when installing shared libraries, but are added when building.")
 
-SET(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make.  This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")
+set(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make.  This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")
 
-IF(CMAKE_GENERATOR MATCHES "Makefiles")
-  SET(CMAKE_COLOR_MAKEFILE ON CACHE BOOL
+if(CMAKE_GENERATOR MATCHES "Makefiles")
+  set(CMAKE_COLOR_MAKEFILE ON CACHE BOOL
     "Enable/Disable color output during build."
     )
-  MARK_AS_ADVANCED(CMAKE_COLOR_MAKEFILE)
-  IF(DEFINED CMAKE_RULE_MESSAGES)
-    SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES ${CMAKE_RULE_MESSAGES})
-  ENDIF(DEFINED CMAKE_RULE_MESSAGES)
-  IF(CMAKE_GENERATOR MATCHES "Unix Makefiles")
-    SET(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL
+  mark_as_advanced(CMAKE_COLOR_MAKEFILE)
+  if(DEFINED CMAKE_RULE_MESSAGES)
+    set_property(GLOBAL PROPERTY RULE_MESSAGES ${CMAKE_RULE_MESSAGES})
+  endif(DEFINED CMAKE_RULE_MESSAGES)
+  if(CMAKE_GENERATOR MATCHES "Unix Makefiles")
+    set(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL
       "Enable/Disable output of compile commands during generation."
       )
-    MARK_AS_ADVANCED(CMAKE_EXPORT_COMPILE_COMMANDS)
-  ENDIF(CMAKE_GENERATOR MATCHES "Unix Makefiles")
-ENDIF(CMAKE_GENERATOR MATCHES "Makefiles")
+    mark_as_advanced(CMAKE_EXPORT_COMPILE_COMMANDS)
+  endif(CMAKE_GENERATOR MATCHES "Unix Makefiles")
+endif(CMAKE_GENERATOR MATCHES "Makefiles")
 
-IF(CMAKE_GENERATOR MATCHES "Ninja")
-  SET(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL
+if(CMAKE_GENERATOR MATCHES "Ninja")
+  set(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL
     "Enable/Disable output of compile commands during generation."
     )
-  MARK_AS_ADVANCED(CMAKE_EXPORT_COMPILE_COMMANDS)
-ENDIF(CMAKE_GENERATOR MATCHES "Ninja")
+  mark_as_advanced(CMAKE_EXPORT_COMPILE_COMMANDS)
+endif(CMAKE_GENERATOR MATCHES "Ninja")
 
 # GetDefaultWindowsPrefixBase
 #
@@ -160,27 +160,27 @@ endfunction()
 # was initialized by the block below.  This is useful for user
 # projects to change the default prefix while still allowing the
 # command line to override it.
-IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
-  SET(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 1)
-ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
+if(NOT DEFINED CMAKE_INSTALL_PREFIX)
+  set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 1)
+endif(NOT DEFINED CMAKE_INSTALL_PREFIX)
 
 # Choose a default install prefix for this platform.
-IF(CMAKE_HOST_UNIX)
-  SET(CMAKE_INSTALL_PREFIX "/usr/local"
+if(CMAKE_HOST_UNIX)
+  set(CMAKE_INSTALL_PREFIX "/usr/local"
     CACHE PATH "Install path prefix, prepended onto install directories.")
-ELSE(CMAKE_HOST_UNIX)
+else(CMAKE_HOST_UNIX)
   GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES)
-  SET(CMAKE_INSTALL_PREFIX
+  set(CMAKE_INSTALL_PREFIX
     "${CMAKE_GENERIC_PROGRAM_FILES}/${PROJECT_NAME}"
     CACHE PATH "Install path prefix, prepended onto install directories.")
-  SET(CMAKE_GENERIC_PROGRAM_FILES)
-ENDIF(CMAKE_HOST_UNIX)
+  set(CMAKE_GENERIC_PROGRAM_FILES)
+endif(CMAKE_HOST_UNIX)
 
 # Set a variable which will be used as component name in install() commands
 # where no COMPONENT has been given:
-SET(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "Unspecified")
+set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "Unspecified")
 
-MARK_AS_ADVANCED(
+mark_as_advanced(
   CMAKE_SKIP_RPATH
   CMAKE_SKIP_INSTALL_RPATH
   CMAKE_VERBOSE_MAKEFILE
diff --git a/Modules/CMakeImportBuildSettings.cmake b/Modules/CMakeImportBuildSettings.cmake
index 848d89445..f0080ecd5 100644
--- a/Modules/CMakeImportBuildSettings.cmake
+++ b/Modules/CMakeImportBuildSettings.cmake
@@ -16,9 +16,9 @@
 
 # This macro used to load build settings from another project that
 # stored settings using the CMAKE_EXPORT_BUILD_SETTINGS macro.
-MACRO(CMAKE_IMPORT_BUILD_SETTINGS SETTINGS_FILE)
-  IF(${SETTINGS_FILE} MATCHES ".+")
-  ELSE(${SETTINGS_FILE} MATCHES ".+")
-    MESSAGE(SEND_ERROR "CMAKE_IMPORT_BUILD_SETTINGS called with no argument.")
-  ENDIF(${SETTINGS_FILE} MATCHES ".+")
-ENDMACRO(CMAKE_IMPORT_BUILD_SETTINGS)
+macro(CMAKE_IMPORT_BUILD_SETTINGS SETTINGS_FILE)
+  if(${SETTINGS_FILE} MATCHES ".+")
+  else(${SETTINGS_FILE} MATCHES ".+")
+    message(SEND_ERROR "CMAKE_IMPORT_BUILD_SETTINGS called with no argument.")
+  endif(${SETTINGS_FILE} MATCHES ".+")
+endmacro(CMAKE_IMPORT_BUILD_SETTINGS)
diff --git a/Modules/CMakeJOMFindMake.cmake b/Modules/CMakeJOMFindMake.cmake
index 617f3bb90..cb3cf12c8 100644
--- a/Modules/CMakeJOMFindMake.cmake
+++ b/Modules/CMakeJOMFindMake.cmake
@@ -13,6 +13,6 @@
 #  License text for the above reference.)
 
 
-SET (CMAKE_MAKE_PROGRAM "jom" CACHE STRING
+set (CMAKE_MAKE_PROGRAM "jom" CACHE STRING
      "Program used to build from makefiles.")
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
diff --git a/Modules/CMakeJavaCompiler.cmake.in b/Modules/CMakeJavaCompiler.cmake.in
index 79c9288bc..cd4158c8e 100644
--- a/Modules/CMakeJavaCompiler.cmake.in
+++ b/Modules/CMakeJavaCompiler.cmake.in
@@ -1,13 +1,13 @@
-SET(CMAKE_Java_COMPILER "@CMAKE_Java_COMPILER@")
-SET(CMAKE_Java_COMPILER_ARG1 "@CMAKE_Java_COMPILER_ARG1@")
-SET(CMAKE_Java_RUNTIME  "@CMAKE_Java_RUNTIME@")
-SET(CMAKE_Java_ARCHIVE  "@CMAKE_Java_ARCHIVE@")
-SET(CMAKE_Java_COMPILER_LOADED 1)
+set(CMAKE_Java_COMPILER "@CMAKE_Java_COMPILER@")
+set(CMAKE_Java_COMPILER_ARG1 "@CMAKE_Java_COMPILER_ARG1@")
+set(CMAKE_Java_RUNTIME  "@CMAKE_Java_RUNTIME@")
+set(CMAKE_Java_ARCHIVE  "@CMAKE_Java_ARCHIVE@")
+set(CMAKE_Java_COMPILER_LOADED 1)
 
-SET(CMAKE_Java_SOURCE_FILE_EXTENSIONS java)
-SET(CMAKE_Java_LINKER_PREFERENCE 40)
-SET(CMAKE_Java_OUTPUT_EXTENSION .class)
-SET(CMAKE_Java_OUTPUT_EXTENSION_REPLACE 1)
-SET(CMAKE_STATIC_LIBRARY_PREFIX_Java "")
-SET(CMAKE_STATIC_LIBRARY_SUFFIX_Java ".jar")
-SET(CMAKE_Java_COMPILER_ENV_VAR "JAVA_COMPILER")
+set(CMAKE_Java_SOURCE_FILE_EXTENSIONS java)
+set(CMAKE_Java_LINKER_PREFERENCE 40)
+set(CMAKE_Java_OUTPUT_EXTENSION .class)
+set(CMAKE_Java_OUTPUT_EXTENSION_REPLACE 1)
+set(CMAKE_STATIC_LIBRARY_PREFIX_Java "")
+set(CMAKE_STATIC_LIBRARY_SUFFIX_Java ".jar")
+set(CMAKE_Java_COMPILER_ENV_VAR "JAVA_COMPILER")
diff --git a/Modules/CMakeJavaInformation.cmake b/Modules/CMakeJavaInformation.cmake
index 7f812bd32..79208ca51 100644
--- a/Modules/CMakeJavaInformation.cmake
+++ b/Modules/CMakeJavaInformation.cmake
@@ -18,42 +18,42 @@
 # But, it should still be after the platform file so changes can
 # be made to those values.
 
-IF(CMAKE_USER_MAKE_RULES_OVERRIDE)
+if(CMAKE_USER_MAKE_RULES_OVERRIDE)
   # Save the full path of the file so try_compile can use it.
-  INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
-  SET(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
-ENDIF()
+  include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
+  set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
+endif()
 
-IF(CMAKE_USER_MAKE_RULES_OVERRIDE_Java)
+if(CMAKE_USER_MAKE_RULES_OVERRIDE_Java)
   # Save the full path of the file so try_compile can use it.
-   INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_Java} RESULT_VARIABLE _override)
-   SET(CMAKE_USER_MAKE_RULES_OVERRIDE_Java "${_override}")
-ENDIF()
+   include(${CMAKE_USER_MAKE_RULES_OVERRIDE_Java} RESULT_VARIABLE _override)
+   set(CMAKE_USER_MAKE_RULES_OVERRIDE_Java "${_override}")
+endif()
 
 # this is a place holder if java needed flags for javac they would go here.
-IF(NOT CMAKE_Java_CREATE_STATIC_LIBRARY)
-#  IF(WIN32)
-#    SET(class_files_mask "*.class")
-#  ELSE(WIN32)
-    SET(class_files_mask ".")
-#  ENDIF(WIN32)
+if(NOT CMAKE_Java_CREATE_STATIC_LIBRARY)
+#  if(WIN32)
+#    set(class_files_mask "*.class")
+#  else(WIN32)
+    set(class_files_mask ".")
+#  endif(WIN32)
 
-  SET(CMAKE_Java_CREATE_STATIC_LIBRARY
+  set(CMAKE_Java_CREATE_STATIC_LIBRARY
       "<CMAKE_Java_ARCHIVE> -cf <TARGET> -C <OBJECT_DIR> ${class_files_mask}")
     # "${class_files_mask}" should really be "<OBJECTS>" but compling a *.java
     # file can create more than one *.class file...
-ENDIF(NOT CMAKE_Java_CREATE_STATIC_LIBRARY)
+endif(NOT CMAKE_Java_CREATE_STATIC_LIBRARY)
 
 # compile a Java file into an object file
-IF(NOT CMAKE_Java_COMPILE_OBJECT)
-  SET(CMAKE_Java_COMPILE_OBJECT
+if(NOT CMAKE_Java_COMPILE_OBJECT)
+  set(CMAKE_Java_COMPILE_OBJECT
     "<CMAKE_Java_COMPILER> <FLAGS> <SOURCE> -d <OBJECT_DIR>")
-ENDIF(NOT CMAKE_Java_COMPILE_OBJECT)
+endif(NOT CMAKE_Java_COMPILE_OBJECT)
 
 # set java include flag option and the separator for multiple include paths
-SET(CMAKE_INCLUDE_FLAG_Java "-classpath ")
-IF(WIN32 AND NOT CYGWIN)
-  SET(CMAKE_INCLUDE_FLAG_SEP_Java ";")
-ELSE(WIN32 AND NOT CYGWIN)
-  SET(CMAKE_INCLUDE_FLAG_SEP_Java ":")
-ENDIF(WIN32 AND NOT CYGWIN)
+set(CMAKE_INCLUDE_FLAG_Java "-classpath ")
+if(WIN32 AND NOT CYGWIN)
+  set(CMAKE_INCLUDE_FLAG_SEP_Java ";")
+else(WIN32 AND NOT CYGWIN)
+  set(CMAKE_INCLUDE_FLAG_SEP_Java ":")
+endif(WIN32 AND NOT CYGWIN)
diff --git a/Modules/CMakeMSYSFindMake.cmake b/Modules/CMakeMSYSFindMake.cmake
index 29dc2c025..bc0f89fff 100644
--- a/Modules/CMakeMSYSFindMake.cmake
+++ b/Modules/CMakeMSYSFindMake.cmake
@@ -12,9 +12,9 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PROGRAM(CMAKE_MAKE_PROGRAM make
+find_program(CMAKE_MAKE_PROGRAM make
   PATHS
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MSYS-1.0_is1;Inno Setup: App Path]/bin"
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin"
   c:/msys/1.0/bin /msys/1.0/bin)
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
diff --git a/Modules/CMakeMinGWFindMake.cmake b/Modules/CMakeMinGWFindMake.cmake
index 61ddb8c6c..9081e68c1 100644
--- a/Modules/CMakeMinGWFindMake.cmake
+++ b/Modules/CMakeMinGWFindMake.cmake
@@ -12,13 +12,13 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PROGRAM(CMAKE_MAKE_PROGRAM mingw32-make.exe PATHS
+find_program(CMAKE_MAKE_PROGRAM mingw32-make.exe PATHS
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin"
   c:/MinGW/bin /MinGW/bin)
-FIND_PROGRAM(CMAKE_SH sh.exe )
-IF(CMAKE_SH)
-  MESSAGE(FATAL_ERROR "sh.exe was found in your PATH, here:\n${CMAKE_SH}\nFor MinGW make to work correctly sh.exe must NOT be in your path.\nRun cmake from a shell that does not have sh.exe in your PATH.\nIf you want to use a UNIX shell, then use MSYS Makefiles.\n")
-  SET(CMAKE_MAKE_PROGRAM NOTFOUND)
-ENDIF(CMAKE_SH)
+find_program(CMAKE_SH sh.exe )
+if(CMAKE_SH)
+  message(FATAL_ERROR "sh.exe was found in your PATH, here:\n${CMAKE_SH}\nFor MinGW make to work correctly sh.exe must NOT be in your path.\nRun cmake from a shell that does not have sh.exe in your PATH.\nIf you want to use a UNIX shell, then use MSYS Makefiles.\n")
+  set(CMAKE_MAKE_PROGRAM NOTFOUND)
+endif(CMAKE_SH)
 
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM CMAKE_SH)
+mark_as_advanced(CMAKE_MAKE_PROGRAM CMAKE_SH)
diff --git a/Modules/CMakeNMakeFindMake.cmake b/Modules/CMakeNMakeFindMake.cmake
index f6472170c..d807df82b 100644
--- a/Modules/CMakeNMakeFindMake.cmake
+++ b/Modules/CMakeNMakeFindMake.cmake
@@ -13,6 +13,6 @@
 #  License text for the above reference.)
 
 
-SET (CMAKE_MAKE_PROGRAM "nmake" CACHE STRING
+set (CMAKE_MAKE_PROGRAM "nmake" CACHE STRING
      "Program used to build from makefiles.")
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
diff --git a/Modules/CMakeNinjaFindMake.cmake b/Modules/CMakeNinjaFindMake.cmake
index f15c3e0d4..c3ca7671c 100644
--- a/Modules/CMakeNinjaFindMake.cmake
+++ b/Modules/CMakeNinjaFindMake.cmake
@@ -12,6 +12,6 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PROGRAM(CMAKE_MAKE_PROGRAM ninja
+find_program(CMAKE_MAKE_PROGRAM ninja
   DOC "Program used to build from build.ninja files.")
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
diff --git a/Modules/CMakePackageConfigHelpers.cmake b/Modules/CMakePackageConfigHelpers.cmake
index 48039e522..457a7ae6d 100644
--- a/Modules/CMakePackageConfigHelpers.cmake
+++ b/Modules/CMakePackageConfigHelpers.cmake
@@ -6,7 +6,7 @@
 #                                                   [NO_CHECK_REQUIRED_COMPONENTS_MACRO])
 #
 # CONFIGURE_PACKAGE_CONFIG_FILE() should be used instead of the plain
-# CONFIGURE_FILE() command when creating the <Name>Config.cmake or <Name>-config.cmake
+# configure_file() command when creating the <Name>Config.cmake or <Name>-config.cmake
 # file for installing a project or library. It helps making the resulting package
 # relocatable by avoiding hardcoded paths in the installed Config.cmake file.
 #
@@ -31,12 +31,12 @@
 # Usage:
 #   1. write a FooConfig.cmake.in file as you are used to
 #   2. insert a line containing only the string "@PACKAGE_INIT@"
-#   3. instead of SET(FOO_DIR "@SOME_INSTALL_DIR@"), use SET(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@")
+#   3. instead of set(FOO_DIR "@SOME_INSTALL_DIR@"), use set(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@")
 #      (this must be after the @PACKAGE_INIT@ line)
-#   4. instead of using the normal CONFIGURE_FILE(), use CONFIGURE_PACKAGE_CONFIG_FILE()
+#   4. instead of using the normal configure_file(), use CONFIGURE_PACKAGE_CONFIG_FILE()
 #
 # The <input> and <output> arguments are the input and output file, the same way
-# as in CONFIGURE_FILE().
+# as in configure_file().
 #
 # The <path> given to INSTALL_DESTINATION must be the destination where the FooConfig.cmake
 # file will be installed to. This can either be a relative or absolute path, both work.
@@ -77,7 +77,7 @@
 #  WRITE_BASIC_PACKAGE_VERSION_FILE( filename VERSION major.minor.patch COMPATIBILITY (AnyNewerVersion|SameMajorVersion|ExactVersion) )
 #
 # Writes a file for use as <package>ConfigVersion.cmake file to <filename>.
-# See the documentation of FIND_PACKAGE() for details on this.
+# See the documentation of find_package() for details on this.
 #    filename is the output filename, it should be in the build tree.
 #    major.minor.patch is the version number of the project to be installed
 # The COMPATIBILITY mode AnyNewerVersion means that the installed package version
diff --git a/Modules/CMakePrintSystemInformation.cmake b/Modules/CMakePrintSystemInformation.cmake
index 2c5d0f2ae..e0c73346b 100644
--- a/Modules/CMakePrintSystemInformation.cmake
+++ b/Modules/CMakePrintSystemInformation.cmake
@@ -16,31 +16,31 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-MESSAGE("CMAKE_SYSTEM is ${CMAKE_SYSTEM} ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION}")
-MESSAGE("CMAKE_SYSTEM file is ${CMAKE_SYSTEM_INFO_FILE}")
-MESSAGE("CMAKE_C_COMPILER is ${CMAKE_C_COMPILER}")
-MESSAGE("CMAKE_CXX_COMPILER is ${CMAKE_CXX_COMPILER}")
+message("CMAKE_SYSTEM is ${CMAKE_SYSTEM} ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION}")
+message("CMAKE_SYSTEM file is ${CMAKE_SYSTEM_INFO_FILE}")
+message("CMAKE_C_COMPILER is ${CMAKE_C_COMPILER}")
+message("CMAKE_CXX_COMPILER is ${CMAKE_CXX_COMPILER}")
 
 
-MESSAGE("CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS is ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}")
-MESSAGE("CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS is ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}")
-MESSAGE("CMAKE_DL_LIBS is ${CMAKE_DL_LIBS}")
-MESSAGE("CMAKE_SHARED_LIBRARY_PREFIX is ${CMAKE_SHARED_LIBRARY_PREFIX}")
-MESSAGE("CMAKE_SHARED_LIBRARY_SUFFIX is ${CMAKE_SHARED_LIBRARY_SUFFIX}")
-MESSAGE("CMAKE_COMPILER_IS_GNUCC = ${CMAKE_COMPILER_IS_GNUCC}")
-MESSAGE("CMAKE_COMPILER_IS_GNUCXX = ${CMAKE_COMPILER_IS_GNUCXX}")
+message("CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS is ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}")
+message("CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS is ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}")
+message("CMAKE_DL_LIBS is ${CMAKE_DL_LIBS}")
+message("CMAKE_SHARED_LIBRARY_PREFIX is ${CMAKE_SHARED_LIBRARY_PREFIX}")
+message("CMAKE_SHARED_LIBRARY_SUFFIX is ${CMAKE_SHARED_LIBRARY_SUFFIX}")
+message("CMAKE_COMPILER_IS_GNUCC = ${CMAKE_COMPILER_IS_GNUCC}")
+message("CMAKE_COMPILER_IS_GNUCXX = ${CMAKE_COMPILER_IS_GNUCXX}")
 
-MESSAGE("CMAKE_CXX_CREATE_SHARED_LIBRARY is ${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
-MESSAGE("CMAKE_CXX_CREATE_SHARED_MODULE is ${CMAKE_CXX_CREATE_SHARED_MODULE}")
-MESSAGE("CMAKE_CXX_CREATE_STATIC_LIBRARY is ${CMAKE_CXX_CREATE_STATIC_LIBRARY}")
-MESSAGE("CMAKE_CXX_COMPILE_OBJECT is ${CMAKE_CXX_COMPILE_OBJECT}")
-MESSAGE("CMAKE_CXX_LINK_EXECUTABLE ${CMAKE_CXX_LINK_EXECUTABLE}")
+message("CMAKE_CXX_CREATE_SHARED_LIBRARY is ${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
+message("CMAKE_CXX_CREATE_SHARED_MODULE is ${CMAKE_CXX_CREATE_SHARED_MODULE}")
+message("CMAKE_CXX_CREATE_STATIC_LIBRARY is ${CMAKE_CXX_CREATE_STATIC_LIBRARY}")
+message("CMAKE_CXX_COMPILE_OBJECT is ${CMAKE_CXX_COMPILE_OBJECT}")
+message("CMAKE_CXX_LINK_EXECUTABLE ${CMAKE_CXX_LINK_EXECUTABLE}")
 
-MESSAGE("CMAKE_C_CREATE_SHARED_LIBRARY is ${CMAKE_C_CREATE_SHARED_LIBRARY}")
-MESSAGE("CMAKE_C_CREATE_SHARED_MODULE is ${CMAKE_C_CREATE_SHARED_MODULE}")
-MESSAGE("CMAKE_C_CREATE_STATIC_LIBRARY is ${CMAKE_C_CREATE_STATIC_LIBRARY}")
-MESSAGE("CMAKE_C_COMPILE_OBJECT is ${CMAKE_C_COMPILE_OBJECT}")
-MESSAGE("CMAKE_C_LINK_EXECUTABLE ${CMAKE_C_LINK_EXECUTABLE}")
+message("CMAKE_C_CREATE_SHARED_LIBRARY is ${CMAKE_C_CREATE_SHARED_LIBRARY}")
+message("CMAKE_C_CREATE_SHARED_MODULE is ${CMAKE_C_CREATE_SHARED_MODULE}")
+message("CMAKE_C_CREATE_STATIC_LIBRARY is ${CMAKE_C_CREATE_STATIC_LIBRARY}")
+message("CMAKE_C_COMPILE_OBJECT is ${CMAKE_C_COMPILE_OBJECT}")
+message("CMAKE_C_LINK_EXECUTABLE ${CMAKE_C_LINK_EXECUTABLE}")
 
-MESSAGE("CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE ${CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE}")
-MESSAGE("CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE ${CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE}")
+message("CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE ${CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE}")
+message("CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE ${CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE}")
diff --git a/Modules/CMakePushCheckState.cmake b/Modules/CMakePushCheckState.cmake
index 0a4212818..fa6e81c6c 100644
--- a/Modules/CMakePushCheckState.cmake
+++ b/Modules/CMakePushCheckState.cmake
@@ -31,31 +31,31 @@
 #  License text for the above reference.)
 
 
-MACRO(CMAKE_PUSH_CHECK_STATE)
+macro(CMAKE_PUSH_CHECK_STATE)
 
-   IF(NOT DEFINED _CMAKE_PUSH_CHECK_STATE_COUNTER)
-      SET(_CMAKE_PUSH_CHECK_STATE_COUNTER 0)
-   ENDIF()
+   if(NOT DEFINED _CMAKE_PUSH_CHECK_STATE_COUNTER)
+      set(_CMAKE_PUSH_CHECK_STATE_COUNTER 0)
+   endif()
 
-   MATH(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}+1")
+   math(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}+1")
 
-   SET(_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}    ${CMAKE_REQUIRED_INCLUDES})
-   SET(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS})
-   SET(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}   ${CMAKE_REQUIRED_LIBRARIES})
-   SET(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}       ${CMAKE_REQUIRED_FLAGS})
-ENDMACRO(CMAKE_PUSH_CHECK_STATE)
+   set(_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}    ${CMAKE_REQUIRED_INCLUDES})
+   set(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS})
+   set(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}   ${CMAKE_REQUIRED_LIBRARIES})
+   set(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}       ${CMAKE_REQUIRED_FLAGS})
+endmacro(CMAKE_PUSH_CHECK_STATE)
 
-MACRO(CMAKE_POP_CHECK_STATE)
+macro(CMAKE_POP_CHECK_STATE)
 
 # don't pop more than we pushed
-   IF("${_CMAKE_PUSH_CHECK_STATE_COUNTER}" GREATER "0")
+   if("${_CMAKE_PUSH_CHECK_STATE_COUNTER}" GREATER "0")
 
-      SET(CMAKE_REQUIRED_INCLUDES    ${_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
-      SET(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
-      SET(CMAKE_REQUIRED_LIBRARIES   ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
-      SET(CMAKE_REQUIRED_FLAGS       ${_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
+      set(CMAKE_REQUIRED_INCLUDES    ${_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
+      set(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
+      set(CMAKE_REQUIRED_LIBRARIES   ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
+      set(CMAKE_REQUIRED_FLAGS       ${_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
 
-      MATH(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}-1")
-   ENDIF()
+      math(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}-1")
+   endif()
 
-ENDMACRO(CMAKE_POP_CHECK_STATE)
+endmacro(CMAKE_POP_CHECK_STATE)
diff --git a/Modules/CMakeRCCompiler.cmake.in b/Modules/CMakeRCCompiler.cmake.in
index 83428e2eb..0fc314220 100644
--- a/Modules/CMakeRCCompiler.cmake.in
+++ b/Modules/CMakeRCCompiler.cmake.in
@@ -1,6 +1,6 @@
-SET(CMAKE_RC_COMPILER "@CMAKE_RC_COMPILER@")
-SET(CMAKE_RC_COMPILER_ARG1 "@CMAKE_RC_COMPILER_ARG1@")
-SET(CMAKE_RC_COMPILER_LOADED 1)
-SET(CMAKE_RC_SOURCE_FILE_EXTENSIONS rc)
-SET(CMAKE_RC_OUTPUT_EXTENSION @CMAKE_RC_OUTPUT_EXTENSION@)
-SET(CMAKE_RC_COMPILER_ENV_VAR "RC")
+set(CMAKE_RC_COMPILER "@CMAKE_RC_COMPILER@")
+set(CMAKE_RC_COMPILER_ARG1 "@CMAKE_RC_COMPILER_ARG1@")
+set(CMAKE_RC_COMPILER_LOADED 1)
+set(CMAKE_RC_SOURCE_FILE_EXTENSIONS rc)
+set(CMAKE_RC_OUTPUT_EXTENSION @CMAKE_RC_OUTPUT_EXTENSION@)
+set(CMAKE_RC_COMPILER_ENV_VAR "RC")
diff --git a/Modules/CMakeRCInformation.cmake b/Modules/CMakeRCInformation.cmake
index 859fe1158..2f1387c37 100644
--- a/Modules/CMakeRCInformation.cmake
+++ b/Modules/CMakeRCInformation.cmake
@@ -18,36 +18,36 @@
 # if it exists.
 
 # make sure we don't use CMAKE_BASE_NAME from somewhere else
-SET(CMAKE_BASE_NAME)
-GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_RC_COMPILER} NAME_WE)
-IF("${CMAKE_BASE_NAME}" MATCHES "windres")
-  SET(CMAKE_BASE_NAME "windres")
-ENDIF()
-SET(CMAKE_SYSTEM_AND_RC_COMPILER_INFO_FILE
+set(CMAKE_BASE_NAME)
+get_filename_component(CMAKE_BASE_NAME ${CMAKE_RC_COMPILER} NAME_WE)
+if("${CMAKE_BASE_NAME}" MATCHES "windres")
+  set(CMAKE_BASE_NAME "windres")
+endif()
+set(CMAKE_SYSTEM_AND_RC_COMPILER_INFO_FILE
   ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake)
-INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
+include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
 
 
 
-SET (CMAKE_RC_FLAGS "$ENV{RCFLAGS} ${CMAKE_RC_FLAGS_INIT}" CACHE STRING
+set (CMAKE_RC_FLAGS "$ENV{RCFLAGS} ${CMAKE_RC_FLAGS_INIT}" CACHE STRING
      "Flags for Fortran compiler.")
 
 # These are the only types of flags that should be passed to the rc
 # command, if COMPILE_FLAGS is used on a target this will be used
 # to filter out any other flags
-SET(CMAKE_RC_FLAG_REGEX "^[-/](D|I)")
+set(CMAKE_RC_FLAG_REGEX "^[-/](D|I)")
 
 # now define the following rule variables
 # CMAKE_RC_COMPILE_OBJECT
-SET(CMAKE_INCLUDE_FLAG_RC "-I")
+set(CMAKE_INCLUDE_FLAG_RC "-I")
 # compile a Resource file into an object file
-IF(NOT CMAKE_RC_COMPILE_OBJECT)
-  SET(CMAKE_RC_COMPILE_OBJECT
+if(NOT CMAKE_RC_COMPILE_OBJECT)
+  set(CMAKE_RC_COMPILE_OBJECT
     "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> /fo<OBJECT> <SOURCE>")
-ENDIF(NOT CMAKE_RC_COMPILE_OBJECT)
+endif(NOT CMAKE_RC_COMPILE_OBJECT)
 
-MARK_AS_ADVANCED(
+mark_as_advanced(
 CMAKE_RC_FLAGS
 )
 # set this variable so we can avoid loading this more than once.
-SET(CMAKE_RC_INFORMATION_LOADED 1)
+set(CMAKE_RC_INFORMATION_LOADED 1)
diff --git a/Modules/CMakeSystem.cmake.in b/Modules/CMakeSystem.cmake.in
index a9f3a552d..7e2a3584b 100644
--- a/Modules/CMakeSystem.cmake.in
+++ b/Modules/CMakeSystem.cmake.in
@@ -1,15 +1,15 @@
 @INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED@
 
-SET(CMAKE_SYSTEM "@CMAKE_SYSTEM@")
-SET(CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@")
-SET(CMAKE_SYSTEM_VERSION "@CMAKE_SYSTEM_VERSION@")
-SET(CMAKE_SYSTEM_PROCESSOR "@CMAKE_SYSTEM_PROCESSOR@")
+set(CMAKE_SYSTEM "@CMAKE_SYSTEM@")
+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_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_CROSSCOMPILING "@CMAKE_CROSSCOMPILING@")
 
-SET(CMAKE_SYSTEM_LOADED 1)
+set(CMAKE_SYSTEM_LOADED 1)
diff --git a/Modules/CMakeSystemSpecificInformation.cmake b/Modules/CMakeSystemSpecificInformation.cmake
index 88b77489b..6f85ccc91 100644
--- a/Modules/CMakeSystemSpecificInformation.cmake
+++ b/Modules/CMakeSystemSpecificInformation.cmake
@@ -21,49 +21,49 @@
 # But they are reset here and set again in the platform files for the target
 # platform, so they can be used for testing the target platform instead
 # of testing the host platform.
-SET(APPLE  )
-SET(UNIX   )
-SET(CYGWIN )
-SET(WIN32  )
+set(APPLE  )
+set(UNIX   )
+set(CYGWIN )
+set(WIN32  )
 
 
 # include Generic system information
-INCLUDE(CMakeGenericSystem)
+include(CMakeGenericSystem)
 
 # 2. now include SystemName.cmake file to set the system specific information
-SET(CMAKE_SYSTEM_INFO_FILE Platform/${CMAKE_SYSTEM_NAME})
+set(CMAKE_SYSTEM_INFO_FILE Platform/${CMAKE_SYSTEM_NAME})
 
-INCLUDE(${CMAKE_SYSTEM_INFO_FILE} OPTIONAL RESULT_VARIABLE _INCLUDED_SYSTEM_INFO_FILE)
+include(${CMAKE_SYSTEM_INFO_FILE} OPTIONAL RESULT_VARIABLE _INCLUDED_SYSTEM_INFO_FILE)
 
-IF(NOT _INCLUDED_SYSTEM_INFO_FILE)
-  MESSAGE("System is unknown to cmake, create:\n${CMAKE_SYSTEM_INFO_FILE}"
+if(NOT _INCLUDED_SYSTEM_INFO_FILE)
+  message("System is unknown to cmake, create:\n${CMAKE_SYSTEM_INFO_FILE}"
           " to use this system, please send your config file to "
           "cmake@www.cmake.org so it can be added to cmake")
-  IF(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
-    CONFIGURE_FILE(${CMAKE_BINARY_DIR}/CMakeCache.txt
+  if(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
+    configure_file(${CMAKE_BINARY_DIR}/CMakeCache.txt
                    ${CMAKE_BINARY_DIR}/CopyOfCMakeCache.txt COPYONLY)
-    MESSAGE("Your CMakeCache.txt file was copied to CopyOfCMakeCache.txt. "
+    message("Your CMakeCache.txt file was copied to CopyOfCMakeCache.txt. "
             "Please send that file to cmake@www.cmake.org.")
-   ENDIF(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
-ENDIF(NOT _INCLUDED_SYSTEM_INFO_FILE)
+   endif(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
+endif(NOT _INCLUDED_SYSTEM_INFO_FILE)
 
 
 # optionally include a file which can do extra-generator specific things, e.g.
 # CMakeFindEclipseCDT4.cmake asks gcc for the system include dirs for the Eclipse CDT4 generator
-IF(CMAKE_EXTRA_GENERATOR)
-  STRING(REPLACE " " "" _CMAKE_EXTRA_GENERATOR_NO_SPACES ${CMAKE_EXTRA_GENERATOR} )
-  INCLUDE("CMakeFind${_CMAKE_EXTRA_GENERATOR_NO_SPACES}" OPTIONAL)
-ENDIF(CMAKE_EXTRA_GENERATOR)
+if(CMAKE_EXTRA_GENERATOR)
+  string(REPLACE " " "" _CMAKE_EXTRA_GENERATOR_NO_SPACES ${CMAKE_EXTRA_GENERATOR} )
+  include("CMakeFind${_CMAKE_EXTRA_GENERATOR_NO_SPACES}" OPTIONAL)
+endif(CMAKE_EXTRA_GENERATOR)
 
 
 # for most systems a module is the same as a shared library
 # so unless the variable CMAKE_MODULE_EXISTS is set just
 # copy the values from the LIBRARY variables
 # this has to be done after the system information has been loaded
-IF(NOT CMAKE_MODULE_EXISTS)
-  SET(CMAKE_SHARED_MODULE_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}")
-  SET(CMAKE_SHARED_MODULE_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}")
-ENDIF(NOT CMAKE_MODULE_EXISTS)
+if(NOT CMAKE_MODULE_EXISTS)
+  set(CMAKE_SHARED_MODULE_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}")
+  set(CMAKE_SHARED_MODULE_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}")
+endif(NOT CMAKE_MODULE_EXISTS)
 
 
-SET(CMAKE_SYSTEM_SPECIFIC_INFORMATION_LOADED 1)
+set(CMAKE_SYSTEM_SPECIFIC_INFORMATION_LOADED 1)
diff --git a/Modules/CMakeTestASM-ATTCompiler.cmake b/Modules/CMakeTestASM-ATTCompiler.cmake
index 581ad0c23..0cc68573e 100644
--- a/Modules/CMakeTestASM-ATTCompiler.cmake
+++ b/Modules/CMakeTestASM-ATTCompiler.cmake
@@ -18,6 +18,6 @@
 # because otherwise there would have to be a separate assembler source file
 # for each assembler on every architecture.
 
-SET(ASM_DIALECT "-ATT")
-INCLUDE(CMakeTestASMCompiler)
-SET(ASM_DIALECT)
+set(ASM_DIALECT "-ATT")
+include(CMakeTestASMCompiler)
+set(ASM_DIALECT)
diff --git a/Modules/CMakeTestASMCompiler.cmake b/Modules/CMakeTestASMCompiler.cmake
index 294511d89..9381619c4 100644
--- a/Modules/CMakeTestASMCompiler.cmake
+++ b/Modules/CMakeTestASMCompiler.cmake
@@ -19,17 +19,17 @@
 # for each assembler on every architecture.
 
 
-SET(_ASM_COMPILER_WORKS 0)
+set(_ASM_COMPILER_WORKS 0)
 
-IF(CMAKE_ASM${ASM_DIALECT}_COMPILER)
-  SET(_ASM_COMPILER_WORKS 1)
-ENDIF()
+if(CMAKE_ASM${ASM_DIALECT}_COMPILER)
+  set(_ASM_COMPILER_WORKS 1)
+endif()
 
 # when using generic "ASM" support, we must have detected the compiler ID, fail otherwise:
-IF("ASM${ASM_DIALECT}" STREQUAL "ASM")
-  IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
-    SET(_ASM_COMPILER_WORKS 0)
-  ENDIF()
-ENDIF()
+if("ASM${ASM_DIALECT}" STREQUAL "ASM")
+  if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
+    set(_ASM_COMPILER_WORKS 0)
+  endif()
+endif()
 
-SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_WORKS ${_ASM_COMPILER_WORKS} CACHE INTERNAL "")
+set(CMAKE_ASM${ASM_DIALECT}_COMPILER_WORKS ${_ASM_COMPILER_WORKS} CACHE INTERNAL "")
diff --git a/Modules/CMakeTestASM_MASMCompiler.cmake b/Modules/CMakeTestASM_MASMCompiler.cmake
index 8369b942c..462b1fc07 100644
--- a/Modules/CMakeTestASM_MASMCompiler.cmake
+++ b/Modules/CMakeTestASM_MASMCompiler.cmake
@@ -18,6 +18,6 @@
 # because otherwise there would have to be a separate assembler source file
 # for each assembler on every architecture.
 
-SET(ASM_DIALECT "_MASM")
-INCLUDE(CMakeTestASMCompiler)
-SET(ASM_DIALECT)
+set(ASM_DIALECT "_MASM")
+include(CMakeTestASMCompiler)
+set(ASM_DIALECT)
diff --git a/Modules/CMakeTestASM_NASMCompiler.cmake b/Modules/CMakeTestASM_NASMCompiler.cmake
index a5e2bea0a..414c2f550 100644
--- a/Modules/CMakeTestASM_NASMCompiler.cmake
+++ b/Modules/CMakeTestASM_NASMCompiler.cmake
@@ -18,6 +18,6 @@
 # because otherwise there would have to be a separate assembler source file
 # for each assembler on every architecture.
 
-SET(ASM_DIALECT "_NASM")
-INCLUDE(CMakeTestASMCompiler)
-SET(ASM_DIALECT)
+set(ASM_DIALECT "_NASM")
+include(CMakeTestASMCompiler)
+set(ASM_DIALECT)
diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake
index 5a86eb917..9881c9d24 100644
--- a/Modules/CMakeTestCCompiler.cmake
+++ b/Modules/CMakeTestCCompiler.cmake
@@ -12,16 +12,16 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE(CMakeTestCompilerCommon)
+include(CMakeTestCompilerCommon)
 
 # This file is used by EnableLanguage in cmGlobalGenerator to
 # determine that that selected C compiler can actually compile
 # and link the most basic of programs.   If not, a fatal error
 # is set and cmake stops processing commands and will not generate
 # any makefiles or projects.
-IF(NOT CMAKE_C_COMPILER_WORKS)
+if(NOT CMAKE_C_COMPILER_WORKS)
   PrintTestCompilerStatus("C" "")
-  FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c
+  file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c
     "#ifdef __cplusplus\n"
     "# error \"The CMAKE_C_COMPILER is set to a C++ compiler\"\n"
     "#endif\n"
@@ -33,55 +33,55 @@ IF(NOT CMAKE_C_COMPILER_WORKS)
     "int main(int argc, char* argv[])\n"
     "#endif\n"
     "{ (void)argv; return argc-1;}\n")
-  TRY_COMPILE(CMAKE_C_COMPILER_WORKS ${CMAKE_BINARY_DIR}
+  try_compile(CMAKE_C_COMPILER_WORKS ${CMAKE_BINARY_DIR}
     ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c
     OUTPUT_VARIABLE __CMAKE_C_COMPILER_OUTPUT)
-  SET(C_TEST_WAS_RUN 1)
-ENDIF(NOT CMAKE_C_COMPILER_WORKS)
+  set(C_TEST_WAS_RUN 1)
+endif(NOT CMAKE_C_COMPILER_WORKS)
 
-IF(NOT CMAKE_C_COMPILER_WORKS)
+if(NOT CMAKE_C_COMPILER_WORKS)
   PrintTestCompilerStatus("C" " -- broken")
-  FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+  file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
     "Determining if the C compiler works failed with "
     "the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n")
   # if the compiler is broken make sure to remove the platform file
   # since Windows-cl configures both c/cxx files both need to be removed
   # when c or c++ fails
-  FILE(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake )
-  FILE(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake )
-  MESSAGE(FATAL_ERROR "The C compiler \"${CMAKE_C_COMPILER}\" "
+  file(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake )
+  file(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake )
+  message(FATAL_ERROR "The C compiler \"${CMAKE_C_COMPILER}\" "
     "is not able to compile a simple test program.\nIt fails "
     "with the following output:\n ${__CMAKE_C_COMPILER_OUTPUT}\n\n"
     "CMake will not be able to correctly generate this project.")
-ELSE(NOT CMAKE_C_COMPILER_WORKS)
-  IF(C_TEST_WAS_RUN)
+else(NOT CMAKE_C_COMPILER_WORKS)
+  if(C_TEST_WAS_RUN)
     PrintTestCompilerStatus("C" " -- works")
-    FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining if the C compiler works passed with "
       "the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n")
-  ENDIF(C_TEST_WAS_RUN)
-  SET(CMAKE_C_COMPILER_WORKS 1 CACHE INTERNAL "")
+  endif(C_TEST_WAS_RUN)
+  set(CMAKE_C_COMPILER_WORKS 1 CACHE INTERNAL "")
 
-  IF(CMAKE_C_COMPILER_FORCED)
+  if(CMAKE_C_COMPILER_FORCED)
     # The compiler configuration was forced by the user.
     # Assume the user has configured all compiler information.
-  ELSE(CMAKE_C_COMPILER_FORCED)
+  else(CMAKE_C_COMPILER_FORCED)
     # Try to identify the ABI and configure it into CMakeCCompiler.cmake
-    INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
+    include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
     CMAKE_DETERMINE_COMPILER_ABI(C ${CMAKE_ROOT}/Modules/CMakeCCompilerABI.c)
-    CONFIGURE_FILE(
+    configure_file(
       ${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCCompiler.cmake
       @ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
       )
-    INCLUDE(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCCompiler.cmake)
-  ENDIF(CMAKE_C_COMPILER_FORCED)
-  IF(CMAKE_C_SIZEOF_DATA_PTR)
-    FOREACH(f ${CMAKE_C_ABI_FILES})
-      INCLUDE(${f})
-    ENDFOREACH()
-    UNSET(CMAKE_C_ABI_FILES)
-  ENDIF()
-ENDIF(NOT CMAKE_C_COMPILER_WORKS)
+    include(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCCompiler.cmake)
+  endif(CMAKE_C_COMPILER_FORCED)
+  if(CMAKE_C_SIZEOF_DATA_PTR)
+    foreach(f ${CMAKE_C_ABI_FILES})
+      include(${f})
+    endforeach()
+    unset(CMAKE_C_ABI_FILES)
+  endif()
+endif(NOT CMAKE_C_COMPILER_WORKS)
 
-UNSET(__CMAKE_C_COMPILER_OUTPUT)
+unset(__CMAKE_C_COMPILER_OUTPUT)
diff --git a/Modules/CMakeTestCXXCompiler.cmake b/Modules/CMakeTestCXXCompiler.cmake
index dadec1a65..52eaa3cca 100644
--- a/Modules/CMakeTestCXXCompiler.cmake
+++ b/Modules/CMakeTestCXXCompiler.cmake
@@ -12,69 +12,69 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE(CMakeTestCompilerCommon)
+include(CMakeTestCompilerCommon)
 
 # This file is used by EnableLanguage in cmGlobalGenerator to
 # determine that that selected C++ compiler can actually compile
 # and link the most basic of programs.   If not, a fatal error
 # is set and cmake stops processing commands and will not generate
 # any makefiles or projects.
-IF(NOT CMAKE_CXX_COMPILER_WORKS)
+if(NOT CMAKE_CXX_COMPILER_WORKS)
   PrintTestCompilerStatus("CXX" "")
-  FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx
+  file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx
     "#ifndef __cplusplus\n"
     "# error \"The CMAKE_CXX_COMPILER is set to a C compiler\"\n"
     "#endif\n"
     "int main(){return 0;}\n")
-  TRY_COMPILE(CMAKE_CXX_COMPILER_WORKS ${CMAKE_BINARY_DIR}
+  try_compile(CMAKE_CXX_COMPILER_WORKS ${CMAKE_BINARY_DIR}
     ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx
     OUTPUT_VARIABLE __CMAKE_CXX_COMPILER_OUTPUT)
-  SET(CXX_TEST_WAS_RUN 1)
-ENDIF(NOT CMAKE_CXX_COMPILER_WORKS)
+  set(CXX_TEST_WAS_RUN 1)
+endif(NOT CMAKE_CXX_COMPILER_WORKS)
 
-IF(NOT CMAKE_CXX_COMPILER_WORKS)
+if(NOT CMAKE_CXX_COMPILER_WORKS)
   PrintTestCompilerStatus("CXX" " -- broken")
   # if the compiler is broken make sure to remove the platform file
   # since Windows-cl configures both c/cxx files both need to be removed
   # when c or c++ fails
-  FILE(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake )
-  FILE(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake )
-  FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+  file(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake )
+  file(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake )
+  file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
     "Determining if the CXX compiler works failed with "
     "the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n")
-  MESSAGE(FATAL_ERROR "The C++ compiler \"${CMAKE_CXX_COMPILER}\" "
+  message(FATAL_ERROR "The C++ compiler \"${CMAKE_CXX_COMPILER}\" "
     "is not able to compile a simple test program.\nIt fails "
     "with the following output:\n ${__CMAKE_CXX_COMPILER_OUTPUT}\n\n"
     "CMake will not be able to correctly generate this project.")
-ELSE(NOT CMAKE_CXX_COMPILER_WORKS)
-  IF(CXX_TEST_WAS_RUN)
+else(NOT CMAKE_CXX_COMPILER_WORKS)
+  if(CXX_TEST_WAS_RUN)
     PrintTestCompilerStatus("CXX" " -- works")
-    FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining if the CXX compiler works passed with "
       "the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n")
-  ENDIF(CXX_TEST_WAS_RUN)
-  SET(CMAKE_CXX_COMPILER_WORKS 1 CACHE INTERNAL "")
+  endif(CXX_TEST_WAS_RUN)
+  set(CMAKE_CXX_COMPILER_WORKS 1 CACHE INTERNAL "")
 
-  IF(CMAKE_CXX_COMPILER_FORCED)
+  if(CMAKE_CXX_COMPILER_FORCED)
     # The compiler configuration was forced by the user.
     # Assume the user has configured all compiler information.
-  ELSE(CMAKE_CXX_COMPILER_FORCED)
+  else(CMAKE_CXX_COMPILER_FORCED)
     # Try to identify the ABI and configure it into CMakeCXXCompiler.cmake
-    INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
+    include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
     CMAKE_DETERMINE_COMPILER_ABI(CXX ${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp)
-    CONFIGURE_FILE(
+    configure_file(
       ${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake
       @ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
       )
-    INCLUDE(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake)
-  ENDIF(CMAKE_CXX_COMPILER_FORCED)
-  IF(CMAKE_CXX_SIZEOF_DATA_PTR)
-    FOREACH(f ${CMAKE_CXX_ABI_FILES})
-      INCLUDE(${f})
-    ENDFOREACH()
-    UNSET(CMAKE_CXX_ABI_FILES)
-  ENDIF()
-ENDIF(NOT CMAKE_CXX_COMPILER_WORKS)
+    include(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake)
+  endif(CMAKE_CXX_COMPILER_FORCED)
+  if(CMAKE_CXX_SIZEOF_DATA_PTR)
+    foreach(f ${CMAKE_CXX_ABI_FILES})
+      include(${f})
+    endforeach()
+    unset(CMAKE_CXX_ABI_FILES)
+  endif()
+endif(NOT CMAKE_CXX_COMPILER_WORKS)
 
-UNSET(__CMAKE_CXX_COMPILER_OUTPUT)
+unset(__CMAKE_CXX_COMPILER_OUTPUT)
diff --git a/Modules/CMakeTestCompilerCommon.cmake b/Modules/CMakeTestCompilerCommon.cmake
index fd8a105b2..d51b503a1 100644
--- a/Modules/CMakeTestCompilerCommon.cmake
+++ b/Modules/CMakeTestCompilerCommon.cmake
@@ -13,9 +13,9 @@
 #  License text for the above reference.)
 
 function(PrintTestCompilerStatus LANG MSG)
-  IF(CMAKE_GENERATOR MATCHES Make)
-    MESSAGE(STATUS "Check for working ${LANG} compiler: ${CMAKE_${LANG}_COMPILER}${MSG}")
-  ELSE()
-    MESSAGE(STATUS "Check for working ${LANG} compiler using: ${CMAKE_GENERATOR}${MSG}")
-  ENDIF()
+  if(CMAKE_GENERATOR MATCHES Make)
+    message(STATUS "Check for working ${LANG} compiler: ${CMAKE_${LANG}_COMPILER}${MSG}")
+  else()
+    message(STATUS "Check for working ${LANG} compiler using: ${CMAKE_GENERATOR}${MSG}")
+  endif()
 endfunction()
diff --git a/Modules/CMakeTestFortranCompiler.cmake b/Modules/CMakeTestFortranCompiler.cmake
index b2fa16aef..4f711d8e3 100644
--- a/Modules/CMakeTestFortranCompiler.cmake
+++ b/Modules/CMakeTestFortranCompiler.cmake
@@ -12,90 +12,90 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE(CMakeTestCompilerCommon)
+include(CMakeTestCompilerCommon)
 
 # This file is used by EnableLanguage in cmGlobalGenerator to
 # determine that that selected Fortran compiler can actually compile
 # and link the most basic of programs.   If not, a fatal error
 # is set and cmake stops processing commands and will not generate
 # any makefiles or projects.
-IF(NOT CMAKE_Fortran_COMPILER_WORKS)
+if(NOT CMAKE_Fortran_COMPILER_WORKS)
   PrintTestCompilerStatus("Fortran" "")
-  FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f "
+  file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f "
         PROGRAM TESTFortran
         PRINT *, 'Hello'
         END
   ")
-  TRY_COMPILE(CMAKE_Fortran_COMPILER_WORKS ${CMAKE_BINARY_DIR}
+  try_compile(CMAKE_Fortran_COMPILER_WORKS ${CMAKE_BINARY_DIR}
     ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f
     OUTPUT_VARIABLE OUTPUT)
-  SET(FORTRAN_TEST_WAS_RUN 1)
-ENDIF(NOT CMAKE_Fortran_COMPILER_WORKS)
+  set(FORTRAN_TEST_WAS_RUN 1)
+endif(NOT CMAKE_Fortran_COMPILER_WORKS)
 
-IF(NOT CMAKE_Fortran_COMPILER_WORKS)
+if(NOT CMAKE_Fortran_COMPILER_WORKS)
   PrintTestCompilerStatus("Fortran" "  -- broken")
-  FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+  file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
     "Determining if the Fortran compiler works failed with "
     "the following output:\n${OUTPUT}\n\n")
-  MESSAGE(FATAL_ERROR "The Fortran compiler \"${CMAKE_Fortran_COMPILER}\" "
+  message(FATAL_ERROR "The Fortran compiler \"${CMAKE_Fortran_COMPILER}\" "
     "is not able to compile a simple test program.\nIt fails "
     "with the following output:\n ${OUTPUT}\n\n"
     "CMake will not be able to correctly generate this project.")
-ELSE(NOT CMAKE_Fortran_COMPILER_WORKS)
-  IF(FORTRAN_TEST_WAS_RUN)
+else(NOT CMAKE_Fortran_COMPILER_WORKS)
+  if(FORTRAN_TEST_WAS_RUN)
     PrintTestCompilerStatus("Fortran" "  -- works")
-    FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining if the Fortran compiler works passed with "
       "the following output:\n${OUTPUT}\n\n")
-  ENDIF(FORTRAN_TEST_WAS_RUN)
-  SET(CMAKE_Fortran_COMPILER_WORKS 1 CACHE INTERNAL "")
+  endif(FORTRAN_TEST_WAS_RUN)
+  set(CMAKE_Fortran_COMPILER_WORKS 1 CACHE INTERNAL "")
 
-  IF(CMAKE_Fortran_COMPILER_FORCED)
+  if(CMAKE_Fortran_COMPILER_FORCED)
     # The compiler configuration was forced by the user.
     # Assume the user has configured all compiler information.
-  ELSE(CMAKE_Fortran_COMPILER_FORCED)
+  else(CMAKE_Fortran_COMPILER_FORCED)
     # Try to identify the ABI and configure it into CMakeFortranCompiler.cmake
-    INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
+    include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
     CMAKE_DETERMINE_COMPILER_ABI(Fortran ${CMAKE_ROOT}/Modules/CMakeFortranCompilerABI.F)
 
     # Test for Fortran 90 support by using an f90-specific construct.
-    IF(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90)
-      MESSAGE(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90")
-      FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90 "
+    if(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90)
+      message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90")
+      file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90 "
       PROGRAM TESTFortran90
       stop = 1 ; do while ( stop .eq. 0 ) ; end do
       END PROGRAM TESTFortran90
 ")
-      TRY_COMPILE(CMAKE_Fortran_COMPILER_SUPPORTS_F90 ${CMAKE_BINARY_DIR}
+      try_compile(CMAKE_Fortran_COMPILER_SUPPORTS_F90 ${CMAKE_BINARY_DIR}
         ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90
         OUTPUT_VARIABLE OUTPUT)
-      IF(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
-        MESSAGE(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- yes")
-        FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+      if(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
+        message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- yes")
+        file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
           "Determining if the Fortran compiler supports Fortran 90 passed with "
           "the following output:\n${OUTPUT}\n\n")
-        SET(CMAKE_Fortran_COMPILER_SUPPORTS_F90 1)
-      ELSE(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
-        MESSAGE(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- no")
-        FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+        set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 1)
+      else(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
+        message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- no")
+        file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
           "Determining if the Fortran compiler supports Fortran 90 failed with "
           "the following output:\n${OUTPUT}\n\n")
-        SET(CMAKE_Fortran_COMPILER_SUPPORTS_F90 0)
-      ENDIF(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
-      UNSET(CMAKE_Fortran_COMPILER_SUPPORTS_F90 CACHE)
-    ENDIF(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90)
+        set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 0)
+      endif(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
+      unset(CMAKE_Fortran_COMPILER_SUPPORTS_F90 CACHE)
+    endif(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90)
 
-    CONFIGURE_FILE(
+    configure_file(
       ${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake
       @ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
       )
-    INCLUDE(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake)
-  ENDIF(CMAKE_Fortran_COMPILER_FORCED)
-  IF(CMAKE_Fortran_SIZEOF_DATA_PTR)
-    FOREACH(f ${CMAKE_Fortran_ABI_FILES})
-      INCLUDE(${f})
-    ENDFOREACH()
-    UNSET(CMAKE_Fortran_ABI_FILES)
-  ENDIF()
-ENDIF(NOT CMAKE_Fortran_COMPILER_WORKS)
+    include(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake)
+  endif(CMAKE_Fortran_COMPILER_FORCED)
+  if(CMAKE_Fortran_SIZEOF_DATA_PTR)
+    foreach(f ${CMAKE_Fortran_ABI_FILES})
+      include(${f})
+    endforeach()
+    unset(CMAKE_Fortran_ABI_FILES)
+  endif()
+endif(NOT CMAKE_Fortran_COMPILER_WORKS)
diff --git a/Modules/CMakeTestJavaCompiler.cmake b/Modules/CMakeTestJavaCompiler.cmake
index cfd3e24b6..d763412bf 100644
--- a/Modules/CMakeTestJavaCompiler.cmake
+++ b/Modules/CMakeTestJavaCompiler.cmake
@@ -17,4 +17,4 @@
 # and link the most basic of programs.   If not, a fatal error
 # is set and cmake stops processing commands and will not generate
 # any makefiles or projects.
-SET(CMAKE_Java_COMPILER_WORKS 1 CACHE INTERNAL "")
+set(CMAKE_Java_COMPILER_WORKS 1 CACHE INTERNAL "")
diff --git a/Modules/CMakeTestRCCompiler.cmake b/Modules/CMakeTestRCCompiler.cmake
index a5c8d1149..7969da1de 100644
--- a/Modules/CMakeTestRCCompiler.cmake
+++ b/Modules/CMakeTestRCCompiler.cmake
@@ -20,4 +20,4 @@
 
 # For now there is no way to do a try compile on just a .rc file
 # so just do nothing in here.
-SET(CMAKE_RC_COMPILER_WORKS 1 CACHE INTERNAL "")
+set(CMAKE_RC_COMPILER_WORKS 1 CACHE INTERNAL "")
diff --git a/Modules/CMakeUnixFindMake.cmake b/Modules/CMakeUnixFindMake.cmake
index 39962c0d3..c75cf7cbc 100644
--- a/Modules/CMakeUnixFindMake.cmake
+++ b/Modules/CMakeUnixFindMake.cmake
@@ -12,5 +12,5 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PROGRAM(CMAKE_MAKE_PROGRAM NAMES gmake make smake)
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
+find_program(CMAKE_MAKE_PROGRAM NAMES gmake make smake)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
diff --git a/Modules/CMakeVS10FindMake.cmake b/Modules/CMakeVS10FindMake.cmake
index 695e92f52..189b62698 100644
--- a/Modules/CMakeVS10FindMake.cmake
+++ b/Modules/CMakeVS10FindMake.cmake
@@ -15,7 +15,7 @@
 # Look for devenv as a build program.  We need to use this to support
 # Intel Fortran integration into VS.  MSBuild can not be used for that case
 # since Intel Fortran uses the older devenv file format.
-FIND_PROGRAM(CMAKE_MAKE_PROGRAM
+find_program(CMAKE_MAKE_PROGRAM
   NAMES devenv
   HINTS
   [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;EnvironmentDirectory]
@@ -39,16 +39,16 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
 # causes the compiler checks and try-compile stuff to fail. MSbuild
 # is a better choice for this.  However, VCExpress does not support
 # cross compiling needed for Win CE.
-IF(NOT CMAKE_CROSSCOMPILING)
-  FIND_PROGRAM(CMAKE_MAKE_PROGRAM
+if(NOT CMAKE_CROSSCOMPILING)
+  find_program(CMAKE_MAKE_PROGRAM
     NAMES MSBuild
     HINTS
     [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;ProductDir]
     "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/"
     "c:/WINDOWS/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/"
     "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\10.0;CLR Version]/")
-ENDIF()
+endif()
 
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
-SET(MSVC10 1)
-SET(MSVC_VERSION 1600)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
+set(MSVC10 1)
+set(MSVC_VERSION 1600)
diff --git a/Modules/CMakeVS11FindMake.cmake b/Modules/CMakeVS11FindMake.cmake
index 302efaa59..c55a4c53a 100644
--- a/Modules/CMakeVS11FindMake.cmake
+++ b/Modules/CMakeVS11FindMake.cmake
@@ -15,7 +15,7 @@
 # Look for devenv as a build program.  We need to use this to support
 # Intel Fortran integration into VS.  MSBuild can not be used for that case
 # since Intel Fortran uses the older devenv file format.
-FIND_PROGRAM(CMAKE_MAKE_PROGRAM
+find_program(CMAKE_MAKE_PROGRAM
   NAMES devenv
   HINTS
   [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;EnvironmentDirectory]
@@ -39,16 +39,16 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
 # causes the compiler checks and try-compile stuff to fail. MSbuild
 # is a better choice for this.  However, VCExpress does not support
 # cross compiling needed for Win CE.
-IF(NOT CMAKE_CROSSCOMPILING)
-  FIND_PROGRAM(CMAKE_MAKE_PROGRAM
+if(NOT CMAKE_CROSSCOMPILING)
+  find_program(CMAKE_MAKE_PROGRAM
     NAMES MSBuild
     HINTS
     [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;ProductDir]
     "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;CLR Version]/"
     "c:/WINDOWS/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;CLR Version]/"
     "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\11.0;CLR Version]/")
-ENDIF()
+endif()
 
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
-SET(MSVC11 1)
-SET(MSVC_VERSION 1700)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
+set(MSVC11 1)
+set(MSVC_VERSION 1700)
diff --git a/Modules/CMakeVS6BackwardCompatibility.cmake b/Modules/CMakeVS6BackwardCompatibility.cmake
index c948ff4a0..ca48b8587 100644
--- a/Modules/CMakeVS6BackwardCompatibility.cmake
+++ b/Modules/CMakeVS6BackwardCompatibility.cmake
@@ -13,14 +13,14 @@
 #  License text for the above reference.)
 
 # hard code these for fast backwards compatibility tests
-SET (CMAKE_SIZEOF_INT       4   CACHE INTERNAL "Size of int data type")
-SET (CMAKE_SIZEOF_LONG      4   CACHE INTERNAL "Size of long data type")
-SET (CMAKE_SIZEOF_VOID_P    4   CACHE INTERNAL "Size of void* data type")
-SET (CMAKE_SIZEOF_CHAR      1   CACHE INTERNAL "Size of char data type")
-SET (CMAKE_SIZEOF_SHORT     2   CACHE INTERNAL "Size of short data type")
-SET (CMAKE_SIZEOF_FLOAT     4   CACHE INTERNAL "Size of float data type")
-SET (CMAKE_SIZEOF_DOUBLE    8   CACHE INTERNAL "Size of double data type")
-SET (CMAKE_NO_ANSI_FOR_SCOPE 1 CACHE INTERNAL
+set (CMAKE_SIZEOF_INT       4   CACHE INTERNAL "Size of int data type")
+set (CMAKE_SIZEOF_LONG      4   CACHE INTERNAL "Size of long data type")
+set (CMAKE_SIZEOF_VOID_P    4   CACHE INTERNAL "Size of void* data type")
+set (CMAKE_SIZEOF_CHAR      1   CACHE INTERNAL "Size of char data type")
+set (CMAKE_SIZEOF_SHORT     2   CACHE INTERNAL "Size of short data type")
+set (CMAKE_SIZEOF_FLOAT     4   CACHE INTERNAL "Size of float data type")
+set (CMAKE_SIZEOF_DOUBLE    8   CACHE INTERNAL "Size of double data type")
+set (CMAKE_NO_ANSI_FOR_SCOPE 1 CACHE INTERNAL
          "Does the compiler support ansi for scope.")
-SET (CMAKE_USE_WIN32_THREADS  TRUE CACHE BOOL    "Use the win32 thread library.")
-SET (CMAKE_WORDS_BIGENDIAN 0 CACHE INTERNAL "endianness of bytes")
+set (CMAKE_USE_WIN32_THREADS  TRUE CACHE BOOL    "Use the win32 thread library.")
+set (CMAKE_WORDS_BIGENDIAN 0 CACHE INTERNAL "endianness of bytes")
diff --git a/Modules/CMakeVS6FindMake.cmake b/Modules/CMakeVS6FindMake.cmake
index dccf8c462..40bf5b172 100644
--- a/Modules/CMakeVS6FindMake.cmake
+++ b/Modules/CMakeVS6FindMake.cmake
@@ -12,7 +12,7 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PROGRAM(CMAKE_MAKE_PROGRAM
+find_program(CMAKE_MAKE_PROGRAM
   NAMES msdev
   PATHS
   [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\6.0\\Setup;VsCommonDir]/MSDev98/Bin
@@ -20,6 +20,6 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
   "c:/Program Files/Microsoft Visual Studio/Common/MSDev98/Bin"
   "/Program Files/Microsoft Visual Studio/Common/MSDev98/Bin"
   )
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
-SET(MSVC60 1)
-SET(MSVC_VERSION 1200)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
+set(MSVC60 1)
+set(MSVC_VERSION 1200)
diff --git a/Modules/CMakeVS71FindMake.cmake b/Modules/CMakeVS71FindMake.cmake
index 2381adb55..945c3faf8 100644
--- a/Modules/CMakeVS71FindMake.cmake
+++ b/Modules/CMakeVS71FindMake.cmake
@@ -12,7 +12,7 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PROGRAM(CMAKE_MAKE_PROGRAM
+find_program(CMAKE_MAKE_PROGRAM
   NAMES devenv
   PATHS
   [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VS;EnvironmentDirectory]
@@ -21,6 +21,6 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
   "c:/Program Files/Microsoft Visual Studio.NET/Common7/IDE"
   "/Program Files/Microsoft Visual Studio .NET/Common7/IDE/"
   )
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
-SET(MSVC71 1)
-SET(MSVC_VERSION 1310)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
+set(MSVC71 1)
+set(MSVC_VERSION 1310)
diff --git a/Modules/CMakeVS7BackwardCompatibility.cmake b/Modules/CMakeVS7BackwardCompatibility.cmake
index 9743c2705..e9622eecf 100644
--- a/Modules/CMakeVS7BackwardCompatibility.cmake
+++ b/Modules/CMakeVS7BackwardCompatibility.cmake
@@ -13,14 +13,14 @@
 #  License text for the above reference.)
 
 # hard code these for fast backwards compatibility tests
-SET (CMAKE_SIZEOF_INT       4   CACHE INTERNAL "Size of int data type")
-SET (CMAKE_SIZEOF_LONG      4   CACHE INTERNAL "Size of long data type")
-SET (CMAKE_SIZEOF_VOID_P    4   CACHE INTERNAL "Size of void* data type")
-SET (CMAKE_SIZEOF_CHAR      1   CACHE INTERNAL "Size of char data type")
-SET (CMAKE_SIZEOF_SHORT     2   CACHE INTERNAL "Size of short data type")
-SET (CMAKE_SIZEOF_FLOAT     4   CACHE INTERNAL "Size of float data type")
-SET (CMAKE_SIZEOF_DOUBLE    8   CACHE INTERNAL "Size of double data type")
-SET (CMAKE_NO_ANSI_FOR_SCOPE 0 CACHE INTERNAL
+set (CMAKE_SIZEOF_INT       4   CACHE INTERNAL "Size of int data type")
+set (CMAKE_SIZEOF_LONG      4   CACHE INTERNAL "Size of long data type")
+set (CMAKE_SIZEOF_VOID_P    4   CACHE INTERNAL "Size of void* data type")
+set (CMAKE_SIZEOF_CHAR      1   CACHE INTERNAL "Size of char data type")
+set (CMAKE_SIZEOF_SHORT     2   CACHE INTERNAL "Size of short data type")
+set (CMAKE_SIZEOF_FLOAT     4   CACHE INTERNAL "Size of float data type")
+set (CMAKE_SIZEOF_DOUBLE    8   CACHE INTERNAL "Size of double data type")
+set (CMAKE_NO_ANSI_FOR_SCOPE 0 CACHE INTERNAL
          "Does the compiler support ansi for scope.")
-SET (CMAKE_USE_WIN32_THREADS  TRUE CACHE BOOL    "Use the win32 thread library.")
-SET (CMAKE_WORDS_BIGENDIAN 0 CACHE INTERNAL "endianness of bytes")
+set (CMAKE_USE_WIN32_THREADS  TRUE CACHE BOOL    "Use the win32 thread library.")
+set (CMAKE_WORDS_BIGENDIAN 0 CACHE INTERNAL "endianness of bytes")
diff --git a/Modules/CMakeVS7FindMake.cmake b/Modules/CMakeVS7FindMake.cmake
index 665158c88..218c5f2df 100644
--- a/Modules/CMakeVS7FindMake.cmake
+++ b/Modules/CMakeVS7FindMake.cmake
@@ -12,7 +12,7 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PROGRAM(CMAKE_MAKE_PROGRAM
+find_program(CMAKE_MAKE_PROGRAM
   NAMES devenv
   PATHS
   [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.0\\Setup\\VS;EnvironmentDirectory]
@@ -20,6 +20,6 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
   "c:/Program Files/Microsoft Visual Studio.NET/Common7/IDE"
   "/Program Files/Microsoft Visual Studio .NET/Common7/IDE/"
   )
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
-SET(MSVC70 1)
-SET(MSVC_VERSION 1300)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
+set(MSVC70 1)
+set(MSVC_VERSION 1300)
diff --git a/Modules/CMakeVS8FindMake.cmake b/Modules/CMakeVS8FindMake.cmake
index bb0818014..790ca2b6a 100644
--- a/Modules/CMakeVS8FindMake.cmake
+++ b/Modules/CMakeVS8FindMake.cmake
@@ -13,12 +13,12 @@
 #  License text for the above reference.)
 
 # VCExpress does not support cross compiling, which is necessary for Win CE
-SET( _CMAKE_MAKE_PROGRAM_NAMES devenv)
-IF(NOT CMAKE_CROSSCOMPILING)
-  SET( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress)
-ENDIF(NOT CMAKE_CROSSCOMPILING)
+set( _CMAKE_MAKE_PROGRAM_NAMES devenv)
+if(NOT CMAKE_CROSSCOMPILING)
+  set( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress)
+endif(NOT CMAKE_CROSSCOMPILING)
 
-FIND_PROGRAM(CMAKE_MAKE_PROGRAM
+find_program(CMAKE_MAKE_PROGRAM
   NAMES ${_CMAKE_MAKE_PROGRAM_NAMES}
   HINTS
   [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VS;EnvironmentDirectory]
@@ -29,6 +29,6 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
   "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio8/Common7/IDE"
   "/Program Files/Microsoft Visual Studio 8/Common7/IDE/"
   )
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
-SET(MSVC80 1)
-SET(MSVC_VERSION 1400)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
+set(MSVC80 1)
+set(MSVC_VERSION 1400)
diff --git a/Modules/CMakeVS9FindMake.cmake b/Modules/CMakeVS9FindMake.cmake
index 9e3c39ef3..c7aba3692 100644
--- a/Modules/CMakeVS9FindMake.cmake
+++ b/Modules/CMakeVS9FindMake.cmake
@@ -13,12 +13,12 @@
 #  License text for the above reference.)
 
 # VCExpress does not support cross compiling, which is necessary for Win CE
-SET( _CMAKE_MAKE_PROGRAM_NAMES devenv)
-IF(NOT CMAKE_CROSSCOMPILING)
-  SET( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress)
-ENDIF(NOT CMAKE_CROSSCOMPILING)
+set( _CMAKE_MAKE_PROGRAM_NAMES devenv)
+if(NOT CMAKE_CROSSCOMPILING)
+  set( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress)
+endif(NOT CMAKE_CROSSCOMPILING)
 
-FIND_PROGRAM(CMAKE_MAKE_PROGRAM
+find_program(CMAKE_MAKE_PROGRAM
   NAMES ${_CMAKE_MAKE_PROGRAM_NAMES}
   HINTS
   [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VS;EnvironmentDirectory]
@@ -34,6 +34,6 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
   "/Program Files/Microsoft Visual Studio 9.0/Common7/IDE/"
   "/Program Files/Microsoft Visual Studio 9/Common7/IDE/"
   )
-MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
-SET(MSVC90 1)
-SET(MSVC_VERSION 1500)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
+set(MSVC90 1)
+set(MSVC_VERSION 1500)
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index b79960e02..513e11275 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -285,48 +285,48 @@
 #  License text for the above reference.)
 
 # Define this var in order to avoid (or warn) concerning multiple inclusion
-IF(CPack_CMake_INCLUDED)
-  MESSAGE(WARNING "CPack.cmake has already been included!!")
-ELSE(CPack_CMake_INCLUDED)
-  SET(CPack_CMake_INCLUDED 1)
-ENDIF(CPack_CMake_INCLUDED)
+if(CPack_CMake_INCLUDED)
+  message(WARNING "CPack.cmake has already been included!!")
+else(CPack_CMake_INCLUDED)
+  set(CPack_CMake_INCLUDED 1)
+endif(CPack_CMake_INCLUDED)
 
 # Pick a configuration file
-SET(cpack_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
-IF(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
-  SET(cpack_input_file "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
-ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
-SET(cpack_source_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
-IF(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
-  SET(cpack_source_input_file "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
-ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
+set(cpack_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
+if(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
+  set(cpack_input_file "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
+endif(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
+set(cpack_source_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
+if(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
+  set(cpack_source_input_file "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
+endif(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
 
 # Backward compatibility
 # Include CPackComponent macros if it has not already been included before.
 include(CPackComponent)
 
 # Macro for setting values if a user did not overwrite them
-MACRO(cpack_set_if_not_set name value)
-  IF(NOT DEFINED "${name}")
-    SET(${name} "${value}")
-  ENDIF(NOT DEFINED "${name}")
-ENDMACRO(cpack_set_if_not_set)
+macro(cpack_set_if_not_set name value)
+  if(NOT DEFINED "${name}")
+    set(${name} "${value}")
+  endif(NOT DEFINED "${name}")
+endmacro(cpack_set_if_not_set)
 
 # cpack_encode_variables - Macro to encode variables for the configuration file
 # find any variable that starts with CPACK and create a variable
 # _CPACK_OTHER_VARIABLES_ that contains SET commands for
 # each cpack variable.  _CPACK_OTHER_VARIABLES_ is then
 # used as an @ replacment in configure_file for the CPackConfig.
-MACRO(cpack_encode_variables)
-  SET(_CPACK_OTHER_VARIABLES_)
-  GET_CMAKE_PROPERTY(res VARIABLES)
-  FOREACH(var ${res})
-    IF("xxx${var}" MATCHES "xxxCPACK")
-      SET(_CPACK_OTHER_VARIABLES_
+macro(cpack_encode_variables)
+  set(_CPACK_OTHER_VARIABLES_)
+  get_cmake_property(res VARIABLES)
+  foreach(var ${res})
+    if("xxx${var}" MATCHES "xxxCPACK")
+      set(_CPACK_OTHER_VARIABLES_
         "${_CPACK_OTHER_VARIABLES_}\nSET(${var} \"${${var}}\")")
-      ENDIF("xxx${var}" MATCHES "xxxCPACK")
-  ENDFOREACH(var ${res})
-ENDMACRO(cpack_encode_variables)
+      endif("xxx${var}" MATCHES "xxxCPACK")
+  endforeach(var ${res})
+endmacro(cpack_encode_variables)
 
 # Set the package name
 cpack_set_if_not_set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
@@ -350,22 +350,22 @@ cpack_set_if_not_set(CPACK_RESOURCE_FILE_WELCOME
 
 cpack_set_if_not_set(CPACK_MODULE_PATH "${CMAKE_MODULE_PATH}")
 
-IF(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL)
-  SET(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
-ENDIF(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL)
+if(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL)
+  set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
+endif(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL)
 
-IF(CPACK_NSIS_MODIFY_PATH)
-  SET(CPACK_NSIS_MODIFY_PATH ON)
-ENDIF(CPACK_NSIS_MODIFY_PATH)
+if(CPACK_NSIS_MODIFY_PATH)
+  set(CPACK_NSIS_MODIFY_PATH ON)
+endif(CPACK_NSIS_MODIFY_PATH)
 
-SET(__cpack_system_name ${CMAKE_SYSTEM_NAME})
-IF(${__cpack_system_name} MATCHES Windows)
-  IF(CMAKE_CL_64)
-    SET(__cpack_system_name win64)
-  ELSE(CMAKE_CL_64)
-    SET(__cpack_system_name win32)
-  ENDIF(CMAKE_CL_64)
-ENDIF(${__cpack_system_name} MATCHES Windows)
+set(__cpack_system_name ${CMAKE_SYSTEM_NAME})
+if(${__cpack_system_name} MATCHES Windows)
+  if(CMAKE_CL_64)
+    set(__cpack_system_name win64)
+  else(CMAKE_CL_64)
+    set(__cpack_system_name win32)
+  endif(CMAKE_CL_64)
+endif(${__cpack_system_name} MATCHES Windows)
 cpack_set_if_not_set(CPACK_SYSTEM_NAME "${__cpack_system_name}")
 
 # Root dir: default value should be the string literal "$PROGRAMFILES"
@@ -494,7 +494,7 @@ cpack_set_if_not_set(CPACK_CMAKE_GENERATOR "${CMAKE_GENERATOR}")
 cpack_set_if_not_set(CPACK_TOPLEVEL_TAG "${CPACK_SYSTEM_NAME}")
 # if the user has set CPACK_NSIS_DISPLAY_NAME remember it
 if(DEFINED CPACK_NSIS_DISPLAY_NAME)
-  SET(CPACK_NSIS_DISPLAY_NAME_SET TRUE)
+  set(CPACK_NSIS_DISPLAY_NAME_SET TRUE)
 endif()
 # if the user has set CPACK_NSIS_DISPLAY
 # explicitly, then use that as the default
@@ -522,31 +522,31 @@ cpack_set_if_not_set(CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
 cpack_set_if_not_set(CPACK_NSIS_INSTALLER_ICON_CODE "")
 cpack_set_if_not_set(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
 
-IF(DEFINED CPACK_COMPONENTS_ALL)
-  IF(CPACK_MONOLITHIC_INSTALL)
-    MESSAGE("CPack warning: both CPACK_COMPONENTS_ALL and CPACK_MONOLITHIC_INSTALL have been set.\nDefaulting to a monolithic installation.")
-    SET(CPACK_COMPONENTS_ALL)
-  ELSE(CPACK_MONOLITHIC_INSTALL)
+if(DEFINED CPACK_COMPONENTS_ALL)
+  if(CPACK_MONOLITHIC_INSTALL)
+    message("CPack warning: both CPACK_COMPONENTS_ALL and CPACK_MONOLITHIC_INSTALL have been set.\nDefaulting to a monolithic installation.")
+    set(CPACK_COMPONENTS_ALL)
+  else(CPACK_MONOLITHIC_INSTALL)
     # The user has provided the set of components to be installed as
     # part of a component-based installation; trust her.
-    SET(CPACK_COMPONENTS_ALL_SET_BY_USER TRUE)
-  ENDIF(CPACK_MONOLITHIC_INSTALL)
-ELSE(DEFINED CPACK_COMPONENTS_ALL)
+    set(CPACK_COMPONENTS_ALL_SET_BY_USER TRUE)
+  endif(CPACK_MONOLITHIC_INSTALL)
+else(DEFINED CPACK_COMPONENTS_ALL)
   # If the user has not specifically requested a monolithic installer
   # but has specified components in various "install" commands, tell
   # CPack about those components.
-  IF(NOT CPACK_MONOLITHIC_INSTALL)
-    GET_CMAKE_PROPERTY(CPACK_COMPONENTS_ALL COMPONENTS)
-    LIST(LENGTH CPACK_COMPONENTS_ALL CPACK_COMPONENTS_LEN)
-    IF(CPACK_COMPONENTS_LEN EQUAL 1)
+  if(NOT CPACK_MONOLITHIC_INSTALL)
+    get_cmake_property(CPACK_COMPONENTS_ALL COMPONENTS)
+    list(LENGTH CPACK_COMPONENTS_ALL CPACK_COMPONENTS_LEN)
+    if(CPACK_COMPONENTS_LEN EQUAL 1)
       # Only one component: this is not a component-based installation
       # (at least, it isn't a component-based installation, but may
       # become one later if the user uses the cpack_add_* commands).
-      SET(CPACK_COMPONENTS_ALL)
-    ENDIF(CPACK_COMPONENTS_LEN EQUAL 1)
-    SET(CPACK_COMPONENTS_LEN)
-  ENDIF(NOT CPACK_MONOLITHIC_INSTALL)
-ENDIF(DEFINED CPACK_COMPONENTS_ALL)
+      set(CPACK_COMPONENTS_ALL)
+    endif(CPACK_COMPONENTS_LEN EQUAL 1)
+    set(CPACK_COMPONENTS_LEN)
+  endif(NOT CPACK_MONOLITHIC_INSTALL)
+endif(DEFINED CPACK_COMPONENTS_ALL)
 
 # CMake always generates a component named "Unspecified", which is
 # used to install everything that doesn't have an explicitly-provided
@@ -566,13 +566,13 @@ cpack_set_if_not_set(CPACK_SOURCE_PACKAGE_FILE_NAME
   "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-Source")
 cpack_set_if_not_set(CPACK_SOURCE_IGNORE_FILES
   "/CVS/;/\\\\\\\\.svn/;/\\\\\\\\.bzr/;/\\\\\\\\.hg/;/\\\\\\\\.git/;\\\\\\\\.swp$;\\\\\\\\.#;/#")
-SET(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_SOURCE_INSTALL_CMAKE_PROJECTS}")
-SET(CPACK_INSTALLED_DIRECTORIES "${CPACK_SOURCE_INSTALLED_DIRECTORIES}")
-SET(CPACK_GENERATOR "${CPACK_SOURCE_GENERATOR}")
-SET(CPACK_TOPLEVEL_TAG "${CPACK_SOURCE_TOPLEVEL_TAG}")
-SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
-SET(CPACK_IGNORE_FILES "${CPACK_SOURCE_IGNORE_FILES}")
-SET(CPACK_STRIP_FILES "${CPACK_SOURCE_STRIP_FILES}")
+set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_SOURCE_INSTALL_CMAKE_PROJECTS}")
+set(CPACK_INSTALLED_DIRECTORIES "${CPACK_SOURCE_INSTALLED_DIRECTORIES}")
+set(CPACK_GENERATOR "${CPACK_SOURCE_GENERATOR}")
+set(CPACK_TOPLEVEL_TAG "${CPACK_SOURCE_TOPLEVEL_TAG}")
+set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
+set(CPACK_IGNORE_FILES "${CPACK_SOURCE_IGNORE_FILES}")
+set(CPACK_STRIP_FILES "${CPACK_SOURCE_STRIP_FILES}")
 
 cpack_encode_variables()
 configure_file("${cpack_source_input_file}"
diff --git a/Modules/CPackComponent.cmake b/Modules/CPackComponent.cmake
index dce34bf3a..d7d3cf84b 100644
--- a/Modules/CPackComponent.cmake
+++ b/Modules/CPackComponent.cmake
@@ -275,84 +275,84 @@
 #  License text for the above reference.)
 
 # Define var in order to avoid multiple inclusion
-IF(NOT CPackComponent_CMake_INCLUDED)
-SET(CPackComponent_CMake_INCLUDED 1)
+if(NOT CPackComponent_CMake_INCLUDED)
+set(CPackComponent_CMake_INCLUDED 1)
 
 # Argument-parsing macro from http://www.cmake.org/Wiki/CMakeMacroParseArguments
-MACRO(cpack_parse_arguments prefix arg_names option_names)
-  SET(${prefix}_DEFAULT_ARGS)
-  FOREACH(arg_name ${arg_names})
-    SET(${prefix}_${arg_name})
-  ENDFOREACH(arg_name)
-  FOREACH(option ${option_names})
-    SET(${prefix}_${option} FALSE)
-  ENDFOREACH(option)
+macro(cpack_parse_arguments prefix arg_names option_names)
+  set(${prefix}_DEFAULT_ARGS)
+  foreach(arg_name ${arg_names})
+    set(${prefix}_${arg_name})
+  endforeach(arg_name)
+  foreach(option ${option_names})
+    set(${prefix}_${option} FALSE)
+  endforeach(option)
 
-  SET(current_arg_name DEFAULT_ARGS)
-  SET(current_arg_list)
-  FOREACH(arg ${ARGN})
-    SET(larg_names ${arg_names})
-    LIST(FIND larg_names "${arg}" is_arg_name)
-    IF (is_arg_name GREATER -1)
-      SET(${prefix}_${current_arg_name} ${current_arg_list})
-      SET(current_arg_name ${arg})
-      SET(current_arg_list)
-    ELSE (is_arg_name GREATER -1)
-      SET(loption_names ${option_names})
-      LIST(FIND loption_names "${arg}" is_option)
-      IF (is_option GREATER -1)
-        SET(${prefix}_${arg} TRUE)
-      ELSE (is_option GREATER -1)
-        SET(current_arg_list ${current_arg_list} ${arg})
-      ENDIF (is_option GREATER -1)
-    ENDIF (is_arg_name GREATER -1)
-  ENDFOREACH(arg)
-  SET(${prefix}_${current_arg_name} ${current_arg_list})
-ENDMACRO(cpack_parse_arguments)
+  set(current_arg_name DEFAULT_ARGS)
+  set(current_arg_list)
+  foreach(arg ${ARGN})
+    set(larg_names ${arg_names})
+    list(FIND larg_names "${arg}" is_arg_name)
+    if (is_arg_name GREATER -1)
+      set(${prefix}_${current_arg_name} ${current_arg_list})
+      set(current_arg_name ${arg})
+      set(current_arg_list)
+    else (is_arg_name GREATER -1)
+      set(loption_names ${option_names})
+      list(FIND loption_names "${arg}" is_option)
+      if (is_option GREATER -1)
+        set(${prefix}_${arg} TRUE)
+      else (is_option GREATER -1)
+        set(current_arg_list ${current_arg_list} ${arg})
+      endif (is_option GREATER -1)
+    endif (is_arg_name GREATER -1)
+  endforeach(arg)
+  set(${prefix}_${current_arg_name} ${current_arg_list})
+endmacro(cpack_parse_arguments)
 
 # Macro that appends a SET command for the given variable name (var)
 # to the macro named strvar, but only if the variable named "var"
 # has been defined. The string will eventually be appended to a CPack
 # configuration file.
-MACRO(cpack_append_variable_set_command var strvar)
-  IF (DEFINED ${var})
-    SET(${strvar} "${${strvar}}SET(${var}")
-    FOREACH(APPENDVAL ${${var}})
-      SET(${strvar} "${${strvar}} ${APPENDVAL}")
-    ENDFOREACH(APPENDVAL)
-    SET(${strvar} "${${strvar}})\n")
-  ENDIF (DEFINED ${var})
-ENDMACRO(cpack_append_variable_set_command)
+macro(cpack_append_variable_set_command var strvar)
+  if (DEFINED ${var})
+    set(${strvar} "${${strvar}}set(${var}")
+    foreach(APPENDVAL ${${var}})
+      set(${strvar} "${${strvar}} ${APPENDVAL}")
+    endforeach(APPENDVAL)
+    set(${strvar} "${${strvar}})\n")
+  endif (DEFINED ${var})
+endmacro(cpack_append_variable_set_command)
 
 # Macro that appends a SET command for the given variable name (var)
 # to the macro named strvar, but only if the variable named "var"
 # has been defined and is a string. The string will eventually be
 # appended to a CPack configuration file.
-MACRO(cpack_append_string_variable_set_command var strvar)
-  IF (DEFINED ${var})
-    LIST(LENGTH ${var} CPACK_APP_VALUE_LEN)
-    IF(${CPACK_APP_VALUE_LEN} EQUAL 1)
-      SET(${strvar} "${${strvar}}SET(${var} \"${${var}}\")\n")
-    ENDIF(${CPACK_APP_VALUE_LEN} EQUAL 1)
-  ENDIF (DEFINED ${var})
-ENDMACRO(cpack_append_string_variable_set_command)
+macro(cpack_append_string_variable_set_command var strvar)
+  if (DEFINED ${var})
+    list(LENGTH ${var} CPACK_APP_VALUE_LEN)
+    if(${CPACK_APP_VALUE_LEN} EQUAL 1)
+      set(${strvar} "${${strvar}}set(${var} \"${${var}}\")\n")
+    endif(${CPACK_APP_VALUE_LEN} EQUAL 1)
+  endif (DEFINED ${var})
+endmacro(cpack_append_string_variable_set_command)
 
 # Macro that appends a SET command for the given variable name (var)
 # to the macro named strvar, but only if the variable named "var"
 # has been set to true. The string will eventually be
 # appended to a CPack configuration file.
-MACRO(cpack_append_option_set_command var strvar)
-  IF (${var})
-    LIST(LENGTH ${var} CPACK_APP_VALUE_LEN)
-    IF(${CPACK_APP_VALUE_LEN} EQUAL 1)
-      SET(${strvar} "${${strvar}}SET(${var} TRUE)\n")
-    ENDIF(${CPACK_APP_VALUE_LEN} EQUAL 1)
-  ENDIF (${var})
-ENDMACRO(cpack_append_option_set_command)
+macro(cpack_append_option_set_command var strvar)
+  if (${var})
+    list(LENGTH ${var} CPACK_APP_VALUE_LEN)
+    if(${CPACK_APP_VALUE_LEN} EQUAL 1)
+      set(${strvar} "${${strvar}}set(${var} TRUE)\n")
+    endif(${CPACK_APP_VALUE_LEN} EQUAL 1)
+  endif (${var})
+endmacro(cpack_append_option_set_command)
 
 # Macro that adds a component to the CPack installer
-MACRO(cpack_add_component compname)
-  STRING(TOUPPER ${compname} CPACK_ADDCOMP_UNAME)
+macro(cpack_add_component compname)
+  string(TOUPPER ${compname} CPACK_ADDCOMP_UNAME)
   cpack_parse_arguments(CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}
     "DISPLAY_NAME;DESCRIPTION;GROUP;DEPENDS;INSTALL_TYPES;ARCHIVE_FILE"
     "HIDDEN;REQUIRED;DISABLED;DOWNLOADED"
@@ -360,25 +360,25 @@ MACRO(cpack_add_component compname)
     )
 
   if (CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DOWNLOADED)
-    SET(CPACK_ADDCOMP_STR "\n# Configuration for downloaded component \"${compname}\"\n")
+    set(CPACK_ADDCOMP_STR "\n# Configuration for downloaded component \"${compname}\"\n")
   else ()
-    SET(CPACK_ADDCOMP_STR "\n# Configuration for component \"${compname}\"\n")
+    set(CPACK_ADDCOMP_STR "\n# Configuration for component \"${compname}\"\n")
   endif ()
 
-  IF(NOT CPACK_MONOLITHIC_INSTALL)
+  if(NOT CPACK_MONOLITHIC_INSTALL)
     # If the user didn't set CPACK_COMPONENTS_ALL explicitly, update the
     # value of CPACK_COMPONENTS_ALL in the configuration file. This will
     # take care of any components that have been added after the CPack
     # moduled was included.
-    IF(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
-      GET_CMAKE_PROPERTY(CPACK_ADDCOMP_COMPONENTS COMPONENTS)
-      SET(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR}\nSET(CPACK_COMPONENTS_ALL")
-      FOREACH(COMP ${CPACK_ADDCOMP_COMPONENTS})
-       SET(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR} ${COMP}")
-      ENDFOREACH(COMP)
-      SET(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR})\n")
-    ENDIF(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
-  ENDIF(NOT CPACK_MONOLITHIC_INSTALL)
+    if(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
+      get_cmake_property(CPACK_ADDCOMP_COMPONENTS COMPONENTS)
+      set(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR}\nSET(CPACK_COMPONENTS_ALL")
+      foreach(COMP ${CPACK_ADDCOMP_COMPONENTS})
+       set(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR} ${COMP}")
+      endforeach(COMP)
+      set(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR})\n")
+    endif(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
+  endif(NOT CPACK_MONOLITHIC_INSTALL)
 
   cpack_append_string_variable_set_command(
     CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DISPLAY_NAME
@@ -414,21 +414,21 @@ MACRO(cpack_add_component compname)
   # Write to config iff the macros is used after CPack.cmake has been
   # included, other it's not necessary because the variables
   # will be encoded by cpack_encode_variables.
-  IF(CPack_CMake_INCLUDED)
-    FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDCOMP_STR}")
-  ENDIF(CPack_CMake_INCLUDED)
-ENDMACRO(cpack_add_component)
+  if(CPack_CMake_INCLUDED)
+    file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDCOMP_STR}")
+  endif(CPack_CMake_INCLUDED)
+endmacro(cpack_add_component)
 
 # Macro that adds a component group to the CPack installer
-MACRO(cpack_add_component_group grpname)
-  STRING(TOUPPER ${grpname} CPACK_ADDGRP_UNAME)
+macro(cpack_add_component_group grpname)
+  string(TOUPPER ${grpname} CPACK_ADDGRP_UNAME)
   cpack_parse_arguments(CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}
     "DISPLAY_NAME;DESCRIPTION"
     "EXPANDED;BOLD_TITLE"
     ${ARGN}
     )
 
-  SET(CPACK_ADDGRP_STR "\n# Configuration for component group \"${grpname}\"\n")
+  set(CPACK_ADDGRP_STR "\n# Configuration for component group \"${grpname}\"\n")
   cpack_append_string_variable_set_command(
     CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}_DISPLAY_NAME
     CPACK_ADDGRP_STR)
@@ -445,24 +445,24 @@ MACRO(cpack_add_component_group grpname)
   # Write to config iff the macros is used after CPack.cmake has been
   # included, other it's not necessary because the variables
   # will be encoded by cpack_encode_variables.
-  IF(CPack_CMake_INCLUDED)
-    FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDGRP_STR}")
-  ENDIF(CPack_CMake_INCLUDED)
-ENDMACRO(cpack_add_component_group)
+  if(CPack_CMake_INCLUDED)
+    file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDGRP_STR}")
+  endif(CPack_CMake_INCLUDED)
+endmacro(cpack_add_component_group)
 
 # Macro that adds an installation type to the CPack installer
-MACRO(cpack_add_install_type insttype)
-  STRING(TOUPPER ${insttype} CPACK_INSTTYPE_UNAME)
+macro(cpack_add_install_type insttype)
+  string(TOUPPER ${insttype} CPACK_INSTTYPE_UNAME)
   cpack_parse_arguments(CPACK_INSTALL_TYPE_${CPACK_INSTTYPE_UNAME}
     "DISPLAY_NAME"
     ""
     ${ARGN}
     )
 
-  SET(CPACK_INSTTYPE_STR
+  set(CPACK_INSTTYPE_STR
     "\n# Configuration for installation type \"${insttype}\"\n")
-  SET(CPACK_INSTTYPE_STR
-    "${CPACK_INSTTYPE_STR}LIST(APPEND CPACK_ALL_INSTALL_TYPES ${insttype})\n")
+  set(CPACK_INSTTYPE_STR
+    "${CPACK_INSTTYPE_STR}list(APPEND CPACK_ALL_INSTALL_TYPES ${insttype})\n")
   cpack_append_string_variable_set_command(
     CPACK_INSTALL_TYPE_${CPACK_INSTTYPE_UNAME}_DISPLAY_NAME
     CPACK_INSTTYPE_STR)
@@ -470,22 +470,22 @@ MACRO(cpack_add_install_type insttype)
   # Write to config iff the macros is used after CPack.cmake has been
   # included, other it's not necessary because the variables
   # will be encoded by cpack_encode_variables.
-  IF(CPack_CMake_INCLUDED)
-    FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_INSTTYPE_STR}")
-  ENDIF(CPack_CMake_INCLUDED)
-ENDMACRO(cpack_add_install_type)
+  if(CPack_CMake_INCLUDED)
+    file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_INSTTYPE_STR}")
+  endif(CPack_CMake_INCLUDED)
+endmacro(cpack_add_install_type)
 
-MACRO(cpack_configure_downloads site)
+macro(cpack_configure_downloads site)
   cpack_parse_arguments(CPACK_DOWNLOAD
     "UPLOAD_DIRECTORY"
     "ALL;ADD_REMOVE;NO_ADD_REMOVE"
     ${ARGN}
     )
 
-  SET(CPACK_CONFIG_DL_STR
+  set(CPACK_CONFIG_DL_STR
     "\n# Downloaded components configuration\n")
-  SET(CPACK_UPLOAD_DIRECTORY ${CPACK_DOWNLOAD_UPLOAD_DIRECTORY})
-  SET(CPACK_DOWNLOAD_SITE ${site})
+  set(CPACK_UPLOAD_DIRECTORY ${CPACK_DOWNLOAD_UPLOAD_DIRECTORY})
+  set(CPACK_DOWNLOAD_SITE ${site})
   cpack_append_string_variable_set_command(
     CPACK_DOWNLOAD_SITE
     CPACK_CONFIG_DL_STR)
@@ -495,10 +495,10 @@ MACRO(cpack_configure_downloads site)
   cpack_append_option_set_command(
     CPACK_DOWNLOAD_ALL
     CPACK_CONFIG_DL_STR)
-  IF (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
-    SET(CPACK_DOWNLOAD_ADD_REMOVE ON)
-  ENDIF (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
-  SET(CPACK_ADD_REMOVE ${CPACK_DOWNLOAD_ADD_REMOVE})
+  if (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
+    set(CPACK_DOWNLOAD_ADD_REMOVE ON)
+  endif (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
+  set(CPACK_ADD_REMOVE ${CPACK_DOWNLOAD_ADD_REMOVE})
   cpack_append_option_set_command(
     CPACK_ADD_REMOVE
     CPACK_CONFIG_DL_STR)
@@ -506,8 +506,8 @@ MACRO(cpack_configure_downloads site)
   # Write to config iff the macros is used after CPack.cmake has been
   # included, other it's not necessary because the variables
   # will be encoded by cpack_encode_variables.
-  IF(CPack_CMake_INCLUDED)
-    FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_CONFIG_DL_STR}")
-  ENDIF(CPack_CMake_INCLUDED)
-ENDMACRO(cpack_configure_downloads)
-ENDIF(NOT CPackComponent_CMake_INCLUDED)
+  if(CPack_CMake_INCLUDED)
+    file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_CONFIG_DL_STR}")
+  endif(CPack_CMake_INCLUDED)
+endmacro(cpack_configure_downloads)
+endif(NOT CPackComponent_CMake_INCLUDED)
diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake
index bd3b94d74..640cf9a0e 100644
--- a/Modules/CPackDeb.cmake
+++ b/Modules/CPackDeb.cmake
@@ -161,7 +161,7 @@
 #     Default   : -
 #     This variable allow advanced user to add custom script to the control.tar.gz
 #     Typical usage is for conffiles, postinst, postrm, prerm.
-#     Usage: SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
+#     Usage: set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
 #            "${CMAKE_CURRENT_SOURCE_DIR/prerm;${CMAKE_CURRENT_SOURCE_DIR}/postrm")
 ##end
 
@@ -185,115 +185,115 @@
 #
 # http://wiki.debian.org/HowToPackageForDebian
 
-IF(CMAKE_BINARY_DIR)
-  MESSAGE(FATAL_ERROR "CPackDeb.cmake may only be used by CPack internally.")
-ENDIF(CMAKE_BINARY_DIR)
+if(CMAKE_BINARY_DIR)
+  message(FATAL_ERROR "CPackDeb.cmake may only be used by CPack internally.")
+endif(CMAKE_BINARY_DIR)
 
-IF(NOT UNIX)
-  MESSAGE(FATAL_ERROR "CPackDeb.cmake may only be used under UNIX.")
-ENDIF(NOT UNIX)
+if(NOT UNIX)
+  message(FATAL_ERROR "CPackDeb.cmake may only be used under UNIX.")
+endif(NOT UNIX)
 
 # CPACK_DEBIAN_PACKAGE_SHLIBDEPS
 # If specify OFF, only user depends are used
-IF(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
-  SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF)
-ENDIF(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
+if(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
+  set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF)
+endif(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
 
-FIND_PROGRAM(FAKEROOT_EXECUTABLE fakeroot)
-IF(FAKEROOT_EXECUTABLE)
-  SET(CPACK_DEBIAN_FAKEROOT_EXECUTABLE ${FAKEROOT_EXECUTABLE})
-ENDIF(FAKEROOT_EXECUTABLE)
+find_program(FAKEROOT_EXECUTABLE fakeroot)
+if(FAKEROOT_EXECUTABLE)
+  set(CPACK_DEBIAN_FAKEROOT_EXECUTABLE ${FAKEROOT_EXECUTABLE})
+endif(FAKEROOT_EXECUTABLE)
 
-IF(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
+if(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
   # dpkg-shlibdeps is a Debian utility for generating dependency list
-  FIND_PROGRAM(SHLIBDEPS_EXECUTABLE dpkg-shlibdeps)
+  find_program(SHLIBDEPS_EXECUTABLE dpkg-shlibdeps)
 
   # Check version of the dpkg-shlibdeps tool using CPackRPM method
-  IF(SHLIBDEPS_EXECUTABLE)
-    EXECUTE_PROCESS(COMMAND ${SHLIBDEPS_EXECUTABLE} --version
+  if(SHLIBDEPS_EXECUTABLE)
+    execute_process(COMMAND ${SHLIBDEPS_EXECUTABLE} --version
       OUTPUT_VARIABLE _TMP_VERSION
       ERROR_QUIET
       OUTPUT_STRIP_TRAILING_WHITESPACE)
-    STRING(REGEX MATCH "dpkg-shlibdeps version ([0-9]+\\.[0-9]+\\.[0-9]+)"
+    string(REGEX MATCH "dpkg-shlibdeps version ([0-9]+\\.[0-9]+\\.[0-9]+)"
       SHLIBDEPS_EXECUTABLE_VERSION
       ${_TMP_VERSION})
-    SET(SHLIBDEPS_EXECUTABLE_VERSION "${CMAKE_MATCH_1}")
-    IF(CPACK_DEBIAN_PACKAGE_DEBUG)
-      MESSAGE( "CPackDeb Debug: dpkg-shlibdeps version is <${SHLIBDEPS_EXECUTABLE_VERSION}>")
-    ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
+    set(SHLIBDEPS_EXECUTABLE_VERSION "${CMAKE_MATCH_1}")
+    if(CPACK_DEBIAN_PACKAGE_DEBUG)
+      message( "CPackDeb Debug: dpkg-shlibdeps version is <${SHLIBDEPS_EXECUTABLE_VERSION}>")
+    endif(CPACK_DEBIAN_PACKAGE_DEBUG)
 
     # Generating binary list - Get type of all install files
-    EXECUTE_PROCESS(COMMAND find -type f
+    execute_process(COMMAND find -type f
       COMMAND xargs file
       WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}"
       OUTPUT_VARIABLE CPACK_DEB_INSTALL_FILES)
 
     # Convert to CMake list
-    STRING(REGEX REPLACE "\n" ";" CPACK_DEB_INSTALL_FILES ${CPACK_DEB_INSTALL_FILES})
+    string(REGEX REPLACE "\n" ";" CPACK_DEB_INSTALL_FILES ${CPACK_DEB_INSTALL_FILES})
 
     # Only dynamically linked ELF files are included
     # Extract only file name infront of ":"
-    FOREACH ( _FILE ${CPACK_DEB_INSTALL_FILES})
-      IF ( ${_FILE} MATCHES "ELF.*dynamically linked")
-         STRING(REGEX MATCH "(^.*):" _FILE_NAME ${_FILE})
-         LIST(APPEND CPACK_DEB_BINARY_FILES ${CMAKE_MATCH_1})
-      ENDIF()
-    ENDFOREACH()
+    foreach ( _FILE ${CPACK_DEB_INSTALL_FILES})
+      if ( ${_FILE} MATCHES "ELF.*dynamically linked")
+         string(REGEX MATCH "(^.*):" _FILE_NAME ${_FILE})
+         list(APPEND CPACK_DEB_BINARY_FILES ${CMAKE_MATCH_1})
+      endif()
+    endforeach()
 
-    MESSAGE( "CPackDeb: - Generating dependency list")
+    message( "CPackDeb: - Generating dependency list")
 
     # Create blank control file for running dpkg-shlibdeps
     # There might be some other way to invoke dpkg-shlibdeps without creating this file
     # but standard debian package should not have anything that can collide with this file or directory
-    FILE(MAKE_DIRECTORY ${CPACK_TEMPORARY_DIRECTORY}/debian)
-    FILE(WRITE ${CPACK_TEMPORARY_DIRECTORY}/debian/control "")
+    file(MAKE_DIRECTORY ${CPACK_TEMPORARY_DIRECTORY}/debian)
+    file(WRITE ${CPACK_TEMPORARY_DIRECTORY}/debian/control "")
 
     # Execute dpkg-shlibdeps
     # --ignore-missing-info : allow dpkg-shlibdeps to run even if some libs do not belong to a package
     # -O : print to STDOUT
-    EXECUTE_PROCESS(COMMAND ${SHLIBDEPS_EXECUTABLE} --ignore-missing-info -O ${CPACK_DEB_BINARY_FILES}
+    execute_process(COMMAND ${SHLIBDEPS_EXECUTABLE} --ignore-missing-info -O ${CPACK_DEB_BINARY_FILES}
       WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}"
       OUTPUT_VARIABLE SHLIBDEPS_OUTPUT
       RESULT_VARIABLE SHLIBDEPS_RESULT
       ERROR_VARIABLE SHLIBDEPS_ERROR
       OUTPUT_STRIP_TRAILING_WHITESPACE )
-    IF(CPACK_DEBIAN_PACKAGE_DEBUG)
+    if(CPACK_DEBIAN_PACKAGE_DEBUG)
       # dpkg-shlibdeps will throw some warnings if some input files are not binary
-      MESSAGE( "CPackDeb Debug: dpkg-shlibdeps warnings \n${SHLIBDEPS_ERROR}")
-    ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
-    IF (NOT SHLIBDEPS_RESULT EQUAL 0)
-      MESSAGE (FATAL_ERROR "CPackDeb: dpkg-shlibdeps: ${SHLIBDEPS_ERROR}")
-    ENDIF (NOT SHLIBDEPS_RESULT EQUAL 0)
+      message( "CPackDeb Debug: dpkg-shlibdeps warnings \n${SHLIBDEPS_ERROR}")
+    endif(CPACK_DEBIAN_PACKAGE_DEBUG)
+    if (NOT SHLIBDEPS_RESULT EQUAL 0)
+      message (FATAL_ERROR "CPackDeb: dpkg-shlibdeps: ${SHLIBDEPS_ERROR}")
+    endif (NOT SHLIBDEPS_RESULT EQUAL 0)
 
     #Get rid of prefix generated by dpkg-shlibdeps
     string (REGEX REPLACE "^.*Depends=" "" CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS ${SHLIBDEPS_OUTPUT})
 
-    IF(CPACK_DEBIAN_PACKAGE_DEBUG)
-      MESSAGE( "CPackDeb Debug: Found dependency: ${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}")
-    ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
+    if(CPACK_DEBIAN_PACKAGE_DEBUG)
+      message( "CPackDeb Debug: Found dependency: ${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}")
+    endif(CPACK_DEBIAN_PACKAGE_DEBUG)
 
     # Remove blank control file
     # Might not be safe if package actual contain file or directory named debian
-    FILE(REMOVE_RECURSE "${CPACK_TEMPORARY_DIRECTORY}/debian")
+    file(REMOVE_RECURSE "${CPACK_TEMPORARY_DIRECTORY}/debian")
 
     # Append user depend if set
-    IF (CPACK_DEBIAN_PACKAGE_DEPENDS)
-      SET (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}, ${CPACK_DEBIAN_PACKAGE_DEPENDS}")
-    ELSE (CPACK_DEBIAN_PACKAGE_DEPENDS)
-      SET (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}")
-    ENDIF (CPACK_DEBIAN_PACKAGE_DEPENDS)
+    if (CPACK_DEBIAN_PACKAGE_DEPENDS)
+      set (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}, ${CPACK_DEBIAN_PACKAGE_DEPENDS}")
+    else (CPACK_DEBIAN_PACKAGE_DEPENDS)
+      set (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}")
+    endif (CPACK_DEBIAN_PACKAGE_DEPENDS)
 
-  ELSE (SHLIBDEPS_EXECUTABLE)
-    IF(CPACK_DEBIAN_PACKAGE_DEBUG)
-      MESSAGE( "CPackDeb Debug: Using only user-provided depends because dpkg-shlibdeps is not found.")
-    ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
-  ENDIF(SHLIBDEPS_EXECUTABLE)
+  else (SHLIBDEPS_EXECUTABLE)
+    if(CPACK_DEBIAN_PACKAGE_DEBUG)
+      message( "CPackDeb Debug: Using only user-provided depends because dpkg-shlibdeps is not found.")
+    endif(CPACK_DEBIAN_PACKAGE_DEBUG)
+  endif(SHLIBDEPS_EXECUTABLE)
 
-ELSE (CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
-  IF(CPACK_DEBIAN_PACKAGE_DEBUG)
-    MESSAGE( "CPackDeb Debug: Using only user-provided depends")
-  ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
-ENDIF(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
+else (CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
+  if(CPACK_DEBIAN_PACKAGE_DEBUG)
+    message( "CPackDeb Debug: Using only user-provided depends")
+  endif(CPACK_DEBIAN_PACKAGE_DEBUG)
+endif(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
 
 # Let's define the control file found in debian package:
 
@@ -303,67 +303,67 @@ ENDIF(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
 # DEBIAN/control
 # debian policy enforce lower case for package name
 # Package: (mandatory)
-IF(NOT CPACK_DEBIAN_PACKAGE_NAME)
-  STRING(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_DEBIAN_PACKAGE_NAME)
-ENDIF(NOT CPACK_DEBIAN_PACKAGE_NAME)
+if(NOT CPACK_DEBIAN_PACKAGE_NAME)
+  string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_DEBIAN_PACKAGE_NAME)
+endif(NOT CPACK_DEBIAN_PACKAGE_NAME)
 
 # Version: (mandatory)
-IF(NOT CPACK_DEBIAN_PACKAGE_VERSION)
-  IF(NOT CPACK_PACKAGE_VERSION)
-    MESSAGE(FATAL_ERROR "CPackDeb: Debian package requires a package version")
-  ENDIF(NOT CPACK_PACKAGE_VERSION)
-  SET(CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
-ENDIF(NOT CPACK_DEBIAN_PACKAGE_VERSION)
+if(NOT CPACK_DEBIAN_PACKAGE_VERSION)
+  if(NOT CPACK_PACKAGE_VERSION)
+    message(FATAL_ERROR "CPackDeb: Debian package requires a package version")
+  endif(NOT CPACK_PACKAGE_VERSION)
+  set(CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
+endif(NOT CPACK_DEBIAN_PACKAGE_VERSION)
 
 # Architecture: (mandatory)
-IF(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
+if(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
   # There is no such thing as i686 architecture on debian, you should use i386 instead
   # $ dpkg --print-architecture
-  FIND_PROGRAM(DPKG_CMD dpkg)
-  IF(NOT DPKG_CMD)
-    MESSAGE(STATUS "CPackDeb: Can not find dpkg in your path, default to i386.")
-    SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386)
-  ENDIF(NOT DPKG_CMD)
-  EXECUTE_PROCESS(COMMAND "${DPKG_CMD}" --print-architecture
+  find_program(DPKG_CMD dpkg)
+  if(NOT DPKG_CMD)
+    message(STATUS "CPackDeb: Can not find dpkg in your path, default to i386.")
+    set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386)
+  endif(NOT DPKG_CMD)
+  execute_process(COMMAND "${DPKG_CMD}" --print-architecture
     OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
     OUTPUT_STRIP_TRAILING_WHITESPACE
     )
-ENDIF(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
+endif(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
 
-# have a look at GET_PROPERTY(result GLOBAL PROPERTY ENABLED_FEATURES),
-# this returns the successful FIND_PACKAGE() calls, maybe this can help
+# have a look at get_property(result GLOBAL PROPERTY ENABLED_FEATURES),
+# this returns the successful find_package() calls, maybe this can help
 # Depends:
 # You should set: DEBIAN_PACKAGE_DEPENDS
 # TODO: automate 'objdump -p | grep NEEDED'
-IF(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
-  MESSAGE(STATUS "CPACK_DEBIAN_PACKAGE_DEPENDS not set, the package will have no dependencies.")
-ENDIF(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
+if(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
+  message(STATUS "CPACK_DEBIAN_PACKAGE_DEPENDS not set, the package will have no dependencies.")
+endif(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
 
 # Maintainer: (mandatory)
-IF(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER)
-  IF(NOT CPACK_PACKAGE_CONTACT)
-    MESSAGE(FATAL_ERROR "CPackDeb: Debian package requires a maintainer for a package, set CPACK_PACKAGE_CONTACT or CPACK_DEBIAN_PACKAGE_MAINTAINER")
-  ENDIF(NOT CPACK_PACKAGE_CONTACT)
-  SET(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT})
-ENDIF(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER)
+if(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER)
+  if(NOT CPACK_PACKAGE_CONTACT)
+    message(FATAL_ERROR "CPackDeb: Debian package requires a maintainer for a package, set CPACK_PACKAGE_CONTACT or CPACK_DEBIAN_PACKAGE_MAINTAINER")
+  endif(NOT CPACK_PACKAGE_CONTACT)
+  set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT})
+endif(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER)
 
 # Description: (mandatory)
-IF(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
-  IF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
-    MESSAGE(FATAL_ERROR "CPackDeb: Debian package requires a summary for a package, set CPACK_PACKAGE_DESCRIPTION_SUMMARY or CPACK_DEBIAN_PACKAGE_DESCRIPTION")
-  ENDIF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
-  SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
-ENDIF(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
+if(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
+  if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
+    message(FATAL_ERROR "CPackDeb: Debian package requires a summary for a package, set CPACK_PACKAGE_DESCRIPTION_SUMMARY or CPACK_DEBIAN_PACKAGE_DESCRIPTION")
+  endif(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
+  set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
+endif(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
 
 # Section: (recommended)
-IF(NOT CPACK_DEBIAN_PACKAGE_SECTION)
-  SET(CPACK_DEBIAN_PACKAGE_SECTION "devel")
-ENDIF(NOT CPACK_DEBIAN_PACKAGE_SECTION)
+if(NOT CPACK_DEBIAN_PACKAGE_SECTION)
+  set(CPACK_DEBIAN_PACKAGE_SECTION "devel")
+endif(NOT CPACK_DEBIAN_PACKAGE_SECTION)
 
 # Priority: (recommended)
-IF(NOT CPACK_DEBIAN_PACKAGE_PRIORITY)
-  SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
-ENDIF(NOT CPACK_DEBIAN_PACKAGE_PRIORITY )
+if(NOT CPACK_DEBIAN_PACKAGE_PRIORITY)
+  set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
+endif(NOT CPACK_DEBIAN_PACKAGE_PRIORITY )
 
 # Recommends:
 # You should set: CPACK_DEBIAN_PACKAGE_RECOMMENDS
@@ -379,32 +379,32 @@ ENDIF(NOT CPACK_DEBIAN_PACKAGE_PRIORITY )
 # - postrm
 # - prerm"
 # Usage:
-# SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
+# set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
 #    "${CMAKE_CURRENT_SOURCE_DIR/prerm;${CMAKE_CURRENT_SOURCE_DIR}/postrm")
 
 # Are we packaging components ?
-IF(CPACK_DEB_PACKAGE_COMPONENT)
-  SET(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "-${CPACK_DEB_PACKAGE_COMPONENT}")
-  SET(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "/${CPACK_DEB_PACKAGE_COMPONENT}")
-  SET(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${CPACK_DEB_PACKAGE_COMPONENT}")
-  STRING(TOLOWER "${CPACK_PACKAGE_NAME}${CPACK_DEB_PACKAGE_COMPONENT_PART_NAME}" CPACK_DEBIAN_PACKAGE_NAME)
-ELSE(CPACK_DEB_PACKAGE_COMPONENT)
-  SET(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "")
-  SET(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "")
-  SET(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
-ENDIF(CPACK_DEB_PACKAGE_COMPONENT)
+if(CPACK_DEB_PACKAGE_COMPONENT)
+  set(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "-${CPACK_DEB_PACKAGE_COMPONENT}")
+  set(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "/${CPACK_DEB_PACKAGE_COMPONENT}")
+  set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${CPACK_DEB_PACKAGE_COMPONENT}")
+  string(TOLOWER "${CPACK_PACKAGE_NAME}${CPACK_DEB_PACKAGE_COMPONENT_PART_NAME}" CPACK_DEBIAN_PACKAGE_NAME)
+else(CPACK_DEB_PACKAGE_COMPONENT)
+  set(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "")
+  set(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "")
+  set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
+endif(CPACK_DEB_PACKAGE_COMPONENT)
 
 # Print out some debug information if we were asked for that
-IF(CPACK_DEBIAN_PACKAGE_DEBUG)
-   MESSAGE("CPackDeb:Debug: CPACK_TOPLEVEL_DIRECTORY          = ${CPACK_TOPLEVEL_DIRECTORY}")
-   MESSAGE("CPackDeb:Debug: CPACK_TOPLEVEL_TAG                = ${CPACK_TOPLEVEL_TAG}")
-   MESSAGE("CPackDeb:Debug: CPACK_TEMPORARY_DIRECTORY         = ${CPACK_TEMPORARY_DIRECTORY}")
-   MESSAGE("CPackDeb:Debug: CPACK_OUTPUT_FILE_NAME            = ${CPACK_OUTPUT_FILE_NAME}")
-   MESSAGE("CPackDeb:Debug: CPACK_OUTPUT_FILE_PATH            = ${CPACK_OUTPUT_FILE_PATH}")
-   MESSAGE("CPackDeb:Debug: CPACK_PACKAGE_FILE_NAME           = ${CPACK_PACKAGE_FILE_NAME}")
-   MESSAGE("CPackDeb:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY   = ${CPACK_PACKAGE_INSTALL_DIRECTORY}")
-   MESSAGE("CPackDeb:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
-ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
+if(CPACK_DEBIAN_PACKAGE_DEBUG)
+   message("CPackDeb:Debug: CPACK_TOPLEVEL_DIRECTORY          = ${CPACK_TOPLEVEL_DIRECTORY}")
+   message("CPackDeb:Debug: CPACK_TOPLEVEL_TAG                = ${CPACK_TOPLEVEL_TAG}")
+   message("CPackDeb:Debug: CPACK_TEMPORARY_DIRECTORY         = ${CPACK_TEMPORARY_DIRECTORY}")
+   message("CPackDeb:Debug: CPACK_OUTPUT_FILE_NAME            = ${CPACK_OUTPUT_FILE_NAME}")
+   message("CPackDeb:Debug: CPACK_OUTPUT_FILE_PATH            = ${CPACK_OUTPUT_FILE_PATH}")
+   message("CPackDeb:Debug: CPACK_PACKAGE_FILE_NAME           = ${CPACK_PACKAGE_FILE_NAME}")
+   message("CPackDeb:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY   = ${CPACK_PACKAGE_INSTALL_DIRECTORY}")
+   message("CPackDeb:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
+endif(CPACK_DEBIAN_PACKAGE_DEBUG)
 
 # For debian source packages:
 # debian/control
@@ -414,8 +414,8 @@ ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
 # http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-debiansourcecontrolfiles
 
 # Builds-Depends:
-#IF(NOT CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS)
-#  SET(CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS
+#if(NOT CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS)
+#  set(CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS
 #    "debhelper (>> 5.0.0), libncurses5-dev, tcl8.4"
 #  )
-#ENDIF(NOT CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS)
+#endif(NOT CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS)
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index 0ac6e17e6..66237d88d 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -162,7 +162,7 @@
 #     Default   : -
 #     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).
+#     The specified file will be processed by configure_file( @ONLY).
 ##end
 ##variable
 #  CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE - Spec file template.
@@ -239,22 +239,22 @@
 
 # Author: Eric Noulard with the help of Alexander Neundorf.
 
-IF(CMAKE_BINARY_DIR)
-  MESSAGE(FATAL_ERROR "CPackRPM.cmake may only be used by CPack internally.")
-ENDIF(CMAKE_BINARY_DIR)
+if(CMAKE_BINARY_DIR)
+  message(FATAL_ERROR "CPackRPM.cmake may only be used by CPack internally.")
+endif(CMAKE_BINARY_DIR)
 
-IF(NOT UNIX)
-  MESSAGE(FATAL_ERROR "CPackRPM.cmake may only be used under UNIX.")
-ENDIF(NOT UNIX)
+if(NOT UNIX)
+  message(FATAL_ERROR "CPackRPM.cmake may only be used under UNIX.")
+endif(NOT UNIX)
 
 # rpmbuild is the basic command for building RPM package
 # it may be a simple (symbolic) link to rpm command.
-FIND_PROGRAM(RPMBUILD_EXECUTABLE rpmbuild)
+find_program(RPMBUILD_EXECUTABLE rpmbuild)
 
 # Check version of the rpmbuild tool this would be easier to
 # track bugs with users and CPackRPM debug mode.
 # We may use RPM version in order to check for available version dependent features
-IF(RPMBUILD_EXECUTABLE)
+if(RPMBUILD_EXECUTABLE)
   execute_process(COMMAND ${RPMBUILD_EXECUTABLE} --version
                   OUTPUT_VARIABLE _TMP_VERSION
                   ERROR_QUIET
@@ -262,19 +262,19 @@ IF(RPMBUILD_EXECUTABLE)
   string(REGEX REPLACE "^.*\ " ""
          RPMBUILD_EXECUTABLE_VERSION
          ${_TMP_VERSION})
-  IF(CPACK_RPM_PACKAGE_DEBUG)
-    MESSAGE("CPackRPM:Debug: rpmbuild version is <${RPMBUILD_EXECUTABLE_VERSION}>")
-  ENDIF(CPACK_RPM_PACKAGE_DEBUG)
-ENDIF(RPMBUILD_EXECUTABLE)
+  if(CPACK_RPM_PACKAGE_DEBUG)
+    message("CPackRPM:Debug: rpmbuild version is <${RPMBUILD_EXECUTABLE_VERSION}>")
+  endif(CPACK_RPM_PACKAGE_DEBUG)
+endif(RPMBUILD_EXECUTABLE)
 
-IF(NOT RPMBUILD_EXECUTABLE)
-  MESSAGE(FATAL_ERROR "RPM package requires rpmbuild executable")
-ENDIF(NOT RPMBUILD_EXECUTABLE)
+if(NOT RPMBUILD_EXECUTABLE)
+  message(FATAL_ERROR "RPM package requires rpmbuild executable")
+endif(NOT RPMBUILD_EXECUTABLE)
 
 # Display lsb_release output if DEBUG mode enable
 # This will help to diagnose problem with CPackRPM
 # because we will know on which kind of Linux we are
-IF(CPACK_RPM_PACKAGE_DEBUG)
+if(CPACK_RPM_PACKAGE_DEBUG)
   find_program(LSB_RELEASE_EXECUTABLE lsb_release)
   if(LSB_RELEASE_EXECUTABLE)
     execute_process(COMMAND ${LSB_RELEASE_EXECUTABLE} -a
@@ -287,37 +287,37 @@ IF(CPACK_RPM_PACKAGE_DEBUG)
   else (LSB_RELEASE_EXECUTABLE)
     set(LSB_RELEASE_OUTPUT "lsb_release not installed/found!")
   endif(LSB_RELEASE_EXECUTABLE)
-  MESSAGE("CPackRPM:Debug: LSB_RELEASE  = ${LSB_RELEASE_OUTPUT}")
-ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+  message("CPackRPM:Debug: LSB_RELEASE  = ${LSB_RELEASE_OUTPUT}")
+endif(CPACK_RPM_PACKAGE_DEBUG)
 
 # We may use RPM version in the future in order
 # to shut down warning about space in buildtree
 # some recent RPM version should support space in different places.
 # not checked [yet].
-IF(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*")
-  MESSAGE(FATAL_ERROR "${RPMBUILD_EXECUTABLE} can't handle paths with spaces, use a build directory without spaces for building RPMs.")
-ENDIF(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*")
+if(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*")
+  message(FATAL_ERROR "${RPMBUILD_EXECUTABLE} can't handle paths with spaces, use a build directory without spaces for building RPMs.")
+endif(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*")
 
 # If rpmbuild is found
 # we try to discover alien since we may be on non RPM distro like Debian.
 # In this case we may try to to use more advanced features
 # like generating RPM directly from DEB using alien.
 # FIXME feature not finished (yet)
-FIND_PROGRAM(ALIEN_EXECUTABLE alien)
-IF(ALIEN_EXECUTABLE)
-  MESSAGE(STATUS "alien found, we may be on a Debian based distro.")
-ENDIF(ALIEN_EXECUTABLE)
+find_program(ALIEN_EXECUTABLE alien)
+if(ALIEN_EXECUTABLE)
+  message(STATUS "alien found, we may be on a Debian based distro.")
+endif(ALIEN_EXECUTABLE)
 
 # Are we packaging components ?
-IF(CPACK_RPM_PACKAGE_COMPONENT)
-  SET(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "-${CPACK_RPM_PACKAGE_COMPONENT}")
-  SET(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "/${CPACK_RPM_PACKAGE_COMPONENT}")
-  SET(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${CPACK_RPM_PACKAGE_COMPONENT}")
-ELSE(CPACK_RPM_PACKAGE_COMPONENT)
-  SET(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "")
-  SET(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "")
-  SET(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
-ENDIF(CPACK_RPM_PACKAGE_COMPONENT)
+if(CPACK_RPM_PACKAGE_COMPONENT)
+  set(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "-${CPACK_RPM_PACKAGE_COMPONENT}")
+  set(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "/${CPACK_RPM_PACKAGE_COMPONENT}")
+  set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${CPACK_RPM_PACKAGE_COMPONENT}")
+else(CPACK_RPM_PACKAGE_COMPONENT)
+  set(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "")
+  set(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "")
+  set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
+endif(CPACK_RPM_PACKAGE_COMPONENT)
 
 #
 # Use user-defined RPM specific variables value
@@ -329,42 +329,42 @@ ENDIF(CPACK_RPM_PACKAGE_COMPONENT)
 #
 
 # CPACK_RPM_PACKAGE_SUMMARY (mandatory)
-IF(NOT CPACK_RPM_PACKAGE_SUMMARY)
+if(NOT CPACK_RPM_PACKAGE_SUMMARY)
   # if neither var is defined lets use the name as summary
-  IF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
-    STRING(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_SUMMARY)
-  ELSE(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
-    SET(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
-  ENDIF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
-ENDIF(NOT CPACK_RPM_PACKAGE_SUMMARY)
+  if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
+    string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_SUMMARY)
+  else(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
+    set(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
+  endif(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
+endif(NOT CPACK_RPM_PACKAGE_SUMMARY)
 
 # CPACK_RPM_PACKAGE_NAME (mandatory)
-IF(NOT CPACK_RPM_PACKAGE_NAME)
-  STRING(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_NAME)
-ENDIF(NOT CPACK_RPM_PACKAGE_NAME)
+if(NOT CPACK_RPM_PACKAGE_NAME)
+  string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_NAME)
+endif(NOT CPACK_RPM_PACKAGE_NAME)
 
 # CPACK_RPM_PACKAGE_VERSION (mandatory)
-IF(NOT CPACK_RPM_PACKAGE_VERSION)
-  IF(NOT CPACK_PACKAGE_VERSION)
-    MESSAGE(FATAL_ERROR "RPM package requires a package version")
-  ENDIF(NOT CPACK_PACKAGE_VERSION)
-  SET(CPACK_RPM_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
-ENDIF(NOT CPACK_RPM_PACKAGE_VERSION)
+if(NOT CPACK_RPM_PACKAGE_VERSION)
+  if(NOT CPACK_PACKAGE_VERSION)
+    message(FATAL_ERROR "RPM package requires a package version")
+  endif(NOT CPACK_PACKAGE_VERSION)
+  set(CPACK_RPM_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
+endif(NOT CPACK_RPM_PACKAGE_VERSION)
 # Replace '-' in version with '_'
 # '-' character is  an Illegal RPM version character
 # it is illegal because it is used to separate
 # RPM "Version" from RPM "Release"
-STRING(REPLACE "-" "_" CPACK_RPM_PACKAGE_VERSION ${CPACK_RPM_PACKAGE_VERSION})
+string(REPLACE "-" "_" CPACK_RPM_PACKAGE_VERSION ${CPACK_RPM_PACKAGE_VERSION})
 
 # CPACK_RPM_PACKAGE_ARCHITECTURE (optional)
-IF(CPACK_RPM_PACKAGE_ARCHITECTURE)
-  SET(TMP_RPM_BUILDARCH "Buildarch: ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
-  IF(CPACK_RPM_PACKAGE_DEBUG)
-    MESSAGE("CPackRPM:Debug: using user-specified build arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
-  ENDIF(CPACK_RPM_PACKAGE_DEBUG)
-ELSE(CPACK_RPM_PACKAGE_ARCHITECTURE)
-  SET(TMP_RPM_BUILDARCH "")
-ENDIF(CPACK_RPM_PACKAGE_ARCHITECTURE)
+if(CPACK_RPM_PACKAGE_ARCHITECTURE)
+  set(TMP_RPM_BUILDARCH "Buildarch: ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
+  if(CPACK_RPM_PACKAGE_DEBUG)
+    message("CPackRPM:Debug: using user-specified build arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
+  endif(CPACK_RPM_PACKAGE_DEBUG)
+else(CPACK_RPM_PACKAGE_ARCHITECTURE)
+  set(TMP_RPM_BUILDARCH "")
+endif(CPACK_RPM_PACKAGE_ARCHITECTURE)
 
 # CPACK_RPM_PACKAGE_RELEASE
 # The RPM release is the numbering of the RPM package ITSELF
@@ -374,28 +374,28 @@ ENDIF(CPACK_RPM_PACKAGE_ARCHITECTURE)
 # without changing the version of the packaged software.
 # This is the case when the packaging is buggy (not) the software :=)
 # If not set, 1 is a good candidate
-IF(NOT CPACK_RPM_PACKAGE_RELEASE)
-  SET(CPACK_RPM_PACKAGE_RELEASE 1)
-ENDIF(NOT CPACK_RPM_PACKAGE_RELEASE)
+if(NOT CPACK_RPM_PACKAGE_RELEASE)
+  set(CPACK_RPM_PACKAGE_RELEASE 1)
+endif(NOT CPACK_RPM_PACKAGE_RELEASE)
 
 # CPACK_RPM_PACKAGE_LICENSE
-IF(NOT CPACK_RPM_PACKAGE_LICENSE)
-  SET(CPACK_RPM_PACKAGE_LICENSE "unknown")
-ENDIF(NOT CPACK_RPM_PACKAGE_LICENSE)
+if(NOT CPACK_RPM_PACKAGE_LICENSE)
+  set(CPACK_RPM_PACKAGE_LICENSE "unknown")
+endif(NOT CPACK_RPM_PACKAGE_LICENSE)
 
 # CPACK_RPM_PACKAGE_GROUP
-IF(NOT CPACK_RPM_PACKAGE_GROUP)
-  SET(CPACK_RPM_PACKAGE_GROUP "unknown")
-ENDIF(NOT CPACK_RPM_PACKAGE_GROUP)
+if(NOT CPACK_RPM_PACKAGE_GROUP)
+  set(CPACK_RPM_PACKAGE_GROUP "unknown")
+endif(NOT CPACK_RPM_PACKAGE_GROUP)
 
 # CPACK_RPM_PACKAGE_VENDOR
-IF(NOT CPACK_RPM_PACKAGE_VENDOR)
-  IF(CPACK_PACKAGE_VENDOR)
-    SET(CPACK_RPM_PACKAGE_VENDOR "${CPACK_PACKAGE_VENDOR}")
-  ELSE(CPACK_PACKAGE_VENDOR)
-    SET(CPACK_RPM_PACKAGE_VENDOR "unknown")
-  ENDIF(CPACK_PACKAGE_VENDOR)
-ENDIF(NOT CPACK_RPM_PACKAGE_VENDOR)
+if(NOT CPACK_RPM_PACKAGE_VENDOR)
+  if(CPACK_PACKAGE_VENDOR)
+    set(CPACK_RPM_PACKAGE_VENDOR "${CPACK_PACKAGE_VENDOR}")
+  else(CPACK_PACKAGE_VENDOR)
+    set(CPACK_RPM_PACKAGE_VENDOR "unknown")
+  endif(CPACK_PACKAGE_VENDOR)
+endif(NOT CPACK_RPM_PACKAGE_VENDOR)
 
 # CPACK_RPM_PACKAGE_SOURCE
 # The name of the source tarball in case we generate a source RPM
@@ -407,35 +407,35 @@ ENDIF(NOT CPACK_RPM_PACKAGE_VENDOR)
 #     if it is defined
 #   - set to a default value
 #
-IF (NOT CPACK_RPM_PACKAGE_DESCRIPTION)
-        IF (CPACK_PACKAGE_DESCRIPTION_FILE)
-                FILE(READ ${CPACK_PACKAGE_DESCRIPTION_FILE} CPACK_RPM_PACKAGE_DESCRIPTION)
-        ELSE (CPACK_PACKAGE_DESCRIPTION_FILE)
-                SET(CPACK_RPM_PACKAGE_DESCRIPTION "no package description available")
-        ENDIF (CPACK_PACKAGE_DESCRIPTION_FILE)
-ENDIF (NOT CPACK_RPM_PACKAGE_DESCRIPTION)
+if (NOT CPACK_RPM_PACKAGE_DESCRIPTION)
+        if (CPACK_PACKAGE_DESCRIPTION_FILE)
+                file(READ ${CPACK_PACKAGE_DESCRIPTION_FILE} CPACK_RPM_PACKAGE_DESCRIPTION)
+        else (CPACK_PACKAGE_DESCRIPTION_FILE)
+                set(CPACK_RPM_PACKAGE_DESCRIPTION "no package description available")
+        endif (CPACK_PACKAGE_DESCRIPTION_FILE)
+endif (NOT CPACK_RPM_PACKAGE_DESCRIPTION)
 
 # CPACK_RPM_COMPRESSION_TYPE
 #
-IF (CPACK_RPM_COMPRESSION_TYPE)
-   IF(CPACK_RPM_PACKAGE_DEBUG)
-     MESSAGE("CPackRPM:Debug: User Specified RPM compression type: ${CPACK_RPM_COMPRESSION_TYPE}")
-   ENDIF(CPACK_RPM_PACKAGE_DEBUG)
-   IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "lzma")
-     SET(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.lzdio")
-   ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "lzma")
-   IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz")
-     SET(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w7.xzdio")
-   ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz")
-   IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2")
-     SET(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.bzdio")
-   ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2")
-   IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip")
-     SET(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.gzdio")
-   ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip")
-ELSE(CPACK_RPM_COMPRESSION_TYPE)
-   SET(CPACK_RPM_COMPRESSION_TYPE_TMP "")
-ENDIF(CPACK_RPM_COMPRESSION_TYPE)
+if (CPACK_RPM_COMPRESSION_TYPE)
+   if(CPACK_RPM_PACKAGE_DEBUG)
+     message("CPackRPM:Debug: User Specified RPM compression type: ${CPACK_RPM_COMPRESSION_TYPE}")
+   endif(CPACK_RPM_PACKAGE_DEBUG)
+   if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "lzma")
+     set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.lzdio")
+   endif(CPACK_RPM_COMPRESSION_TYPE STREQUAL "lzma")
+   if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz")
+     set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w7.xzdio")
+   endif(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz")
+   if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2")
+     set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.bzdio")
+   endif(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2")
+   if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip")
+     set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.gzdio")
+   endif(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip")
+else(CPACK_RPM_COMPRESSION_TYPE)
+   set(CPACK_RPM_COMPRESSION_TYPE_TMP "")
+endif(CPACK_RPM_COMPRESSION_TYPE)
 
 if(CPACK_PACKAGE_RELOCATABLE)
   set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE)
@@ -453,57 +453,57 @@ endif(CPACK_RPM_PACKAGE_RELOCATABLE)
 
 # Check if additional fields for RPM spec header are given
 # There may be some COMPONENT specific variables as well
-FOREACH(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLICTS AUTOPROV AUTOREQ AUTOREQPROV)
-    IF(CPACK_RPM_PACKAGE_DEBUG)
+foreach(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLICTS AUTOPROV AUTOREQ AUTOREQPROV)
+    if(CPACK_RPM_PACKAGE_DEBUG)
       message("CPackRPM:Debug: processing ${_RPM_SPEC_HEADER}")
-    ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+    endif(CPACK_RPM_PACKAGE_DEBUG)
     if(CPACK_RPM_PACKAGE_COMPONENT)
         if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER})
-            IF(CPACK_RPM_PACKAGE_DEBUG)
+            if(CPACK_RPM_PACKAGE_DEBUG)
               message("CPackRPM:Debug: using CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}")
-            ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+            endif(CPACK_RPM_PACKAGE_DEBUG)
             set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}})
         else()
-            IF(CPACK_RPM_PACKAGE_DEBUG)
+            if(CPACK_RPM_PACKAGE_DEBUG)
               message("CPackRPM:Debug: CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER} not defined")
               message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}")
-            ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+            endif(CPACK_RPM_PACKAGE_DEBUG)
             set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}})
         endif()
     else()
-        IF(CPACK_RPM_PACKAGE_DEBUG)
+        if(CPACK_RPM_PACKAGE_DEBUG)
           message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}")
-        ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+        endif(CPACK_RPM_PACKAGE_DEBUG)
         set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}})
     endif()
 
-  IF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
-    STRING(LENGTH ${_RPM_SPEC_HEADER} _PACKAGE_HEADER_STRLENGTH)
-    MATH(EXPR _PACKAGE_HEADER_STRLENGTH "${_PACKAGE_HEADER_STRLENGTH} - 1")
-    STRING(SUBSTRING ${_RPM_SPEC_HEADER} 1 ${_PACKAGE_HEADER_STRLENGTH} _PACKAGE_HEADER_TAIL)
-    STRING(TOLOWER "${_PACKAGE_HEADER_TAIL}" _PACKAGE_HEADER_TAIL)
-    STRING(SUBSTRING ${_RPM_SPEC_HEADER} 0 1 _PACKAGE_HEADER_NAME)
-    SET(_PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_NAME}${_PACKAGE_HEADER_TAIL}")
-    IF(CPACK_RPM_PACKAGE_DEBUG)
-      MESSAGE("CPackRPM:Debug: User defined ${_PACKAGE_HEADER_NAME}:\n ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}")
-    ENDIF(CPACK_RPM_PACKAGE_DEBUG)
-    SET(TMP_RPM_${_RPM_SPEC_HEADER} "${_PACKAGE_HEADER_NAME}: ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}")
-  ELSE(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
+  if(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
+    string(LENGTH ${_RPM_SPEC_HEADER} _PACKAGE_HEADER_STRLENGTH)
+    math(EXPR _PACKAGE_HEADER_STRLENGTH "${_PACKAGE_HEADER_STRLENGTH} - 1")
+    string(SUBSTRING ${_RPM_SPEC_HEADER} 1 ${_PACKAGE_HEADER_STRLENGTH} _PACKAGE_HEADER_TAIL)
+    string(TOLOWER "${_PACKAGE_HEADER_TAIL}" _PACKAGE_HEADER_TAIL)
+    string(SUBSTRING ${_RPM_SPEC_HEADER} 0 1 _PACKAGE_HEADER_NAME)
+    set(_PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_NAME}${_PACKAGE_HEADER_TAIL}")
+    if(CPACK_RPM_PACKAGE_DEBUG)
+      message("CPackRPM:Debug: User defined ${_PACKAGE_HEADER_NAME}:\n ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}")
+    endif(CPACK_RPM_PACKAGE_DEBUG)
+    set(TMP_RPM_${_RPM_SPEC_HEADER} "${_PACKAGE_HEADER_NAME}: ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}")
+  else(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
     # Do not forget to unset previously set header (from previous component)
-    UNSET(TMP_RPM_${_RPM_SPEC_HEADER})
-  ENDIF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
-ENDFOREACH(_RPM_SPEC_HEADER)
+    unset(TMP_RPM_${_RPM_SPEC_HEADER})
+  endif(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
+endforeach(_RPM_SPEC_HEADER)
 
 # CPACK_RPM_SPEC_INSTALL_POST
 # May be used to define a RPM post intallation script
 # for example setting it to "/bin/true" may prevent
 # rpmbuild from stripping binaries.
-IF(CPACK_RPM_SPEC_INSTALL_POST)
-  IF(CPACK_RPM_PACKAGE_DEBUG)
-    MESSAGE("CPackRPM:Debug: User defined CPACK_RPM_SPEC_INSTALL_POST = ${CPACK_RPM_SPEC_INSTALL_POST}")
-  ENDIF(CPACK_RPM_PACKAGE_DEBUG)
-  SET(TMP_RPM_SPEC_INSTALL_POST "%define __spec_install_post ${CPACK_RPM_SPEC_INSTALL_POST}")
-ENDIF(CPACK_RPM_SPEC_INSTALL_POST)
+if(CPACK_RPM_SPEC_INSTALL_POST)
+  if(CPACK_RPM_PACKAGE_DEBUG)
+    message("CPackRPM:Debug: User defined CPACK_RPM_SPEC_INSTALL_POST = ${CPACK_RPM_SPEC_INSTALL_POST}")
+  endif(CPACK_RPM_PACKAGE_DEBUG)
+  set(TMP_RPM_SPEC_INSTALL_POST "%define __spec_install_post ${CPACK_RPM_SPEC_INSTALL_POST}")
+endif(CPACK_RPM_SPEC_INSTALL_POST)
 
 # CPACK_RPM_POST_INSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_POST_INSTALL_SCRIPT_FILE)
 # CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_POST_UNINSTALL_SCRIPT_FILE)
@@ -614,30 +614,30 @@ endif(CPACK_RPM_CHANGELOG_FILE)
 
 # CPACK_RPM_SPEC_MORE_DEFINE
 # This is a generated spec rpm file spaceholder
-IF(CPACK_RPM_SPEC_MORE_DEFINE)
-  IF(CPACK_RPM_PACKAGE_DEBUG)
-    MESSAGE("CPackRPM:Debug: User defined more define spec line specified:\n ${CPACK_RPM_SPEC_MORE_DEFINE}")
-  ENDIF(CPACK_RPM_PACKAGE_DEBUG)
-ENDIF(CPACK_RPM_SPEC_MORE_DEFINE)
+if(CPACK_RPM_SPEC_MORE_DEFINE)
+  if(CPACK_RPM_PACKAGE_DEBUG)
+    message("CPackRPM:Debug: User defined more define spec line specified:\n ${CPACK_RPM_SPEC_MORE_DEFINE}")
+  endif(CPACK_RPM_PACKAGE_DEBUG)
+endif(CPACK_RPM_SPEC_MORE_DEFINE)
 
 # Now we may create the RPM build tree structure
-SET(CPACK_RPM_ROOTDIR "${CPACK_TOPLEVEL_DIRECTORY}")
-MESSAGE(STATUS "CPackRPM:Debug: Using CPACK_RPM_ROOTDIR=${CPACK_RPM_ROOTDIR}")
+set(CPACK_RPM_ROOTDIR "${CPACK_TOPLEVEL_DIRECTORY}")
+message(STATUS "CPackRPM:Debug: Using CPACK_RPM_ROOTDIR=${CPACK_RPM_ROOTDIR}")
 # Prepare RPM build tree
-FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR})
-FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/tmp)
-FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/BUILD)
-FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/RPMS)
-FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SOURCES)
-FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SPECS)
-FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SRPMS)
+file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR})
+file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/tmp)
+file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/BUILD)
+file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/RPMS)
+file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SOURCES)
+file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SPECS)
+file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SRPMS)
 
-#SET(CPACK_RPM_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${CPACK_RPM_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}-${CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm")
-SET(CPACK_RPM_FILE_NAME "${CPACK_OUTPUT_FILE_NAME}")
+#set(CPACK_RPM_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${CPACK_RPM_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}-${CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm")
+set(CPACK_RPM_FILE_NAME "${CPACK_OUTPUT_FILE_NAME}")
 # it seems rpmbuild can't handle spaces in the path
 # neither escaping (as below) nor putting quotes around the path seem to help
-#STRING(REGEX REPLACE " " "\\\\ " CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
-SET(CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
+#string(REGEX REPLACE " " "\\\\ " CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
+set(CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
 
 # if we are creating a relocatable package, omit parent directories of
 # CPACK_RPM_PACKAGE_PREFIX. This is achieved by building a "filter list"
@@ -666,7 +666,7 @@ endif()
 # file name by enclosing it between double quotes (thus the sed)
 # Then we must authorize any man pages extension (adding * at the end)
 # because rpmbuild may automatically compress those files
-EXECUTE_PROCESS(COMMAND find . -type f -o -type l -o (-type d -a -not ( -name "." ${_RPM_DIRS_TO_OMIT} ) )
+execute_process(COMMAND find . -type f -o -type l -o (-type d -a -not ( -name "." ${_RPM_DIRS_TO_OMIT} ) )
                 COMMAND sed s:.*/man.*/.*:&*:
                 COMMAND sed s/\\.\\\(.*\\\)/\"\\1\"/
                 WORKING_DIRECTORY "${WDIR}"
@@ -715,9 +715,9 @@ endif()
 #                      or CPACK_RPM_INSTALL_FILES,
 # hence it must be done before these auto-generated lists are processed.
 if(CPACK_RPM_USER_FILELIST_INTERNAL)
-  IF(CPACK_RPM_PACKAGE_DEBUG)
+  if(CPACK_RPM_PACKAGE_DEBUG)
     message("CPackRPM:Debug: Handling User Filelist: <${CPACK_RPM_USER_FILELIST_INTERNAL}>")
-  ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+  endif(CPACK_RPM_PACKAGE_DEBUG)
 
   # Create CMake list from CPACK_RPM_INSTALL_FILES
   string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST)
@@ -753,9 +753,9 @@ else()
 endif()
 
 if (CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
-  IF(CPACK_RPM_PACKAGE_DEBUG)
+  if(CPACK_RPM_PACKAGE_DEBUG)
     message("CPackRPM:Debug: Handling Absolute Destination Files: ${CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL}")
-  ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+  endif(CPACK_RPM_PACKAGE_DEBUG)
   # Remove trailing space
   string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST)
   # Transform endline separated - string into CMake List
@@ -774,10 +774,10 @@ if (CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
   foreach(F IN LISTS CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
     set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "${CPACK_RPM_ABSOLUTE_INSTALL_FILES}%config \"${F}\"\n")
   endforeach(F)
-  IF(CPACK_RPM_PACKAGE_DEBUG)
+  if(CPACK_RPM_PACKAGE_DEBUG)
     message("CPackRPM:Debug: CPACK_RPM_ABSOLUTE_INSTALL_FILES=${CPACK_RPM_ABSOLUTE_INSTALL_FILES}")
     message("CPackRPM:Debug: CPACK_RPM_INSTALL_FILES=${CPACK_RPM_INSTALL_FILES}")
-  ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+  endif(CPACK_RPM_PACKAGE_DEBUG)
 else()
   # reset vars in order to avoid leakage of value(s) from one component to another
   set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "")
@@ -803,28 +803,28 @@ endforeach(F)
 set(CPACK_RPM_INSTALL_FILES_LIST "")
 
 # The name of the final spec file to be used by rpmbuild
-SET(CPACK_RPM_BINARY_SPECFILE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.spec")
+set(CPACK_RPM_BINARY_SPECFILE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.spec")
 
 # Print out some debug information if we were asked for that
-IF(CPACK_RPM_PACKAGE_DEBUG)
-   MESSAGE("CPackRPM:Debug: CPACK_TOPLEVEL_DIRECTORY          = ${CPACK_TOPLEVEL_DIRECTORY}")
-   MESSAGE("CPackRPM:Debug: CPACK_TOPLEVEL_TAG                = ${CPACK_TOPLEVEL_TAG}")
-   MESSAGE("CPackRPM:Debug: CPACK_TEMPORARY_DIRECTORY         = ${CPACK_TEMPORARY_DIRECTORY}")
-   MESSAGE("CPackRPM:Debug: CPACK_OUTPUT_FILE_NAME            = ${CPACK_OUTPUT_FILE_NAME}")
-   MESSAGE("CPackRPM:Debug: CPACK_OUTPUT_FILE_PATH            = ${CPACK_OUTPUT_FILE_PATH}")
-   MESSAGE("CPackRPM:Debug: CPACK_PACKAGE_FILE_NAME           = ${CPACK_PACKAGE_FILE_NAME}")
-   MESSAGE("CPackRPM:Debug: CPACK_RPM_BINARY_SPECFILE         = ${CPACK_RPM_BINARY_SPECFILE}")
-   MESSAGE("CPackRPM:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY   = ${CPACK_PACKAGE_INSTALL_DIRECTORY}")
-   MESSAGE("CPackRPM:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
-ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+if(CPACK_RPM_PACKAGE_DEBUG)
+   message("CPackRPM:Debug: CPACK_TOPLEVEL_DIRECTORY          = ${CPACK_TOPLEVEL_DIRECTORY}")
+   message("CPackRPM:Debug: CPACK_TOPLEVEL_TAG                = ${CPACK_TOPLEVEL_TAG}")
+   message("CPackRPM:Debug: CPACK_TEMPORARY_DIRECTORY         = ${CPACK_TEMPORARY_DIRECTORY}")
+   message("CPackRPM:Debug: CPACK_OUTPUT_FILE_NAME            = ${CPACK_OUTPUT_FILE_NAME}")
+   message("CPackRPM:Debug: CPACK_OUTPUT_FILE_PATH            = ${CPACK_OUTPUT_FILE_PATH}")
+   message("CPackRPM:Debug: CPACK_PACKAGE_FILE_NAME           = ${CPACK_PACKAGE_FILE_NAME}")
+   message("CPackRPM:Debug: CPACK_RPM_BINARY_SPECFILE         = ${CPACK_RPM_BINARY_SPECFILE}")
+   message("CPackRPM:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY   = ${CPACK_PACKAGE_INSTALL_DIRECTORY}")
+   message("CPackRPM:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
+endif(CPACK_RPM_PACKAGE_DEBUG)
 
 # USER generated spec file handling.
 # We should generate a 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
+if(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE)
+   file(WRITE ${CPACK_RPM_BINARY_SPECFILE}.in
       "# -*- rpm-spec -*-
 BuildRoot:      \@CPACK_RPM_DIRECTORY\@/\@CPACK_PACKAGE_FILE_NAME\@\@CPACK_RPM_PACKAGE_COMPONENT_PART_PATH\@
 Summary:        \@CPACK_RPM_PACKAGE_SUMMARY\@
@@ -898,28 +898,28 @@ ${CPACK_RPM_USER_INSTALL_FILES}
   # Stop here if we were asked to only generate a template USER spec file
   # The generated file may then be used as a template by user who wants
   # to customize their own spec file.
-  IF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE)
-     MESSAGE(FATAL_ERROR "CPackRPM: STOP here Generated USER binary spec file templare is: ${CPACK_RPM_BINARY_SPECFILE}.in")
-  ENDIF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE)
-ENDIF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE)
+  if(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE)
+     message(FATAL_ERROR "CPackRPM: STOP here Generated USER binary spec file templare is: ${CPACK_RPM_BINARY_SPECFILE}.in")
+  endif(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE)
+endif(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE)
 
 # After that we may either use a user provided spec file
 # or generate one using appropriate variables value.
-IF(CPACK_RPM_USER_BINARY_SPECFILE)
+if(CPACK_RPM_USER_BINARY_SPECFILE)
   # User may have specified SPECFILE just use it
-  MESSAGE("CPackRPM: Will use USER specified spec file: ${CPACK_RPM_USER_BINARY_SPECFILE}")
+  message("CPackRPM: Will use USER specified spec file: ${CPACK_RPM_USER_BINARY_SPECFILE}")
   # The user provided file is processed for @var replacement
-  CONFIGURE_FILE(${CPACK_RPM_USER_BINARY_SPECFILE} ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
-ELSE(CPACK_RPM_USER_BINARY_SPECFILE)
+  configure_file(${CPACK_RPM_USER_BINARY_SPECFILE} ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
+else(CPACK_RPM_USER_BINARY_SPECFILE)
   # No User specified spec file, will use the generated spec file
-  MESSAGE("CPackRPM: Will use GENERATED spec file: ${CPACK_RPM_BINARY_SPECFILE}")
+  message("CPackRPM: Will use GENERATED spec file: ${CPACK_RPM_BINARY_SPECFILE}")
   # Note the just created file is processed for @var replacement
-  CONFIGURE_FILE(${CPACK_RPM_BINARY_SPECFILE}.in ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
-ENDIF(CPACK_RPM_USER_BINARY_SPECFILE)
+  configure_file(${CPACK_RPM_BINARY_SPECFILE}.in ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
+endif(CPACK_RPM_USER_BINARY_SPECFILE)
 
-IF(RPMBUILD_EXECUTABLE)
+if(RPMBUILD_EXECUTABLE)
   # Now call rpmbuild using the SPECFILE
-  EXECUTE_PROCESS(
+  execute_process(
     COMMAND "${RPMBUILD_EXECUTABLE}" -bb
             --define "_topdir ${CPACK_RPM_DIRECTORY}"
             --buildroot "${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}"
@@ -928,17 +928,17 @@ IF(RPMBUILD_EXECUTABLE)
     RESULT_VARIABLE CPACK_RPMBUILD_EXEC_RESULT
     ERROR_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err"
     OUTPUT_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out")
-  IF(CPACK_RPM_PACKAGE_DEBUG OR CPACK_RPMBUILD_EXEC_RESULT)
-    FILE(READ ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err RPMBUILDERR)
-    FILE(READ ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out RPMBUILDOUT)
-    MESSAGE("CPackRPM:Debug: You may consult rpmbuild logs in: ")
-    MESSAGE("CPackRPM:Debug:    - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err")
-    MESSAGE("CPackRPM:Debug: *** ${RPMBUILDERR} ***")
-    MESSAGE("CPackRPM:Debug:    - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out")
-    MESSAGE("CPackRPM:Debug: *** ${RPMBUILDERR} ***")
-  ENDIF(CPACK_RPM_PACKAGE_DEBUG OR CPACK_RPMBUILD_EXEC_RESULT)
-ELSE(RPMBUILD_EXECUTABLE)
-  IF(ALIEN_EXECUTABLE)
-    MESSAGE(FATAL_ERROR "RPM packaging through alien not done (yet)")
-  ENDIF(ALIEN_EXECUTABLE)
-ENDIF(RPMBUILD_EXECUTABLE)
+  if(CPACK_RPM_PACKAGE_DEBUG OR CPACK_RPMBUILD_EXEC_RESULT)
+    file(READ ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err RPMBUILDERR)
+    file(READ ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out RPMBUILDOUT)
+    message("CPackRPM:Debug: You may consult rpmbuild logs in: ")
+    message("CPackRPM:Debug:    - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err")
+    message("CPackRPM:Debug: *** ${RPMBUILDERR} ***")
+    message("CPackRPM:Debug:    - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out")
+    message("CPackRPM:Debug: *** ${RPMBUILDERR} ***")
+  endif(CPACK_RPM_PACKAGE_DEBUG OR CPACK_RPMBUILD_EXEC_RESULT)
+else(RPMBUILD_EXECUTABLE)
+  if(ALIEN_EXECUTABLE)
+    message(FATAL_ERROR "RPM packaging through alien not done (yet)")
+  endif(ALIEN_EXECUTABLE)
+endif(RPMBUILD_EXECUTABLE)
diff --git a/Modules/CPackZIP.cmake b/Modules/CPackZIP.cmake
index f80b43903..bf7062a76 100644
--- a/Modules/CPackZIP.cmake
+++ b/Modules/CPackZIP.cmake
@@ -12,30 +12,30 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-IF(CMAKE_BINARY_DIR)
-  MESSAGE(FATAL_ERROR "CPackZIP.cmake may only be used by CPack internally.")
-ENDIF(CMAKE_BINARY_DIR)
+if(CMAKE_BINARY_DIR)
+  message(FATAL_ERROR "CPackZIP.cmake may only be used by CPack internally.")
+endif(CMAKE_BINARY_DIR)
 
-FIND_PROGRAM(ZIP_EXECUTABLE wzzip PATHS "$ENV{ProgramFiles}/WinZip")
-IF(ZIP_EXECUTABLE)
-  SET(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" -P \"<ARCHIVE>\" @<FILELIST>")
-  SET(CPACK_ZIP_NEED_QUOTES TRUE)
-ENDIF(ZIP_EXECUTABLE)
+find_program(ZIP_EXECUTABLE wzzip PATHS "$ENV{ProgramFiles}/WinZip")
+if(ZIP_EXECUTABLE)
+  set(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" -P \"<ARCHIVE>\" @<FILELIST>")
+  set(CPACK_ZIP_NEED_QUOTES TRUE)
+endif(ZIP_EXECUTABLE)
 
-IF(NOT ZIP_EXECUTABLE)
-  FIND_PROGRAM(ZIP_EXECUTABLE 7z PATHS "$ENV{ProgramFiles}/7-Zip")
-  IF(ZIP_EXECUTABLE)
-    SET(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" a -tzip \"<ARCHIVE>\" @<FILELIST>")
-  SET(CPACK_ZIP_NEED_QUOTES TRUE)
-  ENDIF(ZIP_EXECUTABLE)
-ENDIF(NOT ZIP_EXECUTABLE)
+if(NOT ZIP_EXECUTABLE)
+  find_program(ZIP_EXECUTABLE 7z PATHS "$ENV{ProgramFiles}/7-Zip")
+  if(ZIP_EXECUTABLE)
+    set(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" a -tzip \"<ARCHIVE>\" @<FILELIST>")
+  set(CPACK_ZIP_NEED_QUOTES TRUE)
+  endif(ZIP_EXECUTABLE)
+endif(NOT ZIP_EXECUTABLE)
 
-IF(NOT ZIP_EXECUTABLE)
-  FIND_PACKAGE(Cygwin)
-  FIND_PROGRAM(ZIP_EXECUTABLE zip PATHS "${CYGWIN_INSTALL_PATH}/bin")
-  IF(ZIP_EXECUTABLE)
-    SET(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" -r \"<ARCHIVE>\" . -i@<FILELIST>")
-    SET(CPACK_ZIP_NEED_QUOTES FALSE)
-  ENDIF(ZIP_EXECUTABLE)
-ENDIF(NOT ZIP_EXECUTABLE)
+if(NOT ZIP_EXECUTABLE)
+  find_package(Cygwin)
+  find_program(ZIP_EXECUTABLE zip PATHS "${CYGWIN_INSTALL_PATH}/bin")
+  if(ZIP_EXECUTABLE)
+    set(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" -r \"<ARCHIVE>\" . -i@<FILELIST>")
+    set(CPACK_ZIP_NEED_QUOTES FALSE)
+  endif(ZIP_EXECUTABLE)
+endif(NOT ZIP_EXECUTABLE)
 
diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake
index a32baa223..4e861a92a 100644
--- a/Modules/CTest.cmake
+++ b/Modules/CTest.cmake
@@ -58,46 +58,46 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-OPTION(BUILD_TESTING "Build the testing tree." ON)
+option(BUILD_TESTING "Build the testing tree." ON)
 
 # function to turn generator name into a version string
 # like vs7 vs71 vs8 vs9
-FUNCTION(GET_VS_VERSION_STRING generator var)
-  STRING(REGEX REPLACE "Visual Studio ([0-9][0-9]?)($|.*)" "\\1"
+function(GET_VS_VERSION_STRING generator var)
+  string(REGEX REPLACE "Visual Studio ([0-9][0-9]?)($|.*)" "\\1"
     NUMBER "${generator}")
-  IF("${generator}" MATCHES "Visual Studio 7 .NET 2003")
-    SET(ver_string "vs71")
-  ELSE("${generator}" MATCHES "Visual Studio 7 .NET 2003")
-    SET(ver_string "vs${NUMBER}")
-  ENDIF("${generator}" MATCHES "Visual Studio 7 .NET 2003")
-  SET(${var} ${ver_string} PARENT_SCOPE)
-ENDFUNCTION(GET_VS_VERSION_STRING)
+  if("${generator}" MATCHES "Visual Studio 7 .NET 2003")
+    set(ver_string "vs71")
+  else("${generator}" MATCHES "Visual Studio 7 .NET 2003")
+    set(ver_string "vs${NUMBER}")
+  endif("${generator}" MATCHES "Visual Studio 7 .NET 2003")
+  set(${var} ${ver_string} PARENT_SCOPE)
+endfunction(GET_VS_VERSION_STRING)
 
-IF(BUILD_TESTING)
+if(BUILD_TESTING)
   # Setup some auxilary macros
-  MACRO(SET_IF_NOT_SET var val)
-    IF(NOT DEFINED "${var}")
-      SET("${var}" "${val}")
-    ENDIF(NOT DEFINED "${var}")
-  ENDMACRO(SET_IF_NOT_SET)
+  macro(SET_IF_NOT_SET var val)
+    if(NOT DEFINED "${var}")
+      set("${var}" "${val}")
+    endif(NOT DEFINED "${var}")
+  endmacro(SET_IF_NOT_SET)
 
-  MACRO(SET_IF_SET var val)
-    IF(NOT "${val}" MATCHES "^$")
-      SET("${var}" "${val}")
-    ENDIF(NOT "${val}" MATCHES "^$")
-  ENDMACRO(SET_IF_SET)
+  macro(SET_IF_SET var val)
+    if(NOT "${val}" MATCHES "^$")
+      set("${var}" "${val}")
+    endif(NOT "${val}" MATCHES "^$")
+  endmacro(SET_IF_SET)
 
-  MACRO(SET_IF_SET_AND_NOT_SET var val)
-    IF(NOT "${val}" MATCHES "^$")
+  macro(SET_IF_SET_AND_NOT_SET var val)
+    if(NOT "${val}" MATCHES "^$")
       SET_IF_NOT_SET("${var}" "${val}")
-    ENDIF(NOT "${val}" MATCHES "^$")
-  ENDMACRO(SET_IF_SET_AND_NOT_SET)
+    endif(NOT "${val}" MATCHES "^$")
+  endmacro(SET_IF_SET_AND_NOT_SET)
 
   # Make sure testing is enabled
-  ENABLE_TESTING()
+  enable_testing()
 
-  IF(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake")
-    INCLUDE("${PROJECT_SOURCE_DIR}/CTestConfig.cmake")
+  if(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake")
+    include("${PROJECT_SOURCE_DIR}/CTestConfig.cmake")
     SET_IF_SET_AND_NOT_SET(NIGHTLY_START_TIME "${CTEST_NIGHTLY_START_TIME}")
     SET_IF_SET_AND_NOT_SET(DROP_METHOD "${CTEST_DROP_METHOD}")
     SET_IF_SET_AND_NOT_SET(DROP_SITE "${CTEST_DROP_SITE}")
@@ -107,155 +107,155 @@ IF(BUILD_TESTING)
     SET_IF_SET_AND_NOT_SET(DROP_LOCATION "${CTEST_DROP_LOCATION}")
     SET_IF_SET_AND_NOT_SET(TRIGGER_SITE "${CTEST_TRIGGER_SITE}")
     SET_IF_SET_AND_NOT_SET(UPDATE_TYPE "${CTEST_UPDATE_TYPE}")
-  ENDIF(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake")
+  endif(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake")
 
   # the project can have a DartConfig.cmake file
-  IF(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake")
-    INCLUDE("${PROJECT_SOURCE_DIR}/DartConfig.cmake")
-  ELSE(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake")
+  if(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake")
+    include("${PROJECT_SOURCE_DIR}/DartConfig.cmake")
+  else(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake")
     # Dashboard is opened for submissions for a 24 hour period starting at
     # the specified NIGHTLY_START_TIME. Time is specified in 24 hour format.
     SET_IF_NOT_SET (NIGHTLY_START_TIME "00:00:00 EDT")
     SET_IF_NOT_SET(DROP_METHOD "http")
     SET_IF_NOT_SET (COMPRESS_SUBMISSION ON)
-  ENDIF(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake")
+  endif(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake")
   SET_IF_NOT_SET (NIGHTLY_START_TIME "00:00:00 EDT")
 
-  FIND_PROGRAM(CVSCOMMAND cvs )
-  SET(CVS_UPDATE_OPTIONS "-d -A -P" CACHE STRING
+  find_program(CVSCOMMAND cvs )
+  set(CVS_UPDATE_OPTIONS "-d -A -P" CACHE STRING
     "Options passed to the cvs update command.")
-  FIND_PROGRAM(SVNCOMMAND svn)
-  FIND_PROGRAM(BZRCOMMAND bzr)
-  FIND_PROGRAM(HGCOMMAND hg)
-  FIND_PROGRAM(GITCOMMAND git)
+  find_program(SVNCOMMAND svn)
+  find_program(BZRCOMMAND bzr)
+  find_program(HGCOMMAND hg)
+  find_program(GITCOMMAND git)
 
-  IF(NOT UPDATE_TYPE)
-    IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CVS")
-      SET(UPDATE_TYPE cvs)
-    ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn")
-      SET(UPDATE_TYPE svn)
-    ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.bzr")
-      SET(UPDATE_TYPE bzr)
-    ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.hg")
-      SET(UPDATE_TYPE hg)
-    ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
-      SET(UPDATE_TYPE git)
-    ENDIF()
-  ENDIF(NOT UPDATE_TYPE)
+  if(NOT UPDATE_TYPE)
+    if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CVS")
+      set(UPDATE_TYPE cvs)
+    elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn")
+      set(UPDATE_TYPE svn)
+    elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.bzr")
+      set(UPDATE_TYPE bzr)
+    elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.hg")
+      set(UPDATE_TYPE hg)
+    elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
+      set(UPDATE_TYPE git)
+    endif()
+  endif(NOT UPDATE_TYPE)
 
-  STRING(TOLOWER "${UPDATE_TYPE}" _update_type)
-  IF("${_update_type}" STREQUAL "cvs")
-    SET(UPDATE_COMMAND "${CVSCOMMAND}")
-    SET(UPDATE_OPTIONS "${CVS_UPDATE_OPTIONS}")
-  ELSEIF("${_update_type}" STREQUAL "svn")
-    SET(UPDATE_COMMAND "${SVNCOMMAND}")
-    SET(UPDATE_OPTIONS "${SVN_UPDATE_OPTIONS}")
-  ELSEIF("${_update_type}" STREQUAL "bzr")
-    SET(UPDATE_COMMAND "${BZRCOMMAND}")
-    SET(UPDATE_OPTIONS "${BZR_UPDATE_OPTIONS}")
-  ELSEIF("${_update_type}" STREQUAL "hg")
-    SET(UPDATE_COMMAND "${HGCOMMAND}")
-    SET(UPDATE_OPTIONS "${HG_UPDATE_OPTIONS}")
-  ELSEIF("${_update_type}" STREQUAL "git")
-    SET(UPDATE_COMMAND "${GITCOMMAND}")
-    SET(UPDATE_OPTIONS "${GIT_UPDATE_OPTIONS}")
-  ENDIF()
+  string(TOLOWER "${UPDATE_TYPE}" _update_type)
+  if("${_update_type}" STREQUAL "cvs")
+    set(UPDATE_COMMAND "${CVSCOMMAND}")
+    set(UPDATE_OPTIONS "${CVS_UPDATE_OPTIONS}")
+  elseif("${_update_type}" STREQUAL "svn")
+    set(UPDATE_COMMAND "${SVNCOMMAND}")
+    set(UPDATE_OPTIONS "${SVN_UPDATE_OPTIONS}")
+  elseif("${_update_type}" STREQUAL "bzr")
+    set(UPDATE_COMMAND "${BZRCOMMAND}")
+    set(UPDATE_OPTIONS "${BZR_UPDATE_OPTIONS}")
+  elseif("${_update_type}" STREQUAL "hg")
+    set(UPDATE_COMMAND "${HGCOMMAND}")
+    set(UPDATE_OPTIONS "${HG_UPDATE_OPTIONS}")
+  elseif("${_update_type}" STREQUAL "git")
+    set(UPDATE_COMMAND "${GITCOMMAND}")
+    set(UPDATE_OPTIONS "${GIT_UPDATE_OPTIONS}")
+  endif()
 
-  SET(DART_TESTING_TIMEOUT 1500 CACHE STRING
+  set(DART_TESTING_TIMEOUT 1500 CACHE STRING
     "Maximum time allowed before CTest will kill the test.")
 
-  SET(CTEST_SUBMIT_RETRY_DELAY 5 CACHE STRING
+  set(CTEST_SUBMIT_RETRY_DELAY 5 CACHE STRING
     "How long to wait between timed-out CTest submissions.")
-  SET(CTEST_SUBMIT_RETRY_COUNT 3 CACHE STRING
+  set(CTEST_SUBMIT_RETRY_COUNT 3 CACHE STRING
     "How many times to retry timed-out CTest submissions.")
 
-  FIND_PROGRAM(MEMORYCHECK_COMMAND
+  find_program(MEMORYCHECK_COMMAND
     NAMES purify valgrind boundscheck
     PATHS
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Rational Software\\Purify\\Setup;InstallFolder]"
     DOC "Path to the memory checking command, used for memory error detection."
     )
-  FIND_PROGRAM(SLURM_SBATCH_COMMAND sbatch DOC
+  find_program(SLURM_SBATCH_COMMAND sbatch DOC
     "Path to the SLURM sbatch executable"
     )
-  FIND_PROGRAM(SLURM_SRUN_COMMAND srun DOC
+  find_program(SLURM_SRUN_COMMAND srun DOC
     "Path to the SLURM srun executable"
     )
-  SET(MEMORYCHECK_SUPPRESSIONS_FILE "" CACHE FILEPATH
+  set(MEMORYCHECK_SUPPRESSIONS_FILE "" CACHE FILEPATH
     "File that contains suppressions for the memory checker")
-  FIND_PROGRAM(SCPCOMMAND scp DOC
+  find_program(SCPCOMMAND scp DOC
     "Path to scp command, used by CTest for submitting results to a Dart server"
     )
-  FIND_PROGRAM(COVERAGE_COMMAND gcov DOC
+  find_program(COVERAGE_COMMAND gcov DOC
     "Path to the coverage program that CTest uses for performing coverage inspection"
     )
-  SET(COVERAGE_EXTRA_FLAGS "-l" CACHE STRING
+  set(COVERAGE_EXTRA_FLAGS "-l" CACHE STRING
     "Extra command line flags to pass to the coverage tool")
 
   # set the site name
-  SITE_NAME(SITE)
+  site_name(SITE)
   # set the build name
-  IF(NOT BUILDNAME)
-    SET(DART_COMPILER "${CMAKE_CXX_COMPILER}")
-    IF(NOT DART_COMPILER)
-      SET(DART_COMPILER "${CMAKE_C_COMPILER}")
-    ENDIF(NOT DART_COMPILER)
-    IF(NOT DART_COMPILER)
-      SET(DART_COMPILER "unknown")
-    ENDIF(NOT DART_COMPILER)
-    IF(WIN32)
-      SET(DART_NAME_COMPONENT "NAME_WE")
-    ELSE(WIN32)
-      SET(DART_NAME_COMPONENT "NAME")
-    ENDIF(WIN32)
-    IF(NOT BUILD_NAME_SYSTEM_NAME)
-      SET(BUILD_NAME_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}")
-    ENDIF(NOT BUILD_NAME_SYSTEM_NAME)
-    IF(WIN32)
-      SET(BUILD_NAME_SYSTEM_NAME "Win32")
-    ENDIF(WIN32)
-    IF(UNIX OR BORLAND)
-      GET_FILENAME_COMPONENT(DART_CXX_NAME
+  if(NOT BUILDNAME)
+    set(DART_COMPILER "${CMAKE_CXX_COMPILER}")
+    if(NOT DART_COMPILER)
+      set(DART_COMPILER "${CMAKE_C_COMPILER}")
+    endif(NOT DART_COMPILER)
+    if(NOT DART_COMPILER)
+      set(DART_COMPILER "unknown")
+    endif(NOT DART_COMPILER)
+    if(WIN32)
+      set(DART_NAME_COMPONENT "NAME_WE")
+    else(WIN32)
+      set(DART_NAME_COMPONENT "NAME")
+    endif(WIN32)
+    if(NOT BUILD_NAME_SYSTEM_NAME)
+      set(BUILD_NAME_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}")
+    endif(NOT BUILD_NAME_SYSTEM_NAME)
+    if(WIN32)
+      set(BUILD_NAME_SYSTEM_NAME "Win32")
+    endif(WIN32)
+    if(UNIX OR BORLAND)
+      get_filename_component(DART_CXX_NAME
         "${CMAKE_CXX_COMPILER}" ${DART_NAME_COMPONENT})
-    ELSE(UNIX OR BORLAND)
-      GET_FILENAME_COMPONENT(DART_CXX_NAME
+    else(UNIX OR BORLAND)
+      get_filename_component(DART_CXX_NAME
         "${CMAKE_BUILD_TOOL}" ${DART_NAME_COMPONENT})
-    ENDIF(UNIX OR BORLAND)
-    IF(DART_CXX_NAME MATCHES "msdev")
-      SET(DART_CXX_NAME "vs60")
-    ENDIF(DART_CXX_NAME MATCHES "msdev")
-    IF(DART_CXX_NAME MATCHES "devenv")
+    endif(UNIX OR BORLAND)
+    if(DART_CXX_NAME MATCHES "msdev")
+      set(DART_CXX_NAME "vs60")
+    endif(DART_CXX_NAME MATCHES "msdev")
+    if(DART_CXX_NAME MATCHES "devenv")
       GET_VS_VERSION_STRING("${CMAKE_GENERATOR}" DART_CXX_NAME)
-    ENDIF(DART_CXX_NAME MATCHES "devenv")
-    SET(BUILDNAME "${BUILD_NAME_SYSTEM_NAME}-${DART_CXX_NAME}")
-  ENDIF(NOT BUILDNAME)
+    endif(DART_CXX_NAME MATCHES "devenv")
+    set(BUILDNAME "${BUILD_NAME_SYSTEM_NAME}-${DART_CXX_NAME}")
+  endif(NOT BUILDNAME)
 
   # the build command
-  BUILD_COMMAND(MAKECOMMAND_DEFAULT_VALUE
+  build_command(MAKECOMMAND_DEFAULT_VALUE
     CONFIGURATION "\${CTEST_CONFIGURATION_TYPE}")
-  SET(MAKECOMMAND ${MAKECOMMAND_DEFAULT_VALUE}
+  set(MAKECOMMAND ${MAKECOMMAND_DEFAULT_VALUE}
     CACHE STRING "Command to build the project")
 
   # the default build configuration the ctest build handler will use
   # if there is no -C arg given to ctest:
-  SET(DEFAULT_CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}")
-  IF(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "")
-    SET(DEFAULT_CTEST_CONFIGURATION_TYPE "Release")
-  ENDIF(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "")
+  set(DEFAULT_CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}")
+  if(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "")
+    set(DEFAULT_CTEST_CONFIGURATION_TYPE "Release")
+  endif(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "")
 
-  IF(NOT "${CMAKE_GENERATOR}" MATCHES "Make")
-    SET(CTEST_USE_LAUNCHERS 0)
-  ENDIF(NOT "${CMAKE_GENERATOR}" MATCHES "Make")
-  IF(CTEST_USE_LAUNCHERS)
-    SET(CTEST_LAUNCH_COMPILE "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OBJECT> --source <SOURCE> --language <LANGUAGE> --")
-    SET(CTEST_LAUNCH_LINK    "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <TARGET> --target-type <TARGET_TYPE> --language <LANGUAGE> --")
-    SET(CTEST_LAUNCH_CUSTOM  "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OUTPUT> --")
-    SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CTEST_LAUNCH_COMPILE}")
-    SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CTEST_LAUNCH_LINK}")
-    SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_CUSTOM "${CTEST_LAUNCH_CUSTOM}")
-  ENDIF(CTEST_USE_LAUNCHERS)
+  if(NOT "${CMAKE_GENERATOR}" MATCHES "Make")
+    set(CTEST_USE_LAUNCHERS 0)
+  endif(NOT "${CMAKE_GENERATOR}" MATCHES "Make")
+  if(CTEST_USE_LAUNCHERS)
+    set(CTEST_LAUNCH_COMPILE "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OBJECT> --source <SOURCE> --language <LANGUAGE> --")
+    set(CTEST_LAUNCH_LINK    "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <TARGET> --target-type <TARGET_TYPE> --language <LANGUAGE> --")
+    set(CTEST_LAUNCH_CUSTOM  "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OUTPUT> --")
+    set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CTEST_LAUNCH_COMPILE}")
+    set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CTEST_LAUNCH_LINK}")
+    set_property(GLOBAL PROPERTY RULE_LAUNCH_CUSTOM "${CTEST_LAUNCH_CUSTOM}")
+  endif(CTEST_USE_LAUNCHERS)
 
-  MARK_AS_ADVANCED(
+  mark_as_advanced(
     BZRCOMMAND
     BZR_UPDATE_OPTIONS
     COVERAGE_COMMAND
@@ -278,9 +278,9 @@ IF(BUILD_TESTING)
     SVNCOMMAND
     SVN_UPDATE_OPTIONS
     )
-  IF(NOT RUN_FROM_DART)
-    SET(RUN_FROM_CTEST_OR_DART 1)
-    INCLUDE(CTestTargets)
-    SET(RUN_FROM_CTEST_OR_DART)
-  ENDIF(NOT RUN_FROM_DART)
-ENDIF(BUILD_TESTING)
+  if(NOT RUN_FROM_DART)
+    set(RUN_FROM_CTEST_OR_DART 1)
+    include(CTestTargets)
+    set(RUN_FROM_CTEST_OR_DART)
+  endif(NOT RUN_FROM_DART)
+endif(BUILD_TESTING)
diff --git a/Modules/CTestTargets.cmake b/Modules/CTestTargets.cmake
index bc4d9646a..15be42dac 100644
--- a/Modules/CTestTargets.cmake
+++ b/Modules/CTestTargets.cmake
@@ -12,29 +12,29 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-IF(NOT RUN_FROM_CTEST_OR_DART)
-  MESSAGE(FATAL_ERROR "Do not incldue CTestTargets.cmake directly")
-ENDIF(NOT RUN_FROM_CTEST_OR_DART)
+if(NOT RUN_FROM_CTEST_OR_DART)
+  message(FATAL_ERROR "Do not incldue CTestTargets.cmake directly")
+endif(NOT RUN_FROM_CTEST_OR_DART)
 
 # make directories in the binary tree
-FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/Testing/Temporary)
-GET_FILENAME_COMPONENT(CMAKE_HOST_PATH ${CMAKE_COMMAND} PATH)
-SET(CMAKE_TARGET_PATH ${EXECUTABLE_OUTPUT_PATH})
-FIND_PROGRAM(CMAKE_CTEST_COMMAND ctest ${CMAKE_HOST_PATH} ${CMAKE_TARGET_PATH})
-MARK_AS_ADVANCED(CMAKE_CTEST_COMMAND)
+file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/Testing/Temporary)
+get_filename_component(CMAKE_HOST_PATH ${CMAKE_COMMAND} PATH)
+set(CMAKE_TARGET_PATH ${EXECUTABLE_OUTPUT_PATH})
+find_program(CMAKE_CTEST_COMMAND ctest ${CMAKE_HOST_PATH} ${CMAKE_TARGET_PATH})
+mark_as_advanced(CMAKE_CTEST_COMMAND)
 
 # Use CTest
 # configure files
 
-IF(CTEST_NEW_FORMAT)
-  CONFIGURE_FILE(
+if(CTEST_NEW_FORMAT)
+  configure_file(
     ${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in
     ${PROJECT_BINARY_DIR}/CTestConfiguration.ini )
-ELSE(CTEST_NEW_FORMAT)
-  CONFIGURE_FILE(
+else(CTEST_NEW_FORMAT)
+  configure_file(
     ${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in
     ${PROJECT_BINARY_DIR}/DartConfiguration.tcl )
-ENDIF(CTEST_NEW_FORMAT)
+endif(CTEST_NEW_FORMAT)
 
 #
 # Section 3:
@@ -43,53 +43,53 @@ ENDIF(CTEST_NEW_FORMAT)
 # These should NOT need to be modified from project to project.
 #
 
-SET(__conf_types "")
-IF(CMAKE_CONFIGURATION_TYPES)
+set(__conf_types "")
+if(CMAKE_CONFIGURATION_TYPES)
   # We need to pass the configuration type on the test command line.
-  SET(__conf_types -C "${CMAKE_CFG_INTDIR}")
-ENDIF(CMAKE_CONFIGURATION_TYPES)
+  set(__conf_types -C "${CMAKE_CFG_INTDIR}")
+endif(CMAKE_CONFIGURATION_TYPES)
 
 # Add convenience targets.  Do this at most once in case of nested
 # projects.
-DEFINE_PROPERTY(GLOBAL PROPERTY CTEST_TARGETS_ADDED
+define_property(GLOBAL PROPERTY CTEST_TARGETS_ADDED
   BRIEF_DOCS "Internal property used by CTestTargets module."
   FULL_DOCS "Set by the CTestTargets module to track addition of testing targets."
   )
-GET_PROPERTY(_CTEST_TARGETS_ADDED GLOBAL PROPERTY CTEST_TARGETS_ADDED)
-IF(NOT _CTEST_TARGETS_ADDED)
-  SET_PROPERTY(GLOBAL PROPERTY CTEST_TARGETS_ADDED 1)
+get_property(_CTEST_TARGETS_ADDED GLOBAL PROPERTY CTEST_TARGETS_ADDED)
+if(NOT _CTEST_TARGETS_ADDED)
+  set_property(GLOBAL PROPERTY CTEST_TARGETS_ADDED 1)
 
   # For all generators add basic testing targets.
-  FOREACH(mode Experimental Nightly Continuous NightlyMemoryCheck)
-    ADD_CUSTOM_TARGET(${mode}
+  foreach(mode Experimental Nightly Continuous NightlyMemoryCheck)
+    add_custom_target(${mode}
       ${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${mode}
       )
-    SET_PROPERTY(TARGET ${mode} PROPERTY RULE_LAUNCH_CUSTOM "")
-    SET_PROPERTY(TARGET ${mode} PROPERTY FOLDER "CTestDashboardTargets")
-  ENDFOREACH(mode)
+    set_property(TARGET ${mode} PROPERTY RULE_LAUNCH_CUSTOM "")
+    set_property(TARGET ${mode} PROPERTY FOLDER "CTestDashboardTargets")
+  endforeach(mode)
 
   # For Makefile generators add more granular targets.
-  IF("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)")
+  if("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)")
     # Make targets for Experimental builds
-    FOREACH(mode Nightly Experimental Continuous)
-      FOREACH(testtype
+    foreach(mode Nightly Experimental Continuous)
+      foreach(testtype
           Start Update Configure Build Test Coverage MemCheck Submit
           # missing purify
           )
-        ADD_CUSTOM_TARGET(${mode}${testtype}
+        add_custom_target(${mode}${testtype}
           ${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${mode}${testtype}
           )
-        SET_PROPERTY(TARGET ${mode}${testtype} PROPERTY RULE_LAUNCH_CUSTOM "")
-        SET_PROPERTY(TARGET ${mode}${testtype} PROPERTY FOLDER "CTestDashboardTargets")
-      ENDFOREACH(testtype)
-    ENDFOREACH(mode)
-  ENDIF("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)")
+        set_property(TARGET ${mode}${testtype} PROPERTY RULE_LAUNCH_CUSTOM "")
+        set_property(TARGET ${mode}${testtype} PROPERTY FOLDER "CTestDashboardTargets")
+      endforeach(testtype)
+    endforeach(mode)
+  endif("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)")
 
   # If requested, add an alias that is the equivalent of the built-in "test"
   # or "RUN_TESTS" target:
-  IF(CTEST_TEST_TARGET_ALIAS)
-    ADD_CUSTOM_TARGET(${CTEST_TEST_TARGET_ALIAS}
+  if(CTEST_TEST_TARGET_ALIAS)
+    add_custom_target(${CTEST_TEST_TARGET_ALIAS}
       ${CMAKE_CTEST_COMMAND} ${__conf_types}
       )
-  ENDIF()
-ENDIF(NOT _CTEST_TARGETS_ADDED)
+  endif()
+endif(NOT _CTEST_TARGETS_ADDED)
diff --git a/Modules/CheckCCompilerFlag.cmake b/Modules/CheckCCompilerFlag.cmake
index 90d04ac66..2f54e392d 100644
--- a/Modules/CheckCCompilerFlag.cmake
+++ b/Modules/CheckCCompilerFlag.cmake
@@ -21,11 +21,11 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE(CheckCSourceCompiles)
+include(CheckCSourceCompiles)
 
-MACRO (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
-   SET(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
-   SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
+macro (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
+   set(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
+   set(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
    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 +41,5 @@ MACRO (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
      FAIL_REGEX "command option .* is not recognized"       # XL
      FAIL_REGEX "WARNING: unknown flag:"                    # Open64
      )
-   SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
-ENDMACRO (CHECK_C_COMPILER_FLAG)
+   set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
+endmacro (CHECK_C_COMPILER_FLAG)
diff --git a/Modules/CheckCSourceCompiles.cmake b/Modules/CheckCSourceCompiles.cmake
index 266933634..3c6e6a9fb 100644
--- a/Modules/CheckCSourceCompiles.cmake
+++ b/Modules/CheckCSourceCompiles.cmake
@@ -24,43 +24,43 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
 
 
-MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR)
-  IF("${VAR}" MATCHES "^${VAR}$")
-    SET(_FAIL_REGEX)
-    SET(_key)
-    FOREACH(arg ${ARGN})
-      IF("${arg}" MATCHES "^(FAIL_REGEX)$")
-        SET(_key "${arg}")
-      ELSEIF(_key)
-        LIST(APPEND _${_key} "${arg}")
-      ELSE()
-        MESSAGE(FATAL_ERROR "Unknown argument:\n  ${arg}\n")
-      ENDIF()
-    ENDFOREACH()
-    SET(MACRO_CHECK_FUNCTION_DEFINITIONS
+macro(CHECK_C_SOURCE_COMPILES SOURCE VAR)
+  if("${VAR}" MATCHES "^${VAR}$")
+    set(_FAIL_REGEX)
+    set(_key)
+    foreach(arg ${ARGN})
+      if("${arg}" MATCHES "^(FAIL_REGEX)$")
+        set(_key "${arg}")
+      elseif(_key)
+        list(APPEND _${_key} "${arg}")
+      else()
+        message(FATAL_ERROR "Unknown argument:\n  ${arg}\n")
+      endif()
+    endforeach()
+    set(MACRO_CHECK_FUNCTION_DEFINITIONS
       "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
-    IF(CMAKE_REQUIRED_LIBRARIES)
+    if(CMAKE_REQUIRED_LIBRARIES)
       # this one translates potentially used imported library targets to their files on disk
       CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
-      SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
+      set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
         "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
-    ELSE(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
-    ENDIF(CMAKE_REQUIRED_LIBRARIES)
-    IF(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
+    else(CMAKE_REQUIRED_LIBRARIES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
+    endif(CMAKE_REQUIRED_LIBRARIES)
+    if(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
         "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
-    ELSE(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
-    ENDIF(CMAKE_REQUIRED_INCLUDES)
-    FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
+    else(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
+    endif(CMAKE_REQUIRED_INCLUDES)
+    file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
       "${SOURCE}\n")
 
-    MESSAGE(STATUS "Performing Test ${VAR}")
-    TRY_COMPILE(${VAR}
+    message(STATUS "Performing Test ${VAR}")
+    try_compile(${VAR}
       ${CMAKE_BINARY_DIR}
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@@ -69,27 +69,27 @@ MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR)
       "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
       OUTPUT_VARIABLE OUTPUT)
 
-    FOREACH(_regex ${_FAIL_REGEX})
-      IF("${OUTPUT}" MATCHES "${_regex}")
-        SET(${VAR} 0)
-      ENDIF()
-    ENDFOREACH()
+    foreach(_regex ${_FAIL_REGEX})
+      if("${OUTPUT}" MATCHES "${_regex}")
+        set(${VAR} 0)
+      endif()
+    endforeach()
 
-    IF(${VAR})
-      SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
-      MESSAGE(STATUS "Performing Test ${VAR} - Success")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    if(${VAR})
+      set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
+      message(STATUS "Performing Test ${VAR} - Success")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
         "${OUTPUT}\n"
         "Source file was:\n${SOURCE}\n")
-    ELSE(${VAR})
-      MESSAGE(STATUS "Performing Test ${VAR} - Failed")
-      SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+    else(${VAR})
+      message(STATUS "Performing Test ${VAR} - Failed")
+      set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
         "${OUTPUT}\n"
         "Source file was:\n${SOURCE}\n")
-    ENDIF(${VAR})
-  ENDIF("${VAR}" MATCHES "^${VAR}$")
-ENDMACRO(CHECK_C_SOURCE_COMPILES)
+    endif(${VAR})
+  endif("${VAR}" MATCHES "^${VAR}$")
+endmacro(CHECK_C_SOURCE_COMPILES)
 
diff --git a/Modules/CheckCSourceRuns.cmake b/Modules/CheckCSourceRuns.cmake
index feee93a71..a8fb554aa 100644
--- a/Modules/CheckCSourceRuns.cmake
+++ b/Modules/CheckCSourceRuns.cmake
@@ -24,32 +24,32 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
 
 
-MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
-  IF("${VAR}" MATCHES "^${VAR}$")
-    SET(MACRO_CHECK_FUNCTION_DEFINITIONS
+macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
+  if("${VAR}" MATCHES "^${VAR}$")
+    set(MACRO_CHECK_FUNCTION_DEFINITIONS
       "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
-    IF(CMAKE_REQUIRED_LIBRARIES)
+    if(CMAKE_REQUIRED_LIBRARIES)
       # this one translates potentially used imported library targets to their files on disk
       CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
-      SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
+      set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
         "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
-    ELSE(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
-    ENDIF(CMAKE_REQUIRED_LIBRARIES)
-    IF(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
+    else(CMAKE_REQUIRED_LIBRARIES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
+    endif(CMAKE_REQUIRED_LIBRARIES)
+    if(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
         "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
-    ELSE(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
-    ENDIF(CMAKE_REQUIRED_INCLUDES)
-    FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
+    else(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
+    endif(CMAKE_REQUIRED_INCLUDES)
+    file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
       "${SOURCE}\n")
 
-    MESSAGE(STATUS "Performing Test ${VAR}")
-    TRY_RUN(${VAR}_EXITCODE ${VAR}_COMPILED
+    message(STATUS "Performing Test ${VAR}")
+    try_run(${VAR}_EXITCODE ${VAR}_COMPILED
       ${CMAKE_BINARY_DIR}
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@@ -59,33 +59,33 @@ MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
       "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
       COMPILE_OUTPUT_VARIABLE OUTPUT)
     # if it did not compile make the return value fail code of 1
-    IF(NOT ${VAR}_COMPILED)
-      SET(${VAR}_EXITCODE 1)
-    ENDIF(NOT ${VAR}_COMPILED)
+    if(NOT ${VAR}_COMPILED)
+      set(${VAR}_EXITCODE 1)
+    endif(NOT ${VAR}_COMPILED)
     # if the return value was 0 then it worked
-    IF("${${VAR}_EXITCODE}" EQUAL 0)
-      SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
-      MESSAGE(STATUS "Performing Test ${VAR} - Success")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    if("${${VAR}_EXITCODE}" EQUAL 0)
+      set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
+      message(STATUS "Performing Test ${VAR} - Success")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
         "${OUTPUT}\n"
         "Return value: ${${VAR}}\n"
         "Source file was:\n${SOURCE}\n")
-    ELSE("${${VAR}_EXITCODE}" EQUAL 0)
-      IF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
-        SET(${VAR} "${${VAR}_EXITCODE}")
-      ELSE(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
-        SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
-      ENDIF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+    else("${${VAR}_EXITCODE}" EQUAL 0)
+      if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+        set(${VAR} "${${VAR}_EXITCODE}")
+      else(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+        set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
+      endif(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
 
-      MESSAGE(STATUS "Performing Test ${VAR} - Failed")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+      message(STATUS "Performing Test ${VAR} - Failed")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
         "${OUTPUT}\n"
         "Return value: ${${VAR}_EXITCODE}\n"
         "Source file was:\n${SOURCE}\n")
 
-    ENDIF("${${VAR}_EXITCODE}" EQUAL 0)
-  ENDIF("${VAR}" MATCHES "^${VAR}$")
-ENDMACRO(CHECK_C_SOURCE_RUNS)
+    endif("${${VAR}_EXITCODE}" EQUAL 0)
+  endif("${VAR}" MATCHES "^${VAR}$")
+endmacro(CHECK_C_SOURCE_RUNS)
 
diff --git a/Modules/CheckCXXCompilerFlag.cmake b/Modules/CheckCXXCompilerFlag.cmake
index 19963ea4c..7e763f7fd 100644
--- a/Modules/CheckCXXCompilerFlag.cmake
+++ b/Modules/CheckCXXCompilerFlag.cmake
@@ -21,11 +21,11 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE(CheckCXXSourceCompiles)
+include(CheckCXXSourceCompiles)
 
-MACRO (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
-   SET(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
-   SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
+macro (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
+   set(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
+   set(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
    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 +43,6 @@ MACRO (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
      FAIL_REGEX "File with unknown suffix passed to linker" # PGI
      FAIL_REGEX "WARNING: unknown flag:"                    # Open64
      )
-   SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
-ENDMACRO (CHECK_CXX_COMPILER_FLAG)
+   set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
+endmacro (CHECK_CXX_COMPILER_FLAG)
 
diff --git a/Modules/CheckCXXSourceCompiles.cmake b/Modules/CheckCXXSourceCompiles.cmake
index 7f7336e5b..d13142362 100644
--- a/Modules/CheckCXXSourceCompiles.cmake
+++ b/Modules/CheckCXXSourceCompiles.cmake
@@ -24,44 +24,44 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
 
 
-MACRO(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
-  IF("${VAR}" MATCHES "^${VAR}$")
-    SET(_FAIL_REGEX)
-    SET(_key)
-    FOREACH(arg ${ARGN})
-      IF("${arg}" MATCHES "^(FAIL_REGEX)$")
-        SET(_key "${arg}")
-      ELSEIF(_key)
-        LIST(APPEND _${_key} "${arg}")
-      ELSE()
-        MESSAGE(FATAL_ERROR "Unknown argument:\n  ${arg}\n")
-      ENDIF()
-    ENDFOREACH()
+macro(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
+  if("${VAR}" MATCHES "^${VAR}$")
+    set(_FAIL_REGEX)
+    set(_key)
+    foreach(arg ${ARGN})
+      if("${arg}" MATCHES "^(FAIL_REGEX)$")
+        set(_key "${arg}")
+      elseif(_key)
+        list(APPEND _${_key} "${arg}")
+      else()
+        message(FATAL_ERROR "Unknown argument:\n  ${arg}\n")
+      endif()
+    endforeach()
 
-    SET(MACRO_CHECK_FUNCTION_DEFINITIONS
+    set(MACRO_CHECK_FUNCTION_DEFINITIONS
       "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
-    IF(CMAKE_REQUIRED_LIBRARIES)
+    if(CMAKE_REQUIRED_LIBRARIES)
       # this one translates potentially used imported library targets to their files on disk
       CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
-      SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
+      set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
         "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
-    ELSE(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
-    ENDIF(CMAKE_REQUIRED_LIBRARIES)
-    IF(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES
+    else(CMAKE_REQUIRED_LIBRARIES)
+      set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
+    endif(CMAKE_REQUIRED_LIBRARIES)
+    if(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES
         "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
-    ELSE(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES)
-    ENDIF(CMAKE_REQUIRED_INCLUDES)
-    FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
+    else(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES)
+    endif(CMAKE_REQUIRED_INCLUDES)
+    file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
       "${SOURCE}\n")
 
-    MESSAGE(STATUS "Performing Test ${VAR}")
-    TRY_COMPILE(${VAR}
+    message(STATUS "Performing Test ${VAR}")
+    try_compile(${VAR}
       ${CMAKE_BINARY_DIR}
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@@ -70,27 +70,27 @@ MACRO(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
       "${CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES}"
       OUTPUT_VARIABLE OUTPUT)
 
-    FOREACH(_regex ${_FAIL_REGEX})
-      IF("${OUTPUT}" MATCHES "${_regex}")
-        SET(${VAR} 0)
-      ENDIF()
-    ENDFOREACH()
+    foreach(_regex ${_FAIL_REGEX})
+      if("${OUTPUT}" MATCHES "${_regex}")
+        set(${VAR} 0)
+      endif()
+    endforeach()
 
-    IF(${VAR})
-      SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
-      MESSAGE(STATUS "Performing Test ${VAR} - Success")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    if(${VAR})
+      set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
+      message(STATUS "Performing Test ${VAR} - Success")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n"
         "${OUTPUT}\n"
         "Source file was:\n${SOURCE}\n")
-    ELSE(${VAR})
-      MESSAGE(STATUS "Performing Test ${VAR} - Failed")
-      SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+    else(${VAR})
+      message(STATUS "Performing Test ${VAR} - Failed")
+      set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
         "${OUTPUT}\n"
         "Source file was:\n${SOURCE}\n")
-    ENDIF(${VAR})
-  ENDIF("${VAR}" MATCHES "^${VAR}$")
-ENDMACRO(CHECK_CXX_SOURCE_COMPILES)
+    endif(${VAR})
+  endif("${VAR}" MATCHES "^${VAR}$")
+endmacro(CHECK_CXX_SOURCE_COMPILES)
 
diff --git a/Modules/CheckCXXSourceRuns.cmake b/Modules/CheckCXXSourceRuns.cmake
index cd68d5706..515951741 100644
--- a/Modules/CheckCXXSourceRuns.cmake
+++ b/Modules/CheckCXXSourceRuns.cmake
@@ -24,32 +24,32 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
 
 
-MACRO(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
-  IF("${VAR}" MATCHES "^${VAR}$")
-    SET(MACRO_CHECK_FUNCTION_DEFINITIONS
+macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
+  if("${VAR}" MATCHES "^${VAR}$")
+    set(MACRO_CHECK_FUNCTION_DEFINITIONS
       "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
-    IF(CMAKE_REQUIRED_LIBRARIES)
+    if(CMAKE_REQUIRED_LIBRARIES)
       # this one translates potentially used imported library targets to their files on disk
       CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
-      SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
+      set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
         "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
-    ELSE(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
-    ENDIF(CMAKE_REQUIRED_LIBRARIES)
-    IF(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES
+    else(CMAKE_REQUIRED_LIBRARIES)
+      set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
+    endif(CMAKE_REQUIRED_LIBRARIES)
+    if(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES
         "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
-    ELSE(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES)
-    ENDIF(CMAKE_REQUIRED_INCLUDES)
-    FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
+    else(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES)
+    endif(CMAKE_REQUIRED_INCLUDES)
+    file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
       "${SOURCE}\n")
 
-    MESSAGE(STATUS "Performing Test ${VAR}")
-    TRY_RUN(${VAR}_EXITCODE ${VAR}_COMPILED
+    message(STATUS "Performing Test ${VAR}")
+    try_run(${VAR}_EXITCODE ${VAR}_COMPILED
       ${CMAKE_BINARY_DIR}
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@@ -60,32 +60,32 @@ MACRO(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
       COMPILE_OUTPUT_VARIABLE OUTPUT)
 
     # if it did not compile make the return value fail code of 1
-    IF(NOT ${VAR}_COMPILED)
-      SET(${VAR}_EXITCODE 1)
-    ENDIF(NOT ${VAR}_COMPILED)
+    if(NOT ${VAR}_COMPILED)
+      set(${VAR}_EXITCODE 1)
+    endif(NOT ${VAR}_COMPILED)
     # if the return value was 0 then it worked
-    IF("${${VAR}_EXITCODE}" EQUAL 0)
-      SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
-      MESSAGE(STATUS "Performing Test ${VAR} - Success")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    if("${${VAR}_EXITCODE}" EQUAL 0)
+      set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
+      message(STATUS "Performing Test ${VAR} - Success")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n"
         "${OUTPUT}\n"
         "Return value: ${${VAR}}\n"
         "Source file was:\n${SOURCE}\n")
-    ELSE("${${VAR}_EXITCODE}" EQUAL 0)
-      IF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
-        SET(${VAR} "${${VAR}_EXITCODE}")
-      ELSE(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
-        SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
-      ENDIF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+    else("${${VAR}_EXITCODE}" EQUAL 0)
+      if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+        set(${VAR} "${${VAR}_EXITCODE}")
+      else(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+        set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
+      endif(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
 
-      MESSAGE(STATUS "Performing Test ${VAR} - Failed")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+      message(STATUS "Performing Test ${VAR} - Failed")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
         "${OUTPUT}\n"
         "Return value: ${${VAR}_EXITCODE}\n"
         "Source file was:\n${SOURCE}\n")
-    ENDIF("${${VAR}_EXITCODE}" EQUAL 0)
-  ENDIF("${VAR}" MATCHES "^${VAR}$")
-ENDMACRO(CHECK_CXX_SOURCE_RUNS)
+    endif("${${VAR}_EXITCODE}" EQUAL 0)
+  endif("${VAR}" MATCHES "^${VAR}$")
+endmacro(CHECK_CXX_SOURCE_RUNS)
 
diff --git a/Modules/CheckCXXSymbolExists.cmake b/Modules/CheckCXXSymbolExists.cmake
index 1b012aefd..ebb3a92d8 100644
--- a/Modules/CheckCXXSymbolExists.cmake
+++ b/Modules/CheckCXXSymbolExists.cmake
@@ -35,8 +35,8 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE(CheckSymbolExists)
+include(CheckSymbolExists)
 
-MACRO(CHECK_CXX_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
+macro(CHECK_CXX_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
   _CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.cxx" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
-ENDMACRO(CHECK_CXX_SYMBOL_EXISTS)
+endmacro(CHECK_CXX_SYMBOL_EXISTS)
diff --git a/Modules/CheckFortranFunctionExists.cmake b/Modules/CheckFortranFunctionExists.cmake
index abec9f738..0ccf64a5e 100644
--- a/Modules/CheckFortranFunctionExists.cmake
+++ b/Modules/CheckFortranFunctionExists.cmake
@@ -22,7 +22,7 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
 
 
 macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE)
@@ -36,7 +36,7 @@ macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE)
     else(CMAKE_REQUIRED_LIBRARIES)
       set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
     endif(CMAKE_REQUIRED_LIBRARIES)
-    FILE(WRITE
+    file(WRITE
     ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f
     "
       program TESTFortran
diff --git a/Modules/CheckFunctionExists.cmake b/Modules/CheckFunctionExists.cmake
index 8c469f012..b9c0f26f8 100644
--- a/Modules/CheckFunctionExists.cmake
+++ b/Modules/CheckFunctionExists.cmake
@@ -27,29 +27,29 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
 
 
-MACRO(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
-  IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
-    SET(MACRO_CHECK_FUNCTION_DEFINITIONS
+macro(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
+  if("${VARIABLE}" MATCHES "^${VARIABLE}$")
+    set(MACRO_CHECK_FUNCTION_DEFINITIONS
       "-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}")
-    MESSAGE(STATUS "Looking for ${FUNCTION}")
-    IF(CMAKE_REQUIRED_LIBRARIES)
+    message(STATUS "Looking for ${FUNCTION}")
+    if(CMAKE_REQUIRED_LIBRARIES)
       # this one translates potentially used imported library targets to their files on disk
       CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
-      SET(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
+      set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
         "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
-    ELSE(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
-    ENDIF(CMAKE_REQUIRED_LIBRARIES)
-    IF(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_FUNCTION_EXISTS_ADD_INCLUDES
+    else(CMAKE_REQUIRED_LIBRARIES)
+      set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
+    endif(CMAKE_REQUIRED_LIBRARIES)
+    if(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_FUNCTION_EXISTS_ADD_INCLUDES
         "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
-    ELSE(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_FUNCTION_EXISTS_ADD_INCLUDES)
-    ENDIF(CMAKE_REQUIRED_INCLUDES)
-    TRY_COMPILE(${VARIABLE}
+    else(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_FUNCTION_EXISTS_ADD_INCLUDES)
+    endif(CMAKE_REQUIRED_INCLUDES)
+    try_compile(${VARIABLE}
       ${CMAKE_BINARY_DIR}
       ${CMAKE_ROOT}/Modules/CheckFunctionExists.c
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@@ -57,18 +57,18 @@ MACRO(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
       "${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}"
       "${CHECK_FUNCTION_EXISTS_ADD_INCLUDES}"
       OUTPUT_VARIABLE OUTPUT)
-    IF(${VARIABLE})
-      SET(${VARIABLE} 1 CACHE INTERNAL "Have function ${FUNCTION}")
-      MESSAGE(STATUS "Looking for ${FUNCTION} - found")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    if(${VARIABLE})
+      set(${VARIABLE} 1 CACHE INTERNAL "Have function ${FUNCTION}")
+      message(STATUS "Looking for ${FUNCTION} - found")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if the function ${FUNCTION} exists passed with the following output:\n"
         "${OUTPUT}\n\n")
-    ELSE(${VARIABLE})
-      MESSAGE(STATUS "Looking for ${FUNCTION} - not found")
-      SET(${VARIABLE} "" CACHE INTERNAL "Have function ${FUNCTION}")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+    else(${VARIABLE})
+      message(STATUS "Looking for ${FUNCTION} - not found")
+      set(${VARIABLE} "" CACHE INTERNAL "Have function ${FUNCTION}")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if the function ${FUNCTION} exists failed with the following output:\n"
         "${OUTPUT}\n\n")
-    ENDIF(${VARIABLE})
-  ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$")
-ENDMACRO(CHECK_FUNCTION_EXISTS)
+    endif(${VARIABLE})
+  endif("${VARIABLE}" MATCHES "^${VARIABLE}$")
+endmacro(CHECK_FUNCTION_EXISTS)
diff --git a/Modules/CheckIncludeFile.cmake b/Modules/CheckIncludeFile.cmake
index 07a5ef82d..07d4966b9 100644
--- a/Modules/CheckIncludeFile.cmake
+++ b/Modules/CheckIncludeFile.cmake
@@ -28,24 +28,24 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-MACRO(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
-  IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
-    IF(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_INCLUDE_FILE_C_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}")
-    ELSE(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_INCLUDE_FILE_C_INCLUDE_DIRS)
-    ENDIF(CMAKE_REQUIRED_INCLUDES)
-    SET(MACRO_CHECK_INCLUDE_FILE_FLAGS ${CMAKE_REQUIRED_FLAGS})
-    SET(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
-    CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in
+macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
+  if("${VARIABLE}" MATCHES "^${VARIABLE}$")
+    if(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_INCLUDE_FILE_C_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}")
+    else(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_INCLUDE_FILE_C_INCLUDE_DIRS)
+    endif(CMAKE_REQUIRED_INCLUDES)
+    set(MACRO_CHECK_INCLUDE_FILE_FLAGS ${CMAKE_REQUIRED_FLAGS})
+    set(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
+    configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.c IMMEDIATE)
-    MESSAGE(STATUS "Looking for ${INCLUDE}")
-    IF(${ARGC} EQUAL 3)
-      SET(CMAKE_C_FLAGS_SAVE ${CMAKE_C_FLAGS})
-      SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARGV2}")
-    ENDIF(${ARGC} EQUAL 3)
+    message(STATUS "Looking for ${INCLUDE}")
+    if(${ARGC} EQUAL 3)
+      set(CMAKE_C_FLAGS_SAVE ${CMAKE_C_FLAGS})
+      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARGV2}")
+    endif(${ARGC} EQUAL 3)
 
-    TRY_COMPILE(${VARIABLE}
+    try_compile(${VARIABLE}
       ${CMAKE_BINARY_DIR}
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.c
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@@ -54,24 +54,24 @@ MACRO(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
       "${CHECK_INCLUDE_FILE_C_INCLUDE_DIRS}"
       OUTPUT_VARIABLE OUTPUT)
 
-    IF(${ARGC} EQUAL 3)
-      SET(CMAKE_C_FLAGS ${CMAKE_C_FLAGS_SAVE})
-    ENDIF(${ARGC} EQUAL 3)
+    if(${ARGC} EQUAL 3)
+      set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS_SAVE})
+    endif(${ARGC} EQUAL 3)
 
-    IF(${VARIABLE})
-      MESSAGE(STATUS "Looking for ${INCLUDE} - found")
-      SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    if(${VARIABLE})
+      message(STATUS "Looking for ${INCLUDE} - found")
+      set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if the include file ${INCLUDE} "
         "exists passed with the following output:\n"
         "${OUTPUT}\n\n")
-    ELSE(${VARIABLE})
-      MESSAGE(STATUS "Looking for ${INCLUDE} - not found")
-      SET(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+    else(${VARIABLE})
+      message(STATUS "Looking for ${INCLUDE} - not found")
+      set(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if the include file ${INCLUDE} "
         "exists failed with the following output:\n"
         "${OUTPUT}\n\n")
-    ENDIF(${VARIABLE})
-  ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$")
-ENDMACRO(CHECK_INCLUDE_FILE)
+    endif(${VARIABLE})
+  endif("${VARIABLE}" MATCHES "^${VARIABLE}$")
+endmacro(CHECK_INCLUDE_FILE)
diff --git a/Modules/CheckIncludeFileCXX.cmake b/Modules/CheckIncludeFileCXX.cmake
index f27d25340..adc39f3cd 100644
--- a/Modules/CheckIncludeFileCXX.cmake
+++ b/Modules/CheckIncludeFileCXX.cmake
@@ -28,24 +28,24 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-MACRO(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
-  IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
-    IF(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}")
-    ELSE(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS)
-    ENDIF(CMAKE_REQUIRED_INCLUDES)
-    SET(MACRO_CHECK_INCLUDE_FILE_FLAGS ${CMAKE_REQUIRED_FLAGS})
-    SET(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
-    CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
+macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
+  if("${VARIABLE}" MATCHES "^${VARIABLE}$")
+    if(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}")
+    else(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS)
+    endif(CMAKE_REQUIRED_INCLUDES)
+    set(MACRO_CHECK_INCLUDE_FILE_FLAGS ${CMAKE_REQUIRED_FLAGS})
+    set(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
+    configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx IMMEDIATE)
-    MESSAGE(STATUS "Looking for C++ include ${INCLUDE}")
-    IF(${ARGC} EQUAL 3)
-      SET(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS})
-      SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARGV2}")
-    ENDIF(${ARGC} EQUAL 3)
+    message(STATUS "Looking for C++ include ${INCLUDE}")
+    if(${ARGC} EQUAL 3)
+      set(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS})
+      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARGV2}")
+    endif(${ARGC} EQUAL 3)
 
-    TRY_COMPILE(${VARIABLE}
+    try_compile(${VARIABLE}
       ${CMAKE_BINARY_DIR}
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@@ -54,24 +54,24 @@ MACRO(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
       "${CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS}"
       OUTPUT_VARIABLE OUTPUT)
 
-    IF(${ARGC} EQUAL 3)
-      SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_SAVE})
-    ENDIF(${ARGC} EQUAL 3)
+    if(${ARGC} EQUAL 3)
+      set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_SAVE})
+    endif(${ARGC} EQUAL 3)
 
-    IF(${VARIABLE})
-      MESSAGE(STATUS "Looking for C++ include ${INCLUDE} - found")
-      SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    if(${VARIABLE})
+      message(STATUS "Looking for C++ include ${INCLUDE} - found")
+      set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if the include file ${INCLUDE} "
         "exists passed with the following output:\n"
         "${OUTPUT}\n\n")
-    ELSE(${VARIABLE})
-      MESSAGE(STATUS "Looking for C++ include ${INCLUDE} - not found")
-      SET(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+    else(${VARIABLE})
+      message(STATUS "Looking for C++ include ${INCLUDE} - not found")
+      set(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if the include file ${INCLUDE} "
         "exists failed with the following output:\n"
         "${OUTPUT}\n\n")
-    ENDIF(${VARIABLE})
-  ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$")
-ENDMACRO(CHECK_INCLUDE_FILE_CXX)
+    endif(${VARIABLE})
+  endif("${VARIABLE}" MATCHES "^${VARIABLE}$")
+endmacro(CHECK_INCLUDE_FILE_CXX)
diff --git a/Modules/CheckIncludeFiles.cmake b/Modules/CheckIncludeFiles.cmake
index 6901fbc5d..02e3aac2e 100644
--- a/Modules/CheckIncludeFiles.cmake
+++ b/Modules/CheckIncludeFiles.cmake
@@ -25,37 +25,37 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-MACRO(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
-  IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
-    SET(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n")
-    IF(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_INCLUDE_FILES_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}")
-    ELSE(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_INCLUDE_FILES_INCLUDE_DIRS)
-    ENDIF(CMAKE_REQUIRED_INCLUDES)
-    SET(CHECK_INCLUDE_FILES_CONTENT "/* */\n")
-    SET(MACRO_CHECK_INCLUDE_FILES_FLAGS ${CMAKE_REQUIRED_FLAGS})
-    FOREACH(FILE ${INCLUDE})
-      SET(CMAKE_CONFIGURABLE_FILE_CONTENT
+macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
+  if("${VARIABLE}" MATCHES "^${VARIABLE}$")
+    set(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n")
+    if(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_INCLUDE_FILES_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}")
+    else(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_INCLUDE_FILES_INCLUDE_DIRS)
+    endif(CMAKE_REQUIRED_INCLUDES)
+    set(CHECK_INCLUDE_FILES_CONTENT "/* */\n")
+    set(MACRO_CHECK_INCLUDE_FILES_FLAGS ${CMAKE_REQUIRED_FLAGS})
+    foreach(FILE ${INCLUDE})
+      set(CMAKE_CONFIGURABLE_FILE_CONTENT
         "${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n")
-    ENDFOREACH(FILE)
-    SET(CMAKE_CONFIGURABLE_FILE_CONTENT
+    endforeach(FILE)
+    set(CMAKE_CONFIGURABLE_FILE_CONTENT
       "${CMAKE_CONFIGURABLE_FILE_CONTENT}\n\nint main(){return 0;}\n")
-    CONFIGURE_FILE("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
+    configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
       "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.c" @ONLY IMMEDIATE)
 
-    SET(_INCLUDE ${INCLUDE}) # remove empty elements
-    IF("${_INCLUDE}" MATCHES "^([^;]+);.+;([^;]+)$")
-      LIST(LENGTH _INCLUDE _INCLUDE_LEN)
-      SET(_description "${_INCLUDE_LEN} include files ${CMAKE_MATCH_1}, ..., ${CMAKE_MATCH_2}")
-    ELSEIF("${_INCLUDE}" MATCHES "^([^;]+);([^;]+)$")
-      SET(_description "include files ${CMAKE_MATCH_1}, ${CMAKE_MATCH_2}")
-    ELSE()
-      SET(_description "include file ${_INCLUDE}")
-    ENDIF()
+    set(_INCLUDE ${INCLUDE}) # remove empty elements
+    if("${_INCLUDE}" MATCHES "^([^;]+);.+;([^;]+)$")
+      list(LENGTH _INCLUDE _INCLUDE_LEN)
+      set(_description "${_INCLUDE_LEN} include files ${CMAKE_MATCH_1}, ..., ${CMAKE_MATCH_2}")
+    elseif("${_INCLUDE}" MATCHES "^([^;]+);([^;]+)$")
+      set(_description "include files ${CMAKE_MATCH_1}, ${CMAKE_MATCH_2}")
+    else()
+      set(_description "include file ${_INCLUDE}")
+    endif()
 
-    MESSAGE(STATUS "Looking for ${_description}")
-    TRY_COMPILE(${VARIABLE}
+    message(STATUS "Looking for ${_description}")
+    try_compile(${VARIABLE}
       ${CMAKE_BINARY_DIR}
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.c
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@@ -63,20 +63,20 @@ MACRO(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
       -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILES_FLAGS}
       "${CHECK_INCLUDE_FILES_INCLUDE_DIRS}"
       OUTPUT_VARIABLE OUTPUT)
-    IF(${VARIABLE})
-      MESSAGE(STATUS "Looking for ${_description} - found")
-      SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    if(${VARIABLE})
+      message(STATUS "Looking for ${_description} - found")
+      set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if files ${INCLUDE} "
         "exist passed with the following output:\n"
         "${OUTPUT}\n\n")
-    ELSE(${VARIABLE})
-      MESSAGE(STATUS "Looking for ${_description} - not found.")
-      SET(${VARIABLE} "" CACHE INTERNAL "Have includes ${INCLUDE}")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+    else(${VARIABLE})
+      message(STATUS "Looking for ${_description} - not found.")
+      set(${VARIABLE} "" CACHE INTERNAL "Have includes ${INCLUDE}")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if files ${INCLUDE} "
         "exist failed with the following output:\n"
         "${OUTPUT}\nSource:\n${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
-    ENDIF(${VARIABLE})
-  ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$")
-ENDMACRO(CHECK_INCLUDE_FILES)
+    endif(${VARIABLE})
+  endif("${VARIABLE}" MATCHES "^${VARIABLE}$")
+endmacro(CHECK_INCLUDE_FILES)
diff --git a/Modules/CheckLibraryExists.cmake b/Modules/CheckLibraryExists.cmake
index 59fca0a32..447e97d75 100644
--- a/Modules/CheckLibraryExists.cmake
+++ b/Modules/CheckLibraryExists.cmake
@@ -26,22 +26,22 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
 
 
-MACRO(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
-  IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
-    SET(MACRO_CHECK_LIBRARY_EXISTS_DEFINITION
+macro(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
+  if("${VARIABLE}" MATCHES "^${VARIABLE}$")
+    set(MACRO_CHECK_LIBRARY_EXISTS_DEFINITION
       "-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}")
-    MESSAGE(STATUS "Looking for ${FUNCTION} in ${LIBRARY}")
-    SET(CHECK_LIBRARY_EXISTS_LIBRARIES ${LIBRARY})
-    IF(CMAKE_REQUIRED_LIBRARIES)
+    message(STATUS "Looking for ${FUNCTION} in ${LIBRARY}")
+    set(CHECK_LIBRARY_EXISTS_LIBRARIES ${LIBRARY})
+    if(CMAKE_REQUIRED_LIBRARIES)
       # this one translates potentially used imported library targets to their files on disk
       CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
-      SET(CHECK_LIBRARY_EXISTS_LIBRARIES
+      set(CHECK_LIBRARY_EXISTS_LIBRARIES
         ${CHECK_LIBRARY_EXISTS_LIBRARIES} ${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES})
-    ENDIF(CMAKE_REQUIRED_LIBRARIES)
-    TRY_COMPILE(${VARIABLE}
+    endif(CMAKE_REQUIRED_LIBRARIES)
+    try_compile(${VARIABLE}
       ${CMAKE_BINARY_DIR}
       ${CMAKE_ROOT}/Modules/CheckFunctionExists.c
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@@ -51,20 +51,20 @@ MACRO(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
       "-DLINK_LIBRARIES:STRING=${CHECK_LIBRARY_EXISTS_LIBRARIES}"
       OUTPUT_VARIABLE OUTPUT)
 
-    IF(${VARIABLE})
-      MESSAGE(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - found")
-      SET(${VARIABLE} 1 CACHE INTERNAL "Have library ${LIBRARY}")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    if(${VARIABLE})
+      message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - found")
+      set(${VARIABLE} 1 CACHE INTERNAL "Have library ${LIBRARY}")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if the function ${FUNCTION} exists in the ${LIBRARY} "
         "passed with the following output:\n"
         "${OUTPUT}\n\n")
-    ELSE(${VARIABLE})
-      MESSAGE(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - not found")
-      SET(${VARIABLE} "" CACHE INTERNAL "Have library ${LIBRARY}")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+    else(${VARIABLE})
+      message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - not found")
+      set(${VARIABLE} "" CACHE INTERNAL "Have library ${LIBRARY}")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if the function ${FUNCTION} exists in the ${LIBRARY} "
         "failed with the following output:\n"
         "${OUTPUT}\n\n")
-    ENDIF(${VARIABLE})
-  ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$")
-ENDMACRO(CHECK_LIBRARY_EXISTS)
+    endif(${VARIABLE})
+  endif("${VARIABLE}" MATCHES "^${VARIABLE}$")
+endmacro(CHECK_LIBRARY_EXISTS)
diff --git a/Modules/CheckSizeOf.cmake b/Modules/CheckSizeOf.cmake
index f6d6636e5..9f587b5c2 100644
--- a/Modules/CheckSizeOf.cmake
+++ b/Modules/CheckSizeOf.cmake
@@ -12,7 +12,7 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-MESSAGE(SEND_ERROR
+message(SEND_ERROR
         "Modules/CheckSizeOf.cmake has been removed.  "
         "Use Modules/CheckTypeSize.cmake instead.  This "
         "compatability check may be removed before the next release!")
diff --git a/Modules/CheckStructHasMember.cmake b/Modules/CheckStructHasMember.cmake
index 18e80e3c0..fb9703ea2 100644
--- a/Modules/CheckStructHasMember.cmake
+++ b/Modules/CheckStructHasMember.cmake
@@ -28,15 +28,15 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE(CheckCSourceCompiles)
+include(CheckCSourceCompiles)
 
-MACRO (CHECK_STRUCT_HAS_MEMBER _STRUCT _MEMBER _HEADER _RESULT)
-   SET(_INCLUDE_FILES)
-   FOREACH (it ${_HEADER})
-      SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n")
-   ENDFOREACH (it)
+macro (CHECK_STRUCT_HAS_MEMBER _STRUCT _MEMBER _HEADER _RESULT)
+   set(_INCLUDE_FILES)
+   foreach (it ${_HEADER})
+      set(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n")
+   endforeach (it)
 
-   SET(_CHECK_STRUCT_MEMBER_SOURCE_CODE "
+   set(_CHECK_STRUCT_MEMBER_SOURCE_CODE "
 ${_INCLUDE_FILES}
 int main()
 {
@@ -47,5 +47,5 @@ int main()
 ")
    CHECK_C_SOURCE_COMPILES("${_CHECK_STRUCT_MEMBER_SOURCE_CODE}" ${_RESULT})
 
-ENDMACRO (CHECK_STRUCT_HAS_MEMBER)
+endmacro (CHECK_STRUCT_HAS_MEMBER)
 
diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake
index e6e677d4f..c843c31e2 100644
--- a/Modules/CheckSymbolExists.cmake
+++ b/Modules/CheckSymbolExists.cmake
@@ -35,43 +35,43 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
 
 
-MACRO(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
+macro(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
   _CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.c" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
-ENDMACRO(CHECK_SYMBOL_EXISTS)
+endmacro(CHECK_SYMBOL_EXISTS)
 
-MACRO(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
-  IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
-    SET(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n")
-    SET(MACRO_CHECK_SYMBOL_EXISTS_FLAGS ${CMAKE_REQUIRED_FLAGS})
-    IF(CMAKE_REQUIRED_LIBRARIES)
+macro(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
+  if("${VARIABLE}" MATCHES "^${VARIABLE}$")
+    set(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n")
+    set(MACRO_CHECK_SYMBOL_EXISTS_FLAGS ${CMAKE_REQUIRED_FLAGS})
+    if(CMAKE_REQUIRED_LIBRARIES)
       # this one translates potentially used imported library targets to their files on disk
       CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
-      SET(CHECK_SYMBOL_EXISTS_LIBS
+      set(CHECK_SYMBOL_EXISTS_LIBS
         "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
-    ELSE(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_SYMBOL_EXISTS_LIBS)
-    ENDIF(CMAKE_REQUIRED_LIBRARIES)
-    IF(CMAKE_REQUIRED_INCLUDES)
-      SET(CMAKE_SYMBOL_EXISTS_INCLUDES
+    else(CMAKE_REQUIRED_LIBRARIES)
+      set(CHECK_SYMBOL_EXISTS_LIBS)
+    endif(CMAKE_REQUIRED_LIBRARIES)
+    if(CMAKE_REQUIRED_INCLUDES)
+      set(CMAKE_SYMBOL_EXISTS_INCLUDES
         "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
-    ELSE(CMAKE_REQUIRED_INCLUDES)
-      SET(CMAKE_SYMBOL_EXISTS_INCLUDES)
-    ENDIF(CMAKE_REQUIRED_INCLUDES)
-    FOREACH(FILE ${FILES})
-      SET(CMAKE_CONFIGURABLE_FILE_CONTENT
+    else(CMAKE_REQUIRED_INCLUDES)
+      set(CMAKE_SYMBOL_EXISTS_INCLUDES)
+    endif(CMAKE_REQUIRED_INCLUDES)
+    foreach(FILE ${FILES})
+      set(CMAKE_CONFIGURABLE_FILE_CONTENT
         "${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n")
-    ENDFOREACH(FILE)
-    SET(CMAKE_CONFIGURABLE_FILE_CONTENT
+    endforeach(FILE)
+    set(CMAKE_CONFIGURABLE_FILE_CONTENT
       "${CMAKE_CONFIGURABLE_FILE_CONTENT}\nint main(int argc, char** argv)\n{\n  (void)argv;\n#ifndef ${SYMBOL}\n  return ((int*)(&${SYMBOL}))[argc];\n#else\n  (void)argc;\n  return 0;\n#endif\n}\n")
 
-    CONFIGURE_FILE("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
+    configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
       "${SOURCEFILE}" @ONLY IMMEDIATE)
 
-    MESSAGE(STATUS "Looking for ${SYMBOL}")
-    TRY_COMPILE(${VARIABLE}
+    message(STATUS "Looking for ${SYMBOL}")
+    try_compile(${VARIABLE}
       ${CMAKE_BINARY_DIR}
       "${SOURCEFILE}"
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@@ -80,22 +80,22 @@ MACRO(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
       "${CHECK_SYMBOL_EXISTS_LIBS}"
       "${CMAKE_SYMBOL_EXISTS_INCLUDES}"
       OUTPUT_VARIABLE OUTPUT)
-    IF(${VARIABLE})
-      MESSAGE(STATUS "Looking for ${SYMBOL} - found")
-      SET(${VARIABLE} 1 CACHE INTERNAL "Have symbol ${SYMBOL}")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    if(${VARIABLE})
+      message(STATUS "Looking for ${SYMBOL} - found")
+      set(${VARIABLE} 1 CACHE INTERNAL "Have symbol ${SYMBOL}")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if the ${SYMBOL} "
         "exist passed with the following output:\n"
         "${OUTPUT}\nFile ${SOURCEFILE}:\n"
         "${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
-    ELSE(${VARIABLE})
-      MESSAGE(STATUS "Looking for ${SYMBOL} - not found.")
-      SET(${VARIABLE} "" CACHE INTERNAL "Have symbol ${SYMBOL}")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+    else(${VARIABLE})
+      message(STATUS "Looking for ${SYMBOL} - not found.")
+      set(${VARIABLE} "" CACHE INTERNAL "Have symbol ${SYMBOL}")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if the ${SYMBOL} "
         "exist failed with the following output:\n"
         "${OUTPUT}\nFile ${SOURCEFILE}:\n"
         "${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
-    ENDIF(${VARIABLE})
-  ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$")
-ENDMACRO(_CHECK_SYMBOL_EXISTS)
+    endif(${VARIABLE})
+  endif("${VARIABLE}" MATCHES "^${VARIABLE}$")
+endmacro(_CHECK_SYMBOL_EXISTS)
diff --git a/Modules/CheckVariableExists.cmake b/Modules/CheckVariableExists.cmake
index 7d6c7945d..48e848b31 100644
--- a/Modules/CheckVariableExists.cmake
+++ b/Modules/CheckVariableExists.cmake
@@ -26,41 +26,41 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
 
 
-MACRO(CHECK_VARIABLE_EXISTS VAR VARIABLE)
-  IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
-    SET(MACRO_CHECK_VARIABLE_DEFINITIONS
+macro(CHECK_VARIABLE_EXISTS VAR VARIABLE)
+  if("${VARIABLE}" MATCHES "^${VARIABLE}$")
+    set(MACRO_CHECK_VARIABLE_DEFINITIONS
       "-DCHECK_VARIABLE_EXISTS=${VAR} ${CMAKE_REQUIRED_FLAGS}")
-    MESSAGE(STATUS "Looking for ${VAR}")
-    IF(CMAKE_REQUIRED_LIBRARIES)
+    message(STATUS "Looking for ${VAR}")
+    if(CMAKE_REQUIRED_LIBRARIES)
       # this one translates potentially used imported library targets to their files on disk
       CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
-      SET(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES
+      set(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES
         "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
-    ELSE(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES)
-    ENDIF(CMAKE_REQUIRED_LIBRARIES)
-    TRY_COMPILE(${VARIABLE}
+    else(CMAKE_REQUIRED_LIBRARIES)
+      set(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES)
+    endif(CMAKE_REQUIRED_LIBRARIES)
+    try_compile(${VARIABLE}
       ${CMAKE_BINARY_DIR}
       ${CMAKE_ROOT}/Modules/CheckVariableExists.c
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
       CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_VARIABLE_DEFINITIONS}
       "${CHECK_VARIABLE_EXISTS_ADD_LIBRARIES}"
       OUTPUT_VARIABLE OUTPUT)
-    IF(${VARIABLE})
-      SET(${VARIABLE} 1 CACHE INTERNAL "Have variable ${VAR}")
-      MESSAGE(STATUS "Looking for ${VAR} - found")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    if(${VARIABLE})
+      set(${VARIABLE} 1 CACHE INTERNAL "Have variable ${VAR}")
+      message(STATUS "Looking for ${VAR} - found")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if the variable ${VAR} exists passed with the following output:\n"
         "${OUTPUT}\n\n")
-    ELSE(${VARIABLE})
-      SET(${VARIABLE} "" CACHE INTERNAL "Have variable ${VAR}")
-      MESSAGE(STATUS "Looking for ${VAR} - not found")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+    else(${VARIABLE})
+      set(${VARIABLE} "" CACHE INTERNAL "Have variable ${VAR}")
+      message(STATUS "Looking for ${VAR} - not found")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if the variable ${VAR} exists failed with the following output:\n"
         "${OUTPUT}\n\n")
-    ENDIF(${VARIABLE})
-  ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$")
-ENDMACRO(CHECK_VARIABLE_EXISTS)
+    endif(${VARIABLE})
+  endif("${VARIABLE}" MATCHES "^${VARIABLE}$")
+endmacro(CHECK_VARIABLE_EXISTS)
diff --git a/Modules/Compiler/Absoft-Fortran.cmake b/Modules/Compiler/Absoft-Fortran.cmake
index 1bb7b1f82..2e1666fbf 100644
--- a/Modules/Compiler/Absoft-Fortran.cmake
+++ b/Modules/Compiler/Absoft-Fortran.cmake
@@ -1,10 +1,10 @@
-SET(CMAKE_Fortran_FLAGS_INIT "")
-SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "-g")
-SET(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "")
-SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3")
-SET(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
-SET(CMAKE_Fortran_MODDIR_FLAG "-YMOD_OUT_DIR=")
-SET(CMAKE_Fortran_MODPATH_FLAG "-p")
-SET(CMAKE_Fortran_VERBOSE_FLAG "-v")
+set(CMAKE_Fortran_FLAGS_INIT "")
+set(CMAKE_Fortran_FLAGS_DEBUG_INIT "-g")
+set(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "")
+set(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3")
+set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+set(CMAKE_Fortran_MODDIR_FLAG "-YMOD_OUT_DIR=")
+set(CMAKE_Fortran_MODPATH_FLAG "-p")
+set(CMAKE_Fortran_VERBOSE_FLAG "-v")
 set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-ffixed")
 set(CMAKE_Fortran_FORMAT_FREE_FLAG "-ffree")
diff --git a/Modules/Compiler/GNU-Fortran.cmake b/Modules/Compiler/GNU-Fortran.cmake
index c710e8698..313ccbd02 100644
--- a/Modules/Compiler/GNU-Fortran.cmake
+++ b/Modules/Compiler/GNU-Fortran.cmake
@@ -5,13 +5,13 @@ set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-ffixed-form")
 set(CMAKE_Fortran_FORMAT_FREE_FLAG "-ffree-form")
 
 # No -DNDEBUG for Fortran.
-SET(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-Os")
-SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3")
+set(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-Os")
+set(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3")
 
 # We require updates to CMake C++ code to support preprocessing rules
 # for Fortran.
-SET(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE)
-SET(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE)
+set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE)
+set(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE)
 
 # Fortran-specific feature flags.
-SET(CMAKE_Fortran_MODDIR_FLAG -J)
+set(CMAKE_Fortran_MODDIR_FLAG -J)
diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake
index 6aecf90e8..4f316f6e8 100644
--- a/Modules/Compiler/GNU.cmake
+++ b/Modules/Compiler/GNU.cmake
@@ -32,7 +32,7 @@ macro(__compiler_gnu lang)
   # header file as a warning if depfiles are enabled, causing check_header_file
   # tests to always succeed.  Work around this by disabling dependency tracking
   # in try_compile mode.
-  GET_PROPERTY(_IN_TC GLOBAL PROPERTY IN_TRY_COMPILE)
+  get_property(_IN_TC GLOBAL PROPERTY IN_TRY_COMPILE)
   if(NOT _IN_TC OR CMAKE_FORCE_DEPFILES)
     # distcc does not transform -o to -MT when invoking the preprocessor
     # internally, as it ought to.  Work around this bug by setting -MT here
diff --git a/Modules/Compiler/HP-ASM.cmake b/Modules/Compiler/HP-ASM.cmake
index 8aa7bdb7d..b60f207b4 100644
--- a/Modules/Compiler/HP-ASM.cmake
+++ b/Modules/Compiler/HP-ASM.cmake
@@ -1,3 +1,3 @@
-SET(CMAKE_ASM_VERBOSE_FLAG "-v")
+set(CMAKE_ASM_VERBOSE_FLAG "-v")
 
 set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s )
diff --git a/Modules/Compiler/HP-C.cmake b/Modules/Compiler/HP-C.cmake
index dc7fbb21d..6dddcbae1 100644
--- a/Modules/Compiler/HP-C.cmake
+++ b/Modules/Compiler/HP-C.cmake
@@ -1,4 +1,4 @@
-SET(CMAKE_C_VERBOSE_FLAG "-v")
+set(CMAKE_C_VERBOSE_FLAG "-v")
 
-SET(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
-SET(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
+set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
diff --git a/Modules/Compiler/HP-CXX.cmake b/Modules/Compiler/HP-CXX.cmake
index 82c1a861e..44470cae0 100644
--- a/Modules/Compiler/HP-CXX.cmake
+++ b/Modules/Compiler/HP-CXX.cmake
@@ -1,4 +1,4 @@
-SET(CMAKE_CXX_VERBOSE_FLAG "-v")
+set(CMAKE_CXX_VERBOSE_FLAG "-v")
 
-SET(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
-SET(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
+set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
diff --git a/Modules/Compiler/HP-Fortran.cmake b/Modules/Compiler/HP-Fortran.cmake
index 04fb96ea4..cc56b4611 100644
--- a/Modules/Compiler/HP-Fortran.cmake
+++ b/Modules/Compiler/HP-Fortran.cmake
@@ -1,3 +1,3 @@
-SET(CMAKE_Fortran_VERBOSE_FLAG "-v")
+set(CMAKE_Fortran_VERBOSE_FLAG "-v")
 set(CMAKE_Fortran_FORMAT_FIXED_FLAG "+source=fixed")
 set(CMAKE_Fortran_FORMAT_FREE_FLAG "+source=free")
diff --git a/Modules/Compiler/Intel-ASM.cmake b/Modules/Compiler/Intel-ASM.cmake
index 59b50a15c..0dd7b0d64 100644
--- a/Modules/Compiler/Intel-ASM.cmake
+++ b/Modules/Compiler/Intel-ASM.cmake
@@ -1,13 +1,13 @@
-SET(CMAKE_ASM_VERBOSE_FLAG "-v")
+set(CMAKE_ASM_VERBOSE_FLAG "-v")
 
-SET(CMAKE_ASM_FLAGS_INIT "")
-SET(CMAKE_ASM_FLAGS_DEBUG_INIT "-g")
-SET(CMAKE_ASM_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
-SET(CMAKE_ASM_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
-SET(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+set(CMAKE_ASM_FLAGS_INIT "")
+set(CMAKE_ASM_FLAGS_DEBUG_INIT "-g")
+set(CMAKE_ASM_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
+set(CMAKE_ASM_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
+set(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
 
-IF(UNIX)
-  SET(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;S)
-ELSE(UNIX)
-  SET(CMAKE_ASM_SOURCE_FILE_EXTENSIONS asm)
-ENDIF(UNIX)
+if(UNIX)
+  set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;S)
+else(UNIX)
+  set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS asm)
+endif(UNIX)
diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake
index 4be91d084..bca86a0f4 100644
--- a/Modules/Compiler/Intel-C.cmake
+++ b/Modules/Compiler/Intel-C.cmake
@@ -1,10 +1,10 @@
-SET(CMAKE_C_VERBOSE_FLAG "-v")
+set(CMAKE_C_VERBOSE_FLAG "-v")
 
-SET(CMAKE_C_FLAGS_INIT "")
-SET(CMAKE_C_FLAGS_DEBUG_INIT "-g")
-SET(CMAKE_C_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
-SET(CMAKE_C_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
-SET(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+set(CMAKE_C_FLAGS_INIT "")
+set(CMAKE_C_FLAGS_DEBUG_INIT "-g")
+set(CMAKE_C_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
+set(CMAKE_C_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
+set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
 
-SET(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
-SET(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
+set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake
index ff01a81f6..354bb1759 100644
--- a/Modules/Compiler/Intel-CXX.cmake
+++ b/Modules/Compiler/Intel-CXX.cmake
@@ -1,10 +1,10 @@
-SET(CMAKE_CXX_VERBOSE_FLAG "-v")
+set(CMAKE_CXX_VERBOSE_FLAG "-v")
 
-SET(CMAKE_CXX_FLAGS_INIT "")
-SET(CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
-SET(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
-SET(CMAKE_CXX_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
-SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+set(CMAKE_CXX_FLAGS_INIT "")
+set(CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
+set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
+set(CMAKE_CXX_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
+set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
 
-SET(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
-SET(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
+set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
diff --git a/Modules/Compiler/Intel-Fortran.cmake b/Modules/Compiler/Intel-Fortran.cmake
index 467abdcf5..84f6182a7 100644
--- a/Modules/Compiler/Intel-Fortran.cmake
+++ b/Modules/Compiler/Intel-Fortran.cmake
@@ -1,9 +1,9 @@
-SET(CMAKE_Fortran_FLAGS_INIT "")
-SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "-g")
-SET(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-Os")
-SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3")
-SET(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
-SET(CMAKE_Fortran_MODDIR_FLAG "-module ")
-SET(CMAKE_Fortran_VERBOSE_FLAG "-v")
+set(CMAKE_Fortran_FLAGS_INIT "")
+set(CMAKE_Fortran_FLAGS_DEBUG_INIT "-g")
+set(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-Os")
+set(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3")
+set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+set(CMAKE_Fortran_MODDIR_FLAG "-module ")
+set(CMAKE_Fortran_VERBOSE_FLAG "-v")
 set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixed")
 set(CMAKE_Fortran_FORMAT_FREE_FLAG "-free")
diff --git a/Modules/Compiler/MIPSpro-C.cmake b/Modules/Compiler/MIPSpro-C.cmake
index abf384ab8..675560c2a 100644
--- a/Modules/Compiler/MIPSpro-C.cmake
+++ b/Modules/Compiler/MIPSpro-C.cmake
@@ -1 +1 @@
-SET(CMAKE_C_VERBOSE_FLAG "-v")
+set(CMAKE_C_VERBOSE_FLAG "-v")
diff --git a/Modules/Compiler/MIPSpro-CXX.cmake b/Modules/Compiler/MIPSpro-CXX.cmake
index f3c6b5f82..9fb191c75 100644
--- a/Modules/Compiler/MIPSpro-CXX.cmake
+++ b/Modules/Compiler/MIPSpro-CXX.cmake
@@ -1 +1 @@
-SET(CMAKE_CXX_VERBOSE_FLAG "-v")
+set(CMAKE_CXX_VERBOSE_FLAG "-v")
diff --git a/Modules/Compiler/MIPSpro-Fortran.cmake b/Modules/Compiler/MIPSpro-Fortran.cmake
index 9220d3bf0..ffceea80d 100644
--- a/Modules/Compiler/MIPSpro-Fortran.cmake
+++ b/Modules/Compiler/MIPSpro-Fortran.cmake
@@ -1,3 +1,3 @@
-SET(CMAKE_Fortran_VERBOSE_FLAG "-v")
+set(CMAKE_Fortran_VERBOSE_FLAG "-v")
 set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixedform")
 set(CMAKE_Fortran_FORMAT_FREE_FLAG "-freeform")
diff --git a/Modules/Compiler/PGI-Fortran.cmake b/Modules/Compiler/PGI-Fortran.cmake
index aebc7b1c2..264c23e74 100644
--- a/Modules/Compiler/PGI-Fortran.cmake
+++ b/Modules/Compiler/PGI-Fortran.cmake
@@ -4,12 +4,12 @@ __compiler_pgi(Fortran)
 set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-Mnofreeform")
 set(CMAKE_Fortran_FORMAT_FREE_FLAG "-Mfreeform")
 
-SET(CMAKE_Fortran_FLAGS_INIT "${CMAKE_Fortran_FLAGS_INIT} -Mpreprocess -Kieee")
-SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "${CMAKE_Fortran_FLAGS_DEBUG_INIT} -Mbounds")
+set(CMAKE_Fortran_FLAGS_INIT "${CMAKE_Fortran_FLAGS_INIT} -Mpreprocess -Kieee")
+set(CMAKE_Fortran_FLAGS_DEBUG_INIT "${CMAKE_Fortran_FLAGS_DEBUG_INIT} -Mbounds")
 
 # We require updates to CMake C++ code to support preprocessing rules
 # for Fortran.
-SET(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE)
-SET(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE)
+set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE)
+set(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE)
 
-SET(CMAKE_Fortran_MODDIR_FLAG "-module ")
+set(CMAKE_Fortran_MODDIR_FLAG "-module ")
diff --git a/Modules/Compiler/PathScale-Fortran.cmake b/Modules/Compiler/PathScale-Fortran.cmake
index e05bf2afc..d90362104 100644
--- a/Modules/Compiler/PathScale-Fortran.cmake
+++ b/Modules/Compiler/PathScale-Fortran.cmake
@@ -1,6 +1,6 @@
 include(Compiler/PathScale)
 __compiler_pathscale(Fortran)
 
-SET(CMAKE_Fortran_MODDIR_FLAG "-module ")
+set(CMAKE_Fortran_MODDIR_FLAG "-module ")
 set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixedform")
 set(CMAKE_Fortran_FORMAT_FREE_FLAG "-freeform")
diff --git a/Modules/Compiler/SunPro-ASM.cmake b/Modules/Compiler/SunPro-ASM.cmake
index dfc5702ee..371e23373 100644
--- a/Modules/Compiler/SunPro-ASM.cmake
+++ b/Modules/Compiler/SunPro-ASM.cmake
@@ -1,24 +1,24 @@
 set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s )
 
-SET(CMAKE_ASM_VERBOSE_FLAG "-#")
+set(CMAKE_ASM_VERBOSE_FLAG "-#")
 
-SET(CMAKE_SHARED_LIBRARY_ASM_FLAGS "-KPIC")
-SET(CMAKE_SHARED_LIBRARY_CREATE_ASM_FLAGS "-G")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_ASM_FLAG "-R")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_ASM_FLAG_SEP ":")
-SET(CMAKE_SHARED_LIBRARY_SONAME_ASM_FLAG "-h")
+set(CMAKE_SHARED_LIBRARY_ASM_FLAGS "-KPIC")
+set(CMAKE_SHARED_LIBRARY_CREATE_ASM_FLAGS "-G")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_ASM_FLAG "-R")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_ASM_FLAG_SEP ":")
+set(CMAKE_SHARED_LIBRARY_SONAME_ASM_FLAG "-h")
 
-SET(CMAKE_ASM_FLAGS_INIT "")
-SET(CMAKE_ASM_FLAGS_DEBUG_INIT "-g")
-SET(CMAKE_ASM_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG")
-SET(CMAKE_ASM_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG")
-SET(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-g -xO2")
+set(CMAKE_ASM_FLAGS_INIT "")
+set(CMAKE_ASM_FLAGS_DEBUG_INIT "-g")
+set(CMAKE_ASM_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG")
+set(CMAKE_ASM_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG")
+set(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-g -xO2")
 
 # Initialize ASM link type selection flags.  These flags are used when
 # building a shared library, shared module, or executable that links
 # to other libraries to select whether to use the static or shared
 # versions of the libraries.
-FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
-  SET(CMAKE_${type}_LINK_STATIC_ASM_FLAGS "-Bstatic")
-  SET(CMAKE_${type}_LINK_DYNAMIC_ASM_FLAGS "-Bdynamic")
-ENDFOREACH(type)
+foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+  set(CMAKE_${type}_LINK_STATIC_ASM_FLAGS "-Bstatic")
+  set(CMAKE_${type}_LINK_DYNAMIC_ASM_FLAGS "-Bdynamic")
+endforeach(type)
diff --git a/Modules/Compiler/SunPro-C.cmake b/Modules/Compiler/SunPro-C.cmake
index a1a3ae118..668ddaea5 100644
--- a/Modules/Compiler/SunPro-C.cmake
+++ b/Modules/Compiler/SunPro-C.cmake
@@ -1,27 +1,27 @@
-SET(CMAKE_C_VERBOSE_FLAG "-#")
+set(CMAKE_C_VERBOSE_FLAG "-#")
 
-SET(CMAKE_C_COMPILE_OPTIONS_PIC -KPIC)
-SET(CMAKE_C_COMPILE_OPTIONS_PIE -KPIE)
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-KPIC")
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-G")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-R")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
-SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-h")
+set(CMAKE_C_COMPILE_OPTIONS_PIC -KPIC)
+set(CMAKE_C_COMPILE_OPTIONS_PIE -KPIE)
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "-KPIC")
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-G")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-R")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
+set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-h")
 
-SET(CMAKE_C_FLAGS_INIT "")
-SET(CMAKE_C_FLAGS_DEBUG_INIT "-g")
-SET(CMAKE_C_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG")
-SET(CMAKE_C_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG")
-SET(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g -xO2")
+set(CMAKE_C_FLAGS_INIT "")
+set(CMAKE_C_FLAGS_DEBUG_INIT "-g")
+set(CMAKE_C_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG")
+set(CMAKE_C_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG")
+set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g -xO2")
 
 # Initialize C link type selection flags.  These flags are used when
 # building a shared library, shared module, or executable that links
 # to other libraries to select whether to use the static or shared
 # versions of the libraries.
-FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
-  SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Bstatic")
-  SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Bdynamic")
-ENDFOREACH(type)
+foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+  set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Bstatic")
+  set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Bdynamic")
+endforeach(type)
 
-SET(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
-SET(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
+set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
diff --git a/Modules/Compiler/SunPro-CXX.cmake b/Modules/Compiler/SunPro-CXX.cmake
index 702e42458..d912eefcd 100644
--- a/Modules/Compiler/SunPro-CXX.cmake
+++ b/Modules/Compiler/SunPro-CXX.cmake
@@ -1,33 +1,33 @@
-SET(CMAKE_CXX_VERBOSE_FLAG "-v")
+set(CMAKE_CXX_VERBOSE_FLAG "-v")
 
-SET(CMAKE_CXX_COMPILE_OPTIONS_PIC -KPIC)
-SET(CMAKE_CXX_COMPILE_OPTIONS_PIE -KPIE)
-SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-KPIC")
-SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-G")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-R")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP ":")
-SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-h")
+set(CMAKE_CXX_COMPILE_OPTIONS_PIC -KPIC)
+set(CMAKE_CXX_COMPILE_OPTIONS_PIE -KPIE)
+set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-KPIC")
+set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-G")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-R")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP ":")
+set(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-h")
 
-SET(CMAKE_CXX_FLAGS_INIT "")
-SET(CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
-SET(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG")
-SET(CMAKE_CXX_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG")
-SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-g -xO2")
+set(CMAKE_CXX_FLAGS_INIT "")
+set(CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
+set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG")
+set(CMAKE_CXX_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG")
+set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-g -xO2")
 
 # Initialize C link type selection flags.  These flags are used when
 # building a shared library, shared module, or executable that links
 # to other libraries to select whether to use the static or shared
 # versions of the libraries.
-FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
-  SET(CMAKE_${type}_LINK_STATIC_CXX_FLAGS "-Bstatic")
-  SET(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS "-Bdynamic")
-ENDFOREACH(type)
+foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+  set(CMAKE_${type}_LINK_STATIC_CXX_FLAGS "-Bstatic")
+  set(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS "-Bdynamic")
+endforeach(type)
 
-SET(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
-SET(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
+set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
 
 # Create archives with "CC -xar" in case user adds "-instances=extern"
 # so that template instantiations are available to archive members.
-SET(CMAKE_CXX_CREATE_STATIC_LIBRARY
+set(CMAKE_CXX_CREATE_STATIC_LIBRARY
   "<CMAKE_CXX_COMPILER> -xar -o <TARGET> <OBJECTS> "
   "<CMAKE_RANLIB> <TARGET> ")
diff --git a/Modules/Compiler/SunPro-Fortran.cmake b/Modules/Compiler/SunPro-Fortran.cmake
index 86d6def34..223a6c66a 100644
--- a/Modules/Compiler/SunPro-Fortran.cmake
+++ b/Modules/Compiler/SunPro-Fortran.cmake
@@ -1,18 +1,18 @@
-SET(CMAKE_Fortran_VERBOSE_FLAG "-v")
+set(CMAKE_Fortran_VERBOSE_FLAG "-v")
 set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixed")
 set(CMAKE_Fortran_FORMAT_FREE_FLAG "-free")
 
-SET(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "-KPIC")
-SET(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-G")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG "-R")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP ":")
-SET(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG "-h")
+set(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "-KPIC")
+set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-G")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG "-R")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP ":")
+set(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG "-h")
 set(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG "-R")
 
-SET(CMAKE_Fortran_FLAGS_INIT "")
-SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "-g")
-SET(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG")
-SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG")
-SET(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-g -xO2")
-SET(CMAKE_Fortran_MODDIR_FLAG "-moddir=")
-SET(CMAKE_Fortran_MODPATH_FLAG "-M")
+set(CMAKE_Fortran_FLAGS_INIT "")
+set(CMAKE_Fortran_FLAGS_DEBUG_INIT "-g")
+set(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG")
+set(CMAKE_Fortran_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG")
+set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-g -xO2")
+set(CMAKE_Fortran_MODDIR_FLAG "-moddir=")
+set(CMAKE_Fortran_MODPATH_FLAG "-M")
diff --git a/Modules/Compiler/TinyCC-C.cmake b/Modules/Compiler/TinyCC-C.cmake
index 4a48c0af5..178dd0c5e 100644
--- a/Modules/Compiler/TinyCC-C.cmake
+++ b/Modules/Compiler/TinyCC-C.cmake
@@ -1,8 +1,8 @@
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
 
 # no optimization in tcc:
-SET (CMAKE_C_FLAGS_INIT "")
-SET (CMAKE_C_FLAGS_DEBUG_INIT "-g")
-SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-DNDEBUG")
-SET (CMAKE_C_FLAGS_RELEASE_INIT "-DNDEBUG")
-SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g")
+set (CMAKE_C_FLAGS_INIT "")
+set (CMAKE_C_FLAGS_DEBUG_INIT "-g")
+set (CMAKE_C_FLAGS_MINSIZEREL_INIT "-DNDEBUG")
+set (CMAKE_C_FLAGS_RELEASE_INIT "-DNDEBUG")
+set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g")
diff --git a/Modules/Compiler/XL-ASM.cmake b/Modules/Compiler/XL-ASM.cmake
index e5d4ffa85..95af2ea53 100644
--- a/Modules/Compiler/XL-ASM.cmake
+++ b/Modules/Compiler/XL-ASM.cmake
@@ -1,13 +1,13 @@
-SET(CMAKE_ASM_VERBOSE_FLAG "-V")
+set(CMAKE_ASM_VERBOSE_FLAG "-V")
 
 # -qthreaded     = Ensures that all optimizations will be thread-safe
 # -qalias=noansi = Turns off type-based aliasing completely (safer optimizer)
 # -qhalt=e       = Halt on error messages (rather than just severe errors)
-SET(CMAKE_ASM_FLAGS_INIT "-qthreaded -qalias=noansi -qhalt=e -qsourcetype=assembler")
+set(CMAKE_ASM_FLAGS_INIT "-qthreaded -qalias=noansi -qhalt=e -qsourcetype=assembler")
 
-SET(CMAKE_ASM_FLAGS_DEBUG_INIT "-g")
-SET(CMAKE_ASM_FLAGS_RELEASE_INIT "-O -DNDEBUG")
-SET(CMAKE_ASM_FLAGS_MINSIZEREL_INIT "-O -DNDEBUG")
-SET(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-g")
+set(CMAKE_ASM_FLAGS_DEBUG_INIT "-g")
+set(CMAKE_ASM_FLAGS_RELEASE_INIT "-O -DNDEBUG")
+set(CMAKE_ASM_FLAGS_MINSIZEREL_INIT "-O -DNDEBUG")
+set(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-g")
 
-SET(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s )
+set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s )
diff --git a/Modules/Compiler/XL-C.cmake b/Modules/Compiler/XL-C.cmake
index ae869e37e..09a55291e 100644
--- a/Modules/Compiler/XL-C.cmake
+++ b/Modules/Compiler/XL-C.cmake
@@ -6,4 +6,4 @@ set(CMAKE_C_FLAGS_MINSIZEREL_INIT "${CMAKE_C_FLAGS_MINSIZEREL_INIT} -DNDEBUG")
 # -qthreaded     = Ensures that all optimizations will be thread-safe
 # -qalias=noansi = Turns off type-based aliasing completely (safer optimizer)
 # -qhalt=e       = Halt on error messages (rather than just severe errors)
-SET(CMAKE_C_FLAGS_INIT "-qthreaded -qalias=noansi -qhalt=e")
+set(CMAKE_C_FLAGS_INIT "-qthreaded -qalias=noansi -qhalt=e")
diff --git a/Modules/Compiler/XL-CXX.cmake b/Modules/Compiler/XL-CXX.cmake
index 29c4b5e37..6c842cd77 100644
--- a/Modules/Compiler/XL-CXX.cmake
+++ b/Modules/Compiler/XL-CXX.cmake
@@ -5,7 +5,7 @@ set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "${CMAKE_CXX_FLAGS_MINSIZEREL_INIT} -DNDEBUG
 
 # -qthreaded     = Ensures that all optimizations will be thread-safe
 # -qhalt=e       = Halt on error messages (rather than just severe errors)
-SET(CMAKE_CXX_FLAGS_INIT "-qthreaded -qhalt=e")
+set(CMAKE_CXX_FLAGS_INIT "-qthreaded -qhalt=e")
 
-SET(CMAKE_CXX_COMPILE_OBJECT
+set(CMAKE_CXX_COMPILE_OBJECT
   "<CMAKE_CXX_COMPILER> -+ <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
diff --git a/Modules/Compiler/XL-Fortran.cmake b/Modules/Compiler/XL-Fortran.cmake
index e7026f11a..f1c9158b2 100644
--- a/Modules/Compiler/XL-Fortran.cmake
+++ b/Modules/Compiler/XL-Fortran.cmake
@@ -4,14 +4,14 @@ __compiler_xl(Fortran)
 set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-qfixed") # [=<right_margin>]
 set(CMAKE_Fortran_FORMAT_FREE_FLAG "-qfree") # [=f90|ibm]
 
-SET(CMAKE_Fortran_MODDIR_FLAG "-qmoddir=")
+set(CMAKE_Fortran_MODDIR_FLAG "-qmoddir=")
 
-SET(CMAKE_Fortran_DEFINE_FLAG "-WF,-D")
+set(CMAKE_Fortran_DEFINE_FLAG "-WF,-D")
 
 # -qthreaded     = Ensures that all optimizations will be thread-safe
 # -qhalt=e       = Halt on error messages (rather than just severe errors)
-SET(CMAKE_Fortran_FLAGS_INIT "-qthreaded -qhalt=e")
+set(CMAKE_Fortran_FLAGS_INIT "-qthreaded -qhalt=e")
 
 # We require updates to CMake C++ code to support preprocessing rules for Fortran.
-SET(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE)
-SET(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE)
+set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE)
+set(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE)
diff --git a/Modules/Dart.cmake b/Modules/Dart.cmake
index e85f093ce..97addcc2a 100644
--- a/Modules/Dart.cmake
+++ b/Modules/Dart.cmake
@@ -3,10 +3,10 @@
 # It supports using the old Dart 1 Tcl client for driving dashboard
 # submissions as well as testing with CTest.  This module should be included
 # in the CMakeLists.txt file at the top of a project.  Typical usage:
-#  INCLUDE(Dart)
-#  IF(BUILD_TESTING)
+#  include(Dart)
+#  if(BUILD_TESTING)
 #    # ... testing related CMake code ...
-#  ENDIF(BUILD_TESTING)
+#  endif(BUILD_TESTING)
 # The BUILD_TESTING option is created by the Dart module to determine
 # whether testing support should be enabled.  The default is ON.
 
@@ -32,10 +32,10 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-OPTION(BUILD_TESTING "Build the testing tree." ON)
+option(BUILD_TESTING "Build the testing tree." ON)
 
-IF(BUILD_TESTING)
-  FIND_PACKAGE(Dart QUIET)
+if(BUILD_TESTING)
+  find_package(Dart QUIET)
 
   #
   # Section #1:
@@ -44,25 +44,25 @@ IF(BUILD_TESTING)
   # on the client and configure site name and build name.
   #
 
-  SET(RUN_FROM_DART 1)
-  INCLUDE(CTest)
-  SET(RUN_FROM_DART)
+  set(RUN_FROM_DART 1)
+  include(CTest)
+  set(RUN_FROM_DART)
 
-  FIND_PROGRAM(COMPRESSIONCOMMAND NAMES gzip compress zip
+  find_program(COMPRESSIONCOMMAND NAMES gzip compress zip
     DOC "Path to program used to compress files for transfer to the dart server")
-  FIND_PROGRAM(GUNZIPCOMMAND gunzip DOC "Path to gunzip executable")
-  FIND_PROGRAM(JAVACOMMAND java DOC "Path to java command, used by the Dart server to create html.")
-  OPTION(DART_VERBOSE_BUILD "Show the actual output of the build, or if off show a . for each 1024 bytes."
+  find_program(GUNZIPCOMMAND gunzip DOC "Path to gunzip executable")
+  find_program(JAVACOMMAND java DOC "Path to java command, used by the Dart server to create html.")
+  option(DART_VERBOSE_BUILD "Show the actual output of the build, or if off show a . for each 1024 bytes."
     OFF)
-  OPTION(DART_BUILD_ERROR_REPORT_LIMIT "Limit of reported errors, -1 reports all." -1 )
-  OPTION(DART_BUILD_WARNING_REPORT_LIMIT "Limit of reported warnings, -1 reports all." -1 )
+  option(DART_BUILD_ERROR_REPORT_LIMIT "Limit of reported errors, -1 reports all." -1 )
+  option(DART_BUILD_WARNING_REPORT_LIMIT "Limit of reported warnings, -1 reports all." -1 )
 
-  SET(VERBOSE_BUILD ${DART_VERBOSE_BUILD})
-  SET(BUILD_ERROR_REPORT_LIMIT ${DART_BUILD_ERROR_REPORT_LIMIT})
-  SET(BUILD_WARNING_REPORT_LIMIT ${DART_BUILD_WARNING_REPORT_LIMIT})
-  SET (DELIVER_CONTINUOUS_EMAIL "Off" CACHE BOOL "Should Dart server send email when build errors are found in Continuous builds?")
+  set(VERBOSE_BUILD ${DART_VERBOSE_BUILD})
+  set(BUILD_ERROR_REPORT_LIMIT ${DART_BUILD_ERROR_REPORT_LIMIT})
+  set(BUILD_WARNING_REPORT_LIMIT ${DART_BUILD_WARNING_REPORT_LIMIT})
+  set (DELIVER_CONTINUOUS_EMAIL "Off" CACHE BOOL "Should Dart server send email when build errors are found in Continuous builds?")
 
-  MARK_AS_ADVANCED(
+  mark_as_advanced(
     COMPRESSIONCOMMAND
     DART_BUILD_ERROR_REPORT_LIMIT
     DART_BUILD_WARNING_REPORT_LIMIT
@@ -73,10 +73,10 @@ IF(BUILD_TESTING)
     JAVACOMMAND
     )
 
-  SET(HAVE_DART)
-  IF(EXISTS "${DART_ROOT}/Source/Client/Dart.conf.in")
-    SET(HAVE_DART 1)
-  ENDIF(EXISTS "${DART_ROOT}/Source/Client/Dart.conf.in")
+  set(HAVE_DART)
+  if(EXISTS "${DART_ROOT}/Source/Client/Dart.conf.in")
+    set(HAVE_DART 1)
+  endif(EXISTS "${DART_ROOT}/Source/Client/Dart.conf.in")
 
   #
   # Section #2:
@@ -84,18 +84,18 @@ IF(BUILD_TESTING)
   # Make necessary directories and configure testing scripts
   #
   # find a tcl shell command
-  IF(HAVE_DART)
-    FIND_PACKAGE(Tclsh)
-  ENDIF(HAVE_DART)
+  if(HAVE_DART)
+    find_package(Tclsh)
+  endif(HAVE_DART)
 
 
-  IF (HAVE_DART)
+  if (HAVE_DART)
     # make directories in the binary tree
-    FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/Testing/HTML/TestingResults/Dashboard"
+    file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/Testing/HTML/TestingResults/Dashboard"
       "${PROJECT_BINARY_DIR}/Testing/HTML/TestingResults/Sites/${SITE}/${BUILDNAME}")
 
     # configure files
-    CONFIGURE_FILE(
+    configure_file(
       "${DART_ROOT}/Source/Client/Dart.conf.in"
       "${PROJECT_BINARY_DIR}/DartConfiguration.tcl" )
 
@@ -107,16 +107,16 @@ IF(BUILD_TESTING)
     #
 
     # add testing targets
-    SET(DART_EXPERIMENTAL_NAME Experimental)
-    IF(DART_EXPERIMENTAL_USE_PROJECT_NAME)
-      SET(DART_EXPERIMENTAL_NAME "${DART_EXPERIMENTAL_NAME}${PROJECT_NAME}")
-    ENDIF(DART_EXPERIMENTAL_USE_PROJECT_NAME)
-  ENDIF (HAVE_DART)
+    set(DART_EXPERIMENTAL_NAME Experimental)
+    if(DART_EXPERIMENTAL_USE_PROJECT_NAME)
+      set(DART_EXPERIMENTAL_NAME "${DART_EXPERIMENTAL_NAME}${PROJECT_NAME}")
+    endif(DART_EXPERIMENTAL_USE_PROJECT_NAME)
+  endif (HAVE_DART)
 
-  SET(RUN_FROM_CTEST_OR_DART 1)
-  INCLUDE(CTestTargets)
-  SET(RUN_FROM_CTEST_OR_DART)
-ENDIF(BUILD_TESTING)
+  set(RUN_FROM_CTEST_OR_DART 1)
+  include(CTestTargets)
+  set(RUN_FROM_CTEST_OR_DART)
+endif(BUILD_TESTING)
 
 #
 # End of Dart.cmake
diff --git a/Modules/DeployQt4.cmake b/Modules/DeployQt4.cmake
index edf4b4e76..6190abed1 100644
--- a/Modules/DeployQt4.cmake
+++ b/Modules/DeployQt4.cmake
@@ -293,8 +293,8 @@ function(install_qt4_executable executable)
         resolve_qt4_paths(libs "")
 
         install(CODE
-  "INCLUDE(\"${DeployQt4_cmake_dir}/DeployQt4.cmake\")
-  SET(BU_CHMOD_BUNDLE_ITEMS TRUE)
+  "include(\"${DeployQt4_cmake_dir}/DeployQt4.cmake\")
+  set(BU_CHMOD_BUNDLE_ITEMS TRUE)
   FIXUP_QT4_EXECUTABLE(\"\${CMAKE_INSTALL_PREFIX}/${executable}\" \"\" \"${libs}\" \"${dirs}\" \"${plugins_dir}\" \"${request_qt_conf}\")"
                 ${component}
         )
diff --git a/Modules/Documentation.cmake b/Modules/Documentation.cmake
index aff78c94f..ec989f408 100644
--- a/Modules/Documentation.cmake
+++ b/Modules/Documentation.cmake
@@ -18,28 +18,28 @@
 #
 # Build the documentation ?
 #
-OPTION(BUILD_DOCUMENTATION "Build the documentation (Doxygen)." OFF)
-MARK_AS_ADVANCED(BUILD_DOCUMENTATION)
+option(BUILD_DOCUMENTATION "Build the documentation (Doxygen)." OFF)
+mark_as_advanced(BUILD_DOCUMENTATION)
 
-IF (BUILD_DOCUMENTATION)
+if (BUILD_DOCUMENTATION)
 
   #
   # Check for the tools
   #
-  FIND_PACKAGE(UnixCommands)
-  FIND_PACKAGE(Doxygen)
-  FIND_PACKAGE(Gnuplot)
-  FIND_PACKAGE(HTMLHelp)
-  FIND_PACKAGE(Perl)
-  FIND_PACKAGE(Wget)
+  find_package(UnixCommands)
+  find_package(Doxygen)
+  find_package(Gnuplot)
+  find_package(HTMLHelp)
+  find_package(Perl)
+  find_package(Wget)
 
-  OPTION(DOCUMENTATION_HTML_HELP
+  option(DOCUMENTATION_HTML_HELP
     "Build the HTML Help file (CHM)." OFF)
 
-  OPTION(DOCUMENTATION_HTML_TARZ
+  option(DOCUMENTATION_HTML_TARZ
     "Build a compressed tar archive of the HTML doc." OFF)
 
-  MARK_AS_ADVANCED(
+  mark_as_advanced(
     DOCUMENTATION_HTML_HELP
     DOCUMENTATION_HTML_TARZ
     )
@@ -49,4 +49,4 @@ IF (BUILD_DOCUMENTATION)
   # We will probably need bash to create the custom target
   #
 
-ENDIF (BUILD_DOCUMENTATION)
+endif (BUILD_DOCUMENTATION)
diff --git a/Modules/FLTKCompatibility.cmake b/Modules/FLTKCompatibility.cmake
index 6b6f9607b..58c52da34 100644
--- a/Modules/FLTKCompatibility.cmake
+++ b/Modules/FLTKCompatibility.cmake
@@ -12,4 +12,4 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE(CheckIncludeFile)
+include(CheckIncludeFile)
diff --git a/Modules/FeatureSummary.cmake b/Modules/FeatureSummary.cmake
index a5b94d199..718a0d90d 100644
--- a/Modules/FeatureSummary.cmake
+++ b/Modules/FeatureSummary.cmake
@@ -87,7 +87,7 @@
 # Use this macro to set up information about the named package, which can
 # then be displayed via FEATURE_SUMMARY().
 # This can be done either directly in the Find-module or in the project
-# which uses the module after the FIND_PACKAGE() call.
+# which uses the module after the find_package() call.
 # The features for which information can be set are added automatically by the
 # find_package() command.
 #
@@ -151,7 +151,7 @@
 # Use this macro to set up information about the named package, which can
 # then be displayed via FEATURE_SUMMARY().
 # This can be done either directly in the Find-module or in the project
-# which uses the module after the FIND_PACKAGE() call.
+# which uses the module after the find_package() call.
 # The features for which information can be set are added automatically by the
 # find_package() command.
 #
@@ -177,177 +177,177 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE(CMakeParseArguments)
+include(CMakeParseArguments)
 
 
-FUNCTION(ADD_FEATURE_INFO _name _enabled _desc)
-  IF (${_enabled})
-    SET_PROPERTY(GLOBAL APPEND PROPERTY ENABLED_FEATURES "${_name}")
-  ELSE ()
-    SET_PROPERTY(GLOBAL APPEND PROPERTY DISABLED_FEATURES "${_name}")
-  ENDIF ()
+function(ADD_FEATURE_INFO _name _enabled _desc)
+  if (${_enabled})
+    set_property(GLOBAL APPEND PROPERTY ENABLED_FEATURES "${_name}")
+  else ()
+    set_property(GLOBAL APPEND PROPERTY DISABLED_FEATURES "${_name}")
+  endif ()
 
-  SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION "${_desc}" )
-ENDFUNCTION(ADD_FEATURE_INFO)
+  set_property(GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION "${_desc}" )
+endfunction(ADD_FEATURE_INFO)
 
 
 
-FUNCTION(SET_PACKAGE_PROPERTIES _name _props)
-  IF(NOT "${_props}" STREQUAL "PROPERTIES")
-    MESSAGE(FATAL_ERROR "PROPERTIES keyword is missing in SET_PACKAGE_PROPERTIES() call.")
-  ENDIF()
+function(SET_PACKAGE_PROPERTIES _name _props)
+  if(NOT "${_props}" STREQUAL "PROPERTIES")
+    message(FATAL_ERROR "PROPERTIES keyword is missing in SET_PACKAGE_PROPERTIES() call.")
+  endif()
 
-  SET(options ) # none
-  SET(oneValueArgs DESCRIPTION URL TYPE PURPOSE )
-  SET(multiValueArgs ) # none
+  set(options ) # none
+  set(oneValueArgs DESCRIPTION URL TYPE PURPOSE )
+  set(multiValueArgs ) # none
 
   CMAKE_PARSE_ARGUMENTS(_SPP "${options}" "${oneValueArgs}" "${multiValueArgs}"  ${ARGN})
 
-  IF(_SPP_UNPARSED_ARGUMENTS)
-    MESSAGE(FATAL_ERROR "Unknown keywords given to SET_PACKAGE_PROPERTIES(): \"${_SPP_UNPARSED_ARGUMENTS}\"")
-  ENDIF()
+  if(_SPP_UNPARSED_ARGUMENTS)
+    message(FATAL_ERROR "Unknown keywords given to SET_PACKAGE_PROPERTIES(): \"${_SPP_UNPARSED_ARGUMENTS}\"")
+  endif()
 
-  IF(_SPP_DESCRIPTION)
-    GET_PROPERTY(_info  GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION)
-    IF(_info AND NOT "${_info}" STREQUAL "${_SPP_DESCRIPTION}")
-      MESSAGE(STATUS "Warning: Property DESCRIPTION for package ${_name} already set to \"${_info}\", overriding it with \"${_SPP_DESCRIPTION}\"")
-    ENDIF()
+  if(_SPP_DESCRIPTION)
+    get_property(_info  GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION)
+    if(_info AND NOT "${_info}" STREQUAL "${_SPP_DESCRIPTION}")
+      message(STATUS "Warning: Property DESCRIPTION for package ${_name} already set to \"${_info}\", overriding it with \"${_SPP_DESCRIPTION}\"")
+    endif()
 
-    SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION "${_SPP_DESCRIPTION}" )
-  ENDIF()
+    set_property(GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION "${_SPP_DESCRIPTION}" )
+  endif()
 
 
-  IF(_SPP_URL)
-    GET_PROPERTY(_info  GLOBAL PROPERTY _CMAKE_${_name}_URL)
-    IF(_info AND NOT "${_info}" STREQUAL "${_SPP_URL}")
-      MESSAGE(STATUS "Warning: Property URL already set to \"${_info}\", overriding it with \"${_SPP_URL}\"")
-    ENDIF()
+  if(_SPP_URL)
+    get_property(_info  GLOBAL PROPERTY _CMAKE_${_name}_URL)
+    if(_info AND NOT "${_info}" STREQUAL "${_SPP_URL}")
+      message(STATUS "Warning: Property URL already set to \"${_info}\", overriding it with \"${_SPP_URL}\"")
+    endif()
 
-    SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_URL "${_SPP_URL}" )
-  ENDIF()
+    set_property(GLOBAL PROPERTY _CMAKE_${_name}_URL "${_SPP_URL}" )
+  endif()
 
 
   # handle the PURPOSE: use APPEND, since there can be multiple purposes for one package inside a project
-  IF(_SPP_PURPOSE)
-    SET_PROPERTY(GLOBAL APPEND PROPERTY _CMAKE_${_name}_PURPOSE "${_SPP_PURPOSE}" )
-  ENDIF()
+  if(_SPP_PURPOSE)
+    set_property(GLOBAL APPEND PROPERTY _CMAKE_${_name}_PURPOSE "${_SPP_PURPOSE}" )
+  endif()
 
   # handle the TYPE
-  IF(NOT _SPP_TYPE)
-    SET(_SPP_TYPE OPTIONAL)
-  ENDIF()
+  if(NOT _SPP_TYPE)
+    set(_SPP_TYPE OPTIONAL)
+  endif()
 
   # List the supported types, according to their priority
-  SET(validTypes "RUNTIME" "OPTIONAL" "RECOMMENDED" "REQUIRED" )
-  LIST(FIND validTypes ${_SPP_TYPE} _typeIndexInList)
-  IF("${_typeIndexInList}" STREQUAL "-1" )
-    MESSAGE(FATAL_ERROR "Bad package property type ${_SPP_TYPE} used in SET_PACKAGE_PROPERTIES(). "
+  set(validTypes "RUNTIME" "OPTIONAL" "RECOMMENDED" "REQUIRED" )
+  list(FIND validTypes ${_SPP_TYPE} _typeIndexInList)
+  if("${_typeIndexInList}" STREQUAL "-1" )
+    message(FATAL_ERROR "Bad package property type ${_SPP_TYPE} used in SET_PACKAGE_PROPERTIES(). "
                         "Valid types are OPTIONAL, RECOMMENDED, REQUIRED and RUNTIME." )
-  ENDIF()
+  endif()
 
-  GET_PROPERTY(_previousType  GLOBAL PROPERTY _CMAKE_${_name}_TYPE)
-  LIST(FIND validTypes "${_previousType}" _prevTypeIndexInList)
+  get_property(_previousType  GLOBAL PROPERTY _CMAKE_${_name}_TYPE)
+  list(FIND validTypes "${_previousType}" _prevTypeIndexInList)
 
   # make sure a previously set TYPE is not overridden with a lower new TYPE:
-  IF("${_typeIndexInList}" GREATER "${_prevTypeIndexInList}")
-    SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_TYPE "${_SPP_TYPE}" )
-  ENDIF()
+  if("${_typeIndexInList}" GREATER "${_prevTypeIndexInList}")
+    set_property(GLOBAL PROPERTY _CMAKE_${_name}_TYPE "${_SPP_TYPE}" )
+  endif()
 
-ENDFUNCTION(SET_PACKAGE_PROPERTIES)
+endfunction(SET_PACKAGE_PROPERTIES)
 
 
 
-FUNCTION(_FS_GET_FEATURE_SUMMARY _property _var _includeQuiet)
+function(_FS_GET_FEATURE_SUMMARY _property _var _includeQuiet)
 
-  SET(_type "ANY")
-  IF("${_property}" MATCHES "REQUIRED_")
-    SET(_type "REQUIRED")
-  ELSEIF("${_property}" MATCHES "RECOMMENDED_")
-    SET(_type "RECOMMENDED")
-  ELSEIF("${_property}" MATCHES "RUNTIME_")
-    SET(_type "RUNTIME")
-  ELSEIF("${_property}" MATCHES "OPTIONAL_")
-    SET(_type "OPTIONAL")
-  ENDIF()
+  set(_type "ANY")
+  if("${_property}" MATCHES "REQUIRED_")
+    set(_type "REQUIRED")
+  elseif("${_property}" MATCHES "RECOMMENDED_")
+    set(_type "RECOMMENDED")
+  elseif("${_property}" MATCHES "RUNTIME_")
+    set(_type "RUNTIME")
+  elseif("${_property}" MATCHES "OPTIONAL_")
+    set(_type "OPTIONAL")
+  endif()
 
-  IF("${_property}" MATCHES "PACKAGES_FOUND")
-    SET(_property "PACKAGES_FOUND")
-  ELSEIF("${_property}" MATCHES "PACKAGES_NOT_FOUND")
-    SET(_property "PACKAGES_NOT_FOUND")
-  ENDIF()
+  if("${_property}" MATCHES "PACKAGES_FOUND")
+    set(_property "PACKAGES_FOUND")
+  elseif("${_property}" MATCHES "PACKAGES_NOT_FOUND")
+    set(_property "PACKAGES_NOT_FOUND")
+  endif()
 
 
-  SET(_currentFeatureText "")
-  GET_PROPERTY(_EnabledFeatures  GLOBAL PROPERTY ${_property})
+  set(_currentFeatureText "")
+  get_property(_EnabledFeatures  GLOBAL PROPERTY ${_property})
 
-  FOREACH(_currentFeature ${_EnabledFeatures})
+  foreach(_currentFeature ${_EnabledFeatures})
 
     # does this package belong to the type we currently want to list ?
-    GET_PROPERTY(_currentType  GLOBAL PROPERTY _CMAKE_${_currentFeature}_TYPE)
-    IF(NOT _currentType)
-      SET(_currentType OPTIONAL)
-    ENDIF()
+    get_property(_currentType  GLOBAL PROPERTY _CMAKE_${_currentFeature}_TYPE)
+    if(NOT _currentType)
+      set(_currentType OPTIONAL)
+    endif()
 
-    IF("${_type}" STREQUAL ANY  OR  "${_type}" STREQUAL "${_currentType}")
+    if("${_type}" STREQUAL ANY  OR  "${_type}" STREQUAL "${_currentType}")
 
       # check whether the current feature/package should be in the output depending on whether it was QUIET or not
-      SET(includeThisOne TRUE)
+      set(includeThisOne TRUE)
       # skip QUIET packages, except if they are REQUIRED or INCLUDE_QUIET_PACKAGES has been set
-      IF((NOT "${_currentType}" STREQUAL "REQUIRED") AND NOT _includeQuiet)
-        GET_PROPERTY(_isQuiet  GLOBAL PROPERTY _CMAKE_${_currentFeature}_QUIET)
-        IF(_isQuiet)
-          SET(includeThisOne FALSE)
-        ENDIF()
-      ENDIF()
+      if((NOT "${_currentType}" STREQUAL "REQUIRED") AND NOT _includeQuiet)
+        get_property(_isQuiet  GLOBAL PROPERTY _CMAKE_${_currentFeature}_QUIET)
+        if(_isQuiet)
+          set(includeThisOne FALSE)
+        endif()
+      endif()
 
-      IF(includeThisOne)
+      if(includeThisOne)
 
-        SET(_currentFeatureText "${_currentFeatureText}\n * ${_currentFeature}")
-        GET_PROPERTY(_info  GLOBAL PROPERTY _CMAKE_${_currentFeature}_REQUIRED_VERSION)
-        IF(_info)
-          SET(_currentFeatureText "${_currentFeatureText} (required version ${_info})")
-        ENDIF(_info)
-        GET_PROPERTY(_info  GLOBAL PROPERTY _CMAKE_${_currentFeature}_DESCRIPTION)
-        IF(_info)
-          SET(_currentFeatureText "${_currentFeatureText} , ${_info}")
-        ENDIF(_info)
-        GET_PROPERTY(_info  GLOBAL PROPERTY _CMAKE_${_currentFeature}_URL)
-        IF(_info)
-          SET(_currentFeatureText "${_currentFeatureText} , <${_info}>")
-        ENDIF(_info)
+        set(_currentFeatureText "${_currentFeatureText}\n * ${_currentFeature}")
+        get_property(_info  GLOBAL PROPERTY _CMAKE_${_currentFeature}_REQUIRED_VERSION)
+        if(_info)
+          set(_currentFeatureText "${_currentFeatureText} (required version ${_info})")
+        endif(_info)
+        get_property(_info  GLOBAL PROPERTY _CMAKE_${_currentFeature}_DESCRIPTION)
+        if(_info)
+          set(_currentFeatureText "${_currentFeatureText} , ${_info}")
+        endif(_info)
+        get_property(_info  GLOBAL PROPERTY _CMAKE_${_currentFeature}_URL)
+        if(_info)
+          set(_currentFeatureText "${_currentFeatureText} , <${_info}>")
+        endif(_info)
 
-        GET_PROPERTY(_info  GLOBAL PROPERTY _CMAKE_${_currentFeature}_PURPOSE)
-        FOREACH(_purpose ${_info})
-          SET(_currentFeatureText "${_currentFeatureText}\n   ${_purpose}")
-        ENDFOREACH()
+        get_property(_info  GLOBAL PROPERTY _CMAKE_${_currentFeature}_PURPOSE)
+        foreach(_purpose ${_info})
+          set(_currentFeatureText "${_currentFeatureText}\n   ${_purpose}")
+        endforeach()
 
-      ENDIF(includeThisOne)
+      endif(includeThisOne)
 
-    ENDIF("${_type}" STREQUAL ANY  OR  "${_type}" STREQUAL "${_currentType}")
+    endif("${_type}" STREQUAL ANY  OR  "${_type}" STREQUAL "${_currentType}")
 
-  ENDFOREACH(_currentFeature)
-  SET(${_var} "${_currentFeatureText}" PARENT_SCOPE)
-ENDFUNCTION(_FS_GET_FEATURE_SUMMARY)
+  endforeach(_currentFeature)
+  set(${_var} "${_currentFeatureText}" PARENT_SCOPE)
+endfunction(_FS_GET_FEATURE_SUMMARY)
 
 
 
-FUNCTION(FEATURE_SUMMARY)
+function(FEATURE_SUMMARY)
 # CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords> <multi_value_keywords> args...)
-  SET(options APPEND INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
-  SET(oneValueArgs FILENAME VAR DESCRIPTION WHAT)
-  SET(multiValueArgs ) # none
+  set(options APPEND INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
+  set(oneValueArgs FILENAME VAR DESCRIPTION WHAT)
+  set(multiValueArgs ) # none
 
   CMAKE_PARSE_ARGUMENTS(_FS "${options}" "${oneValueArgs}" "${multiValueArgs}"  ${_FIRST_ARG} ${ARGN})
 
-  IF(_FS_UNPARSED_ARGUMENTS)
-    MESSAGE(FATAL_ERROR "Unknown keywords given to FEATURE_SUMMARY(): \"${_FS_UNPARSED_ARGUMENTS}\"")
-  ENDIF()
+  if(_FS_UNPARSED_ARGUMENTS)
+    message(FATAL_ERROR "Unknown keywords given to FEATURE_SUMMARY(): \"${_FS_UNPARSED_ARGUMENTS}\"")
+  endif()
 
-  IF(NOT _FS_WHAT)
-    MESSAGE(FATAL_ERROR "The call to FEATURE_SUMMARY() doesn't set the required WHAT argument.")
-  ENDIF()
+  if(NOT _FS_WHAT)
+    message(FATAL_ERROR "The call to FEATURE_SUMMARY() doesn't set the required WHAT argument.")
+  endif()
 
-  SET(validWhatParts "ENABLED_FEATURES"
+  set(validWhatParts "ENABLED_FEATURES"
                      "DISABLED_FEATURES"
                      "PACKAGES_FOUND"
                      "PACKAGES_NOT_FOUND"
@@ -360,17 +360,17 @@ FUNCTION(FEATURE_SUMMARY)
                      "RUNTIME_PACKAGES_FOUND"
                      "RUNTIME_PACKAGES_NOT_FOUND")
 
-  LIST(FIND validWhatParts "${_FS_WHAT}" indexInList)
-  IF(NOT "${indexInList}" STREQUAL "-1")
+  list(FIND validWhatParts "${_FS_WHAT}" indexInList)
+  if(NOT "${indexInList}" STREQUAL "-1")
     _FS_GET_FEATURE_SUMMARY( ${_FS_WHAT} _featureSummary ${_FS_INCLUDE_QUIET_PACKAGES} )
-    SET(_fullText "${_FS_DESCRIPTION}${_featureSummary}\n")
-    IF (("${_FS_WHAT}" STREQUAL "REQUIRED_PACKAGES_NOT_FOUND") AND _featureSummary)
-      SET(requiredPackagesNotFound TRUE)
-    ENDIF()
+    set(_fullText "${_FS_DESCRIPTION}${_featureSummary}\n")
+    if (("${_FS_WHAT}" STREQUAL "REQUIRED_PACKAGES_NOT_FOUND") AND _featureSummary)
+      set(requiredPackagesNotFound TRUE)
+    endif()
 
-  ELSEIF("${_FS_WHAT}" STREQUAL "ALL")
+  elseif("${_FS_WHAT}" STREQUAL "ALL")
 
-    SET(allWhatParts "ENABLED_FEATURES"
+    set(allWhatParts "ENABLED_FEATURES"
                      "RUNTIME_PACKAGES_FOUND"
                      "OPTIONAL_PACKAGES_FOUND"
                      "RECOMMENDED_PACKAGES_FOUND"
@@ -383,84 +383,84 @@ FUNCTION(FEATURE_SUMMARY)
                      "REQUIRED_PACKAGES_NOT_FOUND"
        )
 
-    SET(title_ENABLED_FEATURES               "The following features have been enabled:")
-    SET(title_DISABLED_FEATURES              "The following features have been disabled:")
-    SET(title_OPTIONAL_PACKAGES_FOUND        "The following OPTIONAL packages have been found:")
-    SET(title_OPTIONAL_PACKAGES_NOT_FOUND    "The following OPTIONAL packages have not been found:")
-    SET(title_RECOMMENDED_PACKAGES_FOUND     "The following RECOMMENDED packages have been found:")
-    SET(title_RECOMMENDED_PACKAGES_NOT_FOUND "The following RECOMMENDED packages have not been found:")
-    SET(title_REQUIRED_PACKAGES_FOUND        "The following REQUIRED packages have been found:")
-    SET(title_REQUIRED_PACKAGES_NOT_FOUND    "The following REQUIRED packages have not been found:")
-    SET(title_RUNTIME_PACKAGES_FOUND         "The following RUNTIME packages have been found:")
-    SET(title_RUNTIME_PACKAGES_NOT_FOUND     "The following RUNTIME packages have not been found:")
+    set(title_ENABLED_FEATURES               "The following features have been enabled:")
+    set(title_DISABLED_FEATURES              "The following features have been disabled:")
+    set(title_OPTIONAL_PACKAGES_FOUND        "The following OPTIONAL packages have been found:")
+    set(title_OPTIONAL_PACKAGES_NOT_FOUND    "The following OPTIONAL packages have not been found:")
+    set(title_RECOMMENDED_PACKAGES_FOUND     "The following RECOMMENDED packages have been found:")
+    set(title_RECOMMENDED_PACKAGES_NOT_FOUND "The following RECOMMENDED packages have not been found:")
+    set(title_REQUIRED_PACKAGES_FOUND        "The following REQUIRED packages have been found:")
+    set(title_REQUIRED_PACKAGES_NOT_FOUND    "The following REQUIRED packages have not been found:")
+    set(title_RUNTIME_PACKAGES_FOUND         "The following RUNTIME packages have been found:")
+    set(title_RUNTIME_PACKAGES_NOT_FOUND     "The following RUNTIME packages have not been found:")
 
-    SET(_fullText "${_FS_DESCRIPTION}")
-    FOREACH(part ${allWhatParts})
-      SET(_tmp)
+    set(_fullText "${_FS_DESCRIPTION}")
+    foreach(part ${allWhatParts})
+      set(_tmp)
       _FS_GET_FEATURE_SUMMARY( ${part} _tmp ${_FS_INCLUDE_QUIET_PACKAGES})
-      IF(_tmp)
-        SET(_fullText "${_fullText}\n-- ${title_${part}}\n${_tmp}\n")
-        IF("${part}" STREQUAL "REQUIRED_PACKAGES_NOT_FOUND")
-          SET(requiredPackagesNotFound TRUE)
-        ENDIF()
-      ENDIF()
-    ENDFOREACH()
-  ELSE()
-    MESSAGE(FATAL_ERROR "The WHAT argument of FEATURE_SUMMARY() is set to ${_FS_WHAT}, which is not a valid value.")
-  ENDIF()
+      if(_tmp)
+        set(_fullText "${_fullText}\n-- ${title_${part}}\n${_tmp}\n")
+        if("${part}" STREQUAL "REQUIRED_PACKAGES_NOT_FOUND")
+          set(requiredPackagesNotFound TRUE)
+        endif()
+      endif()
+    endforeach()
+  else()
+    message(FATAL_ERROR "The WHAT argument of FEATURE_SUMMARY() is set to ${_FS_WHAT}, which is not a valid value.")
+  endif()
 
-  IF(_FS_FILENAME)
-    IF(_FS_APPEND)
-      FILE(APPEND "${_FS_FILENAME}" "${_fullText}")
-    ELSE(_FS_APPEND)
-      FILE(WRITE  "${_FS_FILENAME}" "${_fullText}")
-    ENDIF()
+  if(_FS_FILENAME)
+    if(_FS_APPEND)
+      file(APPEND "${_FS_FILENAME}" "${_fullText}")
+    else(_FS_APPEND)
+      file(WRITE  "${_FS_FILENAME}" "${_fullText}")
+    endif()
 
-  ELSE(_FS_FILENAME)
-    IF(NOT _FS_VAR)
-      MESSAGE(STATUS "${_fullText}")
-    ENDIF()
-  ENDIF()
+  else(_FS_FILENAME)
+    if(NOT _FS_VAR)
+      message(STATUS "${_fullText}")
+    endif()
+  endif()
 
-  IF(_FS_VAR)
-    SET(${_FS_VAR} "${_fullText}" PARENT_SCOPE)
-  ENDIF()
+  if(_FS_VAR)
+    set(${_FS_VAR} "${_fullText}" PARENT_SCOPE)
+  endif()
 
-  IF(requiredPackagesNotFound  AND  _FS_FATAL_ON_MISSING_REQUIRED_PACKAGES)
-    MESSAGE(FATAL_ERROR "feature_summary() Error: REQUIRED package(s) are missing, aborting CMake run.")
-  ENDIF()
+  if(requiredPackagesNotFound  AND  _FS_FATAL_ON_MISSING_REQUIRED_PACKAGES)
+    message(FATAL_ERROR "feature_summary() Error: REQUIRED package(s) are missing, aborting CMake run.")
+  endif()
 
-ENDFUNCTION(FEATURE_SUMMARY)
+endfunction(FEATURE_SUMMARY)
 
 
 # The stuff below is only kept for compatibility
 
-FUNCTION(SET_PACKAGE_INFO _name _desc)
-  SET(_url "${ARGV2}")
-  SET(_purpose "${ARGV3}")
-  SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION "${_desc}" )
-  IF(_url MATCHES ".+")
-    SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_URL "${_url}" )
-  ENDIF()
-  IF(_purpose MATCHES ".+")
-    SET_PROPERTY(GLOBAL APPEND PROPERTY _CMAKE_${_name}_PURPOSE "${_purpose}" )
-  ENDIF()
-ENDFUNCTION(SET_PACKAGE_INFO)
+function(SET_PACKAGE_INFO _name _desc)
+  set(_url "${ARGV2}")
+  set(_purpose "${ARGV3}")
+  set_property(GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION "${_desc}" )
+  if(_url MATCHES ".+")
+    set_property(GLOBAL PROPERTY _CMAKE_${_name}_URL "${_url}" )
+  endif()
+  if(_purpose MATCHES ".+")
+    set_property(GLOBAL APPEND PROPERTY _CMAKE_${_name}_PURPOSE "${_purpose}" )
+  endif()
+endfunction(SET_PACKAGE_INFO)
 
 
 
-FUNCTION(SET_FEATURE_INFO)
+function(SET_FEATURE_INFO)
   SET_PACKAGE_INFO(${ARGN})
-ENDFUNCTION(SET_FEATURE_INFO)
+endfunction(SET_FEATURE_INFO)
 
 
 
-FUNCTION(PRINT_ENABLED_FEATURES)
+function(PRINT_ENABLED_FEATURES)
   FEATURE_SUMMARY(WHAT ENABLED_FEATURES  DESCRIPTION "Enabled features:")
-ENDFUNCTION(PRINT_ENABLED_FEATURES)
+endfunction(PRINT_ENABLED_FEATURES)
 
 
 
-FUNCTION(PRINT_DISABLED_FEATURES)
+function(PRINT_DISABLED_FEATURES)
   FEATURE_SUMMARY(WHAT DISABLED_FEATURES  DESCRIPTION "Disabled features:")
-ENDFUNCTION(PRINT_DISABLED_FEATURES)
+endfunction(PRINT_DISABLED_FEATURES)
diff --git a/Modules/FindASPELL.cmake b/Modules/FindASPELL.cmake
index 713ab7e19..5b383c4d3 100644
--- a/Modules/FindASPELL.cmake
+++ b/Modules/FindASPELL.cmake
@@ -21,17 +21,17 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PATH(ASPELL_INCLUDE_DIR aspell.h )
+find_path(ASPELL_INCLUDE_DIR aspell.h )
 
-FIND_PROGRAM(ASPELL_EXECUTABLE
+find_program(ASPELL_EXECUTABLE
   NAMES aspell
 )
 
-FIND_LIBRARY(ASPELL_LIBRARIES NAMES aspell aspell-15 libaspell-15 libaspell)
+find_library(ASPELL_LIBRARIES NAMES aspell aspell-15 libaspell-15 libaspell)
 
 # handle the QUIETLY and REQUIRED arguments and set ASPELL_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(ASPELL DEFAULT_MSG ASPELL_LIBRARIES ASPELL_INCLUDE_DIR ASPELL_EXECUTABLE)
 
-MARK_AS_ADVANCED(ASPELL_INCLUDE_DIR ASPELL_LIBRARIES ASPELL_EXECUTABLE)
+mark_as_advanced(ASPELL_INCLUDE_DIR ASPELL_LIBRARIES ASPELL_EXECUTABLE)
diff --git a/Modules/FindAVIFile.cmake b/Modules/FindAVIFile.cmake
index a45ebf8b9..ce4e1e726 100644
--- a/Modules/FindAVIFile.cmake
+++ b/Modules/FindAVIFile.cmake
@@ -22,27 +22,27 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-IF (UNIX)
+if (UNIX)
 
-  FIND_PATH(AVIFILE_INCLUDE_DIR avifile.h
+  find_path(AVIFILE_INCLUDE_DIR avifile.h
     /usr/local/avifile/include
     /usr/local/include/avifile
   )
 
-  FIND_LIBRARY(AVIFILE_AVIPLAY_LIBRARY aviplay
+  find_library(AVIFILE_AVIPLAY_LIBRARY aviplay
     /usr/local/avifile/lib
   )
 
-ENDIF (UNIX)
+endif (UNIX)
 
 # handle the QUIETLY and REQUIRED arguments and set AVIFILE_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(AVIFile DEFAULT_MSG AVIFILE_INCLUDE_DIR AVIFILE_AVIPLAY_LIBRARY)
 
-IF (AVIFILE_FOUND)
-    SET(AVIFILE_LIBRARIES ${AVIFILE_AVIPLAY_LIBRARY})
-    SET(AVIFILE_DEFINITIONS "")
-ENDIF()
+if (AVIFILE_FOUND)
+    set(AVIFILE_LIBRARIES ${AVIFILE_AVIPLAY_LIBRARY})
+    set(AVIFILE_DEFINITIONS "")
+endif()
 
-MARK_AS_ADVANCED(AVIFILE_INCLUDE_DIR AVIFILE_AVIPLAY_LIBRARY)
+mark_as_advanced(AVIFILE_INCLUDE_DIR AVIFILE_AVIPLAY_LIBRARY)
diff --git a/Modules/FindBISON.cmake b/Modules/FindBISON.cmake
index 7af336788..d0e0a222f 100644
--- a/Modules/FindBISON.cmake
+++ b/Modules/FindBISON.cmake
@@ -47,46 +47,46 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PROGRAM(BISON_EXECUTABLE bison DOC "path to the bison executable")
-MARK_AS_ADVANCED(BISON_EXECUTABLE)
+find_program(BISON_EXECUTABLE bison DOC "path to the bison executable")
+mark_as_advanced(BISON_EXECUTABLE)
 
-IF(BISON_EXECUTABLE)
+if(BISON_EXECUTABLE)
   # the bison commands should be executed with the C locale, otherwise
   # the message (which are parsed) may be translated
-  SET(_Bison_SAVED_LC_ALL "$ENV{LC_ALL}")
-  SET(ENV{LC_ALL} C)
+  set(_Bison_SAVED_LC_ALL "$ENV{LC_ALL}")
+  set(ENV{LC_ALL} C)
 
-  EXECUTE_PROCESS(COMMAND ${BISON_EXECUTABLE} --version
+  execute_process(COMMAND ${BISON_EXECUTABLE} --version
     OUTPUT_VARIABLE BISON_version_output
     ERROR_VARIABLE BISON_version_error
     RESULT_VARIABLE BISON_version_result
     OUTPUT_STRIP_TRAILING_WHITESPACE)
 
-  SET(ENV{LC_ALL} ${_Bison_SAVED_LC_ALL})
+  set(ENV{LC_ALL} ${_Bison_SAVED_LC_ALL})
 
-  IF(NOT ${BISON_version_result} EQUAL 0)
-    MESSAGE(SEND_ERROR "Command \"${BISON_EXECUTABLE} --version\" failed with output:\n${BISON_version_error}")
-  ELSE()
+  if(NOT ${BISON_version_result} EQUAL 0)
+    message(SEND_ERROR "Command \"${BISON_EXECUTABLE} --version\" failed with output:\n${BISON_version_error}")
+  else()
     # Bison++
-    IF("${BISON_version_output}" MATCHES "^bison\\+\\+")
-      STRING(REGEX REPLACE "^bison\\+\\+ Version ([^,]+).*" "\\1"
+    if("${BISON_version_output}" MATCHES "^bison\\+\\+")
+      string(REGEX REPLACE "^bison\\+\\+ Version ([^,]+).*" "\\1"
         BISON_VERSION "${BISON_version_output}")
     # GNU Bison
-    ELSEIF("${BISON_version_output}" MATCHES "^bison[^+]")
-      STRING(REGEX REPLACE "^bison \\(GNU Bison\\) ([^\n]+)\n.*" "\\1"
+    elseif("${BISON_version_output}" MATCHES "^bison[^+]")
+      string(REGEX REPLACE "^bison \\(GNU Bison\\) ([^\n]+)\n.*" "\\1"
         BISON_VERSION "${BISON_version_output}")
-    ELSEIF("${BISON_version_output}" MATCHES "^GNU Bison ")
-      STRING(REGEX REPLACE "^GNU Bison (version )?([^\n]+).*" "\\2"
+    elseif("${BISON_version_output}" MATCHES "^GNU Bison ")
+      string(REGEX REPLACE "^GNU Bison (version )?([^\n]+).*" "\\2"
         BISON_VERSION "${BISON_version_output}")
-    ENDIF()
-  ENDIF()
+    endif()
+  endif()
 
   # internal macro
-  MACRO(BISON_TARGET_option_verbose Name BisonOutput filename)
-    LIST(APPEND BISON_TARGET_cmdopt "--verbose")
-    GET_FILENAME_COMPONENT(BISON_TARGET_output_path "${BisonOutput}" PATH)
-    GET_FILENAME_COMPONENT(BISON_TARGET_output_name "${BisonOutput}" NAME_WE)
-    ADD_CUSTOM_COMMAND(OUTPUT ${filename}
+  macro(BISON_TARGET_option_verbose Name BisonOutput filename)
+    list(APPEND BISON_TARGET_cmdopt "--verbose")
+    get_filename_component(BISON_TARGET_output_path "${BisonOutput}" PATH)
+    get_filename_component(BISON_TARGET_output_name "${BisonOutput}" NAME_WE)
+    add_custom_command(OUTPUT ${filename}
       COMMAND ${CMAKE_COMMAND}
       ARGS -E copy
       "${BISON_TARGET_output_path}/${BISON_TARGET_output_name}.output"
@@ -95,58 +95,58 @@ IF(BISON_EXECUTABLE)
       "${BISON_TARGET_output_path}/${BISON_TARGET_output_name}.output"
       COMMENT "[BISON][${Name}] Copying bison verbose table to ${filename}"
       WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
-    SET(BISON_${Name}_VERBOSE_FILE ${filename})
-    LIST(APPEND BISON_TARGET_extraoutputs
+    set(BISON_${Name}_VERBOSE_FILE ${filename})
+    list(APPEND BISON_TARGET_extraoutputs
       "${BISON_TARGET_output_path}/${BISON_TARGET_output_name}.output")
-  ENDMACRO(BISON_TARGET_option_verbose)
+  endmacro(BISON_TARGET_option_verbose)
 
   # internal macro
-  MACRO(BISON_TARGET_option_extraopts Options)
-    SET(BISON_TARGET_extraopts "${Options}")
-    SEPARATE_ARGUMENTS(BISON_TARGET_extraopts)
-    LIST(APPEND BISON_TARGET_cmdopt ${BISON_TARGET_extraopts})
-  ENDMACRO(BISON_TARGET_option_extraopts)
+  macro(BISON_TARGET_option_extraopts Options)
+    set(BISON_TARGET_extraopts "${Options}")
+    separate_arguments(BISON_TARGET_extraopts)
+    list(APPEND BISON_TARGET_cmdopt ${BISON_TARGET_extraopts})
+  endmacro(BISON_TARGET_option_extraopts)
 
   #============================================================
   # BISON_TARGET (public macro)
   #============================================================
   #
-  MACRO(BISON_TARGET Name BisonInput BisonOutput)
-    SET(BISON_TARGET_output_header "")
-    SET(BISON_TARGET_cmdopt "")
-    SET(BISON_TARGET_outputs "${BisonOutput}")
-    IF(NOT ${ARGC} EQUAL 3 AND NOT ${ARGC} EQUAL 5 AND NOT ${ARGC} EQUAL 7)
-      MESSAGE(SEND_ERROR "Usage")
-    ELSE()
+  macro(BISON_TARGET Name BisonInput BisonOutput)
+    set(BISON_TARGET_output_header "")
+    set(BISON_TARGET_cmdopt "")
+    set(BISON_TARGET_outputs "${BisonOutput}")
+    if(NOT ${ARGC} EQUAL 3 AND NOT ${ARGC} EQUAL 5 AND NOT ${ARGC} EQUAL 7)
+      message(SEND_ERROR "Usage")
+    else()
       # Parsing parameters
-      IF(${ARGC} GREATER 5 OR ${ARGC} EQUAL 5)
-        IF("${ARGV3}" STREQUAL "VERBOSE")
+      if(${ARGC} GREATER 5 OR ${ARGC} EQUAL 5)
+        if("${ARGV3}" STREQUAL "VERBOSE")
           BISON_TARGET_option_verbose(${Name} ${BisonOutput} "${ARGV4}")
-        ENDIF()
-        IF("${ARGV3}" STREQUAL "COMPILE_FLAGS")
+        endif()
+        if("${ARGV3}" STREQUAL "COMPILE_FLAGS")
           BISON_TARGET_option_extraopts("${ARGV4}")
-        ENDIF()
-      ENDIF()
+        endif()
+      endif()
 
-      IF(${ARGC} EQUAL 7)
-        IF("${ARGV5}" STREQUAL "VERBOSE")
+      if(${ARGC} EQUAL 7)
+        if("${ARGV5}" STREQUAL "VERBOSE")
           BISON_TARGET_option_verbose(${Name} ${BisonOutput} "${ARGV6}")
-        ENDIF()
+        endif()
 
-        IF("${ARGV5}" STREQUAL "COMPILE_FLAGS")
+        if("${ARGV5}" STREQUAL "COMPILE_FLAGS")
           BISON_TARGET_option_extraopts("${ARGV6}")
-        ENDIF()
-      ENDIF()
+        endif()
+      endif()
 
       # Header's name generated by bison (see option -d)
-      LIST(APPEND BISON_TARGET_cmdopt "-d")
-      STRING(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\2" _fileext "${ARGV2}")
-      STRING(REPLACE "c" "h" _fileext ${_fileext})
-      STRING(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\1${_fileext}"
+      list(APPEND BISON_TARGET_cmdopt "-d")
+      string(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\2" _fileext "${ARGV2}")
+      string(REPLACE "c" "h" _fileext ${_fileext})
+      string(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\1${_fileext}"
           BISON_${Name}_OUTPUT_HEADER "${ARGV2}")
-      LIST(APPEND BISON_TARGET_outputs "${BISON_${Name}_OUTPUT_HEADER}")
+      list(APPEND BISON_TARGET_outputs "${BISON_${Name}_OUTPUT_HEADER}")
 
-      ADD_CUSTOM_COMMAND(OUTPUT ${BISON_TARGET_outputs}
+      add_custom_command(OUTPUT ${BISON_TARGET_outputs}
         ${BISON_TARGET_extraoutputs}
         COMMAND ${BISON_EXECUTABLE}
         ARGS ${BISON_TARGET_cmdopt} -o ${ARGV2} ${ARGV1}
@@ -155,20 +155,20 @@ IF(BISON_EXECUTABLE)
         WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
 
       # define target variables
-      SET(BISON_${Name}_DEFINED TRUE)
-      SET(BISON_${Name}_INPUT ${ARGV1})
-      SET(BISON_${Name}_OUTPUTS ${BISON_TARGET_outputs})
-      SET(BISON_${Name}_COMPILE_FLAGS ${BISON_TARGET_cmdopt})
-      SET(BISON_${Name}_OUTPUT_SOURCE "${BisonOutput}")
+      set(BISON_${Name}_DEFINED TRUE)
+      set(BISON_${Name}_INPUT ${ARGV1})
+      set(BISON_${Name}_OUTPUTS ${BISON_TARGET_outputs})
+      set(BISON_${Name}_COMPILE_FLAGS ${BISON_TARGET_cmdopt})
+      set(BISON_${Name}_OUTPUT_SOURCE "${BisonOutput}")
 
-    ENDIF(NOT ${ARGC} EQUAL 3 AND NOT ${ARGC} EQUAL 5 AND NOT ${ARGC} EQUAL 7)
-  ENDMACRO(BISON_TARGET)
+    endif(NOT ${ARGC} EQUAL 3 AND NOT ${ARGC} EQUAL 5 AND NOT ${ARGC} EQUAL 7)
+  endmacro(BISON_TARGET)
   #
   #============================================================
 
-ENDIF(BISON_EXECUTABLE)
+endif(BISON_EXECUTABLE)
 
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON REQUIRED_VARS  BISON_EXECUTABLE
                                         VERSION_VAR BISON_VERSION)
 
diff --git a/Modules/FindBZip2.cmake b/Modules/FindBZip2.cmake
index 75ab50004..121d3f089 100644
--- a/Modules/FindBZip2.cmake
+++ b/Modules/FindBZip2.cmake
@@ -22,35 +22,35 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-SET(_BZIP2_PATHS PATHS
+set(_BZIP2_PATHS PATHS
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Bzip2;InstallPath]"
   )
 
-FIND_PATH(BZIP2_INCLUDE_DIR bzlib.h ${_BZIP2_PATHS} PATH_SUFFIXES include)
+find_path(BZIP2_INCLUDE_DIR bzlib.h ${_BZIP2_PATHS} PATH_SUFFIXES include)
 
-IF (NOT BZIP2_LIBRARIES)
-    FIND_LIBRARY(BZIP2_LIBRARY_RELEASE NAMES bz2 bzip2 ${_BZIP2_PATHS} PATH_SUFFIXES lib)
-    FIND_LIBRARY(BZIP2_LIBRARY_DEBUG NAMES bzip2d ${_BZIP2_PATHS} PATH_SUFFIXES lib)
+if (NOT BZIP2_LIBRARIES)
+    find_library(BZIP2_LIBRARY_RELEASE NAMES bz2 bzip2 ${_BZIP2_PATHS} PATH_SUFFIXES lib)
+    find_library(BZIP2_LIBRARY_DEBUG NAMES bzip2d ${_BZIP2_PATHS} PATH_SUFFIXES lib)
 
-    INCLUDE(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
+    include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
     SELECT_LIBRARY_CONFIGURATIONS(BZIP2)
-ENDIF (NOT BZIP2_LIBRARIES)
+endif (NOT BZIP2_LIBRARIES)
 
-IF (BZIP2_INCLUDE_DIR AND EXISTS "${BZIP2_INCLUDE_DIR}/bzlib.h")
-    FILE(STRINGS "${BZIP2_INCLUDE_DIR}/bzlib.h" BZLIB_H REGEX "bzip2/libbzip2 version [0-9]+\\.[^ ]+ of [0-9]+ ")
-    STRING(REGEX REPLACE ".* bzip2/libbzip2 version ([0-9]+\\.[^ ]+) of [0-9]+ .*" "\\1" BZIP2_VERSION_STRING "${BZLIB_H}")
-ENDIF (BZIP2_INCLUDE_DIR AND EXISTS "${BZIP2_INCLUDE_DIR}/bzlib.h")
+if (BZIP2_INCLUDE_DIR AND EXISTS "${BZIP2_INCLUDE_DIR}/bzlib.h")
+    file(STRINGS "${BZIP2_INCLUDE_DIR}/bzlib.h" BZLIB_H REGEX "bzip2/libbzip2 version [0-9]+\\.[^ ]+ of [0-9]+ ")
+    string(REGEX REPLACE ".* bzip2/libbzip2 version ([0-9]+\\.[^ ]+) of [0-9]+ .*" "\\1" BZIP2_VERSION_STRING "${BZLIB_H}")
+endif (BZIP2_INCLUDE_DIR AND EXISTS "${BZIP2_INCLUDE_DIR}/bzlib.h")
 
 # handle the QUIETLY and REQUIRED arguments and set BZip2_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(BZip2
                                   REQUIRED_VARS BZIP2_LIBRARIES BZIP2_INCLUDE_DIR
                                   VERSION_VAR BZIP2_VERSION_STRING)
 
-IF (BZIP2_FOUND)
-   INCLUDE(CheckLibraryExists)
+if (BZIP2_FOUND)
+   include(CheckLibraryExists)
    CHECK_LIBRARY_EXISTS("${BZIP2_LIBRARIES}" BZ2_bzCompressInit "" BZIP2_NEED_PREFIX)
-ENDIF (BZIP2_FOUND)
+endif (BZIP2_FOUND)
 
-MARK_AS_ADVANCED(BZIP2_INCLUDE_DIR)
+mark_as_advanced(BZIP2_INCLUDE_DIR)
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index ad6b1598d..e536b6e4d 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -48,7 +48,7 @@
 #     libraries with a few exceptions (Boost.Python is one).
 #
 #     Please see the section below near Boost_LIB_DIAGNOSTIC_DEFINITIONS for
-#     more details.  Adding a TARGET_LINK_LIBRARIES() as shown in the example
+#     more details.  Adding a target_link_libraries() as shown in the example
 #     above appears to cause VS to link dynamically if Boost_USE_STATIC_LIBS
 #     gets set to OFF.  It is suggested you avoid automatic linking since it
 #     will make your application less portable.
diff --git a/Modules/FindCABLE.cmake b/Modules/FindCABLE.cmake
index 678fb07ca..72a8805ca 100644
--- a/Modules/FindCABLE.cmake
+++ b/Modules/FindCABLE.cmake
@@ -23,12 +23,12 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-IF(NOT CABLE)
-  FIND_PATH(CABLE_BUILD_DIR cableVersion.h)
-ENDIF(NOT CABLE)
+if(NOT CABLE)
+  find_path(CABLE_BUILD_DIR cableVersion.h)
+endif(NOT CABLE)
 
-IF(CABLE_BUILD_DIR)
-  LOAD_CACHE(${CABLE_BUILD_DIR}
+if(CABLE_BUILD_DIR)
+  load_cache(${CABLE_BUILD_DIR}
              EXCLUDE
                BUILD_SHARED_LIBS
                LIBRARY_OUTPUT_PATH
@@ -39,43 +39,43 @@ IF(CABLE_BUILD_DIR)
                CABLE_LIBRARY_PATH
                CABLE_EXECUTABLE_PATH)
 
-  IF(CABLE_LIBRARY_PATH)
-    FIND_LIBRARY(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS
+  if(CABLE_LIBRARY_PATH)
+    find_library(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS
                  ${CABLE_LIBRARY_PATH}
                  ${CABLE_LIBRARY_PATH}/*)
-  ELSE(CABLE_LIBRARY_PATH)
-    FIND_LIBRARY(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS
+  else(CABLE_LIBRARY_PATH)
+    find_library(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS
                  ${CABLE_BINARY_DIR}/CableTclFacility
                  ${CABLE_BINARY_DIR}/CableTclFacility/*)
-  ENDIF(CABLE_LIBRARY_PATH)
+  endif(CABLE_LIBRARY_PATH)
 
-  IF(CABLE_EXECUTABLE_PATH)
-    FIND_PROGRAM(CABLE NAMES cable PATHS
+  if(CABLE_EXECUTABLE_PATH)
+    find_program(CABLE NAMES cable PATHS
                  ${CABLE_EXECUTABLE_PATH}
                  ${CABLE_EXECUTABLE_PATH}/*)
-  ELSE(CABLE_EXECUTABLE_PATH)
-    FIND_PROGRAM(CABLE NAMES cable PATHS
+  else(CABLE_EXECUTABLE_PATH)
+    find_program(CABLE NAMES cable PATHS
                  ${CABLE_BINARY_DIR}/Executables
                  ${CABLE_BINARY_DIR}/Executables/*)
-  ENDIF(CABLE_EXECUTABLE_PATH)
+  endif(CABLE_EXECUTABLE_PATH)
 
-  FIND_PATH(CABLE_INCLUDE_DIR CableTclFacility/ctCalls.h
+  find_path(CABLE_INCLUDE_DIR CableTclFacility/ctCalls.h
             ${CABLE_SOURCE_DIR})
-ELSE(CABLE_BUILD_DIR)
+else(CABLE_BUILD_DIR)
   # Find the cable executable in the path.
-  FIND_PROGRAM(CABLE NAMES cable)
+  find_program(CABLE NAMES cable)
 
   # Get the path where the executable sits, but without the executable
   # name on it.
-  GET_FILENAME_COMPONENT(CABLE_ROOT_BIN ${CABLE} PATH)
+  get_filename_component(CABLE_ROOT_BIN ${CABLE} PATH)
 
   # Find the cable include directory in a path relative to the cable
   # executable.
-  FIND_PATH(CABLE_INCLUDE_DIR CableTclFacility/ctCalls.h
+  find_path(CABLE_INCLUDE_DIR CableTclFacility/ctCalls.h
             ${CABLE_ROOT_BIN}/../include/Cable)
 
   # Find the WrapTclFacility library in a path relative to the cable
   # executable.
-  FIND_LIBRARY(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS
+  find_library(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS
                ${CABLE_ROOT_BIN}/../lib/Cable)
-ENDIF(CABLE_BUILD_DIR)
+endif(CABLE_BUILD_DIR)
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 56a92c199..94e4500be 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -855,7 +855,7 @@ function(CUDA_COMPUTE_BUILD_PATH path build_path)
   file(TO_CMAKE_PATH "${path}" bpath)
   if (IS_ABSOLUTE "${bpath}")
     # Absolute paths are generally unnessary, especially if something like
-    # FILE(GLOB_RECURSE) is used to pick up the files.
+    # file(GLOB_RECURSE) is used to pick up the files.
     file(RELATIVE_PATH bpath "${CMAKE_CURRENT_SOURCE_DIR}" "${bpath}")
   endif()
 
diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake
index 5f2181a99..5c58b8437 100644
--- a/Modules/FindCURL.cmake
+++ b/Modules/FindCURL.cmake
@@ -21,39 +21,39 @@
 #  License text for the above reference.)
 
 # Look for the header file.
-FIND_PATH(CURL_INCLUDE_DIR NAMES curl/curl.h)
-MARK_AS_ADVANCED(CURL_INCLUDE_DIR)
+find_path(CURL_INCLUDE_DIR NAMES curl/curl.h)
+mark_as_advanced(CURL_INCLUDE_DIR)
 
 # Look for the library.
-FIND_LIBRARY(CURL_LIBRARY NAMES
+find_library(CURL_LIBRARY NAMES
     curl
   # Windows MSVC prebuilts:
     curllib
     libcurl_imp
     curllib_static
 )
-MARK_AS_ADVANCED(CURL_LIBRARY)
+mark_as_advanced(CURL_LIBRARY)
 
-IF(CURL_INCLUDE_DIR)
-  FOREACH(_curl_version_header curlver.h curl.h)
-    IF(EXISTS "${CURL_INCLUDE_DIR}/curl/${_curl_version_header}")
-      FILE(STRINGS "${CURL_INCLUDE_DIR}/curl/${_curl_version_header}" curl_version_str REGEX "^#define[\t ]+LIBCURL_VERSION[\t ]+\".*\"")
+if(CURL_INCLUDE_DIR)
+  foreach(_curl_version_header curlver.h curl.h)
+    if(EXISTS "${CURL_INCLUDE_DIR}/curl/${_curl_version_header}")
+      file(STRINGS "${CURL_INCLUDE_DIR}/curl/${_curl_version_header}" curl_version_str REGEX "^#define[\t ]+LIBCURL_VERSION[\t ]+\".*\"")
 
-      STRING(REGEX REPLACE "^#define[\t ]+LIBCURL_VERSION[\t ]+\"([^\"]*)\".*" "\\1" CURL_VERSION_STRING "${curl_version_str}")
-      UNSET(curl_version_str)
-      BREAK()
-    ENDIF()
-  ENDFOREACH(_curl_version_header)
-ENDIF()
+      string(REGEX REPLACE "^#define[\t ]+LIBCURL_VERSION[\t ]+\"([^\"]*)\".*" "\\1" CURL_VERSION_STRING "${curl_version_str}")
+      unset(curl_version_str)
+      break()
+    endif()
+  endforeach(_curl_version_header)
+endif()
 
 # handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL
                                   REQUIRED_VARS CURL_LIBRARY CURL_INCLUDE_DIR
                                   VERSION_VAR CURL_VERSION_STRING)
 
-IF(CURL_FOUND)
-  SET(CURL_LIBRARIES ${CURL_LIBRARY})
-  SET(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
-ENDIF(CURL_FOUND)
+if(CURL_FOUND)
+  set(CURL_LIBRARIES ${CURL_LIBRARY})
+  set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
+endif(CURL_FOUND)
diff --git a/Modules/FindCoin3D.cmake b/Modules/FindCoin3D.cmake
index 2b4c914f4..914d74b11 100644
--- a/Modules/FindCoin3D.cmake
+++ b/Modules/FindCoin3D.cmake
@@ -22,63 +22,63 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-IF (WIN32)
-  IF (CYGWIN)
+if (WIN32)
+  if (CYGWIN)
 
-    FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h)
-    FIND_LIBRARY(COIN3D_LIBRARIES Coin)
+    find_path(COIN3D_INCLUDE_DIRS Inventor/So.h)
+    find_library(COIN3D_LIBRARIES Coin)
 
-  ELSE (CYGWIN)
+  else (CYGWIN)
 
-    FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h
+    find_path(COIN3D_INCLUDE_DIRS Inventor/So.h
       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/include"
     )
 
-    FIND_LIBRARY(COIN3D_LIBRARY_DEBUG coin2d
+    find_library(COIN3D_LIBRARY_DEBUG coin2d
       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/lib"
     )
 
-    FIND_LIBRARY(COIN3D_LIBRARY_RELEASE coin2
+    find_library(COIN3D_LIBRARY_RELEASE coin2
       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/lib"
     )
 
-    IF (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
-      SET(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
+    if (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
+      set(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
                            debug ${COIN3D_LIBRARY_DEBUG})
-    ELSE (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
-      IF (COIN3D_LIBRARY_DEBUG)
-        SET (COIN3D_LIBRARIES ${COIN3D_LIBRARY_DEBUG})
-      ENDIF (COIN3D_LIBRARY_DEBUG)
-      IF (COIN3D_LIBRARY_RELEASE)
-        SET (COIN3D_LIBRARIES ${COIN3D_LIBRARY_RELEASE})
-      ENDIF (COIN3D_LIBRARY_RELEASE)
-    ENDIF (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
+    else (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
+      if (COIN3D_LIBRARY_DEBUG)
+        set (COIN3D_LIBRARIES ${COIN3D_LIBRARY_DEBUG})
+      endif (COIN3D_LIBRARY_DEBUG)
+      if (COIN3D_LIBRARY_RELEASE)
+        set (COIN3D_LIBRARIES ${COIN3D_LIBRARY_RELEASE})
+      endif (COIN3D_LIBRARY_RELEASE)
+    endif (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
 
-  ENDIF (CYGWIN)
+  endif (CYGWIN)
 
-ELSE (WIN32)
-  IF(APPLE)
-    FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h
+else (WIN32)
+  if(APPLE)
+    find_path(COIN3D_INCLUDE_DIRS Inventor/So.h
      /Library/Frameworks/Inventor.framework/Headers
     )
-    FIND_LIBRARY(COIN3D_LIBRARIES Coin
+    find_library(COIN3D_LIBRARIES Coin
       /Library/Frameworks/Inventor.framework/Libraries
     )
-    SET(COIN3D_LIBRARIES "-framework Coin3d" CACHE STRING "Coin3D library for OSX")
-  ELSE(APPLE)
+    set(COIN3D_LIBRARIES "-framework Coin3d" CACHE STRING "Coin3D library for OSX")
+  else(APPLE)
 
-    FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h)
-    FIND_LIBRARY(COIN3D_LIBRARIES Coin)
+    find_path(COIN3D_INCLUDE_DIRS Inventor/So.h)
+    find_library(COIN3D_LIBRARIES Coin)
 
-  ENDIF(APPLE)
+  endif(APPLE)
 
-ENDIF (WIN32)
+endif (WIN32)
 
 # handle the QUIETLY and REQUIRED arguments and set COIN3D_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Coin3D DEFAULT_MSG COIN3D_LIBRARIES COIN3D_INCLUDE_DIRS)
 
-MARK_AS_ADVANCED(COIN3D_INCLUDE_DIRS COIN3D_LIBRARIES )
+mark_as_advanced(COIN3D_INCLUDE_DIRS COIN3D_LIBRARIES )
 
 
diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake
index 0ea5166d2..de719921e 100644
--- a/Modules/FindCurses.cmake
+++ b/Modules/FindCurses.cmake
@@ -9,7 +9,7 @@
 #  CURSES_HAVE_NCURSES_CURSES_H - true if ncurses/curses.h is available
 #  CURSES_LIBRARY - set for backwards compatibility with 2.4 CMake
 #
-# Set CURSES_NEED_NCURSES to TRUE before the FIND_PACKAGE() command if NCurses
+# Set CURSES_NEED_NCURSES to TRUE before the find_package() command if NCurses
 # functionality is required.
 
 #=============================================================================
@@ -25,23 +25,23 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_LIBRARY(CURSES_CURSES_LIBRARY NAMES curses )
+find_library(CURSES_CURSES_LIBRARY NAMES curses )
 
-FIND_LIBRARY(CURSES_NCURSES_LIBRARY NAMES ncurses )
-SET(CURSES_USE_NCURSES FALSE)
+find_library(CURSES_NCURSES_LIBRARY NAMES ncurses )
+set(CURSES_USE_NCURSES FALSE)
 
-IF(CURSES_NCURSES_LIBRARY  AND NOT  CURSES_CURSES_LIBRARY)
-  SET(CURSES_USE_NCURSES TRUE)
-ENDIF(CURSES_NCURSES_LIBRARY  AND NOT  CURSES_CURSES_LIBRARY)
+if(CURSES_NCURSES_LIBRARY  AND NOT  CURSES_CURSES_LIBRARY)
+  set(CURSES_USE_NCURSES TRUE)
+endif(CURSES_NCURSES_LIBRARY  AND NOT  CURSES_CURSES_LIBRARY)
 # http://cygwin.com/ml/cygwin-announce/2010-01/msg00002.html
 # cygwin ncurses stopped providing curses.h symlinks see above
 # message.  Cygwin is an ncurses package, so force ncurses on
 # cygwin if the curses.h is missing
-IF(CYGWIN)
-  IF(NOT EXISTS /usr/include/curses.h)
-    SET(CURSES_USE_NCURSES TRUE)
-  ENDIF()
-ENDIF()
+if(CYGWIN)
+  if(NOT EXISTS /usr/include/curses.h)
+    set(CURSES_USE_NCURSES TRUE)
+  endif()
+endif()
 
 
 # Not sure the logic is correct here.
@@ -55,48 +55,48 @@ ENDIF()
 # So at first try ncurses.h, if not found, try to find curses.h under the same
 # prefix as the library was found, if still not found, try curses.h with the
 # default search paths.
-IF(CURSES_CURSES_LIBRARY  AND  CURSES_NEED_NCURSES)
-  INCLUDE(CheckLibraryExists)
+if(CURSES_CURSES_LIBRARY  AND  CURSES_NEED_NCURSES)
+  include(CheckLibraryExists)
   CHECK_LIBRARY_EXISTS("${CURSES_CURSES_LIBRARY}"
     wsyncup "" CURSES_CURSES_HAS_WSYNCUP)
 
-  IF(CURSES_NCURSES_LIBRARY  AND NOT  CURSES_CURSES_HAS_WSYNCUP)
+  if(CURSES_NCURSES_LIBRARY  AND NOT  CURSES_CURSES_HAS_WSYNCUP)
     CHECK_LIBRARY_EXISTS("${CURSES_NCURSES_LIBRARY}"
       wsyncup "" CURSES_NCURSES_HAS_WSYNCUP)
-    IF( CURSES_NCURSES_HAS_WSYNCUP)
-      SET(CURSES_USE_NCURSES TRUE)
-    ENDIF( CURSES_NCURSES_HAS_WSYNCUP)
-  ENDIF(CURSES_NCURSES_LIBRARY  AND NOT  CURSES_CURSES_HAS_WSYNCUP)
+    if( CURSES_NCURSES_HAS_WSYNCUP)
+      set(CURSES_USE_NCURSES TRUE)
+    endif( CURSES_NCURSES_HAS_WSYNCUP)
+  endif(CURSES_NCURSES_LIBRARY  AND NOT  CURSES_CURSES_HAS_WSYNCUP)
 
-ENDIF(CURSES_CURSES_LIBRARY  AND  CURSES_NEED_NCURSES)
+endif(CURSES_CURSES_LIBRARY  AND  CURSES_NEED_NCURSES)
 
 
-IF(NOT CURSES_USE_NCURSES)
-  FIND_FILE(CURSES_HAVE_CURSES_H curses.h )
-  FIND_PATH(CURSES_CURSES_H_PATH curses.h )
-  GET_FILENAME_COMPONENT(_cursesLibDir "${CURSES_CURSES_LIBRARY}" PATH)
-  GET_FILENAME_COMPONENT(_cursesParentDir "${_cursesLibDir}" PATH)
+if(NOT CURSES_USE_NCURSES)
+  find_file(CURSES_HAVE_CURSES_H curses.h )
+  find_path(CURSES_CURSES_H_PATH curses.h )
+  get_filename_component(_cursesLibDir "${CURSES_CURSES_LIBRARY}" PATH)
+  get_filename_component(_cursesParentDir "${_cursesLibDir}" PATH)
 
   # for compatibility with older FindCurses.cmake this has to be in the cache
   # FORCE must not be used since this would break builds which preload a cache wqith these variables set
-  SET(CURSES_INCLUDE_PATH "${CURSES_CURSES_H_PATH}"
+  set(CURSES_INCLUDE_PATH "${CURSES_CURSES_H_PATH}"
     CACHE FILEPATH "The curses include path")
-  SET(CURSES_LIBRARY "${CURSES_CURSES_LIBRARY}"
+  set(CURSES_LIBRARY "${CURSES_CURSES_LIBRARY}"
     CACHE FILEPATH "The curses library")
-ELSE(NOT CURSES_USE_NCURSES)
+else(NOT CURSES_USE_NCURSES)
 # we need to find ncurses
-  GET_FILENAME_COMPONENT(_cursesLibDir "${CURSES_NCURSES_LIBRARY}" PATH)
-  GET_FILENAME_COMPONENT(_cursesParentDir "${_cursesLibDir}" PATH)
+  get_filename_component(_cursesLibDir "${CURSES_NCURSES_LIBRARY}" PATH)
+  get_filename_component(_cursesParentDir "${_cursesLibDir}" PATH)
 
-  FIND_FILE(CURSES_HAVE_NCURSES_H         ncurses.h)
-  FIND_FILE(CURSES_HAVE_NCURSES_NCURSES_H ncurses/ncurses.h)
-  FIND_FILE(CURSES_HAVE_NCURSES_CURSES_H  ncurses/curses.h)
-  FIND_FILE(CURSES_HAVE_CURSES_H          curses.h
+  find_file(CURSES_HAVE_NCURSES_H         ncurses.h)
+  find_file(CURSES_HAVE_NCURSES_NCURSES_H ncurses/ncurses.h)
+  find_file(CURSES_HAVE_NCURSES_CURSES_H  ncurses/curses.h)
+  find_file(CURSES_HAVE_CURSES_H          curses.h
     HINTS "${_cursesParentDir}/include")
 
-  FIND_PATH(CURSES_NCURSES_INCLUDE_PATH ncurses.h ncurses/ncurses.h
+  find_path(CURSES_NCURSES_INCLUDE_PATH ncurses.h ncurses/ncurses.h
     ncurses/curses.h)
-  FIND_PATH(CURSES_NCURSES_INCLUDE_PATH curses.h
+  find_path(CURSES_NCURSES_INCLUDE_PATH curses.h
     HINTS "${_cursesParentDir}/include")
 
   # for compatibility with older FindCurses.cmake this has to be in the cache
@@ -106,60 +106,60 @@ ELSE(NOT CURSES_USE_NCURSES)
   # a cache wqith these variables set
   # only put ncurses include and library into
   # variables if they are found
-  IF(NOT CURSES_NCURSES_INCLUDE_PATH AND CURSES_HAVE_NCURSES_NCURSES_H)
-    GET_FILENAME_COMPONENT(CURSES_NCURSES_INCLUDE_PATH
+  if(NOT CURSES_NCURSES_INCLUDE_PATH AND CURSES_HAVE_NCURSES_NCURSES_H)
+    get_filename_component(CURSES_NCURSES_INCLUDE_PATH
       "${CURSES_HAVE_NCURSES_NCURSES_H}" PATH)
-  ENDIF(NOT CURSES_NCURSES_INCLUDE_PATH AND CURSES_HAVE_NCURSES_NCURSES_H)
-  IF(CURSES_NCURSES_INCLUDE_PATH AND CURSES_NCURSES_LIBRARY)
-    SET( FORCE_IT )
-    IF(CURSES_INCLUDE_PATH MATCHES NOTFOUND)
-      SET(FORCE_IT FORCE)
-    ENDIF(CURSES_INCLUDE_PATH MATCHES NOTFOUND)
-    SET(CURSES_INCLUDE_PATH "${CURSES_NCURSES_INCLUDE_PATH}"
+  endif(NOT CURSES_NCURSES_INCLUDE_PATH AND CURSES_HAVE_NCURSES_NCURSES_H)
+  if(CURSES_NCURSES_INCLUDE_PATH AND CURSES_NCURSES_LIBRARY)
+    set( FORCE_IT )
+    if(CURSES_INCLUDE_PATH MATCHES NOTFOUND)
+      set(FORCE_IT FORCE)
+    endif(CURSES_INCLUDE_PATH MATCHES NOTFOUND)
+    set(CURSES_INCLUDE_PATH "${CURSES_NCURSES_INCLUDE_PATH}"
       CACHE FILEPATH "The curses include path" ${FORCE_IT})
-    SET( FORCE_IT)
-    IF(CURSES_LIBRARY MATCHES NOTFOUND)
-      SET(FORCE_IT FORCE)
-    ENDIF(CURSES_LIBRARY MATCHES NOTFOUND)
-    SET(CURSES_LIBRARY "${CURSES_NCURSES_LIBRARY}"
+    set( FORCE_IT)
+    if(CURSES_LIBRARY MATCHES NOTFOUND)
+      set(FORCE_IT FORCE)
+    endif(CURSES_LIBRARY MATCHES NOTFOUND)
+    set(CURSES_LIBRARY "${CURSES_NCURSES_LIBRARY}"
       CACHE FILEPATH "The curses library" ${FORCE_IT})
-  ENDIF(CURSES_NCURSES_INCLUDE_PATH AND CURSES_NCURSES_LIBRARY)
+  endif(CURSES_NCURSES_INCLUDE_PATH AND CURSES_NCURSES_LIBRARY)
 
-ENDIF(NOT CURSES_USE_NCURSES)
+endif(NOT CURSES_USE_NCURSES)
 
-FIND_LIBRARY(CURSES_EXTRA_LIBRARY cur_colr HINTS "${_cursesLibDir}")
-FIND_LIBRARY(CURSES_EXTRA_LIBRARY cur_colr )
+find_library(CURSES_EXTRA_LIBRARY cur_colr HINTS "${_cursesLibDir}")
+find_library(CURSES_EXTRA_LIBRARY cur_colr )
 
-FIND_LIBRARY(CURSES_FORM_LIBRARY form HINTS "${_cursesLibDir}")
-FIND_LIBRARY(CURSES_FORM_LIBRARY form )
+find_library(CURSES_FORM_LIBRARY form HINTS "${_cursesLibDir}")
+find_library(CURSES_FORM_LIBRARY form )
 
 # for compatibility with older FindCurses.cmake this has to be in the cache
 # FORCE must not be used since this would break builds which preload a cache
 # qith these variables set
-SET(FORM_LIBRARY "${CURSES_FORM_LIBRARY}"
+set(FORM_LIBRARY "${CURSES_FORM_LIBRARY}"
   CACHE FILEPATH "The curses form library")
 
 # Need to provide the *_LIBRARIES
-SET(CURSES_LIBRARIES ${CURSES_LIBRARY})
+set(CURSES_LIBRARIES ${CURSES_LIBRARY})
 
-IF(CURSES_EXTRA_LIBRARY)
-  SET(CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_EXTRA_LIBRARY})
-ENDIF(CURSES_EXTRA_LIBRARY)
+if(CURSES_EXTRA_LIBRARY)
+  set(CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_EXTRA_LIBRARY})
+endif(CURSES_EXTRA_LIBRARY)
 
-IF(CURSES_FORM_LIBRARY)
-  SET(CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_FORM_LIBRARY})
-ENDIF(CURSES_FORM_LIBRARY)
+if(CURSES_FORM_LIBRARY)
+  set(CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_FORM_LIBRARY})
+endif(CURSES_FORM_LIBRARY)
 
 # Proper name is *_INCLUDE_DIR
-SET(CURSES_INCLUDE_DIR ${CURSES_INCLUDE_PATH})
+set(CURSES_INCLUDE_DIR ${CURSES_INCLUDE_PATH})
 
 # handle the QUIETLY and REQUIRED arguments and set CURSES_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Curses DEFAULT_MSG
   CURSES_LIBRARY CURSES_INCLUDE_PATH)
 
-MARK_AS_ADVANCED(
+mark_as_advanced(
   CURSES_INCLUDE_PATH
   CURSES_LIBRARY
   CURSES_CURSES_INCLUDE_PATH
diff --git a/Modules/FindCygwin.cmake b/Modules/FindCygwin.cmake
index 28f55ba0c..75e3342ba 100644
--- a/Modules/FindCygwin.cmake
+++ b/Modules/FindCygwin.cmake
@@ -14,15 +14,15 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-IF (WIN32)
-  FIND_PATH(CYGWIN_INSTALL_PATH
+if (WIN32)
+  find_path(CYGWIN_INSTALL_PATH
     cygwin.bat
     "C:/Cygwin"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Cygwin\\setup;rootdir]"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Cygnus Solutions\\Cygwin\\mounts v2\\/;native]"
   )
 
-  MARK_AS_ADVANCED(
+  mark_as_advanced(
     CYGWIN_INSTALL_PATH
   )
-ENDIF (WIN32)
+endif (WIN32)
diff --git a/Modules/FindDart.cmake b/Modules/FindDart.cmake
index caca4b868..13e19be7d 100644
--- a/Modules/FindDart.cmake
+++ b/Modules/FindDart.cmake
@@ -16,7 +16,7 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PATH(DART_ROOT README.INSTALL
+find_path(DART_ROOT README.INSTALL
     $ENV{DART_ROOT}
     ${PROJECT_SOURCE_DIR}/Dart
      /usr/share/Dart
@@ -30,7 +30,7 @@ FIND_PATH(DART_ROOT README.INSTALL
 
 # handle the QUIETLY and REQUIRED arguments and set DART_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Dart DEFAULT_MSG DART_ROOT)
 
-MARK_AS_ADVANCED(DART_ROOT)
+mark_as_advanced(DART_ROOT)
diff --git a/Modules/FindDevIL.cmake b/Modules/FindDevIL.cmake
index ebfe29898..dacc60422 100644
--- a/Modules/FindDevIL.cmake
+++ b/Modules/FindDevIL.cmake
@@ -36,38 +36,38 @@
 # TODO: Add version support.
 # Tested under Linux and Windows (MSVC)
 
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 
-FIND_PATH(IL_INCLUDE_DIR il.h
+find_path(IL_INCLUDE_DIR il.h
   PATH_SUFFIXES include IL
   DOC "The path the the directory that contains il.h"
 )
 
-#MESSAGE("IL_INCLUDE_DIR is ${IL_INCLUDE_DIR}")
+#message("IL_INCLUDE_DIR is ${IL_INCLUDE_DIR}")
 
-FIND_LIBRARY(IL_LIBRARIES
+find_library(IL_LIBRARIES
   NAMES IL DEVIL
   PATH_SUFFIXES lib64 lib lib32
   DOC "The file that corresponds to the base il library."
 )
 
-#MESSAGE("IL_LIBRARIES is ${IL_LIBRARIES}")
+#message("IL_LIBRARIES is ${IL_LIBRARIES}")
 
-FIND_LIBRARY(ILUT_LIBRARIES
+find_library(ILUT_LIBRARIES
   NAMES ILUT
   PATH_SUFFIXES lib64 lib lib32
   DOC "The file that corresponds to the il (system?) utility library."
 )
 
-#MESSAGE("ILUT_LIBRARIES is ${ILUT_LIBRARIES}")
+#message("ILUT_LIBRARIES is ${ILUT_LIBRARIES}")
 
-FIND_LIBRARY(ILU_LIBRARIES
+find_library(ILU_LIBRARIES
   NAMES ILU
   PATH_SUFFIXES lib64 lib lib32
   DOC "The file that corresponds to the il utility library."
 )
 
-#MESSAGE("ILU_LIBRARIES is ${ILU_LIBRARIES}")
+#message("ILU_LIBRARIES is ${ILU_LIBRARIES}")
 
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(IL DEFAULT_MSG
                                   IL_LIBRARIES ILU_LIBRARIES
diff --git a/Modules/FindDoxygen.cmake b/Modules/FindDoxygen.cmake
index a004d7b65..d63044f42 100644
--- a/Modules/FindDoxygen.cmake
+++ b/Modules/FindDoxygen.cmake
@@ -33,9 +33,9 @@
 #  License text for the above reference.)
 
 # For backwards compatibility support
-IF(Doxygen_FIND_QUIETLY)
-  SET(DOXYGEN_FIND_QUIETLY TRUE)
-ENDIF(Doxygen_FIND_QUIETLY)
+if(Doxygen_FIND_QUIETLY)
+  set(DOXYGEN_FIND_QUIETLY TRUE)
+endif(Doxygen_FIND_QUIETLY)
 
 # ===== Rationale for OS X AppBundle mods below =====
 #     With the OS X GUI version, Doxygen likes to be installed to /Applications and
@@ -54,9 +54,9 @@ ENDIF(Doxygen_FIND_QUIETLY)
 #     the app-bundle feature, just for this CMake module:
 if(APPLE)
     #  Save the old setting
-    SET(TEMP_DOXYGEN_SAVE_CMAKE_FIND_APPBUNDLE ${CMAKE_FIND_APPBUNDLE})
+    set(TEMP_DOXYGEN_SAVE_CMAKE_FIND_APPBUNDLE ${CMAKE_FIND_APPBUNDLE})
     # Disable the App-bundle detection feature
-    SET(CMAKE_FIND_APPBUNDLE "NEVER")
+    set(CMAKE_FIND_APPBUNDLE "NEVER")
 endif()
 #     FYI:
 #     In the older versions of OS X Doxygen, dot was included with the
@@ -68,7 +68,7 @@ endif()
 # Find Doxygen...
 #
 
-FIND_PROGRAM(DOXYGEN_EXECUTABLE
+find_program(DOXYGEN_EXECUTABLE
   NAMES doxygen
   PATHS
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\doxygen_is1;Inno Setup: App Path]/bin"
@@ -77,9 +77,9 @@ FIND_PROGRAM(DOXYGEN_EXECUTABLE
   DOC "Doxygen documentation generation tool (http://www.doxygen.org)"
 )
 
-IF(DOXYGEN_EXECUTABLE)
-  EXECUTE_PROCESS(COMMAND ${DOXYGEN_EXECUTABLE} "--version" OUTPUT_VARIABLE DOXYGEN_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
-ENDIF()
+if(DOXYGEN_EXECUTABLE)
+  execute_process(COMMAND ${DOXYGEN_EXECUTABLE} "--version" OUTPUT_VARIABLE DOXYGEN_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+endif()
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Doxygen REQUIRED_VARS DOXYGEN_EXECUTABLE VERSION_VAR DOXYGEN_VERSION)
@@ -88,8 +88,8 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Doxygen REQUIRED_VARS DOXYGEN_EXECUTABLE VERSI
 # Find Dot...
 #
 
-IF(NOT DOXYGEN_SKIP_DOT)
-  FIND_PROGRAM(DOXYGEN_DOT_EXECUTABLE
+if(NOT DOXYGEN_SKIP_DOT)
+  find_program(DOXYGEN_DOT_EXECUTABLE
     NAMES dot
     PATHS
       "$ENV{ProgramFiles}/Graphviz 2.21/bin"
@@ -117,7 +117,7 @@ endif(NOT DOXYGEN_SKIP_DOT)
 
 if(APPLE)
   # Restore the old app-bundle setting setting
-  SET(CMAKE_FIND_APPBUNDLE ${TEMP_DOXYGEN_SAVE_CMAKE_FIND_APPBUNDLE})
+  set(CMAKE_FIND_APPBUNDLE ${TEMP_DOXYGEN_SAVE_CMAKE_FIND_APPBUNDLE})
 endif()
 
 # Maintain the _FOUND variables as "YES" or "NO" for backwards compatibility
@@ -134,10 +134,10 @@ else()
 endif()
 
 # For backwards compatibility support
-SET (DOXYGEN ${DOXYGEN_EXECUTABLE} )
-SET (DOT ${DOXYGEN_DOT_EXECUTABLE} )
+set (DOXYGEN ${DOXYGEN_EXECUTABLE} )
+set (DOT ${DOXYGEN_DOT_EXECUTABLE} )
 
-MARK_AS_ADVANCED(
+mark_as_advanced(
   DOXYGEN_EXECUTABLE
   DOXYGEN_DOT_EXECUTABLE
   DOXYGEN_DOT_PATH
diff --git a/Modules/FindEXPAT.cmake b/Modules/FindEXPAT.cmake
index 7a6dbbbd9..e8523a059 100644
--- a/Modules/FindEXPAT.cmake
+++ b/Modules/FindEXPAT.cmake
@@ -19,10 +19,10 @@
 #  License text for the above reference.)
 
 # Look for the header file.
-FIND_PATH(EXPAT_INCLUDE_DIR NAMES expat.h)
+find_path(EXPAT_INCLUDE_DIR NAMES expat.h)
 
 # Look for the library.
-FIND_LIBRARY(EXPAT_LIBRARY NAMES expat libexpat)
+find_library(EXPAT_LIBRARY NAMES expat libexpat)
 
 if (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h")
     file(STRINGS "${EXPAT_INCLUDE_DIR}/expat.h" expat_version_str
@@ -46,15 +46,15 @@ endif (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h")
 
 # handle the QUIETLY and REQUIRED arguments and set EXPAT_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(EXPAT
                                   REQUIRED_VARS EXPAT_LIBRARY EXPAT_INCLUDE_DIR
                                   VERSION_VAR EXPAT_VERSION_STRING)
 
 # Copy the results to the output variables.
-IF(EXPAT_FOUND)
-  SET(EXPAT_LIBRARIES ${EXPAT_LIBRARY})
-  SET(EXPAT_INCLUDE_DIRS ${EXPAT_INCLUDE_DIR})
-ENDIF(EXPAT_FOUND)
+if(EXPAT_FOUND)
+  set(EXPAT_LIBRARIES ${EXPAT_LIBRARY})
+  set(EXPAT_INCLUDE_DIRS ${EXPAT_INCLUDE_DIR})
+endif(EXPAT_FOUND)
 
-MARK_AS_ADVANCED(EXPAT_INCLUDE_DIR EXPAT_LIBRARY)
+mark_as_advanced(EXPAT_INCLUDE_DIR EXPAT_LIBRARY)
diff --git a/Modules/FindFLEX.cmake b/Modules/FindFLEX.cmake
index 586f77a6e..64c1d535a 100644
--- a/Modules/FindFLEX.cmake
+++ b/Modules/FindFLEX.cmake
@@ -8,7 +8,7 @@
 #  FLEX_INCLUDE_DIRS - The path to the flex headers
 #
 # The minimum required version of flex can be specified using the
-# standard syntax, e.g. FIND_PACKAGE(FLEX 2.5.13)
+# standard syntax, e.g. find_package(FLEX 2.5.13)
 #
 #
 # If flex is found on the system, the module provides the macro:
@@ -63,73 +63,73 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PROGRAM(FLEX_EXECUTABLE flex DOC "path to the flex executable")
-MARK_AS_ADVANCED(FLEX_EXECUTABLE)
+find_program(FLEX_EXECUTABLE flex DOC "path to the flex executable")
+mark_as_advanced(FLEX_EXECUTABLE)
 
-FIND_LIBRARY(FL_LIBRARY NAMES fl
+find_library(FL_LIBRARY NAMES fl
   DOC "Path to the fl library")
 
-FIND_PATH(FLEX_INCLUDE_DIR FlexLexer.h
+find_path(FLEX_INCLUDE_DIR FlexLexer.h
   DOC "Path to the flex headers")
 
-MARK_AS_ADVANCED(FL_LIBRARY FLEX_INCLUDE_DIR)
+mark_as_advanced(FL_LIBRARY FLEX_INCLUDE_DIR)
 
-SET(FLEX_INCLUDE_DIRS ${FLEX_INCLUDE_DIR})
-SET(FLEX_LIBRARIES ${FL_LIBRARY})
+set(FLEX_INCLUDE_DIRS ${FLEX_INCLUDE_DIR})
+set(FLEX_LIBRARIES ${FL_LIBRARY})
 
-IF(FLEX_EXECUTABLE)
+if(FLEX_EXECUTABLE)
 
-  EXECUTE_PROCESS(COMMAND ${FLEX_EXECUTABLE} --version
+  execute_process(COMMAND ${FLEX_EXECUTABLE} --version
     OUTPUT_VARIABLE FLEX_version_output
     ERROR_VARIABLE FLEX_version_error
     RESULT_VARIABLE FLEX_version_result
     OUTPUT_STRIP_TRAILING_WHITESPACE)
-  IF(NOT ${FLEX_version_result} EQUAL 0)
-    IF(FLEX_FIND_REQUIRED)
-      MESSAGE(SEND_ERROR "Command \"${FLEX_EXECUTABLE} --version\" failed with output:\n${FLEX_version_output}\n${FLEX_version_error}")
-    ELSE()
-      MESSAGE("Command \"${FLEX_EXECUTABLE} --version\" failed with output:\n${FLEX_version_output}\n${FLEX_version_error}\nFLEX_VERSION will not be available")
-    ENDIF()
-  ELSE()
+  if(NOT ${FLEX_version_result} EQUAL 0)
+    if(FLEX_FIND_REQUIRED)
+      message(SEND_ERROR "Command \"${FLEX_EXECUTABLE} --version\" failed with output:\n${FLEX_version_output}\n${FLEX_version_error}")
+    else()
+      message("Command \"${FLEX_EXECUTABLE} --version\" failed with output:\n${FLEX_version_output}\n${FLEX_version_error}\nFLEX_VERSION will not be available")
+    endif()
+  else()
     # older versions of flex printed "/full/path/to/executable version X.Y"
     # newer versions use "basename(executable) X.Y"
-    GET_FILENAME_COMPONENT(FLEX_EXE_NAME "${FLEX_EXECUTABLE}" NAME)
-    STRING(REGEX REPLACE "^.*${FLEX_EXE_NAME}\"? (version )?([0-9]+[^ ]*)$" "\\2"
+    get_filename_component(FLEX_EXE_NAME "${FLEX_EXECUTABLE}" NAME)
+    string(REGEX REPLACE "^.*${FLEX_EXE_NAME}\"? (version )?([0-9]+[^ ]*)$" "\\2"
       FLEX_VERSION "${FLEX_version_output}")
-    UNSET(FLEX_EXE_NAME)
-  ENDIF()
+    unset(FLEX_EXE_NAME)
+  endif()
 
   #============================================================
   # FLEX_TARGET (public macro)
   #============================================================
   #
-  MACRO(FLEX_TARGET Name Input Output)
-    SET(FLEX_TARGET_usage "FLEX_TARGET(<Name> <Input> <Output> [COMPILE_FLAGS <string>]")
-    IF(${ARGC} GREATER 3)
-      IF(${ARGC} EQUAL 5)
-        IF("${ARGV3}" STREQUAL "COMPILE_FLAGS")
-          SET(FLEX_EXECUTABLE_opts  "${ARGV4}")
-          SEPARATE_ARGUMENTS(FLEX_EXECUTABLE_opts)
-        ELSE()
-          MESSAGE(SEND_ERROR ${FLEX_TARGET_usage})
-        ENDIF()
-      ELSE()
-        MESSAGE(SEND_ERROR ${FLEX_TARGET_usage})
-      ENDIF()
-    ENDIF()
+  macro(FLEX_TARGET Name Input Output)
+    set(FLEX_TARGET_usage "FLEX_TARGET(<Name> <Input> <Output> [COMPILE_FLAGS <string>]")
+    if(${ARGC} GREATER 3)
+      if(${ARGC} EQUAL 5)
+        if("${ARGV3}" STREQUAL "COMPILE_FLAGS")
+          set(FLEX_EXECUTABLE_opts  "${ARGV4}")
+          separate_arguments(FLEX_EXECUTABLE_opts)
+        else()
+          message(SEND_ERROR ${FLEX_TARGET_usage})
+        endif()
+      else()
+        message(SEND_ERROR ${FLEX_TARGET_usage})
+      endif()
+    endif()
 
-    ADD_CUSTOM_COMMAND(OUTPUT ${Output}
+    add_custom_command(OUTPUT ${Output}
       COMMAND ${FLEX_EXECUTABLE}
       ARGS ${FLEX_EXECUTABLE_opts} -o${Output} ${Input}
       DEPENDS ${Input}
       COMMENT "[FLEX][${Name}] Building scanner with flex ${FLEX_VERSION}"
       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
 
-    SET(FLEX_${Name}_DEFINED TRUE)
-    SET(FLEX_${Name}_OUTPUTS ${Output})
-    SET(FLEX_${Name}_INPUT ${Input})
-    SET(FLEX_${Name}_COMPILE_FLAGS ${FLEX_EXECUTABLE_opts})
-  ENDMACRO(FLEX_TARGET)
+    set(FLEX_${Name}_DEFINED TRUE)
+    set(FLEX_${Name}_OUTPUTS ${Output})
+    set(FLEX_${Name}_INPUT ${Input})
+    set(FLEX_${Name}_COMPILE_FLAGS ${FLEX_EXECUTABLE_opts})
+  endmacro(FLEX_TARGET)
   #============================================================
 
 
@@ -137,24 +137,24 @@ IF(FLEX_EXECUTABLE)
   # ADD_FLEX_BISON_DEPENDENCY (public macro)
   #============================================================
   #
-  MACRO(ADD_FLEX_BISON_DEPENDENCY FlexTarget BisonTarget)
+  macro(ADD_FLEX_BISON_DEPENDENCY FlexTarget BisonTarget)
 
-    IF(NOT FLEX_${FlexTarget}_OUTPUTS)
-      MESSAGE(SEND_ERROR "Flex target `${FlexTarget}' does not exists.")
-    ENDIF()
+    if(NOT FLEX_${FlexTarget}_OUTPUTS)
+      message(SEND_ERROR "Flex target `${FlexTarget}' does not exists.")
+    endif()
 
-    IF(NOT BISON_${BisonTarget}_OUTPUT_HEADER)
-      MESSAGE(SEND_ERROR "Bison target `${BisonTarget}' does not exists.")
-    ENDIF()
+    if(NOT BISON_${BisonTarget}_OUTPUT_HEADER)
+      message(SEND_ERROR "Bison target `${BisonTarget}' does not exists.")
+    endif()
 
-    SET_SOURCE_FILES_PROPERTIES(${FLEX_${FlexTarget}_OUTPUTS}
+    set_source_files_properties(${FLEX_${FlexTarget}_OUTPUTS}
       PROPERTIES OBJECT_DEPENDS ${BISON_${BisonTarget}_OUTPUT_HEADER})
-  ENDMACRO(ADD_FLEX_BISON_DEPENDENCY)
+  endmacro(ADD_FLEX_BISON_DEPENDENCY)
   #============================================================
 
-ENDIF(FLEX_EXECUTABLE)
+endif(FLEX_EXECUTABLE)
 
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(FLEX REQUIRED_VARS FLEX_EXECUTABLE
                                        VERSION_VAR FLEX_VERSION)
 
diff --git a/Modules/FindFLTK.cmake b/Modules/FindFLTK.cmake
index 8a656f627..402fe2f5e 100644
--- a/Modules/FindFLTK.cmake
+++ b/Modules/FindFLTK.cmake
@@ -42,56 +42,56 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-IF(NOT FLTK_SKIP_OPENGL)
-  FIND_PACKAGE(OpenGL)
-ENDIF()
+if(NOT FLTK_SKIP_OPENGL)
+  find_package(OpenGL)
+endif()
 
 #  Platform dependent libraries required by FLTK
-IF(WIN32)
-  IF(NOT CYGWIN)
-    IF(BORLAND)
-      SET( FLTK_PLATFORM_DEPENDENT_LIBS import32 )
-    ELSE(BORLAND)
-      SET( FLTK_PLATFORM_DEPENDENT_LIBS wsock32 comctl32 )
-    ENDIF(BORLAND)
-  ENDIF(NOT CYGWIN)
-ENDIF(WIN32)
+if(WIN32)
+  if(NOT CYGWIN)
+    if(BORLAND)
+      set( FLTK_PLATFORM_DEPENDENT_LIBS import32 )
+    else(BORLAND)
+      set( FLTK_PLATFORM_DEPENDENT_LIBS wsock32 comctl32 )
+    endif(BORLAND)
+  endif(NOT CYGWIN)
+endif(WIN32)
 
-IF(UNIX)
-  INCLUDE(FindX11)
-  FIND_LIBRARY(FLTK_MATH_LIBRARY m)
-  SET( FLTK_PLATFORM_DEPENDENT_LIBS ${X11_LIBRARIES} ${FLTK_MATH_LIBRARY})
-ENDIF(UNIX)
+if(UNIX)
+  include(FindX11)
+  find_library(FLTK_MATH_LIBRARY m)
+  set( FLTK_PLATFORM_DEPENDENT_LIBS ${X11_LIBRARIES} ${FLTK_MATH_LIBRARY})
+endif(UNIX)
 
-IF(APPLE)
-  SET( FLTK_PLATFORM_DEPENDENT_LIBS  "-framework Carbon -framework Cocoa -framework ApplicationServices -lz")
-ENDIF(APPLE)
+if(APPLE)
+  set( FLTK_PLATFORM_DEPENDENT_LIBS  "-framework Carbon -framework Cocoa -framework ApplicationServices -lz")
+endif(APPLE)
 
 # If FLTK_INCLUDE_DIR is already defined we assigne its value to FLTK_DIR
-IF(FLTK_INCLUDE_DIR)
-  SET(FLTK_DIR ${FLTK_INCLUDE_DIR})
-ENDIF(FLTK_INCLUDE_DIR)
+if(FLTK_INCLUDE_DIR)
+  set(FLTK_DIR ${FLTK_INCLUDE_DIR})
+endif(FLTK_INCLUDE_DIR)
 
 
 # If FLTK has been built using CMake we try to find everything directly
-SET(FLTK_DIR_STRING "directory containing FLTKConfig.cmake.  This is either the root of the build tree, or PREFIX/lib/fltk for an installation.")
+set(FLTK_DIR_STRING "directory containing FLTKConfig.cmake.  This is either the root of the build tree, or PREFIX/lib/fltk for an installation.")
 
 # Search only if the location is not already known.
-IF(NOT FLTK_DIR)
+if(NOT FLTK_DIR)
   # Get the system search path as a list.
-  FILE(TO_CMAKE_PATH "$ENV{PATH}" FLTK_DIR_SEARCH2)
+  file(TO_CMAKE_PATH "$ENV{PATH}" FLTK_DIR_SEARCH2)
 
   # Construct a set of paths relative to the system search path.
-  SET(FLTK_DIR_SEARCH "")
-  FOREACH(dir ${FLTK_DIR_SEARCH2})
-    SET(FLTK_DIR_SEARCH ${FLTK_DIR_SEARCH} "${dir}/../lib/fltk")
-  ENDFOREACH(dir)
-  STRING(REPLACE "//" "/" FLTK_DIR_SEARCH "${FLTK_DIR_SEARCH}")
+  set(FLTK_DIR_SEARCH "")
+  foreach(dir ${FLTK_DIR_SEARCH2})
+    set(FLTK_DIR_SEARCH ${FLTK_DIR_SEARCH} "${dir}/../lib/fltk")
+  endforeach(dir)
+  string(REPLACE "//" "/" FLTK_DIR_SEARCH "${FLTK_DIR_SEARCH}")
 
   #
   # Look for an installation or build tree.
   #
-  FIND_PATH(FLTK_DIR FLTKConfig.cmake
+  find_path(FLTK_DIR FLTKConfig.cmake
     # Look for an environment variable FLTK_DIR.
     $ENV{FLTK_DIR}
 
@@ -122,188 +122,188 @@ IF(NOT FLTK_DIR)
     # Help the user find it if we cannot.
     DOC "The ${FLTK_DIR_STRING}"
     )
-ENDIF(NOT FLTK_DIR)
+endif(NOT FLTK_DIR)
 
   # Check if FLTK was built using CMake
-  IF(EXISTS ${FLTK_DIR}/FLTKConfig.cmake)
-    SET(FLTK_BUILT_WITH_CMAKE 1)
-  ENDIF(EXISTS ${FLTK_DIR}/FLTKConfig.cmake)
+  if(EXISTS ${FLTK_DIR}/FLTKConfig.cmake)
+    set(FLTK_BUILT_WITH_CMAKE 1)
+  endif(EXISTS ${FLTK_DIR}/FLTKConfig.cmake)
 
-  IF(FLTK_BUILT_WITH_CMAKE)
-    SET(FLTK_FOUND 1)
-    INCLUDE(${FLTK_DIR}/FLTKConfig.cmake)
+  if(FLTK_BUILT_WITH_CMAKE)
+    set(FLTK_FOUND 1)
+    include(${FLTK_DIR}/FLTKConfig.cmake)
 
     # Fluid
-    IF(FLUID_COMMAND)
-      SET(FLTK_FLUID_EXECUTABLE ${FLUID_COMMAND} CACHE FILEPATH "Fluid executable")
-    ELSE(FLUID_COMMAND)
-      FIND_PROGRAM(FLTK_FLUID_EXECUTABLE fluid PATHS
+    if(FLUID_COMMAND)
+      set(FLTK_FLUID_EXECUTABLE ${FLUID_COMMAND} CACHE FILEPATH "Fluid executable")
+    else(FLUID_COMMAND)
+      find_program(FLTK_FLUID_EXECUTABLE fluid PATHS
         ${FLTK_EXECUTABLE_DIRS}
         ${FLTK_EXECUTABLE_DIRS}/RelWithDebInfo
         ${FLTK_EXECUTABLE_DIRS}/Debug
         ${FLTK_EXECUTABLE_DIRS}/Release
         NO_SYSTEM_PATH)
-    ENDIF(FLUID_COMMAND)
-    # MARK_AS_ADVANCED(FLTK_FLUID_EXECUTABLE)
+    endif(FLUID_COMMAND)
+    # mark_as_advanced(FLTK_FLUID_EXECUTABLE)
 
-    SET(FLTK_INCLUDE_DIR ${FLTK_DIR})
-    LINK_DIRECTORIES(${FLTK_LIBRARY_DIRS})
+    set(FLTK_INCLUDE_DIR ${FLTK_DIR})
+    link_directories(${FLTK_LIBRARY_DIRS})
 
-    SET(FLTK_BASE_LIBRARY fltk)
-    SET(FLTK_GL_LIBRARY fltk_gl)
-    SET(FLTK_FORMS_LIBRARY fltk_forms)
-    SET(FLTK_IMAGES_LIBRARY fltk_images)
+    set(FLTK_BASE_LIBRARY fltk)
+    set(FLTK_GL_LIBRARY fltk_gl)
+    set(FLTK_FORMS_LIBRARY fltk_forms)
+    set(FLTK_IMAGES_LIBRARY fltk_images)
 
     # Add the extra libraries
-    LOAD_CACHE(${FLTK_DIR}
+    load_cache(${FLTK_DIR}
       READ_WITH_PREFIX
       FL FLTK_USE_SYSTEM_JPEG
       FL FLTK_USE_SYSTEM_PNG
       FL FLTK_USE_SYSTEM_ZLIB
       )
 
-    SET(FLTK_IMAGES_LIBS "")
-    IF(FLFLTK_USE_SYSTEM_JPEG)
-      SET(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} fltk_jpeg)
-    ENDIF(FLFLTK_USE_SYSTEM_JPEG)
-    IF(FLFLTK_USE_SYSTEM_PNG)
-      SET(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} fltk_png)
-    ENDIF(FLFLTK_USE_SYSTEM_PNG)
-    IF(FLFLTK_USE_SYSTEM_ZLIB)
-      SET(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} fltk_zlib)
-    ENDIF(FLFLTK_USE_SYSTEM_ZLIB)
-    SET(FLTK_IMAGES_LIBS "${FLTK_IMAGES_LIBS}" CACHE INTERNAL
+    set(FLTK_IMAGES_LIBS "")
+    if(FLFLTK_USE_SYSTEM_JPEG)
+      set(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} fltk_jpeg)
+    endif(FLFLTK_USE_SYSTEM_JPEG)
+    if(FLFLTK_USE_SYSTEM_PNG)
+      set(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} fltk_png)
+    endif(FLFLTK_USE_SYSTEM_PNG)
+    if(FLFLTK_USE_SYSTEM_ZLIB)
+      set(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} fltk_zlib)
+    endif(FLFLTK_USE_SYSTEM_ZLIB)
+    set(FLTK_IMAGES_LIBS "${FLTK_IMAGES_LIBS}" CACHE INTERNAL
       "Extra libraries for fltk_images library.")
 
-  ELSE(FLTK_BUILT_WITH_CMAKE)
+  else(FLTK_BUILT_WITH_CMAKE)
 
     # if FLTK was not built using CMake
     # Find fluid executable.
-    FIND_PROGRAM(FLTK_FLUID_EXECUTABLE fluid ${FLTK_INCLUDE_DIR}/fluid)
+    find_program(FLTK_FLUID_EXECUTABLE fluid ${FLTK_INCLUDE_DIR}/fluid)
 
     # Use location of fluid to help find everything else.
-    SET(FLTK_INCLUDE_SEARCH_PATH "")
-    SET(FLTK_LIBRARY_SEARCH_PATH "")
-    IF(FLTK_FLUID_EXECUTABLE)
-      GET_FILENAME_COMPONENT(FLTK_BIN_DIR "${FLTK_FLUID_EXECUTABLE}" PATH)
-      SET(FLTK_INCLUDE_SEARCH_PATH ${FLTK_INCLUDE_SEARCH_PATH}
+    set(FLTK_INCLUDE_SEARCH_PATH "")
+    set(FLTK_LIBRARY_SEARCH_PATH "")
+    if(FLTK_FLUID_EXECUTABLE)
+      get_filename_component(FLTK_BIN_DIR "${FLTK_FLUID_EXECUTABLE}" PATH)
+      set(FLTK_INCLUDE_SEARCH_PATH ${FLTK_INCLUDE_SEARCH_PATH}
         ${FLTK_BIN_DIR}/../include ${FLTK_BIN_DIR}/..)
-      SET(FLTK_LIBRARY_SEARCH_PATH ${FLTK_LIBRARY_SEARCH_PATH}
+      set(FLTK_LIBRARY_SEARCH_PATH ${FLTK_LIBRARY_SEARCH_PATH}
         ${FLTK_BIN_DIR}/../lib)
-      SET(FLTK_WRAP_UI 1)
-    ENDIF(FLTK_FLUID_EXECUTABLE)
+      set(FLTK_WRAP_UI 1)
+    endif(FLTK_FLUID_EXECUTABLE)
 
     #
     # Try to find FLTK include dir using fltk-config
     #
-    IF(UNIX)
+    if(UNIX)
       # Use fltk-config to generate a list of possible include directories
-      FIND_PROGRAM(FLTK_CONFIG_SCRIPT fltk-config PATHS ${FLTK_BIN_DIR})
-      IF(FLTK_CONFIG_SCRIPT)
-        IF(NOT FLTK_INCLUDE_DIR)
-          EXEC_PROGRAM(${FLTK_CONFIG_SCRIPT} ARGS --cxxflags OUTPUT_VARIABLE FLTK_CXXFLAGS)
-          IF(FLTK_CXXFLAGS)
-            STRING(REGEX MATCHALL "-I[^ ]*" _fltk_temp_dirs ${FLTK_CXXFLAGS})
-            STRING(REPLACE "-I" "" _fltk_temp_dirs "${_fltk_temp_dirs}")
-            FOREACH(_dir ${_fltk_temp_dirs})
-              STRING(STRIP ${_dir} _output)
-              LIST(APPEND _FLTK_POSSIBLE_INCLUDE_DIRS ${_output})
-            ENDFOREACH()
-          ENDIF(FLTK_CXXFLAGS)
-        ENDIF()
-      ENDIF()
-    ENDIF()
+      find_program(FLTK_CONFIG_SCRIPT fltk-config PATHS ${FLTK_BIN_DIR})
+      if(FLTK_CONFIG_SCRIPT)
+        if(NOT FLTK_INCLUDE_DIR)
+          exec_program(${FLTK_CONFIG_SCRIPT} ARGS --cxxflags OUTPUT_VARIABLE FLTK_CXXFLAGS)
+          if(FLTK_CXXFLAGS)
+            string(REGEX MATCHALL "-I[^ ]*" _fltk_temp_dirs ${FLTK_CXXFLAGS})
+            string(REPLACE "-I" "" _fltk_temp_dirs "${_fltk_temp_dirs}")
+            foreach(_dir ${_fltk_temp_dirs})
+              string(STRIP ${_dir} _output)
+              list(APPEND _FLTK_POSSIBLE_INCLUDE_DIRS ${_output})
+            endforeach()
+          endif(FLTK_CXXFLAGS)
+        endif()
+      endif()
+    endif()
 
-    SET(FLTK_INCLUDE_SEARCH_PATH ${FLTK_INCLUDE_SEARCH_PATH}
+    set(FLTK_INCLUDE_SEARCH_PATH ${FLTK_INCLUDE_SEARCH_PATH}
       /usr/local/fltk
       /usr/X11R6/include
       ${_FLTK_POSSIBLE_INCLUDE_DIRS}
       )
 
-    FIND_PATH(FLTK_INCLUDE_DIR
+    find_path(FLTK_INCLUDE_DIR
         NAMES FL/Fl.h FL/Fl.H    # fltk 1.1.9 has Fl.H (#8376)
         PATHS ${FLTK_INCLUDE_SEARCH_PATH})
 
     #
     # Try to find FLTK library
-    IF(UNIX)
-      IF(FLTK_CONFIG_SCRIPT)
-        EXEC_PROGRAM(${FLTK_CONFIG_SCRIPT} ARGS --libs OUTPUT_VARIABLE _FLTK_POSSIBLE_LIBS)
-        IF(_FLTK_POSSIBLE_LIBS)
-          GET_FILENAME_COMPONENT(_FLTK_POSSIBLE_LIBRARY_DIR ${_FLTK_POSSIBLE_LIBS} PATH)
-        ENDIF()
-      ENDIF()
-    ENDIF()
+    if(UNIX)
+      if(FLTK_CONFIG_SCRIPT)
+        exec_program(${FLTK_CONFIG_SCRIPT} ARGS --libs OUTPUT_VARIABLE _FLTK_POSSIBLE_LIBS)
+        if(_FLTK_POSSIBLE_LIBS)
+          get_filename_component(_FLTK_POSSIBLE_LIBRARY_DIR ${_FLTK_POSSIBLE_LIBS} PATH)
+        endif()
+      endif()
+    endif()
 
-    SET(FLTK_LIBRARY_SEARCH_PATH ${FLTK_LIBRARY_SEARCH_PATH}
+    set(FLTK_LIBRARY_SEARCH_PATH ${FLTK_LIBRARY_SEARCH_PATH}
       /usr/local/fltk/lib
       /usr/X11R6/lib
       ${FLTK_INCLUDE_DIR}/lib
       ${_FLTK_POSSIBLE_LIBRARY_DIR}
       )
 
-    FIND_LIBRARY(FLTK_BASE_LIBRARY NAMES fltk fltkd
+    find_library(FLTK_BASE_LIBRARY NAMES fltk fltkd
       PATHS ${FLTK_LIBRARY_SEARCH_PATH})
-    FIND_LIBRARY(FLTK_GL_LIBRARY NAMES fltkgl fltkgld fltk_gl
+    find_library(FLTK_GL_LIBRARY NAMES fltkgl fltkgld fltk_gl
       PATHS ${FLTK_LIBRARY_SEARCH_PATH})
-    FIND_LIBRARY(FLTK_FORMS_LIBRARY NAMES fltkforms fltkformsd fltk_forms
+    find_library(FLTK_FORMS_LIBRARY NAMES fltkforms fltkformsd fltk_forms
       PATHS ${FLTK_LIBRARY_SEARCH_PATH})
-    FIND_LIBRARY(FLTK_IMAGES_LIBRARY NAMES fltkimages fltkimagesd fltk_images
+    find_library(FLTK_IMAGES_LIBRARY NAMES fltkimages fltkimagesd fltk_images
       PATHS ${FLTK_LIBRARY_SEARCH_PATH})
 
     # Find the extra libraries needed for the fltk_images library.
-    IF(UNIX)
-      IF(FLTK_CONFIG_SCRIPT)
-        EXEC_PROGRAM(${FLTK_CONFIG_SCRIPT} ARGS --use-images --ldflags
+    if(UNIX)
+      if(FLTK_CONFIG_SCRIPT)
+        exec_program(${FLTK_CONFIG_SCRIPT} ARGS --use-images --ldflags
           OUTPUT_VARIABLE FLTK_IMAGES_LDFLAGS)
-        SET(FLTK_LIBS_EXTRACT_REGEX ".*-lfltk_images (.*) -lfltk.*")
-        IF("${FLTK_IMAGES_LDFLAGS}" MATCHES "${FLTK_LIBS_EXTRACT_REGEX}")
-          STRING(REGEX REPLACE "${FLTK_LIBS_EXTRACT_REGEX}" "\\1"
+        set(FLTK_LIBS_EXTRACT_REGEX ".*-lfltk_images (.*) -lfltk.*")
+        if("${FLTK_IMAGES_LDFLAGS}" MATCHES "${FLTK_LIBS_EXTRACT_REGEX}")
+          string(REGEX REPLACE "${FLTK_LIBS_EXTRACT_REGEX}" "\\1"
             FLTK_IMAGES_LIBS "${FLTK_IMAGES_LDFLAGS}")
-          STRING(REGEX REPLACE " +" ";" FLTK_IMAGES_LIBS "${FLTK_IMAGES_LIBS}")
+          string(REGEX REPLACE " +" ";" FLTK_IMAGES_LIBS "${FLTK_IMAGES_LIBS}")
           # The EXEC_PROGRAM will not be inherited into subdirectories from
           # the file that originally included this module.  Save the answer.
-          SET(FLTK_IMAGES_LIBS "${FLTK_IMAGES_LIBS}" CACHE INTERNAL
+          set(FLTK_IMAGES_LIBS "${FLTK_IMAGES_LIBS}" CACHE INTERNAL
             "Extra libraries for fltk_images library.")
-        ENDIF("${FLTK_IMAGES_LDFLAGS}" MATCHES "${FLTK_LIBS_EXTRACT_REGEX}")
-      ENDIF(FLTK_CONFIG_SCRIPT)
-    ENDIF(UNIX)
+        endif("${FLTK_IMAGES_LDFLAGS}" MATCHES "${FLTK_LIBS_EXTRACT_REGEX}")
+      endif(FLTK_CONFIG_SCRIPT)
+    endif(UNIX)
 
-  ENDIF(FLTK_BUILT_WITH_CMAKE)
+  endif(FLTK_BUILT_WITH_CMAKE)
 
   # Append all of the required libraries together (by default, everything)
-  SET(FLTK_LIBRARIES)
-  IF(NOT FLTK_SKIP_IMAGES)
-    LIST(APPEND FLTK_LIBRARIES ${FLTK_IMAGES_LIBRARY})
-  ENDIF()
-  IF(NOT FLTK_SKIP_FORMS)
-    LIST(APPEND FLTK_LIBRARIES ${FLTK_FORMS_LIBRARY})
-  ENDIF()
-  IF(NOT FLTK_SKIP_OPENGL)
-    LIST(APPEND FLTK_LIBRARIES ${FLTK_GL_LIBRARY} ${OPENGL_gl_LIBRARY})
-    LIST(APPEND FLTK_INCLUDE_DIR ${OPENGL_INCLUDE_DIR})
-    LIST(REMOVE_DUPLICATES FLTK_INCLUDE_DIR)
-  ENDIF()
-  LIST(APPEND FLTK_LIBRARIES ${FLTK_BASE_LIBRARY})
+  set(FLTK_LIBRARIES)
+  if(NOT FLTK_SKIP_IMAGES)
+    list(APPEND FLTK_LIBRARIES ${FLTK_IMAGES_LIBRARY})
+  endif()
+  if(NOT FLTK_SKIP_FORMS)
+    list(APPEND FLTK_LIBRARIES ${FLTK_FORMS_LIBRARY})
+  endif()
+  if(NOT FLTK_SKIP_OPENGL)
+    list(APPEND FLTK_LIBRARIES ${FLTK_GL_LIBRARY} ${OPENGL_gl_LIBRARY})
+    list(APPEND FLTK_INCLUDE_DIR ${OPENGL_INCLUDE_DIR})
+    list(REMOVE_DUPLICATES FLTK_INCLUDE_DIR)
+  endif()
+  list(APPEND FLTK_LIBRARIES ${FLTK_BASE_LIBRARY})
 
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-IF(FLTK_SKIP_FLUID)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+if(FLTK_SKIP_FLUID)
   FIND_PACKAGE_HANDLE_STANDARD_ARGS(FLTK DEFAULT_MSG FLTK_LIBRARIES FLTK_INCLUDE_DIR)
-ELSE()
+else()
   FIND_PACKAGE_HANDLE_STANDARD_ARGS(FLTK DEFAULT_MSG FLTK_LIBRARIES FLTK_INCLUDE_DIR FLTK_FLUID_EXECUTABLE)
-ENDIF()
+endif()
 
-IF(FLTK_FOUND)
-  IF(APPLE)
-    SET(FLTK_LIBRARIES ${FLTK_PLATFORM_DEPENDENT_LIBS} ${FLTK_LIBRARIES})
-  ELSE(APPLE)
-    SET(FLTK_LIBRARIES ${FLTK_LIBRARIES} ${FLTK_PLATFORM_DEPENDENT_LIBS})
-  ENDIF(APPLE)
+if(FLTK_FOUND)
+  if(APPLE)
+    set(FLTK_LIBRARIES ${FLTK_PLATFORM_DEPENDENT_LIBS} ${FLTK_LIBRARIES})
+  else(APPLE)
+    set(FLTK_LIBRARIES ${FLTK_LIBRARIES} ${FLTK_PLATFORM_DEPENDENT_LIBS})
+  endif(APPLE)
 
   # The following deprecated settings are for compatibility with CMake 1.4
-  SET (HAS_FLTK ${FLTK_FOUND})
-  SET (FLTK_INCLUDE_PATH ${FLTK_INCLUDE_DIR})
-  SET (FLTK_FLUID_EXE ${FLTK_FLUID_EXECUTABLE})
-  SET (FLTK_LIBRARY ${FLTK_LIBRARIES})
-ENDIF(FLTK_FOUND)
+  set (HAS_FLTK ${FLTK_FOUND})
+  set (FLTK_INCLUDE_PATH ${FLTK_INCLUDE_DIR})
+  set (FLTK_FLUID_EXE ${FLTK_FLUID_EXECUTABLE})
+  set (FLTK_LIBRARY ${FLTK_LIBRARIES})
+endif(FLTK_FOUND)
 
diff --git a/Modules/FindFLTK2.cmake b/Modules/FindFLTK2.cmake
index c6a978807..059ecdbcf 100644
--- a/Modules/FindFLTK2.cmake
+++ b/Modules/FindFLTK2.cmake
@@ -23,55 +23,55 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-SET (FLTK2_DIR $ENV{FLTK2_DIR} )
+set (FLTK2_DIR $ENV{FLTK2_DIR} )
 
 #  Platform dependent libraries required by FLTK2
-IF(WIN32)
-  IF(NOT CYGWIN)
-    IF(BORLAND)
-      SET( FLTK2_PLATFORM_DEPENDENT_LIBS import32 )
-    ELSE(BORLAND)
-      SET( FLTK2_PLATFORM_DEPENDENT_LIBS wsock32 comctl32 )
-    ENDIF(BORLAND)
-  ENDIF(NOT CYGWIN)
-ENDIF(WIN32)
+if(WIN32)
+  if(NOT CYGWIN)
+    if(BORLAND)
+      set( FLTK2_PLATFORM_DEPENDENT_LIBS import32 )
+    else(BORLAND)
+      set( FLTK2_PLATFORM_DEPENDENT_LIBS wsock32 comctl32 )
+    endif(BORLAND)
+  endif(NOT CYGWIN)
+endif(WIN32)
 
-IF(UNIX)
-  INCLUDE(${CMAKE_ROOT}/Modules/FindX11.cmake)
-  SET( FLTK2_PLATFORM_DEPENDENT_LIBS ${X11_LIBRARIES} -lm)
-ENDIF(UNIX)
+if(UNIX)
+  include(${CMAKE_ROOT}/Modules/FindX11.cmake)
+  set( FLTK2_PLATFORM_DEPENDENT_LIBS ${X11_LIBRARIES} -lm)
+endif(UNIX)
 
-IF(APPLE)
-  SET( FLTK2_PLATFORM_DEPENDENT_LIBS  "-framework Carbon -framework Cocoa -framework ApplicationServices -lz")
-ENDIF(APPLE)
+if(APPLE)
+  set( FLTK2_PLATFORM_DEPENDENT_LIBS  "-framework Carbon -framework Cocoa -framework ApplicationServices -lz")
+endif(APPLE)
 
 # If FLTK2_INCLUDE_DIR is already defined we assigne its value to FLTK2_DIR
-IF(FLTK2_INCLUDE_DIR)
-  SET(FLTK2_DIR ${FLTK2_INCLUDE_DIR})
-ELSE(FLTK2_INCLUDE_DIR)
-  SET(FLTK2_INCLUDE_DIR ${FLTK2_DIR})
-ENDIF(FLTK2_INCLUDE_DIR)
+if(FLTK2_INCLUDE_DIR)
+  set(FLTK2_DIR ${FLTK2_INCLUDE_DIR})
+else(FLTK2_INCLUDE_DIR)
+  set(FLTK2_INCLUDE_DIR ${FLTK2_DIR})
+endif(FLTK2_INCLUDE_DIR)
 
 
 # If FLTK2 has been built using CMake we try to find everything directly
-SET(FLTK2_DIR_STRING "directory containing FLTK2Config.cmake.  This is either the root of the build tree, or PREFIX/lib/fltk for an installation.")
+set(FLTK2_DIR_STRING "directory containing FLTK2Config.cmake.  This is either the root of the build tree, or PREFIX/lib/fltk for an installation.")
 
 # Search only if the location is not already known.
-IF(NOT FLTK2_DIR)
+if(NOT FLTK2_DIR)
   # Get the system search path as a list.
-  FILE(TO_CMAKE_PATH "$ENV{PATH}" FLTK2_DIR_SEARCH2)
+  file(TO_CMAKE_PATH "$ENV{PATH}" FLTK2_DIR_SEARCH2)
 
   # Construct a set of paths relative to the system search path.
-  SET(FLTK2_DIR_SEARCH "")
-  FOREACH(dir ${FLTK2_DIR_SEARCH2})
-    SET(FLTK2_DIR_SEARCH ${FLTK2_DIR_SEARCH} "${dir}/../lib/fltk")
-  ENDFOREACH(dir)
-  STRING(REPLACE "//" "/" FLTK2_DIR_SEARCH "${FLTK2_DIR_SEARCH}")
+  set(FLTK2_DIR_SEARCH "")
+  foreach(dir ${FLTK2_DIR_SEARCH2})
+    set(FLTK2_DIR_SEARCH ${FLTK2_DIR_SEARCH} "${dir}/../lib/fltk")
+  endforeach(dir)
+  string(REPLACE "//" "/" FLTK2_DIR_SEARCH "${FLTK2_DIR_SEARCH}")
 
   #
   # Look for an installation or build tree.
   #
-  FIND_PATH(FLTK2_DIR FLTK2Config.cmake
+  find_path(FLTK2_DIR FLTK2Config.cmake
     # Look for an environment variable FLTK2_DIR.
     $ENV{FLTK2_DIR}
 
@@ -101,167 +101,167 @@ IF(NOT FLTK2_DIR)
     DOC "The ${FLTK2_DIR_STRING}"
     )
 
-  IF(NOT FLTK2_DIR)
-    FIND_PATH(FLTK2_DIR fltk/run.h ${FLTK2_INCLUDE_SEARCH_PATH})
-  ENDIF(NOT FLTK2_DIR)
+  if(NOT FLTK2_DIR)
+    find_path(FLTK2_DIR fltk/run.h ${FLTK2_INCLUDE_SEARCH_PATH})
+  endif(NOT FLTK2_DIR)
 
-ENDIF(NOT FLTK2_DIR)
+endif(NOT FLTK2_DIR)
 
 
 # If FLTK2 was found, load the configuration file to get the rest of the
 # settings.
-IF(FLTK2_DIR)
+if(FLTK2_DIR)
 
   # Check if FLTK2 was built using CMake
-  IF(EXISTS ${FLTK2_DIR}/FLTK2Config.cmake)
-    SET(FLTK2_BUILT_WITH_CMAKE 1)
-  ENDIF(EXISTS ${FLTK2_DIR}/FLTK2Config.cmake)
+  if(EXISTS ${FLTK2_DIR}/FLTK2Config.cmake)
+    set(FLTK2_BUILT_WITH_CMAKE 1)
+  endif(EXISTS ${FLTK2_DIR}/FLTK2Config.cmake)
 
-  IF(FLTK2_BUILT_WITH_CMAKE)
-    SET(FLTK2_FOUND 1)
-    INCLUDE(${FLTK2_DIR}/FLTK2Config.cmake)
+  if(FLTK2_BUILT_WITH_CMAKE)
+    set(FLTK2_FOUND 1)
+    include(${FLTK2_DIR}/FLTK2Config.cmake)
 
     # Fluid
-    IF(FLUID_COMMAND)
-      SET(FLTK2_FLUID_EXECUTABLE ${FLUID_COMMAND} CACHE FILEPATH "Fluid executable")
-    ELSE(FLUID_COMMAND)
-      FIND_PROGRAM(FLTK2_FLUID_EXECUTABLE fluid2 PATHS
+    if(FLUID_COMMAND)
+      set(FLTK2_FLUID_EXECUTABLE ${FLUID_COMMAND} CACHE FILEPATH "Fluid executable")
+    else(FLUID_COMMAND)
+      find_program(FLTK2_FLUID_EXECUTABLE fluid2 PATHS
         ${FLTK2_EXECUTABLE_DIRS}
         ${FLTK2_EXECUTABLE_DIRS}/RelWithDebInfo
         ${FLTK2_EXECUTABLE_DIRS}/Debug
         ${FLTK2_EXECUTABLE_DIRS}/Release
         NO_SYSTEM_PATH)
-    ENDIF(FLUID_COMMAND)
+    endif(FLUID_COMMAND)
 
-    MARK_AS_ADVANCED(FLTK2_FLUID_EXECUTABLE)
-    SET( FLTK_FLUID_EXECUTABLE ${FLTK2_FLUID_EXECUTABLE} )
+    mark_as_advanced(FLTK2_FLUID_EXECUTABLE)
+    set( FLTK_FLUID_EXECUTABLE ${FLTK2_FLUID_EXECUTABLE} )
 
 
 
 
-    SET(FLTK2_INCLUDE_DIR ${FLTK2_DIR})
-    LINK_DIRECTORIES(${FLTK2_LIBRARY_DIRS})
+    set(FLTK2_INCLUDE_DIR ${FLTK2_DIR})
+    link_directories(${FLTK2_LIBRARY_DIRS})
 
-    SET(FLTK2_BASE_LIBRARY fltk2)
-    SET(FLTK2_GL_LIBRARY fltk2_gl)
-    SET(FLTK2_IMAGES_LIBRARY fltk2_images)
+    set(FLTK2_BASE_LIBRARY fltk2)
+    set(FLTK2_GL_LIBRARY fltk2_gl)
+    set(FLTK2_IMAGES_LIBRARY fltk2_images)
 
     # Add the extra libraries
-    LOAD_CACHE(${FLTK2_DIR}
+    load_cache(${FLTK2_DIR}
       READ_WITH_PREFIX
       FL FLTK2_USE_SYSTEM_JPEG
       FL FLTK2_USE_SYSTEM_PNG
       FL FLTK2_USE_SYSTEM_ZLIB
       )
 
-    SET(FLTK2_IMAGES_LIBS "")
-    IF(FLFLTK2_USE_SYSTEM_JPEG)
-      SET(FLTK2_IMAGES_LIBS ${FLTK2_IMAGES_LIBS} fltk2_jpeg)
-    ENDIF(FLFLTK2_USE_SYSTEM_JPEG)
-    IF(FLFLTK2_USE_SYSTEM_PNG)
-      SET(FLTK2_IMAGES_LIBS ${FLTK2_IMAGES_LIBS} fltk2_png)
-    ENDIF(FLFLTK2_USE_SYSTEM_PNG)
-    IF(FLFLTK2_USE_SYSTEM_ZLIB)
-      SET(FLTK2_IMAGES_LIBS ${FLTK2_IMAGES_LIBS} fltk2_zlib)
-    ENDIF(FLFLTK2_USE_SYSTEM_ZLIB)
-    SET(FLTK2_IMAGES_LIBS "${FLTK2_IMAGES_LIBS}" CACHE INTERNAL
+    set(FLTK2_IMAGES_LIBS "")
+    if(FLFLTK2_USE_SYSTEM_JPEG)
+      set(FLTK2_IMAGES_LIBS ${FLTK2_IMAGES_LIBS} fltk2_jpeg)
+    endif(FLFLTK2_USE_SYSTEM_JPEG)
+    if(FLFLTK2_USE_SYSTEM_PNG)
+      set(FLTK2_IMAGES_LIBS ${FLTK2_IMAGES_LIBS} fltk2_png)
+    endif(FLFLTK2_USE_SYSTEM_PNG)
+    if(FLFLTK2_USE_SYSTEM_ZLIB)
+      set(FLTK2_IMAGES_LIBS ${FLTK2_IMAGES_LIBS} fltk2_zlib)
+    endif(FLFLTK2_USE_SYSTEM_ZLIB)
+    set(FLTK2_IMAGES_LIBS "${FLTK2_IMAGES_LIBS}" CACHE INTERNAL
       "Extra libraries for fltk2_images library.")
 
-  ELSE(FLTK2_BUILT_WITH_CMAKE)
+  else(FLTK2_BUILT_WITH_CMAKE)
 
     # if FLTK2 was not built using CMake
     # Find fluid executable.
-    FIND_PROGRAM(FLTK2_FLUID_EXECUTABLE fluid2 ${FLTK2_INCLUDE_DIR}/fluid)
+    find_program(FLTK2_FLUID_EXECUTABLE fluid2 ${FLTK2_INCLUDE_DIR}/fluid)
 
     # Use location of fluid to help find everything else.
-    SET(FLTK2_INCLUDE_SEARCH_PATH "")
-    SET(FLTK2_LIBRARY_SEARCH_PATH "")
-    IF(FLTK2_FLUID_EXECUTABLE)
-      SET( FLTK_FLUID_EXECUTABLE ${FLTK2_FLUID_EXECUTABLE} )
-      GET_FILENAME_COMPONENT(FLTK2_BIN_DIR "${FLTK2_FLUID_EXECUTABLE}" PATH)
-      SET(FLTK2_INCLUDE_SEARCH_PATH ${FLTK2_INCLUDE_SEARCH_PATH}
+    set(FLTK2_INCLUDE_SEARCH_PATH "")
+    set(FLTK2_LIBRARY_SEARCH_PATH "")
+    if(FLTK2_FLUID_EXECUTABLE)
+      set( FLTK_FLUID_EXECUTABLE ${FLTK2_FLUID_EXECUTABLE} )
+      get_filename_component(FLTK2_BIN_DIR "${FLTK2_FLUID_EXECUTABLE}" PATH)
+      set(FLTK2_INCLUDE_SEARCH_PATH ${FLTK2_INCLUDE_SEARCH_PATH}
         ${FLTK2_BIN_DIR}/../include ${FLTK2_BIN_DIR}/..)
-      SET(FLTK2_LIBRARY_SEARCH_PATH ${FLTK2_LIBRARY_SEARCH_PATH}
+      set(FLTK2_LIBRARY_SEARCH_PATH ${FLTK2_LIBRARY_SEARCH_PATH}
         ${FLTK2_BIN_DIR}/../lib)
-      SET(FLTK2_WRAP_UI 1)
-    ENDIF(FLTK2_FLUID_EXECUTABLE)
+      set(FLTK2_WRAP_UI 1)
+    endif(FLTK2_FLUID_EXECUTABLE)
 
-    SET(FLTK2_INCLUDE_SEARCH_PATH ${FLTK2_INCLUDE_SEARCH_PATH}
+    set(FLTK2_INCLUDE_SEARCH_PATH ${FLTK2_INCLUDE_SEARCH_PATH}
       /usr/local/fltk2
       /usr/X11R6/include
       )
 
-    FIND_PATH(FLTK2_INCLUDE_DIR fltk/run.h ${FLTK2_INCLUDE_SEARCH_PATH})
+    find_path(FLTK2_INCLUDE_DIR fltk/run.h ${FLTK2_INCLUDE_SEARCH_PATH})
 
-    SET(FLTK2_LIBRARY_SEARCH_PATH ${FLTK2_LIBRARY_SEARCH_PATH}
+    set(FLTK2_LIBRARY_SEARCH_PATH ${FLTK2_LIBRARY_SEARCH_PATH}
       /usr/local/fltk2/lib
       /usr/X11R6/lib
       ${FLTK2_INCLUDE_DIR}/lib
       )
 
-    FIND_LIBRARY(FLTK2_BASE_LIBRARY NAMES fltk2
+    find_library(FLTK2_BASE_LIBRARY NAMES fltk2
       PATHS ${FLTK2_LIBRARY_SEARCH_PATH})
-    FIND_LIBRARY(FLTK2_GL_LIBRARY NAMES fltk2_gl
+    find_library(FLTK2_GL_LIBRARY NAMES fltk2_gl
       PATHS ${FLTK2_LIBRARY_SEARCH_PATH})
-    FIND_LIBRARY(FLTK2_IMAGES_LIBRARY NAMES fltk2_images
+    find_library(FLTK2_IMAGES_LIBRARY NAMES fltk2_images
       PATHS ${FLTK2_LIBRARY_SEARCH_PATH})
 
     # Find the extra libraries needed for the fltk_images library.
-    IF(UNIX)
-      FIND_PROGRAM(FLTK2_CONFIG_SCRIPT fltk2-config PATHS ${FLTK2_BIN_DIR})
-      IF(FLTK2_CONFIG_SCRIPT)
-        EXEC_PROGRAM(${FLTK2_CONFIG_SCRIPT} ARGS --use-images --ldflags
+    if(UNIX)
+      find_program(FLTK2_CONFIG_SCRIPT fltk2-config PATHS ${FLTK2_BIN_DIR})
+      if(FLTK2_CONFIG_SCRIPT)
+        exec_program(${FLTK2_CONFIG_SCRIPT} ARGS --use-images --ldflags
           OUTPUT_VARIABLE FLTK2_IMAGES_LDFLAGS)
-        SET(FLTK2_LIBS_EXTRACT_REGEX ".*-lfltk2_images (.*) -lfltk2.*")
-        IF("${FLTK2_IMAGES_LDFLAGS}" MATCHES "${FLTK2_LIBS_EXTRACT_REGEX}")
-          STRING(REGEX REPLACE "${FLTK2_LIBS_EXTRACT_REGEX}" "\\1"
+        set(FLTK2_LIBS_EXTRACT_REGEX ".*-lfltk2_images (.*) -lfltk2.*")
+        if("${FLTK2_IMAGES_LDFLAGS}" MATCHES "${FLTK2_LIBS_EXTRACT_REGEX}")
+          string(REGEX REPLACE "${FLTK2_LIBS_EXTRACT_REGEX}" "\\1"
             FLTK2_IMAGES_LIBS "${FLTK2_IMAGES_LDFLAGS}")
-          STRING(REGEX REPLACE " +" ";" FLTK2_IMAGES_LIBS "${FLTK2_IMAGES_LIBS}")
+          string(REGEX REPLACE " +" ";" FLTK2_IMAGES_LIBS "${FLTK2_IMAGES_LIBS}")
           # The EXEC_PROGRAM will not be inherited into subdirectories from
           # the file that originally included this module.  Save the answer.
-          SET(FLTK2_IMAGES_LIBS "${FLTK2_IMAGES_LIBS}" CACHE INTERNAL
+          set(FLTK2_IMAGES_LIBS "${FLTK2_IMAGES_LIBS}" CACHE INTERNAL
             "Extra libraries for fltk_images library.")
-        ENDIF("${FLTK2_IMAGES_LDFLAGS}" MATCHES "${FLTK2_LIBS_EXTRACT_REGEX}")
-      ENDIF(FLTK2_CONFIG_SCRIPT)
-    ENDIF(UNIX)
+        endif("${FLTK2_IMAGES_LDFLAGS}" MATCHES "${FLTK2_LIBS_EXTRACT_REGEX}")
+      endif(FLTK2_CONFIG_SCRIPT)
+    endif(UNIX)
 
-  ENDIF(FLTK2_BUILT_WITH_CMAKE)
-ENDIF(FLTK2_DIR)
+  endif(FLTK2_BUILT_WITH_CMAKE)
+endif(FLTK2_DIR)
 
 
-SET(FLTK2_FOUND 1)
-FOREACH(var FLTK2_FLUID_EXECUTABLE FLTK2_INCLUDE_DIR
+set(FLTK2_FOUND 1)
+foreach(var FLTK2_FLUID_EXECUTABLE FLTK2_INCLUDE_DIR
     FLTK2_BASE_LIBRARY FLTK2_GL_LIBRARY
     FLTK2_IMAGES_LIBRARY)
-  IF(NOT ${var})
-    MESSAGE( STATUS "${var} not found" )
-    SET(FLTK2_FOUND 0)
-  ENDIF(NOT ${var})
-ENDFOREACH(var)
+  if(NOT ${var})
+    message( STATUS "${var} not found" )
+    set(FLTK2_FOUND 0)
+  endif(NOT ${var})
+endforeach(var)
 
 
-IF(FLTK2_FOUND)
-  SET(FLTK2_LIBRARIES ${FLTK2_IMAGES_LIBRARY} ${FLTK2_IMAGES_LIBS} ${FLTK2_BASE_LIBRARY} ${FLTK2_GL_LIBRARY} )
-  IF(APPLE)
-    SET(FLTK2_LIBRARIES ${FLTK2_PLATFORM_DEPENDENT_LIBS} ${FLTK2_LIBRARIES})
-  ELSE(APPLE)
-    SET(FLTK2_LIBRARIES ${FLTK2_LIBRARIES} ${FLTK2_PLATFORM_DEPENDENT_LIBS})
-  ENDIF(APPLE)
+if(FLTK2_FOUND)
+  set(FLTK2_LIBRARIES ${FLTK2_IMAGES_LIBRARY} ${FLTK2_IMAGES_LIBS} ${FLTK2_BASE_LIBRARY} ${FLTK2_GL_LIBRARY} )
+  if(APPLE)
+    set(FLTK2_LIBRARIES ${FLTK2_PLATFORM_DEPENDENT_LIBS} ${FLTK2_LIBRARIES})
+  else(APPLE)
+    set(FLTK2_LIBRARIES ${FLTK2_LIBRARIES} ${FLTK2_PLATFORM_DEPENDENT_LIBS})
+  endif(APPLE)
 
   # The following deprecated settings are for compatibility with CMake 1.4
-  SET (HAS_FLTK2 ${FLTK2_FOUND})
-  SET (FLTK2_INCLUDE_PATH ${FLTK2_INCLUDE_DIR})
-  SET (FLTK2_FLUID_EXE ${FLTK2_FLUID_EXECUTABLE})
-  SET (FLTK2_LIBRARY ${FLTK2_LIBRARIES})
-ELSE(FLTK2_FOUND)
+  set (HAS_FLTK2 ${FLTK2_FOUND})
+  set (FLTK2_INCLUDE_PATH ${FLTK2_INCLUDE_DIR})
+  set (FLTK2_FLUID_EXE ${FLTK2_FLUID_EXECUTABLE})
+  set (FLTK2_LIBRARY ${FLTK2_LIBRARIES})
+else(FLTK2_FOUND)
   # make FIND_PACKAGE friendly
-  IF(NOT FLTK2_FIND_QUIETLY)
-    IF(FLTK2_FIND_REQUIRED)
-      MESSAGE(FATAL_ERROR
+  if(NOT FLTK2_FIND_QUIETLY)
+    if(FLTK2_FIND_REQUIRED)
+      message(FATAL_ERROR
               "FLTK2 required, please specify its location with FLTK2_DIR.")
-    ELSE(FLTK2_FIND_REQUIRED)
-      MESSAGE(STATUS "FLTK2 was not found.")
-    ENDIF(FLTK2_FIND_REQUIRED)
-  ENDIF(NOT FLTK2_FIND_QUIETLY)
-ENDIF(FLTK2_FOUND)
+    else(FLTK2_FIND_REQUIRED)
+      message(STATUS "FLTK2 was not found.")
+    endif(FLTK2_FIND_REQUIRED)
+  endif(NOT FLTK2_FIND_QUIETLY)
+endif(FLTK2_FOUND)
 
diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake
index e6f670256..d89683371 100644
--- a/Modules/FindFreetype.cmake
+++ b/Modules/FindFreetype.cmake
@@ -38,11 +38,11 @@
 # Then from there, they need to set a bunch of #define's
 # so you can do something like:
 # #include FT_FREETYPE_H
-# Unfortunately, using CMake's mechanisms like INCLUDE_DIRECTORIES()
+# Unfortunately, using CMake's mechanisms like include_directories()
 # wants explicit full paths and this trickery doesn't work too well.
 # I'm going to attempt to cut out the middleman and hope
 # everything still works.
-FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
+find_path(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
   HINTS
   $ENV{FREETYPE_DIR}
   PATHS
@@ -51,7 +51,7 @@ FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
   /usr/freeware/include
 )
 
-FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
+find_path(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
   HINTS
   $ENV{FREETYPE_DIR}/include/freetype2
   PATHS
@@ -61,7 +61,7 @@ FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
   PATH_SUFFIXES freetype2
 )
 
-FIND_LIBRARY(FREETYPE_LIBRARY
+find_library(FREETYPE_LIBRARY
   NAMES freetype libfreetype freetype219
   HINTS
   $ENV{FREETYPE_DIR}
@@ -73,38 +73,38 @@ FIND_LIBRARY(FREETYPE_LIBRARY
 )
 
 # set the user variables
-IF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
-  SET(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
-ENDIF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
-SET(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}")
+if(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
+  set(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
+endif(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
+set(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}")
 
-IF(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
-    FILE(STRINGS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h" freetype_version_str
+if(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
+    file(STRINGS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h" freetype_version_str
          REGEX "^#[\t ]*define[\t ]+FREETYPE_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$")
 
-    UNSET(FREETYPE_VERSION_STRING)
-    FOREACH(VPART MAJOR MINOR PATCH)
-        FOREACH(VLINE ${freetype_version_str})
-            IF(VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}")
-                STRING(REGEX REPLACE "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$" "\\1"
+    unset(FREETYPE_VERSION_STRING)
+    foreach(VPART MAJOR MINOR PATCH)
+        foreach(VLINE ${freetype_version_str})
+            if(VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}")
+                string(REGEX REPLACE "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$" "\\1"
                        FREETYPE_VERSION_PART "${VLINE}")
-                IF(FREETYPE_VERSION_STRING)
-                    SET(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}")
-                ELSE(FREETYPE_VERSION_STRING)
-                    SET(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}")
-                ENDIF(FREETYPE_VERSION_STRING)
-                UNSET(FREETYPE_VERSION_PART)
-            ENDIF()
-        ENDFOREACH(VLINE)
-    ENDFOREACH(VPART)
-ENDIF(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
+                if(FREETYPE_VERSION_STRING)
+                    set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}")
+                else(FREETYPE_VERSION_STRING)
+                    set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}")
+                endif(FREETYPE_VERSION_STRING)
+                unset(FREETYPE_VERSION_PART)
+            endif()
+        endforeach(VLINE)
+    endforeach(VPART)
+endif(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
 
 
 # handle the QUIETLY and REQUIRED arguments and set FREETYPE_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Freetype
                                   REQUIRED_VARS FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS
                                   VERSION_VAR FREETYPE_VERSION_STRING)
 
-MARK_AS_ADVANCED(FREETYPE_LIBRARY FREETYPE_INCLUDE_DIR_freetype2 FREETYPE_INCLUDE_DIR_ft2build)
+mark_as_advanced(FREETYPE_LIBRARY FREETYPE_INCLUDE_DIR_freetype2 FREETYPE_INCLUDE_DIR_ft2build)
diff --git a/Modules/FindGCCXML.cmake b/Modules/FindGCCXML.cmake
index 261a5d180..05f08a639 100644
--- a/Modules/FindGCCXML.cmake
+++ b/Modules/FindGCCXML.cmake
@@ -16,7 +16,7 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PROGRAM(GCCXML
+find_program(GCCXML
   NAMES gccxml
         ../GCC_XML/gccxml
   PATHS [HKEY_CURRENT_USER\\Software\\Kitware\\GCC_XML;loc]
@@ -24,4 +24,4 @@ FIND_PROGRAM(GCCXML
   "C:/Program Files/GCC_XML"
 )
 
-MARK_AS_ADVANCED(GCCXML)
+mark_as_advanced(GCCXML)
diff --git a/Modules/FindGDAL.cmake b/Modules/FindGDAL.cmake
index 3b42a33d4..1e09b8200 100644
--- a/Modules/FindGDAL.cmake
+++ b/Modules/FindGDAL.cmake
@@ -40,7 +40,7 @@
 #
 #include "gdal.h"
 
-FIND_PATH(GDAL_INCLUDE_DIR gdal.h
+find_path(GDAL_INCLUDE_DIR gdal.h
   HINTS
     $ENV{GDAL_DIR}
     $ENV{GDAL_ROOT}
@@ -57,12 +57,12 @@ FIND_PATH(GDAL_INCLUDE_DIR gdal.h
       /opt
 )
 
-IF(UNIX)
+if(UNIX)
     # Use gdal-config to obtain the library version (this should hopefully
     # allow us to -lgdal1.x.y where x.y are correct version)
     # For some reason, libgdal development packages do not contain
     # libgdal.so...
-    FIND_PROGRAM(GDAL_CONFIG gdal-config
+    find_program(GDAL_CONFIG gdal-config
         HINTS
           $ENV{GDAL_DIR}
           $ENV{GDAL_ROOT}
@@ -85,7 +85,7 @@ IF(UNIX)
     endif()
 endif()
 
-FIND_LIBRARY(GDAL_LIBRARY
+find_library(GDAL_LIBRARY
   NAMES ${_gdal_lib} gdal gdal_i gdal1.5.0 gdal1.4.0 gdal1.3.2 GDAL
   HINTS
      $ENV{GDAL_DIR}
diff --git a/Modules/FindGIF.cmake b/Modules/FindGIF.cmake
index 41e909805..ff1d39667 100644
--- a/Modules/FindGIF.cmake
+++ b/Modules/FindGIF.cmake
@@ -5,7 +5,7 @@
 # GIF_VERSION, reports either version 4 or 3 (for everything before version 4)
 #
 # The minimum required version of giflib can be specified using the
-# standard syntax, e.g. FIND_PACKAGE(GIF 4)
+# standard syntax, e.g. find_package(GIF 4)
 #
 # $GIF_DIR is an environment variable that would
 # correspond to the ./configure --prefix=$GIF_DIR
@@ -26,7 +26,7 @@
 # Created by Eric Wing.
 # Modifications by Alexander Neundorf
 
-FIND_PATH(GIF_INCLUDE_DIR gif_lib.h
+find_path(GIF_INCLUDE_DIR gif_lib.h
   HINTS
   $ENV{GIF_DIR}
   PATH_SUFFIXES include
@@ -36,9 +36,9 @@ FIND_PATH(GIF_INCLUDE_DIR gif_lib.h
 )
 
 # the gif library can have many names :-/
-SET(POTENTIAL_GIF_LIBS gif libgif ungif libungif giflib giflib4)
+set(POTENTIAL_GIF_LIBS gif libgif ungif libungif giflib giflib4)
 
-FIND_LIBRARY(GIF_LIBRARY
+find_library(GIF_LIBRARY
   NAMES ${POTENTIAL_GIF_LIBS}
   HINTS
   $ENV{GIF_DIR}
@@ -49,7 +49,7 @@ FIND_LIBRARY(GIF_LIBRARY
 )
 
 # see readme.txt
-SET(GIF_LIBRARIES ${GIF_LIBRARY})
+set(GIF_LIBRARIES ${GIF_LIBRARY})
 
 # Very basic version detection.
 # The GIF_LIB_VERSION string in gif_lib.h seems to be unreliable, since it seems
@@ -57,24 +57,24 @@ SET(GIF_LIBRARIES ${GIF_LIBRARY})
 # In version 4 the member UserData was added to GifFileType, so we check for this
 # one.
 # http://giflib.sourcearchive.com/documentation/4.1.4/files.html
-IF(GIF_INCLUDE_DIR)
-  INCLUDE(CMakePushCheckState)
-  INCLUDE(CheckStructHasMember)
+if(GIF_INCLUDE_DIR)
+  include(CMakePushCheckState)
+  include(CheckStructHasMember)
   CMAKE_PUSH_CHECK_STATE()
-  SET(GIF_VERSION 3)
-  SET(CMAKE_REQUIRED_INCLUDES "${GIF_INCLUDE_DIR}")
+  set(GIF_VERSION 3)
+  set(CMAKE_REQUIRED_INCLUDES "${GIF_INCLUDE_DIR}")
   CHECK_STRUCT_HAS_MEMBER(GifFileType UserData gif_lib.h GIF_GifFileType_UserData )
-  IF(GIF_GifFileType_UserData)
-    SET(GIF_VERSION 4)
-  ENDIF()
+  if(GIF_GifFileType_UserData)
+    set(GIF_VERSION 4)
+  endif()
   CMAKE_POP_CHECK_STATE()
-ENDIF()
+endif()
 
 
 # handle the QUIETLY and REQUIRED arguments and set GIF_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(GIF  REQUIRED_VARS  GIF_LIBRARY  GIF_INCLUDE_DIR
                                        VERSION_VAR GIF_VERSION )
 
-MARK_AS_ADVANCED(GIF_INCLUDE_DIR GIF_LIBRARY)
+mark_as_advanced(GIF_INCLUDE_DIR GIF_LIBRARY)
diff --git a/Modules/FindGLU.cmake b/Modules/FindGLU.cmake
index 5198f11e1..3db2ce4c6 100644
--- a/Modules/FindGLU.cmake
+++ b/Modules/FindGLU.cmake
@@ -16,13 +16,13 @@
 # GLU library is now found by FindOpenGL.cmake
 #
 
-MESSAGE(STATUS
+message(STATUS
   "WARNING: you are using the obsolete 'GLU' package, please use 'OpenGL' instead")
 
-INCLUDE(FindOpenGL)
+include(FindOpenGL)
 
-IF (OPENGL_GLU_FOUND)
-  SET (GLU_LIBRARY ${OPENGL_LIBRARIES})
-  SET (GLU_INCLUDE_PATH ${OPENGL_INCLUDE_DIR})
-ENDIF (OPENGL_GLU_FOUND)
+if (OPENGL_GLU_FOUND)
+  set (GLU_LIBRARY ${OPENGL_LIBRARIES})
+  set (GLU_INCLUDE_PATH ${OPENGL_INCLUDE_DIR})
+endif (OPENGL_GLU_FOUND)
 
diff --git a/Modules/FindGLUT.cmake b/Modules/FindGLUT.cmake
index cfa137516..edff53cb9 100644
--- a/Modules/FindGLUT.cmake
+++ b/Modules/FindGLUT.cmake
@@ -20,27 +20,27 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-IF (WIN32)
-  FIND_PATH( GLUT_INCLUDE_DIR NAMES GL/glut.h
+if (WIN32)
+  find_path( GLUT_INCLUDE_DIR NAMES GL/glut.h
     PATHS  ${GLUT_ROOT_PATH}/include )
-  FIND_LIBRARY( GLUT_glut_LIBRARY NAMES glut glut32 freeglut
+  find_library( GLUT_glut_LIBRARY NAMES glut glut32 freeglut
     PATHS
     ${OPENGL_LIBRARY_DIR}
     ${GLUT_ROOT_PATH}/Release
     )
-ELSE (WIN32)
+else (WIN32)
 
-  IF (APPLE)
+  if (APPLE)
     # These values for Apple could probably do with improvement.
-    FIND_PATH( GLUT_INCLUDE_DIR glut.h
+    find_path( GLUT_INCLUDE_DIR glut.h
       /System/Library/Frameworks/GLUT.framework/Versions/A/Headers
       ${OPENGL_LIBRARY_DIR}
       )
-    SET(GLUT_glut_LIBRARY "-framework GLUT" CACHE STRING "GLUT library for OSX")
-    SET(GLUT_cocoa_LIBRARY "-framework Cocoa" CACHE STRING "Cocoa framework for OSX")
-  ELSE (APPLE)
+    set(GLUT_glut_LIBRARY "-framework GLUT" CACHE STRING "GLUT library for OSX")
+    set(GLUT_cocoa_LIBRARY "-framework Cocoa" CACHE STRING "Cocoa framework for OSX")
+  else (APPLE)
 
-    FIND_PATH( GLUT_INCLUDE_DIR GL/glut.h
+    find_path( GLUT_INCLUDE_DIR GL/glut.h
       /usr/include/GL
       /usr/openwin/share/include
       /usr/openwin/include
@@ -48,29 +48,29 @@ ELSE (WIN32)
       /opt/graphics/OpenGL/contrib/libglut
       )
 
-    FIND_LIBRARY( GLUT_glut_LIBRARY glut
+    find_library( GLUT_glut_LIBRARY glut
       /usr/openwin/lib
       )
 
-    FIND_LIBRARY( GLUT_Xi_LIBRARY Xi
+    find_library( GLUT_Xi_LIBRARY Xi
       /usr/openwin/lib
       )
 
-    FIND_LIBRARY( GLUT_Xmu_LIBRARY Xmu
+    find_library( GLUT_Xmu_LIBRARY Xmu
       /usr/openwin/lib
       )
 
-  ENDIF (APPLE)
+  endif (APPLE)
 
-ENDIF (WIN32)
+endif (WIN32)
 
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLUT REQUIRED_VARS GLUT_glut_LIBRARY GLUT_INCLUDE_DIR)
 
-IF (GLUT_FOUND)
+if (GLUT_FOUND)
   # Is -lXi and -lXmu required on all platforms that have it?
   # If not, we need some way to figure out what platform we are on.
-  SET( GLUT_LIBRARIES
+  set( GLUT_LIBRARIES
     ${GLUT_glut_LIBRARY}
     ${GLUT_Xmu_LIBRARY}
     ${GLUT_Xi_LIBRARY}
@@ -78,11 +78,11 @@ IF (GLUT_FOUND)
     )
 
   #The following deprecated settings are for backwards compatibility with CMake1.4
-  SET (GLUT_LIBRARY ${GLUT_LIBRARIES})
-  SET (GLUT_INCLUDE_PATH ${GLUT_INCLUDE_DIR})
-ENDIF(GLUT_FOUND)
+  set (GLUT_LIBRARY ${GLUT_LIBRARIES})
+  set (GLUT_INCLUDE_PATH ${GLUT_INCLUDE_DIR})
+endif(GLUT_FOUND)
 
-MARK_AS_ADVANCED(
+mark_as_advanced(
   GLUT_INCLUDE_DIR
   GLUT_glut_LIBRARY
   GLUT_Xmu_LIBRARY
diff --git a/Modules/FindGTK.cmake b/Modules/FindGTK.cmake
index 3fa75a640..780932e61 100644
--- a/Modules/FindGTK.cmake
+++ b/Modules/FindGTK.cmake
@@ -18,9 +18,9 @@
 #  License text for the above reference.)
 
 # don't even bother under WIN32
-IF(UNIX)
+if(UNIX)
 
-  FIND_PATH( GTK_gtk_INCLUDE_PATH NAMES gtk/gtk.h
+  find_path( GTK_gtk_INCLUDE_PATH NAMES gtk/gtk.h
     PATH_SUFFIXES gtk-1.2 gtk12
     PATHS
     /usr/openwin/share/include
@@ -33,7 +33,7 @@ IF(UNIX)
   # for both.
   #  - Atanas Georgiev <atanas@cs.columbia.edu>
 
-  FIND_PATH( GTK_glibconfig_INCLUDE_PATH NAMES glibconfig.h
+  find_path( GTK_glibconfig_INCLUDE_PATH NAMES glibconfig.h
     PATHS
     /usr/openwin/share/include
     /usr/local/include/glib12
@@ -43,7 +43,7 @@ IF(UNIX)
     /opt/gnome/lib/glib/include
   )
 
-  FIND_PATH( GTK_glib_INCLUDE_PATH NAMES glib.h
+  find_path( GTK_glib_INCLUDE_PATH NAMES glib.h
     PATH_SUFFIXES gtk-1.2 glib-1.2 glib12
     PATHS
     /usr/openwin/share/include
@@ -51,12 +51,12 @@ IF(UNIX)
     /opt/gnome/include
   )
 
-  FIND_PATH( GTK_gtkgl_INCLUDE_PATH NAMES gtkgl/gtkglarea.h
+  find_path( GTK_gtkgl_INCLUDE_PATH NAMES gtkgl/gtkglarea.h
     PATHS /usr/openwin/share/include
           /opt/gnome/include
   )
 
-  FIND_LIBRARY( GTK_gtkgl_LIBRARY gtkgl
+  find_library( GTK_gtkgl_LIBRARY gtkgl
     /usr/openwin/lib
     /opt/gnome/lib
   )
@@ -65,43 +65,43 @@ IF(UNIX)
   # The 12 suffix is thanks to the FreeBSD ports collection
   #
 
-  FIND_LIBRARY( GTK_gtk_LIBRARY
+  find_library( GTK_gtk_LIBRARY
     NAMES  gtk gtk12
     PATHS /usr/openwin/lib
           /opt/gnome/lib
   )
 
-  FIND_LIBRARY( GTK_gdk_LIBRARY
+  find_library( GTK_gdk_LIBRARY
     NAMES  gdk gdk12
     PATHS  /usr/openwin/lib
            /opt/gnome/lib
   )
 
-  FIND_LIBRARY( GTK_gmodule_LIBRARY
+  find_library( GTK_gmodule_LIBRARY
     NAMES  gmodule gmodule12
     PATHS  /usr/openwin/lib
            /opt/gnome/lib
   )
 
-  FIND_LIBRARY( GTK_glib_LIBRARY
+  find_library( GTK_glib_LIBRARY
     NAMES  glib glib12
     PATHS  /usr/openwin/lib
            /opt/gnome/lib
   )
 
-  FIND_LIBRARY( GTK_Xi_LIBRARY
+  find_library( GTK_Xi_LIBRARY
     NAMES Xi
     PATHS /usr/openwin/lib
           /opt/gnome/lib
     )
 
-  FIND_LIBRARY( GTK_gthread_LIBRARY
+  find_library( GTK_gthread_LIBRARY
     NAMES  gthread gthread12
     PATHS  /usr/openwin/lib
            /opt/gnome/lib
   )
 
-  IF(GTK_gtk_INCLUDE_PATH
+  if(GTK_gtk_INCLUDE_PATH
      AND GTK_glibconfig_INCLUDE_PATH
      AND GTK_glib_INCLUDE_PATH
      AND GTK_gtk_LIBRARY
@@ -110,42 +110,42 @@ IF(UNIX)
     # Assume that if gtk and glib were found, the other
     # supporting libraries have also been found.
 
-    SET( GTK_FOUND "YES" )
-    SET( GTK_INCLUDE_DIR  ${GTK_gtk_INCLUDE_PATH}
+    set( GTK_FOUND "YES" )
+    set( GTK_INCLUDE_DIR  ${GTK_gtk_INCLUDE_PATH}
                            ${GTK_glibconfig_INCLUDE_PATH}
                            ${GTK_glib_INCLUDE_PATH} )
-    SET( GTK_LIBRARIES  ${GTK_gtk_LIBRARY}
+    set( GTK_LIBRARIES  ${GTK_gtk_LIBRARY}
                         ${GTK_gdk_LIBRARY}
                         ${GTK_glib_LIBRARY} )
 
-    IF(GTK_gmodule_LIBRARY)
-      SET(GTK_LIBRARIES ${GTK_LIBRARIES} ${GTK_gmodule_LIBRARY})
-    ENDIF(GTK_gmodule_LIBRARY)
-    IF(GTK_gthread_LIBRARY)
-      SET(GTK_LIBRARIES ${GTK_LIBRARIES} ${GTK_gthread_LIBRARY})
-    ENDIF(GTK_gthread_LIBRARY)
-    IF(GTK_Xi_LIBRARY)
-      SET(GTK_LIBRARIES ${GTK_LIBRARIES} ${GTK_Xi_LIBRARY})
-    ENDIF(GTK_Xi_LIBRARY)
+    if(GTK_gmodule_LIBRARY)
+      set(GTK_LIBRARIES ${GTK_LIBRARIES} ${GTK_gmodule_LIBRARY})
+    endif(GTK_gmodule_LIBRARY)
+    if(GTK_gthread_LIBRARY)
+      set(GTK_LIBRARIES ${GTK_LIBRARIES} ${GTK_gthread_LIBRARY})
+    endif(GTK_gthread_LIBRARY)
+    if(GTK_Xi_LIBRARY)
+      set(GTK_LIBRARIES ${GTK_LIBRARIES} ${GTK_Xi_LIBRARY})
+    endif(GTK_Xi_LIBRARY)
 
-    IF(GTK_gtkgl_INCLUDE_PATH AND GTK_gtkgl_LIBRARY)
-      SET( GTK_GL_FOUND "YES" )
-      SET( GTK_INCLUDE_DIR  ${GTK_INCLUDE_DIR}
+    if(GTK_gtkgl_INCLUDE_PATH AND GTK_gtkgl_LIBRARY)
+      set( GTK_GL_FOUND "YES" )
+      set( GTK_INCLUDE_DIR  ${GTK_INCLUDE_DIR}
                             ${GTK_gtkgl_INCLUDE_PATH} )
-      SET( GTK_LIBRARIES  ${GTK_gtkgl_LIBRARY} ${GTK_LIBRARIES} )
-      MARK_AS_ADVANCED(
+      set( GTK_LIBRARIES  ${GTK_gtkgl_LIBRARY} ${GTK_LIBRARIES} )
+      mark_as_advanced(
         GTK_gtkgl_LIBRARY
         GTK_gtkgl_INCLUDE_PATH
         )
-    ENDIF(GTK_gtkgl_INCLUDE_PATH AND GTK_gtkgl_LIBRARY)
+    endif(GTK_gtkgl_INCLUDE_PATH AND GTK_gtkgl_LIBRARY)
 
-  ENDIF(GTK_gtk_INCLUDE_PATH
+  endif(GTK_gtk_INCLUDE_PATH
      AND GTK_glibconfig_INCLUDE_PATH
      AND GTK_glib_INCLUDE_PATH
      AND GTK_gtk_LIBRARY
      AND GTK_glib_LIBRARY)
 
-  MARK_AS_ADVANCED(
+  mark_as_advanced(
     GTK_gdk_LIBRARY
     GTK_glib_INCLUDE_PATH
     GTK_glib_LIBRARY
@@ -159,7 +159,7 @@ IF(UNIX)
     GTK_gtkgl_LIBRARY
   )
 
-ENDIF(UNIX)
+endif(UNIX)
 
 
 
diff --git a/Modules/FindGettext.cmake b/Modules/FindGettext.cmake
index 6dbc02618..a801a29c8 100644
--- a/Modules/FindGettext.cmake
+++ b/Modules/FindGettext.cmake
@@ -39,182 +39,182 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PROGRAM(GETTEXT_MSGMERGE_EXECUTABLE msgmerge)
+find_program(GETTEXT_MSGMERGE_EXECUTABLE msgmerge)
 
-FIND_PROGRAM(GETTEXT_MSGFMT_EXECUTABLE msgfmt)
+find_program(GETTEXT_MSGFMT_EXECUTABLE msgfmt)
 
-IF(GETTEXT_MSGMERGE_EXECUTABLE)
-   EXECUTE_PROCESS(COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --version
+if(GETTEXT_MSGMERGE_EXECUTABLE)
+   execute_process(COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --version
                   OUTPUT_VARIABLE gettext_version
                   ERROR_QUIET
                   OUTPUT_STRIP_TRAILING_WHITESPACE)
-   IF (gettext_version MATCHES "^msgmerge \\(.*\\) [0-9]")
-      STRING(REGEX REPLACE "^msgmerge \\([^\\)]*\\) ([0-9\\.]+[^ \n]*).*" "\\1" GETTEXT_VERSION_STRING "${gettext_version}")
-   ENDIF()
-   UNSET(gettext_version)
-ENDIF(GETTEXT_MSGMERGE_EXECUTABLE)
+   if (gettext_version MATCHES "^msgmerge \\(.*\\) [0-9]")
+      string(REGEX REPLACE "^msgmerge \\([^\\)]*\\) ([0-9\\.]+[^ \n]*).*" "\\1" GETTEXT_VERSION_STRING "${gettext_version}")
+   endif()
+   unset(gettext_version)
+endif(GETTEXT_MSGMERGE_EXECUTABLE)
 
-INCLUDE(FindPackageHandleStandardArgs)
+include(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gettext
                                   REQUIRED_VARS GETTEXT_MSGMERGE_EXECUTABLE GETTEXT_MSGFMT_EXECUTABLE
                                   VERSION_VAR GETTEXT_VERSION_STRING)
 
-INCLUDE(CMakeParseArguments)
+include(CMakeParseArguments)
 
-FUNCTION(_GETTEXT_GET_UNIQUE_TARGET_NAME _name _unique_name)
-   SET(propertyName "_GETTEXT_UNIQUE_COUNTER_${_name}")
-   GET_PROPERTY(currentCounter GLOBAL PROPERTY "${propertyName}")
-   IF(NOT currentCounter)
-      SET(currentCounter 1)
-   ENDIF()
-   SET(${_unique_name} "${_name}_${currentCounter}" PARENT_SCOPE)
-   MATH(EXPR currentCounter "${currentCounter} + 1")
-   SET_PROPERTY(GLOBAL PROPERTY ${propertyName} ${currentCounter} )
-ENDFUNCTION()
+function(_GETTEXT_GET_UNIQUE_TARGET_NAME _name _unique_name)
+   set(propertyName "_GETTEXT_UNIQUE_COUNTER_${_name}")
+   get_property(currentCounter GLOBAL PROPERTY "${propertyName}")
+   if(NOT currentCounter)
+      set(currentCounter 1)
+   endif()
+   set(${_unique_name} "${_name}_${currentCounter}" PARENT_SCOPE)
+   math(EXPR currentCounter "${currentCounter} + 1")
+   set_property(GLOBAL PROPERTY ${propertyName} ${currentCounter} )
+endfunction()
 
-MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg)
+macro(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg)
    # make it a real variable, so we can modify it here
-   SET(_firstPoFile "${_firstPoFileArg}")
+   set(_firstPoFile "${_firstPoFileArg}")
 
-   SET(_gmoFiles)
-   GET_FILENAME_COMPONENT(_potName ${_potFile} NAME)
-   STRING(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _potBasename ${_potName})
-   GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE)
+   set(_gmoFiles)
+   get_filename_component(_potName ${_potFile} NAME)
+   string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _potBasename ${_potName})
+   get_filename_component(_absPotFile ${_potFile} ABSOLUTE)
 
-   SET(_addToAll)
-   IF(${_firstPoFile} STREQUAL "ALL")
-      SET(_addToAll "ALL")
-      SET(_firstPoFile)
-   ENDIF(${_firstPoFile} STREQUAL "ALL")
+   set(_addToAll)
+   if(${_firstPoFile} STREQUAL "ALL")
+      set(_addToAll "ALL")
+      set(_firstPoFile)
+   endif(${_firstPoFile} STREQUAL "ALL")
 
-   FOREACH (_currentPoFile ${_firstPoFile} ${ARGN})
-      GET_FILENAME_COMPONENT(_absFile ${_currentPoFile} ABSOLUTE)
-      GET_FILENAME_COMPONENT(_abs_PATH ${_absFile} PATH)
-      GET_FILENAME_COMPONENT(_lang ${_absFile} NAME_WE)
-      SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)
+   foreach (_currentPoFile ${_firstPoFile} ${ARGN})
+      get_filename_component(_absFile ${_currentPoFile} ABSOLUTE)
+      get_filename_component(_abs_PATH ${_absFile} PATH)
+      get_filename_component(_lang ${_absFile} NAME_WE)
+      set(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)
 
-      ADD_CUSTOM_COMMAND(
+      add_custom_command(
          OUTPUT ${_gmoFile}
          COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_absFile} ${_absPotFile}
          COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_absFile}
          DEPENDS ${_absPotFile} ${_absFile}
       )
 
-      INSTALL(FILES ${_gmoFile} DESTINATION share/locale/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
-      SET(_gmoFiles ${_gmoFiles} ${_gmoFile})
+      install(FILES ${_gmoFile} DESTINATION share/locale/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
+      set(_gmoFiles ${_gmoFiles} ${_gmoFile})
 
-   ENDFOREACH (_currentPoFile )
+   endforeach (_currentPoFile )
 
-   IF(NOT TARGET translations)
-      ADD_CUSTOM_TARGET(translations)
-   ENDIF()
+   if(NOT TARGET translations)
+      add_custom_target(translations)
+   endif()
 
   _GETTEXT_GET_UNIQUE_TARGET_NAME(translations uniqueTargetName)
 
-   ADD_CUSTOM_TARGET(${uniqueTargetName} ${_addToAll} DEPENDS ${_gmoFiles})
+   add_custom_target(${uniqueTargetName} ${_addToAll} DEPENDS ${_gmoFiles})
 
-   ADD_DEPENDENCIES(translations ${uniqueTargetName})
+   add_dependencies(translations ${uniqueTargetName})
 
-ENDMACRO(GETTEXT_CREATE_TRANSLATIONS )
+endmacro(GETTEXT_CREATE_TRANSLATIONS )
 
 
-FUNCTION(GETTEXT_PROCESS_POT_FILE _potFile)
-   SET(_gmoFiles)
-   SET(_options ALL)
-   SET(_oneValueArgs INSTALL_DESTINATION)
-   SET(_multiValueArgs LANGUAGES)
+function(GETTEXT_PROCESS_POT_FILE _potFile)
+   set(_gmoFiles)
+   set(_options ALL)
+   set(_oneValueArgs INSTALL_DESTINATION)
+   set(_multiValueArgs LANGUAGES)
 
    CMAKE_PARSE_ARGUMENTS(_parsedArguments "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
 
-   GET_FILENAME_COMPONENT(_potName ${_potFile} NAME)
-   STRING(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _potBasename ${_potName})
-   GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE)
+   get_filename_component(_potName ${_potFile} NAME)
+   string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _potBasename ${_potName})
+   get_filename_component(_absPotFile ${_potFile} ABSOLUTE)
 
-   FOREACH (_lang ${_parsedArguments_LANGUAGES})
-      SET(_poFile  "${CMAKE_CURRENT_BINARY_DIR}/${_lang}.po")
-      SET(_gmoFile "${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo")
+   foreach (_lang ${_parsedArguments_LANGUAGES})
+      set(_poFile  "${CMAKE_CURRENT_BINARY_DIR}/${_lang}.po")
+      set(_gmoFile "${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo")
 
-      ADD_CUSTOM_COMMAND(
+      add_custom_command(
          OUTPUT "${_poFile}"
          COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_poFile} ${_absPotFile}
          DEPENDS ${_absPotFile}
       )
 
-      ADD_CUSTOM_COMMAND(
+      add_custom_command(
          OUTPUT "${_gmoFile}"
          COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_poFile}
          DEPENDS ${_absPotFile} ${_poFile}
       )
 
-      IF(_parsedArguments_INSTALL_DESTINATION)
-         INSTALL(FILES ${_gmoFile} DESTINATION ${_parsedArguments_INSTALL_DESTINATION}/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
-      ENDIF(_parsedArguments_INSTALL_DESTINATION)
-      LIST(APPEND _gmoFiles ${_gmoFile})
-   ENDFOREACH (_lang )
+      if(_parsedArguments_INSTALL_DESTINATION)
+         install(FILES ${_gmoFile} DESTINATION ${_parsedArguments_INSTALL_DESTINATION}/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
+      endif(_parsedArguments_INSTALL_DESTINATION)
+      list(APPEND _gmoFiles ${_gmoFile})
+   endforeach (_lang )
 
-  IF(NOT TARGET potfiles)
-     ADD_CUSTOM_TARGET(potfiles)
-  ENDIF()
+  if(NOT TARGET potfiles)
+     add_custom_target(potfiles)
+  endif()
 
   _GETTEXT_GET_UNIQUE_TARGET_NAME( potfiles uniqueTargetName)
 
-   IF(_parsedArguments_ALL)
-      ADD_CUSTOM_TARGET(${uniqueTargetName} ALL DEPENDS ${_gmoFiles})
-   ELSE(_parsedArguments_ALL)
-      ADD_CUSTOM_TARGET(${uniqueTargetName} DEPENDS ${_gmoFiles})
-   ENDIF(_parsedArguments_ALL)
+   if(_parsedArguments_ALL)
+      add_custom_target(${uniqueTargetName} ALL DEPENDS ${_gmoFiles})
+   else(_parsedArguments_ALL)
+      add_custom_target(${uniqueTargetName} DEPENDS ${_gmoFiles})
+   endif(_parsedArguments_ALL)
 
-   ADD_DEPENDENCIES(potfiles ${uniqueTargetName})
+   add_dependencies(potfiles ${uniqueTargetName})
 
-ENDFUNCTION(GETTEXT_PROCESS_POT_FILE)
+endfunction(GETTEXT_PROCESS_POT_FILE)
 
 
-FUNCTION(GETTEXT_PROCESS_PO_FILES _lang)
-   SET(_options ALL)
-   SET(_oneValueArgs INSTALL_DESTINATION)
-   SET(_multiValueArgs PO_FILES)
-   SET(_gmoFiles)
+function(GETTEXT_PROCESS_PO_FILES _lang)
+   set(_options ALL)
+   set(_oneValueArgs INSTALL_DESTINATION)
+   set(_multiValueArgs PO_FILES)
+   set(_gmoFiles)
 
    CMAKE_PARSE_ARGUMENTS(_parsedArguments "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
 
-   FOREACH(_current_PO_FILE ${_parsedArguments_PO_FILES})
-      GET_FILENAME_COMPONENT(_name ${_current_PO_FILE} NAME)
-      STRING(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _basename ${_name})
-      SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo)
-      ADD_CUSTOM_COMMAND(OUTPUT ${_gmoFile}
+   foreach(_current_PO_FILE ${_parsedArguments_PO_FILES})
+      get_filename_component(_name ${_current_PO_FILE} NAME)
+      string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _basename ${_name})
+      set(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo)
+      add_custom_command(OUTPUT ${_gmoFile}
             COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_current_PO_FILE}
             WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
             DEPENDS ${_current_PO_FILE}
          )
 
-      IF(_parsedArguments_INSTALL_DESTINATION)
-         INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo DESTINATION ${_parsedArguments_INSTALL_DESTINATION}/${_lang}/LC_MESSAGES/ RENAME ${_basename}.mo)
-      ENDIF(_parsedArguments_INSTALL_DESTINATION)
-      LIST(APPEND _gmoFiles ${_gmoFile})
-   ENDFOREACH(_current_PO_FILE)
+      if(_parsedArguments_INSTALL_DESTINATION)
+         install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo DESTINATION ${_parsedArguments_INSTALL_DESTINATION}/${_lang}/LC_MESSAGES/ RENAME ${_basename}.mo)
+      endif(_parsedArguments_INSTALL_DESTINATION)
+      list(APPEND _gmoFiles ${_gmoFile})
+   endforeach(_current_PO_FILE)
 
 
-  IF(NOT TARGET pofiles)
-     ADD_CUSTOM_TARGET(pofiles)
-  ENDIF()
+  if(NOT TARGET pofiles)
+     add_custom_target(pofiles)
+  endif()
 
   _GETTEXT_GET_UNIQUE_TARGET_NAME( pofiles uniqueTargetName)
 
-   IF(_parsedArguments_ALL)
-      ADD_CUSTOM_TARGET(${uniqueTargetName} ALL DEPENDS ${_gmoFiles})
-   ELSE(_parsedArguments_ALL)
-      ADD_CUSTOM_TARGET(${uniqueTargetName} DEPENDS ${_gmoFiles})
-   ENDIF(_parsedArguments_ALL)
+   if(_parsedArguments_ALL)
+      add_custom_target(${uniqueTargetName} ALL DEPENDS ${_gmoFiles})
+   else(_parsedArguments_ALL)
+      add_custom_target(${uniqueTargetName} DEPENDS ${_gmoFiles})
+   endif(_parsedArguments_ALL)
 
-   ADD_DEPENDENCIES(pofiles ${uniqueTargetName})
+   add_dependencies(pofiles ${uniqueTargetName})
 
-ENDFUNCTION(GETTEXT_PROCESS_PO_FILES)
+endfunction(GETTEXT_PROCESS_PO_FILES)
 
-IF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
-   SET(GETTEXT_FOUND TRUE)
-ELSE (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
-   SET(GETTEXT_FOUND FALSE)
-   IF (GetText_REQUIRED)
-      MESSAGE(FATAL_ERROR "GetText not found")
-   ENDIF (GetText_REQUIRED)
-ENDIF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
+if (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
+   set(GETTEXT_FOUND TRUE)
+else (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
+   set(GETTEXT_FOUND FALSE)
+   if (GetText_REQUIRED)
+      message(FATAL_ERROR "GetText not found")
+   endif (GetText_REQUIRED)
+endif (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
diff --git a/Modules/FindGnuTLS.cmake b/Modules/FindGnuTLS.cmake
index 617f58f26..a05efe6b0 100644
--- a/Modules/FindGnuTLS.cmake
+++ b/Modules/FindGnuTLS.cmake
@@ -26,44 +26,44 @@
 # Note that this doesn't try to find the gnutls-extra package.
 
 
-IF (GNUTLS_INCLUDE_DIR AND GNUTLS_LIBRARY)
+if (GNUTLS_INCLUDE_DIR AND GNUTLS_LIBRARY)
    # in cache already
-   SET(gnutls_FIND_QUIETLY TRUE)
-ENDIF (GNUTLS_INCLUDE_DIR AND GNUTLS_LIBRARY)
+   set(gnutls_FIND_QUIETLY TRUE)
+endif (GNUTLS_INCLUDE_DIR AND GNUTLS_LIBRARY)
 
-IF (NOT WIN32)
+if (NOT WIN32)
    # try using pkg-config to get the directories and then use these values
-   # in the FIND_PATH() and FIND_LIBRARY() calls
+   # in the find_path() and find_library() calls
    # also fills in GNUTLS_DEFINITIONS, although that isn't normally useful
-   FIND_PACKAGE(PkgConfig QUIET)
+   find_package(PkgConfig QUIET)
    PKG_CHECK_MODULES(PC_GNUTLS QUIET gnutls)
-   SET(GNUTLS_DEFINITIONS ${PC_GNUTLS_CFLAGS_OTHER})
-   SET(GNUTLS_VERSION_STRING ${PC_GNUTLS_VERSION})
-ENDIF (NOT WIN32)
+   set(GNUTLS_DEFINITIONS ${PC_GNUTLS_CFLAGS_OTHER})
+   set(GNUTLS_VERSION_STRING ${PC_GNUTLS_VERSION})
+endif (NOT WIN32)
 
-FIND_PATH(GNUTLS_INCLUDE_DIR gnutls/gnutls.h
+find_path(GNUTLS_INCLUDE_DIR gnutls/gnutls.h
    HINTS
    ${PC_GNUTLS_INCLUDEDIR}
    ${PC_GNUTLS_INCLUDE_DIRS}
    )
 
-FIND_LIBRARY(GNUTLS_LIBRARY NAMES gnutls libgnutls
+find_library(GNUTLS_LIBRARY NAMES gnutls libgnutls
    HINTS
    ${PC_GNUTLS_LIBDIR}
    ${PC_GNUTLS_LIBRARY_DIRS}
    )
 
-MARK_AS_ADVANCED(GNUTLS_INCLUDE_DIR GNUTLS_LIBRARY)
+mark_as_advanced(GNUTLS_INCLUDE_DIR GNUTLS_LIBRARY)
 
 # handle the QUIETLY and REQUIRED arguments and set GNUTLS_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(GnuTLS
                                   REQUIRED_VARS GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR
                                   VERSION_VAR GNUTLS_VERSION_STRING)
 
-IF(GNUTLS_FOUND)
-    SET(GNUTLS_LIBRARIES    ${GNUTLS_LIBRARY})
-    SET(GNUTLS_INCLUDE_DIRS ${GNUTLS_INCLUDE_DIR})
-ENDIF()
+if(GNUTLS_FOUND)
+    set(GNUTLS_LIBRARIES    ${GNUTLS_LIBRARY})
+    set(GNUTLS_INCLUDE_DIRS ${GNUTLS_INCLUDE_DIR})
+endif()
 
diff --git a/Modules/FindGnuplot.cmake b/Modules/FindGnuplot.cmake
index d5730476d..07af0bf20 100644
--- a/Modules/FindGnuplot.cmake
+++ b/Modules/FindGnuplot.cmake
@@ -21,9 +21,9 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE(FindCygwin)
+include(FindCygwin)
 
-FIND_PROGRAM(GNUPLOT_EXECUTABLE
+find_program(GNUPLOT_EXECUTABLE
   NAMES
   gnuplot
   pgnuplot
@@ -32,26 +32,26 @@ FIND_PROGRAM(GNUPLOT_EXECUTABLE
   ${CYGWIN_INSTALL_PATH}/bin
 )
 
-IF (GNUPLOT_EXECUTABLE)
-    EXECUTE_PROCESS(COMMAND "${GNUPLOT_EXECUTABLE}" --version
+if (GNUPLOT_EXECUTABLE)
+    execute_process(COMMAND "${GNUPLOT_EXECUTABLE}" --version
                   OUTPUT_VARIABLE GNUPLOT_OUTPUT_VARIABLE
                   ERROR_QUIET
                   OUTPUT_STRIP_TRAILING_WHITESPACE)
 
-    STRING(REGEX REPLACE "^gnuplot ([0-9\\.]+)( patchlevel )?" "\\1." GNUPLOT_VERSION_STRING "${GNUPLOT_OUTPUT_VARIABLE}")
-    STRING(REGEX REPLACE "\\.$" "" GNUPLOT_VERSION_STRING "${GNUPLOT_VERSION_STRING}")
-    UNSET(GNUPLOT_OUTPUT_VARIABLE)
-ENDIF()
+    string(REGEX REPLACE "^gnuplot ([0-9\\.]+)( patchlevel )?" "\\1." GNUPLOT_VERSION_STRING "${GNUPLOT_OUTPUT_VARIABLE}")
+    string(REGEX REPLACE "\\.$" "" GNUPLOT_VERSION_STRING "${GNUPLOT_VERSION_STRING}")
+    unset(GNUPLOT_OUTPUT_VARIABLE)
+endif()
 
 # for compatibility
-SET(GNUPLOT ${GNUPLOT_EXECUTABLE})
+set(GNUPLOT ${GNUPLOT_EXECUTABLE})
 
 # handle the QUIETLY and REQUIRED arguments and set GNUPLOT_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gnuplot
                                   REQUIRED_VARS GNUPLOT_EXECUTABLE
                                   VERSION_VAR GNUPLOT_VERSION_STRING)
 
-MARK_AS_ADVANCED( GNUPLOT_EXECUTABLE )
+mark_as_advanced( GNUPLOT_EXECUTABLE )
 
diff --git a/Modules/FindHSPELL.cmake b/Modules/FindHSPELL.cmake
index 79bfc81bb..05b55059b 100644
--- a/Modules/FindHSPELL.cmake
+++ b/Modules/FindHSPELL.cmake
@@ -24,23 +24,23 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PATH(HSPELL_INCLUDE_DIR hspell.h)
+find_path(HSPELL_INCLUDE_DIR hspell.h)
 
-FIND_LIBRARY(HSPELL_LIBRARIES NAMES hspell)
+find_library(HSPELL_LIBRARIES NAMES hspell)
 
-IF (HSPELL_INCLUDE_DIR)
-    FILE(READ "${HSPELL_INCLUDE_DIR}/hspell.h" HSPELL_H)
-    STRING(REGEX REPLACE ".*#define HSPELL_VERSION_MAJOR ([0-9]+).*" "\\1" HSPELL_VERSION_MAJOR "${HSPELL_H}")
-    STRING(REGEX REPLACE ".*#define HSPELL_VERSION_MINOR ([0-9]+).*" "\\1" HSPELL_VERSION_MINOR "${HSPELL_H}")
-    SET(HSPELL_VERSION_STRING "${HSPELL_VERSION_MAJOR}.${HSPELL_VERSION_MINOR}")
-ENDIF()
+if (HSPELL_INCLUDE_DIR)
+    file(READ "${HSPELL_INCLUDE_DIR}/hspell.h" HSPELL_H)
+    string(REGEX REPLACE ".*#define HSPELL_VERSION_MAJOR ([0-9]+).*" "\\1" HSPELL_VERSION_MAJOR "${HSPELL_H}")
+    string(REGEX REPLACE ".*#define HSPELL_VERSION_MINOR ([0-9]+).*" "\\1" HSPELL_VERSION_MINOR "${HSPELL_H}")
+    set(HSPELL_VERSION_STRING "${HSPELL_VERSION_MAJOR}.${HSPELL_VERSION_MINOR}")
+endif()
 
 # handle the QUIETLY and REQUIRED arguments and set HSPELL_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(HSPELL
                                   REQUIRED_VARS HSPELL_LIBRARIES HSPELL_INCLUDE_DIR
                                   VERSION_VAR HSPELL_VERSION_STRING)
 
-MARK_AS_ADVANCED(HSPELL_INCLUDE_DIR HSPELL_LIBRARIES)
+mark_as_advanced(HSPELL_INCLUDE_DIR HSPELL_LIBRARIES)
 
diff --git a/Modules/FindHTMLHelp.cmake b/Modules/FindHTMLHelp.cmake
index 00de82afd..d51b3987a 100644
--- a/Modules/FindHTMLHelp.cmake
+++ b/Modules/FindHTMLHelp.cmake
@@ -18,18 +18,18 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-IF(WIN32)
+if(WIN32)
 
-  FIND_PROGRAM(HTML_HELP_COMPILER
+  find_program(HTML_HELP_COMPILER
     hhc
     "[HKEY_CURRENT_USER\\Software\\Microsoft\\HTML Help Workshop;InstallDir]"
     "$ENV{ProgramFiles}/HTML Help Workshop"
     "C:/Program Files/HTML Help Workshop"
     )
 
-  GET_FILENAME_COMPONENT(HTML_HELP_COMPILER_PATH "${HTML_HELP_COMPILER}" PATH)
+  get_filename_component(HTML_HELP_COMPILER_PATH "${HTML_HELP_COMPILER}" PATH)
 
-  FIND_PATH(HTML_HELP_INCLUDE_PATH
+  find_path(HTML_HELP_INCLUDE_PATH
     htmlhelp.h
     "${HTML_HELP_COMPILER_PATH}/include"
     "[HKEY_CURRENT_USER\\Software\\Microsoft\\HTML Help Workshop;InstallDir]/include"
@@ -37,7 +37,7 @@ IF(WIN32)
     "C:/Program Files/HTML Help Workshop/include"
     )
 
-  FIND_LIBRARY(HTML_HELP_LIBRARY
+  find_library(HTML_HELP_LIBRARY
     htmlhelp
     "${HTML_HELP_COMPILER_PATH}/lib"
     "[HKEY_CURRENT_USER\\Software\\Microsoft\\HTML Help Workshop;InstallDir]/lib"
@@ -45,10 +45,10 @@ IF(WIN32)
     "C:/Program Files/HTML Help Workshop/lib"
     )
 
-  MARK_AS_ADVANCED(
+  mark_as_advanced(
     HTML_HELP_COMPILER
     HTML_HELP_INCLUDE_PATH
     HTML_HELP_LIBRARY
     )
 
-ENDIF(WIN32)
+endif(WIN32)
diff --git a/Modules/FindITK.cmake b/Modules/FindITK.cmake
index 5b598d230..b0b3f03f0 100644
--- a/Modules/FindITK.cmake
+++ b/Modules/FindITK.cmake
@@ -36,22 +36,22 @@
 # Use the Config mode of the find_package() command to find ITKConfig.
 # If this succeeds (possibly because ITK_DIR is already set), the
 # command will have already loaded ITKConfig.cmake and set ITK_FOUND.
-IF(NOT ITK_FOUND)
-  SET(_ITK_REQUIRED "")
-  IF(ITK_FIND_REQUIRED)
-    SET(_ITK_REQUIRED REQUIRED)
-  ENDIF()
-  SET(_ITK_QUIET "")
-  IF(ITK_FIND_QUIETLY)
-    SET(_ITK_QUIET QUIET)
-  ENDIF()
-  FIND_PACKAGE(ITK ${_ITK_REQUIRED} ${_ITK_QUIET} NO_MODULE
+if(NOT ITK_FOUND)
+  set(_ITK_REQUIRED "")
+  if(ITK_FIND_REQUIRED)
+    set(_ITK_REQUIRED REQUIRED)
+  endif()
+  set(_ITK_QUIET "")
+  if(ITK_FIND_QUIETLY)
+    set(_ITK_QUIET QUIET)
+  endif()
+  find_package(ITK ${_ITK_REQUIRED} ${_ITK_QUIET} NO_MODULE
     NAMES ITK InsightToolkit
     CONFIGS ITKConfig.cmake
     )
-ENDIF()
+endif()
 
-IF(ITK_FOUND)
+if(ITK_FOUND)
   # Set USE_ITK_FILE for backward-compatability.
-  SET(USE_ITK_FILE ${ITK_USE_FILE})
-ENDIF()
+  set(USE_ITK_FILE ${ITK_USE_FILE})
+endif()
diff --git a/Modules/FindImageMagick.cmake b/Modules/FindImageMagick.cmake
index f21b63008..436bb4bb6 100644
--- a/Modules/FindImageMagick.cmake
+++ b/Modules/FindImageMagick.cmake
@@ -45,11 +45,11 @@
 #  ImageMagick_<component>_LIBRARIES    - Full path to <component> libraries.
 #
 # Example Usages:
-#  FIND_PACKAGE(ImageMagick)
-#  FIND_PACKAGE(ImageMagick COMPONENTS convert)
-#  FIND_PACKAGE(ImageMagick COMPONENTS convert mogrify display)
-#  FIND_PACKAGE(ImageMagick COMPONENTS Magick++)
-#  FIND_PACKAGE(ImageMagick COMPONENTS Magick++ convert)
+#  find_package(ImageMagick)
+#  find_package(ImageMagick COMPONENTS convert)
+#  find_package(ImageMagick COMPONENTS convert mogrify display)
+#  find_package(ImageMagick COMPONENTS Magick++)
+#  find_package(ImageMagick COMPONENTS Magick++ convert)
 #
 # Note that the standard FIND_PACKAGE features are supported
 # (i.e., QUIET, REQUIRED, etc.).
@@ -72,10 +72,10 @@
 #---------------------------------------------------------------------
 # Helper functions
 #---------------------------------------------------------------------
-FUNCTION(FIND_IMAGEMAGICK_API component header)
-  SET(ImageMagick_${component}_FOUND FALSE PARENT_SCOPE)
+function(FIND_IMAGEMAGICK_API component header)
+  set(ImageMagick_${component}_FOUND FALSE PARENT_SCOPE)
 
-  FIND_PATH(ImageMagick_${component}_INCLUDE_DIR
+  find_path(ImageMagick_${component}_INCLUDE_DIR
     NAMES ${header}
     PATHS
       ${ImageMagick_INCLUDE_DIRS}
@@ -84,150 +84,150 @@ FUNCTION(FIND_IMAGEMAGICK_API component header)
       ImageMagick
     DOC "Path to the ImageMagick include dir."
     )
-  FIND_LIBRARY(ImageMagick_${component}_LIBRARY
+  find_library(ImageMagick_${component}_LIBRARY
     NAMES ${ARGN}
     PATHS
       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ImageMagick\\Current;BinPath]/lib"
     DOC "Path to the ImageMagick Magick++ library."
     )
 
-  IF(ImageMagick_${component}_INCLUDE_DIR AND ImageMagick_${component}_LIBRARY)
-    SET(ImageMagick_${component}_FOUND TRUE PARENT_SCOPE)
+  if(ImageMagick_${component}_INCLUDE_DIR AND ImageMagick_${component}_LIBRARY)
+    set(ImageMagick_${component}_FOUND TRUE PARENT_SCOPE)
 
-    LIST(APPEND ImageMagick_INCLUDE_DIRS
+    list(APPEND ImageMagick_INCLUDE_DIRS
       ${ImageMagick_${component}_INCLUDE_DIR}
       )
-    LIST(REMOVE_DUPLICATES ImageMagick_INCLUDE_DIRS)
-    SET(ImageMagick_INCLUDE_DIRS ${ImageMagick_INCLUDE_DIRS} PARENT_SCOPE)
+    list(REMOVE_DUPLICATES ImageMagick_INCLUDE_DIRS)
+    set(ImageMagick_INCLUDE_DIRS ${ImageMagick_INCLUDE_DIRS} PARENT_SCOPE)
 
-    LIST(APPEND ImageMagick_LIBRARIES
+    list(APPEND ImageMagick_LIBRARIES
       ${ImageMagick_${component}_LIBRARY}
       )
-    SET(ImageMagick_LIBRARIES ${ImageMagick_LIBRARIES} PARENT_SCOPE)
-  ENDIF(ImageMagick_${component}_INCLUDE_DIR AND ImageMagick_${component}_LIBRARY)
-ENDFUNCTION(FIND_IMAGEMAGICK_API)
+    set(ImageMagick_LIBRARIES ${ImageMagick_LIBRARIES} PARENT_SCOPE)
+  endif(ImageMagick_${component}_INCLUDE_DIR AND ImageMagick_${component}_LIBRARY)
+endfunction(FIND_IMAGEMAGICK_API)
 
-FUNCTION(FIND_IMAGEMAGICK_EXE component)
-  SET(_IMAGEMAGICK_EXECUTABLE
+function(FIND_IMAGEMAGICK_EXE component)
+  set(_IMAGEMAGICK_EXECUTABLE
     ${ImageMagick_EXECUTABLE_DIR}/${component}${CMAKE_EXECUTABLE_SUFFIX})
-  IF(EXISTS ${_IMAGEMAGICK_EXECUTABLE})
-    SET(ImageMagick_${component}_EXECUTABLE
+  if(EXISTS ${_IMAGEMAGICK_EXECUTABLE})
+    set(ImageMagick_${component}_EXECUTABLE
       ${_IMAGEMAGICK_EXECUTABLE}
        PARENT_SCOPE
        )
-    SET(ImageMagick_${component}_FOUND TRUE PARENT_SCOPE)
-  ELSE(EXISTS ${_IMAGEMAGICK_EXECUTABLE})
-    SET(ImageMagick_${component}_FOUND FALSE PARENT_SCOPE)
-  ENDIF(EXISTS ${_IMAGEMAGICK_EXECUTABLE})
-ENDFUNCTION(FIND_IMAGEMAGICK_EXE)
+    set(ImageMagick_${component}_FOUND TRUE PARENT_SCOPE)
+  else(EXISTS ${_IMAGEMAGICK_EXECUTABLE})
+    set(ImageMagick_${component}_FOUND FALSE PARENT_SCOPE)
+  endif(EXISTS ${_IMAGEMAGICK_EXECUTABLE})
+endfunction(FIND_IMAGEMAGICK_EXE)
 
 #---------------------------------------------------------------------
 # Start Actual Work
 #---------------------------------------------------------------------
 # Try to find a ImageMagick installation binary path.
-FIND_PATH(ImageMagick_EXECUTABLE_DIR
+find_path(ImageMagick_EXECUTABLE_DIR
   NAMES mogrify${CMAKE_EXECUTABLE_SUFFIX}
   PATHS
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ImageMagick\\Current;BinPath]"
   DOC "Path to the ImageMagick binary directory."
   NO_DEFAULT_PATH
   )
-FIND_PATH(ImageMagick_EXECUTABLE_DIR
+find_path(ImageMagick_EXECUTABLE_DIR
   NAMES mogrify${CMAKE_EXECUTABLE_SUFFIX}
   )
 
 # Find each component. Search for all tools in same dir
 # <ImageMagick_EXECUTABLE_DIR>; otherwise they should be found
 # independently and not in a cohesive module such as this one.
-UNSET(ImageMagick_REQUIRED_VARS)
-UNSET(ImageMagick_DEFAULT_EXECUTABLES)
-FOREACH(component ${ImageMagick_FIND_COMPONENTS}
+unset(ImageMagick_REQUIRED_VARS)
+unset(ImageMagick_DEFAULT_EXECUTABLES)
+foreach(component ${ImageMagick_FIND_COMPONENTS}
     # DEPRECATED: forced components for backward compatibility
     convert mogrify import montage composite
     )
-  IF(component STREQUAL "Magick++")
+  if(component STREQUAL "Magick++")
     FIND_IMAGEMAGICK_API(Magick++ Magick++.h
       Magick++ CORE_RL_Magick++_
       )
-    LIST(APPEND ImageMagick_REQUIRED_VARS ImageMagick_Magick++_LIBRARY)
-  ELSEIF(component STREQUAL "MagickWand")
+    list(APPEND ImageMagick_REQUIRED_VARS ImageMagick_Magick++_LIBRARY)
+  elseif(component STREQUAL "MagickWand")
     FIND_IMAGEMAGICK_API(MagickWand wand/MagickWand.h
       Wand MagickWand CORE_RL_wand_
       )
-    LIST(APPEND ImageMagick_REQUIRED_VARS ImageMagick_MagickWand_LIBRARY)
-  ELSEIF(component STREQUAL "MagickCore")
+    list(APPEND ImageMagick_REQUIRED_VARS ImageMagick_MagickWand_LIBRARY)
+  elseif(component STREQUAL "MagickCore")
     FIND_IMAGEMAGICK_API(MagickCore magick/MagickCore.h
       Magick MagickCore CORE_RL_magick_
       )
-    LIST(APPEND ImageMagick_REQUIRED_VARS ImageMagick_MagickCore_LIBRARY)
-  ELSE(component STREQUAL "Magick++")
-    IF(ImageMagick_EXECUTABLE_DIR)
+    list(APPEND ImageMagick_REQUIRED_VARS ImageMagick_MagickCore_LIBRARY)
+  else(component STREQUAL "Magick++")
+    if(ImageMagick_EXECUTABLE_DIR)
       FIND_IMAGEMAGICK_EXE(${component})
-    ENDIF(ImageMagick_EXECUTABLE_DIR)
+    endif(ImageMagick_EXECUTABLE_DIR)
 
-    IF(ImageMagick_FIND_COMPONENTS)
-      LIST(FIND ImageMagick_FIND_COMPONENTS ${component} is_requested)
-      IF(is_requested GREATER -1)
-        LIST(APPEND ImageMagick_REQUIRED_VARS ImageMagick_${component}_EXECUTABLE)
-      ENDIF(is_requested GREATER -1)
-    ELSEIF(ImageMagick_${component}_EXECUTABLE)
+    if(ImageMagick_FIND_COMPONENTS)
+      list(FIND ImageMagick_FIND_COMPONENTS ${component} is_requested)
+      if(is_requested GREATER -1)
+        list(APPEND ImageMagick_REQUIRED_VARS ImageMagick_${component}_EXECUTABLE)
+      endif(is_requested GREATER -1)
+    elseif(ImageMagick_${component}_EXECUTABLE)
       # if no components were requested explicitly put all (default) executables
       # in the list
-      LIST(APPEND ImageMagick_DEFAULT_EXECUTABLES ImageMagick_${component}_EXECUTABLE)
-    ENDIF(ImageMagick_FIND_COMPONENTS)
-  ENDIF(component STREQUAL "Magick++")
-ENDFOREACH(component)
+      list(APPEND ImageMagick_DEFAULT_EXECUTABLES ImageMagick_${component}_EXECUTABLE)
+    endif(ImageMagick_FIND_COMPONENTS)
+  endif(component STREQUAL "Magick++")
+endforeach(component)
 
-IF(NOT ImageMagick_FIND_COMPONENTS AND NOT ImageMagick_DEFAULT_EXECUTABLES)
+if(NOT ImageMagick_FIND_COMPONENTS AND NOT ImageMagick_DEFAULT_EXECUTABLES)
   # No components were requested, and none of the default components were
   # found. Just insert mogrify into the list of the default components to
   # find so FPHSA below has something to check
-  LIST(APPEND ImageMagick_REQUIRED_VARS ImageMagick_mogrify_EXECUTABLE)
-ELSEIF(ImageMagick_DEFAULT_EXECUTABLES)
-  LIST(APPEND ImageMagick_REQUIRED_VARS ${ImageMagick_DEFAULT_EXECUTABLES})
-ENDIF()
+  list(APPEND ImageMagick_REQUIRED_VARS ImageMagick_mogrify_EXECUTABLE)
+elseif(ImageMagick_DEFAULT_EXECUTABLES)
+  list(APPEND ImageMagick_REQUIRED_VARS ${ImageMagick_DEFAULT_EXECUTABLES})
+endif()
 
-SET(ImageMagick_INCLUDE_DIRS ${ImageMagick_INCLUDE_DIRS})
-SET(ImageMagick_LIBRARIES ${ImageMagick_LIBRARIES})
+set(ImageMagick_INCLUDE_DIRS ${ImageMagick_INCLUDE_DIRS})
+set(ImageMagick_LIBRARIES ${ImageMagick_LIBRARIES})
 
-IF(ImageMagick_mogrify_EXECUTABLE)
-  EXECUTE_PROCESS(COMMAND ${ImageMagick_mogrify_EXECUTABLE} -version
+if(ImageMagick_mogrify_EXECUTABLE)
+  execute_process(COMMAND ${ImageMagick_mogrify_EXECUTABLE} -version
                   OUTPUT_VARIABLE imagemagick_version
                   ERROR_QUIET
                   OUTPUT_STRIP_TRAILING_WHITESPACE)
-  IF(imagemagick_version MATCHES "^Version: ImageMagick [0-9]")
-    STRING(REGEX REPLACE "^Version: ImageMagick ([-0-9\\.]+).*" "\\1" ImageMagick_VERSION_STRING "${imagemagick_version}")
-  ENDIF()
-  UNSET(imagemagick_version)
-ENDIF(ImageMagick_mogrify_EXECUTABLE)
+  if(imagemagick_version MATCHES "^Version: ImageMagick [0-9]")
+    string(REGEX REPLACE "^Version: ImageMagick ([-0-9\\.]+).*" "\\1" ImageMagick_VERSION_STRING "${imagemagick_version}")
+  endif()
+  unset(imagemagick_version)
+endif(ImageMagick_mogrify_EXECUTABLE)
 
 #---------------------------------------------------------------------
 # Standard Package Output
 #---------------------------------------------------------------------
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(ImageMagick
                                   REQUIRED_VARS ${ImageMagick_REQUIRED_VARS}
                                   VERSION_VAR ImageMagick_VERSION_STRING
   )
 # Maintain consistency with all other variables.
-SET(ImageMagick_FOUND ${IMAGEMAGICK_FOUND})
+set(ImageMagick_FOUND ${IMAGEMAGICK_FOUND})
 
 #---------------------------------------------------------------------
 # DEPRECATED: Setting variables for backward compatibility.
 #---------------------------------------------------------------------
-SET(IMAGEMAGICK_BINARY_PATH          ${ImageMagick_EXECUTABLE_DIR}
+set(IMAGEMAGICK_BINARY_PATH          ${ImageMagick_EXECUTABLE_DIR}
     CACHE PATH "Path to the ImageMagick binary directory.")
-SET(IMAGEMAGICK_CONVERT_EXECUTABLE   ${ImageMagick_convert_EXECUTABLE}
+set(IMAGEMAGICK_CONVERT_EXECUTABLE   ${ImageMagick_convert_EXECUTABLE}
     CACHE FILEPATH "Path to ImageMagick's convert executable.")
-SET(IMAGEMAGICK_MOGRIFY_EXECUTABLE   ${ImageMagick_mogrify_EXECUTABLE}
+set(IMAGEMAGICK_MOGRIFY_EXECUTABLE   ${ImageMagick_mogrify_EXECUTABLE}
     CACHE FILEPATH "Path to ImageMagick's mogrify executable.")
-SET(IMAGEMAGICK_IMPORT_EXECUTABLE    ${ImageMagick_import_EXECUTABLE}
+set(IMAGEMAGICK_IMPORT_EXECUTABLE    ${ImageMagick_import_EXECUTABLE}
     CACHE FILEPATH "Path to ImageMagick's import executable.")
-SET(IMAGEMAGICK_MONTAGE_EXECUTABLE   ${ImageMagick_montage_EXECUTABLE}
+set(IMAGEMAGICK_MONTAGE_EXECUTABLE   ${ImageMagick_montage_EXECUTABLE}
     CACHE FILEPATH "Path to ImageMagick's montage executable.")
-SET(IMAGEMAGICK_COMPOSITE_EXECUTABLE ${ImageMagick_composite_EXECUTABLE}
+set(IMAGEMAGICK_COMPOSITE_EXECUTABLE ${ImageMagick_composite_EXECUTABLE}
     CACHE FILEPATH "Path to ImageMagick's composite executable.")
-MARK_AS_ADVANCED(
+mark_as_advanced(
   IMAGEMAGICK_BINARY_PATH
   IMAGEMAGICK_CONVERT_EXECUTABLE
   IMAGEMAGICK_MOGRIFY_EXECUTABLE
diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake
index f93b454a4..1dae07e7f 100644
--- a/Modules/FindJNI.cmake
+++ b/Modules/FindJNI.cmake
@@ -27,74 +27,74 @@
 #  License text for the above reference.)
 
 # Expand {libarch} occurences to java_libarch subdirectory(-ies) and set ${_var}
-MACRO(java_append_library_directories _var)
+macro(java_append_library_directories _var)
     # Determine java arch-specific library subdir
     # Mostly based on openjdk/jdk/make/common/shared/Platform.gmk as of openjdk
     # 1.6.0_18 + icedtea patches. However, it would be much better to base the
     # guess on the first part of the GNU config.guess platform triplet.
-    IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
-        SET(_java_libarch "amd64")
-    ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
-        SET(_java_libarch "i386")
-    ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^alpha")
-        SET(_java_libarch "alpha")
-    ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
+    if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+        set(_java_libarch "amd64")
+    elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
+        set(_java_libarch "i386")
+    elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^alpha")
+        set(_java_libarch "alpha")
+    elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
         # Subdir is "arm" for both big-endian (arm) and little-endian (armel).
-        SET(_java_libarch "arm")
-    ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
+        set(_java_libarch "arm")
+    elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
         # mips* machines are bi-endian mostly so processor does not tell
         # endianess of the underlying system.
-        SET(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "mips" "mipsel" "mipseb")
-    ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64")
-        SET(_java_libarch "ppc64")
-    ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)")
-        SET(_java_libarch "ppc")
-    ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc")
+        set(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "mips" "mipsel" "mipseb")
+    elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64")
+        set(_java_libarch "ppc64")
+    elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)")
+        set(_java_libarch "ppc")
+    elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc")
         # Both flavours can run on the same processor
-        SET(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "sparc" "sparcv9")
-    ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(parisc|hppa)")
-        SET(_java_libarch "parisc" "parisc64")
-    ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^s390")
+        set(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "sparc" "sparcv9")
+    elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(parisc|hppa)")
+        set(_java_libarch "parisc" "parisc64")
+    elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^s390")
         # s390 binaries can run on s390x machines
-        SET(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "s390" "s390x")
-    ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^sh")
-        SET(_java_libarch "sh")
-    ELSE(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
-        SET(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}")
-    ENDIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+        set(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "s390" "s390x")
+    elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^sh")
+        set(_java_libarch "sh")
+    else(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+        set(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}")
+    endif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
 
     # Append default list architectures if CMAKE_SYSTEM_PROCESSOR was empty or
     # system is non-Linux (where the code above has not been well tested)
-    IF(NOT _java_libarch OR NOT (CMAKE_SYSTEM_NAME MATCHES "Linux"))
-        LIST(APPEND _java_libarch "i386" "amd64" "ppc")
-    ENDIF(NOT _java_libarch OR NOT (CMAKE_SYSTEM_NAME MATCHES "Linux"))
+    if(NOT _java_libarch OR NOT (CMAKE_SYSTEM_NAME MATCHES "Linux"))
+        list(APPEND _java_libarch "i386" "amd64" "ppc")
+    endif(NOT _java_libarch OR NOT (CMAKE_SYSTEM_NAME MATCHES "Linux"))
 
     # Sometimes ${CMAKE_SYSTEM_PROCESSOR} is added to the list to prefer
     # current value to a hardcoded list. Remove possible duplicates.
-    LIST(REMOVE_DUPLICATES _java_libarch)
+    list(REMOVE_DUPLICATES _java_libarch)
 
-    FOREACH(_path ${ARGN})
-        IF(_path MATCHES "{libarch}")
-            FOREACH(_libarch ${_java_libarch})
-                STRING(REPLACE "{libarch}" "${_libarch}" _newpath "${_path}")
-                LIST(APPEND ${_var} "${_newpath}")
-            ENDFOREACH(_libarch)
-        ELSE(_path MATCHES "{libarch}")
-            LIST(APPEND ${_var} "${_path}")
-        ENDIF(_path MATCHES "{libarch}")
-    ENDFOREACH(_path)
-ENDMACRO(java_append_library_directories)
+    foreach(_path ${ARGN})
+        if(_path MATCHES "{libarch}")
+            foreach(_libarch ${_java_libarch})
+                string(REPLACE "{libarch}" "${_libarch}" _newpath "${_path}")
+                list(APPEND ${_var} "${_newpath}")
+            endforeach(_libarch)
+        else(_path MATCHES "{libarch}")
+            list(APPEND ${_var} "${_path}")
+        endif(_path MATCHES "{libarch}")
+    endforeach(_path)
+endmacro(java_append_library_directories)
 
-GET_FILENAME_COMPONENT(java_install_version
+get_filename_component(java_install_version
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit;CurrentVersion]" NAME)
 
-SET(JAVA_AWT_LIBRARY_DIRECTORIES
+set(JAVA_AWT_LIBRARY_DIRECTORIES
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/lib"
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/lib"
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/lib"
   )
 
-FILE(TO_CMAKE_PATH "$ENV{JAVA_HOME}" _JAVA_HOME)
+file(TO_CMAKE_PATH "$ENV{JAVA_HOME}" _JAVA_HOME)
 
 JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
   ${_JAVA_HOME}/jre/lib/{libarch}
@@ -122,18 +122,18 @@ JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
   /usr/lib/jvm/default-java/lib
   )
 
-SET(JAVA_JVM_LIBRARY_DIRECTORIES)
-FOREACH(dir ${JAVA_AWT_LIBRARY_DIRECTORIES})
-  SET(JAVA_JVM_LIBRARY_DIRECTORIES
+set(JAVA_JVM_LIBRARY_DIRECTORIES)
+foreach(dir ${JAVA_AWT_LIBRARY_DIRECTORIES})
+  set(JAVA_JVM_LIBRARY_DIRECTORIES
     ${JAVA_JVM_LIBRARY_DIRECTORIES}
     "${dir}"
     "${dir}/client"
     "${dir}/server"
     )
-ENDFOREACH(dir)
+endforeach(dir)
 
 
-SET(JAVA_AWT_INCLUDE_DIRECTORIES
+set(JAVA_AWT_INCLUDE_DIRECTORIES
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/include"
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/include"
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/include"
@@ -155,74 +155,74 @@ SET(JAVA_AWT_INCLUDE_DIRECTORIES
   /usr/lib/jvm/default-java/include
   )
 
-FOREACH(JAVA_PROG "${JAVA_RUNTIME}" "${JAVA_COMPILE}" "${JAVA_ARCHIVE}")
-  GET_FILENAME_COMPONENT(jpath "${JAVA_PROG}" PATH)
-  FOREACH(JAVA_INC_PATH ../include ../java/include ../share/java/include)
-    IF(EXISTS ${jpath}/${JAVA_INC_PATH})
-      SET(JAVA_AWT_INCLUDE_DIRECTORIES ${JAVA_AWT_INCLUDE_DIRECTORIES} "${jpath}/${JAVA_INC_PATH}")
-    ENDIF(EXISTS ${jpath}/${JAVA_INC_PATH})
-  ENDFOREACH(JAVA_INC_PATH)
-  FOREACH(JAVA_LIB_PATH
+foreach(JAVA_PROG "${JAVA_RUNTIME}" "${JAVA_COMPILE}" "${JAVA_ARCHIVE}")
+  get_filename_component(jpath "${JAVA_PROG}" PATH)
+  foreach(JAVA_INC_PATH ../include ../java/include ../share/java/include)
+    if(EXISTS ${jpath}/${JAVA_INC_PATH})
+      set(JAVA_AWT_INCLUDE_DIRECTORIES ${JAVA_AWT_INCLUDE_DIRECTORIES} "${jpath}/${JAVA_INC_PATH}")
+    endif(EXISTS ${jpath}/${JAVA_INC_PATH})
+  endforeach(JAVA_INC_PATH)
+  foreach(JAVA_LIB_PATH
     ../lib ../jre/lib ../jre/lib/i386
     ../java/lib ../java/jre/lib ../java/jre/lib/i386
     ../share/java/lib ../share/java/jre/lib ../share/java/jre/lib/i386)
-    IF(EXISTS ${jpath}/${JAVA_LIB_PATH})
-      SET(JAVA_AWT_LIBRARY_DIRECTORIES ${JAVA_AWT_LIBRARY_DIRECTORIES} "${jpath}/${JAVA_LIB_PATH}")
-    ENDIF(EXISTS ${jpath}/${JAVA_LIB_PATH})
-  ENDFOREACH(JAVA_LIB_PATH)
-ENDFOREACH(JAVA_PROG)
+    if(EXISTS ${jpath}/${JAVA_LIB_PATH})
+      set(JAVA_AWT_LIBRARY_DIRECTORIES ${JAVA_AWT_LIBRARY_DIRECTORIES} "${jpath}/${JAVA_LIB_PATH}")
+    endif(EXISTS ${jpath}/${JAVA_LIB_PATH})
+  endforeach(JAVA_LIB_PATH)
+endforeach(JAVA_PROG)
 
-IF(APPLE)
-  IF(EXISTS ~/Library/Frameworks/JavaVM.framework)
-    SET(JAVA_HAVE_FRAMEWORK 1)
-  ENDIF(EXISTS ~/Library/Frameworks/JavaVM.framework)
-  IF(EXISTS /Library/Frameworks/JavaVM.framework)
-    SET(JAVA_HAVE_FRAMEWORK 1)
-  ENDIF(EXISTS /Library/Frameworks/JavaVM.framework)
-  IF(EXISTS /System/Library/Frameworks/JavaVM.framework)
-    SET(JAVA_HAVE_FRAMEWORK 1)
-  ENDIF(EXISTS /System/Library/Frameworks/JavaVM.framework)
+if(APPLE)
+  if(EXISTS ~/Library/Frameworks/JavaVM.framework)
+    set(JAVA_HAVE_FRAMEWORK 1)
+  endif(EXISTS ~/Library/Frameworks/JavaVM.framework)
+  if(EXISTS /Library/Frameworks/JavaVM.framework)
+    set(JAVA_HAVE_FRAMEWORK 1)
+  endif(EXISTS /Library/Frameworks/JavaVM.framework)
+  if(EXISTS /System/Library/Frameworks/JavaVM.framework)
+    set(JAVA_HAVE_FRAMEWORK 1)
+  endif(EXISTS /System/Library/Frameworks/JavaVM.framework)
 
-  IF(JAVA_HAVE_FRAMEWORK)
-    IF(NOT JAVA_AWT_LIBRARY)
-      SET (JAVA_AWT_LIBRARY "-framework JavaVM" CACHE FILEPATH "Java Frameworks" FORCE)
-    ENDIF(NOT JAVA_AWT_LIBRARY)
+  if(JAVA_HAVE_FRAMEWORK)
+    if(NOT JAVA_AWT_LIBRARY)
+      set (JAVA_AWT_LIBRARY "-framework JavaVM" CACHE FILEPATH "Java Frameworks" FORCE)
+    endif(NOT JAVA_AWT_LIBRARY)
 
-    IF(NOT JAVA_JVM_LIBRARY)
-      SET (JAVA_JVM_LIBRARY "-framework JavaVM" CACHE FILEPATH "Java Frameworks" FORCE)
-    ENDIF(NOT JAVA_JVM_LIBRARY)
+    if(NOT JAVA_JVM_LIBRARY)
+      set (JAVA_JVM_LIBRARY "-framework JavaVM" CACHE FILEPATH "Java Frameworks" FORCE)
+    endif(NOT JAVA_JVM_LIBRARY)
 
-    IF(NOT JAVA_AWT_INCLUDE_PATH)
-      IF(EXISTS /System/Library/Frameworks/JavaVM.framework/Headers/jawt.h)
-        SET (JAVA_AWT_INCLUDE_PATH "/System/Library/Frameworks/JavaVM.framework/Headers" CACHE FILEPATH "jawt.h location" FORCE)
-      ENDIF(EXISTS /System/Library/Frameworks/JavaVM.framework/Headers/jawt.h)
-    ENDIF(NOT JAVA_AWT_INCLUDE_PATH)
+    if(NOT JAVA_AWT_INCLUDE_PATH)
+      if(EXISTS /System/Library/Frameworks/JavaVM.framework/Headers/jawt.h)
+        set (JAVA_AWT_INCLUDE_PATH "/System/Library/Frameworks/JavaVM.framework/Headers" CACHE FILEPATH "jawt.h location" FORCE)
+      endif(EXISTS /System/Library/Frameworks/JavaVM.framework/Headers/jawt.h)
+    endif(NOT JAVA_AWT_INCLUDE_PATH)
 
     # If using "-framework JavaVM", prefer its headers *before* the others in
     # JAVA_AWT_INCLUDE_DIRECTORIES... (*prepend* to the list here)
     #
-    SET(JAVA_AWT_INCLUDE_DIRECTORIES
+    set(JAVA_AWT_INCLUDE_DIRECTORIES
       ~/Library/Frameworks/JavaVM.framework/Headers
       /Library/Frameworks/JavaVM.framework/Headers
       /System/Library/Frameworks/JavaVM.framework/Headers
       ${JAVA_AWT_INCLUDE_DIRECTORIES}
       )
-  ENDIF(JAVA_HAVE_FRAMEWORK)
-ELSE(APPLE)
-  FIND_LIBRARY(JAVA_AWT_LIBRARY jawt
+  endif(JAVA_HAVE_FRAMEWORK)
+else(APPLE)
+  find_library(JAVA_AWT_LIBRARY jawt
     PATHS ${JAVA_AWT_LIBRARY_DIRECTORIES}
   )
-  FIND_LIBRARY(JAVA_JVM_LIBRARY NAMES jvm JavaVM
+  find_library(JAVA_JVM_LIBRARY NAMES jvm JavaVM
     PATHS ${JAVA_JVM_LIBRARY_DIRECTORIES}
   )
-ENDIF(APPLE)
+endif(APPLE)
 
 # add in the include path
-FIND_PATH(JAVA_INCLUDE_PATH jni.h
+find_path(JAVA_INCLUDE_PATH jni.h
   ${JAVA_AWT_INCLUDE_DIRECTORIES}
 )
 
-FIND_PATH(JAVA_INCLUDE_PATH2 jni_md.h
+find_path(JAVA_INCLUDE_PATH2 jni_md.h
   ${JAVA_INCLUDE_PATH}
   ${JAVA_INCLUDE_PATH}/win32
   ${JAVA_INCLUDE_PATH}/linux
@@ -232,15 +232,15 @@ FIND_PATH(JAVA_INCLUDE_PATH2 jni_md.h
   ${JAVA_INCLUDE_PATH}/alpha
 )
 
-FIND_PATH(JAVA_AWT_INCLUDE_PATH jawt.h
+find_path(JAVA_AWT_INCLUDE_PATH jawt.h
   ${JAVA_INCLUDE_PATH}
 )
 
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(JNI  DEFAULT_MSG  JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY
                                                     JAVA_INCLUDE_PATH  JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
 
-MARK_AS_ADVANCED(
+mark_as_advanced(
   JAVA_AWT_LIBRARY
   JAVA_JVM_LIBRARY
   JAVA_AWT_INCLUDE_PATH
@@ -248,12 +248,12 @@ MARK_AS_ADVANCED(
   JAVA_INCLUDE_PATH2
 )
 
-SET(JNI_LIBRARIES
+set(JNI_LIBRARIES
   ${JAVA_AWT_LIBRARY}
   ${JAVA_JVM_LIBRARY}
 )
 
-SET(JNI_INCLUDE_DIRS
+set(JNI_INCLUDE_DIRS
   ${JAVA_INCLUDE_PATH}
   ${JAVA_INCLUDE_PATH2}
   ${JAVA_AWT_INCLUDE_PATH}
diff --git a/Modules/FindJPEG.cmake b/Modules/FindJPEG.cmake
index 0b5db4089..9b0d8f48a 100644
--- a/Modules/FindJPEG.cmake
+++ b/Modules/FindJPEG.cmake
@@ -20,24 +20,24 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PATH(JPEG_INCLUDE_DIR jpeglib.h)
+find_path(JPEG_INCLUDE_DIR jpeglib.h)
 
-SET(JPEG_NAMES ${JPEG_NAMES} jpeg)
-FIND_LIBRARY(JPEG_LIBRARY NAMES ${JPEG_NAMES} )
+set(JPEG_NAMES ${JPEG_NAMES} jpeg)
+find_library(JPEG_LIBRARY NAMES ${JPEG_NAMES} )
 
 # handle the QUIETLY and REQUIRED arguments and set JPEG_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(JPEG DEFAULT_MSG JPEG_LIBRARY JPEG_INCLUDE_DIR)
 
-IF(JPEG_FOUND)
-  SET(JPEG_LIBRARIES ${JPEG_LIBRARY})
-ENDIF(JPEG_FOUND)
+if(JPEG_FOUND)
+  set(JPEG_LIBRARIES ${JPEG_LIBRARY})
+endif(JPEG_FOUND)
 
 # Deprecated declarations.
-SET (NATIVE_JPEG_INCLUDE_PATH ${JPEG_INCLUDE_DIR} )
-IF(JPEG_LIBRARY)
-  GET_FILENAME_COMPONENT (NATIVE_JPEG_LIB_PATH ${JPEG_LIBRARY} PATH)
-ENDIF(JPEG_LIBRARY)
+set (NATIVE_JPEG_INCLUDE_PATH ${JPEG_INCLUDE_DIR} )
+if(JPEG_LIBRARY)
+  get_filename_component (NATIVE_JPEG_LIB_PATH ${JPEG_LIBRARY} PATH)
+endif(JPEG_LIBRARY)
 
-MARK_AS_ADVANCED(JPEG_LIBRARY JPEG_INCLUDE_DIR )
+mark_as_advanced(JPEG_LIBRARY JPEG_INCLUDE_DIR )
diff --git a/Modules/FindJasper.cmake b/Modules/FindJasper.cmake
index b6178449b..c5b865a12 100644
--- a/Modules/FindJasper.cmake
+++ b/Modules/FindJasper.cmake
@@ -21,33 +21,33 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PATH(JASPER_INCLUDE_DIR jasper/jasper.h)
+find_path(JASPER_INCLUDE_DIR jasper/jasper.h)
 
-IF (NOT JASPER_LIBRARIES)
-    FIND_PACKAGE(JPEG)
+if (NOT JASPER_LIBRARIES)
+    find_package(JPEG)
 
-    FIND_LIBRARY(JASPER_LIBRARY_RELEASE NAMES jasper libjasper)
-    FIND_LIBRARY(JASPER_LIBRARY_DEBUG NAMES jasperd)
+    find_library(JASPER_LIBRARY_RELEASE NAMES jasper libjasper)
+    find_library(JASPER_LIBRARY_DEBUG NAMES jasperd)
 
-    INCLUDE(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
+    include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
     SELECT_LIBRARY_CONFIGURATIONS(JASPER)
-ENDIF (NOT JASPER_LIBRARIES)
+endif (NOT JASPER_LIBRARIES)
 
-IF (JASPER_INCLUDE_DIR AND EXISTS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h")
-    FILE(STRINGS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h" jasper_version_str REGEX "^#define[\t ]+JAS_VERSION[\t ]+\".*\".*")
+if (JASPER_INCLUDE_DIR AND EXISTS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h")
+    file(STRINGS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h" jasper_version_str REGEX "^#define[\t ]+JAS_VERSION[\t ]+\".*\".*")
 
-    STRING(REGEX REPLACE "^#define[\t ]+JAS_VERSION[\t ]+\"([^\"]+)\".*" "\\1" JASPER_VERSION_STRING "${jasper_version_str}")
-ENDIF (JASPER_INCLUDE_DIR AND EXISTS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h")
+    string(REGEX REPLACE "^#define[\t ]+JAS_VERSION[\t ]+\"([^\"]+)\".*" "\\1" JASPER_VERSION_STRING "${jasper_version_str}")
+endif (JASPER_INCLUDE_DIR AND EXISTS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h")
 
 # handle the QUIETLY and REQUIRED arguments and set JASPER_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Jasper
                                   REQUIRED_VARS JASPER_LIBRARIES JASPER_INCLUDE_DIR JPEG_LIBRARIES
                                   VERSION_VAR JASPER_VERSION_STRING)
 
-IF (JASPER_FOUND)
-   SET(JASPER_LIBRARIES ${JASPER_LIBRARIES} ${JPEG_LIBRARIES} )
-ENDIF (JASPER_FOUND)
+if (JASPER_FOUND)
+   set(JASPER_LIBRARIES ${JASPER_LIBRARIES} ${JPEG_LIBRARIES} )
+endif (JASPER_FOUND)
 
-MARK_AS_ADVANCED(JASPER_INCLUDE_DIR)
+mark_as_advanced(JASPER_INCLUDE_DIR)
diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake
index 2e50ecac2..24af0e00b 100644
--- a/Modules/FindJava.cmake
+++ b/Modules/FindJava.cmake
@@ -16,7 +16,7 @@
 #  Java_VERSION            = This is set to: $major.$minor.$patch(.$tweak)
 #
 # The minimum required version of Java can be specified using the
-# standard CMake syntax, e.g. FIND_PACKAGE(Java 1.5)
+# standard CMake syntax, e.g. find_package(Java 1.5)
 #
 # NOTE: ${Java_VERSION} and ${Java_VERSION_STRING} are not guaranteed to be
 # identical. For example some java version may return:
@@ -37,9 +37,9 @@
 #  Java_<component>_FOUND        - TRUE if <component> is found.
 #
 # Example Usages:
-#  FIND_PACKAGE(Java)
-#  FIND_PACKAGE(Java COMPONENTS Runtime)
-#  FIND_PACKAGE(Java COMPONENTS Development)
+#  find_package(Java)
+#  find_package(Java COMPONENTS Runtime)
+#  find_package(Java COMPONENTS Development)
 #
 
 #=============================================================================
@@ -57,7 +57,7 @@
 #  License text for the above reference.)
 
 # The HINTS option should only be used for values computed from the system.
-SET(_JAVA_HINTS
+set(_JAVA_HINTS
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\2.0;JavaHome]/bin"
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.9;JavaHome]/bin"
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.8;JavaHome]/bin"
@@ -70,7 +70,7 @@ SET(_JAVA_HINTS
   )
 # Hard-coded guesses should still go in PATHS. This ensures that the user
 # environment can always override hard guesses.
-SET(_JAVA_PATHS
+set(_JAVA_PATHS
   /usr/lib/java/bin
   /usr/share/java/bin
   /usr/local/java/bin
@@ -81,79 +81,79 @@ SET(_JAVA_PATHS
   /usr/lib/j2sdk1.5-sun/bin
   /opt/sun-jdk-1.5.0.04/bin
   )
-FIND_PROGRAM(Java_JAVA_EXECUTABLE
+find_program(Java_JAVA_EXECUTABLE
   NAMES java
   HINTS ${_JAVA_HINTS}
   PATHS ${_JAVA_PATHS}
 )
 
-IF(Java_JAVA_EXECUTABLE)
-    EXECUTE_PROCESS(COMMAND ${Java_JAVA_EXECUTABLE} -version
+if(Java_JAVA_EXECUTABLE)
+    execute_process(COMMAND ${Java_JAVA_EXECUTABLE} -version
       RESULT_VARIABLE res
       OUTPUT_VARIABLE var
       ERROR_VARIABLE var # sun-java output to stderr
       OUTPUT_STRIP_TRAILING_WHITESPACE
       ERROR_STRIP_TRAILING_WHITESPACE)
-    IF( res )
-      IF(${Java_FIND_REQUIRED})
-        MESSAGE( FATAL_ERROR "Error executing java -version" )
-      ELSE()
-        MESSAGE( STATUS "Warning, could not run java --version")
-      ENDIF()
-    ELSE()
+    if( res )
+      if(${Java_FIND_REQUIRED})
+        message( FATAL_ERROR "Error executing java -version" )
+      else()
+        message( STATUS "Warning, could not run java --version")
+      endif()
+    else()
       # extract major/minor version and patch level from "java -version" output
       # Tested on linux using
       # 1. Sun / Sun OEM
       # 2. OpenJDK 1.6
       # 3. GCJ 1.5
       # 4. Kaffe 1.4.2
-      IF(var MATCHES "java version \"[0-9]+\\.[0-9]+\\.[0-9_.]+.*\".*")
+      if(var MATCHES "java version \"[0-9]+\\.[0-9]+\\.[0-9_.]+.*\".*")
         # This is most likely Sun / OpenJDK, or maybe GCJ-java compat layer
-        STRING( REGEX REPLACE ".* version \"([0-9]+\\.[0-9]+\\.[0-9_.]+.*)\".*"
+        string( REGEX REPLACE ".* version \"([0-9]+\\.[0-9]+\\.[0-9_.]+.*)\".*"
                 "\\1" Java_VERSION_STRING "${var}" )
-      ELSEIF(var MATCHES "java full version \"kaffe-[0-9]+\\.[0-9]+\\.[0-9_]+\".*")
+      elseif(var MATCHES "java full version \"kaffe-[0-9]+\\.[0-9]+\\.[0-9_]+\".*")
         # Kaffe style
-        STRING( REGEX REPLACE "java full version \"kaffe-([0-9]+\\.[0-9]+\\.[0-9_]+).*"
+        string( REGEX REPLACE "java full version \"kaffe-([0-9]+\\.[0-9]+\\.[0-9_]+).*"
                 "\\1" Java_VERSION_STRING "${var}" )
-      ELSE()
-        IF(NOT Java_FIND_QUIETLY)
+      else()
+        if(NOT Java_FIND_QUIETLY)
           message(WARNING "regex not supported: ${var}. Please report")
-        ENDIF(NOT Java_FIND_QUIETLY)
-      ENDIF()
-      STRING( REGEX REPLACE "([0-9]+).*" "\\1" Java_VERSION_MAJOR "${Java_VERSION_STRING}" )
-      STRING( REGEX REPLACE "[0-9]+\\.([0-9]+).*" "\\1" Java_VERSION_MINOR "${Java_VERSION_STRING}" )
-      STRING( REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" Java_VERSION_PATCH "${Java_VERSION_STRING}" )
+        endif(NOT Java_FIND_QUIETLY)
+      endif()
+      string( REGEX REPLACE "([0-9]+).*" "\\1" Java_VERSION_MAJOR "${Java_VERSION_STRING}" )
+      string( REGEX REPLACE "[0-9]+\\.([0-9]+).*" "\\1" Java_VERSION_MINOR "${Java_VERSION_STRING}" )
+      string( REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" Java_VERSION_PATCH "${Java_VERSION_STRING}" )
       # warning tweak version can be empty:
-      STRING( REGEX REPLACE "[0-9]+\\.[0-9]+\\.[0-9]+[_\\.]?([0-9]*).*$" "\\1" Java_VERSION_TWEAK "${Java_VERSION_STRING}" )
+      string( REGEX REPLACE "[0-9]+\\.[0-9]+\\.[0-9]+[_\\.]?([0-9]*).*$" "\\1" Java_VERSION_TWEAK "${Java_VERSION_STRING}" )
       if( Java_VERSION_TWEAK STREQUAL "" ) # check case where tweak is not defined
         set(Java_VERSION ${Java_VERSION_MAJOR}.${Java_VERSION_MINOR}.${Java_VERSION_PATCH})
       else( )
         set(Java_VERSION ${Java_VERSION_MAJOR}.${Java_VERSION_MINOR}.${Java_VERSION_PATCH}.${Java_VERSION_TWEAK})
       endif( )
-    ENDIF()
+    endif()
 
-ENDIF(Java_JAVA_EXECUTABLE)
+endif(Java_JAVA_EXECUTABLE)
 
 
-FIND_PROGRAM(Java_JAR_EXECUTABLE
+find_program(Java_JAR_EXECUTABLE
   NAMES jar
   HINTS ${_JAVA_HINTS}
   PATHS ${_JAVA_PATHS}
 )
 
-FIND_PROGRAM(Java_JAVAC_EXECUTABLE
+find_program(Java_JAVAC_EXECUTABLE
   NAMES javac
   HINTS ${_JAVA_HINTS}
   PATHS ${_JAVA_PATHS}
 )
 
-FIND_PROGRAM(Java_JAVAH_EXECUTABLE
+find_program(Java_JAVAH_EXECUTABLE
   NAMES javah
   HINTS ${_JAVA_HINTS}
   PATHS ${_JAVA_PATHS}
 )
 
-FIND_PROGRAM(Java_JAVADOC_EXECUTABLE
+find_program(Java_JAVADOC_EXECUTABLE
   NAMES javadoc
   HINTS ${_JAVA_HINTS}
   PATHS ${_JAVA_PATHS}
@@ -189,7 +189,7 @@ else()
 endif()
 
 
-MARK_AS_ADVANCED(
+mark_as_advanced(
   Java_JAVA_EXECUTABLE
   Java_JAR_EXECUTABLE
   Java_JAVAC_EXECUTABLE
@@ -198,7 +198,7 @@ MARK_AS_ADVANCED(
   )
 
 # LEGACY
-SET(JAVA_RUNTIME ${Java_JAVA_EXECUTABLE})
-SET(JAVA_ARCHIVE ${Java_JAR_EXECUTABLE})
-SET(JAVA_COMPILE ${Java_JAVAC_EXECUTABLE})
+set(JAVA_RUNTIME ${Java_JAVA_EXECUTABLE})
+set(JAVA_ARCHIVE ${Java_JAR_EXECUTABLE})
+set(JAVA_COMPILE ${Java_JAVAC_EXECUTABLE})
 
diff --git a/Modules/FindKDE3.cmake b/Modules/FindKDE3.cmake
index 65a559fa7..a8d30a890 100644
--- a/Modules/FindKDE3.cmake
+++ b/Modules/FindKDE3.cmake
@@ -3,8 +3,8 @@
 # This module defines the following variables:
 #  KDE3_DEFINITIONS         - compiler definitions required for compiling KDE software
 #  KDE3_INCLUDE_DIR         - the KDE include directory
-#  KDE3_INCLUDE_DIRS        - the KDE and the Qt include directory, for use with INCLUDE_DIRECTORIES()
-#  KDE3_LIB_DIR             - the directory where the KDE libraries are installed, for use with LINK_DIRECTORIES()
+#  KDE3_INCLUDE_DIRS        - the KDE and the Qt include directory, for use with include_directories()
+#  KDE3_LIB_DIR             - the directory where the KDE libraries are installed, for use with link_directories()
 #  QT_AND_KDECORE_LIBS      - this contains both the Qt and the kdecore library
 #  KDE3_DCOPIDL_EXECUTABLE  - the dcopidl executable
 #  KDE3_DCOPIDL2CPP_EXECUTABLE - the dcopidl2cpp executable
@@ -23,7 +23,7 @@
 #    Call this if you want to have automatic moc file handling.
 #    This means if you include "foo.moc" in the source file foo.cpp
 #    a moc file for the header foo.h will be created automatically.
-#    You can set the property SKIP_AUTOMAKE using SET_SOURCE_FILES_PROPERTIES()
+#    You can set the property SKIP_AUTOMAKE using set_source_files_properties()
 #    to exclude some files in the list from being processed.
 #
 # KDE3_ADD_MOC_FILES(SRCS_VAR file1 ... fileN )
@@ -46,7 +46,7 @@
 #    This will create and install a simple libtool file for the given target.
 #
 # KDE3_ADD_EXECUTABLE(name file1 ... fileN )
-#    Currently identical to ADD_EXECUTABLE(), may provide some advanced features in the future.
+#    Currently identical to add_executable(), may provide some advanced features in the future.
 #
 # KDE3_ADD_KPART(name [WITH_PREFIX] file1 ... fileN )
 #    Create a KDE plugin (KPart, kioslave, etc.) from the given source files.
@@ -77,37 +77,37 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-IF(NOT UNIX AND KDE3_FIND_REQUIRED)
-   MESSAGE(FATAL_ERROR "Compiling KDE3 applications and libraries under Windows is not supported")
-ENDIF(NOT UNIX AND KDE3_FIND_REQUIRED)
+if(NOT UNIX AND KDE3_FIND_REQUIRED)
+   message(FATAL_ERROR "Compiling KDE3 applications and libraries under Windows is not supported")
+endif(NOT UNIX AND KDE3_FIND_REQUIRED)
 
 # If Qt4 has already been found, fail.
-IF(QT4_FOUND)
-  IF(KDE3_FIND_REQUIRED)
-    MESSAGE( FATAL_ERROR "KDE3/Qt3 and Qt4 cannot be used together in one project.")
-  ELSE(KDE3_FIND_REQUIRED)
-    IF(NOT KDE3_FIND_QUIETLY)
-      MESSAGE( STATUS    "KDE3/Qt3 and Qt4 cannot be used together in one project.")
-    ENDIF(NOT KDE3_FIND_QUIETLY)
-    RETURN()
-  ENDIF(KDE3_FIND_REQUIRED)
-ENDIF(QT4_FOUND)
+if(QT4_FOUND)
+  if(KDE3_FIND_REQUIRED)
+    message( FATAL_ERROR "KDE3/Qt3 and Qt4 cannot be used together in one project.")
+  else(KDE3_FIND_REQUIRED)
+    if(NOT KDE3_FIND_QUIETLY)
+      message( STATUS    "KDE3/Qt3 and Qt4 cannot be used together in one project.")
+    endif(NOT KDE3_FIND_QUIETLY)
+    return()
+  endif(KDE3_FIND_REQUIRED)
+endif(QT4_FOUND)
 
 
-SET(QT_MT_REQUIRED TRUE)
-#SET(QT_MIN_VERSION "3.0.0")
+set(QT_MT_REQUIRED TRUE)
+#set(QT_MIN_VERSION "3.0.0")
 
 #this line includes FindQt.cmake, which searches the Qt library and headers
-IF(KDE3_FIND_REQUIRED)
-  SET(_REQ_STRING_KDE3 "REQUIRED")
-ENDIF(KDE3_FIND_REQUIRED)
+if(KDE3_FIND_REQUIRED)
+  set(_REQ_STRING_KDE3 "REQUIRED")
+endif(KDE3_FIND_REQUIRED)
 
-FIND_PACKAGE(Qt3 ${_REQ_STRING_KDE3})
-FIND_PACKAGE(X11 ${_REQ_STRING_KDE3})
+find_package(Qt3 ${_REQ_STRING_KDE3})
+find_package(X11 ${_REQ_STRING_KDE3})
 
 
 #now try to find some kde stuff
-FIND_PROGRAM(KDECONFIG_EXECUTABLE NAMES kde-config
+find_program(KDECONFIG_EXECUTABLE NAMES kde-config
   HINTS
    $ENV{KDEDIR}/bin
    PATHS
@@ -115,25 +115,25 @@ FIND_PROGRAM(KDECONFIG_EXECUTABLE NAMES kde-config
   /opt/kde/bin
   )
 
-SET(KDE3PREFIX)
-IF(KDECONFIG_EXECUTABLE)
-   EXECUTE_PROCESS(COMMAND ${KDECONFIG_EXECUTABLE} --version
+set(KDE3PREFIX)
+if(KDECONFIG_EXECUTABLE)
+   execute_process(COMMAND ${KDECONFIG_EXECUTABLE} --version
                    OUTPUT_VARIABLE kde_config_version )
 
-   STRING(REGEX MATCH "KDE: .\\." kde_version "${kde_config_version}")
-   IF ("${kde_version}" MATCHES "KDE: 3\\.")
-      EXECUTE_PROCESS(COMMAND ${KDECONFIG_EXECUTABLE} --prefix
+   string(REGEX MATCH "KDE: .\\." kde_version "${kde_config_version}")
+   if ("${kde_version}" MATCHES "KDE: 3\\.")
+      execute_process(COMMAND ${KDECONFIG_EXECUTABLE} --prefix
                         OUTPUT_VARIABLE kdedir )
-      STRING(REGEX REPLACE "\n" "" KDE3PREFIX "${kdedir}")
+      string(REGEX REPLACE "\n" "" KDE3PREFIX "${kdedir}")
 
-    ENDIF ("${kde_version}" MATCHES "KDE: 3\\.")
-ENDIF(KDECONFIG_EXECUTABLE)
+    endif ("${kde_version}" MATCHES "KDE: 3\\.")
+endif(KDECONFIG_EXECUTABLE)
 
 
 
 # at first the KDE include directory
 # kpassdlg.h comes from kdeui and doesn't exist in KDE4 anymore
-FIND_PATH(KDE3_INCLUDE_DIR kpassdlg.h
+find_path(KDE3_INCLUDE_DIR kpassdlg.h
   HINTS
   $ENV{KDEDIR}/include
   ${KDE3PREFIX}/include
@@ -145,7 +145,7 @@ FIND_PATH(KDE3_INCLUDE_DIR kpassdlg.h
   )
 
 #now the KDE library directory
-FIND_LIBRARY(KDE3_KDECORE_LIBRARY NAMES kdecore
+find_library(KDE3_KDECORE_LIBRARY NAMES kdecore
   HINTS
   $ENV{KDEDIR}/lib
   ${KDE3PREFIX}/lib
@@ -154,20 +154,20 @@ FIND_LIBRARY(KDE3_KDECORE_LIBRARY NAMES kdecore
   /opt/kde/lib
 )
 
-SET(QT_AND_KDECORE_LIBS ${QT_LIBRARIES} ${KDE3_KDECORE_LIBRARY})
+set(QT_AND_KDECORE_LIBS ${QT_LIBRARIES} ${KDE3_KDECORE_LIBRARY})
 
-GET_FILENAME_COMPONENT(KDE3_LIB_DIR ${KDE3_KDECORE_LIBRARY} PATH )
+get_filename_component(KDE3_LIB_DIR ${KDE3_KDECORE_LIBRARY} PATH )
 
-IF(NOT KDE3_LIBTOOL_DIR)
-   IF(KDE3_KDECORE_LIBRARY MATCHES lib64)
-     SET(KDE3_LIBTOOL_DIR /lib64/kde3)
-   ELSE(KDE3_KDECORE_LIBRARY MATCHES lib64)
-     SET(KDE3_LIBTOOL_DIR /lib/kde3)
-   ENDIF(KDE3_KDECORE_LIBRARY MATCHES lib64)
-ENDIF(NOT KDE3_LIBTOOL_DIR)
+if(NOT KDE3_LIBTOOL_DIR)
+   if(KDE3_KDECORE_LIBRARY MATCHES lib64)
+     set(KDE3_LIBTOOL_DIR /lib64/kde3)
+   else(KDE3_KDECORE_LIBRARY MATCHES lib64)
+     set(KDE3_LIBTOOL_DIR /lib/kde3)
+   endif(KDE3_KDECORE_LIBRARY MATCHES lib64)
+endif(NOT KDE3_LIBTOOL_DIR)
 
 #now search for the dcop utilities
-FIND_PROGRAM(KDE3_DCOPIDL_EXECUTABLE NAMES dcopidl
+find_program(KDE3_DCOPIDL_EXECUTABLE NAMES dcopidl
   HINTS
   $ENV{KDEDIR}/bin
   ${KDE3PREFIX}/bin
@@ -176,7 +176,7 @@ FIND_PROGRAM(KDE3_DCOPIDL_EXECUTABLE NAMES dcopidl
   /opt/kde/bin
   )
 
-FIND_PROGRAM(KDE3_DCOPIDL2CPP_EXECUTABLE NAMES dcopidl2cpp
+find_program(KDE3_DCOPIDL2CPP_EXECUTABLE NAMES dcopidl2cpp
   HINTS
   $ENV{KDEDIR}/bin
   ${KDE3PREFIX}/bin
@@ -185,7 +185,7 @@ FIND_PROGRAM(KDE3_DCOPIDL2CPP_EXECUTABLE NAMES dcopidl2cpp
   /opt/kde/bin
   )
 
-FIND_PROGRAM(KDE3_KCFGC_EXECUTABLE NAMES kconfig_compiler
+find_program(KDE3_KCFGC_EXECUTABLE NAMES kconfig_compiler
   HINTS
   $ENV{KDEDIR}/bin
   ${KDE3PREFIX}/bin
@@ -196,104 +196,104 @@ FIND_PROGRAM(KDE3_KCFGC_EXECUTABLE NAMES kconfig_compiler
 
 
 #SET KDE3_FOUND
-IF (KDE3_INCLUDE_DIR AND KDE3_LIB_DIR AND KDE3_DCOPIDL_EXECUTABLE AND KDE3_DCOPIDL2CPP_EXECUTABLE AND KDE3_KCFGC_EXECUTABLE)
-   SET(KDE3_FOUND TRUE)
-ELSE (KDE3_INCLUDE_DIR AND KDE3_LIB_DIR AND KDE3_DCOPIDL_EXECUTABLE AND KDE3_DCOPIDL2CPP_EXECUTABLE AND KDE3_KCFGC_EXECUTABLE)
-   SET(KDE3_FOUND FALSE)
-ENDIF (KDE3_INCLUDE_DIR AND KDE3_LIB_DIR AND KDE3_DCOPIDL_EXECUTABLE AND KDE3_DCOPIDL2CPP_EXECUTABLE AND KDE3_KCFGC_EXECUTABLE)
+if (KDE3_INCLUDE_DIR AND KDE3_LIB_DIR AND KDE3_DCOPIDL_EXECUTABLE AND KDE3_DCOPIDL2CPP_EXECUTABLE AND KDE3_KCFGC_EXECUTABLE)
+   set(KDE3_FOUND TRUE)
+else (KDE3_INCLUDE_DIR AND KDE3_LIB_DIR AND KDE3_DCOPIDL_EXECUTABLE AND KDE3_DCOPIDL2CPP_EXECUTABLE AND KDE3_KCFGC_EXECUTABLE)
+   set(KDE3_FOUND FALSE)
+endif (KDE3_INCLUDE_DIR AND KDE3_LIB_DIR AND KDE3_DCOPIDL_EXECUTABLE AND KDE3_DCOPIDL2CPP_EXECUTABLE AND KDE3_KCFGC_EXECUTABLE)
 
 # add some KDE specific stuff
-SET(KDE3_DEFINITIONS -DQT_CLEAN_NAMESPACE -D_GNU_SOURCE)
+set(KDE3_DEFINITIONS -DQT_CLEAN_NAMESPACE -D_GNU_SOURCE)
 
 # set compiler flags only if KDE3 has actually been found
-IF(KDE3_FOUND)
-   SET(_KDE3_USE_FLAGS FALSE)
-   IF(CMAKE_COMPILER_IS_GNUCXX)
-      SET(_KDE3_USE_FLAGS TRUE) # use flags for gnu compiler
-      EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} --version
+if(KDE3_FOUND)
+   set(_KDE3_USE_FLAGS FALSE)
+   if(CMAKE_COMPILER_IS_GNUCXX)
+      set(_KDE3_USE_FLAGS TRUE) # use flags for gnu compiler
+      execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version
                       OUTPUT_VARIABLE out)
       # gnu gcc 2.96 does not work with flags
       # I guess 2.95 also doesn't then
-      IF("${out}" MATCHES "2.9[56]")
-         SET(_KDE3_USE_FLAGS FALSE)
-      ENDIF("${out}" MATCHES "2.9[56]")
-   ENDIF(CMAKE_COMPILER_IS_GNUCXX)
+      if("${out}" MATCHES "2.9[56]")
+         set(_KDE3_USE_FLAGS FALSE)
+      endif("${out}" MATCHES "2.9[56]")
+   endif(CMAKE_COMPILER_IS_GNUCXX)
 
    #only on linux, but NOT e.g. on FreeBSD:
-   IF(CMAKE_SYSTEM_NAME MATCHES "Linux" AND _KDE3_USE_FLAGS)
-      SET (KDE3_DEFINITIONS ${KDE3_DEFINITIONS} -D_XOPEN_SOURCE=500 -D_BSD_SOURCE)
-      SET ( CMAKE_C_FLAGS     "${CMAKE_C_FLAGS} -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common")
-      SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -fno-exceptions -fno-check-new -fno-common")
-   ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux" AND _KDE3_USE_FLAGS)
+   if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND _KDE3_USE_FLAGS)
+      set (KDE3_DEFINITIONS ${KDE3_DEFINITIONS} -D_XOPEN_SOURCE=500 -D_BSD_SOURCE)
+      set ( CMAKE_C_FLAGS     "${CMAKE_C_FLAGS} -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common")
+      set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -fno-exceptions -fno-check-new -fno-common")
+   endif(CMAKE_SYSTEM_NAME MATCHES "Linux" AND _KDE3_USE_FLAGS)
 
    # works on FreeBSD, NOT tested on NetBSD and OpenBSD
-   IF (CMAKE_SYSTEM_NAME MATCHES BSD AND _KDE3_USE_FLAGS)
-      SET ( CMAKE_C_FLAGS     "${CMAKE_C_FLAGS} -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common")
-      SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common")
-   ENDIF (CMAKE_SYSTEM_NAME MATCHES BSD AND _KDE3_USE_FLAGS)
+   if (CMAKE_SYSTEM_NAME MATCHES BSD AND _KDE3_USE_FLAGS)
+      set ( CMAKE_C_FLAGS     "${CMAKE_C_FLAGS} -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common")
+      set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common")
+   endif (CMAKE_SYSTEM_NAME MATCHES BSD AND _KDE3_USE_FLAGS)
 
    # if no special buildtype is selected, add -O2 as default optimization
-   IF (NOT CMAKE_BUILD_TYPE AND _KDE3_USE_FLAGS)
-      SET ( CMAKE_C_FLAGS     "${CMAKE_C_FLAGS} -O2")
-      SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
-   ENDIF (NOT CMAKE_BUILD_TYPE AND _KDE3_USE_FLAGS)
+   if (NOT CMAKE_BUILD_TYPE AND _KDE3_USE_FLAGS)
+      set ( CMAKE_C_FLAGS     "${CMAKE_C_FLAGS} -O2")
+      set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
+   endif (NOT CMAKE_BUILD_TYPE AND _KDE3_USE_FLAGS)
 
-#SET(CMAKE_SHARED_LINKER_FLAGS "-avoid-version -module -Wl,--no-undefined -Wl,--allow-shlib-undefined")
-#SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -avoid-version -Wl,--no-undefined -lc")
-#SET(CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings -avoid-version -Wl,--no-undefined -lc")
-ENDIF(KDE3_FOUND)
+#set(CMAKE_SHARED_LINKER_FLAGS "-avoid-version -module -Wl,--no-undefined -Wl,--allow-shlib-undefined")
+#set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -avoid-version -Wl,--no-undefined -lc")
+#set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings -avoid-version -Wl,--no-undefined -lc")
+endif(KDE3_FOUND)
 
 
 # KDE3Macros.cmake contains all the KDE specific macros
-INCLUDE(KDE3Macros)
+include(KDE3Macros)
 
 
-MACRO (KDE3_PRINT_RESULTS)
-   IF(KDE3_INCLUDE_DIR)
-      MESSAGE(STATUS "Found KDE3 include dir: ${KDE3_INCLUDE_DIR}")
-   ELSE(KDE3_INCLUDE_DIR)
-      MESSAGE(STATUS "Didn't find KDE3 headers")
-   ENDIF(KDE3_INCLUDE_DIR)
+macro (KDE3_PRINT_RESULTS)
+   if(KDE3_INCLUDE_DIR)
+      message(STATUS "Found KDE3 include dir: ${KDE3_INCLUDE_DIR}")
+   else(KDE3_INCLUDE_DIR)
+      message(STATUS "Didn't find KDE3 headers")
+   endif(KDE3_INCLUDE_DIR)
 
-   IF(KDE3_LIB_DIR)
-      MESSAGE(STATUS "Found KDE3 library dir: ${KDE3_LIB_DIR}")
-   ELSE(KDE3_LIB_DIR)
-      MESSAGE(STATUS "Didn't find KDE3 core library")
-   ENDIF(KDE3_LIB_DIR)
+   if(KDE3_LIB_DIR)
+      message(STATUS "Found KDE3 library dir: ${KDE3_LIB_DIR}")
+   else(KDE3_LIB_DIR)
+      message(STATUS "Didn't find KDE3 core library")
+   endif(KDE3_LIB_DIR)
 
-   IF(KDE3_DCOPIDL_EXECUTABLE)
-      MESSAGE(STATUS "Found KDE3 dcopidl preprocessor: ${KDE3_DCOPIDL_EXECUTABLE}")
-   ELSE(KDE3_DCOPIDL_EXECUTABLE)
-      MESSAGE(STATUS "Didn't find the KDE3 dcopidl preprocessor")
-   ENDIF(KDE3_DCOPIDL_EXECUTABLE)
+   if(KDE3_DCOPIDL_EXECUTABLE)
+      message(STATUS "Found KDE3 dcopidl preprocessor: ${KDE3_DCOPIDL_EXECUTABLE}")
+   else(KDE3_DCOPIDL_EXECUTABLE)
+      message(STATUS "Didn't find the KDE3 dcopidl preprocessor")
+   endif(KDE3_DCOPIDL_EXECUTABLE)
 
-   IF(KDE3_DCOPIDL2CPP_EXECUTABLE)
-      MESSAGE(STATUS "Found KDE3 dcopidl2cpp preprocessor: ${KDE3_DCOPIDL2CPP_EXECUTABLE}")
-   ELSE(KDE3_DCOPIDL2CPP_EXECUTABLE)
-      MESSAGE(STATUS "Didn't find the KDE3 dcopidl2cpp preprocessor")
-   ENDIF(KDE3_DCOPIDL2CPP_EXECUTABLE)
+   if(KDE3_DCOPIDL2CPP_EXECUTABLE)
+      message(STATUS "Found KDE3 dcopidl2cpp preprocessor: ${KDE3_DCOPIDL2CPP_EXECUTABLE}")
+   else(KDE3_DCOPIDL2CPP_EXECUTABLE)
+      message(STATUS "Didn't find the KDE3 dcopidl2cpp preprocessor")
+   endif(KDE3_DCOPIDL2CPP_EXECUTABLE)
 
-   IF(KDE3_KCFGC_EXECUTABLE)
-      MESSAGE(STATUS "Found KDE3 kconfig_compiler preprocessor: ${KDE3_KCFGC_EXECUTABLE}")
-   ELSE(KDE3_KCFGC_EXECUTABLE)
-      MESSAGE(STATUS "Didn't find the KDE3 kconfig_compiler preprocessor")
-   ENDIF(KDE3_KCFGC_EXECUTABLE)
+   if(KDE3_KCFGC_EXECUTABLE)
+      message(STATUS "Found KDE3 kconfig_compiler preprocessor: ${KDE3_KCFGC_EXECUTABLE}")
+   else(KDE3_KCFGC_EXECUTABLE)
+      message(STATUS "Didn't find the KDE3 kconfig_compiler preprocessor")
+   endif(KDE3_KCFGC_EXECUTABLE)
 
-ENDMACRO (KDE3_PRINT_RESULTS)
+endmacro (KDE3_PRINT_RESULTS)
 
 
-IF (KDE3_FIND_REQUIRED AND NOT KDE3_FOUND)
+if (KDE3_FIND_REQUIRED AND NOT KDE3_FOUND)
    #bail out if something wasn't found
    KDE3_PRINT_RESULTS()
-   MESSAGE(FATAL_ERROR "Could NOT find everything required for compiling KDE 3 programs")
+   message(FATAL_ERROR "Could NOT find everything required for compiling KDE 3 programs")
 
-ENDIF (KDE3_FIND_REQUIRED AND NOT KDE3_FOUND)
+endif (KDE3_FIND_REQUIRED AND NOT KDE3_FOUND)
 
 
-IF (NOT KDE3_FIND_QUIETLY)
+if (NOT KDE3_FIND_QUIETLY)
    KDE3_PRINT_RESULTS()
-ENDIF (NOT KDE3_FIND_QUIETLY)
+endif (NOT KDE3_FIND_QUIETLY)
 
 #add the found Qt and KDE include directories to the current include path
-SET(KDE3_INCLUDE_DIRS ${QT_INCLUDE_DIR} ${KDE3_INCLUDE_DIR})
+set(KDE3_INCLUDE_DIRS ${QT_INCLUDE_DIR} ${KDE3_INCLUDE_DIR})
 
diff --git a/Modules/FindKDE4.cmake b/Modules/FindKDE4.cmake
index fb9332828..9cff20ebb 100644
--- a/Modules/FindKDE4.cmake
+++ b/Modules/FindKDE4.cmake
@@ -24,18 +24,18 @@
 #  License text for the above reference.)
 
 # If Qt3 has already been found, fail.
-IF(QT_QT_LIBRARY)
-  IF(KDE4_FIND_REQUIRED)
-    MESSAGE( FATAL_ERROR "KDE4/Qt4 and Qt3 cannot be used together in one project.")
-  ELSE(KDE4_FIND_REQUIRED)
-    IF(NOT KDE4_FIND_QUIETLY)
-      MESSAGE( STATUS    "KDE4/Qt4 and Qt3 cannot be used together in one project.")
-    ENDIF(NOT KDE4_FIND_QUIETLY)
-    RETURN()
-  ENDIF(KDE4_FIND_REQUIRED)
-ENDIF(QT_QT_LIBRARY)
+if(QT_QT_LIBRARY)
+  if(KDE4_FIND_REQUIRED)
+    message( FATAL_ERROR "KDE4/Qt4 and Qt3 cannot be used together in one project.")
+  else(KDE4_FIND_REQUIRED)
+    if(NOT KDE4_FIND_QUIETLY)
+      message( STATUS    "KDE4/Qt4 and Qt3 cannot be used together in one project.")
+    endif(NOT KDE4_FIND_QUIETLY)
+    return()
+  endif(KDE4_FIND_REQUIRED)
+endif(QT_QT_LIBRARY)
 
-FILE(TO_CMAKE_PATH "$ENV{KDEDIRS}" _KDEDIRS)
+file(TO_CMAKE_PATH "$ENV{KDEDIRS}" _KDEDIRS)
 
 # when cross compiling, searching kde4-config in order to run it later on
 # doesn't make a lot of sense. We'll have to do something about this.
@@ -43,7 +43,7 @@ FILE(TO_CMAKE_PATH "$ENV{KDEDIRS}" _KDEDIRS)
 # still it can't be used to run it. Alex
 
 # For KDE4 kde-config has been renamed to kde4-config
-FIND_PROGRAM(KDE4_KDECONFIG_EXECUTABLE NAMES kde4-config
+find_program(KDE4_KDECONFIG_EXECUTABLE NAMES kde4-config
    # the suffix must be used since KDEDIRS can be a list of directories which don't have bin/ appended
    PATH_SUFFIXES bin
    HINTS
@@ -53,48 +53,48 @@ FIND_PROGRAM(KDE4_KDECONFIG_EXECUTABLE NAMES kde4-config
    ONLY_CMAKE_FIND_ROOT_PATH
    )
 
-IF (NOT KDE4_KDECONFIG_EXECUTABLE)
-   IF (KDE4_FIND_REQUIRED)
-      MESSAGE(FATAL_ERROR "ERROR: Could not find KDE4 kde4-config")
-   ENDIF (KDE4_FIND_REQUIRED)
-ENDIF (NOT KDE4_KDECONFIG_EXECUTABLE)
+if (NOT KDE4_KDECONFIG_EXECUTABLE)
+   if (KDE4_FIND_REQUIRED)
+      message(FATAL_ERROR "ERROR: Could not find KDE4 kde4-config")
+   endif (KDE4_FIND_REQUIRED)
+endif (NOT KDE4_KDECONFIG_EXECUTABLE)
 
 
 # when cross compiling, KDE4_DATA_DIR may be already preset
-IF(NOT KDE4_DATA_DIR)
-   IF(CMAKE_CROSSCOMPILING)
+if(NOT KDE4_DATA_DIR)
+   if(CMAKE_CROSSCOMPILING)
       # when cross compiling, don't run kde4-config but use its location as install dir
-      GET_FILENAME_COMPONENT(KDE4_DATA_DIR "${KDE4_KDECONFIG_EXECUTABLE}" PATH)
-      GET_FILENAME_COMPONENT(KDE4_DATA_DIR "${KDE4_DATA_DIR}" PATH)
-   ELSE(CMAKE_CROSSCOMPILING)
+      get_filename_component(KDE4_DATA_DIR "${KDE4_KDECONFIG_EXECUTABLE}" PATH)
+      get_filename_component(KDE4_DATA_DIR "${KDE4_DATA_DIR}" PATH)
+   else(CMAKE_CROSSCOMPILING)
       # then ask kde4-config for the kde data dirs
 
-      IF(KDE4_KDECONFIG_EXECUTABLE)
-        EXECUTE_PROCESS(COMMAND "${KDE4_KDECONFIG_EXECUTABLE}" --path data OUTPUT_VARIABLE _data_DIR ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
-        FILE(TO_CMAKE_PATH "${_data_DIR}" _data_DIR)
+      if(KDE4_KDECONFIG_EXECUTABLE)
+        execute_process(COMMAND "${KDE4_KDECONFIG_EXECUTABLE}" --path data OUTPUT_VARIABLE _data_DIR ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
+        file(TO_CMAKE_PATH "${_data_DIR}" _data_DIR)
         # then check the data dirs for FindKDE4Internal.cmake
-        FIND_PATH(KDE4_DATA_DIR cmake/modules/FindKDE4Internal.cmake HINTS ${_data_DIR})
-      ENDIF(KDE4_KDECONFIG_EXECUTABLE)
-   ENDIF(CMAKE_CROSSCOMPILING)
-ENDIF(NOT KDE4_DATA_DIR)
+        find_path(KDE4_DATA_DIR cmake/modules/FindKDE4Internal.cmake HINTS ${_data_DIR})
+      endif(KDE4_KDECONFIG_EXECUTABLE)
+   endif(CMAKE_CROSSCOMPILING)
+endif(NOT KDE4_DATA_DIR)
 
 # if it has been found...
-IF (KDE4_DATA_DIR)
+if (KDE4_DATA_DIR)
 
-   SET(CMAKE_MODULE_PATH  ${CMAKE_MODULE_PATH} ${KDE4_DATA_DIR}/cmake/modules)
+   set(CMAKE_MODULE_PATH  ${CMAKE_MODULE_PATH} ${KDE4_DATA_DIR}/cmake/modules)
 
-   IF (KDE4_FIND_QUIETLY)
-      SET(_quiet QUIET)
-   ENDIF (KDE4_FIND_QUIETLY)
+   if (KDE4_FIND_QUIETLY)
+      set(_quiet QUIET)
+   endif (KDE4_FIND_QUIETLY)
 
-   IF (KDE4_FIND_REQUIRED)
-      SET(_req REQUIRED)
-   ENDIF (KDE4_FIND_REQUIRED)
+   if (KDE4_FIND_REQUIRED)
+      set(_req REQUIRED)
+   endif (KDE4_FIND_REQUIRED)
 
    # use FindKDE4Internal.cmake to do the rest
-   FIND_PACKAGE(KDE4Internal ${_req} ${_quiet})
-ELSE (KDE4_DATA_DIR)
-   IF (KDE4_FIND_REQUIRED)
-      MESSAGE(FATAL_ERROR "ERROR: cmake/modules/FindKDE4Internal.cmake not found in ${_data_DIR}")
-   ENDIF (KDE4_FIND_REQUIRED)
-ENDIF (KDE4_DATA_DIR)
+   find_package(KDE4Internal ${_req} ${_quiet})
+else (KDE4_DATA_DIR)
+   if (KDE4_FIND_REQUIRED)
+      message(FATAL_ERROR "ERROR: cmake/modules/FindKDE4Internal.cmake not found in ${_data_DIR}")
+   endif (KDE4_FIND_REQUIRED)
+endif (KDE4_DATA_DIR)
diff --git a/Modules/FindLATEX.cmake b/Modules/FindLATEX.cmake
index 7997ae9c8..020272724 100644
--- a/Modules/FindLATEX.cmake
+++ b/Modules/FindLATEX.cmake
@@ -24,97 +24,97 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-IF (WIN32)
+if (WIN32)
 
   # Try to find the MikTex binary path (look for its package manager).
 
-  FIND_PATH(MIKTEX_BINARY_PATH mpm.exe
+  find_path(MIKTEX_BINARY_PATH mpm.exe
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MiK\\MiKTeX\\CurrentVersion\\MiKTeX;Install Root]/miktex/bin"
     DOC
     "Path to the MikTex binary directory."
   )
-  MARK_AS_ADVANCED(MIKTEX_BINARY_PATH)
+  mark_as_advanced(MIKTEX_BINARY_PATH)
 
   # Try to find the GhostScript binary path (look for gswin32).
 
-  GET_FILENAME_COMPONENT(GHOSTSCRIPT_BINARY_PATH_FROM_REGISTERY_8_00
+  get_filename_component(GHOSTSCRIPT_BINARY_PATH_FROM_REGISTERY_8_00
      "[HKEY_LOCAL_MACHINE\\SOFTWARE\\AFPL Ghostscript\\8.00;GS_DLL]" PATH
   )
 
-  GET_FILENAME_COMPONENT(GHOSTSCRIPT_BINARY_PATH_FROM_REGISTERY_7_04
+  get_filename_component(GHOSTSCRIPT_BINARY_PATH_FROM_REGISTERY_7_04
      "[HKEY_LOCAL_MACHINE\\SOFTWARE\\AFPL Ghostscript\\7.04;GS_DLL]" PATH
   )
 
-  FIND_PATH(GHOSTSCRIPT_BINARY_PATH gswin32.exe
+  find_path(GHOSTSCRIPT_BINARY_PATH gswin32.exe
     ${GHOSTSCRIPT_BINARY_PATH_FROM_REGISTERY_8_00}
     ${GHOSTSCRIPT_BINARY_PATH_FROM_REGISTERY_7_04}
     DOC "Path to the GhostScript binary directory."
   )
-  MARK_AS_ADVANCED(GHOSTSCRIPT_BINARY_PATH)
+  mark_as_advanced(GHOSTSCRIPT_BINARY_PATH)
 
-  FIND_PATH(GHOSTSCRIPT_LIBRARY_PATH ps2pdf13.bat
+  find_path(GHOSTSCRIPT_LIBRARY_PATH ps2pdf13.bat
     "${GHOSTSCRIPT_BINARY_PATH}/../lib"
     DOC "Path to the GhostScript library directory."
   )
-  MARK_AS_ADVANCED(GHOSTSCRIPT_LIBRARY_PATH)
+  mark_as_advanced(GHOSTSCRIPT_LIBRARY_PATH)
 
-ENDIF (WIN32)
+endif (WIN32)
 
-FIND_PROGRAM(LATEX_COMPILER
+find_program(LATEX_COMPILER
   NAMES latex
   PATHS ${MIKTEX_BINARY_PATH}
         /usr/bin
 )
 
-FIND_PROGRAM(PDFLATEX_COMPILER
+find_program(PDFLATEX_COMPILER
   NAMES pdflatex
   PATHS ${MIKTEX_BINARY_PATH}
         /usr/bin
 )
 
-FIND_PROGRAM(BIBTEX_COMPILER
+find_program(BIBTEX_COMPILER
   NAMES bibtex
   PATHS ${MIKTEX_BINARY_PATH}
         /usr/bin
 )
 
-FIND_PROGRAM(MAKEINDEX_COMPILER
+find_program(MAKEINDEX_COMPILER
   NAMES makeindex
   PATHS ${MIKTEX_BINARY_PATH}
         /usr/bin
 )
 
-FIND_PROGRAM(DVIPS_CONVERTER
+find_program(DVIPS_CONVERTER
   NAMES dvips
   PATHS ${MIKTEX_BINARY_PATH}
         /usr/bin
 )
 
-FIND_PROGRAM(DVIPDF_CONVERTER
+find_program(DVIPDF_CONVERTER
   NAMES dvipdfm dvipdft dvipdf
   PATHS ${MIKTEX_BINARY_PATH}
         /usr/bin
 )
 
-IF (WIN32)
-  FIND_PROGRAM(PS2PDF_CONVERTER
+if (WIN32)
+  find_program(PS2PDF_CONVERTER
     NAMES ps2pdf14.bat
     PATHS ${GHOSTSCRIPT_LIBRARY_PATH}
   )
-ELSE (WIN32)
-  FIND_PROGRAM(PS2PDF_CONVERTER
+else (WIN32)
+  find_program(PS2PDF_CONVERTER
     NAMES ps2pdf14 ps2pdf
   )
-ENDIF (WIN32)
+endif (WIN32)
 
-FIND_PROGRAM(LATEX2HTML_CONVERTER
+find_program(LATEX2HTML_CONVERTER
   NAMES latex2html
   PATHS ${MIKTEX_BINARY_PATH}
         /usr/bin
 )
 
 
-MARK_AS_ADVANCED(
+mark_as_advanced(
   LATEX_COMPILER
   PDFLATEX_COMPILER
   BIBTEX_COMPILER
diff --git a/Modules/FindLibLZMA.cmake b/Modules/FindLibLZMA.cmake
index 729f5ce73..852d61314 100644
--- a/Modules/FindLibLZMA.cmake
+++ b/Modules/FindLibLZMA.cmake
@@ -29,30 +29,30 @@
 #  License text for the above reference.)
 
 
-FIND_PATH(LIBLZMA_INCLUDE_DIR lzma.h )
-FIND_LIBRARY(LIBLZMA_LIBRARY lzma)
+find_path(LIBLZMA_INCLUDE_DIR lzma.h )
+find_library(LIBLZMA_LIBRARY lzma)
 
-IF(LIBLZMA_INCLUDE_DIR AND EXISTS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h")
-    FILE(READ "${LIBLZMA_INCLUDE_DIR}/lzma/version.h" LIBLZMA_HEADER_CONTENTS)
+if(LIBLZMA_INCLUDE_DIR AND EXISTS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h")
+    file(READ "${LIBLZMA_INCLUDE_DIR}/lzma/version.h" LIBLZMA_HEADER_CONTENTS)
 
-    STRING(REGEX REPLACE ".*#define LZMA_VERSION_MAJOR ([0-9]+).*" "\\1" LIBLZMA_VERSION_MAJOR "${LIBLZMA_HEADER_CONTENTS}")
-    STRING(REGEX REPLACE ".*#define LZMA_VERSION_MINOR ([0-9]+).*" "\\1" LIBLZMA_VERSION_MINOR "${LIBLZMA_HEADER_CONTENTS}")
-    STRING(REGEX REPLACE ".*#define LZMA_VERSION_PATCH ([0-9]+).*" "\\1" LIBLZMA_VERSION_PATCH "${LIBLZMA_HEADER_CONTENTS}")
+    string(REGEX REPLACE ".*#define LZMA_VERSION_MAJOR ([0-9]+).*" "\\1" LIBLZMA_VERSION_MAJOR "${LIBLZMA_HEADER_CONTENTS}")
+    string(REGEX REPLACE ".*#define LZMA_VERSION_MINOR ([0-9]+).*" "\\1" LIBLZMA_VERSION_MINOR "${LIBLZMA_HEADER_CONTENTS}")
+    string(REGEX REPLACE ".*#define LZMA_VERSION_PATCH ([0-9]+).*" "\\1" LIBLZMA_VERSION_PATCH "${LIBLZMA_HEADER_CONTENTS}")
 
-    SET(LIBLZMA_VERSION_STRING "${LIBLZMA_VERSION_MAJOR}.${LIBLZMA_VERSION_MINOR}.${LIBLZMA_VERSION_PATCH}")
-ENDIF(LIBLZMA_INCLUDE_DIR AND EXISTS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h")
+    set(LIBLZMA_VERSION_STRING "${LIBLZMA_VERSION_MAJOR}.${LIBLZMA_VERSION_MINOR}.${LIBLZMA_VERSION_PATCH}")
+endif(LIBLZMA_INCLUDE_DIR AND EXISTS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h")
 
 # We're using new code known now as XZ, even library still been called LZMA
 # it can be found in http://tukaani.org/xz/
 # Avoid using old codebase
-IF (LIBLZMA_LIBRARY)
-   INCLUDE(CheckLibraryExists)
+if (LIBLZMA_LIBRARY)
+   include(CheckLibraryExists)
    CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY} lzma_auto_decoder "" LIBLZMA_HAS_AUTO_DECODER)
    CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY} lzma_easy_encoder "" LIBLZMA_HAS_EASY_ENCODER)
    CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY} lzma_lzma_preset "" LIBLZMA_HAS_LZMA_PRESET)
-ENDIF (LIBLZMA_LIBRARY)
+endif (LIBLZMA_LIBRARY)
 
-INCLUDE(FindPackageHandleStandardArgs)
+include(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibLZMA  REQUIRED_VARS  LIBLZMA_INCLUDE_DIR
                                                           LIBLZMA_LIBRARY
                                                           LIBLZMA_HAS_AUTO_DECODER
@@ -61,9 +61,9 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibLZMA  REQUIRED_VARS  LIBLZMA_INCLUDE_DIR
                                            VERSION_VAR    LIBLZMA_VERSION_STRING
                                  )
 
-IF (LIBLZMA_FOUND)
-    SET(LIBLZMA_LIBRARIES ${LIBLZMA_LIBRARY})
-    SET(LIBLZMA_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIR})
-ENDIF (LIBLZMA_FOUND)
+if (LIBLZMA_FOUND)
+    set(LIBLZMA_LIBRARIES ${LIBLZMA_LIBRARY})
+    set(LIBLZMA_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIR})
+endif (LIBLZMA_FOUND)
 
-MARK_AS_ADVANCED( LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY )
+mark_as_advanced( LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY )
diff --git a/Modules/FindLibXml2.cmake b/Modules/FindLibXml2.cmake
index 4fc5d88b1..858496e09 100644
--- a/Modules/FindLibXml2.cmake
+++ b/Modules/FindLibXml2.cmake
@@ -23,44 +23,44 @@
 #  License text for the above reference.)
 
 # use pkg-config to get the directories and then use these values
-# in the FIND_PATH() and FIND_LIBRARY() calls
-FIND_PACKAGE(PkgConfig QUIET)
+# in the find_path() and find_library() calls
+find_package(PkgConfig QUIET)
 PKG_CHECK_MODULES(PC_LIBXML QUIET libxml-2.0)
-SET(LIBXML2_DEFINITIONS ${PC_LIBXML_CFLAGS_OTHER})
+set(LIBXML2_DEFINITIONS ${PC_LIBXML_CFLAGS_OTHER})
 
-FIND_PATH(LIBXML2_INCLUDE_DIR NAMES libxml/xpath.h
+find_path(LIBXML2_INCLUDE_DIR NAMES libxml/xpath.h
    HINTS
    ${PC_LIBXML_INCLUDEDIR}
    ${PC_LIBXML_INCLUDE_DIRS}
    PATH_SUFFIXES libxml2
    )
 
-FIND_LIBRARY(LIBXML2_LIBRARIES NAMES xml2 libxml2
+find_library(LIBXML2_LIBRARIES NAMES xml2 libxml2
    HINTS
    ${PC_LIBXML_LIBDIR}
    ${PC_LIBXML_LIBRARY_DIRS}
    )
 
-FIND_PROGRAM(LIBXML2_XMLLINT_EXECUTABLE xmllint)
+find_program(LIBXML2_XMLLINT_EXECUTABLE xmllint)
 # for backwards compat. with KDE 4.0.x:
-SET(XMLLINT_EXECUTABLE "${LIBXML2_XMLLINT_EXECUTABLE}")
+set(XMLLINT_EXECUTABLE "${LIBXML2_XMLLINT_EXECUTABLE}")
 
-IF(PC_LIBXML_VERSION)
-    SET(LIBXML2_VERSION_STRING ${PC_LIBXML_VERSION})
-ELSEIF(LIBXML2_INCLUDE_DIR AND EXISTS "${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.h")
-    FILE(STRINGS "${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.h" libxml2_version_str
+if(PC_LIBXML_VERSION)
+    set(LIBXML2_VERSION_STRING ${PC_LIBXML_VERSION})
+elseif(LIBXML2_INCLUDE_DIR AND EXISTS "${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.h")
+    file(STRINGS "${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.h" libxml2_version_str
          REGEX "^#define[\t ]+LIBXML_DOTTED_VERSION[\t ]+\".*\"")
 
-    STRING(REGEX REPLACE "^#define[\t ]+LIBXML_DOTTED_VERSION[\t ]+\"([^\"]*)\".*" "\\1"
+    string(REGEX REPLACE "^#define[\t ]+LIBXML_DOTTED_VERSION[\t ]+\"([^\"]*)\".*" "\\1"
            LIBXML2_VERSION_STRING "${libxml2_version_str}")
-    UNSET(libxml2_version_str)
-ENDIF()
+    unset(libxml2_version_str)
+endif()
 
 # handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2
                                   REQUIRED_VARS LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR
                                   VERSION_VAR LIBXML2_VERSION_STRING)
 
-MARK_AS_ADVANCED(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES LIBXML2_XMLLINT_EXECUTABLE)
+mark_as_advanced(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES LIBXML2_XMLLINT_EXECUTABLE)
diff --git a/Modules/FindLibXslt.cmake b/Modules/FindLibXslt.cmake
index dd5aac461..7d142f430 100644
--- a/Modules/FindLibXslt.cmake
+++ b/Modules/FindLibXslt.cmake
@@ -25,50 +25,50 @@
 #  License text for the above reference.)
 
 # use pkg-config to get the directories and then use these values
-# in the FIND_PATH() and FIND_LIBRARY() calls
-FIND_PACKAGE(PkgConfig QUIET)
+# in the find_path() and find_library() calls
+find_package(PkgConfig QUIET)
 PKG_CHECK_MODULES(PC_LIBXSLT QUIET libxslt)
-SET(LIBXSLT_DEFINITIONS ${PC_LIBXSLT_CFLAGS_OTHER})
+set(LIBXSLT_DEFINITIONS ${PC_LIBXSLT_CFLAGS_OTHER})
 
-FIND_PATH(LIBXSLT_INCLUDE_DIR NAMES libxslt/xslt.h
+find_path(LIBXSLT_INCLUDE_DIR NAMES libxslt/xslt.h
     HINTS
    ${PC_LIBXSLT_INCLUDEDIR}
    ${PC_LIBXSLT_INCLUDE_DIRS}
   )
 
-FIND_LIBRARY(LIBXSLT_LIBRARIES NAMES xslt libxslt
+find_library(LIBXSLT_LIBRARIES NAMES xslt libxslt
     HINTS
    ${PC_LIBXSLT_LIBDIR}
    ${PC_LIBXSLT_LIBRARY_DIRS}
   )
 
-FIND_LIBRARY(LIBXSLT_EXSLT_LIBRARY NAMES exslt libexslt
+find_library(LIBXSLT_EXSLT_LIBRARY NAMES exslt libexslt
     HINTS
     ${PC_LIBXSLT_LIBDIR}
     ${PC_LIBXSLT_LIBRARY_DIRS}
   )
 
-SET(LIBXSLT_EXSLT_LIBRARIES ${LIBXSLT_EXSLT_LIBRARY} )
+set(LIBXSLT_EXSLT_LIBRARIES ${LIBXSLT_EXSLT_LIBRARY} )
 
-FIND_PROGRAM(LIBXSLT_XSLTPROC_EXECUTABLE xsltproc)
+find_program(LIBXSLT_XSLTPROC_EXECUTABLE xsltproc)
 
-IF(PC_LIBXSLT_VERSION)
-    SET(LIBXSLT_VERSION_STRING ${PC_LIBXSLT_VERSION})
-ELSEIF(LIBXSLT_INCLUDE_DIR AND EXISTS "${LIBXSLT_INCLUDE_DIR}/libxslt/xsltconfig.h")
-    FILE(STRINGS "${LIBXSLT_INCLUDE_DIR}/libxslt/xsltconfig.h" libxslt_version_str
+if(PC_LIBXSLT_VERSION)
+    set(LIBXSLT_VERSION_STRING ${PC_LIBXSLT_VERSION})
+elseif(LIBXSLT_INCLUDE_DIR AND EXISTS "${LIBXSLT_INCLUDE_DIR}/libxslt/xsltconfig.h")
+    file(STRINGS "${LIBXSLT_INCLUDE_DIR}/libxslt/xsltconfig.h" libxslt_version_str
          REGEX "^#define[\t ]+LIBXSLT_DOTTED_VERSION[\t ]+\".*\"")
 
-    STRING(REGEX REPLACE "^#define[\t ]+LIBXSLT_DOTTED_VERSION[\t ]+\"([^\"]*)\".*" "\\1"
+    string(REGEX REPLACE "^#define[\t ]+LIBXSLT_DOTTED_VERSION[\t ]+\"([^\"]*)\".*" "\\1"
            LIBXSLT_VERSION_STRING "${libxslt_version_str}")
-    UNSET(libxslt_version_str)
-ENDIF()
+    unset(libxslt_version_str)
+endif()
 
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXslt
                                   REQUIRED_VARS LIBXSLT_LIBRARIES LIBXSLT_INCLUDE_DIR
                                   VERSION_VAR LIBXSLT_VERSION_STRING)
 
-MARK_AS_ADVANCED(LIBXSLT_INCLUDE_DIR
+mark_as_advanced(LIBXSLT_INCLUDE_DIR
                  LIBXSLT_LIBRARIES
                  LIBXSLT_EXSLT_LIBRARY
                  LIBXSLT_XSLTPROC_EXECUTABLE)
diff --git a/Modules/FindLua50.cmake b/Modules/FindLua50.cmake
index 5196cf758..cfe2e7294 100644
--- a/Modules/FindLua50.cmake
+++ b/Modules/FindLua50.cmake
@@ -24,7 +24,7 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PATH(LUA_INCLUDE_DIR lua.h
+find_path(LUA_INCLUDE_DIR lua.h
   HINTS
   $ENV{LUA_DIR}
   PATH_SUFFIXES include/lua50 include/lua5.0 include/lua5 include/lua include
@@ -37,7 +37,7 @@ FIND_PATH(LUA_INCLUDE_DIR lua.h
   /opt
 )
 
-FIND_LIBRARY(LUA_LIBRARY_lua
+find_library(LUA_LIBRARY_lua
   NAMES lua50 lua5.0 lua-5.0 lua5 lua
   HINTS
   $ENV{LUA_DIR}
@@ -53,10 +53,10 @@ FIND_LIBRARY(LUA_LIBRARY_lua
 
 # In an OS X framework, lualib is usually included as part of the framework
 # (like GLU in OpenGL.framework)
-IF(${LUA_LIBRARY_lua} MATCHES "framework")
-  SET( LUA_LIBRARIES "${LUA_LIBRARY_lua}" CACHE STRING "Lua framework")
-ELSE(${LUA_LIBRARY_lua} MATCHES "framework")
-  FIND_LIBRARY(LUA_LIBRARY_lualib
+if(${LUA_LIBRARY_lua} MATCHES "framework")
+  set( LUA_LIBRARIES "${LUA_LIBRARY_lua}" CACHE STRING "Lua framework")
+else(${LUA_LIBRARY_lua} MATCHES "framework")
+  find_library(LUA_LIBRARY_lualib
     NAMES lualib50 lualib5.0 lualib5 lualib
     HINTS
     $ENV{LUALIB_DIR}
@@ -68,23 +68,23 @@ ELSE(${LUA_LIBRARY_lua} MATCHES "framework")
     /opt/csw
     /opt
   )
-  IF(LUA_LIBRARY_lualib AND LUA_LIBRARY_lua)
+  if(LUA_LIBRARY_lualib AND LUA_LIBRARY_lua)
     # include the math library for Unix
-    IF(UNIX AND NOT APPLE)
-      FIND_LIBRARY(MATH_LIBRARY_FOR_LUA m)
-      SET( LUA_LIBRARIES "${LUA_LIBRARY_lualib};${LUA_LIBRARY_lua};${MATH_LIBRARY_FOR_LUA}" CACHE STRING "This is the concatentation of lua and lualib libraries")
+    if(UNIX AND NOT APPLE)
+      find_library(MATH_LIBRARY_FOR_LUA m)
+      set( LUA_LIBRARIES "${LUA_LIBRARY_lualib};${LUA_LIBRARY_lua};${MATH_LIBRARY_FOR_LUA}" CACHE STRING "This is the concatentation of lua and lualib libraries")
     # For Windows and Mac, don't need to explicitly include the math library
-    ELSE(UNIX AND NOT APPLE)
-      SET( LUA_LIBRARIES "${LUA_LIBRARY_lualib};${LUA_LIBRARY_lua}" CACHE STRING "This is the concatentation of lua and lualib libraries")
-    ENDIF(UNIX AND NOT APPLE)
-  ENDIF(LUA_LIBRARY_lualib AND LUA_LIBRARY_lua)
-ENDIF(${LUA_LIBRARY_lua} MATCHES "framework")
+    else(UNIX AND NOT APPLE)
+      set( LUA_LIBRARIES "${LUA_LIBRARY_lualib};${LUA_LIBRARY_lua}" CACHE STRING "This is the concatentation of lua and lualib libraries")
+    endif(UNIX AND NOT APPLE)
+  endif(LUA_LIBRARY_lualib AND LUA_LIBRARY_lua)
+endif(${LUA_LIBRARY_lua} MATCHES "framework")
 
 
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 # handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
 # all listed variables are TRUE
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua50  DEFAULT_MSG  LUA_LIBRARIES LUA_INCLUDE_DIR)
 
-MARK_AS_ADVANCED(LUA_INCLUDE_DIR LUA_LIBRARIES)
+mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARIES)
 
diff --git a/Modules/FindLua51.cmake b/Modules/FindLua51.cmake
index 468b5d4fc..2d189e4c6 100644
--- a/Modules/FindLua51.cmake
+++ b/Modules/FindLua51.cmake
@@ -25,7 +25,7 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PATH(LUA_INCLUDE_DIR lua.h
+find_path(LUA_INCLUDE_DIR lua.h
   HINTS
   $ENV{LUA_DIR}
   PATH_SUFFIXES include/lua51 include/lua5.1 include/lua include
@@ -38,7 +38,7 @@ FIND_PATH(LUA_INCLUDE_DIR lua.h
   /opt
 )
 
-FIND_LIBRARY(LUA_LIBRARY
+find_library(LUA_LIBRARY
   NAMES lua51 lua5.1 lua-5.1 lua
   HINTS
   $ENV{LUA_DIR}
@@ -52,30 +52,30 @@ FIND_LIBRARY(LUA_LIBRARY
   /opt
 )
 
-IF(LUA_LIBRARY)
+if(LUA_LIBRARY)
   # include the math library for Unix
-  IF(UNIX AND NOT APPLE)
-    FIND_LIBRARY(LUA_MATH_LIBRARY m)
-    SET( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
+  if(UNIX AND NOT APPLE)
+    find_library(LUA_MATH_LIBRARY m)
+    set( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
   # For Windows and Mac, don't need to explicitly include the math library
-  ELSE(UNIX AND NOT APPLE)
-    SET( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")
-  ENDIF(UNIX AND NOT APPLE)
-ENDIF(LUA_LIBRARY)
+  else(UNIX AND NOT APPLE)
+    set( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")
+  endif(UNIX AND NOT APPLE)
+endif(LUA_LIBRARY)
 
-IF(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
-  FILE(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")
+if(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
+  file(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")
 
-  STRING(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}")
-  UNSET(lua_version_str)
-ENDIF()
+  string(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}")
+  unset(lua_version_str)
+endif()
 
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 # handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
 # all listed variables are TRUE
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua51
                                   REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
                                   VERSION_VAR LUA_VERSION_STRING)
 
-MARK_AS_ADVANCED(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY)
+mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY)
 
diff --git a/Modules/FindMFC.cmake b/Modules/FindMFC.cmake
index 3df284241..f45046dca 100644
--- a/Modules/FindMFC.cmake
+++ b/Modules/FindMFC.cmake
@@ -18,43 +18,43 @@
 #  License text for the above reference.)
 
 # Assume no MFC support
-SET(MFC_FOUND "NO")
+set(MFC_FOUND "NO")
 
 # Only attempt the try_compile call if it has a chance to succeed:
-SET(MFC_ATTEMPT_TRY_COMPILE 0)
-IF(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW)
-  SET(MFC_ATTEMPT_TRY_COMPILE 1)
-ENDIF(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW)
+set(MFC_ATTEMPT_TRY_COMPILE 0)
+if(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW)
+  set(MFC_ATTEMPT_TRY_COMPILE 1)
+endif(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW)
 
-IF(MFC_ATTEMPT_TRY_COMPILE)
-  IF("MFC_HAVE_MFC" MATCHES "^MFC_HAVE_MFC$")
-    SET(CHECK_INCLUDE_FILE_VAR "afxwin.h")
-    CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
+if(MFC_ATTEMPT_TRY_COMPILE)
+  if("MFC_HAVE_MFC" MATCHES "^MFC_HAVE_MFC$")
+    set(CHECK_INCLUDE_FILE_VAR "afxwin.h")
+    configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx)
-    MESSAGE(STATUS "Looking for MFC")
-    TRY_COMPILE(MFC_HAVE_MFC
+    message(STATUS "Looking for MFC")
+    try_compile(MFC_HAVE_MFC
       ${CMAKE_BINARY_DIR}
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx
       CMAKE_FLAGS
       -DCMAKE_MFC_FLAG:STRING=2
       -DCOMPILE_DEFINITIONS:STRING=-D_AFXDLL
       OUTPUT_VARIABLE OUTPUT)
-    IF(MFC_HAVE_MFC)
-      MESSAGE(STATUS "Looking for MFC - found")
-      SET(MFC_HAVE_MFC 1 CACHE INTERNAL "Have MFC?")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    if(MFC_HAVE_MFC)
+      message(STATUS "Looking for MFC - found")
+      set(MFC_HAVE_MFC 1 CACHE INTERNAL "Have MFC?")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if MFC exists passed with the following output:\n"
         "${OUTPUT}\n\n")
-    ELSE(MFC_HAVE_MFC)
-      MESSAGE(STATUS "Looking for MFC - not found")
-      SET(MFC_HAVE_MFC 0 CACHE INTERNAL "Have MFC?")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+    else(MFC_HAVE_MFC)
+      message(STATUS "Looking for MFC - not found")
+      set(MFC_HAVE_MFC 0 CACHE INTERNAL "Have MFC?")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if MFC exists failed with the following output:\n"
         "${OUTPUT}\n\n")
-    ENDIF(MFC_HAVE_MFC)
-  ENDIF("MFC_HAVE_MFC" MATCHES "^MFC_HAVE_MFC$")
+    endif(MFC_HAVE_MFC)
+  endif("MFC_HAVE_MFC" MATCHES "^MFC_HAVE_MFC$")
 
-  IF(MFC_HAVE_MFC)
-    SET(MFC_FOUND "YES")
-  ENDIF(MFC_HAVE_MFC)
-ENDIF(MFC_ATTEMPT_TRY_COMPILE)
+  if(MFC_HAVE_MFC)
+    set(MFC_FOUND "YES")
+  endif(MFC_HAVE_MFC)
+endif(MFC_ATTEMPT_TRY_COMPILE)
diff --git a/Modules/FindMPEG.cmake b/Modules/FindMPEG.cmake
index 545e0490c..698329e9b 100644
--- a/Modules/FindMPEG.cmake
+++ b/Modules/FindMPEG.cmake
@@ -20,25 +20,25 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PATH(MPEG_INCLUDE_DIR mpeg2dec/include/video_out.h
+find_path(MPEG_INCLUDE_DIR mpeg2dec/include/video_out.h
   /usr/local/livid
 )
 
-FIND_LIBRARY(MPEG_mpeg2_LIBRARY mpeg2
+find_library(MPEG_mpeg2_LIBRARY mpeg2
   /usr/local/livid/mpeg2dec/libmpeg2/.libs
 )
 
-FIND_LIBRARY( MPEG_vo_LIBRARY vo
+find_library( MPEG_vo_LIBRARY vo
   /usr/local/livid/mpeg2dec/libvo/.libs
 )
 
 # handle the QUIETLY and REQUIRED arguments and set MPEG2_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(MPEG DEFAULT_MSG MPEG_INCLUDE_DIR MPEG_mpeg2_LIBRARY MPEG_vo_LIBRARY)
 
-IF(MPEG_FOUND)
-  SET( MPEG_LIBRARIES ${MPEG_mpeg2_LIBRARY} ${MPEG_vo_LIBRARY} )
-ENDIF(MPEG_FOUND)
+if(MPEG_FOUND)
+  set( MPEG_LIBRARIES ${MPEG_mpeg2_LIBRARY} ${MPEG_vo_LIBRARY} )
+endif(MPEG_FOUND)
 
-MARK_AS_ADVANCED(MPEG_INCLUDE_DIR MPEG_mpeg2_LIBRARY MPEG_vo_LIBRARY)
+mark_as_advanced(MPEG_INCLUDE_DIR MPEG_mpeg2_LIBRARY MPEG_vo_LIBRARY)
diff --git a/Modules/FindMPEG2.cmake b/Modules/FindMPEG2.cmake
index 5456e20b6..153ed7f57 100644
--- a/Modules/FindMPEG2.cmake
+++ b/Modules/FindMPEG2.cmake
@@ -20,35 +20,35 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PATH(MPEG2_INCLUDE_DIR
+find_path(MPEG2_INCLUDE_DIR
   NAMES mpeg2.h mpeg2dec/mpeg2.h
   PATHS /usr/local/livid
 )
 
-FIND_LIBRARY(MPEG2_mpeg2_LIBRARY mpeg2
+find_library(MPEG2_mpeg2_LIBRARY mpeg2
   /usr/local/livid/mpeg2dec/libmpeg2/.libs
 )
 
-FIND_LIBRARY( MPEG2_vo_LIBRARY vo
+find_library( MPEG2_vo_LIBRARY vo
   /usr/local/livid/mpeg2dec/libvo/.libs
 )
 
 
 # handle the QUIETLY and REQUIRED arguments and set MPEG2_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(MPEG2 DEFAULT_MSG MPEG2_mpeg2_LIBRARY MPEG2_INCLUDE_DIR)
 
-IF(MPEG2_FOUND)
-  SET( MPEG2_LIBRARIES ${MPEG2_mpeg2_LIBRARY}
+if(MPEG2_FOUND)
+  set( MPEG2_LIBRARIES ${MPEG2_mpeg2_LIBRARY}
                         ${MPEG2_vo_LIBRARY})
 
   #some native mpeg2 installations will depend
   #on libSDL, if found, add it in.
-  INCLUDE( FindSDL )
-  IF(SDL_FOUND)
-    SET( MPEG2_LIBRARIES ${MPEG2_LIBRARIES} ${SDL_LIBRARY})
-  ENDIF(SDL_FOUND)
-ENDIF(MPEG2_FOUND)
+  include( FindSDL )
+  if(SDL_FOUND)
+    set( MPEG2_LIBRARIES ${MPEG2_LIBRARIES} ${SDL_LIBRARY})
+  endif(SDL_FOUND)
+endif(MPEG2_FOUND)
 
-MARK_AS_ADVANCED(MPEG2_INCLUDE_DIR MPEG2_mpeg2_LIBRARY MPEG2_vo_LIBRARY)
+mark_as_advanced(MPEG2_INCLUDE_DIR MPEG2_mpeg2_LIBRARY MPEG2_vo_LIBRARY)
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index 1cdb07174..20dc1daf9 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -19,75 +19,75 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-SET(MATLAB_FOUND 0)
-IF(WIN32)
-  IF(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
-    SET(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/msvc60")
-  ELSE(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
-    IF(${CMAKE_GENERATOR} MATCHES "Visual Studio 7")
+set(MATLAB_FOUND 0)
+if(WIN32)
+  if(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
+    set(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/msvc60")
+  else(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
+    if(${CMAKE_GENERATOR} MATCHES "Visual Studio 7")
       # Assume people are generally using 7.1,
       # if using 7.0 need to link to: ../extern/lib/win32/microsoft/msvc70
-      SET(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/msvc71")
-    ELSE(${CMAKE_GENERATOR} MATCHES "Visual Studio 7")
-      IF(${CMAKE_GENERATOR} MATCHES "Borland")
+      set(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/msvc71")
+    else(${CMAKE_GENERATOR} MATCHES "Visual Studio 7")
+      if(${CMAKE_GENERATOR} MATCHES "Borland")
         # Same here, there are also: bcc50 and bcc51 directories
-        SET(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/bcc54")
-      ELSE(${CMAKE_GENERATOR} MATCHES "Borland")
-        IF(MATLAB_FIND_REQUIRED)
-          MESSAGE(FATAL_ERROR "Generator not compatible: ${CMAKE_GENERATOR}")
-        ENDIF(MATLAB_FIND_REQUIRED)
-      ENDIF(${CMAKE_GENERATOR} MATCHES "Borland")
-    ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio 7")
-  ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
-  FIND_LIBRARY(MATLAB_MEX_LIBRARY
+        set(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/bcc54")
+      else(${CMAKE_GENERATOR} MATCHES "Borland")
+        if(MATLAB_FIND_REQUIRED)
+          message(FATAL_ERROR "Generator not compatible: ${CMAKE_GENERATOR}")
+        endif(MATLAB_FIND_REQUIRED)
+      endif(${CMAKE_GENERATOR} MATCHES "Borland")
+    endif(${CMAKE_GENERATOR} MATCHES "Visual Studio 7")
+  endif(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
+  find_library(MATLAB_MEX_LIBRARY
     libmex
     ${MATLAB_ROOT}
     )
-  FIND_LIBRARY(MATLAB_MX_LIBRARY
+  find_library(MATLAB_MX_LIBRARY
     libmx
     ${MATLAB_ROOT}
     )
-  FIND_LIBRARY(MATLAB_ENG_LIBRARY
+  find_library(MATLAB_ENG_LIBRARY
     libeng
     ${MATLAB_ROOT}
     )
 
-  FIND_PATH(MATLAB_INCLUDE_DIR
+  find_path(MATLAB_INCLUDE_DIR
     "mex.h"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/include"
     )
-ELSE( WIN32 )
-  IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
+else( WIN32 )
+  if(CMAKE_SIZEOF_VOID_P EQUAL 4)
     # Regular x86
-    SET(MATLAB_ROOT
+    set(MATLAB_ROOT
       /usr/local/matlab-7sp1/bin/glnx86/
       /opt/matlab-7sp1/bin/glnx86/
       $ENV{HOME}/matlab-7sp1/bin/glnx86/
       $ENV{HOME}/redhat-matlab/bin/glnx86/
       )
-  ELSE(CMAKE_SIZEOF_VOID_P EQUAL 4)
+  else(CMAKE_SIZEOF_VOID_P EQUAL 4)
     # AMD64:
-    SET(MATLAB_ROOT
+    set(MATLAB_ROOT
       /usr/local/matlab-7sp1/bin/glnxa64/
       /opt/matlab-7sp1/bin/glnxa64/
       $ENV{HOME}/matlab7_64/bin/glnxa64/
       $ENV{HOME}/matlab-7sp1/bin/glnxa64/
       $ENV{HOME}/redhat-matlab/bin/glnxa64/
       )
-  ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 4)
-  FIND_LIBRARY(MATLAB_MEX_LIBRARY
+  endif(CMAKE_SIZEOF_VOID_P EQUAL 4)
+  find_library(MATLAB_MEX_LIBRARY
     mex
     ${MATLAB_ROOT}
     )
-  FIND_LIBRARY(MATLAB_MX_LIBRARY
+  find_library(MATLAB_MX_LIBRARY
     mx
     ${MATLAB_ROOT}
     )
-  FIND_LIBRARY(MATLAB_ENG_LIBRARY
+  find_library(MATLAB_ENG_LIBRARY
     eng
     ${MATLAB_ROOT}
     )
-  FIND_PATH(MATLAB_INCLUDE_DIR
+  find_path(MATLAB_INCLUDE_DIR
     "mex.h"
     "/usr/local/matlab-7sp1/extern/include/"
     "/opt/matlab-7sp1/extern/include/"
@@ -95,20 +95,20 @@ ELSE( WIN32 )
     "$ENV{HOME}/redhat-matlab/extern/include/"
     )
 
-ENDIF(WIN32)
+endif(WIN32)
 
 # This is common to UNIX and Win32:
-SET(MATLAB_LIBRARIES
+set(MATLAB_LIBRARIES
   ${MATLAB_MEX_LIBRARY}
   ${MATLAB_MX_LIBRARY}
   ${MATLAB_ENG_LIBRARY}
 )
 
-IF(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)
-  SET(MATLAB_FOUND 1)
-ENDIF(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)
+if(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)
+  set(MATLAB_FOUND 1)
+endif(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)
 
-MARK_AS_ADVANCED(
+mark_as_advanced(
   MATLAB_LIBRARIES
   MATLAB_MEX_LIBRARY
   MATLAB_MX_LIBRARY
diff --git a/Modules/FindMotif.cmake b/Modules/FindMotif.cmake
index 57da1c1e9..5b7e6a108 100644
--- a/Modules/FindMotif.cmake
+++ b/Modules/FindMotif.cmake
@@ -17,28 +17,28 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-SET(MOTIF_FOUND 0)
+set(MOTIF_FOUND 0)
 
-IF(UNIX)
-  FIND_PATH(MOTIF_INCLUDE_DIR
+if(UNIX)
+  find_path(MOTIF_INCLUDE_DIR
     Xm/Xm.h
     /usr/openwin/include
     )
 
-  FIND_LIBRARY(MOTIF_LIBRARIES
+  find_library(MOTIF_LIBRARIES
     Xm
     /usr/openwin/lib
     )
 
-ENDIF(UNIX)
+endif(UNIX)
 
 # handle the QUIETLY and REQUIRED arguments and set MOTIF_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Motif DEFAULT_MSG MOTIF_LIBRARIES MOTIF_INCLUDE_DIR)
 
 
-MARK_AS_ADVANCED(
+mark_as_advanced(
   MOTIF_INCLUDE_DIR
   MOTIF_LIBRARIES
 )
diff --git a/Modules/FindOpenAL.cmake b/Modules/FindOpenAL.cmake
index fdac45518..311a11a7f 100644
--- a/Modules/FindOpenAL.cmake
+++ b/Modules/FindOpenAL.cmake
@@ -61,7 +61,7 @@
 # OPENAL_LIBRARY to override this selection or set the CMake environment
 # CMAKE_INCLUDE_PATH to modify the search paths.
 
-FIND_PATH(OPENAL_INCLUDE_DIR al.h
+find_path(OPENAL_INCLUDE_DIR al.h
   HINTS
   $ENV{OPENALDIR}
   PATH_SUFFIXES include/AL include/OpenAL include
@@ -75,7 +75,7 @@ FIND_PATH(OPENAL_INCLUDE_DIR al.h
   [HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]
 )
 
-FIND_LIBRARY(OPENAL_LIBRARY
+find_library(OPENAL_LIBRARY
   NAMES OpenAL al openal OpenAL32
   HINTS
   $ENV{OPENALDIR}
@@ -93,7 +93,7 @@ FIND_LIBRARY(OPENAL_LIBRARY
 
 # handle the QUIETLY and REQUIRED arguments and set OPENAL_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenAL  DEFAULT_MSG  OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
 
-MARK_AS_ADVANCED(OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
+mark_as_advanced(OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake
index 322972a59..15650117b 100644
--- a/Modules/FindOpenGL.cmake
+++ b/Modules/FindOpenGL.cmake
@@ -28,45 +28,45 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-IF (WIN32)
-  IF (CYGWIN)
+if (WIN32)
+  if (CYGWIN)
 
-    FIND_PATH(OPENGL_INCLUDE_DIR GL/gl.h )
+    find_path(OPENGL_INCLUDE_DIR GL/gl.h )
 
-    FIND_LIBRARY(OPENGL_gl_LIBRARY opengl32 )
+    find_library(OPENGL_gl_LIBRARY opengl32 )
 
-    FIND_LIBRARY(OPENGL_glu_LIBRARY glu32 )
+    find_library(OPENGL_glu_LIBRARY glu32 )
 
-  ELSE (CYGWIN)
+  else (CYGWIN)
 
-    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(BORLAND)
-      SET (OPENGL_gl_LIBRARY opengl32 CACHE STRING "OpenGL library for win32")
-      SET (OPENGL_glu_LIBRARY glu32 CACHE STRING "GLU library for win32")
-    ENDIF(BORLAND)
+    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(BORLAND)
+      set (OPENGL_gl_LIBRARY opengl32 CACHE STRING "OpenGL library for win32")
+      set (OPENGL_glu_LIBRARY glu32 CACHE STRING "GLU library for win32")
+    endif(BORLAND)
 
-  ENDIF (CYGWIN)
+  endif (CYGWIN)
 
-ELSE (WIN32)
+else (WIN32)
 
-  IF (APPLE)
+  if (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")
 
-  ELSE(APPLE)
+  else(APPLE)
     # 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(HPUX_IA_OPENGL_LIB_PATH /opt/graphics/OpenGL/lib/hpux32/)
-    ELSE(CMAKE_SIZEOF_VOID_P EQUAL 4)
-      SET(HPUX_IA_OPENGL_LIB_PATH
+    if(CMAKE_SIZEOF_VOID_P EQUAL 4)
+      set(HPUX_IA_OPENGL_LIB_PATH /opt/graphics/OpenGL/lib/hpux32/)
+    else(CMAKE_SIZEOF_VOID_P EQUAL 4)
+      set(HPUX_IA_OPENGL_LIB_PATH
         /opt/graphics/OpenGL/lib/hpux64/
         /opt/graphics/OpenGL/lib/pa20_64)
-    ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 4)
+    endif(CMAKE_SIZEOF_VOID_P EQUAL 4)
 
     # The first line below is to make sure that the proper headers
     # are used on a Linux machine with the NVidia drivers installed.
@@ -76,19 +76,19 @@ ELSE (WIN32)
     # Make sure the NVIDIA directory comes BEFORE the others.
     #  - Atanas Georgiev <atanas@cs.columbia.edu>
 
-    FIND_PATH(OPENGL_INCLUDE_DIR GL/gl.h
+    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
     )
 
-    FIND_PATH(OPENGL_xmesa_INCLUDE_DIR GL/xmesa.h
+    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
+    find_library(OPENGL_gl_LIBRARY
       NAMES GL MesaGL
       PATHS /opt/graphics/OpenGL/lib
             /usr/openwin/lib
@@ -101,18 +101,18 @@ ELSE (WIN32)
     # think this is always true.
     # It's not true on OSX.
 
-    IF (OPENGL_gl_LIBRARY)
-      IF(NOT X11_FOUND)
-        INCLUDE(FindX11)
-      ENDIF(NOT X11_FOUND)
-      IF (X11_FOUND)
-        IF (NOT APPLE)
-          SET (OPENGL_LIBRARIES ${X11_LIBRARIES})
-        ENDIF (NOT APPLE)
-      ENDIF (X11_FOUND)
-    ENDIF (OPENGL_gl_LIBRARY)
+    if (OPENGL_gl_LIBRARY)
+      if(NOT X11_FOUND)
+        include(FindX11)
+      endif(NOT X11_FOUND)
+      if (X11_FOUND)
+        if (NOT APPLE)
+          set (OPENGL_LIBRARIES ${X11_LIBRARIES})
+        endif (NOT APPLE)
+      endif (X11_FOUND)
+    endif (OPENGL_gl_LIBRARY)
 
-    FIND_LIBRARY(OPENGL_glu_LIBRARY
+    find_library(OPENGL_glu_LIBRARY
       NAMES GLU MesaGLU
       PATHS ${OPENGL_gl_LIBRARY}
             /opt/graphics/OpenGL/lib
@@ -120,39 +120,39 @@ ELSE (WIN32)
             /usr/shlib /usr/X11R6/lib
     )
 
-  ENDIF(APPLE)
-ENDIF (WIN32)
+  endif(APPLE)
+endif (WIN32)
 
-IF(OPENGL_gl_LIBRARY)
+if(OPENGL_gl_LIBRARY)
 
-    IF(OPENGL_xmesa_INCLUDE_DIR)
-      SET( OPENGL_XMESA_FOUND "YES" )
-    ELSE(OPENGL_xmesa_INCLUDE_DIR)
-      SET( OPENGL_XMESA_FOUND "NO" )
-    ENDIF(OPENGL_xmesa_INCLUDE_DIR)
+    if(OPENGL_xmesa_INCLUDE_DIR)
+      set( OPENGL_XMESA_FOUND "YES" )
+    else(OPENGL_xmesa_INCLUDE_DIR)
+      set( OPENGL_XMESA_FOUND "NO" )
+    endif(OPENGL_xmesa_INCLUDE_DIR)
 
-    SET( OPENGL_LIBRARIES  ${OPENGL_gl_LIBRARY} ${OPENGL_LIBRARIES})
-    IF(OPENGL_glu_LIBRARY)
-      SET( OPENGL_GLU_FOUND "YES" )
-      SET( OPENGL_LIBRARIES ${OPENGL_glu_LIBRARY} ${OPENGL_LIBRARIES} )
-    ELSE(OPENGL_glu_LIBRARY)
-      SET( OPENGL_GLU_FOUND "NO" )
-    ENDIF(OPENGL_glu_LIBRARY)
+    set( OPENGL_LIBRARIES  ${OPENGL_gl_LIBRARY} ${OPENGL_LIBRARIES})
+    if(OPENGL_glu_LIBRARY)
+      set( OPENGL_GLU_FOUND "YES" )
+      set( OPENGL_LIBRARIES ${OPENGL_glu_LIBRARY} ${OPENGL_LIBRARIES} )
+    else(OPENGL_glu_LIBRARY)
+      set( OPENGL_GLU_FOUND "NO" )
+    endif(OPENGL_glu_LIBRARY)
 
     # This deprecated setting is for backward compatibility with CMake1.4
-    SET (OPENGL_LIBRARY ${OPENGL_LIBRARIES})
+    set (OPENGL_LIBRARY ${OPENGL_LIBRARIES})
 
-ENDIF(OPENGL_gl_LIBRARY)
+endif(OPENGL_gl_LIBRARY)
 
 # This deprecated setting is for backward compatibility with CMake1.4
-SET(OPENGL_INCLUDE_PATH ${OPENGL_INCLUDE_DIR})
+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)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenGL DEFAULT_MSG OPENGL_gl_LIBRARY)
 
-MARK_AS_ADVANCED(
+mark_as_advanced(
   OPENGL_INCLUDE_DIR
   OPENGL_xmesa_INCLUDE_DIR
   OPENGL_glu_LIBRARY
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index 6642915ce..b812b22bb 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -29,16 +29,16 @@ if (UNIX)
   pkg_check_modules(_OPENSSL QUIET openssl)
 endif (UNIX)
 
-IF (WIN32)
+if (WIN32)
   # http://www.slproweb.com/products/Win32OpenSSL.html
-  SET(_OPENSSL_ROOT_HINTS
+  set(_OPENSSL_ROOT_HINTS
     ${OPENSSL_ROOT_DIR}
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]"
     ENV OPENSSL_ROOT_DIR
     )
-  FILE(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles)
-  SET(_OPENSSL_ROOT_PATHS
+  file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles)
+  set(_OPENSSL_ROOT_PATHS
     "${_programfiles}/OpenSSL"
     "${_programfiles}/OpenSSL-Win32"
     "${_programfiles}/OpenSSL-Win64"
@@ -46,19 +46,19 @@ IF (WIN32)
     "C:/OpenSSL-Win32/"
     "C:/OpenSSL-Win64/"
     )
-  UNSET(_programfiles)
-  SET(_OPENSSL_ROOT_HINTS_AND_PATHS
+  unset(_programfiles)
+  set(_OPENSSL_ROOT_HINTS_AND_PATHS
     HINTS ${_OPENSSL_ROOT_HINTS}
     PATHS ${_OPENSSL_ROOT_PATHS}
     )
-ELSE ()
-  SET(_OPENSSL_ROOT_HINTS
+else ()
+  set(_OPENSSL_ROOT_HINTS
     ${OPENSSL_ROOT_DIR}
     ENV OPENSSL_ROOT_DIR
     )
-ENDIF ()
+endif ()
 
-FIND_PATH(OPENSSL_INCLUDE_DIR
+find_path(OPENSSL_INCLUDE_DIR
   NAMES
     openssl/ssl.h
   HINTS
@@ -68,8 +68,8 @@ FIND_PATH(OPENSSL_INCLUDE_DIR
     include
 )
 
-IF(WIN32 AND NOT CYGWIN)
-  IF(MSVC)
+if(WIN32 AND NOT CYGWIN)
+  if(MSVC)
     # /MD and /MDd are the standard values - if someone wants to use
     # others, the libnames have to change here too
     # use also ssl and ssleay32 in debug as fallback for openssl < 0.9.8b
@@ -84,7 +84,7 @@ IF(WIN32 AND NOT CYGWIN)
     # We are using the libraries located in the VC subdir instead of the parent directory eventhough :
     # libeay32MD.lib is identical to ../libeay32.lib, and
     # ssleay32MD.lib is identical to ../ssleay32.lib
-    FIND_LIBRARY(LIB_EAY_DEBUG
+    find_library(LIB_EAY_DEBUG
       NAMES
         libeay32MDd
       ${_OPENSSL_ROOT_HINTS_AND_PATHS}
@@ -94,7 +94,7 @@ IF(WIN32 AND NOT CYGWIN)
         "lib/VC"
     )
 
-    FIND_LIBRARY(LIB_EAY_RELEASE
+    find_library(LIB_EAY_RELEASE
       NAMES
         libeay32MD
         libeay32
@@ -105,7 +105,7 @@ IF(WIN32 AND NOT CYGWIN)
         "lib/VC"
     )
 
-    FIND_LIBRARY(SSL_EAY_DEBUG
+    find_library(SSL_EAY_DEBUG
       NAMES
         ssleay32MDd
       ${_OPENSSL_ROOT_HINTS_AND_PATHS}
@@ -115,7 +115,7 @@ IF(WIN32 AND NOT CYGWIN)
         "lib/VC"
     )
 
-    FIND_LIBRARY(SSL_EAY_RELEASE
+    find_library(SSL_EAY_RELEASE
       NAMES
         ssleay32MD
         ssleay32
@@ -132,15 +132,15 @@ IF(WIN32 AND NOT CYGWIN)
     select_library_configurations(SSL_EAY)
 
     set( OPENSSL_LIBRARIES ${SSL_EAY_LIBRARY} ${LIB_EAY_LIBRARY} )
-  ELSEIF(MINGW)
+  elseif(MINGW)
     # same player, for MingW
-    SET(LIB_EAY_NAMES libeay32)
-    SET(SSL_EAY_NAMES ssleay32)
-    IF(CMAKE_CROSS_COMPILING)
-      LIST(APPEND LIB_EAY_NAMES crypto)
-      LIST(APPEND SSL_EAY_NAMES ssl)
-    ENDIF()
-    FIND_LIBRARY(LIB_EAY
+    set(LIB_EAY_NAMES libeay32)
+    set(SSL_EAY_NAMES ssleay32)
+    if(CMAKE_CROSS_COMPILING)
+      list(APPEND LIB_EAY_NAMES crypto)
+      list(APPEND SSL_EAY_NAMES ssl)
+    endif()
+    find_library(LIB_EAY
       NAMES
         ${LIB_EAY_NAMES}
       ${_OPENSSL_ROOT_HINTS_AND_PATHS}
@@ -149,7 +149,7 @@ IF(WIN32 AND NOT CYGWIN)
         "lib/MinGW"
     )
 
-    FIND_LIBRARY(SSL_EAY
+    find_library(SSL_EAY
       NAMES
         ${SSL_EAY_NAMES}
       ${_OPENSSL_ROOT_HINTS_AND_PATHS}
@@ -158,13 +158,13 @@ IF(WIN32 AND NOT CYGWIN)
         "lib/MinGW"
     )
 
-    MARK_AS_ADVANCED(SSL_EAY LIB_EAY)
+    mark_as_advanced(SSL_EAY LIB_EAY)
     set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
     unset(LIB_EAY_NAMES)
     unset(SSL_EAY_NAMES)
-  ELSE(MSVC)
+  else(MSVC)
     # Not sure what to pick for -say- intel, let's use the toplevel ones and hope someone report issues:
-    FIND_LIBRARY(LIB_EAY
+    find_library(LIB_EAY
       NAMES
         libeay32
       HINTS
@@ -174,7 +174,7 @@ IF(WIN32 AND NOT CYGWIN)
         lib
     )
 
-    FIND_LIBRARY(SSL_EAY
+    find_library(SSL_EAY
       NAMES
         ssleay32
       HINTS
@@ -184,12 +184,12 @@ IF(WIN32 AND NOT CYGWIN)
         lib
     )
 
-    MARK_AS_ADVANCED(SSL_EAY LIB_EAY)
+    mark_as_advanced(SSL_EAY LIB_EAY)
     set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
-  ENDIF(MSVC)
-ELSE(WIN32 AND NOT CYGWIN)
+  endif(MSVC)
+else(WIN32 AND NOT CYGWIN)
 
-  FIND_LIBRARY(OPENSSL_SSL_LIBRARY
+  find_library(OPENSSL_SSL_LIBRARY
     NAMES
       ssl
       ssleay32
@@ -201,7 +201,7 @@ ELSE(WIN32 AND NOT CYGWIN)
       lib
   )
 
-  FIND_LIBRARY(OPENSSL_CRYPTO_LIBRARY
+  find_library(OPENSSL_CRYPTO_LIBRARY
     NAMES
       crypto
     HINTS
@@ -211,15 +211,15 @@ ELSE(WIN32 AND NOT CYGWIN)
       lib
   )
 
-  MARK_AS_ADVANCED(OPENSSL_CRYPTO_LIBRARY OPENSSL_SSL_LIBRARY)
+  mark_as_advanced(OPENSSL_CRYPTO_LIBRARY OPENSSL_SSL_LIBRARY)
 
   # compat defines
-  SET(OPENSSL_SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY})
-  SET(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
+  set(OPENSSL_SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY})
+  set(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
 
-  SET(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
+  set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
 
-ENDIF(WIN32 AND NOT CYGWIN)
+endif(WIN32 AND NOT CYGWIN)
 
 function(from_hex HEX DEC)
   string(TOUPPER "${HEX}" HEX)
@@ -309,4 +309,4 @@ else (OPENSSL_VERSION)
   )
 endif (OPENSSL_VERSION)
 
-MARK_AS_ADVANCED(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES)
+mark_as_advanced(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES)
diff --git a/Modules/FindOpenSceneGraph.cmake b/Modules/FindOpenSceneGraph.cmake
index 9dd2c28f0..17ab05776 100644
--- a/Modules/FindOpenSceneGraph.cmake
+++ b/Modules/FindOpenSceneGraph.cmake
@@ -161,7 +161,7 @@ if(OpenSceneGraph_FIND_QUIETLY)
     set(_osg_quiet "QUIET")
 endif()
 #
-# Here we call FIND_PACKAGE() on all of the components
+# Here we call find_package() on all of the components
 #
 foreach(_osg_module ${_osg_modules_to_process})
     if(OpenSceneGraph_DEBUG)
diff --git a/Modules/FindPHP4.cmake b/Modules/FindPHP4.cmake
index abdabe144..2c6a7c8d0 100644
--- a/Modules/FindPHP4.cmake
+++ b/Modules/FindPHP4.cmake
@@ -20,7 +20,7 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-SET(PHP4_POSSIBLE_INCLUDE_PATHS
+set(PHP4_POSSIBLE_INCLUDE_PATHS
   /usr/include/php4
   /usr/local/include/php4
   /usr/include/php
@@ -28,33 +28,33 @@ SET(PHP4_POSSIBLE_INCLUDE_PATHS
   /usr/local/apache/php
   )
 
-SET(PHP4_POSSIBLE_LIB_PATHS
+set(PHP4_POSSIBLE_LIB_PATHS
   /usr/lib
   )
 
-FIND_PATH(PHP4_FOUND_INCLUDE_PATH main/php.h
+find_path(PHP4_FOUND_INCLUDE_PATH main/php.h
   ${PHP4_POSSIBLE_INCLUDE_PATHS})
 
-IF(PHP4_FOUND_INCLUDE_PATH)
-  SET(php4_paths "${PHP4_POSSIBLE_INCLUDE_PATHS}")
-  FOREACH(php4_path Zend main TSRM)
-    SET(php4_paths ${php4_paths} "${PHP4_FOUND_INCLUDE_PATH}/${php4_path}")
-  ENDFOREACH(php4_path Zend main TSRM)
-  SET(PHP4_INCLUDE_PATH "${php4_paths}" INTERNAL "PHP4 include paths")
-ENDIF(PHP4_FOUND_INCLUDE_PATH)
+if(PHP4_FOUND_INCLUDE_PATH)
+  set(php4_paths "${PHP4_POSSIBLE_INCLUDE_PATHS}")
+  foreach(php4_path Zend main TSRM)
+    set(php4_paths ${php4_paths} "${PHP4_FOUND_INCLUDE_PATH}/${php4_path}")
+  endforeach(php4_path Zend main TSRM)
+  set(PHP4_INCLUDE_PATH "${php4_paths}" INTERNAL "PHP4 include paths")
+endif(PHP4_FOUND_INCLUDE_PATH)
 
-FIND_PROGRAM(PHP4_EXECUTABLE NAMES php4 php )
+find_program(PHP4_EXECUTABLE NAMES php4 php )
 
-MARK_AS_ADVANCED(
+mark_as_advanced(
   PHP4_EXECUTABLE
   PHP4_FOUND_INCLUDE_PATH
   )
 
-IF(APPLE)
+if(APPLE)
 # this is a hack for now
-  SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
+  set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
    "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -Wl,-flat_namespace")
-  FOREACH(symbol
+  foreach(symbol
     __efree
     __emalloc
     __estrdup
@@ -76,10 +76,10 @@ IF(APPLE)
     _zend_wrong_param_count
     _zval_used_for_init
     )
-    SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
+    set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
       "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS},-U,${symbol}")
-  ENDFOREACH(symbol)
-ENDIF(APPLE)
+  endforeach(symbol)
+endif(APPLE)
 
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(PHP4 DEFAULT_MSG PHP4_EXECUTABLE PHP4_INCLUDE_PATH)
diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake
index a6c181cb1..50cb7d85e 100644
--- a/Modules/FindPNG.cmake
+++ b/Modules/FindPNG.cmake
@@ -43,15 +43,15 @@ if(ZLIB_FOUND)
 
   if (PNG_LIBRARY AND PNG_PNG_INCLUDE_DIR)
       # png.h includes zlib.h. Sigh.
-      SET(PNG_INCLUDE_DIRS ${PNG_PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
-      SET(PNG_INCLUDE_DIR ${PNG_INCLUDE_DIRS} ) # for backward compatiblity
-      SET(PNG_LIBRARIES ${PNG_LIBRARY} ${ZLIB_LIBRARY})
+      set(PNG_INCLUDE_DIRS ${PNG_PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
+      set(PNG_INCLUDE_DIR ${PNG_INCLUDE_DIRS} ) # for backward compatiblity
+      set(PNG_LIBRARIES ${PNG_LIBRARY} ${ZLIB_LIBRARY})
 
       if (CYGWIN)
         if(BUILD_SHARED_LIBS)
            # No need to define PNG_USE_DLL here, because it's default for Cygwin.
         else(BUILD_SHARED_LIBS)
-          SET (PNG_DEFINITIONS -DPNG_STATIC)
+          set (PNG_DEFINITIONS -DPNG_STATIC)
         endif(BUILD_SHARED_LIBS)
       endif (CYGWIN)
 
diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake
index cdcf9ca7c..1dd865281 100644
--- a/Modules/FindPackageHandleStandardArgs.cmake
+++ b/Modules/FindPackageHandleStandardArgs.cmake
@@ -1,7 +1,7 @@
 # FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> ... )
 #
 # This function is intended to be used in FindXXX.cmake modules files.
-# It handles the REQUIRED, QUIET and version-related arguments to FIND_PACKAGE().
+# It handles the REQUIRED, QUIET and version-related arguments to find_package().
 # It also sets the <UPPERCASED_NAME>_FOUND variable.
 # The package is considered found if all variables <var1>... listed contain
 # valid results, e.g. valid filepaths.
@@ -68,9 +68,9 @@
 #
 # Another example for mode 2:
 #
-#    FIND_PACKAGE(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4)
+#    find_package(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4)
 #    FIND_PACKAGE_HANDLE_STANDARD_ARGS(Automoc4  CONFIG_MODE)
-# In this case, FindAutmoc4.cmake wraps a call to FIND_PACKAGE(Automoc4 NO_MODULE)
+# In this case, FindAutmoc4.cmake wraps a call to find_package(Automoc4 NO_MODULE)
 # and adds an additional search directory for automoc4.
 # The following FIND_PACKAGE_HANDLE_STANDARD_ARGS() call produces a proper
 # success/error message.
@@ -88,209 +88,209 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE(FindPackageMessage)
-INCLUDE(CMakeParseArguments)
+include(FindPackageMessage)
+include(CMakeParseArguments)
 
 # internal helper macro
-MACRO(_FPHSA_FAILURE_MESSAGE _msg)
-  IF (${_NAME}_FIND_REQUIRED)
-    MESSAGE(FATAL_ERROR "${_msg}")
-  ELSE (${_NAME}_FIND_REQUIRED)
-    IF (NOT ${_NAME}_FIND_QUIETLY)
-      MESSAGE(STATUS "${_msg}")
-    ENDIF (NOT ${_NAME}_FIND_QUIETLY)
-  ENDIF (${_NAME}_FIND_REQUIRED)
-ENDMACRO(_FPHSA_FAILURE_MESSAGE _msg)
+macro(_FPHSA_FAILURE_MESSAGE _msg)
+  if (${_NAME}_FIND_REQUIRED)
+    message(FATAL_ERROR "${_msg}")
+  else (${_NAME}_FIND_REQUIRED)
+    if (NOT ${_NAME}_FIND_QUIETLY)
+      message(STATUS "${_msg}")
+    endif (NOT ${_NAME}_FIND_QUIETLY)
+  endif (${_NAME}_FIND_REQUIRED)
+endmacro(_FPHSA_FAILURE_MESSAGE _msg)
 
 
 # internal helper macro to generate the failure message when used in CONFIG_MODE:
-MACRO(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
+macro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
   # <name>_CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found:
-  IF(${_NAME}_CONFIG)
+  if(${_NAME}_CONFIG)
     _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: missing: ${MISSING_VARS} (found ${${_NAME}_CONFIG} ${VERSION_MSG})")
-  ELSE(${_NAME}_CONFIG)
+  else(${_NAME}_CONFIG)
     # If _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version.
     # List them all in the error message:
-    IF(${_NAME}_CONSIDERED_CONFIGS)
-      SET(configsText "")
-      LIST(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount)
-      MATH(EXPR configsCount "${configsCount} - 1")
-      FOREACH(currentConfigIndex RANGE ${configsCount})
-        LIST(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename)
-        LIST(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version)
-        SET(configsText "${configsText}    ${filename} (version ${version})\n")
-      ENDFOREACH(currentConfigIndex)
+    if(${_NAME}_CONSIDERED_CONFIGS)
+      set(configsText "")
+      list(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount)
+      math(EXPR configsCount "${configsCount} - 1")
+      foreach(currentConfigIndex RANGE ${configsCount})
+        list(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename)
+        list(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version)
+        set(configsText "${configsText}    ${filename} (version ${version})\n")
+      endforeach(currentConfigIndex)
       _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}")
 
-    ELSE(${_NAME}_CONSIDERED_CONFIGS)
+    else(${_NAME}_CONSIDERED_CONFIGS)
       # Simple case: No Config-file was found at all:
       _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake ${VERSION_MSG}")
-    ENDIF(${_NAME}_CONSIDERED_CONFIGS)
-  ENDIF(${_NAME}_CONFIG)
-ENDMACRO(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
+    endif(${_NAME}_CONSIDERED_CONFIGS)
+  endif(${_NAME}_CONFIG)
+endmacro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
 
 
-FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
+function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
 
 # set up the arguments for CMAKE_PARSE_ARGUMENTS and check whether we are in
 # new extended or in the "old" mode:
-  SET(options CONFIG_MODE HANDLE_COMPONENTS)
-  SET(oneValueArgs FAIL_MESSAGE VERSION_VAR)
-  SET(multiValueArgs REQUIRED_VARS)
-  SET(_KEYWORDS_FOR_EXTENDED_MODE  ${options} ${oneValueArgs} ${multiValueArgs} )
-  LIST(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX)
+  set(options CONFIG_MODE HANDLE_COMPONENTS)
+  set(oneValueArgs FAIL_MESSAGE VERSION_VAR)
+  set(multiValueArgs REQUIRED_VARS)
+  set(_KEYWORDS_FOR_EXTENDED_MODE  ${options} ${oneValueArgs} ${multiValueArgs} )
+  list(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX)
 
-  IF(${INDEX} EQUAL -1)
-    SET(FPHSA_FAIL_MESSAGE ${_FIRST_ARG})
-    SET(FPHSA_REQUIRED_VARS ${ARGN})
-    SET(FPHSA_VERSION_VAR)
-  ELSE(${INDEX} EQUAL -1)
+  if(${INDEX} EQUAL -1)
+    set(FPHSA_FAIL_MESSAGE ${_FIRST_ARG})
+    set(FPHSA_REQUIRED_VARS ${ARGN})
+    set(FPHSA_VERSION_VAR)
+  else(${INDEX} EQUAL -1)
 
     CMAKE_PARSE_ARGUMENTS(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}"  ${_FIRST_ARG} ${ARGN})
 
-    IF(FPHSA_UNPARSED_ARGUMENTS)
-      MESSAGE(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"")
-    ENDIF(FPHSA_UNPARSED_ARGUMENTS)
+    if(FPHSA_UNPARSED_ARGUMENTS)
+      message(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"")
+    endif(FPHSA_UNPARSED_ARGUMENTS)
 
-    IF(NOT FPHSA_FAIL_MESSAGE)
-      SET(FPHSA_FAIL_MESSAGE  "DEFAULT_MSG")
-    ENDIF(NOT FPHSA_FAIL_MESSAGE)
-  ENDIF(${INDEX} EQUAL -1)
+    if(NOT FPHSA_FAIL_MESSAGE)
+      set(FPHSA_FAIL_MESSAGE  "DEFAULT_MSG")
+    endif(NOT FPHSA_FAIL_MESSAGE)
+  endif(${INDEX} EQUAL -1)
 
 # now that we collected all arguments, process them
 
-  IF("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
-    SET(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}")
-  ENDIF("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
+  if("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
+    set(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}")
+  endif("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
 
   # In config-mode, we rely on the variable <package>_CONFIG, which is set by find_package()
   # when it successfully found the config-file, including version checking:
-  IF(FPHSA_CONFIG_MODE)
-    LIST(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG)
-    LIST(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS)
-    SET(FPHSA_VERSION_VAR ${_NAME}_VERSION)
-  ENDIF(FPHSA_CONFIG_MODE)
+  if(FPHSA_CONFIG_MODE)
+    list(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG)
+    list(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS)
+    set(FPHSA_VERSION_VAR ${_NAME}_VERSION)
+  endif(FPHSA_CONFIG_MODE)
 
-  IF(NOT FPHSA_REQUIRED_VARS)
-    MESSAGE(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()")
-  ENDIF(NOT FPHSA_REQUIRED_VARS)
+  if(NOT FPHSA_REQUIRED_VARS)
+    message(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()")
+  endif(NOT FPHSA_REQUIRED_VARS)
 
-  LIST(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR)
+  list(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR)
 
-  STRING(TOUPPER ${_NAME} _NAME_UPPER)
-  STRING(TOLOWER ${_NAME} _NAME_LOWER)
+  string(TOUPPER ${_NAME} _NAME_UPPER)
+  string(TOLOWER ${_NAME} _NAME_LOWER)
 
   # collect all variables which were not found, so they can be printed, so the
   # user knows better what went wrong (#6375)
-  SET(MISSING_VARS "")
-  SET(DETAILS "")
-  SET(${_NAME_UPPER}_FOUND TRUE)
+  set(MISSING_VARS "")
+  set(DETAILS "")
+  set(${_NAME_UPPER}_FOUND TRUE)
   # check if all passed variables are valid
-  FOREACH(_CURRENT_VAR ${FPHSA_REQUIRED_VARS})
-    IF(NOT ${_CURRENT_VAR})
-      SET(${_NAME_UPPER}_FOUND FALSE)
-      SET(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}")
-    ELSE(NOT ${_CURRENT_VAR})
-      SET(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]")
-    ENDIF(NOT ${_CURRENT_VAR})
-  ENDFOREACH(_CURRENT_VAR)
+  foreach(_CURRENT_VAR ${FPHSA_REQUIRED_VARS})
+    if(NOT ${_CURRENT_VAR})
+      set(${_NAME_UPPER}_FOUND FALSE)
+      set(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}")
+    else(NOT ${_CURRENT_VAR})
+      set(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]")
+    endif(NOT ${_CURRENT_VAR})
+  endforeach(_CURRENT_VAR)
 
   # component handling
-  UNSET(FOUND_COMPONENTS_MSG)
-  UNSET(MISSING_COMPONENTS_MSG)
+  unset(FOUND_COMPONENTS_MSG)
+  unset(MISSING_COMPONENTS_MSG)
 
-  IF(FPHSA_HANDLE_COMPONENTS)
-    FOREACH(comp ${${_NAME}_FIND_COMPONENTS})
-      IF(${_NAME}_${comp}_FOUND)
+  if(FPHSA_HANDLE_COMPONENTS)
+    foreach(comp ${${_NAME}_FIND_COMPONENTS})
+      if(${_NAME}_${comp}_FOUND)
 
-        IF(NOT DEFINED FOUND_COMPONENTS_MSG)
-          SET(FOUND_COMPONENTS_MSG "found components: ")
-        ENDIF()
-        SET(FOUND_COMPONENTS_MSG "${FOUND_COMPONENTS_MSG} ${comp}")
+        if(NOT DEFINED FOUND_COMPONENTS_MSG)
+          set(FOUND_COMPONENTS_MSG "found components: ")
+        endif()
+        set(FOUND_COMPONENTS_MSG "${FOUND_COMPONENTS_MSG} ${comp}")
 
-      ELSE()
+      else()
 
-        IF(NOT DEFINED MISSING_COMPONENTS_MSG)
-          SET(MISSING_COMPONENTS_MSG "missing components: ")
-        ENDIF()
-        SET(MISSING_COMPONENTS_MSG "${MISSING_COMPONENTS_MSG} ${comp}")
+        if(NOT DEFINED MISSING_COMPONENTS_MSG)
+          set(MISSING_COMPONENTS_MSG "missing components: ")
+        endif()
+        set(MISSING_COMPONENTS_MSG "${MISSING_COMPONENTS_MSG} ${comp}")
 
-        IF(${_NAME}_FIND_REQUIRED_${comp})
-          SET(${_NAME_UPPER}_FOUND FALSE)
-          SET(MISSING_VARS "${MISSING_VARS} ${comp}")
-        ENDIF()
+        if(${_NAME}_FIND_REQUIRED_${comp})
+          set(${_NAME_UPPER}_FOUND FALSE)
+          set(MISSING_VARS "${MISSING_VARS} ${comp}")
+        endif()
 
-      ENDIF()
-    ENDFOREACH(comp)
-    SET(COMPONENT_MSG "${FOUND_COMPONENTS_MSG} ${MISSING_COMPONENTS_MSG}")
-    SET(DETAILS "${DETAILS}[c${COMPONENT_MSG}]")
-  ENDIF(FPHSA_HANDLE_COMPONENTS)
+      endif()
+    endforeach(comp)
+    set(COMPONENT_MSG "${FOUND_COMPONENTS_MSG} ${MISSING_COMPONENTS_MSG}")
+    set(DETAILS "${DETAILS}[c${COMPONENT_MSG}]")
+  endif(FPHSA_HANDLE_COMPONENTS)
 
   # version handling:
-  SET(VERSION_MSG "")
-  SET(VERSION_OK TRUE)
-  SET(VERSION ${${FPHSA_VERSION_VAR}} )
-  IF (${_NAME}_FIND_VERSION)
+  set(VERSION_MSG "")
+  set(VERSION_OK TRUE)
+  set(VERSION ${${FPHSA_VERSION_VAR}} )
+  if (${_NAME}_FIND_VERSION)
 
-    IF(VERSION)
+    if(VERSION)
 
-      IF(${_NAME}_FIND_VERSION_EXACT)       # exact version required
-        IF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
-          SET(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
-          SET(VERSION_OK FALSE)
-        ELSE (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
-          SET(VERSION_MSG "(found suitable exact version \"${VERSION}\")")
-        ENDIF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
+      if(${_NAME}_FIND_VERSION_EXACT)       # exact version required
+        if (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
+          set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
+          set(VERSION_OK FALSE)
+        else (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
+          set(VERSION_MSG "(found suitable exact version \"${VERSION}\")")
+        endif (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
 
-      ELSE(${_NAME}_FIND_VERSION_EXACT)     # minimum version specified:
-        IF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
-          SET(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"")
-          SET(VERSION_OK FALSE)
-        ELSE ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
-          SET(VERSION_MSG "(found suitable version \"${VERSION}\", required is \"${${_NAME}_FIND_VERSION}\")")
-        ENDIF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
-      ENDIF(${_NAME}_FIND_VERSION_EXACT)
+      else(${_NAME}_FIND_VERSION_EXACT)     # minimum version specified:
+        if ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
+          set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"")
+          set(VERSION_OK FALSE)
+        else ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
+          set(VERSION_MSG "(found suitable version \"${VERSION}\", required is \"${${_NAME}_FIND_VERSION}\")")
+        endif ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
+      endif(${_NAME}_FIND_VERSION_EXACT)
 
-    ELSE(VERSION)
+    else(VERSION)
 
       # if the package was not found, but a version was given, add that to the output:
-      IF(${_NAME}_FIND_VERSION_EXACT)
-         SET(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")")
-      ELSE(${_NAME}_FIND_VERSION_EXACT)
-         SET(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")")
-      ENDIF(${_NAME}_FIND_VERSION_EXACT)
+      if(${_NAME}_FIND_VERSION_EXACT)
+         set(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")")
+      else(${_NAME}_FIND_VERSION_EXACT)
+         set(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")")
+      endif(${_NAME}_FIND_VERSION_EXACT)
 
-    ENDIF(VERSION)
-  ELSE (${_NAME}_FIND_VERSION)
-    IF(VERSION)
-      SET(VERSION_MSG "(found version \"${VERSION}\")")
-    ENDIF(VERSION)
-  ENDIF (${_NAME}_FIND_VERSION)
+    endif(VERSION)
+  else (${_NAME}_FIND_VERSION)
+    if(VERSION)
+      set(VERSION_MSG "(found version \"${VERSION}\")")
+    endif(VERSION)
+  endif (${_NAME}_FIND_VERSION)
 
-  IF(VERSION_OK)
-    SET(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]")
-  ELSE(VERSION_OK)
-    SET(${_NAME_UPPER}_FOUND FALSE)
-  ENDIF(VERSION_OK)
+  if(VERSION_OK)
+    set(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]")
+  else(VERSION_OK)
+    set(${_NAME_UPPER}_FOUND FALSE)
+  endif(VERSION_OK)
 
 
   # print the result:
-  IF (${_NAME_UPPER}_FOUND)
+  if (${_NAME_UPPER}_FOUND)
     FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}")
-  ELSE (${_NAME_UPPER}_FOUND)
+  else (${_NAME_UPPER}_FOUND)
 
-    IF(FPHSA_CONFIG_MODE)
+    if(FPHSA_CONFIG_MODE)
       _FPHSA_HANDLE_FAILURE_CONFIG_MODE()
-    ELSE(FPHSA_CONFIG_MODE)
-      IF(NOT VERSION_OK)
+    else(FPHSA_CONFIG_MODE)
+      if(NOT VERSION_OK)
         _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})")
-      ELSE(NOT VERSION_OK)
+      else(NOT VERSION_OK)
         _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}")
-      ENDIF(NOT VERSION_OK)
-    ENDIF(FPHSA_CONFIG_MODE)
+      endif(NOT VERSION_OK)
+    endif(FPHSA_CONFIG_MODE)
 
-  ENDIF (${_NAME_UPPER}_FOUND)
+  endif (${_NAME_UPPER}_FOUND)
 
-  SET(${_NAME_UPPER}_FOUND ${${_NAME_UPPER}_FOUND} PARENT_SCOPE)
+  set(${_NAME_UPPER}_FOUND ${${_NAME_UPPER}_FOUND} PARENT_SCOPE)
 
-ENDFUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _FIRST_ARG)
+endfunction(FIND_PACKAGE_HANDLE_STANDARD_ARGS _FIRST_ARG)
diff --git a/Modules/FindPackageMessage.cmake b/Modules/FindPackageMessage.cmake
index 48d3472b5..f78792d26 100644
--- a/Modules/FindPackageMessage.cmake
+++ b/Modules/FindPackageMessage.cmake
@@ -11,12 +11,12 @@
 #
 # Example:
 #
-#  IF(X11_FOUND)
+#  if(X11_FOUND)
 #    FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
 #      "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
-#  ELSE(X11_FOUND)
+#  else(X11_FOUND)
 #   ...
-#  ENDIF(X11_FOUND)
+#  endif(X11_FOUND)
 
 #=============================================================================
 # Copyright 2008-2009 Kitware, Inc.
@@ -31,19 +31,19 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FUNCTION(FIND_PACKAGE_MESSAGE pkg msg details)
+function(FIND_PACKAGE_MESSAGE pkg msg details)
   # Avoid printing a message repeatedly for the same find result.
-  IF(NOT ${pkg}_FIND_QUIETLY)
-    STRING(REGEX REPLACE "[\n]" "" details "${details}")
-    SET(DETAILS_VAR FIND_PACKAGE_MESSAGE_DETAILS_${pkg})
-    IF(NOT "${details}" STREQUAL "${${DETAILS_VAR}}")
+  if(NOT ${pkg}_FIND_QUIETLY)
+    string(REGEX REPLACE "[\n]" "" details "${details}")
+    set(DETAILS_VAR FIND_PACKAGE_MESSAGE_DETAILS_${pkg})
+    if(NOT "${details}" STREQUAL "${${DETAILS_VAR}}")
       # The message has not yet been printed.
-      MESSAGE(STATUS "${msg}")
+      message(STATUS "${msg}")
 
       # Save the find details in the cache to avoid printing the same
       # message again.
-      SET("${DETAILS_VAR}" "${details}"
+      set("${DETAILS_VAR}" "${details}"
         CACHE INTERNAL "Details about finding ${pkg}")
-    ENDIF(NOT "${details}" STREQUAL "${${DETAILS_VAR}}")
-  ENDIF(NOT ${pkg}_FIND_QUIETLY)
-ENDFUNCTION(FIND_PACKAGE_MESSAGE)
+    endif(NOT "${details}" STREQUAL "${${DETAILS_VAR}}")
+  endif(NOT ${pkg}_FIND_QUIETLY)
+endfunction(FIND_PACKAGE_MESSAGE)
diff --git a/Modules/FindPerl.cmake b/Modules/FindPerl.cmake
index bedb839d1..4f45da619 100644
--- a/Modules/FindPerl.cmake
+++ b/Modules/FindPerl.cmake
@@ -18,31 +18,31 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE(FindCygwin)
+include(FindCygwin)
 
-SET(PERL_POSSIBLE_BIN_PATHS
+set(PERL_POSSIBLE_BIN_PATHS
   ${CYGWIN_INSTALL_PATH}/bin
   )
 
-IF(WIN32)
-  GET_FILENAME_COMPONENT(
+if(WIN32)
+  get_filename_component(
     ActivePerl_CurrentVersion
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActivePerl;CurrentVersion]"
     NAME)
-  SET(PERL_POSSIBLE_BIN_PATHS ${PERL_POSSIBLE_BIN_PATHS}
+  set(PERL_POSSIBLE_BIN_PATHS ${PERL_POSSIBLE_BIN_PATHS}
     "C:/Perl/bin"
     [HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActivePerl\\${ActivePerl_CurrentVersion}]/bin
     )
-ENDIF(WIN32)
+endif(WIN32)
 
-FIND_PROGRAM(PERL_EXECUTABLE
+find_program(PERL_EXECUTABLE
   NAMES perl
   PATHS ${PERL_POSSIBLE_BIN_PATHS}
   )
 
-IF(PERL_EXECUTABLE)
+if(PERL_EXECUTABLE)
   ### PERL_VERSION
-  EXECUTE_PROCESS(
+  execute_process(
     COMMAND
       ${PERL_EXECUTABLE} -V:version
       OUTPUT_VARIABLE
@@ -52,32 +52,32 @@ IF(PERL_EXECUTABLE)
       ERROR_QUIET
       OUTPUT_STRIP_TRAILING_WHITESPACE
   )
-  IF(NOT PERL_VERSION_RESULT_VARIABLE AND NOT PERL_VERSION_OUTPUT_VARIABLE MATCHES "^version='UNKNOWN'")
-    STRING(REGEX REPLACE "version='([^']+)'.*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE})
-  ELSE()
-    EXECUTE_PROCESS(
+  if(NOT PERL_VERSION_RESULT_VARIABLE AND NOT PERL_VERSION_OUTPUT_VARIABLE MATCHES "^version='UNKNOWN'")
+    string(REGEX REPLACE "version='([^']+)'.*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE})
+  else()
+    execute_process(
       COMMAND ${PERL_EXECUTABLE} -v
       OUTPUT_VARIABLE PERL_VERSION_OUTPUT_VARIABLE
       RESULT_VARIABLE PERL_VERSION_RESULT_VARIABLE
       ERROR_QUIET
       OUTPUT_STRIP_TRAILING_WHITESPACE
     )
-    IF(NOT PERL_VERSION_RESULT_VARIABLE AND PERL_VERSION_OUTPUT_VARIABLE MATCHES "This is perl.*[ \\(]v([0-9\\._]+)[ \\)]")
-      STRING(REGEX REPLACE ".*This is perl.*[ \\(]v([0-9\\._]+)[ \\)].*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE})
-    ELSEIF(NOT PERL_VERSION_RESULT_VARIABLE AND PERL_VERSION_OUTPUT_VARIABLE MATCHES "This is perl, version ([0-9\\._]+) +")
-      STRING(REGEX REPLACE ".*This is perl, version ([0-9\\._]+) +.*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE})
-    ENDIF()
-  ENDIF()
-ENDIF(PERL_EXECUTABLE)
+    if(NOT PERL_VERSION_RESULT_VARIABLE AND PERL_VERSION_OUTPUT_VARIABLE MATCHES "This is perl.*[ \\(]v([0-9\\._]+)[ \\)]")
+      string(REGEX REPLACE ".*This is perl.*[ \\(]v([0-9\\._]+)[ \\)].*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE})
+    elseif(NOT PERL_VERSION_RESULT_VARIABLE AND PERL_VERSION_OUTPUT_VARIABLE MATCHES "This is perl, version ([0-9\\._]+) +")
+      string(REGEX REPLACE ".*This is perl, version ([0-9\\._]+) +.*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE})
+    endif()
+  endif()
+endif(PERL_EXECUTABLE)
 
 # Deprecated settings for compatibility with CMake1.4
-SET(PERL ${PERL_EXECUTABLE})
+set(PERL ${PERL_EXECUTABLE})
 
 # handle the QUIETLY and REQUIRED arguments and set PERL_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Perl
                                   REQUIRED_VARS PERL_EXECUTABLE
                                   VERSION_VAR PERL_VERSION_STRING)
 
-MARK_AS_ADVANCED(PERL_EXECUTABLE)
+mark_as_advanced(PERL_EXECUTABLE)
diff --git a/Modules/FindPerlLibs.cmake b/Modules/FindPerlLibs.cmake
index 3db67acc4..101aebfd4 100644
--- a/Modules/FindPerlLibs.cmake
+++ b/Modules/FindPerlLibs.cmake
@@ -9,7 +9,7 @@
 #  PERL_EXECUTABLE   = full path to the perl binary
 #
 # The minimum required version of Perl can be specified using the
-# standard syntax, e.g. FIND_PACKAGE(PerlLibs 6.0)
+# standard syntax, e.g. find_package(PerlLibs 6.0)
 #
 #  The following variables are also available if needed
 #  (introduced after CMake 2.6.4)
diff --git a/Modules/FindPhysFS.cmake b/Modules/FindPhysFS.cmake
index 45f9d2e6f..ae78b27ce 100644
--- a/Modules/FindPhysFS.cmake
+++ b/Modules/FindPhysFS.cmake
@@ -23,7 +23,7 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PATH(PHYSFS_INCLUDE_DIR physfs.h
+find_path(PHYSFS_INCLUDE_DIR physfs.h
   HINTS
   $ENV{PHYSFSDIR}
   PATH_SUFFIXES include/physfs include
@@ -36,7 +36,7 @@ FIND_PATH(PHYSFS_INCLUDE_DIR physfs.h
   /opt
 )
 
-FIND_LIBRARY(PHYSFS_LIBRARY
+find_library(PHYSFS_LIBRARY
   NAMES physfs
   HINTS
   $ENV{PHYSFSDIR}
@@ -52,6 +52,6 @@ FIND_LIBRARY(PHYSFS_LIBRARY
 
 # handle the QUIETLY and REQUIRED arguments and set PHYSFS_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(PhysFS DEFAULT_MSG PHYSFS_LIBRARY PHYSFS_INCLUDE_DIR)
 
diff --git a/Modules/FindPike.cmake b/Modules/FindPike.cmake
index 125e42832..5b48ab4e7 100644
--- a/Modules/FindPike.cmake
+++ b/Modules/FindPike.cmake
@@ -20,18 +20,18 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FILE(GLOB PIKE_POSSIBLE_INCLUDE_PATHS
+file(GLOB PIKE_POSSIBLE_INCLUDE_PATHS
   /usr/include/pike/*
   /usr/local/include/pike/*)
 
-FIND_PATH(PIKE_INCLUDE_PATH program.h
+find_path(PIKE_INCLUDE_PATH program.h
   ${PIKE_POSSIBLE_INCLUDE_PATHS})
 
-FIND_PROGRAM(PIKE_EXECUTABLE
+find_program(PIKE_EXECUTABLE
   NAMES pike7.4
   )
 
-MARK_AS_ADVANCED(
+mark_as_advanced(
   PIKE_EXECUTABLE
   PIKE_INCLUDE_PATH
   )
diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake
index 94e5676fe..ad671603b 100644
--- a/Modules/FindPostgreSQL.cmake
+++ b/Modules/FindPostgreSQL.cmake
@@ -35,7 +35,7 @@
 #
 # To use this variable just do something like this:
 # set(PostgreSQL_ADDITIONAL_VERSIONS "9.2" "8.4.4")
-# before calling FIND_PACKAGE(PostgreSQL) in your CMakeLists.txt file.
+# before calling find_package(PostgreSQL) in your CMakeLists.txt file.
 # This will mean that the versions you set here will be found first in the order
 # specified before the default ones are searched.
 #
@@ -61,7 +61,7 @@
 #    PostgreSQL_LIBRARY_DIR to wherever the library pq (or libpq in windows) is
 # 2) Use CMAKE_INCLUDE_PATH to set a path to <Your Path>/PostgreSQL<-version>. This will allow find_path()
 #    to locate PostgreSQL_INCLUDE_DIR by utilizing the PATH_SUFFIXES option. e.g. In your CMakeLists.txt file
-#    SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "<Your Path>/include")
+#    set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "<Your Path>/include")
 # 3) Set an environment variable called ${PostgreSQL_ROOT} that points to the root of where you have
 #    installed PostgreSQL, e.g. <Your Path>.
 #
diff --git a/Modules/FindProducer.cmake b/Modules/FindProducer.cmake
index f7840c5d1..20266cbf7 100644
--- a/Modules/FindProducer.cmake
+++ b/Modules/FindProducer.cmake
@@ -42,7 +42,7 @@
 # #include <Producer/CameraGroup>
 
 # Try the user's environment request before anything else.
-FIND_PATH(PRODUCER_INCLUDE_DIR Producer/CameraGroup
+find_path(PRODUCER_INCLUDE_DIR Producer/CameraGroup
   HINTS
   $ENV{PRODUCER_DIR}
   $ENV{OSG_DIR}
@@ -59,7 +59,7 @@ FIND_PATH(PRODUCER_INCLUDE_DIR Producer/CameraGroup
     [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
 )
 
-FIND_LIBRARY(PRODUCER_LIBRARY
+find_library(PRODUCER_LIBRARY
   NAMES Producer
   HINTS
   $ENV{PRODUCER_DIR}
diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
index 11ff19623..932fbdcc9 100644
--- a/Modules/FindPythonLibs.cmake
+++ b/Modules/FindPythonLibs.cmake
@@ -32,57 +32,57 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE(CMakeFindFrameworks)
+include(CMakeFindFrameworks)
 # Search for the python framework on Apple.
 CMAKE_FIND_FRAMEWORKS(Python)
 
-SET(_PYTHON1_VERSIONS 1.6 1.5)
-SET(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
-SET(_PYTHON3_VERSIONS 3.3 3.2 3.1 3.0)
+set(_PYTHON1_VERSIONS 1.6 1.5)
+set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
+set(_PYTHON3_VERSIONS 3.3 3.2 3.1 3.0)
 
-IF(PythonLibs_FIND_VERSION)
-    IF(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
-        STRING(REGEX REPLACE "^([0-9]+\\.[0-9]+).*" "\\1" _PYTHON_FIND_MAJ_MIN "${PythonLibs_FIND_VERSION}")
-        STRING(REGEX REPLACE "^([0-9]+).*" "\\1" _PYTHON_FIND_MAJ "${_PYTHON_FIND_MAJ_MIN}")
-        UNSET(_PYTHON_FIND_OTHER_VERSIONS)
-        IF(PythonLibs_FIND_VERSION_EXACT)
-            IF(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION)
-                SET(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}")
-            ELSE(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION)
-                SET(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}" "${_PYTHON_FIND_MAJ_MIN}")
-            ENDIF(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION)
-        ELSE(PythonLibs_FIND_VERSION_EXACT)
-            FOREACH(_PYTHON_V ${_PYTHON${_PYTHON_FIND_MAJ}_VERSIONS})
-                IF(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN)
-                    LIST(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V})
-                ENDIF()
-             ENDFOREACH()
-        ENDIF(PythonLibs_FIND_VERSION_EXACT)
-        UNSET(_PYTHON_FIND_MAJ_MIN)
-        UNSET(_PYTHON_FIND_MAJ)
-    ELSE(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
-        SET(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON${PythonLibs_FIND_VERSION}_VERSIONS})
-    ENDIF(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
-ELSE(PythonLibs_FIND_VERSION)
-    SET(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS})
-ENDIF(PythonLibs_FIND_VERSION)
+if(PythonLibs_FIND_VERSION)
+    if(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
+        string(REGEX REPLACE "^([0-9]+\\.[0-9]+).*" "\\1" _PYTHON_FIND_MAJ_MIN "${PythonLibs_FIND_VERSION}")
+        string(REGEX REPLACE "^([0-9]+).*" "\\1" _PYTHON_FIND_MAJ "${_PYTHON_FIND_MAJ_MIN}")
+        unset(_PYTHON_FIND_OTHER_VERSIONS)
+        if(PythonLibs_FIND_VERSION_EXACT)
+            if(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION)
+                set(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}")
+            else(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION)
+                set(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}" "${_PYTHON_FIND_MAJ_MIN}")
+            endif(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION)
+        else(PythonLibs_FIND_VERSION_EXACT)
+            foreach(_PYTHON_V ${_PYTHON${_PYTHON_FIND_MAJ}_VERSIONS})
+                if(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN)
+                    list(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V})
+                endif()
+             endforeach()
+        endif(PythonLibs_FIND_VERSION_EXACT)
+        unset(_PYTHON_FIND_MAJ_MIN)
+        unset(_PYTHON_FIND_MAJ)
+    else(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
+        set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON${PythonLibs_FIND_VERSION}_VERSIONS})
+    endif(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
+else(PythonLibs_FIND_VERSION)
+    set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS})
+endif(PythonLibs_FIND_VERSION)
 
 # Set up the versions we know about, in the order we will search. Always add
 # the user supplied additional versions to the front.
-SET(_Python_VERSIONS
+set(_Python_VERSIONS
   ${Python_ADDITIONAL_VERSIONS}
   ${_PYTHON_FIND_OTHER_VERSIONS}
   )
 
-UNSET(_PYTHON_FIND_OTHER_VERSIONS)
-UNSET(_PYTHON1_VERSIONS)
-UNSET(_PYTHON2_VERSIONS)
-UNSET(_PYTHON3_VERSIONS)
+unset(_PYTHON_FIND_OTHER_VERSIONS)
+unset(_PYTHON1_VERSIONS)
+unset(_PYTHON2_VERSIONS)
+unset(_PYTHON3_VERSIONS)
 
-FOREACH(_CURRENT_VERSION ${_Python_VERSIONS})
-  STRING(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION})
-  IF(WIN32)
-    FIND_LIBRARY(PYTHON_DEBUG_LIBRARY
+foreach(_CURRENT_VERSION ${_Python_VERSIONS})
+  string(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION})
+  if(WIN32)
+    find_library(PYTHON_DEBUG_LIBRARY
       NAMES python${_CURRENT_VERSION_NO_DOTS}_d python
       PATHS
       [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
@@ -90,9 +90,9 @@ FOREACH(_CURRENT_VERSION ${_Python_VERSIONS})
       [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
       [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
       )
-  ENDIF(WIN32)
+  endif(WIN32)
 
-  FIND_LIBRARY(PYTHON_LIBRARY
+  find_library(PYTHON_LIBRARY
     NAMES
     python${_CURRENT_VERSION_NO_DOTS}
     python${_CURRENT_VERSION}mu
@@ -106,7 +106,7 @@ FOREACH(_CURRENT_VERSION ${_Python_VERSIONS})
     NO_SYSTEM_ENVIRONMENT_PATH
   )
   # Look for the static library in the Python config directory
-  FIND_LIBRARY(PYTHON_LIBRARY
+  find_library(PYTHON_LIBRARY
     NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION}
     # Avoid finding the .dll in the PATH.  We want the .lib.
     NO_SYSTEM_ENVIRONMENT_PATH
@@ -116,20 +116,20 @@ FOREACH(_CURRENT_VERSION ${_Python_VERSIONS})
 
   # For backward compatibility, honour value of PYTHON_INCLUDE_PATH, if
   # PYTHON_INCLUDE_DIR is not set.
-  IF(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR)
-    SET(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_PATH}" CACHE PATH
+  if(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR)
+    set(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_PATH}" CACHE PATH
       "Path to where Python.h is found" FORCE)
-  ENDIF(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR)
+  endif(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR)
 
-  SET(PYTHON_FRAMEWORK_INCLUDES)
-  IF(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
-    FOREACH(dir ${Python_FRAMEWORKS})
-      SET(PYTHON_FRAMEWORK_INCLUDES ${PYTHON_FRAMEWORK_INCLUDES}
+  set(PYTHON_FRAMEWORK_INCLUDES)
+  if(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
+    foreach(dir ${Python_FRAMEWORKS})
+      set(PYTHON_FRAMEWORK_INCLUDES ${PYTHON_FRAMEWORK_INCLUDES}
         ${dir}/Versions/${_CURRENT_VERSION}/include/python${_CURRENT_VERSION})
-    ENDFOREACH(dir)
-  ENDIF(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
+    endforeach(dir)
+  endif(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
 
-  FIND_PATH(PYTHON_INCLUDE_DIR
+  find_path(PYTHON_INCLUDE_DIR
     NAMES Python.h
     PATHS
       ${PYTHON_FRAMEWORK_INCLUDES}
@@ -143,22 +143,22 @@ FOREACH(_CURRENT_VERSION ${_Python_VERSIONS})
   )
 
   # For backward compatibility, set PYTHON_INCLUDE_PATH.
-  SET(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}")
+  set(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}")
 
-  IF(PYTHON_INCLUDE_DIR AND EXISTS "${PYTHON_INCLUDE_DIR}/patchlevel.h")
-    FILE(STRINGS "${PYTHON_INCLUDE_DIR}/patchlevel.h" python_version_str
+  if(PYTHON_INCLUDE_DIR AND EXISTS "${PYTHON_INCLUDE_DIR}/patchlevel.h")
+    file(STRINGS "${PYTHON_INCLUDE_DIR}/patchlevel.h" python_version_str
          REGEX "^#define[ \t]+PY_VERSION[ \t]+\"[^\"]+\"")
-    STRING(REGEX REPLACE "^#define[ \t]+PY_VERSION[ \t]+\"([^\"]+)\".*" "\\1"
+    string(REGEX REPLACE "^#define[ \t]+PY_VERSION[ \t]+\"([^\"]+)\".*" "\\1"
                          PYTHONLIBS_VERSION_STRING "${python_version_str}")
-    UNSET(python_version_str)
-  ENDIF(PYTHON_INCLUDE_DIR AND EXISTS "${PYTHON_INCLUDE_DIR}/patchlevel.h")
+    unset(python_version_str)
+  endif(PYTHON_INCLUDE_DIR AND EXISTS "${PYTHON_INCLUDE_DIR}/patchlevel.h")
 
-  IF(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR)
-    BREAK()
-  ENDIF(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR)
-ENDFOREACH(_CURRENT_VERSION)
+  if(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR)
+    break()
+  endif(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR)
+endforeach(_CURRENT_VERSION)
 
-MARK_AS_ADVANCED(
+mark_as_advanced(
   PYTHON_DEBUG_LIBRARY
   PYTHON_LIBRARY
   PYTHON_INCLUDE_DIR
@@ -168,21 +168,21 @@ MARK_AS_ADVANCED(
 # cache entries because they are meant to specify the location of a single
 # library. We now set the variables listed by the documentation for this
 # module.
-SET(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
-SET(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}")
+set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
+set(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}")
 
 # These variables have been historically named in this module different from
 # what SELECT_LIBRARY_CONFIGURATIONS() expects.
-SET(PYTHON_LIBRARY_DEBUG "${PYTHON_DEBUG_LIBRARY}")
-SET(PYTHON_LIBRARY_RELEASE "${PYTHON_LIBRARY}")
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
+set(PYTHON_LIBRARY_DEBUG "${PYTHON_DEBUG_LIBRARY}")
+set(PYTHON_LIBRARY_RELEASE "${PYTHON_LIBRARY}")
+include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
 SELECT_LIBRARY_CONFIGURATIONS(PYTHON)
 # SELECT_LIBRARY_CONFIGURATIONS() sets ${PREFIX}_FOUND if it has a library.
 # Unset this, this prefix doesn't match the module prefix, they are different
 # for historical reasons.
-UNSET(PYTHON_FOUND)
+unset(PYTHON_FOUND)
 
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs
                                   REQUIRED_VARS PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS
                                   VERSION_VAR PYTHONLIBS_VERSION_STRING)
@@ -190,51 +190,51 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs
 # PYTHON_ADD_MODULE(<name> src1 src2 ... srcN) is used to build modules for python.
 # PYTHON_WRITE_MODULES_HEADER(<filename>) writes a header file you can include
 # in your sources to initialize the static python modules
-FUNCTION(PYTHON_ADD_MODULE _NAME )
-  GET_PROPERTY(_TARGET_SUPPORTS_SHARED_LIBS
+function(PYTHON_ADD_MODULE _NAME )
+  get_property(_TARGET_SUPPORTS_SHARED_LIBS
     GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS)
-  OPTION(PYTHON_ENABLE_MODULE_${_NAME} "Add module ${_NAME}" TRUE)
-  OPTION(PYTHON_MODULE_${_NAME}_BUILD_SHARED
+  option(PYTHON_ENABLE_MODULE_${_NAME} "Add module ${_NAME}" TRUE)
+  option(PYTHON_MODULE_${_NAME}_BUILD_SHARED
     "Add module ${_NAME} shared" ${_TARGET_SUPPORTS_SHARED_LIBS})
 
   # Mark these options as advanced
-  MARK_AS_ADVANCED(PYTHON_ENABLE_MODULE_${_NAME}
+  mark_as_advanced(PYTHON_ENABLE_MODULE_${_NAME}
     PYTHON_MODULE_${_NAME}_BUILD_SHARED)
 
-  IF(PYTHON_ENABLE_MODULE_${_NAME})
-    IF(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
-      SET(PY_MODULE_TYPE MODULE)
-    ELSE(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
-      SET(PY_MODULE_TYPE STATIC)
-      SET_PROPERTY(GLOBAL  APPEND  PROPERTY  PY_STATIC_MODULES_LIST ${_NAME})
-    ENDIF(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
+  if(PYTHON_ENABLE_MODULE_${_NAME})
+    if(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
+      set(PY_MODULE_TYPE MODULE)
+    else(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
+      set(PY_MODULE_TYPE STATIC)
+      set_property(GLOBAL  APPEND  PROPERTY  PY_STATIC_MODULES_LIST ${_NAME})
+    endif(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
 
-    SET_PROPERTY(GLOBAL  APPEND  PROPERTY  PY_MODULES_LIST ${_NAME})
-    ADD_LIBRARY(${_NAME} ${PY_MODULE_TYPE} ${ARGN})
-#    TARGET_LINK_LIBRARIES(${_NAME} ${PYTHON_LIBRARIES})
+    set_property(GLOBAL  APPEND  PROPERTY  PY_MODULES_LIST ${_NAME})
+    add_library(${_NAME} ${PY_MODULE_TYPE} ${ARGN})
+#    target_link_libraries(${_NAME} ${PYTHON_LIBRARIES})
 
-    IF(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
-      SET_TARGET_PROPERTIES(${_NAME} PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX}")
-      IF(WIN32 AND NOT CYGWIN)
-        SET_TARGET_PROPERTIES(${_NAME} PROPERTIES SUFFIX ".pyd")
-      ENDIF(WIN32 AND NOT CYGWIN)
-    ENDIF(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
+    if(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
+      set_target_properties(${_NAME} PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX}")
+      if(WIN32 AND NOT CYGWIN)
+        set_target_properties(${_NAME} PROPERTIES SUFFIX ".pyd")
+      endif(WIN32 AND NOT CYGWIN)
+    endif(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
 
-  ENDIF(PYTHON_ENABLE_MODULE_${_NAME})
-ENDFUNCTION(PYTHON_ADD_MODULE)
+  endif(PYTHON_ENABLE_MODULE_${_NAME})
+endfunction(PYTHON_ADD_MODULE)
 
-FUNCTION(PYTHON_WRITE_MODULES_HEADER _filename)
+function(PYTHON_WRITE_MODULES_HEADER _filename)
 
-  GET_PROPERTY(PY_STATIC_MODULES_LIST  GLOBAL  PROPERTY PY_STATIC_MODULES_LIST)
+  get_property(PY_STATIC_MODULES_LIST  GLOBAL  PROPERTY PY_STATIC_MODULES_LIST)
 
-  GET_FILENAME_COMPONENT(_name "${_filename}" NAME)
-  STRING(REPLACE "." "_" _name "${_name}")
-  STRING(TOUPPER ${_name} _nameUpper)
-  SET(_filename ${CMAKE_CURRENT_BINARY_DIR}/${_filename})
+  get_filename_component(_name "${_filename}" NAME)
+  string(REPLACE "." "_" _name "${_name}")
+  string(TOUPPER ${_name} _nameUpper)
+  set(_filename ${CMAKE_CURRENT_BINARY_DIR}/${_filename})
 
-  SET(_filenameTmp "${_filename}.in")
-  FILE(WRITE ${_filenameTmp} "/*Created by cmake, do not edit, changes will be lost*/\n")
-  FILE(APPEND ${_filenameTmp}
+  set(_filenameTmp "${_filename}.in")
+  file(WRITE ${_filenameTmp} "/*Created by cmake, do not edit, changes will be lost*/\n")
+  file(APPEND ${_filenameTmp}
 "#ifndef ${_nameUpper}
 #define ${_nameUpper}
 
@@ -246,11 +246,11 @@ extern \"C\" {
 
 ")
 
-  FOREACH(_currentModule ${PY_STATIC_MODULES_LIST})
-    FILE(APPEND ${_filenameTmp} "extern void init${PYTHON_MODULE_PREFIX}${_currentModule}(void);\n\n")
-  ENDFOREACH(_currentModule ${PY_STATIC_MODULES_LIST})
+  foreach(_currentModule ${PY_STATIC_MODULES_LIST})
+    file(APPEND ${_filenameTmp} "extern void init${PYTHON_MODULE_PREFIX}${_currentModule}(void);\n\n")
+  endforeach(_currentModule ${PY_STATIC_MODULES_LIST})
 
-  FILE(APPEND ${_filenameTmp}
+  file(APPEND ${_filenameTmp}
 "#ifdef __cplusplus
 }
 #endif /* __cplusplus */
@@ -258,18 +258,18 @@ extern \"C\" {
 ")
 
 
-  FOREACH(_currentModule ${PY_STATIC_MODULES_LIST})
-    FILE(APPEND ${_filenameTmp} "int ${_name}_${_currentModule}(void) \n{\n  static char name[]=\"${PYTHON_MODULE_PREFIX}${_currentModule}\"; return PyImport_AppendInittab(name, init${PYTHON_MODULE_PREFIX}${_currentModule});\n}\n\n")
-  ENDFOREACH(_currentModule ${PY_STATIC_MODULES_LIST})
+  foreach(_currentModule ${PY_STATIC_MODULES_LIST})
+    file(APPEND ${_filenameTmp} "int ${_name}_${_currentModule}(void) \n{\n  static char name[]=\"${PYTHON_MODULE_PREFIX}${_currentModule}\"; return PyImport_AppendInittab(name, init${PYTHON_MODULE_PREFIX}${_currentModule});\n}\n\n")
+  endforeach(_currentModule ${PY_STATIC_MODULES_LIST})
 
-  FILE(APPEND ${_filenameTmp} "void ${_name}_LoadAllPythonModules(void)\n{\n")
-  FOREACH(_currentModule ${PY_STATIC_MODULES_LIST})
-    FILE(APPEND ${_filenameTmp} "  ${_name}_${_currentModule}();\n")
-  ENDFOREACH(_currentModule ${PY_STATIC_MODULES_LIST})
-  FILE(APPEND ${_filenameTmp} "}\n\n")
-  FILE(APPEND ${_filenameTmp} "#ifndef EXCLUDE_LOAD_ALL_FUNCTION\nvoid CMakeLoadAllPythonModules(void)\n{\n  ${_name}_LoadAllPythonModules();\n}\n#endif\n\n#endif\n")
+  file(APPEND ${_filenameTmp} "void ${_name}_LoadAllPythonModules(void)\n{\n")
+  foreach(_currentModule ${PY_STATIC_MODULES_LIST})
+    file(APPEND ${_filenameTmp} "  ${_name}_${_currentModule}();\n")
+  endforeach(_currentModule ${PY_STATIC_MODULES_LIST})
+  file(APPEND ${_filenameTmp} "}\n\n")
+  file(APPEND ${_filenameTmp} "#ifndef EXCLUDE_LOAD_ALL_FUNCTION\nvoid CMakeLoadAllPythonModules(void)\n{\n  ${_name}_LoadAllPythonModules();\n}\n#endif\n\n#endif\n")
 
-# with CONFIGURE_FILE() cmake complains that you may not use a file created using FILE(WRITE) as input file for CONFIGURE_FILE()
-  EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_filenameTmp}" "${_filename}" OUTPUT_QUIET ERROR_QUIET)
+# with configure_file() cmake complains that you may not use a file created using file(WRITE) as input file for configure_file()
+  execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_filenameTmp}" "${_filename}" OUTPUT_QUIET ERROR_QUIET)
 
-ENDFUNCTION(PYTHON_WRITE_MODULES_HEADER)
+endfunction(PYTHON_WRITE_MODULES_HEADER)
diff --git a/Modules/FindQt.cmake b/Modules/FindQt.cmake
index 5a1f6fc38..53b1da7cf 100644
--- a/Modules/FindQt.cmake
+++ b/Modules/FindQt.cmake
@@ -31,52 +31,52 @@
 #  License text for the above reference.)
 
 # look for signs of qt3 installations
-FILE(GLOB GLOB_TEMP_VAR /usr/lib/qt-3*/bin/qmake)
-IF(GLOB_TEMP_VAR)
-  SET(QT3_INSTALLED TRUE)
-ENDIF(GLOB_TEMP_VAR)
-SET(GLOB_TEMP_VAR)
+file(GLOB GLOB_TEMP_VAR /usr/lib/qt-3*/bin/qmake)
+if(GLOB_TEMP_VAR)
+  set(QT3_INSTALLED TRUE)
+endif(GLOB_TEMP_VAR)
+set(GLOB_TEMP_VAR)
 
-FILE(GLOB GLOB_TEMP_VAR /usr/local/qt-x11-commercial-3*/bin/qmake)
-IF(GLOB_TEMP_VAR)
-  SET(QT3_INSTALLED TRUE)
-ENDIF(GLOB_TEMP_VAR)
-SET(GLOB_TEMP_VAR)
+file(GLOB GLOB_TEMP_VAR /usr/local/qt-x11-commercial-3*/bin/qmake)
+if(GLOB_TEMP_VAR)
+  set(QT3_INSTALLED TRUE)
+endif(GLOB_TEMP_VAR)
+set(GLOB_TEMP_VAR)
 
 # look for qt4 installations
-FILE(GLOB GLOB_TEMP_VAR /usr/local/qt-x11-commercial-4*/bin/qmake)
-IF(GLOB_TEMP_VAR)
-  SET(QT4_INSTALLED TRUE)
-ENDIF(GLOB_TEMP_VAR)
-SET(GLOB_TEMP_VAR)
+file(GLOB GLOB_TEMP_VAR /usr/local/qt-x11-commercial-4*/bin/qmake)
+if(GLOB_TEMP_VAR)
+  set(QT4_INSTALLED TRUE)
+endif(GLOB_TEMP_VAR)
+set(GLOB_TEMP_VAR)
 
-FILE(GLOB GLOB_TEMP_VAR /usr/local/Trolltech/Qt-4*/bin/qmake)
-IF(GLOB_TEMP_VAR)
-  SET(QT4_INSTALLED TRUE)
-ENDIF(GLOB_TEMP_VAR)
-SET(GLOB_TEMP_VAR)
+file(GLOB GLOB_TEMP_VAR /usr/local/Trolltech/Qt-4*/bin/qmake)
+if(GLOB_TEMP_VAR)
+  set(QT4_INSTALLED TRUE)
+endif(GLOB_TEMP_VAR)
+set(GLOB_TEMP_VAR)
 
 # now find qmake
-FIND_PROGRAM(QT_QMAKE_EXECUTABLE_FINDQT NAMES qmake PATHS "${QT_SEARCH_PATH}/bin" "$ENV{QTDIR}/bin")
-IF(QT_QMAKE_EXECUTABLE_FINDQT)
-  EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE_FINDQT} ARGS "-query QT_VERSION"
+find_program(QT_QMAKE_EXECUTABLE_FINDQT NAMES qmake PATHS "${QT_SEARCH_PATH}/bin" "$ENV{QTDIR}/bin")
+if(QT_QMAKE_EXECUTABLE_FINDQT)
+  exec_program(${QT_QMAKE_EXECUTABLE_FINDQT} ARGS "-query QT_VERSION"
     OUTPUT_VARIABLE QTVERSION)
-  IF(QTVERSION MATCHES "4.*")
-    SET(QT_QMAKE_EXECUTABLE ${QT_QMAKE_EXECUTABLE_FINDQT} CACHE PATH "QT4 qmake program.")
-    SET(QT4_INSTALLED TRUE)
-  ENDIF(QTVERSION MATCHES "4.*")
-  IF(QTVERSION MATCHES "Unknown")
-    SET(QT3_INSTALLED TRUE)
-  ENDIF(QTVERSION MATCHES "Unknown")
-ENDIF(QT_QMAKE_EXECUTABLE_FINDQT)
+  if(QTVERSION MATCHES "4.*")
+    set(QT_QMAKE_EXECUTABLE ${QT_QMAKE_EXECUTABLE_FINDQT} CACHE PATH "QT4 qmake program.")
+    set(QT4_INSTALLED TRUE)
+  endif(QTVERSION MATCHES "4.*")
+  if(QTVERSION MATCHES "Unknown")
+    set(QT3_INSTALLED TRUE)
+  endif(QTVERSION MATCHES "Unknown")
+endif(QT_QMAKE_EXECUTABLE_FINDQT)
 
-IF(QT_QMAKE_EXECUTABLE_FINDQT)
-  EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE_FINDQT}
+if(QT_QMAKE_EXECUTABLE_FINDQT)
+  exec_program( ${QT_QMAKE_EXECUTABLE_FINDQT}
     ARGS "-query QT_INSTALL_HEADERS"
     OUTPUT_VARIABLE qt_headers )
-ENDIF(QT_QMAKE_EXECUTABLE_FINDQT)
+endif(QT_QMAKE_EXECUTABLE_FINDQT)
 
-FIND_FILE( QT4_QGLOBAL_H_FILE qglobal.h
+find_file( QT4_QGLOBAL_H_FILE qglobal.h
   "${QT_SEARCH_PATH}/Qt/include"
   "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/include/Qt"
   "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/include/Qt"
@@ -89,11 +89,11 @@ FIND_FILE( QT4_QGLOBAL_H_FILE qglobal.h
   /usr/share/qt4/include/Qt
   C:/Progra~1/qt/include/Qt )
 
-IF(QT4_QGLOBAL_H_FILE)
-  SET(QT4_INSTALLED TRUE)
-ENDIF(QT4_QGLOBAL_H_FILE)
+if(QT4_QGLOBAL_H_FILE)
+  set(QT4_INSTALLED TRUE)
+endif(QT4_QGLOBAL_H_FILE)
 
-FIND_FILE( QT3_QGLOBAL_H_FILE qglobal.h
+find_file( QT3_QGLOBAL_H_FILE qglobal.h
   "${QT_SEARCH_PATH}/Qt/include"
  "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/include/Qt"
   "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/include/Qt"
@@ -109,52 +109,52 @@ FIND_FILE( QT3_QGLOBAL_H_FILE qglobal.h
   C:/Progra~1/qt/include
   /usr/include/qt3 )
 
-IF(QT3_QGLOBAL_H_FILE)
-  SET(QT3_INSTALLED TRUE)
-ENDIF(QT3_QGLOBAL_H_FILE)
+if(QT3_QGLOBAL_H_FILE)
+  set(QT3_INSTALLED TRUE)
+endif(QT3_QGLOBAL_H_FILE)
 
-IF(QT3_INSTALLED AND QT4_INSTALLED )
+if(QT3_INSTALLED AND QT4_INSTALLED )
   # force user to pick if we have both
-  SET(DESIRED_QT_VERSION 0 CACHE STRING "Pick a version of QT to use: 3 or 4")
-ELSE(QT3_INSTALLED AND QT4_INSTALLED )
+  set(DESIRED_QT_VERSION 0 CACHE STRING "Pick a version of QT to use: 3 or 4")
+else(QT3_INSTALLED AND QT4_INSTALLED )
   # if only one found then pick that one
-  IF(QT3_INSTALLED)
-    SET(DESIRED_QT_VERSION 3 CACHE STRING "Pick a version of QT to use: 3 or 4")
-  ENDIF(QT3_INSTALLED)
-  IF(QT4_INSTALLED)
-    SET(DESIRED_QT_VERSION 4 CACHE STRING "Pick a version of QT to use: 3 or 4")
-  ENDIF(QT4_INSTALLED)
-ENDIF(QT3_INSTALLED AND QT4_INSTALLED )
+  if(QT3_INSTALLED)
+    set(DESIRED_QT_VERSION 3 CACHE STRING "Pick a version of QT to use: 3 or 4")
+  endif(QT3_INSTALLED)
+  if(QT4_INSTALLED)
+    set(DESIRED_QT_VERSION 4 CACHE STRING "Pick a version of QT to use: 3 or 4")
+  endif(QT4_INSTALLED)
+endif(QT3_INSTALLED AND QT4_INSTALLED )
 
-IF(DESIRED_QT_VERSION MATCHES 3)
-  SET(Qt3_FIND_REQUIRED ${Qt_FIND_REQUIRED})
-  SET(Qt3_FIND_QUIETLY  ${Qt_FIND_QUIETLY})
-  INCLUDE(FindQt3)
-ENDIF(DESIRED_QT_VERSION MATCHES 3)
-IF(DESIRED_QT_VERSION MATCHES 4)
-  SET(Qt4_FIND_REQUIRED ${Qt_FIND_REQUIRED})
-  SET(Qt4_FIND_QUIETLY  ${Qt_FIND_QUIETLY})
-  INCLUDE(FindQt4)
-ENDIF(DESIRED_QT_VERSION MATCHES 4)
+if(DESIRED_QT_VERSION MATCHES 3)
+  set(Qt3_FIND_REQUIRED ${Qt_FIND_REQUIRED})
+  set(Qt3_FIND_QUIETLY  ${Qt_FIND_QUIETLY})
+  include(FindQt3)
+endif(DESIRED_QT_VERSION MATCHES 3)
+if(DESIRED_QT_VERSION MATCHES 4)
+  set(Qt4_FIND_REQUIRED ${Qt_FIND_REQUIRED})
+  set(Qt4_FIND_QUIETLY  ${Qt_FIND_QUIETLY})
+  include(FindQt4)
+endif(DESIRED_QT_VERSION MATCHES 4)
 
-IF(NOT QT3_INSTALLED AND NOT QT4_INSTALLED)
-  IF(QT_REQUIRED)
-    MESSAGE(SEND_ERROR "CMake was unable to find any QT versions, put qmake in your path, or set QT_QMAKE_EXECUTABLE.")
-  ENDIF(QT_REQUIRED)
-ELSE(NOT QT3_INSTALLED AND NOT QT4_INSTALLED)
-  IF(NOT QT_FOUND AND NOT DESIRED_QT_VERSION)
-    IF(QT_REQUIRED)
-      MESSAGE(SEND_ERROR "Multiple versions of QT found please set DESIRED_QT_VERSION")
-    ELSE(QT_REQUIRED)
-      MESSAGE("Multiple versions of QT found please set DESIRED_QT_VERSION")
-    ENDIF(QT_REQUIRED)
-  ENDIF(NOT QT_FOUND AND NOT DESIRED_QT_VERSION)
-  IF(NOT QT_FOUND AND DESIRED_QT_VERSION)
-    IF(QT_REQUIRED)
-      MESSAGE(FATAL_ERROR "CMake was unable to find QT version: ${DESIRED_QT_VERSION}. Set advanced values QT_QMAKE_EXECUTABLE and QT${DESIRED_QT_VERSION}_QGLOBAL_FILE, if those are set then QT_QT_LIBRARY or QT_LIBRARY_DIR.")
-    ELSE(QT_REQUIRED)
-      MESSAGE( "CMake was unable to find desired QT version: ${DESIRED_QT_VERSION}. Set advanced values QT_QMAKE_EXECUTABLE and QT${DESIRED_QT_VERSION}_QGLOBAL_FILE.")
-    ENDIF(QT_REQUIRED)
-  ENDIF(NOT QT_FOUND AND DESIRED_QT_VERSION)
-ENDIF(NOT QT3_INSTALLED AND NOT QT4_INSTALLED)
-MARK_AS_ADVANCED(QT3_QGLOBAL_H_FILE QT4_QGLOBAL_H_FILE QT_QMAKE_EXECUTABLE_FINDQT)
+if(NOT QT3_INSTALLED AND NOT QT4_INSTALLED)
+  if(QT_REQUIRED)
+    message(SEND_ERROR "CMake was unable to find any QT versions, put qmake in your path, or set QT_QMAKE_EXECUTABLE.")
+  endif(QT_REQUIRED)
+else(NOT QT3_INSTALLED AND NOT QT4_INSTALLED)
+  if(NOT QT_FOUND AND NOT DESIRED_QT_VERSION)
+    if(QT_REQUIRED)
+      message(SEND_ERROR "Multiple versions of QT found please set DESIRED_QT_VERSION")
+    else(QT_REQUIRED)
+      message("Multiple versions of QT found please set DESIRED_QT_VERSION")
+    endif(QT_REQUIRED)
+  endif(NOT QT_FOUND AND NOT DESIRED_QT_VERSION)
+  if(NOT QT_FOUND AND DESIRED_QT_VERSION)
+    if(QT_REQUIRED)
+      message(FATAL_ERROR "CMake was unable to find QT version: ${DESIRED_QT_VERSION}. Set advanced values QT_QMAKE_EXECUTABLE and QT${DESIRED_QT_VERSION}_QGLOBAL_FILE, if those are set then QT_QT_LIBRARY or QT_LIBRARY_DIR.")
+    else(QT_REQUIRED)
+      message( "CMake was unable to find desired QT version: ${DESIRED_QT_VERSION}. Set advanced values QT_QMAKE_EXECUTABLE and QT${DESIRED_QT_VERSION}_QGLOBAL_FILE.")
+    endif(QT_REQUIRED)
+  endif(NOT QT_FOUND AND DESIRED_QT_VERSION)
+endif(NOT QT3_INSTALLED AND NOT QT4_INSTALLED)
+mark_as_advanced(QT3_QGLOBAL_H_FILE QT4_QGLOBAL_H_FILE QT_QMAKE_EXECUTABLE_FINDQT)
diff --git a/Modules/FindQt3.cmake b/Modules/FindQt3.cmake
index 2d8dbde22..0440a8592 100644
--- a/Modules/FindQt3.cmake
+++ b/Modules/FindQt3.cmake
@@ -35,23 +35,23 @@
 #  License text for the above reference.)
 
 # If Qt4 has already been found, fail.
-IF(QT4_FOUND)
-  IF(Qt3_FIND_REQUIRED)
-    MESSAGE( FATAL_ERROR "Qt3 and Qt4 cannot be used together in one project.")
-  ELSE(Qt3_FIND_REQUIRED)
-    IF(NOT Qt3_FIND_QUIETLY)
-      MESSAGE( STATUS    "Qt3 and Qt4 cannot be used together in one project.")
-    ENDIF(NOT Qt3_FIND_QUIETLY)
-    RETURN()
-  ENDIF(Qt3_FIND_REQUIRED)
-ENDIF(QT4_FOUND)
+if(QT4_FOUND)
+  if(Qt3_FIND_REQUIRED)
+    message( FATAL_ERROR "Qt3 and Qt4 cannot be used together in one project.")
+  else(Qt3_FIND_REQUIRED)
+    if(NOT Qt3_FIND_QUIETLY)
+      message( STATUS    "Qt3 and Qt4 cannot be used together in one project.")
+    endif(NOT Qt3_FIND_QUIETLY)
+    return()
+  endif(Qt3_FIND_REQUIRED)
+endif(QT4_FOUND)
 
 
-FILE(GLOB GLOB_PATHS /usr/lib/qt-3*)
-FOREACH(GLOB_PATH ${GLOB_PATHS})
-  LIST(APPEND GLOB_PATHS_BIN "${GLOB_PATH}/bin")
-ENDFOREACH(GLOB_PATH)
-FIND_PATH(QT_INCLUDE_DIR qt.h
+file(GLOB GLOB_PATHS /usr/lib/qt-3*)
+foreach(GLOB_PATH ${GLOB_PATHS})
+  list(APPEND GLOB_PATHS_BIN "${GLOB_PATH}/bin")
+endforeach(GLOB_PATH)
+find_path(QT_INCLUDE_DIR qt.h
   "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/include/Qt"
   "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/include/Qt"
   "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/include/Qt"
@@ -68,25 +68,25 @@ FIND_PATH(QT_INCLUDE_DIR qt.h
 
 # if qglobal.h is not in the qt_include_dir then set
 # QT_INCLUDE_DIR to NOTFOUND
-IF(NOT EXISTS ${QT_INCLUDE_DIR}/qglobal.h)
-  SET(QT_INCLUDE_DIR QT_INCLUDE_DIR-NOTFOUND CACHE PATH "path to Qt3 include directory" FORCE)
-ENDIF(NOT EXISTS ${QT_INCLUDE_DIR}/qglobal.h)
+if(NOT EXISTS ${QT_INCLUDE_DIR}/qglobal.h)
+  set(QT_INCLUDE_DIR QT_INCLUDE_DIR-NOTFOUND CACHE PATH "path to Qt3 include directory" FORCE)
+endif(NOT EXISTS ${QT_INCLUDE_DIR}/qglobal.h)
 
-IF(QT_INCLUDE_DIR)
+if(QT_INCLUDE_DIR)
   #extract the version string from qglobal.h
-  FILE(READ ${QT_INCLUDE_DIR}/qglobal.h QGLOBAL_H)
-  STRING(REGEX MATCH "#define[\t ]+QT_VERSION_STR[\t ]+\"[0-9]+.[0-9]+.[0-9]+[a-z]*\"" QGLOBAL_H "${QGLOBAL_H}")
-  STRING(REGEX REPLACE ".*\"([0-9]+.[0-9]+.[0-9]+[a-z]*)\".*" "\\1" qt_version_str "${QGLOBAL_H}")
+  file(READ ${QT_INCLUDE_DIR}/qglobal.h QGLOBAL_H)
+  string(REGEX MATCH "#define[\t ]+QT_VERSION_STR[\t ]+\"[0-9]+.[0-9]+.[0-9]+[a-z]*\"" QGLOBAL_H "${QGLOBAL_H}")
+  string(REGEX REPLACE ".*\"([0-9]+.[0-9]+.[0-9]+[a-z]*)\".*" "\\1" qt_version_str "${QGLOBAL_H}")
 
   # Under windows the qt library (MSVC) has the format qt-mtXYZ where XYZ is the
   # version X.Y.Z, so we need to remove the dots from version
-  STRING(REGEX REPLACE "\\." "" qt_version_str_lib "${qt_version_str}")
-  SET(QT_VERSION_STRING "${qt_version_str}")
-ENDIF(QT_INCLUDE_DIR)
+  string(REGEX REPLACE "\\." "" qt_version_str_lib "${qt_version_str}")
+  set(QT_VERSION_STRING "${qt_version_str}")
+endif(QT_INCLUDE_DIR)
 
-FILE(GLOB GLOB_PATHS_LIB /usr/lib/qt-3*/lib/)
-IF (QT_MT_REQUIRED)
-  FIND_LIBRARY(QT_QT_LIBRARY
+file(GLOB GLOB_PATHS_LIB /usr/lib/qt-3*/lib/)
+if (QT_MT_REQUIRED)
+  find_library(QT_QT_LIBRARY
     NAMES
     qt-mt qt-mt${qt_version_str_lib} qt-mtnc${qt_version_str_lib}
     qt-mtedu${qt_version_str_lib} qt-mt230nc qt-mtnc321 qt-mt3
@@ -104,8 +104,8 @@ IF (QT_MT_REQUIRED)
     C:/Progra~1/qt/lib
     )
 
-ELSE (QT_MT_REQUIRED)
-  FIND_LIBRARY(QT_QT_LIBRARY
+else (QT_MT_REQUIRED)
+  find_library(QT_QT_LIBRARY
     NAMES
     qt qt-${qt_version_str_lib} qt-edu${qt_version_str_lib}
     qt-mt qt-mt${qt_version_str_lib} qt-mtnc${qt_version_str_lib}
@@ -123,10 +123,10 @@ ELSE (QT_MT_REQUIRED)
     /usr/share/qt3/lib
     C:/Progra~1/qt/lib
     )
-ENDIF (QT_MT_REQUIRED)
+endif (QT_MT_REQUIRED)
 
 
-FIND_LIBRARY(QT_QASSISTANTCLIENT_LIBRARY
+find_library(QT_QASSISTANTCLIENT_LIBRARY
   NAMES qassistantclient
   PATHS
   "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/lib"
@@ -142,7 +142,7 @@ FIND_LIBRARY(QT_QASSISTANTCLIENT_LIBRARY
   )
 
 # qt 3 should prefer QTDIR over the PATH
-FIND_PROGRAM(QT_MOC_EXECUTABLE
+find_program(QT_MOC_EXECUTABLE
   NAMES moc-qt3 moc
   HINTS
   $ENV{QTDIR}/bin
@@ -160,12 +160,12 @@ FIND_PROGRAM(QT_MOC_EXECUTABLE
   /usr/X11R6/bin
   )
 
-IF(QT_MOC_EXECUTABLE)
-  SET ( QT_WRAP_CPP "YES")
-ENDIF(QT_MOC_EXECUTABLE)
+if(QT_MOC_EXECUTABLE)
+  set ( QT_WRAP_CPP "YES")
+endif(QT_MOC_EXECUTABLE)
 
 # qt 3 should prefer QTDIR over the PATH
-FIND_PROGRAM(QT_UIC_EXECUTABLE
+find_program(QT_UIC_EXECUTABLE
   NAMES uic-qt3 uic
   HINTS
   $ENV{QTDIR}/bin
@@ -182,12 +182,12 @@ FIND_PROGRAM(QT_UIC_EXECUTABLE
   /usr/X11R6/bin
   )
 
-IF(QT_UIC_EXECUTABLE)
-  SET ( QT_WRAP_UI "YES")
-ENDIF(QT_UIC_EXECUTABLE)
+if(QT_UIC_EXECUTABLE)
+  set ( QT_WRAP_UI "YES")
+endif(QT_UIC_EXECUTABLE)
 
-IF (WIN32)
-  FIND_LIBRARY(QT_QTMAIN_LIBRARY qtmain
+if (WIN32)
+  find_library(QT_QTMAIN_LIBRARY qtmain
     HINTS
     $ENV{QTDIR}/lib
     "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/lib"
@@ -198,99 +198,99 @@ IF (WIN32)
     "C:/Program Files/qt/lib"
     DOC "This Library is only needed by and included with Qt3 on MSWindows. It should be NOTFOUND, undefined or IGNORE otherwise."
     )
-ENDIF (WIN32)
+endif (WIN32)
 
 #support old QT_MIN_VERSION if set, but not if version is supplied by find_package()
-IF(NOT Qt3_FIND_VERSION AND QT_MIN_VERSION)
-  SET(Qt3_FIND_VERSION ${QT_MIN_VERSION})
-ENDIF(NOT Qt3_FIND_VERSION AND QT_MIN_VERSION)
+if(NOT Qt3_FIND_VERSION AND QT_MIN_VERSION)
+  set(Qt3_FIND_VERSION ${QT_MIN_VERSION})
+endif(NOT Qt3_FIND_VERSION AND QT_MIN_VERSION)
 
 # if the include a library are found then we have it
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt3
                                   REQUIRED_VARS QT_QT_LIBRARY QT_INCLUDE_DIR QT_MOC_EXECUTABLE
                                   VERSION_VAR QT_VERSION_STRING)
-SET(QT_FOUND ${QT3_FOUND} )
+set(QT_FOUND ${QT3_FOUND} )
 
-IF(QT_FOUND)
-  SET( QT_LIBRARIES ${QT_LIBRARIES} ${QT_QT_LIBRARY} )
-  SET( QT_DEFINITIONS "")
+if(QT_FOUND)
+  set( QT_LIBRARIES ${QT_LIBRARIES} ${QT_QT_LIBRARY} )
+  set( QT_DEFINITIONS "")
 
-  IF (WIN32 AND NOT CYGWIN)
-    IF (QT_QTMAIN_LIBRARY)
+  if (WIN32 AND NOT CYGWIN)
+    if (QT_QTMAIN_LIBRARY)
       # for version 3
-      SET (QT_DEFINITIONS -DQT_DLL -DQT_THREAD_SUPPORT -DNO_DEBUG)
-      SET (QT_LIBRARIES imm32.lib ${QT_QT_LIBRARY} ${QT_QTMAIN_LIBRARY} )
-      SET (QT_LIBRARIES ${QT_LIBRARIES} winmm wsock32)
-    ELSE (QT_QTMAIN_LIBRARY)
+      set (QT_DEFINITIONS -DQT_DLL -DQT_THREAD_SUPPORT -DNO_DEBUG)
+      set (QT_LIBRARIES imm32.lib ${QT_QT_LIBRARY} ${QT_QTMAIN_LIBRARY} )
+      set (QT_LIBRARIES ${QT_LIBRARIES} winmm wsock32)
+    else (QT_QTMAIN_LIBRARY)
       # for version 2
-      SET (QT_LIBRARIES imm32.lib ws2_32.lib ${QT_QT_LIBRARY} )
-    ENDIF (QT_QTMAIN_LIBRARY)
-  ELSE (WIN32 AND NOT CYGWIN)
-    SET (QT_LIBRARIES ${QT_QT_LIBRARY} )
+      set (QT_LIBRARIES imm32.lib ws2_32.lib ${QT_QT_LIBRARY} )
+    endif (QT_QTMAIN_LIBRARY)
+  else (WIN32 AND NOT CYGWIN)
+    set (QT_LIBRARIES ${QT_QT_LIBRARY} )
 
-    SET (QT_DEFINITIONS -DQT_SHARED -DQT_NO_DEBUG)
-    IF(QT_QT_LIBRARY MATCHES "qt-mt")
-      SET (QT_DEFINITIONS ${QT_DEFINITIONS} -DQT_THREAD_SUPPORT -D_REENTRANT)
-    ENDIF(QT_QT_LIBRARY MATCHES "qt-mt")
+    set (QT_DEFINITIONS -DQT_SHARED -DQT_NO_DEBUG)
+    if(QT_QT_LIBRARY MATCHES "qt-mt")
+      set (QT_DEFINITIONS ${QT_DEFINITIONS} -DQT_THREAD_SUPPORT -D_REENTRANT)
+    endif(QT_QT_LIBRARY MATCHES "qt-mt")
 
-  ENDIF (WIN32 AND NOT CYGWIN)
+  endif (WIN32 AND NOT CYGWIN)
 
-  IF (QT_QASSISTANTCLIENT_LIBRARY)
-    SET (QT_LIBRARIES ${QT_QASSISTANTCLIENT_LIBRARY} ${QT_LIBRARIES})
-  ENDIF (QT_QASSISTANTCLIENT_LIBRARY)
+  if (QT_QASSISTANTCLIENT_LIBRARY)
+    set (QT_LIBRARIES ${QT_QASSISTANTCLIENT_LIBRARY} ${QT_LIBRARIES})
+  endif (QT_QASSISTANTCLIENT_LIBRARY)
 
   # Backwards compatibility for CMake1.4 and 1.2
-  SET (QT_MOC_EXE ${QT_MOC_EXECUTABLE} )
-  SET (QT_UIC_EXE ${QT_UIC_EXECUTABLE} )
+  set (QT_MOC_EXE ${QT_MOC_EXECUTABLE} )
+  set (QT_UIC_EXE ${QT_UIC_EXECUTABLE} )
   # for unix add X11 stuff
-  IF(UNIX)
-    FIND_PACKAGE(X11)
-    IF (X11_FOUND)
-      SET (QT_LIBRARIES ${QT_LIBRARIES} ${X11_LIBRARIES})
-    ENDIF (X11_FOUND)
-    IF (CMAKE_DL_LIBS)
-      SET (QT_LIBRARIES ${QT_LIBRARIES} ${CMAKE_DL_LIBS})
-    ENDIF (CMAKE_DL_LIBS)
-  ENDIF(UNIX)
-  IF(QT_QT_LIBRARY MATCHES "qt-mt")
-    FIND_PACKAGE(Threads)
-    SET(QT_LIBRARIES ${QT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
-  ENDIF(QT_QT_LIBRARY MATCHES "qt-mt")
-ENDIF(QT_FOUND)
+  if(UNIX)
+    find_package(X11)
+    if (X11_FOUND)
+      set (QT_LIBRARIES ${QT_LIBRARIES} ${X11_LIBRARIES})
+    endif (X11_FOUND)
+    if (CMAKE_DL_LIBS)
+      set (QT_LIBRARIES ${QT_LIBRARIES} ${CMAKE_DL_LIBS})
+    endif (CMAKE_DL_LIBS)
+  endif(UNIX)
+  if(QT_QT_LIBRARY MATCHES "qt-mt")
+    find_package(Threads)
+    set(QT_LIBRARIES ${QT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+  endif(QT_QT_LIBRARY MATCHES "qt-mt")
+endif(QT_FOUND)
 
-IF(QT_MOC_EXECUTABLE)
-  EXECUTE_PROCESS(COMMAND ${QT_MOC_EXECUTABLE} "-v"
+if(QT_MOC_EXECUTABLE)
+  execute_process(COMMAND ${QT_MOC_EXECUTABLE} "-v"
                   OUTPUT_VARIABLE QTVERSION_MOC
                   ERROR_QUIET)
-ENDIF(QT_MOC_EXECUTABLE)
-IF(QT_UIC_EXECUTABLE)
-  EXECUTE_PROCESS(COMMAND ${QT_UIC_EXECUTABLE} "-version"
+endif(QT_MOC_EXECUTABLE)
+if(QT_UIC_EXECUTABLE)
+  execute_process(COMMAND ${QT_UIC_EXECUTABLE} "-version"
                   OUTPUT_VARIABLE QTVERSION_UIC
                   ERROR_QUIET)
-ENDIF(QT_UIC_EXECUTABLE)
+endif(QT_UIC_EXECUTABLE)
 
-SET(_QT_UIC_VERSION_3 FALSE)
-IF("${QTVERSION_UIC}" MATCHES ".* 3..*")
-  SET(_QT_UIC_VERSION_3 TRUE)
-ENDIF("${QTVERSION_UIC}" MATCHES ".* 3..*")
+set(_QT_UIC_VERSION_3 FALSE)
+if("${QTVERSION_UIC}" MATCHES ".* 3..*")
+  set(_QT_UIC_VERSION_3 TRUE)
+endif("${QTVERSION_UIC}" MATCHES ".* 3..*")
 
-SET(_QT_MOC_VERSION_3 FALSE)
-IF("${QTVERSION_MOC}" MATCHES ".* 3..*")
-  SET(_QT_MOC_VERSION_3 TRUE)
-ENDIF("${QTVERSION_MOC}" MATCHES ".* 3..*")
+set(_QT_MOC_VERSION_3 FALSE)
+if("${QTVERSION_MOC}" MATCHES ".* 3..*")
+  set(_QT_MOC_VERSION_3 TRUE)
+endif("${QTVERSION_MOC}" MATCHES ".* 3..*")
 
-SET(QT_WRAP_CPP FALSE)
-IF (QT_MOC_EXECUTABLE AND _QT_MOC_VERSION_3)
-  SET ( QT_WRAP_CPP TRUE)
-ENDIF (QT_MOC_EXECUTABLE AND _QT_MOC_VERSION_3)
+set(QT_WRAP_CPP FALSE)
+if (QT_MOC_EXECUTABLE AND _QT_MOC_VERSION_3)
+  set ( QT_WRAP_CPP TRUE)
+endif (QT_MOC_EXECUTABLE AND _QT_MOC_VERSION_3)
 
-SET(QT_WRAP_UI FALSE)
-IF (QT_UIC_EXECUTABLE AND _QT_UIC_VERSION_3)
-  SET ( QT_WRAP_UI TRUE)
-ENDIF (QT_UIC_EXECUTABLE AND _QT_UIC_VERSION_3)
+set(QT_WRAP_UI FALSE)
+if (QT_UIC_EXECUTABLE AND _QT_UIC_VERSION_3)
+  set ( QT_WRAP_UI TRUE)
+endif (QT_UIC_EXECUTABLE AND _QT_UIC_VERSION_3)
 
-MARK_AS_ADVANCED(
+mark_as_advanced(
   QT_INCLUDE_DIR
   QT_QT_LIBRARY
   QT_QTMAIN_LIBRARY
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index e3eb1e69b..e20e76465 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -334,139 +334,139 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-# Use FIND_PACKAGE( Qt4 COMPONENTS ... ) to enable modules
-IF( Qt4_FIND_COMPONENTS )
-  FOREACH( component ${Qt4_FIND_COMPONENTS} )
-    STRING( TOUPPER ${component} _COMPONENT )
-    SET( QT_USE_${_COMPONENT} 1 )
-  ENDFOREACH( component )
+# Use find_package( Qt4 COMPONENTS ... ) to enable modules
+if( Qt4_FIND_COMPONENTS )
+  foreach( component ${Qt4_FIND_COMPONENTS} )
+    string( TOUPPER ${component} _COMPONENT )
+    set( QT_USE_${_COMPONENT} 1 )
+  endforeach( component )
 
   # To make sure we don't use QtCore or QtGui when not in COMPONENTS
-  IF(NOT QT_USE_QTCORE)
-    SET( QT_DONT_USE_QTCORE 1 )
-  ENDIF(NOT QT_USE_QTCORE)
+  if(NOT QT_USE_QTCORE)
+    set( QT_DONT_USE_QTCORE 1 )
+  endif(NOT QT_USE_QTCORE)
 
-  IF(NOT QT_USE_QTGUI)
-    SET( QT_DONT_USE_QTGUI 1 )
-  ENDIF(NOT QT_USE_QTGUI)
+  if(NOT QT_USE_QTGUI)
+    set( QT_DONT_USE_QTGUI 1 )
+  endif(NOT QT_USE_QTGUI)
 
-ENDIF( Qt4_FIND_COMPONENTS )
+endif( Qt4_FIND_COMPONENTS )
 
 # If Qt3 has already been found, fail.
-IF(QT_QT_LIBRARY)
-  IF(Qt4_FIND_REQUIRED)
-    MESSAGE( FATAL_ERROR "Qt3 and Qt4 cannot be used together in one project.  If switching to Qt4, the CMakeCache.txt needs to be cleaned.")
-  ELSE(Qt4_FIND_REQUIRED)
-    IF(NOT Qt4_FIND_QUIETLY)
-      MESSAGE( STATUS    "Qt3 and Qt4 cannot be used together in one project.  If switching to Qt4, the CMakeCache.txt needs to be cleaned.")
-    ENDIF(NOT Qt4_FIND_QUIETLY)
-    RETURN()
-  ENDIF(Qt4_FIND_REQUIRED)
-ENDIF(QT_QT_LIBRARY)
+if(QT_QT_LIBRARY)
+  if(Qt4_FIND_REQUIRED)
+    message( FATAL_ERROR "Qt3 and Qt4 cannot be used together in one project.  If switching to Qt4, the CMakeCache.txt needs to be cleaned.")
+  else(Qt4_FIND_REQUIRED)
+    if(NOT Qt4_FIND_QUIETLY)
+      message( STATUS    "Qt3 and Qt4 cannot be used together in one project.  If switching to Qt4, the CMakeCache.txt needs to be cleaned.")
+    endif(NOT Qt4_FIND_QUIETLY)
+    return()
+  endif(Qt4_FIND_REQUIRED)
+endif(QT_QT_LIBRARY)
 
 
-INCLUDE(CheckCXXSymbolExists)
-INCLUDE(MacroAddFileDependencies)
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(CheckCXXSymbolExists)
+include(MacroAddFileDependencies)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 
-SET(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake)
+set(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake)
 
-SET( QT_DEFINITIONS "")
+set( QT_DEFINITIONS "")
 
 # convenience macro for dealing with debug/release library names
-MACRO (_QT4_ADJUST_LIB_VARS _camelCaseBasename)
+macro (_QT4_ADJUST_LIB_VARS _camelCaseBasename)
 
-  STRING(TOUPPER "${_camelCaseBasename}" basename)
+  string(TOUPPER "${_camelCaseBasename}" basename)
 
   # The name of the imported targets, i.e. the prefix "Qt4::" must not change,
   # since it is stored in EXPORT-files as name of a required library. If the name would change
   # here, this would lead to the imported Qt4-library targets not being resolved by cmake anymore.
-  IF (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
+  if (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
 
-    IF(NOT TARGET Qt4::${_camelCaseBasename})
-      ADD_LIBRARY(Qt4::${_camelCaseBasename} UNKNOWN IMPORTED )
+    if(NOT TARGET Qt4::${_camelCaseBasename})
+      add_library(Qt4::${_camelCaseBasename} UNKNOWN IMPORTED )
 
-      IF (QT_${basename}_LIBRARY_RELEASE)
-        SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
+      if (QT_${basename}_LIBRARY_RELEASE)
+        set_property(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
         if(QT_USE_FRAMEWORKS)
-          SET_PROPERTY(TARGET Qt4::${_camelCaseBasename}        PROPERTY IMPORTED_LOCATION_RELEASE "${QT_${basename}_LIBRARY_RELEASE}/${_camelCaseBasename}" )
+          set_property(TARGET Qt4::${_camelCaseBasename}        PROPERTY IMPORTED_LOCATION_RELEASE "${QT_${basename}_LIBRARY_RELEASE}/${_camelCaseBasename}" )
         else()
-          SET_PROPERTY(TARGET Qt4::${_camelCaseBasename}        PROPERTY IMPORTED_LOCATION_RELEASE "${QT_${basename}_LIBRARY_RELEASE}" )
+          set_property(TARGET Qt4::${_camelCaseBasename}        PROPERTY IMPORTED_LOCATION_RELEASE "${QT_${basename}_LIBRARY_RELEASE}" )
         endif()
-      ENDIF (QT_${basename}_LIBRARY_RELEASE)
+      endif (QT_${basename}_LIBRARY_RELEASE)
 
-      IF (QT_${basename}_LIBRARY_DEBUG)
-        SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
+      if (QT_${basename}_LIBRARY_DEBUG)
+        set_property(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
         if(QT_USE_FRAMEWORKS)
-          SET_PROPERTY(TARGET Qt4::${_camelCaseBasename}        PROPERTY IMPORTED_LOCATION_DEBUG "${QT_${basename}_LIBRARY_DEBUG}/${_camelCaseBasename}" )
+          set_property(TARGET Qt4::${_camelCaseBasename}        PROPERTY IMPORTED_LOCATION_DEBUG "${QT_${basename}_LIBRARY_DEBUG}/${_camelCaseBasename}" )
         else()
-          SET_PROPERTY(TARGET Qt4::${_camelCaseBasename}        PROPERTY IMPORTED_LOCATION_DEBUG "${QT_${basename}_LIBRARY_DEBUG}" )
+          set_property(TARGET Qt4::${_camelCaseBasename}        PROPERTY IMPORTED_LOCATION_DEBUG "${QT_${basename}_LIBRARY_DEBUG}" )
         endif()
-      ENDIF (QT_${basename}_LIBRARY_DEBUG)
-    ENDIF(NOT TARGET Qt4::${_camelCaseBasename})
+      endif (QT_${basename}_LIBRARY_DEBUG)
+    endif(NOT TARGET Qt4::${_camelCaseBasename})
 
     # If QT_USE_IMPORTED_TARGETS is enabled, the QT_QTFOO_LIBRARY variables are set to point at these
     # imported targets. This works better in general, and is also in almost all cases fully
     # backward compatible. The only issue is when a project A which had this enabled then exports its
-    # libraries via export or EXPORT_LIBRARY_DEPENDENCIES(). In this case the libraries from project
+    # libraries via export or export_library_dependencies(). In this case the libraries from project
     # A will depend on the imported Qt targets, and the names of these imported targets will be stored
     # in the dependency files on disk. This means when a project B then uses project A, these imported
     # targets must be created again, otherwise e.g. "Qt4__QtCore" will be interpreted as name of a
     # library file on disk, and not as a target, and linking will fail:
-    IF(QT_USE_IMPORTED_TARGETS)
-        SET(QT_${basename}_LIBRARY       Qt4::${_camelCaseBasename} )
-        SET(QT_${basename}_LIBRARIES     Qt4::${_camelCaseBasename} )
-    ELSE(QT_USE_IMPORTED_TARGETS)
+    if(QT_USE_IMPORTED_TARGETS)
+        set(QT_${basename}_LIBRARY       Qt4::${_camelCaseBasename} )
+        set(QT_${basename}_LIBRARIES     Qt4::${_camelCaseBasename} )
+    else(QT_USE_IMPORTED_TARGETS)
 
       # if the release- as well as the debug-version of the library have been found:
-      IF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
+      if (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
         # if the generator supports configuration types then set
         # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
-        IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
-          SET(QT_${basename}_LIBRARY       optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
-        ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+        if (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+          set(QT_${basename}_LIBRARY       optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
+        else(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
           # if there are no configuration types and CMAKE_BUILD_TYPE has no value
           # then just use the release libraries
-          SET(QT_${basename}_LIBRARY       ${QT_${basename}_LIBRARY_RELEASE} )
-        ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
-        SET(QT_${basename}_LIBRARIES       optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
-      ENDIF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
+          set(QT_${basename}_LIBRARY       ${QT_${basename}_LIBRARY_RELEASE} )
+        endif(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+        set(QT_${basename}_LIBRARIES       optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
+      endif (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
 
       # if only the release version was found, set the debug variable also to the release version
-      IF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
-        SET(QT_${basename}_LIBRARY_DEBUG ${QT_${basename}_LIBRARY_RELEASE})
-        SET(QT_${basename}_LIBRARY       ${QT_${basename}_LIBRARY_RELEASE})
-        SET(QT_${basename}_LIBRARIES     ${QT_${basename}_LIBRARY_RELEASE})
-      ENDIF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
+      if (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
+        set(QT_${basename}_LIBRARY_DEBUG ${QT_${basename}_LIBRARY_RELEASE})
+        set(QT_${basename}_LIBRARY       ${QT_${basename}_LIBRARY_RELEASE})
+        set(QT_${basename}_LIBRARIES     ${QT_${basename}_LIBRARY_RELEASE})
+      endif (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
 
       # if only the debug version was found, set the release variable also to the debug version
-      IF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)
-        SET(QT_${basename}_LIBRARY_RELEASE ${QT_${basename}_LIBRARY_DEBUG})
-        SET(QT_${basename}_LIBRARY         ${QT_${basename}_LIBRARY_DEBUG})
-        SET(QT_${basename}_LIBRARIES       ${QT_${basename}_LIBRARY_DEBUG})
-      ENDIF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)
+      if (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)
+        set(QT_${basename}_LIBRARY_RELEASE ${QT_${basename}_LIBRARY_DEBUG})
+        set(QT_${basename}_LIBRARY         ${QT_${basename}_LIBRARY_DEBUG})
+        set(QT_${basename}_LIBRARIES       ${QT_${basename}_LIBRARY_DEBUG})
+      endif (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)
 
       # put the value in the cache:
-      SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY} CACHE STRING "The Qt ${basename} library" FORCE)
+      set(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY} CACHE STRING "The Qt ${basename} library" FORCE)
 
-    ENDIF(QT_USE_IMPORTED_TARGETS)
+    endif(QT_USE_IMPORTED_TARGETS)
 
-    SET(QT_${basename}_FOUND 1)
+    set(QT_${basename}_FOUND 1)
 
-  ELSE (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
+  else (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
 
-    SET(QT_${basename}_LIBRARY "" CACHE STRING "The Qt ${basename} library" FORCE)
+    set(QT_${basename}_LIBRARY "" CACHE STRING "The Qt ${basename} library" FORCE)
 
-  ENDIF (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
+  endif (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
 
-  IF (QT_${basename}_INCLUDE_DIR)
+  if (QT_${basename}_INCLUDE_DIR)
     #add the include directory to QT_INCLUDES
-    SET(QT_INCLUDES "${QT_${basename}_INCLUDE_DIR}" ${QT_INCLUDES})
-  ENDIF (QT_${basename}_INCLUDE_DIR)
+    set(QT_INCLUDES "${QT_${basename}_INCLUDE_DIR}" ${QT_INCLUDES})
+  endif (QT_${basename}_INCLUDE_DIR)
 
   # Make variables changeble to the advanced user
-  MARK_AS_ADVANCED(QT_${basename}_LIBRARY QT_${basename}_LIBRARY_RELEASE QT_${basename}_LIBRARY_DEBUG QT_${basename}_INCLUDE_DIR)
-ENDMACRO (_QT4_ADJUST_LIB_VARS)
+  mark_as_advanced(QT_${basename}_LIBRARY QT_${basename}_LIBRARY_RELEASE QT_${basename}_LIBRARY_DEBUG QT_${basename}_INCLUDE_DIR)
+endmacro (_QT4_ADJUST_LIB_VARS)
 
 function(_QT4_QUERY_QMAKE VAR RESULT)
   execute_process(COMMAND "${QT_QMAKE_EXECUTABLE}" -query ${VAR}
@@ -480,13 +480,13 @@ function(_QT4_QUERY_QMAKE VAR RESULT)
 endfunction(_QT4_QUERY_QMAKE)
 
 
-SET(QT4_INSTALLED_VERSION_TOO_OLD FALSE)
+set(QT4_INSTALLED_VERSION_TOO_OLD FALSE)
 
-GET_FILENAME_COMPONENT(qt_install_version "[HKEY_CURRENT_USER\\Software\\trolltech\\Versions;DefaultQtVersion]" NAME)
+get_filename_component(qt_install_version "[HKEY_CURRENT_USER\\Software\\trolltech\\Versions;DefaultQtVersion]" NAME)
 # check for qmake
 # Debian uses qmake-qt4
 # macports' Qt uses qmake-mac
-FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 qmake-mac PATHS
+find_program(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 qmake-mac PATHS
   "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin"
   "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin"
   "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\${qt_install_version};InstallDir]/bin"
@@ -495,224 +495,224 @@ FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 qmake-mac PATHS
 )
 
 # double check that it was a Qt4 qmake, if not, re-find with different names
-IF (QT_QMAKE_EXECUTABLE)
+if (QT_QMAKE_EXECUTABLE)
 
-  IF(QT_QMAKE_EXECUTABLE_LAST)
-    STRING(COMPARE NOTEQUAL "${QT_QMAKE_EXECUTABLE_LAST}" "${QT_QMAKE_EXECUTABLE}" QT_QMAKE_CHANGED)
-  ENDIF(QT_QMAKE_EXECUTABLE_LAST)
+  if(QT_QMAKE_EXECUTABLE_LAST)
+    string(COMPARE NOTEQUAL "${QT_QMAKE_EXECUTABLE_LAST}" "${QT_QMAKE_EXECUTABLE}" QT_QMAKE_CHANGED)
+  endif(QT_QMAKE_EXECUTABLE_LAST)
 
-  SET(QT_QMAKE_EXECUTABLE_LAST "${QT_QMAKE_EXECUTABLE}" CACHE INTERNAL "" FORCE)
+  set(QT_QMAKE_EXECUTABLE_LAST "${QT_QMAKE_EXECUTABLE}" CACHE INTERNAL "" FORCE)
 
   _qt4_query_qmake(QT_VERSION QTVERSION)
 
   # check for qt3 qmake and then try and find qmake4 or qmake-qt4 in the path
-  IF(NOT QTVERSION)
-    SET(QT_QMAKE_EXECUTABLE NOTFOUND CACHE FILEPATH "" FORCE)
-    FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake4 qmake-qt4 PATHS
+  if(NOT QTVERSION)
+    set(QT_QMAKE_EXECUTABLE NOTFOUND CACHE FILEPATH "" FORCE)
+    find_program(QT_QMAKE_EXECUTABLE NAMES qmake4 qmake-qt4 PATHS
       "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin"
       "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin"
       $ENV{QTDIR}/bin
       DOC "The qmake executable for the Qt installation to use"
       )
-    IF(QT_QMAKE_EXECUTABLE)
+    if(QT_QMAKE_EXECUTABLE)
       _qt4_query_qmake(QT_VERSION QTVERSION)
-    ENDIF(QT_QMAKE_EXECUTABLE)
-  ENDIF(NOT QTVERSION)
+    endif(QT_QMAKE_EXECUTABLE)
+  endif(NOT QTVERSION)
 
-ENDIF (QT_QMAKE_EXECUTABLE)
+endif (QT_QMAKE_EXECUTABLE)
 
-IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
+if (QT_QMAKE_EXECUTABLE AND QTVERSION)
 
   # ask qmake for the mkspecs directory
   # we do this first because QT_LIBINFIX might be set
-  IF (NOT QT_MKSPECS_DIR  OR  QT_QMAKE_CHANGED)
+  if (NOT QT_MKSPECS_DIR  OR  QT_QMAKE_CHANGED)
     _qt4_query_qmake(QMAKE_MKSPECS qt_mkspecs_dirs)
     # do not replace : on windows as it might be a drive letter
     # and windows should already use ; as a separator
-    IF(NOT WIN32)
-      STRING(REPLACE ":" ";" qt_mkspecs_dirs "${qt_mkspecs_dirs}")
-    ENDIF(NOT WIN32)
+    if(NOT WIN32)
+      string(REPLACE ":" ";" qt_mkspecs_dirs "${qt_mkspecs_dirs}")
+    endif(NOT WIN32)
     set(qt_cross_paths)
     foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH})
       set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/mkspecs")
     endforeach(qt_cross_path)
-    SET(QT_MKSPECS_DIR NOTFOUND)
-    FIND_PATH(QT_MKSPECS_DIR NAMES qconfig.pri
+    set(QT_MKSPECS_DIR NOTFOUND)
+    find_path(QT_MKSPECS_DIR NAMES qconfig.pri
       HINTS ${qt_cross_paths} ${qt_mkspecs_dirs}
       DOC "The location of the Qt mkspecs containing qconfig.pri")
-  ENDIF()
+  endif()
 
-  IF(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
-    FILE(READ ${QT_MKSPECS_DIR}/qconfig.pri _qconfig_FILE_contents)
-    STRING(REGEX MATCH "QT_CONFIG[^\n]+" QT_QCONFIG "${_qconfig_FILE_contents}")
-    STRING(REGEX MATCH "CONFIG[^\n]+" QT_CONFIG "${_qconfig_FILE_contents}")
-    STRING(REGEX MATCH "EDITION[^\n]+" QT_EDITION "${_qconfig_FILE_contents}")
-    STRING(REGEX MATCH "QT_LIBINFIX[^\n]+" _qconfig_qt_libinfix "${_qconfig_FILE_contents}")
-    STRING(REGEX REPLACE "QT_LIBINFIX *= *([^\n]*)" "\\1" QT_LIBINFIX "${_qconfig_qt_libinfix}")
-  ENDIF(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
-  IF("${QT_EDITION}" MATCHES "DesktopLight")
-    SET(QT_EDITION_DESKTOPLIGHT 1)
-  ENDIF("${QT_EDITION}" MATCHES "DesktopLight")
+  if(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
+    file(READ ${QT_MKSPECS_DIR}/qconfig.pri _qconfig_FILE_contents)
+    string(REGEX MATCH "QT_CONFIG[^\n]+" QT_QCONFIG "${_qconfig_FILE_contents}")
+    string(REGEX MATCH "CONFIG[^\n]+" QT_CONFIG "${_qconfig_FILE_contents}")
+    string(REGEX MATCH "EDITION[^\n]+" QT_EDITION "${_qconfig_FILE_contents}")
+    string(REGEX MATCH "QT_LIBINFIX[^\n]+" _qconfig_qt_libinfix "${_qconfig_FILE_contents}")
+    string(REGEX REPLACE "QT_LIBINFIX *= *([^\n]*)" "\\1" QT_LIBINFIX "${_qconfig_qt_libinfix}")
+  endif(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
+  if("${QT_EDITION}" MATCHES "DesktopLight")
+    set(QT_EDITION_DESKTOPLIGHT 1)
+  endif("${QT_EDITION}" MATCHES "DesktopLight")
 
   # ask qmake for the library dir as a hint, then search for QtCore library and use that as a reference for finding the
   # others and for setting QT_LIBRARY_DIR
-  IF (NOT (QT_QTCORE_LIBRARY_RELEASE OR QT_QTCORE_LIBRARY_DEBUG)  OR QT_QMAKE_CHANGED)
+  if (NOT (QT_QTCORE_LIBRARY_RELEASE OR QT_QTCORE_LIBRARY_DEBUG)  OR QT_QMAKE_CHANGED)
     _qt4_query_qmake(QT_INSTALL_LIBS QT_LIBRARY_DIR_TMP)
-    SET(QT_QTCORE_LIBRARY_RELEASE NOTFOUND)
-    SET(QT_QTCORE_LIBRARY_DEBUG NOTFOUND)
-    FIND_LIBRARY(QT_QTCORE_LIBRARY_RELEASE
+    set(QT_QTCORE_LIBRARY_RELEASE NOTFOUND)
+    set(QT_QTCORE_LIBRARY_DEBUG NOTFOUND)
+    find_library(QT_QTCORE_LIBRARY_RELEASE
                  NAMES QtCore${QT_LIBINFIX} QtCore${QT_LIBINFIX}4
                  HINTS ${QT_LIBRARY_DIR_TMP}
                  NO_DEFAULT_PATH
         )
-    FIND_LIBRARY(QT_QTCORE_LIBRARY_DEBUG
+    find_library(QT_QTCORE_LIBRARY_DEBUG
                  NAMES QtCore${QT_LIBINFIX}_debug QtCore${QT_LIBINFIX}d QtCore${QT_LIBINFIX}d4
                  HINTS ${QT_LIBRARY_DIR_TMP}
                  NO_DEFAULT_PATH
         )
 
-    IF(NOT QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCORE_LIBRARY_DEBUG)
-      FIND_LIBRARY(QT_QTCORE_LIBRARY_RELEASE
+    if(NOT QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCORE_LIBRARY_DEBUG)
+      find_library(QT_QTCORE_LIBRARY_RELEASE
                    NAMES QtCore${QT_LIBINFIX} QtCore${QT_LIBINFIX}4
                    HINTS ${QT_LIBRARY_DIR_TMP}
           )
-      FIND_LIBRARY(QT_QTCORE_LIBRARY_DEBUG
+      find_library(QT_QTCORE_LIBRARY_DEBUG
                    NAMES QtCore${QT_LIBINFIX}_debug QtCore${QT_LIBINFIX}d QtCore${QT_LIBINFIX}d4
                    HINTS ${QT_LIBRARY_DIR_TMP}
           )
-    ENDIF(NOT QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCORE_LIBRARY_DEBUG)
+    endif(NOT QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCORE_LIBRARY_DEBUG)
 
     # 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.")
-      ENDIF(EXISTS ${QT_LIBRARY_DIR_TMP}/libqtmain.a)
-    ENDIF(NOT QT_QTCORE_LIBRARY_RELEASE AND MSVC)
+    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.")
+      endif(EXISTS ${QT_LIBRARY_DIR_TMP}/libqtmain.a)
+    endif(NOT QT_QTCORE_LIBRARY_RELEASE AND MSVC)
 
-  ENDIF ()
+  endif ()
 
   # set QT_LIBRARY_DIR based on location of QtCore found.
-  IF(QT_QTCORE_LIBRARY_RELEASE)
-    GET_FILENAME_COMPONENT(QT_LIBRARY_DIR_TMP "${QT_QTCORE_LIBRARY_RELEASE}" PATH)
-    SET(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE INTERNAL "Qt library dir" FORCE)
-    SET(QT_QTCORE_FOUND 1)
-  ELSEIF(QT_QTCORE_LIBRARY_DEBUG)
-    GET_FILENAME_COMPONENT(QT_LIBRARY_DIR_TMP "${QT_QTCORE_LIBRARY_DEBUG}" PATH)
-    SET(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE INTERNAL "Qt library dir" FORCE)
-    SET(QT_QTCORE_FOUND 1)
-  ELSE()
-    MESSAGE(WARNING "${QT_QMAKE_EXECUTABLE} reported QT_INSTALL_LIBS as \"${QT_LIBRARY_DIR_TMP}\" "
+  if(QT_QTCORE_LIBRARY_RELEASE)
+    get_filename_component(QT_LIBRARY_DIR_TMP "${QT_QTCORE_LIBRARY_RELEASE}" PATH)
+    set(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE INTERNAL "Qt library dir" FORCE)
+    set(QT_QTCORE_FOUND 1)
+  elseif(QT_QTCORE_LIBRARY_DEBUG)
+    get_filename_component(QT_LIBRARY_DIR_TMP "${QT_QTCORE_LIBRARY_DEBUG}" PATH)
+    set(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE INTERNAL "Qt library dir" FORCE)
+    set(QT_QTCORE_FOUND 1)
+  else()
+    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.")
-    IF(Qt4_FIND_REQUIRED)
-      MESSAGE( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.")
-    ENDIF(Qt4_FIND_REQUIRED)
-  ENDIF()
+    if(Qt4_FIND_REQUIRED)
+      message( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.")
+    endif(Qt4_FIND_REQUIRED)
+  endif()
 
   # ask qmake for the binary dir
-  IF (NOT QT_BINARY_DIR  OR  QT_QMAKE_CHANGED)
+  if (NOT QT_BINARY_DIR  OR  QT_QMAKE_CHANGED)
     _qt4_query_qmake(QT_INSTALL_BINS qt_bins)
-    SET(QT_BINARY_DIR ${qt_bins} CACHE INTERNAL "" FORCE)
-  ENDIF (NOT QT_BINARY_DIR  OR  QT_QMAKE_CHANGED)
+    set(QT_BINARY_DIR ${qt_bins} CACHE INTERNAL "" FORCE)
+  endif (NOT QT_BINARY_DIR  OR  QT_QMAKE_CHANGED)
 
-  IF (APPLE)
-    SET(CMAKE_FIND_FRAMEWORK_OLD ${CMAKE_FIND_FRAMEWORK})
-    IF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
-      SET(QT_USE_FRAMEWORKS ON CACHE INTERNAL "" FORCE)
-      SET(CMAKE_FIND_FRAMEWORK FIRST)
-    ELSE (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
-      SET(QT_USE_FRAMEWORKS OFF CACHE INTERNAL "" FORCE)
-      SET(CMAKE_FIND_FRAMEWORK LAST)
-    ENDIF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
-  ENDIF (APPLE)
+  if (APPLE)
+    set(CMAKE_FIND_FRAMEWORK_OLD ${CMAKE_FIND_FRAMEWORK})
+    if (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
+      set(QT_USE_FRAMEWORKS ON CACHE INTERNAL "" FORCE)
+      set(CMAKE_FIND_FRAMEWORK FIRST)
+    else (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
+      set(QT_USE_FRAMEWORKS OFF CACHE INTERNAL "" FORCE)
+      set(CMAKE_FIND_FRAMEWORK LAST)
+    endif (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
+  endif (APPLE)
 
   # ask qmake for the include dir
-  IF (QT_LIBRARY_DIR AND (NOT QT_QTCORE_INCLUDE_DIR OR NOT QT_HEADERS_DIR OR  QT_QMAKE_CHANGED))
+  if (QT_LIBRARY_DIR AND (NOT QT_QTCORE_INCLUDE_DIR OR NOT QT_HEADERS_DIR OR  QT_QMAKE_CHANGED))
       _qt4_query_qmake(QT_INSTALL_HEADERS qt_headers)
-      SET(QT_QTCORE_INCLUDE_DIR NOTFOUND)
-      FIND_PATH(QT_QTCORE_INCLUDE_DIR QtCore
+      set(QT_QTCORE_INCLUDE_DIR NOTFOUND)
+      find_path(QT_QTCORE_INCLUDE_DIR QtCore
                 HINTS ${qt_headers} ${QT_LIBRARY_DIR}
                 PATH_SUFFIXES QtCore qt4/QtCore
         )
 
       # Set QT_HEADERS_DIR based on finding QtCore header
-      IF(QT_QTCORE_INCLUDE_DIR)
-        IF(QT_USE_FRAMEWORKS)
-          SET(QT_HEADERS_DIR "${qt_headers}" CACHE INTERNAL "" FORCE)
-        ELSE(QT_USE_FRAMEWORKS)
-          GET_FILENAME_COMPONENT(qt_headers "${QT_QTCORE_INCLUDE_DIR}/../" ABSOLUTE)
-          SET(QT_HEADERS_DIR "${qt_headers}" CACHE INTERNAL "" FORCE)
-        ENDIF(QT_USE_FRAMEWORKS)
-      ELSEIF()
-        MESSAGE("Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_HEADERS as ${qt_headers}")
-        MESSAGE("Warning: But QtCore couldn't be found.  Qt must NOT be installed correctly.")
-      ENDIF()
-  ENDIF()
+      if(QT_QTCORE_INCLUDE_DIR)
+        if(QT_USE_FRAMEWORKS)
+          set(QT_HEADERS_DIR "${qt_headers}" CACHE INTERNAL "" FORCE)
+        else(QT_USE_FRAMEWORKS)
+          get_filename_component(qt_headers "${QT_QTCORE_INCLUDE_DIR}/../" ABSOLUTE)
+          set(QT_HEADERS_DIR "${qt_headers}" CACHE INTERNAL "" FORCE)
+        endif(QT_USE_FRAMEWORKS)
+      elseif()
+        message("Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_HEADERS as ${qt_headers}")
+        message("Warning: But QtCore couldn't be found.  Qt must NOT be installed correctly.")
+      endif()
+  endif()
 
-  IF(APPLE)
-    SET(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_OLD})
-  ENDIF(APPLE)
+  if(APPLE)
+    set(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_OLD})
+  endif(APPLE)
 
   # Set QT_INCLUDE_DIR based on QT_HEADERS_DIR
-  IF(QT_HEADERS_DIR)
-    IF(QT_USE_FRAMEWORKS)
+  if(QT_HEADERS_DIR)
+    if(QT_USE_FRAMEWORKS)
       # Qt/Mac frameworks has two include dirs.
       # One is the framework include for which CMake will add a -F flag
       # and the other is an include dir for non-framework Qt modules
-      SET(QT_INCLUDE_DIR ${QT_HEADERS_DIR} ${QT_QTCORE_LIBRARY_RELEASE} )
-    ELSE(QT_USE_FRAMEWORKS)
-      SET(QT_INCLUDE_DIR ${QT_HEADERS_DIR})
-    ENDIF(QT_USE_FRAMEWORKS)
-  ENDIF(QT_HEADERS_DIR)
+      set(QT_INCLUDE_DIR ${QT_HEADERS_DIR} ${QT_QTCORE_LIBRARY_RELEASE} )
+    else(QT_USE_FRAMEWORKS)
+      set(QT_INCLUDE_DIR ${QT_HEADERS_DIR})
+    endif(QT_USE_FRAMEWORKS)
+  endif(QT_HEADERS_DIR)
 
   # Set QT_INCLUDES
-  SET( QT_INCLUDES ${QT_MKSPECS_DIR}/default ${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
+  set( QT_INCLUDES ${QT_MKSPECS_DIR}/default ${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
 
 
   # ask qmake for the documentation directory
-  IF (QT_LIBRARY_DIR AND NOT QT_DOC_DIR  OR  QT_QMAKE_CHANGED)
+  if (QT_LIBRARY_DIR AND NOT QT_DOC_DIR  OR  QT_QMAKE_CHANGED)
     _qt4_query_qmake(QT_INSTALL_DOCS qt_doc_dir)
-    SET(QT_DOC_DIR ${qt_doc_dir} CACHE PATH "The location of the Qt docs" FORCE)
-  ENDIF (QT_LIBRARY_DIR AND NOT QT_DOC_DIR  OR  QT_QMAKE_CHANGED)
+    set(QT_DOC_DIR ${qt_doc_dir} CACHE PATH "The location of the Qt docs" FORCE)
+  endif (QT_LIBRARY_DIR AND NOT QT_DOC_DIR  OR  QT_QMAKE_CHANGED)
 
 
   # ask qmake for the plugins directory
-  IF (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR  OR  QT_QMAKE_CHANGED)
+  if (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR  OR  QT_QMAKE_CHANGED)
     _qt4_query_qmake(QT_INSTALL_PLUGINS qt_plugins_dir)
-    SET(QT_PLUGINS_DIR NOTFOUND)
+    set(QT_PLUGINS_DIR NOTFOUND)
     foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH})
       set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/plugins")
     endforeach(qt_cross_path)
-    FIND_PATH(QT_PLUGINS_DIR NAMES accessible imageformats sqldrivers codecs designer
+    find_path(QT_PLUGINS_DIR NAMES accessible imageformats sqldrivers codecs designer
       HINTS ${qt_cross_paths} ${qt_plugins_dir}
       DOC "The location of the Qt plugins")
-  ENDIF (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR  OR  QT_QMAKE_CHANGED)
+  endif (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR  OR  QT_QMAKE_CHANGED)
 
   # ask qmake for the translations directory
-  IF (QT_LIBRARY_DIR AND NOT QT_TRANSLATIONS_DIR  OR  QT_QMAKE_CHANGED)
+  if (QT_LIBRARY_DIR AND NOT QT_TRANSLATIONS_DIR  OR  QT_QMAKE_CHANGED)
     _qt4_query_qmake(QT_INSTALL_TRANSLATIONS qt_translations_dir)
-    SET(QT_TRANSLATIONS_DIR ${qt_translations_dir} CACHE PATH "The location of the Qt translations" FORCE)
-  ENDIF (QT_LIBRARY_DIR AND NOT QT_TRANSLATIONS_DIR  OR  QT_QMAKE_CHANGED)
+    set(QT_TRANSLATIONS_DIR ${qt_translations_dir} CACHE PATH "The location of the Qt translations" FORCE)
+  endif (QT_LIBRARY_DIR AND NOT QT_TRANSLATIONS_DIR  OR  QT_QMAKE_CHANGED)
 
   # ask qmake for the imports directory
-  IF (QT_LIBRARY_DIR AND NOT QT_IMPORTS_DIR OR QT_QMAKE_CHANGED)
+  if (QT_LIBRARY_DIR AND NOT QT_IMPORTS_DIR OR QT_QMAKE_CHANGED)
     _qt4_query_qmake(QT_INSTALL_IMPORTS qt_imports_dir)
     if(qt_imports_dir)
-      SET(QT_IMPORTS_DIR NOTFOUND)
+      set(QT_IMPORTS_DIR NOTFOUND)
       foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH})
         set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/imports")
       endforeach(qt_cross_path)
-      FIND_PATH(QT_IMPORTS_DIR NAMES Qt
+      find_path(QT_IMPORTS_DIR NAMES Qt
         HINTS ${qt_cross_paths} ${qt_imports_dir}
         DOC "The location of the Qt imports"
         NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH
         NO_CMAKE_SYSTEM_PATH)
       mark_as_advanced(QT_IMPORTS_DIR)
     endif(qt_imports_dir)
-  ENDIF (QT_LIBRARY_DIR AND NOT QT_IMPORTS_DIR  OR  QT_QMAKE_CHANGED)
+  endif (QT_LIBRARY_DIR AND NOT QT_IMPORTS_DIR  OR  QT_QMAKE_CHANGED)
 
   # Make variables changeble to the advanced user
-  MARK_AS_ADVANCED( QT_LIBRARY_DIR QT_DOC_DIR QT_MKSPECS_DIR
+  mark_as_advanced( QT_LIBRARY_DIR QT_DOC_DIR QT_MKSPECS_DIR
                     QT_PLUGINS_DIR QT_TRANSLATIONS_DIR)
 
 
@@ -724,32 +724,32 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
   #
   #############################################
   # Save required variable
-  SET(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
-  SET(CMAKE_REQUIRED_FLAGS_SAVE    ${CMAKE_REQUIRED_FLAGS})
+  set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
+  set(CMAKE_REQUIRED_FLAGS_SAVE    ${CMAKE_REQUIRED_FLAGS})
   # Add QT_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES
-  SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${QT_INCLUDE_DIR}")
+  set(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${QT_INCLUDE_DIR}")
   # Check for Window system symbols (note: only one should end up being set)
   CHECK_CXX_SYMBOL_EXISTS(Q_WS_X11 "QtCore/qglobal.h" Q_WS_X11)
   CHECK_CXX_SYMBOL_EXISTS(Q_WS_WIN "QtCore/qglobal.h" Q_WS_WIN)
   CHECK_CXX_SYMBOL_EXISTS(Q_WS_QWS "QtCore/qglobal.h" Q_WS_QWS)
   CHECK_CXX_SYMBOL_EXISTS(Q_WS_MAC "QtCore/qglobal.h" Q_WS_MAC)
-  IF(Q_WS_MAC)
-    IF(QT_QMAKE_CHANGED)
-      UNSET(QT_MAC_USE_COCOA CACHE)
-    ENDIF(QT_QMAKE_CHANGED)
+  if(Q_WS_MAC)
+    if(QT_QMAKE_CHANGED)
+      unset(QT_MAC_USE_COCOA CACHE)
+    endif(QT_QMAKE_CHANGED)
     CHECK_CXX_SYMBOL_EXISTS(QT_MAC_USE_COCOA "QtCore/qconfig.h" QT_MAC_USE_COCOA)
-  ENDIF(Q_WS_MAC)
+  endif(Q_WS_MAC)
 
-  IF (QT_QTCOPY_REQUIRED)
+  if (QT_QTCOPY_REQUIRED)
      CHECK_CXX_SYMBOL_EXISTS(QT_IS_QTCOPY "QtCore/qglobal.h" QT_KDE_QT_COPY)
-     IF (NOT QT_IS_QTCOPY)
-        MESSAGE(FATAL_ERROR "qt-copy is required, but hasn't been found")
-     ENDIF (NOT QT_IS_QTCOPY)
-  ENDIF (QT_QTCOPY_REQUIRED)
+     if (NOT QT_IS_QTCOPY)
+        message(FATAL_ERROR "qt-copy is required, but hasn't been found")
+     endif (NOT QT_IS_QTCOPY)
+  endif (QT_QTCOPY_REQUIRED)
 
   # Restore CMAKE_REQUIRED_INCLUDES and CMAKE_REQUIRED_FLAGS variables
-  SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})
-  SET(CMAKE_REQUIRED_FLAGS    ${CMAKE_REQUIRED_FLAGS_SAVE})
+  set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})
+  set(CMAKE_REQUIRED_FLAGS    ${CMAKE_REQUIRED_FLAGS_SAVE})
   #
   #############################################
 
@@ -761,48 +761,48 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
   #
   ########################################
 
-  SET(QT_MODULES QtGui Qt3Support QtSvg QtScript QtTest QtUiTools
+  set(QT_MODULES QtGui Qt3Support QtSvg QtScript QtTest QtUiTools
                  QtHelp QtWebKit QtXmlPatterns phonon QtNetwork QtMultimedia
                  QtNsPlugin QtOpenGL QtSql QtXml QtDesigner QtDBus QtScriptTools
                  QtDeclarative)
 
-  IF(Q_WS_X11)
-    SET(QT_MODULES ${QT_MODULES} QtMotif)
-  ENDIF(Q_WS_X11)
+  if(Q_WS_X11)
+    set(QT_MODULES ${QT_MODULES} QtMotif)
+  endif(Q_WS_X11)
 
-  IF(QT_QMAKE_CHANGED)
-    FOREACH(QT_MODULE ${QT_MODULES})
-      STRING(TOUPPER ${QT_MODULE} _upper_qt_module)
-      SET(QT_${_upper_qt_module}_INCLUDE_DIR NOTFOUND)
-      SET(QT_${_upper_qt_module}_LIBRARY_RELEASE NOTFOUND)
-      SET(QT_${_upper_qt_module}_LIBRARY_DEBUG NOTFOUND)
-    ENDFOREACH(QT_MODULE)
-    SET(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR NOTFOUND)
-    SET(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NOTFOUND)
-    SET(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG NOTFOUND)
-    SET(QT_QTASSISTANTCLIENT_INCLUDE_DIR NOTFOUND)
-    SET(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NOTFOUND)
-    SET(QT_QTASSISTANTCLIENT_LIBRARY_DEBUG NOTFOUND)
-    SET(QT_QTASSISTANT_INCLUDE_DIR NOTFOUND)
-    SET(QT_QTASSISTANT_LIBRARY_RELEASE NOTFOUND)
-    SET(QT_QTASSISTANT_LIBRARY_DEBUG NOTFOUND)
-    SET(QT_QTCLUCENE_LIBRARY_RELEASE NOTFOUND)
-    SET(QT_QTCLUCENE_LIBRARY_DEBUG NOTFOUND)
-    SET(QT_QAXCONTAINER_INCLUDE_DIR NOTFOUND)
-    SET(QT_QAXCONTAINER_LIBRARY_RELEASE NOTFOUND)
-    SET(QT_QAXCONTAINER_LIBRARY_DEBUG NOTFOUND)
-    SET(QT_QAXSERVER_INCLUDE_DIR NOTFOUND)
-    SET(QT_QAXSERVER_LIBRARY_RELEASE NOTFOUND)
-    SET(QT_QAXSERVER_LIBRARY_DEBUG NOTFOUND)
-    IF(Q_WS_WIN)
-      SET(QT_QTMAIN_LIBRARY_DEBUG NOTFOUND)
-      SET(QT_QTMAIN_LIBRARY_RELEASE NOTFOUND)
-    ENDIF(Q_WS_WIN)
-  ENDIF(QT_QMAKE_CHANGED)
+  if(QT_QMAKE_CHANGED)
+    foreach(QT_MODULE ${QT_MODULES})
+      string(TOUPPER ${QT_MODULE} _upper_qt_module)
+      set(QT_${_upper_qt_module}_INCLUDE_DIR NOTFOUND)
+      set(QT_${_upper_qt_module}_LIBRARY_RELEASE NOTFOUND)
+      set(QT_${_upper_qt_module}_LIBRARY_DEBUG NOTFOUND)
+    endforeach(QT_MODULE)
+    set(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR NOTFOUND)
+    set(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NOTFOUND)
+    set(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG NOTFOUND)
+    set(QT_QTASSISTANTCLIENT_INCLUDE_DIR NOTFOUND)
+    set(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NOTFOUND)
+    set(QT_QTASSISTANTCLIENT_LIBRARY_DEBUG NOTFOUND)
+    set(QT_QTASSISTANT_INCLUDE_DIR NOTFOUND)
+    set(QT_QTASSISTANT_LIBRARY_RELEASE NOTFOUND)
+    set(QT_QTASSISTANT_LIBRARY_DEBUG NOTFOUND)
+    set(QT_QTCLUCENE_LIBRARY_RELEASE NOTFOUND)
+    set(QT_QTCLUCENE_LIBRARY_DEBUG NOTFOUND)
+    set(QT_QAXCONTAINER_INCLUDE_DIR NOTFOUND)
+    set(QT_QAXCONTAINER_LIBRARY_RELEASE NOTFOUND)
+    set(QT_QAXCONTAINER_LIBRARY_DEBUG NOTFOUND)
+    set(QT_QAXSERVER_INCLUDE_DIR NOTFOUND)
+    set(QT_QAXSERVER_LIBRARY_RELEASE NOTFOUND)
+    set(QT_QAXSERVER_LIBRARY_DEBUG NOTFOUND)
+    if(Q_WS_WIN)
+      set(QT_QTMAIN_LIBRARY_DEBUG NOTFOUND)
+      set(QT_QTMAIN_LIBRARY_RELEASE NOTFOUND)
+    endif(Q_WS_WIN)
+  endif(QT_QMAKE_CHANGED)
 
-  FOREACH(QT_MODULE ${QT_MODULES})
-    STRING(TOUPPER ${QT_MODULE} _upper_qt_module)
-    FIND_PATH(QT_${_upper_qt_module}_INCLUDE_DIR ${QT_MODULE}
+  foreach(QT_MODULE ${QT_MODULES})
+    string(TOUPPER ${QT_MODULE} _upper_qt_module)
+    find_path(QT_${_upper_qt_module}_INCLUDE_DIR ${QT_MODULE}
               PATHS
               ${QT_HEADERS_DIR}/${QT_MODULE}
               ${QT_LIBRARY_DIR}/${QT_MODULE}.framework/Headers
@@ -810,31 +810,31 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
       )
     # phonon doesn't seem consistent, let's try phonondefs.h for some
     # installations
-    IF(${QT_MODULE} STREQUAL "phonon")
-      FIND_PATH(QT_${_upper_qt_module}_INCLUDE_DIR phonondefs.h
+    if(${QT_MODULE} STREQUAL "phonon")
+      find_path(QT_${_upper_qt_module}_INCLUDE_DIR phonondefs.h
                 PATHS
                 ${QT_HEADERS_DIR}/${QT_MODULE}
                 ${QT_LIBRARY_DIR}/${QT_MODULE}.framework/Headers
                 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
         )
-    ENDIF(${QT_MODULE} STREQUAL "phonon")
-  ENDFOREACH(QT_MODULE)
+    endif(${QT_MODULE} STREQUAL "phonon")
+  endforeach(QT_MODULE)
 
-  IF(Q_WS_WIN)
-    SET(QT_MODULES ${QT_MODULES} QAxContainer QAxServer)
+  if(Q_WS_WIN)
+    set(QT_MODULES ${QT_MODULES} QAxContainer QAxServer)
     # Set QT_AXCONTAINER_INCLUDE_DIR and QT_AXSERVER_INCLUDE_DIR
-    FIND_PATH(QT_QAXCONTAINER_INCLUDE_DIR ActiveQt
+    find_path(QT_QAXCONTAINER_INCLUDE_DIR ActiveQt
       PATHS ${QT_HEADERS_DIR}/ActiveQt
       NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
       )
-    FIND_PATH(QT_QAXSERVER_INCLUDE_DIR ActiveQt
+    find_path(QT_QAXSERVER_INCLUDE_DIR ActiveQt
       PATHS ${QT_HEADERS_DIR}/ActiveQt
       NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
       )
-  ENDIF(Q_WS_WIN)
+  endif(Q_WS_WIN)
 
   # Set QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR
-  FIND_PATH(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR QDesignerComponents
+  find_path(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR QDesignerComponents
     PATHS
     ${QT_HEADERS_DIR}/QtDesigner
     ${QT_LIBRARY_DIR}/QtDesigner.framework/Headers
@@ -842,7 +842,7 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
     )
 
   # Set QT_QTASSISTANT_INCLUDE_DIR
-  FIND_PATH(QT_QTASSISTANT_INCLUDE_DIR QtAssistant
+  find_path(QT_QTASSISTANT_INCLUDE_DIR QtAssistant
     PATHS
     ${QT_HEADERS_DIR}/QtAssistant
     ${QT_LIBRARY_DIR}/QtAssistant.framework/Headers
@@ -850,7 +850,7 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
     )
 
   # Set QT_QTASSISTANTCLIENT_INCLUDE_DIR
-  FIND_PATH(QT_QTASSISTANTCLIENT_INCLUDE_DIR QAssistantClient
+  find_path(QT_QTASSISTANTCLIENT_INCLUDE_DIR QAssistantClient
     PATHS
     ${QT_HEADERS_DIR}/QtAssistant
     ${QT_LIBRARY_DIR}/QtAssistant.framework/Headers
@@ -864,48 +864,48 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
   ########################################
 
   # find the libraries
-  FOREACH(QT_MODULE ${QT_MODULES})
-    STRING(TOUPPER ${QT_MODULE} _upper_qt_module)
-    FIND_LIBRARY(QT_${_upper_qt_module}_LIBRARY_RELEASE
+  foreach(QT_MODULE ${QT_MODULES})
+    string(TOUPPER ${QT_MODULE} _upper_qt_module)
+    find_library(QT_${_upper_qt_module}_LIBRARY_RELEASE
                  NAMES ${QT_MODULE}${QT_LIBINFIX} ${QT_MODULE}${QT_LIBINFIX}4
                  PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
         )
-    FIND_LIBRARY(QT_${_upper_qt_module}_LIBRARY_DEBUG
+    find_library(QT_${_upper_qt_module}_LIBRARY_DEBUG
                  NAMES ${QT_MODULE}${QT_LIBINFIX}_debug ${QT_MODULE}${QT_LIBINFIX}d ${QT_MODULE}${QT_LIBINFIX}d4
                  PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
         )
-  ENDFOREACH(QT_MODULE)
+  endforeach(QT_MODULE)
 
   # QtUiTools is sometimes not in the same directory as the other found libraries
   # e.g. on Mac, its never a framework like the others are
-  IF(QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTUITOOLS_LIBRARY_RELEASE)
-    FIND_LIBRARY(QT_QTUITOOLS_LIBRARY_RELEASE NAMES QtUiTools${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR})
-  ENDIF(QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTUITOOLS_LIBRARY_RELEASE)
+  if(QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTUITOOLS_LIBRARY_RELEASE)
+    find_library(QT_QTUITOOLS_LIBRARY_RELEASE NAMES QtUiTools${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR})
+  endif(QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTUITOOLS_LIBRARY_RELEASE)
 
   # Set QT_QTDESIGNERCOMPONENTS_LIBRARY
-  FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NAMES QtDesignerComponents${QT_LIBINFIX} QtDesignerComponents${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
-  FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG   NAMES QtDesignerComponents${QT_LIBINFIX}_debug QtDesignerComponents${QT_LIBINFIX}d QtDesignerComponents${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+  find_library(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NAMES QtDesignerComponents${QT_LIBINFIX} QtDesignerComponents${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+  find_library(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG   NAMES QtDesignerComponents${QT_LIBINFIX}_debug QtDesignerComponents${QT_LIBINFIX}d QtDesignerComponents${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
 
   # Set QT_QTMAIN_LIBRARY
-  IF(Q_WS_WIN)
-    FIND_LIBRARY(QT_QTMAIN_LIBRARY_RELEASE NAMES qtmain${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
-    FIND_LIBRARY(QT_QTMAIN_LIBRARY_DEBUG NAMES qtmain${QT_LIBINFIX}d PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
-  ENDIF(Q_WS_WIN)
+  if(Q_WS_WIN)
+    find_library(QT_QTMAIN_LIBRARY_RELEASE NAMES qtmain${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+    find_library(QT_QTMAIN_LIBRARY_DEBUG NAMES qtmain${QT_LIBINFIX}d PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+  endif(Q_WS_WIN)
 
   # Set QT_QTASSISTANTCLIENT_LIBRARY
-  FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
-  FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_DEBUG   NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR}  NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+  find_library(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+  find_library(QT_QTASSISTANTCLIENT_LIBRARY_DEBUG   NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR}  NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
 
   # Set QT_QTASSISTANT_LIBRARY
-  FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 QtAssistant${QT_LIBINFIX} QtAssistant${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
-  FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_DEBUG   NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 QtAssistant${QT_LIBINFIX}_debug QtAssistant${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+  find_library(QT_QTASSISTANT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 QtAssistant${QT_LIBINFIX} QtAssistant${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+  find_library(QT_QTASSISTANT_LIBRARY_DEBUG   NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 QtAssistant${QT_LIBINFIX}_debug QtAssistant${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
 
   # Set QT_QTHELP_LIBRARY
-  FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene${QT_LIBINFIX} QtCLucene${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
-  FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_DEBUG   NAMES QtCLucene${QT_LIBINFIX}_debug QtCLucene${QT_LIBINFIX}d QtCLucene${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
-  IF(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCLUCENE_LIBRARY_RELEASE)
-    FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR})
-  ENDIF(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCLUCENE_LIBRARY_RELEASE)
+  find_library(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene${QT_LIBINFIX} QtCLucene${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+  find_library(QT_QTCLUCENE_LIBRARY_DEBUG   NAMES QtCLucene${QT_LIBINFIX}_debug QtCLucene${QT_LIBINFIX}d QtCLucene${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+  if(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCLUCENE_LIBRARY_RELEASE)
+    find_library(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR})
+  endif(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCLUCENE_LIBRARY_RELEASE)
 
 
   ############################################
@@ -919,9 +919,9 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
   # library include path to QT_INCLUDES
   _QT4_ADJUST_LIB_VARS(QtCore)
 
-  FOREACH(QT_MODULE ${QT_MODULES})
+  foreach(QT_MODULE ${QT_MODULES})
     _QT4_ADJUST_LIB_VARS(${QT_MODULE})
-  ENDFOREACH(QT_MODULE)
+  endforeach(QT_MODULE)
 
   _QT4_ADJUST_LIB_VARS(QtAssistant)
   _QT4_ADJUST_LIB_VARS(QtAssistantClient)
@@ -929,11 +929,11 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
   _QT4_ADJUST_LIB_VARS(QtDesignerComponents)
 
   # platform dependent libraries
-  IF(Q_WS_WIN)
+  if(Q_WS_WIN)
     _QT4_ADJUST_LIB_VARS(qtmain)
     _QT4_ADJUST_LIB_VARS(QAxServer)
     _QT4_ADJUST_LIB_VARS(QAxContainer)
-  ENDIF(Q_WS_WIN)
+  endif(Q_WS_WIN)
 
 
   #######################################
@@ -944,104 +944,104 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
   #######################################
 
 
-  IF(QT_QMAKE_CHANGED)
-    SET(QT_UIC_EXECUTABLE NOTFOUND)
-    SET(QT_MOC_EXECUTABLE NOTFOUND)
-    SET(QT_UIC3_EXECUTABLE NOTFOUND)
-    SET(QT_RCC_EXECUTABLE NOTFOUND)
-    SET(QT_DBUSCPP2XML_EXECUTABLE NOTFOUND)
-    SET(QT_DBUSXML2CPP_EXECUTABLE NOTFOUND)
-    SET(QT_LUPDATE_EXECUTABLE NOTFOUND)
-    SET(QT_LRELEASE_EXECUTABLE NOTFOUND)
-    SET(QT_QCOLLECTIONGENERATOR_EXECUTABLE NOTFOUND)
-    SET(QT_DESIGNER_EXECUTABLE NOTFOUND)
-    SET(QT_LINGUIST_EXECUTABLE NOTFOUND)
-  ENDIF(QT_QMAKE_CHANGED)
+  if(QT_QMAKE_CHANGED)
+    set(QT_UIC_EXECUTABLE NOTFOUND)
+    set(QT_MOC_EXECUTABLE NOTFOUND)
+    set(QT_UIC3_EXECUTABLE NOTFOUND)
+    set(QT_RCC_EXECUTABLE NOTFOUND)
+    set(QT_DBUSCPP2XML_EXECUTABLE NOTFOUND)
+    set(QT_DBUSXML2CPP_EXECUTABLE NOTFOUND)
+    set(QT_LUPDATE_EXECUTABLE NOTFOUND)
+    set(QT_LRELEASE_EXECUTABLE NOTFOUND)
+    set(QT_QCOLLECTIONGENERATOR_EXECUTABLE NOTFOUND)
+    set(QT_DESIGNER_EXECUTABLE NOTFOUND)
+    set(QT_LINGUIST_EXECUTABLE NOTFOUND)
+  endif(QT_QMAKE_CHANGED)
 
-  FIND_PROGRAM(QT_MOC_EXECUTABLE
+  find_program(QT_MOC_EXECUTABLE
     NAMES moc-qt4 moc
     PATHS ${QT_BINARY_DIR}
     NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
     )
 
-  FIND_PROGRAM(QT_UIC_EXECUTABLE
+  find_program(QT_UIC_EXECUTABLE
     NAMES uic-qt4 uic
     PATHS ${QT_BINARY_DIR}
     NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
     )
 
-  FIND_PROGRAM(QT_UIC3_EXECUTABLE
+  find_program(QT_UIC3_EXECUTABLE
     NAMES uic3
     PATHS ${QT_BINARY_DIR}
     NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
     )
 
-  FIND_PROGRAM(QT_RCC_EXECUTABLE
+  find_program(QT_RCC_EXECUTABLE
     NAMES rcc
     PATHS ${QT_BINARY_DIR}
     NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
     )
 
-  FIND_PROGRAM(QT_DBUSCPP2XML_EXECUTABLE
+  find_program(QT_DBUSCPP2XML_EXECUTABLE
     NAMES qdbuscpp2xml
     PATHS ${QT_BINARY_DIR}
     NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
     )
 
-  FIND_PROGRAM(QT_DBUSXML2CPP_EXECUTABLE
+  find_program(QT_DBUSXML2CPP_EXECUTABLE
     NAMES qdbusxml2cpp
     PATHS ${QT_BINARY_DIR}
     NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
     )
 
-  FIND_PROGRAM(QT_LUPDATE_EXECUTABLE
+  find_program(QT_LUPDATE_EXECUTABLE
     NAMES lupdate-qt4 lupdate
     PATHS ${QT_BINARY_DIR}
     NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
     )
 
-  FIND_PROGRAM(QT_LRELEASE_EXECUTABLE
+  find_program(QT_LRELEASE_EXECUTABLE
     NAMES lrelease-qt4 lrelease
     PATHS ${QT_BINARY_DIR}
     NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
     )
 
-  FIND_PROGRAM(QT_QCOLLECTIONGENERATOR_EXECUTABLE
+  find_program(QT_QCOLLECTIONGENERATOR_EXECUTABLE
     NAMES qcollectiongenerator-qt4 qcollectiongenerator
     PATHS ${QT_BINARY_DIR}
     NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
     )
 
-  FIND_PROGRAM(QT_DESIGNER_EXECUTABLE
+  find_program(QT_DESIGNER_EXECUTABLE
     NAMES designer-qt4 designer
     PATHS ${QT_BINARY_DIR}
     NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
     )
 
-  FIND_PROGRAM(QT_LINGUIST_EXECUTABLE
+  find_program(QT_LINGUIST_EXECUTABLE
     NAMES linguist-qt4 linguist
     PATHS ${QT_BINARY_DIR}
     NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
     )
 
-  IF (QT_MOC_EXECUTABLE)
-     SET(QT_WRAP_CPP "YES")
-  ENDIF (QT_MOC_EXECUTABLE)
+  if (QT_MOC_EXECUTABLE)
+     set(QT_WRAP_CPP "YES")
+  endif (QT_MOC_EXECUTABLE)
 
-  IF (QT_UIC_EXECUTABLE)
-     SET(QT_WRAP_UI "YES")
-  ENDIF (QT_UIC_EXECUTABLE)
+  if (QT_UIC_EXECUTABLE)
+     set(QT_WRAP_UI "YES")
+  endif (QT_UIC_EXECUTABLE)
 
 
 
-  MARK_AS_ADVANCED( QT_UIC_EXECUTABLE QT_UIC3_EXECUTABLE QT_MOC_EXECUTABLE
+  mark_as_advanced( QT_UIC_EXECUTABLE QT_UIC3_EXECUTABLE QT_MOC_EXECUTABLE
     QT_RCC_EXECUTABLE QT_DBUSXML2CPP_EXECUTABLE QT_DBUSCPP2XML_EXECUTABLE
     QT_LUPDATE_EXECUTABLE QT_LRELEASE_EXECUTABLE QT_QCOLLECTIONGENERATOR_EXECUTABLE
     QT_DESIGNER_EXECUTABLE QT_LINGUIST_EXECUTABLE)
 
 
   # get the directory of the current file, used later on in the file
-  GET_FILENAME_COMPONENT( _qt4_current_dir  "${CMAKE_CURRENT_LIST_FILE}" PATH)
+  get_filename_component( _qt4_current_dir  "${CMAKE_CURRENT_LIST_FILE}" PATH)
 
 
   ###############################################
@@ -1050,7 +1050,7 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
   #
   ###############################################
 
-  INCLUDE("${_qt4_current_dir}/Qt4ConfigDependentSettings.cmake")
+  include("${_qt4_current_dir}/Qt4ConfigDependentSettings.cmake")
 
 
   #######################################
@@ -1059,84 +1059,84 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
   #
   #######################################
 
-  SET( QT_PLUGIN_TYPES accessible bearer codecs decorations designer gfxdrivers graphicssystems iconengines imageformats inputmethods mousedrivers phonon_backend script sqldrivers )
+  set( QT_PLUGIN_TYPES accessible bearer codecs decorations designer gfxdrivers graphicssystems iconengines imageformats inputmethods mousedrivers phonon_backend script sqldrivers )
 
-  SET( QT_ACCESSIBLE_PLUGINS qtaccessiblecompatwidgets qtaccessiblewidgets )
-  SET( QT_BEARER_PLUGINS qcorewlanbearer qgenericbearer )
-  SET( QT_CODECS_PLUGINS qcncodecs qjpcodecs qkrcodecs qtwcodecs )
-  SET( QT_DECORATIONS_PLUGINS qdecorationdefault qdecorationwindows )
-  SET( QT_DESIGNER_PLUGINS arthurplugin containerextension customwidgetplugin phononwidgets qdeclarativeview qt3supportwidgets qwebview taskmenuextension worldtimeclockplugin )
-  SET( QT_GRAPHICSDRIVERS_PLUGINS qgfxtransformed qgfxvnc qscreenvfb )
-  SET( QT_GRAPHICSSYSTEMS_PLUGINS qglgraphicssystem qtracegraphicssystem )
-  SET( QT_ICONENGINES_PLUGINS qsvgicon )
-  SET( QT_IMAGEFORMATS_PLUGINS qgif qjpeg qmng qico qsvg qtiff  )
-  SET( QT_INPUTMETHODS_PLUGINS qimsw_multi )
-  SET( QT_MOUSEDRIVERS_PLUGINS qwstslibmousehandler )
-  IF(APPLE)
-    SET( QT_PHONON_BACKEND_PLUGINS phonon_qt7 )
-  ELSEIF(WIN32)
-    SET( QT_PHONON_BACKEND_PLUGINS phonon_ds9 )
-  ENDIF()
-  SET( QT_SCRIPT_PLUGINS qtscriptdbus )
-  SET( QT_SQLDRIVERS_PLUGINS qsqldb2 qsqlibase qsqlite qsqlite2 qsqlmysql qsqloci qsqlodbc qsqlpsql qsqltds )
+  set( QT_ACCESSIBLE_PLUGINS qtaccessiblecompatwidgets qtaccessiblewidgets )
+  set( QT_BEARER_PLUGINS qcorewlanbearer qgenericbearer )
+  set( QT_CODECS_PLUGINS qcncodecs qjpcodecs qkrcodecs qtwcodecs )
+  set( QT_DECORATIONS_PLUGINS qdecorationdefault qdecorationwindows )
+  set( QT_DESIGNER_PLUGINS arthurplugin containerextension customwidgetplugin phononwidgets qdeclarativeview qt3supportwidgets qwebview taskmenuextension worldtimeclockplugin )
+  set( QT_GRAPHICSDRIVERS_PLUGINS qgfxtransformed qgfxvnc qscreenvfb )
+  set( QT_GRAPHICSSYSTEMS_PLUGINS qglgraphicssystem qtracegraphicssystem )
+  set( QT_ICONENGINES_PLUGINS qsvgicon )
+  set( QT_IMAGEFORMATS_PLUGINS qgif qjpeg qmng qico qsvg qtiff  )
+  set( QT_INPUTMETHODS_PLUGINS qimsw_multi )
+  set( QT_MOUSEDRIVERS_PLUGINS qwstslibmousehandler )
+  if(APPLE)
+    set( QT_PHONON_BACKEND_PLUGINS phonon_qt7 )
+  elseif(WIN32)
+    set( QT_PHONON_BACKEND_PLUGINS phonon_ds9 )
+  endif()
+  set( QT_SCRIPT_PLUGINS qtscriptdbus )
+  set( QT_SQLDRIVERS_PLUGINS qsqldb2 qsqlibase qsqlite qsqlite2 qsqlmysql qsqloci qsqlodbc qsqlpsql qsqltds )
 
-  SET( QT_PHONON_PLUGINS ${QT_PHONON_BACKEND_PLUGINS} )
-  SET( QT_QT3SUPPORT_PLUGINS qtaccessiblecompatwidgets )
-  SET( QT_QTCORE_PLUGINS ${QT_BEARER_PLUGINS} ${QT_CODECS_PLUGINS} )
-  SET( QT_QTGUI_PLUGINS qtaccessiblewidgets qgif qjpeg qmng qico qtiff ${QT_DECORATIONS_PLUGINS} ${QT_GRAPHICSDRIVERS_PLUGINS} ${QT_GRAPHICSSYSTEMS_PLUGINS} ${QT_INPUTMETHODS_PLUGINS} ${QT_MOUSEDRIVERS_PLUGINS} )
-  SET( QT_QTSCRIPT_PLUGINS ${QT_SCRIPT_PLUGINS} )
-  SET( QT_QTSQL_PLUGINS ${QT_SQLDRIVERS_PLUGINS} )
-  SET( QT_QTSVG_PLUGINS qsvg qsvgicon )
+  set( QT_PHONON_PLUGINS ${QT_PHONON_BACKEND_PLUGINS} )
+  set( QT_QT3SUPPORT_PLUGINS qtaccessiblecompatwidgets )
+  set( QT_QTCORE_PLUGINS ${QT_BEARER_PLUGINS} ${QT_CODECS_PLUGINS} )
+  set( QT_QTGUI_PLUGINS qtaccessiblewidgets qgif qjpeg qmng qico qtiff ${QT_DECORATIONS_PLUGINS} ${QT_GRAPHICSDRIVERS_PLUGINS} ${QT_GRAPHICSSYSTEMS_PLUGINS} ${QT_INPUTMETHODS_PLUGINS} ${QT_MOUSEDRIVERS_PLUGINS} )
+  set( QT_QTSCRIPT_PLUGINS ${QT_SCRIPT_PLUGINS} )
+  set( QT_QTSQL_PLUGINS ${QT_SQLDRIVERS_PLUGINS} )
+  set( QT_QTSVG_PLUGINS qsvg qsvgicon )
 
-  IF(QT_QMAKE_CHANGED)
-    FOREACH(QT_PLUGIN_TYPE ${QT_PLUGIN_TYPES})
-      STRING(TOUPPER ${QT_PLUGIN_TYPE} _upper_qt_plugin_type)
-      SET(QT_${_upper_qt_plugin_type}_PLUGINS_DIR ${QT_PLUGINS_DIR}/${QT_PLUGIN_TYPE})
-      FOREACH(QT_PLUGIN ${QT_${_upper_qt_plugin_type}_PLUGINS})
-        STRING(TOUPPER ${QT_PLUGIN} _upper_qt_plugin)
-        UNSET(QT_${_upper_qt_plugin}_LIBRARY_RELEASE CACHE)
-        UNSET(QT_${_upper_qt_plugin}_LIBRARY_DEBUG CACHE)
-        UNSET(QT_${_upper_qt_plugin}_LIBRARY CACHE)
-        UNSET(QT_${_upper_qt_plugin}_PLUGIN_RELEASE CACHE)
-        UNSET(QT_${_upper_qt_plugin}_PLUGIN_DEBUG CACHE)
-        UNSET(QT_${_upper_qt_plugin}_PLUGIN CACHE)
-      ENDFOREACH(QT_PLUGIN)
-    ENDFOREACH(QT_PLUGIN_TYPE)
-  ENDIF(QT_QMAKE_CHANGED)
+  if(QT_QMAKE_CHANGED)
+    foreach(QT_PLUGIN_TYPE ${QT_PLUGIN_TYPES})
+      string(TOUPPER ${QT_PLUGIN_TYPE} _upper_qt_plugin_type)
+      set(QT_${_upper_qt_plugin_type}_PLUGINS_DIR ${QT_PLUGINS_DIR}/${QT_PLUGIN_TYPE})
+      foreach(QT_PLUGIN ${QT_${_upper_qt_plugin_type}_PLUGINS})
+        string(TOUPPER ${QT_PLUGIN} _upper_qt_plugin)
+        unset(QT_${_upper_qt_plugin}_LIBRARY_RELEASE CACHE)
+        unset(QT_${_upper_qt_plugin}_LIBRARY_DEBUG CACHE)
+        unset(QT_${_upper_qt_plugin}_LIBRARY CACHE)
+        unset(QT_${_upper_qt_plugin}_PLUGIN_RELEASE CACHE)
+        unset(QT_${_upper_qt_plugin}_PLUGIN_DEBUG CACHE)
+        unset(QT_${_upper_qt_plugin}_PLUGIN CACHE)
+      endforeach(QT_PLUGIN)
+    endforeach(QT_PLUGIN_TYPE)
+  endif(QT_QMAKE_CHANGED)
 
   # find_library works better than find_file but we need to set prefixes to only match plugins
-  FOREACH(QT_PLUGIN_TYPE ${QT_PLUGIN_TYPES})
-    STRING(TOUPPER ${QT_PLUGIN_TYPE} _upper_qt_plugin_type)
-    SET(QT_${_upper_qt_plugin_type}_PLUGINS_DIR ${QT_PLUGINS_DIR}/${QT_PLUGIN_TYPE})
-    FOREACH(QT_PLUGIN ${QT_${_upper_qt_plugin_type}_PLUGINS})
-      STRING(TOUPPER ${QT_PLUGIN} _upper_qt_plugin)
-      IF(QT_IS_STATIC)
-        FIND_LIBRARY(QT_${_upper_qt_plugin}_LIBRARY_RELEASE
+  foreach(QT_PLUGIN_TYPE ${QT_PLUGIN_TYPES})
+    string(TOUPPER ${QT_PLUGIN_TYPE} _upper_qt_plugin_type)
+    set(QT_${_upper_qt_plugin_type}_PLUGINS_DIR ${QT_PLUGINS_DIR}/${QT_PLUGIN_TYPE})
+    foreach(QT_PLUGIN ${QT_${_upper_qt_plugin_type}_PLUGINS})
+      string(TOUPPER ${QT_PLUGIN} _upper_qt_plugin)
+      if(QT_IS_STATIC)
+        find_library(QT_${_upper_qt_plugin}_LIBRARY_RELEASE
                      NAMES ${QT_PLUGIN}${QT_LIBINFIX} ${QT_PLUGIN}${QT_LIBINFIX}4
                      PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
             )
-        FIND_LIBRARY(QT_${_upper_qt_plugin}_LIBRARY_DEBUG
+        find_library(QT_${_upper_qt_plugin}_LIBRARY_DEBUG
                      NAMES ${QT_PLUGIN}${QT_LIBINFIX}_debug ${QT_PLUGIN}${QT_LIBINFIX}d ${QT_PLUGIN}${QT_LIBINFIX}d4
                      PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
             )
         _QT4_ADJUST_LIB_VARS(${QT_PLUGIN})
-      ELSE(QT_IS_STATIC)
+      else(QT_IS_STATIC)
         # find_library works easier/better than find_file but we need to set suffixes to only match plugins
-        SET(CMAKE_FIND_LIBRARY_SUFFIXES_DEFAULT ${CMAKE_FIND_LIBRARY_SUFFIXES})
-        SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_MODULE_SUFFIX} ${CMAKE_SHARED_LIBRARY_SUFFIX})
-        FIND_LIBRARY(QT_${_upper_qt_plugin}_PLUGIN_RELEASE
+        set(CMAKE_FIND_LIBRARY_SUFFIXES_DEFAULT ${CMAKE_FIND_LIBRARY_SUFFIXES})
+        set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_MODULE_SUFFIX} ${CMAKE_SHARED_LIBRARY_SUFFIX})
+        find_library(QT_${_upper_qt_plugin}_PLUGIN_RELEASE
                      NAMES ${QT_PLUGIN}${QT_LIBINFIX} ${QT_PLUGIN}${QT_LIBINFIX}4
                      PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
             )
-        FIND_LIBRARY(QT_${_upper_qt_plugin}_PLUGIN_DEBUG
+        find_library(QT_${_upper_qt_plugin}_PLUGIN_DEBUG
                      NAMES ${QT_PLUGIN}${QT_LIBINFIX}_debug ${QT_PLUGIN}${QT_LIBINFIX}d ${QT_PLUGIN}${QT_LIBINFIX}d4
                      PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
             )
-        MARK_AS_ADVANCED(QT_${_upper_qt_plugin}_PLUGIN_RELEASE QT_${_upper_qt_plugin}_PLUGIN_DEBUG)
-        SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_DEFAULT})
-      ENDIF(QT_IS_STATIC)
-    ENDFOREACH(QT_PLUGIN)
-  ENDFOREACH(QT_PLUGIN_TYPE)
+        mark_as_advanced(QT_${_upper_qt_plugin}_PLUGIN_RELEASE QT_${_upper_qt_plugin}_PLUGIN_DEBUG)
+        set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_DEFAULT})
+      endif(QT_IS_STATIC)
+    endforeach(QT_PLUGIN)
+  endforeach(QT_PLUGIN_TYPE)
 
 
   ######################################
@@ -1145,57 +1145,57 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
   #
   ######################################
 
-  INCLUDE("${_qt4_current_dir}/Qt4Macros.cmake")
+  include("${_qt4_current_dir}/Qt4Macros.cmake")
 
   # set version variables
-  STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" QT_VERSION_MAJOR "${QTVERSION}")
-  STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" QT_VERSION_MINOR "${QTVERSION}")
-  STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" QT_VERSION_PATCH "${QTVERSION}")
+  string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" QT_VERSION_MAJOR "${QTVERSION}")
+  string(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" QT_VERSION_MINOR "${QTVERSION}")
+  string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" QT_VERSION_PATCH "${QTVERSION}")
 
-ENDIF(QT_QMAKE_EXECUTABLE AND QTVERSION)
+endif(QT_QMAKE_EXECUTABLE AND QTVERSION)
 
 #support old QT_MIN_VERSION if set, but not if version is supplied by find_package()
-IF(NOT Qt4_FIND_VERSION AND QT_MIN_VERSION)
-  SET(Qt4_FIND_VERSION ${QT_MIN_VERSION})
-ENDIF(NOT Qt4_FIND_VERSION AND QT_MIN_VERSION)
+if(NOT Qt4_FIND_VERSION AND QT_MIN_VERSION)
+  set(Qt4_FIND_VERSION ${QT_MIN_VERSION})
+endif(NOT Qt4_FIND_VERSION AND QT_MIN_VERSION)
 
-IF( Qt4_FIND_COMPONENTS )
+if( Qt4_FIND_COMPONENTS )
 
   # if components specified in find_package(), make sure each of those pieces were found
-  SET(_QT4_FOUND_REQUIRED_VARS QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_INCLUDE_DIR QT_LIBRARY_DIR)
-  FOREACH( component ${Qt4_FIND_COMPONENTS} )
-    STRING( TOUPPER ${component} _COMPONENT )
+  set(_QT4_FOUND_REQUIRED_VARS QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_INCLUDE_DIR QT_LIBRARY_DIR)
+  foreach( component ${Qt4_FIND_COMPONENTS} )
+    string( TOUPPER ${component} _COMPONENT )
     if(${_COMPONENT} STREQUAL "QTMAIN")
-      IF(Q_WS_WIN)
-        SET(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_${_COMPONENT}_LIBRARY)
-      ENDIF(Q_WS_WIN)
+      if(Q_WS_WIN)
+        set(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_${_COMPONENT}_LIBRARY)
+      endif(Q_WS_WIN)
     else(${_COMPONENT} STREQUAL "QTMAIN")
-      SET(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_${_COMPONENT}_INCLUDE_DIR QT_${_COMPONENT}_LIBRARY)
+      set(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_${_COMPONENT}_INCLUDE_DIR QT_${_COMPONENT}_LIBRARY)
     endif(${_COMPONENT} STREQUAL "QTMAIN")
-  ENDFOREACH( component )
+  endforeach( component )
 
   if(Qt4_FIND_COMPONENTS MATCHES QtGui)
-    SET(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_UIC_EXECUTABLE)
+    set(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_UIC_EXECUTABLE)
   endif(Qt4_FIND_COMPONENTS MATCHES QtGui)
 
-ELSE( Qt4_FIND_COMPONENTS )
+else( Qt4_FIND_COMPONENTS )
 
   # if no components specified, we'll make a default set of required variables to say Qt is found
-  SET(_QT4_FOUND_REQUIRED_VARS QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_UIC_EXECUTABLE QT_INCLUDE_DIR
+  set(_QT4_FOUND_REQUIRED_VARS QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_UIC_EXECUTABLE QT_INCLUDE_DIR
     QT_LIBRARY_DIR QT_QTCORE_LIBRARY)
 
-ENDIF( Qt4_FIND_COMPONENTS )
+endif( Qt4_FIND_COMPONENTS )
 
 if (QT_VERSION_MAJOR GREATER 4)
-    SET(VERSION_MSG "Found unsuitable Qt version \"${QTVERSION}\" from ${QT_QMAKE_EXECUTABLE}")
-    SET(QT4_FOUND FALSE)
-    IF(Qt4_FIND_REQUIRED)
-       MESSAGE( FATAL_ERROR "${VERSION_MSG}, this code requires Qt 4.x")
-    ELSE(Qt4_FIND_REQUIRED)
-      IF(NOT Qt4_FIND_QUIETLY)
-         MESSAGE( STATUS    "${VERSION_MSG}")
-      ENDIF(NOT Qt4_FIND_QUIETLY)
-    ENDIF(Qt4_FIND_REQUIRED)
+    set(VERSION_MSG "Found unsuitable Qt version \"${QTVERSION}\" from ${QT_QMAKE_EXECUTABLE}")
+    set(QT4_FOUND FALSE)
+    if(Qt4_FIND_REQUIRED)
+       message( FATAL_ERROR "${VERSION_MSG}, this code requires Qt 4.x")
+    else(Qt4_FIND_REQUIRED)
+      if(NOT Qt4_FIND_QUIETLY)
+         message( STATUS    "${VERSION_MSG}")
+      endif(NOT Qt4_FIND_QUIETLY)
+    endif(Qt4_FIND_REQUIRED)
 else()
   FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt4
     REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS}
@@ -1209,8 +1209,8 @@ endif()
 #
 #######################################
 # Backwards compatibility for CMake1.4 and 1.2
-SET (QT_MOC_EXE ${QT_MOC_EXECUTABLE} )
-SET (QT_UIC_EXE ${QT_UIC_EXECUTABLE} )
-SET( QT_QT_LIBRARY "")
-SET(QT_FOUND ${QT4_FOUND})
+set (QT_MOC_EXE ${QT_MOC_EXECUTABLE} )
+set (QT_UIC_EXE ${QT_UIC_EXECUTABLE} )
+set( QT_QT_LIBRARY "")
+set(QT_FOUND ${QT4_FOUND})
 
diff --git a/Modules/FindQuickTime.cmake b/Modules/FindQuickTime.cmake
index ccbcb3187..518f42323 100644
--- a/Modules/FindQuickTime.cmake
+++ b/Modules/FindQuickTime.cmake
@@ -25,23 +25,23 @@
 # QuickTime on OS X looks different than QuickTime for Windows,
 # so I am going to case the two.
 
-IF(APPLE)
-  FIND_PATH(QUICKTIME_INCLUDE_DIR QuickTime/QuickTime.h)
-  FIND_LIBRARY(QUICKTIME_LIBRARY QuickTime)
-ELSE(APPLE)
-  FIND_PATH(QUICKTIME_INCLUDE_DIR QuickTime.h
+if(APPLE)
+  find_path(QUICKTIME_INCLUDE_DIR QuickTime/QuickTime.h)
+  find_library(QUICKTIME_LIBRARY QuickTime)
+else(APPLE)
+  find_path(QUICKTIME_INCLUDE_DIR QuickTime.h
     HINTS
     $ENV{QUICKTIME_DIR}/include
     $ENV{QUICKTIME_DIR}
   )
-  FIND_LIBRARY(QUICKTIME_LIBRARY QuickTime
+  find_library(QUICKTIME_LIBRARY QuickTime
     HINTS
     $ENV{QUICKTIME_DIR}/lib
     $ENV{QUICKTIME_DIR}
   )
-ENDIF(APPLE)
+endif(APPLE)
 
 # handle the QUIETLY and REQUIRED arguments and set QUICKTIME_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(QuickTime DEFAULT_MSG QUICKTIME_LIBRARY QUICKTIME_INCLUDE_DIR)
diff --git a/Modules/FindRTI.cmake b/Modules/FindRTI.cmake
index 031c13854..e806e03ba 100644
--- a/Modules/FindRTI.cmake
+++ b/Modules/FindRTI.cmake
@@ -29,73 +29,73 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-MACRO(RTI_MESSAGE_QUIETLY QUIET TYPE MSG)
-  IF(NOT ${QUIET})
-    MESSAGE(${TYPE} "${MSG}")
-  ENDIF(NOT ${QUIET})
-ENDMACRO(RTI_MESSAGE_QUIETLY QUIET TYPE MSG)
+macro(RTI_MESSAGE_QUIETLY QUIET TYPE MSG)
+  if(NOT ${QUIET})
+    message(${TYPE} "${MSG}")
+  endif(NOT ${QUIET})
+endmacro(RTI_MESSAGE_QUIETLY QUIET TYPE MSG)
 
 # Detect the CERTI installation, http://www.cert.fr/CERTI
-IF ("$ENV{CERTI_HOME}" STRGREATER "")
-  FILE(TO_CMAKE_PATH "$ENV{CERTI_HOME}" CERTI_HOME)
+if ("$ENV{CERTI_HOME}" STRGREATER "")
+  file(TO_CMAKE_PATH "$ENV{CERTI_HOME}" CERTI_HOME)
   RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "Using environment defined CERTI_HOME: ${CERTI_HOME}")
-ENDIF ("$ENV{CERTI_HOME}" STRGREATER "")
+endif ("$ENV{CERTI_HOME}" STRGREATER "")
 
-SET(RTI_DEFINITIONS "-DRTI_USES_STD_FSTREAM")
+set(RTI_DEFINITIONS "-DRTI_USES_STD_FSTREAM")
 
 # Detect the MAK Technologies RTI installation, http://www.mak.com/products/rti.php
 # note: the following list is ordered to find the most recent version first
-SET(RTI_POSSIBLE_DIRS
+set(RTI_POSSIBLE_DIRS
   ${CERTI_HOME}
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MAK Technologies\\MAK RTI 3.2 MSVC++ 8.0;Location]"
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MAK RTI 3.2-win32-msvc++8.0;InstallLocation]"
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MAK Technologies\\MAK RTI 2.2;Location]"
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MAK RTI 2.2;InstallLocation]")
 
-SET(RTI_OLD_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}")
+set(RTI_OLD_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}")
 # The MAK RTI has the "lib" prefix even on Windows.
-SET(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
+set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
 
-FIND_LIBRARY(RTI_LIBRARY
+find_library(RTI_LIBRARY
   NAMES RTI RTI-NG
   PATHS ${RTI_POSSIBLE_DIRS}
   PATH_SUFFIXES lib
   DOC "The RTI Library")
 
-IF (RTI_LIBRARY)
-  SET(RTI_LIBRARIES ${RTI_LIBRARY})
+if (RTI_LIBRARY)
+  set(RTI_LIBRARIES ${RTI_LIBRARY})
   RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI library found: ${RTI_LIBRARY}")
-ELSE (RTI_LIBRARY)
+else (RTI_LIBRARY)
   RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI library NOT found")
-ENDIF (RTI_LIBRARY)
+endif (RTI_LIBRARY)
 
-FIND_LIBRARY(RTI_FEDTIME_LIBRARY
+find_library(RTI_FEDTIME_LIBRARY
   NAMES FedTime
   PATHS ${RTI_POSSIBLE_DIRS}
   PATH_SUFFIXES lib
   DOC "The FedTime Library")
 
-IF (RTI_FEDTIME_LIBRARY)
-  SET(RTI_LIBRARIES ${RTI_LIBRARIES} ${RTI_FEDTIME_LIBRARY})
+if (RTI_FEDTIME_LIBRARY)
+  set(RTI_LIBRARIES ${RTI_LIBRARIES} ${RTI_FEDTIME_LIBRARY})
   RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI FedTime found: ${RTI_FEDTIME_LIBRARY}")
-ENDIF (RTI_FEDTIME_LIBRARY)
+endif (RTI_FEDTIME_LIBRARY)
 
-FIND_PATH(RTI_INCLUDE_DIR
+find_path(RTI_INCLUDE_DIR
   NAMES RTI.hh
   PATHS ${RTI_POSSIBLE_DIRS}
   PATH_SUFFIXES include
   DOC "The RTI Include Files")
 
-IF (RTI_INCLUDE_DIR)
+if (RTI_INCLUDE_DIR)
   RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI headers found: ${RTI_INCLUDE_DIR}")
-ELSE (RTI_INCLUDE_DIR)
+else (RTI_INCLUDE_DIR)
   RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI headers NOT found")
-ENDIF (RTI_INCLUDE_DIR)
+endif (RTI_INCLUDE_DIR)
 
 # Set the modified system variables back to the original value.
-SET(CMAKE_FIND_LIBRARY_PREFIXES "${RTI_OLD_FIND_LIBRARY_PREFIXES}")
+set(CMAKE_FIND_LIBRARY_PREFIXES "${RTI_OLD_FIND_LIBRARY_PREFIXES}")
 
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(RTI DEFAULT_MSG
   RTI_LIBRARY RTI_INCLUDE_DIR)
 
diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake
index 5e973e485..b4a306a07 100644
--- a/Modules/FindRuby.cmake
+++ b/Modules/FindRuby.cmake
@@ -3,7 +3,7 @@
 # and libraries are. Ruby 1.8 and 1.9 are supported.
 #
 # The minimum required version of Ruby can be specified using the
-# standard syntax, e.g. FIND_PACKAGE(Ruby 1.8)
+# standard syntax, e.g. find_package(Ruby 1.8)
 #
 # It also determines what the name of the library is. This
 # code sets the following variables:
@@ -37,43 +37,43 @@
 #   RUBY_LIBRUBYARG=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"LIBRUBYARG_SHARED"@:>@)'`
 
 # uncomment the following line to get debug output for this file
-# SET(_RUBY_DEBUG_OUTPUT TRUE)
+# set(_RUBY_DEBUG_OUTPUT TRUE)
 
 # Determine the list of possible names of the ruby executable depending
 # on which version of ruby is required
-SET(_RUBY_POSSIBLE_EXECUTABLE_NAMES ruby)
+set(_RUBY_POSSIBLE_EXECUTABLE_NAMES ruby)
 
 # if 1.9 is required, don't look for ruby18 and ruby1.8, default to version 1.8
-IF(Ruby_FIND_VERSION_MAJOR  AND  Ruby_FIND_VERSION_MINOR)
-   SET(Ruby_FIND_VERSION_SHORT_NODOT "${Ruby_FIND_VERSION_MAJOR}${RUBY_FIND_VERSION_MINOR}")
-ELSE(Ruby_FIND_VERSION_MAJOR  AND  Ruby_FIND_VERSION_MINOR)
-   SET(Ruby_FIND_VERSION_SHORT_NODOT "18")
-ENDIF(Ruby_FIND_VERSION_MAJOR  AND  Ruby_FIND_VERSION_MINOR)
+if(Ruby_FIND_VERSION_MAJOR  AND  Ruby_FIND_VERSION_MINOR)
+   set(Ruby_FIND_VERSION_SHORT_NODOT "${Ruby_FIND_VERSION_MAJOR}${RUBY_FIND_VERSION_MINOR}")
+else(Ruby_FIND_VERSION_MAJOR  AND  Ruby_FIND_VERSION_MINOR)
+   set(Ruby_FIND_VERSION_SHORT_NODOT "18")
+endif(Ruby_FIND_VERSION_MAJOR  AND  Ruby_FIND_VERSION_MINOR)
 
-SET(_RUBY_POSSIBLE_EXECUTABLE_NAMES ${_RUBY_POSSIBLE_EXECUTABLE_NAMES} ruby1.9 ruby19)
+set(_RUBY_POSSIBLE_EXECUTABLE_NAMES ${_RUBY_POSSIBLE_EXECUTABLE_NAMES} ruby1.9 ruby19)
 
 # if we want a version below 1.9, also look for ruby 1.8
-IF("${Ruby_FIND_VERSION_SHORT_NODOT}" VERSION_LESS "19")
-   SET(_RUBY_POSSIBLE_EXECUTABLE_NAMES ${_RUBY_POSSIBLE_EXECUTABLE_NAMES} ruby1.8 ruby18)
-ENDIF("${Ruby_FIND_VERSION_SHORT_NODOT}" VERSION_LESS "19")
+if("${Ruby_FIND_VERSION_SHORT_NODOT}" VERSION_LESS "19")
+   set(_RUBY_POSSIBLE_EXECUTABLE_NAMES ${_RUBY_POSSIBLE_EXECUTABLE_NAMES} ruby1.8 ruby18)
+endif("${Ruby_FIND_VERSION_SHORT_NODOT}" VERSION_LESS "19")
 
-FIND_PROGRAM(RUBY_EXECUTABLE NAMES ${_RUBY_POSSIBLE_EXECUTABLE_NAMES})
+find_program(RUBY_EXECUTABLE NAMES ${_RUBY_POSSIBLE_EXECUTABLE_NAMES})
 
 
-IF(RUBY_EXECUTABLE  AND NOT  RUBY_VERSION_MAJOR)
-  FUNCTION(_RUBY_CONFIG_VAR RBVAR OUTVAR)
-    EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['${RBVAR}']"
+if(RUBY_EXECUTABLE  AND NOT  RUBY_VERSION_MAJOR)
+  function(_RUBY_CONFIG_VAR RBVAR OUTVAR)
+    execute_process(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['${RBVAR}']"
       RESULT_VARIABLE _RUBY_SUCCESS
       OUTPUT_VARIABLE _RUBY_OUTPUT
       ERROR_QUIET)
-    IF(_RUBY_SUCCESS OR NOT _RUBY_OUTPUT)
-      EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['${RBVAR}']"
+    if(_RUBY_SUCCESS OR NOT _RUBY_OUTPUT)
+      execute_process(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['${RBVAR}']"
         RESULT_VARIABLE _RUBY_SUCCESS
         OUTPUT_VARIABLE _RUBY_OUTPUT
         ERROR_QUIET)
-    ENDIF(_RUBY_SUCCESS OR NOT _RUBY_OUTPUT)
-    SET(${OUTVAR} "${_RUBY_OUTPUT}" PARENT_SCOPE)
-  ENDFUNCTION(_RUBY_CONFIG_VAR)
+    endif(_RUBY_SUCCESS OR NOT _RUBY_OUTPUT)
+    set(${OUTVAR} "${_RUBY_OUTPUT}" PARENT_SCOPE)
+  endfunction(_RUBY_CONFIG_VAR)
 
 
   # query the ruby version
@@ -93,29 +93,29 @@ IF(RUBY_EXECUTABLE  AND NOT  RUBY_VERSION_MAJOR)
    _RUBY_CONFIG_VAR("sitelibdir" RUBY_SITELIB_DIR)
 
    # vendor_ruby available ?
-   EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r vendor-specific -e "print 'true'"
+   execute_process(COMMAND ${RUBY_EXECUTABLE} -r vendor-specific -e "print 'true'"
       OUTPUT_VARIABLE RUBY_HAS_VENDOR_RUBY  ERROR_QUIET)
 
-   IF(RUBY_HAS_VENDOR_RUBY)
+   if(RUBY_HAS_VENDOR_RUBY)
       _RUBY_CONFIG_VAR("vendorlibdir" RUBY_VENDORLIB_DIR)
       _RUBY_CONFIG_VAR("vendorarchdir" RUBY_VENDORARCH_DIR)
-   ENDIF(RUBY_HAS_VENDOR_RUBY)
+   endif(RUBY_HAS_VENDOR_RUBY)
 
    # save the results in the cache so we don't have to run ruby the next time again
-   SET(RUBY_VERSION_MAJOR    ${RUBY_VERSION_MAJOR}    CACHE PATH "The Ruby major version" FORCE)
-   SET(RUBY_VERSION_MINOR    ${RUBY_VERSION_MINOR}    CACHE PATH "The Ruby minor version" FORCE)
-   SET(RUBY_VERSION_PATCH    ${RUBY_VERSION_PATCH}    CACHE PATH "The Ruby patch version" FORCE)
-   SET(RUBY_ARCH_DIR         ${RUBY_ARCH_DIR}         CACHE PATH "The Ruby arch dir" FORCE)
-   SET(RUBY_HDR_DIR          ${RUBY_HDR_DIR}          CACHE PATH "The Ruby header dir (1.9)" FORCE)
-   SET(RUBY_POSSIBLE_LIB_DIR ${RUBY_POSSIBLE_LIB_DIR} CACHE PATH "The Ruby lib dir" FORCE)
-   SET(RUBY_RUBY_LIB_DIR     ${RUBY_RUBY_LIB_DIR}     CACHE PATH "The Ruby ruby-lib dir" FORCE)
-   SET(RUBY_SITEARCH_DIR     ${RUBY_SITEARCH_DIR}     CACHE PATH "The Ruby site arch dir" FORCE)
-   SET(RUBY_SITELIB_DIR      ${RUBY_SITELIB_DIR}      CACHE PATH "The Ruby site lib dir" FORCE)
-   SET(RUBY_HAS_VENDOR_RUBY  ${RUBY_HAS_VENDOR_RUBY}  CACHE BOOL "Vendor Ruby is available" FORCE)
-   SET(RUBY_VENDORARCH_DIR   ${RUBY_VENDORARCH_DIR}   CACHE PATH "The Ruby vendor arch dir" FORCE)
-   SET(RUBY_VENDORLIB_DIR    ${RUBY_VENDORLIB_DIR}    CACHE PATH "The Ruby vendor lib dir" FORCE)
+   set(RUBY_VERSION_MAJOR    ${RUBY_VERSION_MAJOR}    CACHE PATH "The Ruby major version" FORCE)
+   set(RUBY_VERSION_MINOR    ${RUBY_VERSION_MINOR}    CACHE PATH "The Ruby minor version" FORCE)
+   set(RUBY_VERSION_PATCH    ${RUBY_VERSION_PATCH}    CACHE PATH "The Ruby patch version" FORCE)
+   set(RUBY_ARCH_DIR         ${RUBY_ARCH_DIR}         CACHE PATH "The Ruby arch dir" FORCE)
+   set(RUBY_HDR_DIR          ${RUBY_HDR_DIR}          CACHE PATH "The Ruby header dir (1.9)" FORCE)
+   set(RUBY_POSSIBLE_LIB_DIR ${RUBY_POSSIBLE_LIB_DIR} CACHE PATH "The Ruby lib dir" FORCE)
+   set(RUBY_RUBY_LIB_DIR     ${RUBY_RUBY_LIB_DIR}     CACHE PATH "The Ruby ruby-lib dir" FORCE)
+   set(RUBY_SITEARCH_DIR     ${RUBY_SITEARCH_DIR}     CACHE PATH "The Ruby site arch dir" FORCE)
+   set(RUBY_SITELIB_DIR      ${RUBY_SITELIB_DIR}      CACHE PATH "The Ruby site lib dir" FORCE)
+   set(RUBY_HAS_VENDOR_RUBY  ${RUBY_HAS_VENDOR_RUBY}  CACHE BOOL "Vendor Ruby is available" FORCE)
+   set(RUBY_VENDORARCH_DIR   ${RUBY_VENDORARCH_DIR}   CACHE PATH "The Ruby vendor arch dir" FORCE)
+   set(RUBY_VENDORLIB_DIR    ${RUBY_VENDORLIB_DIR}    CACHE PATH "The Ruby vendor lib dir" FORCE)
 
-   MARK_AS_ADVANCED(
+   mark_as_advanced(
      RUBY_ARCH_DIR
      RUBY_ARCH
      RUBY_HDR_DIR
@@ -130,107 +130,107 @@ IF(RUBY_EXECUTABLE  AND NOT  RUBY_VERSION_MAJOR)
      RUBY_VERSION_MINOR
      RUBY_VERSION_PATCH
      )
-ENDIF(RUBY_EXECUTABLE  AND NOT  RUBY_VERSION_MAJOR)
+endif(RUBY_EXECUTABLE  AND NOT  RUBY_VERSION_MAJOR)
 
 # In case RUBY_EXECUTABLE could not be executed (e.g. cross compiling)
 # try to detect which version we found. This is not too good.
-IF(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR)
+if(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR)
    # by default assume 1.8.0
-   SET(RUBY_VERSION_MAJOR 1)
-   SET(RUBY_VERSION_MINOR 8)
-   SET(RUBY_VERSION_PATCH 0)
+   set(RUBY_VERSION_MAJOR 1)
+   set(RUBY_VERSION_MINOR 8)
+   set(RUBY_VERSION_PATCH 0)
    # check whether we found 1.9.x
-   IF(${RUBY_EXECUTABLE} MATCHES "ruby1.?9"  OR  RUBY_HDR_DIR)
-      SET(RUBY_VERSION_MAJOR 1)
-      SET(RUBY_VERSION_MINOR 9)
-   ENDIF(${RUBY_EXECUTABLE} MATCHES "ruby1.?9"  OR  RUBY_HDR_DIR)
-ENDIF(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR)
+   if(${RUBY_EXECUTABLE} MATCHES "ruby1.?9"  OR  RUBY_HDR_DIR)
+      set(RUBY_VERSION_MAJOR 1)
+      set(RUBY_VERSION_MINOR 9)
+   endif(${RUBY_EXECUTABLE} MATCHES "ruby1.?9"  OR  RUBY_HDR_DIR)
+endif(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR)
 
-IF(RUBY_VERSION_MAJOR)
-   SET(RUBY_VERSION "${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}.${RUBY_VERSION_PATCH}")
-   SET(_RUBY_VERSION_SHORT "${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}")
-   SET(_RUBY_VERSION_SHORT_NODOT "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}")
-   SET(_RUBY_NODOT_VERSION "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}${RUBY_VERSION_PATCH}")
-ENDIF(RUBY_VERSION_MAJOR)
+if(RUBY_VERSION_MAJOR)
+   set(RUBY_VERSION "${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}.${RUBY_VERSION_PATCH}")
+   set(_RUBY_VERSION_SHORT "${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}")
+   set(_RUBY_VERSION_SHORT_NODOT "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}")
+   set(_RUBY_NODOT_VERSION "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}${RUBY_VERSION_PATCH}")
+endif(RUBY_VERSION_MAJOR)
 
-FIND_PATH(RUBY_INCLUDE_DIR
+find_path(RUBY_INCLUDE_DIR
    NAMES ruby.h
    HINTS
    ${RUBY_HDR_DIR}
    ${RUBY_ARCH_DIR}
    /usr/lib/ruby/${_RUBY_VERSION_SHORT}/i586-linux-gnu/ )
 
-SET(RUBY_INCLUDE_DIRS ${RUBY_INCLUDE_DIR} )
+set(RUBY_INCLUDE_DIRS ${RUBY_INCLUDE_DIR} )
 
 # if ruby > 1.8 is required or if ruby > 1.8 was found, search for the config.h dir
-IF( "${Ruby_FIND_VERSION_SHORT_NODOT}" GREATER 18  OR  "${_RUBY_VERSION_SHORT_NODOT}" GREATER 18  OR  RUBY_HDR_DIR)
-   FIND_PATH(RUBY_CONFIG_INCLUDE_DIR
+if( "${Ruby_FIND_VERSION_SHORT_NODOT}" GREATER 18  OR  "${_RUBY_VERSION_SHORT_NODOT}" GREATER 18  OR  RUBY_HDR_DIR)
+   find_path(RUBY_CONFIG_INCLUDE_DIR
      NAMES ruby/config.h  config.h
      HINTS
      ${RUBY_HDR_DIR}/${RUBY_ARCH}
      ${RUBY_ARCH_DIR}
      )
 
-   SET(RUBY_INCLUDE_DIRS ${RUBY_INCLUDE_DIRS} ${RUBY_CONFIG_INCLUDE_DIR} )
-ENDIF( "${Ruby_FIND_VERSION_SHORT_NODOT}" GREATER 18  OR  "${_RUBY_VERSION_SHORT_NODOT}" GREATER 18  OR  RUBY_HDR_DIR)
+   set(RUBY_INCLUDE_DIRS ${RUBY_INCLUDE_DIRS} ${RUBY_CONFIG_INCLUDE_DIR} )
+endif( "${Ruby_FIND_VERSION_SHORT_NODOT}" GREATER 18  OR  "${_RUBY_VERSION_SHORT_NODOT}" GREATER 18  OR  RUBY_HDR_DIR)
 
 
 # Determine the list of possible names for the ruby library
-SET(_RUBY_POSSIBLE_LIB_NAMES ruby ruby-static ruby${_RUBY_VERSION_SHORT} ruby${_RUBY_VERSION_SHORT_NODOT} ruby-${_RUBY_VERSION_SHORT} ruby-${RUBY_VERSION})
+set(_RUBY_POSSIBLE_LIB_NAMES ruby ruby-static ruby${_RUBY_VERSION_SHORT} ruby${_RUBY_VERSION_SHORT_NODOT} ruby-${_RUBY_VERSION_SHORT} ruby-${RUBY_VERSION})
 
-IF(WIN32)
-   SET( _RUBY_MSVC_RUNTIME "" )
-   IF( MSVC60 )
-     SET( _RUBY_MSVC_RUNTIME "60" )
-   ENDIF( MSVC60 )
-   IF( MSVC70 )
-     SET( _RUBY_MSVC_RUNTIME "70" )
-   ENDIF( MSVC70 )
-   IF( MSVC71 )
-     SET( _RUBY_MSVC_RUNTIME "71" )
-   ENDIF( MSVC71 )
-   IF( MSVC80 )
-     SET( _RUBY_MSVC_RUNTIME "80" )
-   ENDIF( MSVC80 )
-   IF( MSVC90 )
-     SET( _RUBY_MSVC_RUNTIME "90" )
-   ENDIF( MSVC90 )
+if(WIN32)
+   set( _RUBY_MSVC_RUNTIME "" )
+   if( MSVC60 )
+     set( _RUBY_MSVC_RUNTIME "60" )
+   endif( MSVC60 )
+   if( MSVC70 )
+     set( _RUBY_MSVC_RUNTIME "70" )
+   endif( MSVC70 )
+   if( MSVC71 )
+     set( _RUBY_MSVC_RUNTIME "71" )
+   endif( MSVC71 )
+   if( MSVC80 )
+     set( _RUBY_MSVC_RUNTIME "80" )
+   endif( MSVC80 )
+   if( MSVC90 )
+     set( _RUBY_MSVC_RUNTIME "90" )
+   endif( MSVC90 )
 
-   LIST(APPEND _RUBY_POSSIBLE_LIB_NAMES
+   list(APPEND _RUBY_POSSIBLE_LIB_NAMES
                "msvcr${_RUBY_MSVC_RUNTIME}-ruby${_RUBY_NODOT_VERSION}"
                "msvcr${_RUBY_MSVC_RUNTIME}-ruby${_RUBY_NODOT_VERSION}-static"
                "msvcrt-ruby${_RUBY_NODOT_VERSION}"
                "msvcrt-ruby${_RUBY_NODOT_VERSION}-static" )
-ENDIF(WIN32)
+endif(WIN32)
 
-FIND_LIBRARY(RUBY_LIBRARY NAMES ${_RUBY_POSSIBLE_LIB_NAMES} HINTS ${RUBY_POSSIBLE_LIB_DIR} )
+find_library(RUBY_LIBRARY NAMES ${_RUBY_POSSIBLE_LIB_NAMES} HINTS ${RUBY_POSSIBLE_LIB_DIR} )
 
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-SET(_RUBY_REQUIRED_VARS RUBY_EXECUTABLE RUBY_INCLUDE_DIR RUBY_LIBRARY)
-IF(_RUBY_VERSION_SHORT_NODOT GREATER 18)
-   LIST(APPEND _RUBY_REQUIRED_VARS RUBY_CONFIG_INCLUDE_DIR)
-ENDIF(_RUBY_VERSION_SHORT_NODOT GREATER 18)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+set(_RUBY_REQUIRED_VARS RUBY_EXECUTABLE RUBY_INCLUDE_DIR RUBY_LIBRARY)
+if(_RUBY_VERSION_SHORT_NODOT GREATER 18)
+   list(APPEND _RUBY_REQUIRED_VARS RUBY_CONFIG_INCLUDE_DIR)
+endif(_RUBY_VERSION_SHORT_NODOT GREATER 18)
 
-IF(_RUBY_DEBUG_OUTPUT)
-   MESSAGE(STATUS "--------FindRuby.cmake debug------------")
-   MESSAGE(STATUS "_RUBY_POSSIBLE_EXECUTABLE_NAMES: ${_RUBY_POSSIBLE_EXECUTABLE_NAMES}")
-   MESSAGE(STATUS "_RUBY_POSSIBLE_LIB_NAMES: ${_RUBY_POSSIBLE_LIB_NAMES}")
-   MESSAGE(STATUS "RUBY_ARCH_DIR: ${RUBY_ARCH_DIR}")
-   MESSAGE(STATUS "RUBY_HDR_DIR: ${RUBY_HDR_DIR}")
-   MESSAGE(STATUS "RUBY_POSSIBLE_LIB_DIR: ${RUBY_POSSIBLE_LIB_DIR}")
-   MESSAGE(STATUS "Found RUBY_VERSION: \"${RUBY_VERSION}\" , short: \"${_RUBY_VERSION_SHORT}\", nodot: \"${_RUBY_VERSION_SHORT_NODOT}\"")
-   MESSAGE(STATUS "_RUBY_REQUIRED_VARS: ${_RUBY_REQUIRED_VARS}")
-   MESSAGE(STATUS "RUBY_EXECUTABLE: ${RUBY_EXECUTABLE}")
-   MESSAGE(STATUS "RUBY_LIBRARY: ${RUBY_LIBRARY}")
-   MESSAGE(STATUS "RUBY_INCLUDE_DIR: ${RUBY_INCLUDE_DIR}")
-   MESSAGE(STATUS "RUBY_CONFIG_INCLUDE_DIR: ${RUBY_CONFIG_INCLUDE_DIR}")
-   MESSAGE(STATUS "--------------------")
-ENDIF(_RUBY_DEBUG_OUTPUT)
+if(_RUBY_DEBUG_OUTPUT)
+   message(STATUS "--------FindRuby.cmake debug------------")
+   message(STATUS "_RUBY_POSSIBLE_EXECUTABLE_NAMES: ${_RUBY_POSSIBLE_EXECUTABLE_NAMES}")
+   message(STATUS "_RUBY_POSSIBLE_LIB_NAMES: ${_RUBY_POSSIBLE_LIB_NAMES}")
+   message(STATUS "RUBY_ARCH_DIR: ${RUBY_ARCH_DIR}")
+   message(STATUS "RUBY_HDR_DIR: ${RUBY_HDR_DIR}")
+   message(STATUS "RUBY_POSSIBLE_LIB_DIR: ${RUBY_POSSIBLE_LIB_DIR}")
+   message(STATUS "Found RUBY_VERSION: \"${RUBY_VERSION}\" , short: \"${_RUBY_VERSION_SHORT}\", nodot: \"${_RUBY_VERSION_SHORT_NODOT}\"")
+   message(STATUS "_RUBY_REQUIRED_VARS: ${_RUBY_REQUIRED_VARS}")
+   message(STATUS "RUBY_EXECUTABLE: ${RUBY_EXECUTABLE}")
+   message(STATUS "RUBY_LIBRARY: ${RUBY_LIBRARY}")
+   message(STATUS "RUBY_INCLUDE_DIR: ${RUBY_INCLUDE_DIR}")
+   message(STATUS "RUBY_CONFIG_INCLUDE_DIR: ${RUBY_CONFIG_INCLUDE_DIR}")
+   message(STATUS "--------------------")
+endif(_RUBY_DEBUG_OUTPUT)
 
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Ruby  REQUIRED_VARS  ${_RUBY_REQUIRED_VARS}
                                         VERSION_VAR RUBY_VERSION )
 
-MARK_AS_ADVANCED(
+mark_as_advanced(
   RUBY_EXECUTABLE
   RUBY_LIBRARY
   RUBY_INCLUDE_DIR
@@ -238,6 +238,6 @@ MARK_AS_ADVANCED(
   )
 
 # Set some variables for compatibility with previous version of this file
-SET(RUBY_POSSIBLE_LIB_PATH ${RUBY_POSSIBLE_LIB_DIR})
-SET(RUBY_RUBY_LIB_PATH ${RUBY_RUBY_LIB_DIR})
-SET(RUBY_INCLUDE_PATH ${RUBY_INCLUDE_DIRS})
+set(RUBY_POSSIBLE_LIB_PATH ${RUBY_POSSIBLE_LIB_DIR})
+set(RUBY_RUBY_LIB_PATH ${RUBY_RUBY_LIB_DIR})
+set(RUBY_INCLUDE_PATH ${RUBY_INCLUDE_DIRS})
diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake
index 363591f0c..65fea848d 100644
--- a/Modules/FindSDL.cmake
+++ b/Modules/FindSDL.cmake
@@ -65,7 +65,7 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PATH(SDL_INCLUDE_DIR SDL.h
+find_path(SDL_INCLUDE_DIR SDL.h
   HINTS
   $ENV{SDLDIR}
   PATH_SUFFIXES include/SDL include
@@ -84,7 +84,7 @@ FIND_PATH(SDL_INCLUDE_DIR SDL.h
 
 # SDL-1.1 is the name used by FreeBSD ports...
 # don't confuse it for the version number.
-FIND_LIBRARY(SDL_LIBRARY_TEMP
+find_library(SDL_LIBRARY_TEMP
   NAMES SDL SDL-1.1
   HINTS
   $ENV{SDLDIR}
@@ -96,13 +96,13 @@ FIND_LIBRARY(SDL_LIBRARY_TEMP
   /opt
 )
 
-IF(NOT SDL_BUILDING_LIBRARY)
-  IF(NOT ${SDL_INCLUDE_DIR} MATCHES ".framework")
+if(NOT SDL_BUILDING_LIBRARY)
+  if(NOT ${SDL_INCLUDE_DIR} MATCHES ".framework")
     # Non-OS X framework versions expect you to also dynamically link to
     # SDLmain. This is mainly for Windows and OS X. Other (Unix) platforms
     # seem to provide SDLmain for compatibility even though they don't
     # necessarily need it.
-    FIND_LIBRARY(SDLMAIN_LIBRARY
+    find_library(SDLMAIN_LIBRARY
       NAMES SDLmain SDLmain-1.1
       HINTS
       $ENV{SDLDIR}
@@ -113,31 +113,31 @@ IF(NOT SDL_BUILDING_LIBRARY)
       /opt/csw
       /opt
     )
-  ENDIF(NOT ${SDL_INCLUDE_DIR} MATCHES ".framework")
-ENDIF(NOT SDL_BUILDING_LIBRARY)
+  endif(NOT ${SDL_INCLUDE_DIR} MATCHES ".framework")
+endif(NOT SDL_BUILDING_LIBRARY)
 
 # SDL may require threads on your system.
 # The Apple build may not need an explicit flag because one of the
 # frameworks may already provide it.
 # But for non-OSX systems, I will use the CMake Threads package.
-IF(NOT APPLE)
-  FIND_PACKAGE(Threads)
-ENDIF(NOT APPLE)
+if(NOT APPLE)
+  find_package(Threads)
+endif(NOT APPLE)
 
 # MinGW needs an additional library, mwindows
 # It's total link flags should look like -lmingw32 -lSDLmain -lSDL -lmwindows
 # (Actually on second look, I think it only needs one of the m* libraries.)
-IF(MINGW)
-  SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
-ENDIF(MINGW)
+if(MINGW)
+  set(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
+endif(MINGW)
 
-IF(SDL_LIBRARY_TEMP)
+if(SDL_LIBRARY_TEMP)
   # For SDLmain
-  IF(NOT SDL_BUILDING_LIBRARY)
-    IF(SDLMAIN_LIBRARY)
-      SET(SDL_LIBRARY_TEMP ${SDLMAIN_LIBRARY} ${SDL_LIBRARY_TEMP})
-    ENDIF(SDLMAIN_LIBRARY)
-  ENDIF(NOT SDL_BUILDING_LIBRARY)
+  if(NOT SDL_BUILDING_LIBRARY)
+    if(SDLMAIN_LIBRARY)
+      set(SDL_LIBRARY_TEMP ${SDLMAIN_LIBRARY} ${SDL_LIBRARY_TEMP})
+    endif(SDLMAIN_LIBRARY)
+  endif(NOT SDL_BUILDING_LIBRARY)
 
   # For OS X, SDL uses Cocoa as a backend so it must link to Cocoa.
   # CMake doesn't display the -framework Cocoa string in the UI even
@@ -145,29 +145,29 @@ IF(SDL_LIBRARY_TEMP)
   # I think it has something to do with the CACHE STRING.
   # So I use a temporary variable until the end so I can set the
   # "real" variable in one-shot.
-  IF(APPLE)
-    SET(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} "-framework Cocoa")
-  ENDIF(APPLE)
+  if(APPLE)
+    set(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} "-framework Cocoa")
+  endif(APPLE)
 
   # For threads, as mentioned Apple doesn't need this.
   # In fact, there seems to be a problem if I used the Threads package
   # and try using this line, so I'm just skipping it entirely for OS X.
-  IF(NOT APPLE)
-    SET(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
-  ENDIF(NOT APPLE)
+  if(NOT APPLE)
+    set(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
+  endif(NOT APPLE)
 
   # For MinGW library
-  IF(MINGW)
-    SET(SDL_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL_LIBRARY_TEMP})
-  ENDIF(MINGW)
+  if(MINGW)
+    set(SDL_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL_LIBRARY_TEMP})
+  endif(MINGW)
 
   # Set the final string here so the GUI reflects the final state.
-  SET(SDL_LIBRARY ${SDL_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found")
+  set(SDL_LIBRARY ${SDL_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found")
   # Set the temp variable to INTERNAL so it is not seen in the CMake GUI
-  SET(SDL_LIBRARY_TEMP "${SDL_LIBRARY_TEMP}" CACHE INTERNAL "")
-ENDIF(SDL_LIBRARY_TEMP)
+  set(SDL_LIBRARY_TEMP "${SDL_LIBRARY_TEMP}" CACHE INTERNAL "")
+endif(SDL_LIBRARY_TEMP)
 
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL
                                   REQUIRED_VARS SDL_LIBRARY SDL_INCLUDE_DIR)
diff --git a/Modules/FindSDL_image.cmake b/Modules/FindSDL_image.cmake
index 7128f67fb..3c1f7a00e 100644
--- a/Modules/FindSDL_image.cmake
+++ b/Modules/FindSDL_image.cmake
@@ -25,7 +25,7 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PATH(SDLIMAGE_INCLUDE_DIR SDL_image.h
+find_path(SDLIMAGE_INCLUDE_DIR SDL_image.h
   HINTS
   $ENV{SDLIMAGEDIR}
   $ENV{SDLDIR}
@@ -49,7 +49,7 @@ FIND_PATH(SDLIMAGE_INCLUDE_DIR SDL_image.h
   /opt/include
 )
 
-FIND_LIBRARY(SDLIMAGE_LIBRARY
+find_library(SDLIMAGE_LIBRARY
   NAMES SDL_image
   HINTS
   $ENV{SDLIMAGEDIR}
@@ -64,7 +64,7 @@ FIND_LIBRARY(SDLIMAGE_LIBRARY
   /opt
 )
 
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLIMAGE
                                   REQUIRED_VARS SDLIMAGE_LIBRARY SDLIMAGE_INCLUDE_DIR)
diff --git a/Modules/FindSDL_mixer.cmake b/Modules/FindSDL_mixer.cmake
index e8da6407a..ed333eec4 100644
--- a/Modules/FindSDL_mixer.cmake
+++ b/Modules/FindSDL_mixer.cmake
@@ -25,7 +25,7 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PATH(SDLMIXER_INCLUDE_DIR SDL_mixer.h
+find_path(SDLMIXER_INCLUDE_DIR SDL_mixer.h
   HINTS
   $ENV{SDLMIXERDIR}
   $ENV{SDLDIR}
@@ -49,7 +49,7 @@ FIND_PATH(SDLMIXER_INCLUDE_DIR SDL_mixer.h
   /opt/include
 )
 
-FIND_LIBRARY(SDLMIXER_LIBRARY
+find_library(SDLMIXER_LIBRARY
   NAMES SDL_mixer
   HINTS
   $ENV{SDLMIXERDIR}
@@ -64,7 +64,7 @@ FIND_LIBRARY(SDLMIXER_LIBRARY
   /opt
 )
 
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLMIXER
                                   REQUIRED_VARS SDLMIXER_LIBRARY SDLMIXER_INCLUDE_DIR)
diff --git a/Modules/FindSDL_net.cmake b/Modules/FindSDL_net.cmake
index f1bd0919e..dcab3fd64 100644
--- a/Modules/FindSDL_net.cmake
+++ b/Modules/FindSDL_net.cmake
@@ -25,7 +25,7 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PATH(SDLNET_INCLUDE_DIR SDL_net.h
+find_path(SDLNET_INCLUDE_DIR SDL_net.h
   HINTS
   $ENV{SDLNETDIR}
   $ENV{SDLDIR}
@@ -48,7 +48,7 @@ FIND_PATH(SDLNET_INCLUDE_DIR SDL_net.h
   /opt/include/SDL
   /opt/include
 )
-FIND_LIBRARY(SDLNET_LIBRARY
+find_library(SDLNET_LIBRARY
   NAMES SDL_net
   HINTS
   $ENV{SDLNETDIR}
@@ -63,7 +63,7 @@ FIND_LIBRARY(SDLNET_LIBRARY
   /opt
 )
 
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLNET
                                   REQUIRED_VARS SDLNET_LIBRARY SDLNET_INCLUDE_DIR)
diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake
index 963a811f5..06ae203ad 100644
--- a/Modules/FindSDL_sound.cmake
+++ b/Modules/FindSDL_sound.cmake
@@ -69,11 +69,11 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-SET(SDL_SOUND_EXTRAS "" CACHE STRING "SDL_sound extra flags")
-MARK_AS_ADVANCED(SDL_SOUND_EXTRAS)
+set(SDL_SOUND_EXTRAS "" CACHE STRING "SDL_sound extra flags")
+mark_as_advanced(SDL_SOUND_EXTRAS)
 
 # Find SDL_sound.h
-FIND_PATH(SDL_SOUND_INCLUDE_DIR SDL_sound.h
+find_path(SDL_SOUND_INCLUDE_DIR SDL_sound.h
   HINTS
   $ENV{SDLSOUNDDIR}/include
   $ENV{SDLSOUNDDIR}
@@ -96,7 +96,7 @@ FIND_PATH(SDL_SOUND_INCLUDE_DIR SDL_sound.h
   /opt/include
   )
 
-FIND_LIBRARY(SDL_SOUND_LIBRARY
+find_library(SDL_SOUND_LIBRARY
   NAMES SDL_sound
   HINTS
   $ENV{SDLSOUNDDIR}/lib
@@ -110,7 +110,7 @@ FIND_LIBRARY(SDL_SOUND_LIBRARY
   /opt/lib
   )
 
-IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
+if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
 
   # CMake is giving me problems using TRY_COMPILE with the CMAKE_FLAGS
   # for the :STRING syntax if I have multiple values contained in a
@@ -121,12 +121,12 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
   # To get multiple single variables to work, I must separate them with a "\;"
   # I could go back and modify the FindSDL.cmake module, but that's kind of painful.
   # The solution would be to try something like:
-  # SET(SDL_TRY_COMPILE_LIBRARY_LIST "${SDL_TRY_COMPILE_LIBRARY_LIST}\;${CMAKE_THREAD_LIBS_INIT}")
+  # set(SDL_TRY_COMPILE_LIBRARY_LIST "${SDL_TRY_COMPILE_LIBRARY_LIST}\;${CMAKE_THREAD_LIBS_INIT}")
   # Instead, it was suggested on the mailing list to write a temporary CMakeLists.txt
   # with a temporary test project and invoke that with TRY_COMPILE.
   # See message thread "Figuring out dependencies for a library in order to build"
   # 2005-07-16
-  #     TRY_COMPILE(
+  #     try_compile(
   #             MY_RESULT
   #             ${CMAKE_BINARY_DIR}
   #             ${PROJECT_SOURCE_DIR}/DetermineSoundLibs.c
@@ -139,7 +139,7 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
   # To minimize external dependencies, create a sdlsound test program
   # which will be used to figure out if additional link dependencies are
   # required for the link phase.
-  FILE(WRITE ${PROJECT_BINARY_DIR}/CMakeTmp/DetermineSoundLibs.c
+  file(WRITE ${PROJECT_BINARY_DIR}/CMakeTmp/DetermineSoundLibs.c
     "#include \"SDL_sound.h\"
     #include \"SDL.h\"
     int main(int argc, char* argv[])
@@ -163,32 +163,32 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
      )
 
    # Calling
-   # TARGET_LINK_LIBRARIES(DetermineSoundLibs "${SDL_SOUND_LIBRARY} ${SDL_LIBRARY})
+   # target_link_libraries(DetermineSoundLibs "${SDL_SOUND_LIBRARY} ${SDL_LIBRARY})
    # causes problems when SDL_LIBRARY looks like
    # /Library/Frameworks/SDL.framework;-framework Cocoa
    # The ;-framework Cocoa seems to be confusing CMake once the OS X
    # framework support was added. I was told that breaking up the list
    # would fix the problem.
-   SET(TMP_TRY_LIBS)
-   FOREACH(lib ${SDL_SOUND_LIBRARY} ${SDL_LIBRARY})
-     SET(TMP_TRY_LIBS "${TMP_TRY_LIBS} \"${lib}\"")
-   ENDFOREACH(lib)
+   set(TMP_TRY_LIBS)
+   foreach(lib ${SDL_SOUND_LIBRARY} ${SDL_LIBRARY})
+     set(TMP_TRY_LIBS "${TMP_TRY_LIBS} \"${lib}\"")
+   endforeach(lib)
 
-   # MESSAGE("TMP_TRY_LIBS ${TMP_TRY_LIBS}")
+   # message("TMP_TRY_LIBS ${TMP_TRY_LIBS}")
 
    # Write the CMakeLists.txt and test project
    # Weird, this is still sketchy. If I don't quote the variables
    # in the TARGET_LINK_LIBRARIES, I seem to loose everything
    # in the SDL_LIBRARY string after the "-framework".
    # But if I quote the stuff in INCLUDE_DIRECTORIES, it doesn't work.
-   FILE(WRITE ${PROJECT_BINARY_DIR}/CMakeTmp/CMakeLists.txt
-     "PROJECT(DetermineSoundLibs)
-        INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR} ${SDL_SOUND_INCLUDE_DIR})
-        ADD_EXECUTABLE(DetermineSoundLibs DetermineSoundLibs.c)
-        TARGET_LINK_LIBRARIES(DetermineSoundLibs ${TMP_TRY_LIBS})"
+   file(WRITE ${PROJECT_BINARY_DIR}/CMakeTmp/CMakeLists.txt
+     "project(DetermineSoundLibs)
+        include_directories(${SDL_INCLUDE_DIR} ${SDL_SOUND_INCLUDE_DIR})
+        add_executable(DetermineSoundLibs DetermineSoundLibs.c)
+        target_link_libraries(DetermineSoundLibs ${TMP_TRY_LIBS})"
      )
 
-   TRY_COMPILE(
+   try_compile(
      MY_RESULT
      ${PROJECT_BINARY_DIR}/CMakeTmp
      ${PROJECT_BINARY_DIR}/CMakeTmp
@@ -196,20 +196,20 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
      OUTPUT_VARIABLE MY_OUTPUT
      )
 
-   # MESSAGE("${MY_RESULT}")
-   # MESSAGE(${MY_OUTPUT})
+   # message("${MY_RESULT}")
+   # message(${MY_OUTPUT})
 
-   IF(NOT MY_RESULT)
+   if(NOT MY_RESULT)
 
      # I expect that MPGLIB, VOC, WAV, AIFF, and SHN are compiled in statically.
      # I think Timidity is also compiled in statically.
      # I've never had to explcitly link against Quicktime, so I'll skip that for now.
 
-     SET(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARY})
+     set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARY})
 
      # Find MikMod
-     IF("${MY_OUTPUT}" MATCHES "MikMod_")
-     FIND_LIBRARY(MIKMOD_LIBRARY
+     if("${MY_OUTPUT}" MATCHES "MikMod_")
+     find_library(MIKMOD_LIBRARY
          NAMES libmikmod-coreaudio mikmod
          PATHS
          $ENV{MIKMODDIR}/lib
@@ -223,14 +223,14 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
          /opt/csw/lib
        /opt/lib
        )
-       IF(MIKMOD_LIBRARY)
-         SET(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${MIKMOD_LIBRARY})
-       ENDIF(MIKMOD_LIBRARY)
-     ENDIF("${MY_OUTPUT}" MATCHES "MikMod_")
+       if(MIKMOD_LIBRARY)
+         set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${MIKMOD_LIBRARY})
+       endif(MIKMOD_LIBRARY)
+     endif("${MY_OUTPUT}" MATCHES "MikMod_")
 
      # Find ModPlug
-     IF("${MY_OUTPUT}" MATCHES "MODPLUG_")
-       FIND_LIBRARY(MODPLUG_LIBRARY
+     if("${MY_OUTPUT}" MATCHES "MODPLUG_")
+       find_library(MODPLUG_LIBRARY
          NAMES modplug
          PATHS
          $ENV{MODPLUGDIR}/lib
@@ -244,15 +244,15 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
          /opt/csw/lib
        /opt/lib
        )
-       IF(MODPLUG_LIBRARY)
-         SET(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${MODPLUG_LIBRARY})
-       ENDIF(MODPLUG_LIBRARY)
-     ENDIF("${MY_OUTPUT}" MATCHES "MODPLUG_")
+       if(MODPLUG_LIBRARY)
+         set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${MODPLUG_LIBRARY})
+       endif(MODPLUG_LIBRARY)
+     endif("${MY_OUTPUT}" MATCHES "MODPLUG_")
 
 
      # Find Ogg and Vorbis
-     IF("${MY_OUTPUT}" MATCHES "ov_")
-       FIND_LIBRARY(VORBIS_LIBRARY
+     if("${MY_OUTPUT}" MATCHES "ov_")
+       find_library(VORBIS_LIBRARY
          NAMES vorbis Vorbis VORBIS
          PATHS
          $ENV{VORBISDIR}/lib
@@ -268,11 +268,11 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
          /opt/csw/lib
        /opt/lib
          )
-       IF(VORBIS_LIBRARY)
-         SET(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${VORBIS_LIBRARY})
-       ENDIF(VORBIS_LIBRARY)
+       if(VORBIS_LIBRARY)
+         set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${VORBIS_LIBRARY})
+       endif(VORBIS_LIBRARY)
 
-       FIND_LIBRARY(OGG_LIBRARY
+       find_library(OGG_LIBRARY
          NAMES ogg Ogg OGG
          PATHS
          $ENV{OGGDIR}/lib
@@ -288,15 +288,15 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
          /opt/csw/lib
        /opt/lib
          )
-       IF(OGG_LIBRARY)
-         SET(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${OGG_LIBRARY})
-       ENDIF(OGG_LIBRARY)
-     ENDIF("${MY_OUTPUT}" MATCHES "ov_")
+       if(OGG_LIBRARY)
+         set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${OGG_LIBRARY})
+       endif(OGG_LIBRARY)
+     endif("${MY_OUTPUT}" MATCHES "ov_")
 
 
      # Find SMPEG
-     IF("${MY_OUTPUT}" MATCHES "SMPEG_")
-       FIND_LIBRARY(SMPEG_LIBRARY
+     if("${MY_OUTPUT}" MATCHES "SMPEG_")
+       find_library(SMPEG_LIBRARY
          NAMES smpeg SMPEG Smpeg SMpeg
          PATHS
          $ENV{SMPEGDIR}/lib
@@ -310,15 +310,15 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
          /opt/csw/lib
        /opt/lib
          )
-       IF(SMPEG_LIBRARY)
-         SET(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${SMPEG_LIBRARY})
-       ENDIF(SMPEG_LIBRARY)
-     ENDIF("${MY_OUTPUT}" MATCHES "SMPEG_")
+       if(SMPEG_LIBRARY)
+         set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${SMPEG_LIBRARY})
+       endif(SMPEG_LIBRARY)
+     endif("${MY_OUTPUT}" MATCHES "SMPEG_")
 
 
      # Find FLAC
-     IF("${MY_OUTPUT}" MATCHES "FLAC_")
-       FIND_LIBRARY(FLAC_LIBRARY
+     if("${MY_OUTPUT}" MATCHES "FLAC_")
+       find_library(FLAC_LIBRARY
          NAMES flac FLAC
          PATHS
          $ENV{FLACDIR}/lib
@@ -332,18 +332,18 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
          /opt/csw/lib
        /opt/lib
          )
-       IF(FLAC_LIBRARY)
-         SET(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${FLAC_LIBRARY})
-       ENDIF(FLAC_LIBRARY)
-     ENDIF("${MY_OUTPUT}" MATCHES "FLAC_")
+       if(FLAC_LIBRARY)
+         set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${FLAC_LIBRARY})
+       endif(FLAC_LIBRARY)
+     endif("${MY_OUTPUT}" MATCHES "FLAC_")
 
 
      # Hmmm...Speex seems to depend on Ogg. This might be a problem if
      # the TRY_COMPILE attempt gets blocked at SPEEX before it can pull
      # in the Ogg symbols. I'm not sure if I should duplicate the ogg stuff
      # above for here or if two ogg entries will screw up things.
-     IF("${MY_OUTPUT}" MATCHES "speex_")
-       FIND_LIBRARY(SPEEX_LIBRARY
+     if("${MY_OUTPUT}" MATCHES "speex_")
+       find_library(SPEEX_LIBRARY
          NAMES speex SPEEX
          PATHS
          $ENV{SPEEXDIR}/lib
@@ -357,14 +357,14 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
          /opt/csw/lib
        /opt/lib
          )
-       IF(SPEEX_LIBRARY)
-         SET(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${SPEEX_LIBRARY})
-       ENDIF(SPEEX_LIBRARY)
+       if(SPEEX_LIBRARY)
+         set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${SPEEX_LIBRARY})
+       endif(SPEEX_LIBRARY)
 
        # Find OGG (needed for Speex)
      # We might have already found Ogg for Vorbis, so skip it if so.
-       IF(NOT OGG_LIBRARY)
-         FIND_LIBRARY(OGG_LIBRARY
+       if(NOT OGG_LIBRARY)
+         find_library(OGG_LIBRARY
            NAMES ogg Ogg OGG
            PATHS
            $ENV{OGGDIR}/lib
@@ -382,20 +382,20 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
            /opt/csw/lib
          /opt/lib
            )
-         IF(OGG_LIBRARY)
-           SET(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${OGG_LIBRARY})
-         ENDIF(OGG_LIBRARY)
-       ENDIF(NOT OGG_LIBRARY)
-     ENDIF("${MY_OUTPUT}" MATCHES "speex_")
+         if(OGG_LIBRARY)
+           set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${OGG_LIBRARY})
+         endif(OGG_LIBRARY)
+       endif(NOT OGG_LIBRARY)
+     endif("${MY_OUTPUT}" MATCHES "speex_")
 
-   ELSE(NOT MY_RESULT)
-     SET(SDL_SOUND_LIBRARIES "${SDL_SOUND_EXTRAS} ${SDL_SOUND_LIBRARY}" CACHE INTERNAL "SDL_sound and dependent libraries")
-   ENDIF(NOT MY_RESULT)
+   else(NOT MY_RESULT)
+     set(SDL_SOUND_LIBRARIES "${SDL_SOUND_EXTRAS} ${SDL_SOUND_LIBRARY}" CACHE INTERNAL "SDL_sound and dependent libraries")
+   endif(NOT MY_RESULT)
 
-   SET(SDL_SOUND_LIBRARIES "${SDL_SOUND_EXTRAS} ${SDL_SOUND_LIBRARIES_TMP}" CACHE INTERNAL "SDL_sound and dependent libraries")
- ENDIF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
+   set(SDL_SOUND_LIBRARIES "${SDL_SOUND_EXTRAS} ${SDL_SOUND_LIBRARIES_TMP}" CACHE INTERNAL "SDL_sound and dependent libraries")
+ endif(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
 
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_SOUND
                                   REQUIRED_VARS SDL_SOUND_LIBRARIES SDL_SOUND_INCLUDE_DIR)
diff --git a/Modules/FindSDL_ttf.cmake b/Modules/FindSDL_ttf.cmake
index 8bba2130f..6f238e6a6 100644
--- a/Modules/FindSDL_ttf.cmake
+++ b/Modules/FindSDL_ttf.cmake
@@ -25,7 +25,7 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PATH(SDLTTF_INCLUDE_DIR SDL_ttf.h
+find_path(SDLTTF_INCLUDE_DIR SDL_ttf.h
   HINTS
   $ENV{SDLTTFDIR}
   $ENV{SDLDIR}
@@ -49,7 +49,7 @@ FIND_PATH(SDLTTF_INCLUDE_DIR SDL_ttf.h
   /opt/include
 )
 
-FIND_LIBRARY(SDLTTF_LIBRARY
+find_library(SDLTTF_LIBRARY
   NAMES SDL_ttf
   HINTS
   $ENV{SDLTTFDIR}
@@ -64,7 +64,7 @@ FIND_LIBRARY(SDLTTF_LIBRARY
     PATH_SUFFIXES lib64 lib
 )
 
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLTTF
                                   REQUIRED_VARS SDLTTF_LIBRARY SDLTTF_INCLUDE_DIR)
diff --git a/Modules/FindSWIG.cmake b/Modules/FindSWIG.cmake
index d11d1e47b..33cf9d16d 100644
--- a/Modules/FindSWIG.cmake
+++ b/Modules/FindSWIG.cmake
@@ -6,7 +6,7 @@
 #  SWIG_VERSION   - the version number of the swig executable
 #
 # The minimum required version of SWIG can be specified using the
-# standard syntax, e.g. FIND_PACKAGE(SWIG 1.1)
+# standard syntax, e.g. find_package(SWIG 1.1)
 #
 # All information is collected from the SWIG_EXECUTABLE so the
 # version to be found can be changed from the command line by
@@ -27,42 +27,42 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PROGRAM(SWIG_EXECUTABLE NAMES swig2.0 swig)
+find_program(SWIG_EXECUTABLE NAMES swig2.0 swig)
 
-IF(SWIG_EXECUTABLE)
-  EXECUTE_PROCESS(COMMAND ${SWIG_EXECUTABLE} -swiglib
+if(SWIG_EXECUTABLE)
+  execute_process(COMMAND ${SWIG_EXECUTABLE} -swiglib
     OUTPUT_VARIABLE SWIG_swiglib_output
     ERROR_VARIABLE SWIG_swiglib_error
     RESULT_VARIABLE SWIG_swiglib_result)
 
-  IF(SWIG_swiglib_result)
-    IF(SWIG_FIND_REQUIRED)
-      MESSAGE(SEND_ERROR "Command \"${SWIG_EXECUTABLE} -swiglib\" failed with output:\n${SWIG_swiglib_error}")
-    ELSE(SWIG_FIND_REQUIRED)
-      MESSAGE(STATUS "Command \"${SWIG_EXECUTABLE} -swiglib\" failed with output:\n${SWIG_swiglib_error}")
-    ENDIF(SWIG_FIND_REQUIRED)
-  ELSE(SWIG_swiglib_result)
-    STRING(REGEX REPLACE "[\n\r]+" ";" SWIG_swiglib_output ${SWIG_swiglib_output})
+  if(SWIG_swiglib_result)
+    if(SWIG_FIND_REQUIRED)
+      message(SEND_ERROR "Command \"${SWIG_EXECUTABLE} -swiglib\" failed with output:\n${SWIG_swiglib_error}")
+    else(SWIG_FIND_REQUIRED)
+      message(STATUS "Command \"${SWIG_EXECUTABLE} -swiglib\" failed with output:\n${SWIG_swiglib_error}")
+    endif(SWIG_FIND_REQUIRED)
+  else(SWIG_swiglib_result)
+    string(REGEX REPLACE "[\n\r]+" ";" SWIG_swiglib_output ${SWIG_swiglib_output})
     # force the path to be computed each time in case SWIG_EXECUTABLE has changed.
-    SET(SWIG_DIR SWIG_DIR-NOTFOUND)
-    FIND_PATH(SWIG_DIR swig.swg PATHS ${SWIG_swiglib_output})
-    IF(SWIG_DIR)
-      SET(SWIG_USE_FILE ${CMAKE_ROOT}/Modules/UseSWIG.cmake)
-      EXECUTE_PROCESS(COMMAND ${SWIG_EXECUTABLE} -version
+    set(SWIG_DIR SWIG_DIR-NOTFOUND)
+    find_path(SWIG_DIR swig.swg PATHS ${SWIG_swiglib_output})
+    if(SWIG_DIR)
+      set(SWIG_USE_FILE ${CMAKE_ROOT}/Modules/UseSWIG.cmake)
+      execute_process(COMMAND ${SWIG_EXECUTABLE} -version
         OUTPUT_VARIABLE SWIG_version_output
         ERROR_VARIABLE SWIG_version_output
         RESULT_VARIABLE SWIG_version_result)
-      IF(SWIG_version_result)
-        MESSAGE(SEND_ERROR "Command \"${SWIG_EXECUTABLE} -version\" failed with output:\n${SWIG_version_output}")
-      ELSE(SWIG_version_result)
-        STRING(REGEX REPLACE ".*SWIG Version[^0-9.]*\([0-9.]+\).*" "\\1"
+      if(SWIG_version_result)
+        message(SEND_ERROR "Command \"${SWIG_EXECUTABLE} -version\" failed with output:\n${SWIG_version_output}")
+      else(SWIG_version_result)
+        string(REGEX REPLACE ".*SWIG Version[^0-9.]*\([0-9.]+\).*" "\\1"
           SWIG_version_output "${SWIG_version_output}")
-        SET(SWIG_VERSION ${SWIG_version_output} CACHE STRING "Swig version" FORCE)
-      ENDIF(SWIG_version_result)
-    ENDIF(SWIG_DIR)
-  ENDIF(SWIG_swiglib_result)
-ENDIF(SWIG_EXECUTABLE)
+        set(SWIG_VERSION ${SWIG_version_output} CACHE STRING "Swig version" FORCE)
+      endif(SWIG_version_result)
+    endif(SWIG_DIR)
+  endif(SWIG_swiglib_result)
+endif(SWIG_EXECUTABLE)
 
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(SWIG  REQUIRED_VARS SWIG_EXECUTABLE SWIG_DIR
                                         VERSION_VAR SWIG_VERSION )
diff --git a/Modules/FindSelfPackers.cmake b/Modules/FindSelfPackers.cmake
index d13b0c4dd..7d446616c 100644
--- a/Modules/FindSelfPackers.cmake
+++ b/Modules/FindSelfPackers.cmake
@@ -18,9 +18,9 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE(FindCygwin)
+include(FindCygwin)
 
-FIND_PROGRAM(SELF_PACKER_FOR_EXECUTABLE
+find_program(SELF_PACKER_FOR_EXECUTABLE
   upx
   ${CYGWIN_INSTALL_PATH}/bin
   /bin
@@ -29,7 +29,7 @@ FIND_PROGRAM(SELF_PACKER_FOR_EXECUTABLE
   /sbin
 )
 
-FIND_PROGRAM(SELF_PACKER_FOR_SHARED_LIB
+find_program(SELF_PACKER_FOR_SHARED_LIB
   upx
   ${CYGWIN_INSTALL_PATH}/bin
   /bin
@@ -38,7 +38,7 @@ FIND_PROGRAM(SELF_PACKER_FOR_SHARED_LIB
   /sbin
 )
 
-MARK_AS_ADVANCED(
+mark_as_advanced(
   SELF_PACKER_FOR_EXECUTABLE
   SELF_PACKER_FOR_SHARED_LIB
 )
@@ -46,23 +46,23 @@ MARK_AS_ADVANCED(
 #
 # Set flags
 #
-IF (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx")
-  SET (SELF_PACKER_FOR_EXECUTABLE_FLAGS "-q" CACHE STRING
+if (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx")
+  set (SELF_PACKER_FOR_EXECUTABLE_FLAGS "-q" CACHE STRING
        "Flags for the executable self-packer.")
-ELSE (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx")
-  SET (SELF_PACKER_FOR_EXECUTABLE_FLAGS "" CACHE STRING
+else (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx")
+  set (SELF_PACKER_FOR_EXECUTABLE_FLAGS "" CACHE STRING
        "Flags for the executable self-packer.")
-ENDIF (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx")
+endif (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx")
 
-IF (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx")
-  SET (SELF_PACKER_FOR_SHARED_LIB_FLAGS "-q" CACHE STRING
+if (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx")
+  set (SELF_PACKER_FOR_SHARED_LIB_FLAGS "-q" CACHE STRING
        "Flags for the shared lib self-packer.")
-ELSE (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx")
-  SET (SELF_PACKER_FOR_SHARED_LIB_FLAGS "" CACHE STRING
+else (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx")
+  set (SELF_PACKER_FOR_SHARED_LIB_FLAGS "" CACHE STRING
        "Flags for the shared lib self-packer.")
-ENDIF (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx")
+endif (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx")
 
-MARK_AS_ADVANCED(
+mark_as_advanced(
   SELF_PACKER_FOR_EXECUTABLE_FLAGS
   SELF_PACKER_FOR_SHARED_LIB_FLAGS
 )
diff --git a/Modules/FindSquish.cmake b/Modules/FindSquish.cmake
index 3b69b07f7..0127edccc 100644
--- a/Modules/FindSquish.cmake
+++ b/Modules/FindSquish.cmake
@@ -16,11 +16,11 @@
 # macro SQUISH_ADD_TEST(testName applicationUnderTest testSuite testCase)
 #
 # ---- Typical Use
-#  ENABLE_TESTING()
-#  FIND_PACKAGE(Squish)
-#  IF (SQUISH_FOUND)
+#  enable_testing()
+#  find_package(Squish)
+#  if (SQUISH_FOUND)
 #    SQUISH_ADD_TEST(myTestName myApplication testSuiteName testCaseName)
-#  ENDIF (SQUISH_FOUND)
+#  endif (SQUISH_FOUND)
 #
 
 #=============================================================================
@@ -36,24 +36,24 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-SET(SQUISH_INSTALL_DIR_STRING "Directory containing the bin, doc, and lib directories for Squish; this should be the root of the installation directory.")
-SET(SQUISH_SERVER_EXECUTABLE_STRING "The squishserver executable program.")
-SET(SQUISH_CLIENT_EXECUTABLE_STRING "The squishclient executable program.")
+set(SQUISH_INSTALL_DIR_STRING "Directory containing the bin, doc, and lib directories for Squish; this should be the root of the installation directory.")
+set(SQUISH_SERVER_EXECUTABLE_STRING "The squishserver executable program.")
+set(SQUISH_CLIENT_EXECUTABLE_STRING "The squishclient executable program.")
 
 # Search only if the location is not already known.
-IF(NOT SQUISH_INSTALL_DIR)
+if(NOT SQUISH_INSTALL_DIR)
   # Get the system search path as a list.
-  FILE(TO_CMAKE_PATH "$ENV{PATH}" SQUISH_INSTALL_DIR_SEARCH2)
+  file(TO_CMAKE_PATH "$ENV{PATH}" SQUISH_INSTALL_DIR_SEARCH2)
 
   # Construct a set of paths relative to the system search path.
-  SET(SQUISH_INSTALL_DIR_SEARCH "")
-  FOREACH(dir ${SQUISH_INSTALL_DIR_SEARCH2})
-    SET(SQUISH_INSTALL_DIR_SEARCH ${SQUISH_INSTALL_DIR_SEARCH} "${dir}/../lib/fltk")
-  ENDFOREACH(dir)
-  STRING(REPLACE "//" "/" SQUISH_INSTALL_DIR_SEARCH "${SQUISH_INSTALL_DIR_SEARCH}")
+  set(SQUISH_INSTALL_DIR_SEARCH "")
+  foreach(dir ${SQUISH_INSTALL_DIR_SEARCH2})
+    set(SQUISH_INSTALL_DIR_SEARCH ${SQUISH_INSTALL_DIR_SEARCH} "${dir}/../lib/fltk")
+  endforeach(dir)
+  string(REPLACE "//" "/" SQUISH_INSTALL_DIR_SEARCH "${SQUISH_INSTALL_DIR_SEARCH}")
 
   # Look for an installation
-  FIND_PATH(SQUISH_INSTALL_DIR bin/squishrunner
+  find_path(SQUISH_INSTALL_DIR bin/squishrunner
     # Look for an environment variable SQUISH_INSTALL_DIR.
     $ENV{SQUISH_INSTALL_DIR}
 
@@ -65,49 +65,49 @@ IF(NOT SQUISH_INSTALL_DIR)
 
     DOC "The ${SQUISH_INSTALL_DIR_STRING}"
     )
-ENDIF(NOT SQUISH_INSTALL_DIR)
+endif(NOT SQUISH_INSTALL_DIR)
 
 # search for the executables
-IF(SQUISH_INSTALL_DIR)
-  SET(SQUISH_INSTALL_DIR_FOUND 1)
+if(SQUISH_INSTALL_DIR)
+  set(SQUISH_INSTALL_DIR_FOUND 1)
 
   # find the client program
-  IF(NOT SQUISH_CLIENT_EXECUTABLE)
-    FIND_PROGRAM(SQUISH_CLIENT_EXECUTABLE ${SQUISH_INSTALL_DIR}/bin/squishrunner DOC "The ${SQUISH_CLIENT_EXECUTABLE_STRING}")
-  ENDIF(NOT SQUISH_CLIENT_EXECUTABLE)
+  if(NOT SQUISH_CLIENT_EXECUTABLE)
+    find_program(SQUISH_CLIENT_EXECUTABLE ${SQUISH_INSTALL_DIR}/bin/squishrunner DOC "The ${SQUISH_CLIENT_EXECUTABLE_STRING}")
+  endif(NOT SQUISH_CLIENT_EXECUTABLE)
 
   # find the server program
-  IF(NOT SQUISH_SERVER_EXECUTABLE)
-    FIND_PROGRAM(SQUISH_SERVER_EXECUTABLE ${SQUISH_INSTALL_DIR}/bin/squishserver DOC "The ${SQUISH_SERVER_EXECUTABLE_STRING}")
-  ENDIF(NOT SQUISH_SERVER_EXECUTABLE)
+  if(NOT SQUISH_SERVER_EXECUTABLE)
+    find_program(SQUISH_SERVER_EXECUTABLE ${SQUISH_INSTALL_DIR}/bin/squishserver DOC "The ${SQUISH_SERVER_EXECUTABLE_STRING}")
+  endif(NOT SQUISH_SERVER_EXECUTABLE)
 
-ELSE(SQUISH_INSTALL_DIR)
-  SET(SQUISH_INSTALL_DIR_FOUND 0)
-ENDIF(SQUISH_INSTALL_DIR)
+else(SQUISH_INSTALL_DIR)
+  set(SQUISH_INSTALL_DIR_FOUND 0)
+endif(SQUISH_INSTALL_DIR)
 
 # record if executables are set
-IF(SQUISH_CLIENT_EXECUTABLE)
-  SET(SQUISH_CLIENT_EXECUTABLE_FOUND 1)
-ELSE(SQUISH_CLIENT_EXECUTABLE)
-  SET(SQUISH_CLIENT_EXECUTABLE_FOUND 0)
-ENDIF(SQUISH_CLIENT_EXECUTABLE)
+if(SQUISH_CLIENT_EXECUTABLE)
+  set(SQUISH_CLIENT_EXECUTABLE_FOUND 1)
+else(SQUISH_CLIENT_EXECUTABLE)
+  set(SQUISH_CLIENT_EXECUTABLE_FOUND 0)
+endif(SQUISH_CLIENT_EXECUTABLE)
 
-IF(SQUISH_SERVER_EXECUTABLE)
-  SET(SQUISH_SERVER_EXECUTABLE_FOUND 1)
-ELSE(SQUISH_SERVER_EXECUTABLE)
-  SET(SQUISH_SERVER_EXECUTABLE_FOUND 0)
-ENDIF(SQUISH_SERVER_EXECUTABLE)
+if(SQUISH_SERVER_EXECUTABLE)
+  set(SQUISH_SERVER_EXECUTABLE_FOUND 1)
+else(SQUISH_SERVER_EXECUTABLE)
+  set(SQUISH_SERVER_EXECUTABLE_FOUND 0)
+endif(SQUISH_SERVER_EXECUTABLE)
 
 # record if Squish was found
-SET(SQUISH_FOUND 1)
-FOREACH(var SQUISH_INSTALL_DIR_FOUND SQUISH_CLIENT_EXECUTABLE_FOUND SQUISH_SERVER_EXECUTABLE_FOUND)
-  IF(NOT ${var})
-    SET(SQUISH_FOUND 0)
-  ENDIF(NOT ${var})
-ENDFOREACH(var)
+set(SQUISH_FOUND 1)
+foreach(var SQUISH_INSTALL_DIR_FOUND SQUISH_CLIENT_EXECUTABLE_FOUND SQUISH_SERVER_EXECUTABLE_FOUND)
+  if(NOT ${var})
+    set(SQUISH_FOUND 0)
+  endif(NOT ${var})
+endforeach(var)
 
-MACRO(SQUISH_ADD_TEST testName testAUT testCase envVars testWraper)
-  ADD_TEST(${testName}
+macro(SQUISH_ADD_TEST testName testAUT testCase envVars testWraper)
+  add_test(${testName}
     ${CMAKE_COMMAND} -V -VV
     "-Dsquish_aut:STRING=${testAUT}"
     "-Dsquish_server_executable:STRING=${SQUISH_SERVER_EXECUTABLE}"
@@ -118,8 +118,8 @@ MACRO(SQUISH_ADD_TEST testName testAUT testCase envVars testWraper)
     "-Dsquish_wrapper:STRING=${testWraper}"
     -P "${CMAKE_ROOT}/Modules/SquishTestScript.cmake"
     )
-  SET_TESTS_PROPERTIES(${testName}
+  set_tests_properties(${testName}
     PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED;ERROR;FATAL"
     )
-ENDMACRO(SQUISH_ADD_TEST)
+endmacro(SQUISH_ADD_TEST)
 
diff --git a/Modules/FindSubversion.cmake b/Modules/FindSubversion.cmake
index 4166d99ab..85c51059c 100644
--- a/Modules/FindSubversion.cmake
+++ b/Modules/FindSubversion.cmake
@@ -6,7 +6,7 @@
 #  SUBVERSION_FOUND - same as Subversion_FOUND, set for compatiblity reasons
 #
 # The minimum required version of Subversion can be specified using the
-# standard syntax, e.g. FIND_PACKAGE(Subversion 1.4)
+# standard syntax, e.g. find_package(Subversion 1.4)
 #
 # If the command line client executable is found two macros are defined:
 #  Subversion_WC_INFO(<dir> <var-prefix>)
@@ -25,13 +25,13 @@
 # variable:
 #  <var-prefix>_LAST_CHANGED_LOG - last log of base revision
 # Example usage:
-#  FIND_PACKAGE(Subversion)
-#  IF(SUBVERSION_FOUND)
+#  find_package(Subversion)
+#  if(SUBVERSION_FOUND)
 #    Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Project)
-#    MESSAGE("Current revision is ${Project_WC_REVISION}")
+#    message("Current revision is ${Project_WC_REVISION}")
 #    Subversion_WC_LOG(${PROJECT_SOURCE_DIR} Project)
-#    MESSAGE("Last changed log is ${Project_LAST_CHANGED_LOG}")
-#  ENDIF(SUBVERSION_FOUND)
+#    message("Last changed log is ${Project_LAST_CHANGED_LOG}")
+#  endif(SUBVERSION_FOUND)
 
 #=============================================================================
 # Copyright 2006-2009 Kitware, Inc.
@@ -47,85 +47,85 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PROGRAM(Subversion_SVN_EXECUTABLE svn
+find_program(Subversion_SVN_EXECUTABLE svn
   DOC "subversion command line client")
-MARK_AS_ADVANCED(Subversion_SVN_EXECUTABLE)
+mark_as_advanced(Subversion_SVN_EXECUTABLE)
 
-IF(Subversion_SVN_EXECUTABLE)
+if(Subversion_SVN_EXECUTABLE)
   # the subversion commands should be executed with the C locale, otherwise
   # the message (which are parsed) may be translated, Alex
-  SET(_Subversion_SAVED_LC_ALL "$ENV{LC_ALL}")
-  SET(ENV{LC_ALL} C)
+  set(_Subversion_SAVED_LC_ALL "$ENV{LC_ALL}")
+  set(ENV{LC_ALL} C)
 
-  EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} --version
+  execute_process(COMMAND ${Subversion_SVN_EXECUTABLE} --version
     OUTPUT_VARIABLE Subversion_VERSION_SVN
     OUTPUT_STRIP_TRAILING_WHITESPACE)
 
   # restore the previous LC_ALL
-  SET(ENV{LC_ALL} ${_Subversion_SAVED_LC_ALL})
+  set(ENV{LC_ALL} ${_Subversion_SAVED_LC_ALL})
 
-  STRING(REGEX REPLACE "^(.*\n)?svn, version ([.0-9]+).*"
+  string(REGEX REPLACE "^(.*\n)?svn, version ([.0-9]+).*"
     "\\2" Subversion_VERSION_SVN "${Subversion_VERSION_SVN}")
 
-  MACRO(Subversion_WC_INFO dir prefix)
+  macro(Subversion_WC_INFO dir prefix)
     # the subversion commands should be executed with the C locale, otherwise
     # the message (which are parsed) may be translated, Alex
-    SET(_Subversion_SAVED_LC_ALL "$ENV{LC_ALL}")
-    SET(ENV{LC_ALL} C)
+    set(_Subversion_SAVED_LC_ALL "$ENV{LC_ALL}")
+    set(ENV{LC_ALL} C)
 
-    EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} info ${dir}
+    execute_process(COMMAND ${Subversion_SVN_EXECUTABLE} info ${dir}
       OUTPUT_VARIABLE ${prefix}_WC_INFO
       ERROR_VARIABLE Subversion_svn_info_error
       RESULT_VARIABLE Subversion_svn_info_result
       OUTPUT_STRIP_TRAILING_WHITESPACE)
 
-    IF(NOT ${Subversion_svn_info_result} EQUAL 0)
-      MESSAGE(SEND_ERROR "Command \"${Subversion_SVN_EXECUTABLE} info ${dir}\" failed with output:\n${Subversion_svn_info_error}")
-    ELSE(NOT ${Subversion_svn_info_result} EQUAL 0)
+    if(NOT ${Subversion_svn_info_result} EQUAL 0)
+      message(SEND_ERROR "Command \"${Subversion_SVN_EXECUTABLE} info ${dir}\" failed with output:\n${Subversion_svn_info_error}")
+    else(NOT ${Subversion_svn_info_result} EQUAL 0)
 
-      STRING(REGEX REPLACE "^(.*\n)?URL: ([^\n]+).*"
+      string(REGEX REPLACE "^(.*\n)?URL: ([^\n]+).*"
         "\\2" ${prefix}_WC_URL "${${prefix}_WC_INFO}")
-      STRING(REGEX REPLACE "^(.*\n)?Repository Root: ([^\n]+).*"
+      string(REGEX REPLACE "^(.*\n)?Repository Root: ([^\n]+).*"
         "\\2" ${prefix}_WC_ROOT "${${prefix}_WC_INFO}")
-      STRING(REGEX REPLACE "^(.*\n)?Revision: ([^\n]+).*"
+      string(REGEX REPLACE "^(.*\n)?Revision: ([^\n]+).*"
         "\\2" ${prefix}_WC_REVISION "${${prefix}_WC_INFO}")
-      STRING(REGEX REPLACE "^(.*\n)?Last Changed Author: ([^\n]+).*"
+      string(REGEX REPLACE "^(.*\n)?Last Changed Author: ([^\n]+).*"
         "\\2" ${prefix}_WC_LAST_CHANGED_AUTHOR "${${prefix}_WC_INFO}")
-      STRING(REGEX REPLACE "^(.*\n)?Last Changed Rev: ([^\n]+).*"
+      string(REGEX REPLACE "^(.*\n)?Last Changed Rev: ([^\n]+).*"
         "\\2" ${prefix}_WC_LAST_CHANGED_REV "${${prefix}_WC_INFO}")
-      STRING(REGEX REPLACE "^(.*\n)?Last Changed Date: ([^\n]+).*"
+      string(REGEX REPLACE "^(.*\n)?Last Changed Date: ([^\n]+).*"
         "\\2" ${prefix}_WC_LAST_CHANGED_DATE "${${prefix}_WC_INFO}")
 
-    ENDIF(NOT ${Subversion_svn_info_result} EQUAL 0)
+    endif(NOT ${Subversion_svn_info_result} EQUAL 0)
 
     # restore the previous LC_ALL
-    SET(ENV{LC_ALL} ${_Subversion_SAVED_LC_ALL})
+    set(ENV{LC_ALL} ${_Subversion_SAVED_LC_ALL})
 
-  ENDMACRO(Subversion_WC_INFO)
+  endmacro(Subversion_WC_INFO)
 
-  MACRO(Subversion_WC_LOG dir prefix)
+  macro(Subversion_WC_LOG dir prefix)
     # This macro can block if the certificate is not signed:
     # svn ask you to accept the certificate and wait for your answer
     # This macro requires a svn server network access (Internet most of the time)
     # and can also be slow since it access the svn server
-    EXECUTE_PROCESS(COMMAND
+    execute_process(COMMAND
       ${Subversion_SVN_EXECUTABLE} --non-interactive log -r BASE ${dir}
       OUTPUT_VARIABLE ${prefix}_LAST_CHANGED_LOG
       ERROR_VARIABLE Subversion_svn_log_error
       RESULT_VARIABLE Subversion_svn_log_result
       OUTPUT_STRIP_TRAILING_WHITESPACE)
 
-    IF(NOT ${Subversion_svn_log_result} EQUAL 0)
-      MESSAGE(SEND_ERROR "Command \"${Subversion_SVN_EXECUTABLE} log -r BASE ${dir}\" failed with output:\n${Subversion_svn_log_error}")
-    ENDIF(NOT ${Subversion_svn_log_result} EQUAL 0)
-  ENDMACRO(Subversion_WC_LOG)
+    if(NOT ${Subversion_svn_log_result} EQUAL 0)
+      message(SEND_ERROR "Command \"${Subversion_SVN_EXECUTABLE} log -r BASE ${dir}\" failed with output:\n${Subversion_svn_log_error}")
+    endif(NOT ${Subversion_svn_log_result} EQUAL 0)
+  endmacro(Subversion_WC_LOG)
 
-ENDIF(Subversion_SVN_EXECUTABLE)
+endif(Subversion_SVN_EXECUTABLE)
 
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Subversion REQUIRED_VARS Subversion_SVN_EXECUTABLE
                                              VERSION_VAR Subversion_VERSION_SVN )
 
 # for compatibility
-SET(Subversion_FOUND ${SUBVERSION_FOUND})
-SET(Subversion_SVN_FOUND ${SUBVERSION_FOUND})
+set(Subversion_FOUND ${SUBVERSION_FOUND})
+set(Subversion_SVN_FOUND ${SUBVERSION_FOUND})
diff --git a/Modules/FindTCL.cmake b/Modules/FindTCL.cmake
index 763b5ef54..9fe2c7aeb 100644
--- a/Modules/FindTCL.cmake
+++ b/Modules/FindTCL.cmake
@@ -44,38 +44,38 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE(CMakeFindFrameworks)
-INCLUDE(FindTclsh)
-INCLUDE(FindWish)
+include(CMakeFindFrameworks)
+include(FindTclsh)
+include(FindWish)
 
-IF(TCLSH_VERSION_STRING)
-  SET(TCL_TCLSH_VERSION "${TCLSH_VERSION_STRING}")
-ELSE(TCLSH_VERSION_STRING)
-  GET_FILENAME_COMPONENT(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
-  GET_FILENAME_COMPONENT(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH)
-  STRING(REGEX REPLACE
+if(TCLSH_VERSION_STRING)
+  set(TCL_TCLSH_VERSION "${TCLSH_VERSION_STRING}")
+else(TCLSH_VERSION_STRING)
+  get_filename_component(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
+  get_filename_component(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH)
+  string(REGEX REPLACE
     "^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}")
-ENDIF(TCLSH_VERSION_STRING)
+endif(TCLSH_VERSION_STRING)
 
-GET_FILENAME_COMPONENT(TK_WISH_PATH "${TK_WISH}" PATH)
-GET_FILENAME_COMPONENT(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TK_WISH_PATH "${TK_WISH}" PATH)
+get_filename_component(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH)
+string(REGEX REPLACE
   "^.*wish([0-9]\\.*[0-9]).*$" "\\1" TK_WISH_VERSION "${TK_WISH}")
 
-GET_FILENAME_COMPONENT(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
-GET_FILENAME_COMPONENT(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH)
+get_filename_component(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
+get_filename_component(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH)
 
-GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
-GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
+get_filename_component(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH)
+string(REGEX REPLACE
   "^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_LIBRARY_VERSION "${TCL_LIBRARY}")
 
-GET_FILENAME_COMPONENT(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH)
-GET_FILENAME_COMPONENT(TK_LIBRARY_PATH_PARENT "${TK_LIBRARY_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH)
+get_filename_component(TK_LIBRARY_PATH_PARENT "${TK_LIBRARY_PATH}" PATH)
+string(REGEX REPLACE
   "^.*tk([0-9]\\.*[0-9]).*$" "\\1" TK_LIBRARY_VERSION "${TK_LIBRARY}")
 
-SET(TCLTK_POSSIBLE_LIB_PATHS
+set(TCLTK_POSSIBLE_LIB_PATHS
   "${TCL_INCLUDE_PATH_PARENT}/lib"
   "${TK_INCLUDE_PATH_PARENT}/lib"
   "${TCL_LIBRARY_PATH}"
@@ -84,12 +84,12 @@ SET(TCLTK_POSSIBLE_LIB_PATHS
   "${TK_WISH_PATH_PARENT}/lib"
   )
 
-IF(WIN32)
-  GET_FILENAME_COMPONENT(
+if(WIN32)
+  get_filename_component(
     ActiveTcl_CurrentVersion
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
     NAME)
-  SET(TCLTK_POSSIBLE_LIB_PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
+  set(TCLTK_POSSIBLE_LIB_PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/lib"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/lib"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/lib"
@@ -101,9 +101,9 @@ IF(WIN32)
     "C:/Program Files/Tcl/lib"
     "C:/Tcl/lib"
     )
-ENDIF(WIN32)
+endif(WIN32)
 
-FIND_LIBRARY(TCL_LIBRARY
+find_library(TCL_LIBRARY
   NAMES
   tcl
   tcl${TCL_LIBRARY_VERSION} tcl${TCL_TCLSH_VERSION} tcl${TK_WISH_VERSION}
@@ -116,7 +116,7 @@ FIND_LIBRARY(TCL_LIBRARY
   PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
   )
 
-FIND_LIBRARY(TK_LIBRARY
+find_library(TK_LIBRARY
   NAMES
   tk
   tk${TK_LIBRARY_VERSION} tk${TCL_TCLSH_VERSION} tk${TK_WISH_VERSION}
@@ -132,26 +132,26 @@ FIND_LIBRARY(TK_LIBRARY
 CMAKE_FIND_FRAMEWORKS(Tcl)
 CMAKE_FIND_FRAMEWORKS(Tk)
 
-SET(TCL_FRAMEWORK_INCLUDES)
-IF(Tcl_FRAMEWORKS)
-  IF(NOT TCL_INCLUDE_PATH)
-    FOREACH(dir ${Tcl_FRAMEWORKS})
-      SET(TCL_FRAMEWORK_INCLUDES ${TCL_FRAMEWORK_INCLUDES} ${dir}/Headers)
-    ENDFOREACH(dir)
-  ENDIF(NOT TCL_INCLUDE_PATH)
-ENDIF(Tcl_FRAMEWORKS)
+set(TCL_FRAMEWORK_INCLUDES)
+if(Tcl_FRAMEWORKS)
+  if(NOT TCL_INCLUDE_PATH)
+    foreach(dir ${Tcl_FRAMEWORKS})
+      set(TCL_FRAMEWORK_INCLUDES ${TCL_FRAMEWORK_INCLUDES} ${dir}/Headers)
+    endforeach(dir)
+  endif(NOT TCL_INCLUDE_PATH)
+endif(Tcl_FRAMEWORKS)
 
-SET(TK_FRAMEWORK_INCLUDES)
-IF(Tk_FRAMEWORKS)
-  IF(NOT TK_INCLUDE_PATH)
-    FOREACH(dir ${Tk_FRAMEWORKS})
-      SET(TK_FRAMEWORK_INCLUDES ${TK_FRAMEWORK_INCLUDES}
+set(TK_FRAMEWORK_INCLUDES)
+if(Tk_FRAMEWORKS)
+  if(NOT TK_INCLUDE_PATH)
+    foreach(dir ${Tk_FRAMEWORKS})
+      set(TK_FRAMEWORK_INCLUDES ${TK_FRAMEWORK_INCLUDES}
         ${dir}/Headers ${dir}/PrivateHeaders)
-    ENDFOREACH(dir)
-  ENDIF(NOT TK_INCLUDE_PATH)
-ENDIF(Tk_FRAMEWORKS)
+    endforeach(dir)
+  endif(NOT TK_INCLUDE_PATH)
+endif(Tk_FRAMEWORKS)
 
-SET(TCLTK_POSSIBLE_INCLUDE_PATHS
+set(TCLTK_POSSIBLE_INCLUDE_PATHS
   "${TCL_LIBRARY_PATH_PARENT}/include"
   "${TK_LIBRARY_PATH_PARENT}/include"
   "${TCL_INCLUDE_PATH}"
@@ -170,8 +170,8 @@ SET(TCLTK_POSSIBLE_INCLUDE_PATHS
   /usr/include/tcl8.0
   )
 
-IF(WIN32)
-  SET(TCLTK_POSSIBLE_INCLUDE_PATHS ${TCLTK_POSSIBLE_INCLUDE_PATHS}
+if(WIN32)
+  set(TCLTK_POSSIBLE_INCLUDE_PATHS ${TCLTK_POSSIBLE_INCLUDE_PATHS}
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/include"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/include"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/include"
@@ -183,31 +183,31 @@ IF(WIN32)
     "C:/Program Files/Tcl/include"
     "C:/Tcl/include"
     )
-ENDIF(WIN32)
+endif(WIN32)
 
-FIND_PATH(TCL_INCLUDE_PATH
+find_path(TCL_INCLUDE_PATH
   NAMES tcl.h
   HINTS ${TCLTK_POSSIBLE_INCLUDE_PATHS}
   )
 
-FIND_PATH(TK_INCLUDE_PATH
+find_path(TK_INCLUDE_PATH
   NAMES tk.h
   HINTS ${TCLTK_POSSIBLE_INCLUDE_PATHS}
   )
 
 # handle the QUIETLY and REQUIRED arguments and set TCL_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(TCL DEFAULT_MSG TCL_LIBRARY TCL_INCLUDE_PATH)
-SET(TCLTK_FIND_REQUIRED ${TCL_FIND_REQUIRED})
-SET(TCLTK_FIND_QUIETLY  ${TCL_FIND_QUIETLY})
+set(TCLTK_FIND_REQUIRED ${TCL_FIND_REQUIRED})
+set(TCLTK_FIND_QUIETLY  ${TCL_FIND_QUIETLY})
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(TCLTK DEFAULT_MSG TCL_LIBRARY TCL_INCLUDE_PATH TK_LIBRARY TK_INCLUDE_PATH)
-SET(TK_FIND_REQUIRED ${TCL_FIND_REQUIRED})
-SET(TK_FIND_QUIETLY  ${TCL_FIND_QUIETLY})
+set(TK_FIND_REQUIRED ${TCL_FIND_REQUIRED})
+set(TK_FIND_QUIETLY  ${TCL_FIND_QUIETLY})
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(TK DEFAULT_MSG TK_LIBRARY TK_INCLUDE_PATH)
 
-MARK_AS_ADVANCED(
+mark_as_advanced(
   TCL_INCLUDE_PATH
   TK_INCLUDE_PATH
   TCL_LIBRARY
diff --git a/Modules/FindTIFF.cmake b/Modules/FindTIFF.cmake
index be410fd03..c09c4c947 100644
--- a/Modules/FindTIFF.cmake
+++ b/Modules/FindTIFF.cmake
@@ -20,29 +20,29 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PATH(TIFF_INCLUDE_DIR tiff.h)
+find_path(TIFF_INCLUDE_DIR tiff.h)
 
-SET(TIFF_NAMES ${TIFF_NAMES} tiff libtiff tiff3 libtiff3)
-FIND_LIBRARY(TIFF_LIBRARY NAMES ${TIFF_NAMES} )
+set(TIFF_NAMES ${TIFF_NAMES} tiff libtiff tiff3 libtiff3)
+find_library(TIFF_LIBRARY NAMES ${TIFF_NAMES} )
 
-IF(TIFF_INCLUDE_DIR AND EXISTS "${TIFF_INCLUDE_DIR}/tiffvers.h")
-    FILE(STRINGS "${TIFF_INCLUDE_DIR}/tiffvers.h" tiff_version_str
+if(TIFF_INCLUDE_DIR AND EXISTS "${TIFF_INCLUDE_DIR}/tiffvers.h")
+    file(STRINGS "${TIFF_INCLUDE_DIR}/tiffvers.h" tiff_version_str
          REGEX "^#define[\t ]+TIFFLIB_VERSION_STR[\t ]+\"LIBTIFF, Version .*")
 
-    STRING(REGEX REPLACE "^#define[\t ]+TIFFLIB_VERSION_STR[\t ]+\"LIBTIFF, Version +([^ \\n]*).*"
+    string(REGEX REPLACE "^#define[\t ]+TIFFLIB_VERSION_STR[\t ]+\"LIBTIFF, Version +([^ \\n]*).*"
            "\\1" TIFF_VERSION_STRING "${tiff_version_str}")
-    UNSET(tiff_version_str)
-ENDIF()
+    unset(tiff_version_str)
+endif()
 
 # handle the QUIETLY and REQUIRED arguments and set TIFF_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(TIFF
                                   REQUIRED_VARS TIFF_LIBRARY TIFF_INCLUDE_DIR
                                   VERSION_VAR TIFF_VERSION_STRING)
 
-IF(TIFF_FOUND)
-  SET( TIFF_LIBRARIES ${TIFF_LIBRARY} )
-ENDIF(TIFF_FOUND)
+if(TIFF_FOUND)
+  set( TIFF_LIBRARIES ${TIFF_LIBRARY} )
+endif(TIFF_FOUND)
 
-MARK_AS_ADVANCED(TIFF_INCLUDE_DIR TIFF_LIBRARY)
+mark_as_advanced(TIFF_INCLUDE_DIR TIFF_LIBRARY)
diff --git a/Modules/FindTclStub.cmake b/Modules/FindTclStub.cmake
index 1e8350811..cb7727121 100644
--- a/Modules/FindTclStub.cmake
+++ b/Modules/FindTclStub.cmake
@@ -34,32 +34,32 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE(FindTCL)
+include(FindTCL)
 
-GET_FILENAME_COMPONENT(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
-GET_FILENAME_COMPONENT(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
+get_filename_component(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH)
+string(REGEX REPLACE
   "^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}")
 
-GET_FILENAME_COMPONENT(TK_WISH_PATH "${TK_WISH}" PATH)
-GET_FILENAME_COMPONENT(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TK_WISH_PATH "${TK_WISH}" PATH)
+get_filename_component(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH)
+string(REGEX REPLACE
   "^.*wish([0-9]\\.*[0-9]).*$" "\\1" TK_WISH_VERSION "${TK_WISH}")
 
-GET_FILENAME_COMPONENT(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
-GET_FILENAME_COMPONENT(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH)
+get_filename_component(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
+get_filename_component(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH)
 
-GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
-GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
+get_filename_component(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH)
+string(REGEX REPLACE
   "^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_LIBRARY_VERSION "${TCL_LIBRARY}")
 
-GET_FILENAME_COMPONENT(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH)
-GET_FILENAME_COMPONENT(TK_LIBRARY_PATH_PARENT "${TK_LIBRARY_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH)
+get_filename_component(TK_LIBRARY_PATH_PARENT "${TK_LIBRARY_PATH}" PATH)
+string(REGEX REPLACE
   "^.*tk([0-9]\\.*[0-9]).*$" "\\1" TK_LIBRARY_VERSION "${TK_LIBRARY}")
 
-SET(TCLTK_POSSIBLE_LIB_PATHS
+set(TCLTK_POSSIBLE_LIB_PATHS
   "${TCL_INCLUDE_PATH_PARENT}/lib"
   "${TK_INCLUDE_PATH_PARENT}/lib"
   "${TCL_LIBRARY_PATH}"
@@ -68,12 +68,12 @@ SET(TCLTK_POSSIBLE_LIB_PATHS
   "${TK_WISH_PATH_PARENT}/lib"
 )
 
-IF(WIN32)
-  GET_FILENAME_COMPONENT(
+if(WIN32)
+  get_filename_component(
     ActiveTcl_CurrentVersion
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
     NAME)
-  SET(TCLTK_POSSIBLE_LIB_PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
+  set(TCLTK_POSSIBLE_LIB_PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/lib"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/lib"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/lib"
@@ -85,9 +85,9 @@ IF(WIN32)
     "C:/Program Files/Tcl/lib"
     "C:/Tcl/lib"
     )
-ENDIF(WIN32)
+endif(WIN32)
 
-FIND_LIBRARY(TCL_STUB_LIBRARY
+find_library(TCL_STUB_LIBRARY
   NAMES
   tclstub
   tclstub${TK_LIBRARY_VERSION} tclstub${TCL_TCLSH_VERSION} tclstub${TK_WISH_VERSION}
@@ -100,7 +100,7 @@ FIND_LIBRARY(TCL_STUB_LIBRARY
   PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
 )
 
-FIND_LIBRARY(TK_STUB_LIBRARY
+find_library(TK_STUB_LIBRARY
   NAMES
   tkstub
   tkstub${TCL_LIBRARY_VERSION} tkstub${TCL_TCLSH_VERSION} tkstub${TK_WISH_VERSION}
@@ -113,7 +113,7 @@ FIND_LIBRARY(TK_STUB_LIBRARY
   PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
 )
 
-FIND_LIBRARY(TTK_STUB_LIBRARY
+find_library(TTK_STUB_LIBRARY
   NAMES
   ttkstub
   ttkstub${TCL_LIBRARY_VERSION} ttkstub${TCL_TCLSH_VERSION} ttkstub${TK_WISH_VERSION}
@@ -124,7 +124,7 @@ FIND_LIBRARY(TTK_STUB_LIBRARY
   PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
 )
 
-MARK_AS_ADVANCED(
+mark_as_advanced(
   TCL_STUB_LIBRARY
   TK_STUB_LIBRARY
   )
diff --git a/Modules/FindTclsh.cmake b/Modules/FindTclsh.cmake
index fdeafffaf..1e356f526 100644
--- a/Modules/FindTclsh.cmake
+++ b/Modules/FindTclsh.cmake
@@ -20,29 +20,29 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-IF(CYGWIN)
-  FIND_PROGRAM(TCL_TCLSH NAMES cygtclsh83 cygtclsh80)
-ENDIF(CYGWIN)
+if(CYGWIN)
+  find_program(TCL_TCLSH NAMES cygtclsh83 cygtclsh80)
+endif(CYGWIN)
 
-GET_FILENAME_COMPONENT(TK_WISH_PATH "${TK_WISH}" PATH)
-GET_FILENAME_COMPONENT(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TK_WISH_PATH "${TK_WISH}" PATH)
+get_filename_component(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH)
+string(REGEX REPLACE
   "^.*wish([0-9]\\.*[0-9]).*$" "\\1" TK_WISH_VERSION "${TK_WISH}")
 
-GET_FILENAME_COMPONENT(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
-GET_FILENAME_COMPONENT(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH)
+get_filename_component(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
+get_filename_component(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH)
 
-GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
-GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
+get_filename_component(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH)
+string(REGEX REPLACE
   "^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_LIBRARY_VERSION "${TCL_LIBRARY}")
 
-GET_FILENAME_COMPONENT(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH)
-GET_FILENAME_COMPONENT(TK_LIBRARY_PATH_PARENT "${TK_LIBRARY_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH)
+get_filename_component(TK_LIBRARY_PATH_PARENT "${TK_LIBRARY_PATH}" PATH)
+string(REGEX REPLACE
   "^.*tk([0-9]\\.*[0-9]).*$" "\\1" TK_LIBRARY_VERSION "${TK_LIBRARY}")
 
-SET(TCLTK_POSSIBLE_BIN_PATHS
+set(TCLTK_POSSIBLE_BIN_PATHS
   "${TCL_INCLUDE_PATH_PARENT}/bin"
   "${TK_INCLUDE_PATH_PARENT}/bin"
   "${TCL_LIBRARY_PATH_PARENT}/bin"
@@ -50,12 +50,12 @@ SET(TCLTK_POSSIBLE_BIN_PATHS
   "${TK_WISH_PATH_PARENT}/bin"
   )
 
-IF(WIN32)
-  GET_FILENAME_COMPONENT(
+if(WIN32)
+  get_filename_component(
     ActiveTcl_CurrentVersion
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
     NAME)
-  SET(TCLTK_POSSIBLE_BIN_PATHS ${TCLTK_POSSIBLE_BIN_PATHS}
+  set(TCLTK_POSSIBLE_BIN_PATHS ${TCLTK_POSSIBLE_BIN_PATHS}
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/bin"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/bin"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/bin"
@@ -64,9 +64,9 @@ IF(WIN32)
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/bin"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/bin"
     )
-ENDIF(WIN32)
+endif(WIN32)
 
-SET(TCL_TCLSH_NAMES
+set(TCL_TCLSH_NAMES
   tclsh
   tclsh${TCL_LIBRARY_VERSION} tclsh${TK_LIBRARY_VERSION} tclsh${TK_WISH_VERSION}
   tclsh86 tclsh8.6
@@ -77,24 +77,24 @@ SET(TCL_TCLSH_NAMES
   tclsh80 tclsh8.0
   )
 
-FIND_PROGRAM(TCL_TCLSH
+find_program(TCL_TCLSH
   NAMES ${TCL_TCLSH_NAMES}
   HINTS ${TCLTK_POSSIBLE_BIN_PATHS}
   )
 
-IF(TCL_TCLSH)
-   EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -E echo puts "\$tcl_version"
+if(TCL_TCLSH)
+   execute_process(COMMAND "${CMAKE_COMMAND}" -E echo puts "\$tcl_version"
                    COMMAND "${TCL_TCLSH}"
                    OUTPUT_VARIABLE TCLSH_VERSION_STRING
                    ERROR_QUIET
                    OUTPUT_STRIP_TRAILING_WHITESPACE)
-ENDIF(TCL_TCLSH)
+endif(TCL_TCLSH)
 
 # handle the QUIETLY and REQUIRED arguments and set TIFF_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Tclsh
                                   REQUIRED_VARS TCL_TCLSH
                                   VERSION_VAR TCLSH_VERSION_STRING)
 
-MARK_AS_ADVANCED(TCL_TCLSH)
+mark_as_advanced(TCL_TCLSH)
diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake
index bb1ba3c9f..22bffef4a 100644
--- a/Modules/FindThreads.cmake
+++ b/Modules/FindThreads.cmake
@@ -21,117 +21,117 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE (CheckIncludeFiles)
-INCLUDE (CheckLibraryExists)
-INCLUDE (CheckSymbolExists)
-SET(Threads_FOUND FALSE)
+include (CheckIncludeFiles)
+include (CheckLibraryExists)
+include (CheckSymbolExists)
+set(Threads_FOUND FALSE)
 
 # Do we have sproc?
-IF(CMAKE_SYSTEM MATCHES IRIX AND NOT CMAKE_THREAD_PREFER_PTHREAD)
+if(CMAKE_SYSTEM MATCHES IRIX AND NOT CMAKE_THREAD_PREFER_PTHREAD)
   CHECK_INCLUDE_FILES("sys/types.h;sys/prctl.h"  CMAKE_HAVE_SPROC_H)
-ENDIF()
+endif()
 
-IF(CMAKE_HAVE_SPROC_H AND NOT CMAKE_THREAD_PREFER_PTHREAD)
+if(CMAKE_HAVE_SPROC_H AND NOT CMAKE_THREAD_PREFER_PTHREAD)
   # We have sproc
-  SET(CMAKE_USE_SPROC_INIT 1)
-ELSE()
+  set(CMAKE_USE_SPROC_INIT 1)
+else()
   # Do we have pthreads?
   CHECK_INCLUDE_FILES("pthread.h" CMAKE_HAVE_PTHREAD_H)
-  IF(CMAKE_HAVE_PTHREAD_H)
+  if(CMAKE_HAVE_PTHREAD_H)
 
     #
     # We have pthread.h
     # Let's check for the library now.
     #
-    SET(CMAKE_HAVE_THREADS_LIBRARY)
-    IF(NOT THREADS_HAVE_PTHREAD_ARG)
+    set(CMAKE_HAVE_THREADS_LIBRARY)
+    if(NOT THREADS_HAVE_PTHREAD_ARG)
       # Check if pthread functions are in normal C library
       CHECK_SYMBOL_EXISTS(pthread_create pthread.h CMAKE_HAVE_LIBC_CREATE)
-      IF(CMAKE_HAVE_LIBC_CREATE)
-        SET(CMAKE_THREAD_LIBS_INIT "")
-        SET(CMAKE_HAVE_THREADS_LIBRARY 1)
-        SET(Threads_FOUND TRUE)
-      ENDIF()
+      if(CMAKE_HAVE_LIBC_CREATE)
+        set(CMAKE_THREAD_LIBS_INIT "")
+        set(CMAKE_HAVE_THREADS_LIBRARY 1)
+        set(Threads_FOUND TRUE)
+      endif()
 
-      IF(NOT CMAKE_HAVE_THREADS_LIBRARY)
+      if(NOT CMAKE_HAVE_THREADS_LIBRARY)
         # Do we have -lpthreads
         CHECK_LIBRARY_EXISTS(pthreads pthread_create "" CMAKE_HAVE_PTHREADS_CREATE)
-        IF(CMAKE_HAVE_PTHREADS_CREATE)
-          SET(CMAKE_THREAD_LIBS_INIT "-lpthreads")
-          SET(CMAKE_HAVE_THREADS_LIBRARY 1)
-          SET(Threads_FOUND TRUE)
-        ENDIF()
+        if(CMAKE_HAVE_PTHREADS_CREATE)
+          set(CMAKE_THREAD_LIBS_INIT "-lpthreads")
+          set(CMAKE_HAVE_THREADS_LIBRARY 1)
+          set(Threads_FOUND TRUE)
+        endif()
 
         # Ok, how about -lpthread
         CHECK_LIBRARY_EXISTS(pthread pthread_create "" CMAKE_HAVE_PTHREAD_CREATE)
-        IF(CMAKE_HAVE_PTHREAD_CREATE)
-          SET(CMAKE_THREAD_LIBS_INIT "-lpthread")
-          SET(CMAKE_HAVE_THREADS_LIBRARY 1)
-          SET(Threads_FOUND TRUE)
-        ENDIF()
+        if(CMAKE_HAVE_PTHREAD_CREATE)
+          set(CMAKE_THREAD_LIBS_INIT "-lpthread")
+          set(CMAKE_HAVE_THREADS_LIBRARY 1)
+          set(Threads_FOUND TRUE)
+        endif()
 
-        IF(CMAKE_SYSTEM MATCHES "SunOS.*")
+        if(CMAKE_SYSTEM MATCHES "SunOS.*")
           # On sun also check for -lthread
           CHECK_LIBRARY_EXISTS(thread thr_create "" CMAKE_HAVE_THR_CREATE)
-          IF(CMAKE_HAVE_THR_CREATE)
-            SET(CMAKE_THREAD_LIBS_INIT "-lthread")
-            SET(CMAKE_HAVE_THREADS_LIBRARY 1)
-            SET(Threads_FOUND TRUE)
-          ENDIF()
-        ENDIF(CMAKE_SYSTEM MATCHES "SunOS.*")
-      ENDIF(NOT CMAKE_HAVE_THREADS_LIBRARY)
-    ENDIF(NOT THREADS_HAVE_PTHREAD_ARG)
+          if(CMAKE_HAVE_THR_CREATE)
+            set(CMAKE_THREAD_LIBS_INIT "-lthread")
+            set(CMAKE_HAVE_THREADS_LIBRARY 1)
+            set(Threads_FOUND TRUE)
+          endif()
+        endif(CMAKE_SYSTEM MATCHES "SunOS.*")
+      endif(NOT CMAKE_HAVE_THREADS_LIBRARY)
+    endif(NOT THREADS_HAVE_PTHREAD_ARG)
 
-    IF(NOT CMAKE_HAVE_THREADS_LIBRARY)
+    if(NOT CMAKE_HAVE_THREADS_LIBRARY)
       # If we did not found -lpthread, -lpthread, or -lthread, look for -pthread
-      IF("THREADS_HAVE_PTHREAD_ARG" MATCHES "^THREADS_HAVE_PTHREAD_ARG")
-        MESSAGE(STATUS "Check if compiler accepts -pthread")
-        TRY_RUN(THREADS_PTHREAD_ARG THREADS_HAVE_PTHREAD_ARG
+      if("THREADS_HAVE_PTHREAD_ARG" MATCHES "^THREADS_HAVE_PTHREAD_ARG")
+        message(STATUS "Check if compiler accepts -pthread")
+        try_run(THREADS_PTHREAD_ARG THREADS_HAVE_PTHREAD_ARG
           ${CMAKE_BINARY_DIR}
           ${CMAKE_ROOT}/Modules/CheckForPthreads.c
           CMAKE_FLAGS -DLINK_LIBRARIES:STRING=-pthread
           COMPILE_OUTPUT_VARIABLE OUTPUT)
 
-        IF(THREADS_HAVE_PTHREAD_ARG)
-          IF(THREADS_PTHREAD_ARG MATCHES "^2$")
-            SET(Threads_FOUND TRUE)
-            MESSAGE(STATUS "Check if compiler accepts -pthread - yes")
-          ELSE()
-            MESSAGE(STATUS "Check if compiler accepts -pthread - no")
-            FILE(APPEND
+        if(THREADS_HAVE_PTHREAD_ARG)
+          if(THREADS_PTHREAD_ARG MATCHES "^2$")
+            set(Threads_FOUND TRUE)
+            message(STATUS "Check if compiler accepts -pthread - yes")
+          else()
+            message(STATUS "Check if compiler accepts -pthread - no")
+            file(APPEND
               ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
               "Determining if compiler accepts -pthread returned ${THREADS_PTHREAD_ARG} instead of 2. The compiler had the following output:\n${OUTPUT}\n\n")
-          ENDIF()
-        ELSE()
-          MESSAGE(STATUS "Check if compiler accepts -pthread - no")
-          FILE(APPEND
+          endif()
+        else()
+          message(STATUS "Check if compiler accepts -pthread - no")
+          file(APPEND
             ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
             "Determining if compiler accepts -pthread failed with the following output:\n${OUTPUT}\n\n")
-        ENDIF()
+        endif()
 
-      ENDIF("THREADS_HAVE_PTHREAD_ARG" MATCHES "^THREADS_HAVE_PTHREAD_ARG")
+      endif("THREADS_HAVE_PTHREAD_ARG" MATCHES "^THREADS_HAVE_PTHREAD_ARG")
 
-      IF(THREADS_HAVE_PTHREAD_ARG)
-        SET(Threads_FOUND TRUE)
-        SET(CMAKE_THREAD_LIBS_INIT "-pthread")
-      ENDIF()
+      if(THREADS_HAVE_PTHREAD_ARG)
+        set(Threads_FOUND TRUE)
+        set(CMAKE_THREAD_LIBS_INIT "-pthread")
+      endif()
 
-    ENDIF(NOT CMAKE_HAVE_THREADS_LIBRARY)
-  ENDIF(CMAKE_HAVE_PTHREAD_H)
-ENDIF()
+    endif(NOT CMAKE_HAVE_THREADS_LIBRARY)
+  endif(CMAKE_HAVE_PTHREAD_H)
+endif()
 
-IF(CMAKE_THREAD_LIBS_INIT OR CMAKE_HAVE_LIBC_CREATE)
-  SET(CMAKE_USE_PTHREADS_INIT 1)
-  SET(Threads_FOUND TRUE)
-ENDIF()
+if(CMAKE_THREAD_LIBS_INIT OR CMAKE_HAVE_LIBC_CREATE)
+  set(CMAKE_USE_PTHREADS_INIT 1)
+  set(Threads_FOUND TRUE)
+endif()
 
-IF(CMAKE_SYSTEM MATCHES "Windows")
-  SET(CMAKE_USE_WIN32_THREADS_INIT 1)
-  SET(Threads_FOUND TRUE)
-ENDIF()
+if(CMAKE_SYSTEM MATCHES "Windows")
+  set(CMAKE_USE_WIN32_THREADS_INIT 1)
+  set(Threads_FOUND TRUE)
+endif()
 
-IF(CMAKE_USE_PTHREADS_INIT)
-  IF(CMAKE_SYSTEM MATCHES "HP-UX-*")
+if(CMAKE_USE_PTHREADS_INIT)
+  if(CMAKE_SYSTEM MATCHES "HP-UX-*")
     # Use libcma if it exists and can be used.  It provides more
     # symbols than the plain pthread library.  CMA threads
     # have actually been deprecated:
@@ -141,26 +141,26 @@ IF(CMAKE_USE_PTHREADS_INIT)
     # The CMAKE_HP_PTHREADS setting actually indicates whether CMA threads
     # are available.
     CHECK_LIBRARY_EXISTS(cma pthread_attr_create "" CMAKE_HAVE_HP_CMA)
-    IF(CMAKE_HAVE_HP_CMA)
-      SET(CMAKE_THREAD_LIBS_INIT "-lcma")
-      SET(CMAKE_HP_PTHREADS_INIT 1)
-      SET(Threads_FOUND TRUE)
-    ENDIF(CMAKE_HAVE_HP_CMA)
-    SET(CMAKE_USE_PTHREADS_INIT 1)
-  ENDIF()
+    if(CMAKE_HAVE_HP_CMA)
+      set(CMAKE_THREAD_LIBS_INIT "-lcma")
+      set(CMAKE_HP_PTHREADS_INIT 1)
+      set(Threads_FOUND TRUE)
+    endif(CMAKE_HAVE_HP_CMA)
+    set(CMAKE_USE_PTHREADS_INIT 1)
+  endif()
 
-  IF(CMAKE_SYSTEM MATCHES "OSF1-V*")
-    SET(CMAKE_USE_PTHREADS_INIT 0)
-    SET(CMAKE_THREAD_LIBS_INIT )
-  ENDIF()
+  if(CMAKE_SYSTEM MATCHES "OSF1-V*")
+    set(CMAKE_USE_PTHREADS_INIT 0)
+    set(CMAKE_THREAD_LIBS_INIT )
+  endif()
 
-  IF(CMAKE_SYSTEM MATCHES "CYGWIN_NT*")
-    SET(CMAKE_USE_PTHREADS_INIT 1)
-    SET(Threads_FOUND TRUE)
-    SET(CMAKE_THREAD_LIBS_INIT )
-    SET(CMAKE_USE_WIN32_THREADS_INIT 0)
-  ENDIF()
-ENDIF(CMAKE_USE_PTHREADS_INIT)
+  if(CMAKE_SYSTEM MATCHES "CYGWIN_NT*")
+    set(CMAKE_USE_PTHREADS_INIT 1)
+    set(Threads_FOUND TRUE)
+    set(CMAKE_THREAD_LIBS_INIT )
+    set(CMAKE_USE_WIN32_THREADS_INIT 0)
+  endif()
+endif(CMAKE_USE_PTHREADS_INIT)
 
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Threads DEFAULT_MSG Threads_FOUND)
diff --git a/Modules/FindUnixCommands.cmake b/Modules/FindUnixCommands.cmake
index 4ada05c47..a69e3f10c 100644
--- a/Modules/FindUnixCommands.cmake
+++ b/Modules/FindUnixCommands.cmake
@@ -15,9 +15,9 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE(FindCygwin)
+include(FindCygwin)
 
-FIND_PROGRAM(BASH
+find_program(BASH
   bash
   ${CYGWIN_INSTALL_PATH}/bin
   /bin
@@ -25,11 +25,11 @@ FIND_PROGRAM(BASH
   /usr/local/bin
   /sbin
 )
-MARK_AS_ADVANCED(
+mark_as_advanced(
   BASH
 )
 
-FIND_PROGRAM(CP
+find_program(CP
   cp
   ${CYGWIN_INSTALL_PATH}/bin
   /bin
@@ -37,11 +37,11 @@ FIND_PROGRAM(CP
   /usr/local/bin
   /sbin
 )
-MARK_AS_ADVANCED(
+mark_as_advanced(
   CP
 )
 
-FIND_PROGRAM(GZIP
+find_program(GZIP
   gzip
   ${CYGWIN_INSTALL_PATH}/bin
   /bin
@@ -49,11 +49,11 @@ FIND_PROGRAM(GZIP
   /usr/local/bin
   /sbin
 )
-MARK_AS_ADVANCED(
+mark_as_advanced(
   GZIP
 )
 
-FIND_PROGRAM(MV
+find_program(MV
   mv
   ${CYGWIN_INSTALL_PATH}/bin
   /bin
@@ -61,11 +61,11 @@ FIND_PROGRAM(MV
   /usr/local/bin
   /sbin
 )
-MARK_AS_ADVANCED(
+mark_as_advanced(
   MV
 )
 
-FIND_PROGRAM(RM
+find_program(RM
   rm
   ${CYGWIN_INSTALL_PATH}/bin
   /bin
@@ -73,11 +73,11 @@ FIND_PROGRAM(RM
   /usr/local/bin
   /sbin
 )
-MARK_AS_ADVANCED(
+mark_as_advanced(
   RM
 )
 
-FIND_PROGRAM(TAR
+find_program(TAR
   NAMES
   tar
   gtar
@@ -88,6 +88,6 @@ FIND_PROGRAM(TAR
   /usr/local/bin
   /sbin
 )
-MARK_AS_ADVANCED(
+mark_as_advanced(
   TAR
 )
diff --git a/Modules/FindVTK.cmake b/Modules/FindVTK.cmake
index fbdac7f8f..a6257f5e6 100644
--- a/Modules/FindVTK.cmake
+++ b/Modules/FindVTK.cmake
@@ -41,53 +41,53 @@
 #  License text for the above reference.)
 
 # Assume not found.
-SET(VTK_FOUND 0)
+set(VTK_FOUND 0)
 
 # VTK 4.0 did not provide VTKConfig.cmake.
-IF("${VTK_FIND_VERSION}" VERSION_LESS 4.1)
-  SET(_VTK_40_ALLOW 1)
-  IF(VTK_FIND_VERSION)
-    SET(_VTK_40_ONLY 1)
-  ENDIF()
-ENDIF()
+if("${VTK_FIND_VERSION}" VERSION_LESS 4.1)
+  set(_VTK_40_ALLOW 1)
+  if(VTK_FIND_VERSION)
+    set(_VTK_40_ONLY 1)
+  endif()
+endif()
 
 # Construct consitent 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.")
-ENDIF()
-SET(VTK_DIR_MESSAGE "VTK not found.  Set the VTK_DIR cmake cache entry to the ${VTK_DIR_DESCRIPTION}")
+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.")
+endif()
+set(VTK_DIR_MESSAGE "VTK not found.  Set the VTK_DIR cmake cache entry to the ${VTK_DIR_DESCRIPTION}")
 
 # Check whether VTK 4.0 has already been found.
-IF(_VTK_40_ALLOW AND VTK_DIR)
-  IF(EXISTS ${VTK_DIR}/UseVTK.cmake AND NOT EXISTS ${VTK_DIR}/VTKConfig.cmake)
-    SET(VTK_FOUND 1)
-    INCLUDE(UseVTKConfig40) # No VTKConfig; load VTK 4.0 settings.
-  ENDIF()
-ENDIF()
+if(_VTK_40_ALLOW AND VTK_DIR)
+  if(EXISTS ${VTK_DIR}/UseVTK.cmake AND NOT EXISTS ${VTK_DIR}/VTKConfig.cmake)
+    set(VTK_FOUND 1)
+    include(UseVTKConfig40) # No VTKConfig; load VTK 4.0 settings.
+  endif()
+endif()
 
 # Use the Config mode of the find_package() command to find VTKConfig.
 # If this succeeds (possibly because VTK_DIR is already set), the
 # command will have already loaded VTKConfig.cmake and set VTK_FOUND.
-IF(NOT _VTK_40_ONLY AND NOT VTK_FOUND)
-  FIND_PACKAGE(VTK QUIET NO_MODULE)
-ENDIF()
+if(NOT _VTK_40_ONLY AND NOT VTK_FOUND)
+  find_package(VTK QUIET NO_MODULE)
+endif()
 
 # Special search for VTK 4.0.
-IF(_VTK_40_ALLOW AND NOT VTK_DIR)
+if(_VTK_40_ALLOW AND NOT VTK_DIR)
   # Old scripts may set these directories in the CMakeCache.txt file.
   # They can tell us where to find VTKConfig.cmake.
-  SET(VTK_DIR_SEARCH_LEGACY "")
-  IF(VTK_BINARY_PATH AND USE_BUILT_VTK)
-    SET(VTK_DIR_SEARCH_LEGACY ${VTK_DIR_SEARCH_LEGACY} ${VTK_BINARY_PATH})
-  ENDIF(VTK_BINARY_PATH AND USE_BUILT_VTK)
-  IF(VTK_INSTALL_PATH AND USE_INSTALLED_VTK)
-    SET(VTK_DIR_SEARCH_LEGACY ${VTK_DIR_SEARCH_LEGACY}
+  set(VTK_DIR_SEARCH_LEGACY "")
+  if(VTK_BINARY_PATH AND USE_BUILT_VTK)
+    set(VTK_DIR_SEARCH_LEGACY ${VTK_DIR_SEARCH_LEGACY} ${VTK_BINARY_PATH})
+  endif(VTK_BINARY_PATH AND USE_BUILT_VTK)
+  if(VTK_INSTALL_PATH AND USE_INSTALLED_VTK)
+    set(VTK_DIR_SEARCH_LEGACY ${VTK_DIR_SEARCH_LEGACY}
         ${VTK_INSTALL_PATH}/lib/vtk)
-  ENDIF(VTK_INSTALL_PATH AND USE_INSTALLED_VTK)
+  endif(VTK_INSTALL_PATH AND USE_INSTALLED_VTK)
 
   # Look for UseVTK.cmake in build trees or under <prefix>/include/vtk.
-  FIND_PATH(VTK_DIR
+  find_path(VTK_DIR
     NAMES UseVTK.cmake
     PATH_SUFFIXES vtk-4.0 vtk
     HINTS $ENV{VTK_DIR}
@@ -114,28 +114,28 @@ IF(_VTK_40_ALLOW AND NOT VTK_DIR)
     DOC "The ${VTK_DIR_DESCRIPTION}"
     )
 
-  IF(VTK_DIR)
-    IF(EXISTS ${VTK_DIR}/UseVTK.cmake AND NOT EXISTS ${VTK_DIR}/VTKConfig.cmake)
-      SET(VTK_FOUND 1)
-      INCLUDE(UseVTKConfig40) # No VTKConfig; load VTK 4.0 settings.
-    ELSE()
+  if(VTK_DIR)
+    if(EXISTS ${VTK_DIR}/UseVTK.cmake AND NOT EXISTS ${VTK_DIR}/VTKConfig.cmake)
+      set(VTK_FOUND 1)
+      include(UseVTKConfig40) # No VTKConfig; load VTK 4.0 settings.
+    else()
       # We found the wrong version.  Pretend we did not find it.
-      SET(VTK_DIR "VTK_DIR-NOTFOUND" CACHE PATH "The ${VTK_DIR_DESCRIPTION}" FORCE)
-    ENDIF()
-  ENDIF()
-ENDIF()
+      set(VTK_DIR "VTK_DIR-NOTFOUND" CACHE PATH "The ${VTK_DIR_DESCRIPTION}" FORCE)
+    endif()
+  endif()
+endif()
 
 #-----------------------------------------------------------------------------
-IF(VTK_FOUND)
+if(VTK_FOUND)
   # Set USE_VTK_FILE for backward-compatability.
-  SET(USE_VTK_FILE ${VTK_USE_FILE})
-ELSE(VTK_FOUND)
+  set(USE_VTK_FILE ${VTK_USE_FILE})
+else(VTK_FOUND)
   # VTK not found, explain to the user how to specify its location.
-  IF(VTK_FIND_REQUIRED)
-    MESSAGE(FATAL_ERROR ${VTK_DIR_MESSAGE})
-  ELSE(VTK_FIND_REQUIRED)
-    IF(NOT VTK_FIND_QUIETLY)
-      MESSAGE(STATUS ${VTK_DIR_MESSAGE})
-    ENDIF(NOT VTK_FIND_QUIETLY)
-  ENDIF(VTK_FIND_REQUIRED)
-ENDIF(VTK_FOUND)
+  if(VTK_FIND_REQUIRED)
+    message(FATAL_ERROR ${VTK_DIR_MESSAGE})
+  else(VTK_FIND_REQUIRED)
+    if(NOT VTK_FIND_QUIETLY)
+      message(STATUS ${VTK_DIR_MESSAGE})
+    endif(NOT VTK_FIND_QUIETLY)
+  endif(VTK_FIND_REQUIRED)
+endif(VTK_FOUND)
diff --git a/Modules/FindWget.cmake b/Modules/FindWget.cmake
index ee4057dfd..a1dd47f77 100644
--- a/Modules/FindWget.cmake
+++ b/Modules/FindWget.cmake
@@ -17,20 +17,20 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE(FindCygwin)
+include(FindCygwin)
 
-FIND_PROGRAM(WGET_EXECUTABLE
+find_program(WGET_EXECUTABLE
   wget
   ${CYGWIN_INSTALL_PATH}/bin
 )
 
 # handle the QUIETLY and REQUIRED arguments and set WGET_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Wget DEFAULT_MSG WGET_EXECUTABLE)
 
-MARK_AS_ADVANCED( WGET_EXECUTABLE )
+mark_as_advanced( WGET_EXECUTABLE )
 
 # WGET option is deprecated.
 # use WGET_EXECUTABLE instead.
-SET (WGET ${WGET_EXECUTABLE} )
+set (WGET ${WGET_EXECUTABLE} )
diff --git a/Modules/FindWish.cmake b/Modules/FindWish.cmake
index 8a1cd8d36..5f1789066 100644
--- a/Modules/FindWish.cmake
+++ b/Modules/FindWish.cmake
@@ -20,29 +20,29 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-IF(UNIX)
-  FIND_PROGRAM(TK_WISH cygwish80 )
-ENDIF(UNIX)
+if(UNIX)
+  find_program(TK_WISH cygwish80 )
+endif(UNIX)
 
-GET_FILENAME_COMPONENT(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
-GET_FILENAME_COMPONENT(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
+get_filename_component(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH)
+string(REGEX REPLACE
   "^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}")
 
-GET_FILENAME_COMPONENT(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
-GET_FILENAME_COMPONENT(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH)
+get_filename_component(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
+get_filename_component(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH)
 
-GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
-GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
+get_filename_component(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH)
+string(REGEX REPLACE
   "^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_LIBRARY_VERSION "${TCL_LIBRARY}")
 
-GET_FILENAME_COMPONENT(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH)
-GET_FILENAME_COMPONENT(TK_LIBRARY_PATH_PARENT "${TK_LIBRARY_PATH}" PATH)
-STRING(REGEX REPLACE
+get_filename_component(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH)
+get_filename_component(TK_LIBRARY_PATH_PARENT "${TK_LIBRARY_PATH}" PATH)
+string(REGEX REPLACE
   "^.*tk([0-9]\\.*[0-9]).*$" "\\1" TK_LIBRARY_VERSION "${TK_LIBRARY}")
 
-SET(TCLTK_POSSIBLE_BIN_PATHS
+set(TCLTK_POSSIBLE_BIN_PATHS
   "${TCL_INCLUDE_PATH_PARENT}/bin"
   "${TK_INCLUDE_PATH_PARENT}/bin"
   "${TCL_LIBRARY_PATH_PARENT}/bin"
@@ -50,12 +50,12 @@ SET(TCLTK_POSSIBLE_BIN_PATHS
   "${TCL_TCLSH_PATH_PARENT}/bin"
   )
 
-IF(WIN32)
-  GET_FILENAME_COMPONENT(
+if(WIN32)
+  get_filename_component(
     ActiveTcl_CurrentVersion
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
     NAME)
-  SET(TCLTK_POSSIBLE_BIN_PATHS ${TCLTK_POSSIBLE_BIN_PATHS}
+  set(TCLTK_POSSIBLE_BIN_PATHS ${TCLTK_POSSIBLE_BIN_PATHS}
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/bin"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/bin"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/bin"
@@ -64,9 +64,9 @@ IF(WIN32)
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/bin"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/bin"
     )
-ENDIF(WIN32)
+endif(WIN32)
 
-SET(TK_WISH_NAMES
+set(TK_WISH_NAMES
   wish
   wish${TCL_LIBRARY_VERSION} wish${TK_LIBRARY_VERSION} wish${TCL_TCLSH_VERSION}
   wish86 wish8.6
@@ -77,9 +77,9 @@ SET(TK_WISH_NAMES
   wish80 wish8.0
   )
 
-FIND_PROGRAM(TK_WISH
+find_program(TK_WISH
   NAMES ${TK_WISH_NAMES}
   HINTS ${TCLTK_POSSIBLE_BIN_PATHS}
   )
 
-MARK_AS_ADVANCED(TK_WISH)
+mark_as_advanced(TK_WISH)
diff --git a/Modules/FindX11.cmake b/Modules/FindX11.cmake
index 76fb3c911..1c16af573 100644
--- a/Modules/FindX11.cmake
+++ b/Modules/FindX11.cmake
@@ -54,13 +54,13 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-IF (UNIX)
-  SET(X11_FOUND 0)
+if (UNIX)
+  set(X11_FOUND 0)
   # X11 is never a framework and some header files may be
   # found in tcl on the mac
-  SET(CMAKE_FIND_FRAMEWORK_SAVE ${CMAKE_FIND_FRAMEWORK})
-  SET(CMAKE_FIND_FRAMEWORK NEVER)
-  SET(X11_INC_SEARCH_PATH
+  set(CMAKE_FIND_FRAMEWORK_SAVE ${CMAKE_FIND_FRAMEWORK})
+  set(CMAKE_FIND_FRAMEWORK NEVER)
+  set(X11_INC_SEARCH_PATH
     /usr/pkg/xorg/include
     /usr/X11R6/include
     /usr/X11R7/include
@@ -70,358 +70,358 @@ IF (UNIX)
     /opt/graphics/OpenGL/include
   )
 
-  SET(X11_LIB_SEARCH_PATH
+  set(X11_LIB_SEARCH_PATH
     /usr/pkg/xorg/lib
     /usr/X11R6/lib
     /usr/X11R7/lib
     /usr/openwin/lib
   )
 
-  FIND_PATH(X11_X11_INCLUDE_PATH X11/X.h                             ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_Xlib_INCLUDE_PATH X11/Xlib.h                         ${X11_INC_SEARCH_PATH})
+  find_path(X11_X11_INCLUDE_PATH X11/X.h                             ${X11_INC_SEARCH_PATH})
+  find_path(X11_Xlib_INCLUDE_PATH X11/Xlib.h                         ${X11_INC_SEARCH_PATH})
 
   # Look for includes; keep the list sorted by name of the cmake *_INCLUDE_PATH
   # variable (which doesn't need to match the include file name).
 
   # Solaris lacks XKBrules.h, so we should skip kxkbd there.
-  FIND_PATH(X11_ICE_INCLUDE_PATH X11/ICE/ICE.h                       ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_SM_INCLUDE_PATH X11/SM/SM.h                          ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_Xaccessrules_INCLUDE_PATH X11/extensions/XKBrules.h  ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_Xaccessstr_INCLUDE_PATH X11/extensions/XKBstr.h      ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_Xau_INCLUDE_PATH X11/Xauth.h                         ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_Xcomposite_INCLUDE_PATH X11/extensions/Xcomposite.h  ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_Xcursor_INCLUDE_PATH X11/Xcursor/Xcursor.h           ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_Xdamage_INCLUDE_PATH X11/extensions/Xdamage.h        ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_Xdmcp_INCLUDE_PATH X11/Xdmcp.h                       ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_dpms_INCLUDE_PATH X11/extensions/dpms.h              ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_xf86misc_INCLUDE_PATH X11/extensions/xf86misc.h      ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_xf86vmode_INCLUDE_PATH X11/extensions/xf86vmode.h    ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_Xfixes_INCLUDE_PATH X11/extensions/Xfixes.h          ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_Xft_INCLUDE_PATH X11/Xft/Xft.h                       ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_Xi_INCLUDE_PATH X11/extensions/XInput.h              ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_Xinerama_INCLUDE_PATH X11/extensions/Xinerama.h      ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_Xinput_INCLUDE_PATH X11/extensions/XInput.h          ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_Xkb_INCLUDE_PATH X11/extensions/XKB.h                ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_Xkblib_INCLUDE_PATH X11/XKBlib.h                     ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_Xkbfile_INCLUDE_PATH X11/extensions/XKBfile.h        ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_Xmu_INCLUDE_PATH X11/Xmu/Xmu.h                       ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_Xpm_INCLUDE_PATH X11/xpm.h                           ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_XTest_INCLUDE_PATH X11/extensions/XTest.h            ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_XShm_INCLUDE_PATH X11/extensions/XShm.h              ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_Xrandr_INCLUDE_PATH X11/extensions/Xrandr.h          ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_Xrender_INCLUDE_PATH X11/extensions/Xrender.h        ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_XRes_INCLUDE_PATH X11/extensions/XRes.h              ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_Xscreensaver_INCLUDE_PATH X11/extensions/scrnsaver.h ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_Xshape_INCLUDE_PATH X11/extensions/shape.h           ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_Xutil_INCLUDE_PATH X11/Xutil.h                       ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_Xt_INCLUDE_PATH X11/Intrinsic.h                      ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_Xv_INCLUDE_PATH X11/extensions/Xvlib.h               ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_XSync_INCLUDE_PATH X11/extensions/sync.h             ${X11_INC_SEARCH_PATH})
+  find_path(X11_ICE_INCLUDE_PATH X11/ICE/ICE.h                       ${X11_INC_SEARCH_PATH})
+  find_path(X11_SM_INCLUDE_PATH X11/SM/SM.h                          ${X11_INC_SEARCH_PATH})
+  find_path(X11_Xaccessrules_INCLUDE_PATH X11/extensions/XKBrules.h  ${X11_INC_SEARCH_PATH})
+  find_path(X11_Xaccessstr_INCLUDE_PATH X11/extensions/XKBstr.h      ${X11_INC_SEARCH_PATH})
+  find_path(X11_Xau_INCLUDE_PATH X11/Xauth.h                         ${X11_INC_SEARCH_PATH})
+  find_path(X11_Xcomposite_INCLUDE_PATH X11/extensions/Xcomposite.h  ${X11_INC_SEARCH_PATH})
+  find_path(X11_Xcursor_INCLUDE_PATH X11/Xcursor/Xcursor.h           ${X11_INC_SEARCH_PATH})
+  find_path(X11_Xdamage_INCLUDE_PATH X11/extensions/Xdamage.h        ${X11_INC_SEARCH_PATH})
+  find_path(X11_Xdmcp_INCLUDE_PATH X11/Xdmcp.h                       ${X11_INC_SEARCH_PATH})
+  find_path(X11_dpms_INCLUDE_PATH X11/extensions/dpms.h              ${X11_INC_SEARCH_PATH})
+  find_path(X11_xf86misc_INCLUDE_PATH X11/extensions/xf86misc.h      ${X11_INC_SEARCH_PATH})
+  find_path(X11_xf86vmode_INCLUDE_PATH X11/extensions/xf86vmode.h    ${X11_INC_SEARCH_PATH})
+  find_path(X11_Xfixes_INCLUDE_PATH X11/extensions/Xfixes.h          ${X11_INC_SEARCH_PATH})
+  find_path(X11_Xft_INCLUDE_PATH X11/Xft/Xft.h                       ${X11_INC_SEARCH_PATH})
+  find_path(X11_Xi_INCLUDE_PATH X11/extensions/XInput.h              ${X11_INC_SEARCH_PATH})
+  find_path(X11_Xinerama_INCLUDE_PATH X11/extensions/Xinerama.h      ${X11_INC_SEARCH_PATH})
+  find_path(X11_Xinput_INCLUDE_PATH X11/extensions/XInput.h          ${X11_INC_SEARCH_PATH})
+  find_path(X11_Xkb_INCLUDE_PATH X11/extensions/XKB.h                ${X11_INC_SEARCH_PATH})
+  find_path(X11_Xkblib_INCLUDE_PATH X11/XKBlib.h                     ${X11_INC_SEARCH_PATH})
+  find_path(X11_Xkbfile_INCLUDE_PATH X11/extensions/XKBfile.h        ${X11_INC_SEARCH_PATH})
+  find_path(X11_Xmu_INCLUDE_PATH X11/Xmu/Xmu.h                       ${X11_INC_SEARCH_PATH})
+  find_path(X11_Xpm_INCLUDE_PATH X11/xpm.h                           ${X11_INC_SEARCH_PATH})
+  find_path(X11_XTest_INCLUDE_PATH X11/extensions/XTest.h            ${X11_INC_SEARCH_PATH})
+  find_path(X11_XShm_INCLUDE_PATH X11/extensions/XShm.h              ${X11_INC_SEARCH_PATH})
+  find_path(X11_Xrandr_INCLUDE_PATH X11/extensions/Xrandr.h          ${X11_INC_SEARCH_PATH})
+  find_path(X11_Xrender_INCLUDE_PATH X11/extensions/Xrender.h        ${X11_INC_SEARCH_PATH})
+  find_path(X11_XRes_INCLUDE_PATH X11/extensions/XRes.h              ${X11_INC_SEARCH_PATH})
+  find_path(X11_Xscreensaver_INCLUDE_PATH X11/extensions/scrnsaver.h ${X11_INC_SEARCH_PATH})
+  find_path(X11_Xshape_INCLUDE_PATH X11/extensions/shape.h           ${X11_INC_SEARCH_PATH})
+  find_path(X11_Xutil_INCLUDE_PATH X11/Xutil.h                       ${X11_INC_SEARCH_PATH})
+  find_path(X11_Xt_INCLUDE_PATH X11/Intrinsic.h                      ${X11_INC_SEARCH_PATH})
+  find_path(X11_Xv_INCLUDE_PATH X11/extensions/Xvlib.h               ${X11_INC_SEARCH_PATH})
+  find_path(X11_XSync_INCLUDE_PATH X11/extensions/sync.h             ${X11_INC_SEARCH_PATH})
 
 
-  FIND_LIBRARY(X11_X11_LIB X11               ${X11_LIB_SEARCH_PATH})
+  find_library(X11_X11_LIB X11               ${X11_LIB_SEARCH_PATH})
 
   # Find additional X libraries. Keep list sorted by library name.
-  FIND_LIBRARY(X11_ICE_LIB ICE               ${X11_LIB_SEARCH_PATH})
-  FIND_LIBRARY(X11_SM_LIB SM                 ${X11_LIB_SEARCH_PATH})
-  FIND_LIBRARY(X11_Xau_LIB Xau               ${X11_LIB_SEARCH_PATH})
-  FIND_LIBRARY(X11_Xcomposite_LIB Xcomposite ${X11_LIB_SEARCH_PATH})
-  FIND_LIBRARY(X11_Xcursor_LIB Xcursor       ${X11_LIB_SEARCH_PATH})
-  FIND_LIBRARY(X11_Xdamage_LIB Xdamage       ${X11_LIB_SEARCH_PATH})
-  FIND_LIBRARY(X11_Xdmcp_LIB Xdmcp           ${X11_LIB_SEARCH_PATH})
-  FIND_LIBRARY(X11_Xext_LIB Xext             ${X11_LIB_SEARCH_PATH})
-  FIND_LIBRARY(X11_Xfixes_LIB Xfixes         ${X11_LIB_SEARCH_PATH})
-  FIND_LIBRARY(X11_Xft_LIB Xft               ${X11_LIB_SEARCH_PATH})
-  FIND_LIBRARY(X11_Xi_LIB Xi                 ${X11_LIB_SEARCH_PATH})
-  FIND_LIBRARY(X11_Xinerama_LIB Xinerama     ${X11_LIB_SEARCH_PATH})
-  FIND_LIBRARY(X11_Xinput_LIB Xi             ${X11_LIB_SEARCH_PATH})
-  FIND_LIBRARY(X11_Xkbfile_LIB xkbfile       ${X11_LIB_SEARCH_PATH})
-  FIND_LIBRARY(X11_Xmu_LIB Xmu               ${X11_LIB_SEARCH_PATH})
-  FIND_LIBRARY(X11_Xpm_LIB Xpm               ${X11_LIB_SEARCH_PATH})
-  FIND_LIBRARY(X11_Xrandr_LIB Xrandr         ${X11_LIB_SEARCH_PATH})
-  FIND_LIBRARY(X11_Xrender_LIB Xrender       ${X11_LIB_SEARCH_PATH})
-  FIND_LIBRARY(X11_XRes_LIB XRes             ${X11_LIB_SEARCH_PATH})
-  FIND_LIBRARY(X11_Xscreensaver_LIB Xss      ${X11_LIB_SEARCH_PATH})
-  FIND_LIBRARY(X11_Xt_LIB Xt                 ${X11_LIB_SEARCH_PATH})
-  FIND_LIBRARY(X11_XTest_LIB Xtst            ${X11_LIB_SEARCH_PATH})
-  FIND_LIBRARY(X11_Xv_LIB Xv                 ${X11_LIB_SEARCH_PATH})
-  FIND_LIBRARY(X11_Xxf86misc_LIB Xxf86misc   ${X11_LIB_SEARCH_PATH})
-  FIND_LIBRARY(X11_Xxf86vm_LIB Xxf86vm       ${X11_LIB_SEARCH_PATH})
+  find_library(X11_ICE_LIB ICE               ${X11_LIB_SEARCH_PATH})
+  find_library(X11_SM_LIB SM                 ${X11_LIB_SEARCH_PATH})
+  find_library(X11_Xau_LIB Xau               ${X11_LIB_SEARCH_PATH})
+  find_library(X11_Xcomposite_LIB Xcomposite ${X11_LIB_SEARCH_PATH})
+  find_library(X11_Xcursor_LIB Xcursor       ${X11_LIB_SEARCH_PATH})
+  find_library(X11_Xdamage_LIB Xdamage       ${X11_LIB_SEARCH_PATH})
+  find_library(X11_Xdmcp_LIB Xdmcp           ${X11_LIB_SEARCH_PATH})
+  find_library(X11_Xext_LIB Xext             ${X11_LIB_SEARCH_PATH})
+  find_library(X11_Xfixes_LIB Xfixes         ${X11_LIB_SEARCH_PATH})
+  find_library(X11_Xft_LIB Xft               ${X11_LIB_SEARCH_PATH})
+  find_library(X11_Xi_LIB Xi                 ${X11_LIB_SEARCH_PATH})
+  find_library(X11_Xinerama_LIB Xinerama     ${X11_LIB_SEARCH_PATH})
+  find_library(X11_Xinput_LIB Xi             ${X11_LIB_SEARCH_PATH})
+  find_library(X11_Xkbfile_LIB xkbfile       ${X11_LIB_SEARCH_PATH})
+  find_library(X11_Xmu_LIB Xmu               ${X11_LIB_SEARCH_PATH})
+  find_library(X11_Xpm_LIB Xpm               ${X11_LIB_SEARCH_PATH})
+  find_library(X11_Xrandr_LIB Xrandr         ${X11_LIB_SEARCH_PATH})
+  find_library(X11_Xrender_LIB Xrender       ${X11_LIB_SEARCH_PATH})
+  find_library(X11_XRes_LIB XRes             ${X11_LIB_SEARCH_PATH})
+  find_library(X11_Xscreensaver_LIB Xss      ${X11_LIB_SEARCH_PATH})
+  find_library(X11_Xt_LIB Xt                 ${X11_LIB_SEARCH_PATH})
+  find_library(X11_XTest_LIB Xtst            ${X11_LIB_SEARCH_PATH})
+  find_library(X11_Xv_LIB Xv                 ${X11_LIB_SEARCH_PATH})
+  find_library(X11_Xxf86misc_LIB Xxf86misc   ${X11_LIB_SEARCH_PATH})
+  find_library(X11_Xxf86vm_LIB Xxf86vm       ${X11_LIB_SEARCH_PATH})
 
-  SET(X11_LIBRARY_DIR "")
-  IF(X11_X11_LIB)
-    GET_FILENAME_COMPONENT(X11_LIBRARY_DIR ${X11_X11_LIB} PATH)
-  ENDIF(X11_X11_LIB)
+  set(X11_LIBRARY_DIR "")
+  if(X11_X11_LIB)
+    get_filename_component(X11_LIBRARY_DIR ${X11_X11_LIB} PATH)
+  endif(X11_X11_LIB)
 
-  SET(X11_INCLUDE_DIR) # start with empty list
-  IF(X11_X11_INCLUDE_PATH)
-    SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_X11_INCLUDE_PATH})
-  ENDIF(X11_X11_INCLUDE_PATH)
+  set(X11_INCLUDE_DIR) # start with empty list
+  if(X11_X11_INCLUDE_PATH)
+    set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_X11_INCLUDE_PATH})
+  endif(X11_X11_INCLUDE_PATH)
 
-  IF(X11_Xlib_INCLUDE_PATH)
-    SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xlib_INCLUDE_PATH})
-  ENDIF(X11_Xlib_INCLUDE_PATH)
+  if(X11_Xlib_INCLUDE_PATH)
+    set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xlib_INCLUDE_PATH})
+  endif(X11_Xlib_INCLUDE_PATH)
 
-  IF(X11_Xutil_INCLUDE_PATH)
-    SET(X11_Xutil_FOUND TRUE)
-    SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xutil_INCLUDE_PATH})
-  ENDIF(X11_Xutil_INCLUDE_PATH)
+  if(X11_Xutil_INCLUDE_PATH)
+    set(X11_Xutil_FOUND TRUE)
+    set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xutil_INCLUDE_PATH})
+  endif(X11_Xutil_INCLUDE_PATH)
 
-  IF(X11_Xshape_INCLUDE_PATH)
-    SET(X11_Xshape_FOUND TRUE)
-    SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xshape_INCLUDE_PATH})
-  ENDIF(X11_Xshape_INCLUDE_PATH)
+  if(X11_Xshape_INCLUDE_PATH)
+    set(X11_Xshape_FOUND TRUE)
+    set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xshape_INCLUDE_PATH})
+  endif(X11_Xshape_INCLUDE_PATH)
 
-  SET(X11_LIBRARIES) # start with empty list
-  IF(X11_X11_LIB)
-    SET(X11_LIBRARIES ${X11_LIBRARIES} ${X11_X11_LIB})
-  ENDIF(X11_X11_LIB)
+  set(X11_LIBRARIES) # start with empty list
+  if(X11_X11_LIB)
+    set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_X11_LIB})
+  endif(X11_X11_LIB)
 
-  IF(X11_Xext_LIB)
-    SET(X11_Xext_FOUND TRUE)
-    SET(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xext_LIB})
-  ENDIF(X11_Xext_LIB)
+  if(X11_Xext_LIB)
+    set(X11_Xext_FOUND TRUE)
+    set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xext_LIB})
+  endif(X11_Xext_LIB)
 
-  IF(X11_Xt_LIB AND X11_Xt_INCLUDE_PATH)
-    SET(X11_Xt_FOUND TRUE)
-  ENDIF(X11_Xt_LIB AND X11_Xt_INCLUDE_PATH)
+  if(X11_Xt_LIB AND X11_Xt_INCLUDE_PATH)
+    set(X11_Xt_FOUND TRUE)
+  endif(X11_Xt_LIB AND X11_Xt_INCLUDE_PATH)
 
-  IF(X11_Xft_LIB AND X11_Xft_INCLUDE_PATH)
-    SET(X11_Xft_FOUND TRUE)
-    SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xft_INCLUDE_PATH})
-  ENDIF(X11_Xft_LIB AND X11_Xft_INCLUDE_PATH)
+  if(X11_Xft_LIB AND X11_Xft_INCLUDE_PATH)
+    set(X11_Xft_FOUND TRUE)
+    set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xft_INCLUDE_PATH})
+  endif(X11_Xft_LIB AND X11_Xft_INCLUDE_PATH)
 
-  IF(X11_Xv_LIB AND X11_Xv_INCLUDE_PATH)
-    SET(X11_Xv_FOUND TRUE)
-    SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xv_INCLUDE_PATH})
-  ENDIF(X11_Xv_LIB AND X11_Xv_INCLUDE_PATH)
+  if(X11_Xv_LIB AND X11_Xv_INCLUDE_PATH)
+    set(X11_Xv_FOUND TRUE)
+    set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xv_INCLUDE_PATH})
+  endif(X11_Xv_LIB AND X11_Xv_INCLUDE_PATH)
 
-  IF (X11_Xau_LIB AND X11_Xau_INCLUDE_PATH)
-    SET(X11_Xau_FOUND TRUE)
-  ENDIF (X11_Xau_LIB AND X11_Xau_INCLUDE_PATH)
+  if (X11_Xau_LIB AND X11_Xau_INCLUDE_PATH)
+    set(X11_Xau_FOUND TRUE)
+  endif (X11_Xau_LIB AND X11_Xau_INCLUDE_PATH)
 
-  IF (X11_Xdmcp_INCLUDE_PATH AND X11_Xdmcp_LIB)
-      SET(X11_Xdmcp_FOUND TRUE)
-      SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xdmcp_INCLUDE_PATH})
-  ENDIF (X11_Xdmcp_INCLUDE_PATH AND X11_Xdmcp_LIB)
+  if (X11_Xdmcp_INCLUDE_PATH AND X11_Xdmcp_LIB)
+      set(X11_Xdmcp_FOUND TRUE)
+      set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xdmcp_INCLUDE_PATH})
+  endif (X11_Xdmcp_INCLUDE_PATH AND X11_Xdmcp_LIB)
 
-  IF (X11_Xaccessrules_INCLUDE_PATH AND X11_Xaccessstr_INCLUDE_PATH)
-      SET(X11_Xaccess_FOUND TRUE)
-      SET(X11_Xaccess_INCLUDE_PATH ${X11_Xaccessstr_INCLUDE_PATH})
-      SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xaccess_INCLUDE_PATH})
-  ENDIF (X11_Xaccessrules_INCLUDE_PATH AND X11_Xaccessstr_INCLUDE_PATH)
+  if (X11_Xaccessrules_INCLUDE_PATH AND X11_Xaccessstr_INCLUDE_PATH)
+      set(X11_Xaccess_FOUND TRUE)
+      set(X11_Xaccess_INCLUDE_PATH ${X11_Xaccessstr_INCLUDE_PATH})
+      set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xaccess_INCLUDE_PATH})
+  endif (X11_Xaccessrules_INCLUDE_PATH AND X11_Xaccessstr_INCLUDE_PATH)
 
-  IF (X11_Xpm_INCLUDE_PATH AND X11_Xpm_LIB)
-      SET(X11_Xpm_FOUND TRUE)
-      SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xpm_INCLUDE_PATH})
-  ENDIF (X11_Xpm_INCLUDE_PATH AND X11_Xpm_LIB)
+  if (X11_Xpm_INCLUDE_PATH AND X11_Xpm_LIB)
+      set(X11_Xpm_FOUND TRUE)
+      set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xpm_INCLUDE_PATH})
+  endif (X11_Xpm_INCLUDE_PATH AND X11_Xpm_LIB)
 
-  IF (X11_Xcomposite_INCLUDE_PATH AND X11_Xcomposite_LIB)
-     SET(X11_Xcomposite_FOUND TRUE)
-     SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xcomposite_INCLUDE_PATH})
-  ENDIF (X11_Xcomposite_INCLUDE_PATH AND X11_Xcomposite_LIB)
+  if (X11_Xcomposite_INCLUDE_PATH AND X11_Xcomposite_LIB)
+     set(X11_Xcomposite_FOUND TRUE)
+     set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xcomposite_INCLUDE_PATH})
+  endif (X11_Xcomposite_INCLUDE_PATH AND X11_Xcomposite_LIB)
 
-  IF (X11_Xdamage_INCLUDE_PATH AND X11_Xdamage_LIB)
-     SET(X11_Xdamage_FOUND TRUE)
-     SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xdamage_INCLUDE_PATH})
-  ENDIF (X11_Xdamage_INCLUDE_PATH AND X11_Xdamage_LIB)
+  if (X11_Xdamage_INCLUDE_PATH AND X11_Xdamage_LIB)
+     set(X11_Xdamage_FOUND TRUE)
+     set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xdamage_INCLUDE_PATH})
+  endif (X11_Xdamage_INCLUDE_PATH AND X11_Xdamage_LIB)
 
-  IF (X11_XShm_INCLUDE_PATH)
-     SET(X11_XShm_FOUND TRUE)
-     SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XShm_INCLUDE_PATH})
-  ENDIF (X11_XShm_INCLUDE_PATH)
+  if (X11_XShm_INCLUDE_PATH)
+     set(X11_XShm_FOUND TRUE)
+     set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XShm_INCLUDE_PATH})
+  endif (X11_XShm_INCLUDE_PATH)
 
-  IF (X11_XTest_INCLUDE_PATH AND X11_XTest_LIB)
-      SET(X11_XTest_FOUND TRUE)
-      SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XTest_INCLUDE_PATH})
-  ENDIF (X11_XTest_INCLUDE_PATH AND X11_XTest_LIB)
+  if (X11_XTest_INCLUDE_PATH AND X11_XTest_LIB)
+      set(X11_XTest_FOUND TRUE)
+      set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XTest_INCLUDE_PATH})
+  endif (X11_XTest_INCLUDE_PATH AND X11_XTest_LIB)
 
-  IF (X11_Xi_INCLUDE_PATH AND X11_Xi_LIB)
-     SET(X11_Xi_FOUND TRUE)
-     SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xi_INCLUDE_PATH})
-  ENDIF (X11_Xi_INCLUDE_PATH  AND X11_Xi_LIB)
+  if (X11_Xi_INCLUDE_PATH AND X11_Xi_LIB)
+     set(X11_Xi_FOUND TRUE)
+     set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xi_INCLUDE_PATH})
+  endif (X11_Xi_INCLUDE_PATH  AND X11_Xi_LIB)
 
-  IF (X11_Xinerama_INCLUDE_PATH AND X11_Xinerama_LIB)
-     SET(X11_Xinerama_FOUND TRUE)
-     SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinerama_INCLUDE_PATH})
-  ENDIF (X11_Xinerama_INCLUDE_PATH  AND X11_Xinerama_LIB)
+  if (X11_Xinerama_INCLUDE_PATH AND X11_Xinerama_LIB)
+     set(X11_Xinerama_FOUND TRUE)
+     set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinerama_INCLUDE_PATH})
+  endif (X11_Xinerama_INCLUDE_PATH  AND X11_Xinerama_LIB)
 
-  IF (X11_Xfixes_INCLUDE_PATH AND X11_Xfixes_LIB)
-     SET(X11_Xfixes_FOUND TRUE)
-     SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xfixes_INCLUDE_PATH})
-  ENDIF (X11_Xfixes_INCLUDE_PATH AND X11_Xfixes_LIB)
+  if (X11_Xfixes_INCLUDE_PATH AND X11_Xfixes_LIB)
+     set(X11_Xfixes_FOUND TRUE)
+     set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xfixes_INCLUDE_PATH})
+  endif (X11_Xfixes_INCLUDE_PATH AND X11_Xfixes_LIB)
 
-  IF (X11_Xrender_INCLUDE_PATH AND X11_Xrender_LIB)
-     SET(X11_Xrender_FOUND TRUE)
-     SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrender_INCLUDE_PATH})
-  ENDIF (X11_Xrender_INCLUDE_PATH AND X11_Xrender_LIB)
+  if (X11_Xrender_INCLUDE_PATH AND X11_Xrender_LIB)
+     set(X11_Xrender_FOUND TRUE)
+     set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrender_INCLUDE_PATH})
+  endif (X11_Xrender_INCLUDE_PATH AND X11_Xrender_LIB)
 
-  IF (X11_XRes_INCLUDE_PATH AND X11_XRes_LIB)
-     SET(X11_XRes_FOUND TRUE)
-     SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XRes_INCLUDE_PATH})
-  ENDIF (X11_XRes_INCLUDE_PATH AND X11_XRes_LIB)
+  if (X11_XRes_INCLUDE_PATH AND X11_XRes_LIB)
+     set(X11_XRes_FOUND TRUE)
+     set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XRes_INCLUDE_PATH})
+  endif (X11_XRes_INCLUDE_PATH AND X11_XRes_LIB)
 
-  IF (X11_Xrandr_INCLUDE_PATH AND X11_Xrandr_LIB)
-     SET(X11_Xrandr_FOUND TRUE)
-     SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrandr_INCLUDE_PATH})
-  ENDIF (X11_Xrandr_INCLUDE_PATH AND X11_Xrandr_LIB)
+  if (X11_Xrandr_INCLUDE_PATH AND X11_Xrandr_LIB)
+     set(X11_Xrandr_FOUND TRUE)
+     set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrandr_INCLUDE_PATH})
+  endif (X11_Xrandr_INCLUDE_PATH AND X11_Xrandr_LIB)
 
-  IF (X11_xf86misc_INCLUDE_PATH AND X11_Xxf86misc_LIB)
-     SET(X11_xf86misc_FOUND TRUE)
-     SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86misc_INCLUDE_PATH})
-  ENDIF (X11_xf86misc_INCLUDE_PATH  AND X11_Xxf86misc_LIB)
+  if (X11_xf86misc_INCLUDE_PATH AND X11_Xxf86misc_LIB)
+     set(X11_xf86misc_FOUND TRUE)
+     set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86misc_INCLUDE_PATH})
+  endif (X11_xf86misc_INCLUDE_PATH  AND X11_Xxf86misc_LIB)
 
-  IF (X11_xf86vmode_INCLUDE_PATH AND X11_Xxf86vm_LIB)
-     SET(X11_xf86vmode_FOUND TRUE)
-     SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86vmode_INCLUDE_PATH})
-  ENDIF (X11_xf86vmode_INCLUDE_PATH AND X11_Xxf86vm_LIB)
+  if (X11_xf86vmode_INCLUDE_PATH AND X11_Xxf86vm_LIB)
+     set(X11_xf86vmode_FOUND TRUE)
+     set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86vmode_INCLUDE_PATH})
+  endif (X11_xf86vmode_INCLUDE_PATH AND X11_Xxf86vm_LIB)
 
-  IF (X11_Xcursor_INCLUDE_PATH AND X11_Xcursor_LIB)
-     SET(X11_Xcursor_FOUND TRUE)
-     SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xcursor_INCLUDE_PATH})
-  ENDIF (X11_Xcursor_INCLUDE_PATH AND X11_Xcursor_LIB)
+  if (X11_Xcursor_INCLUDE_PATH AND X11_Xcursor_LIB)
+     set(X11_Xcursor_FOUND TRUE)
+     set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xcursor_INCLUDE_PATH})
+  endif (X11_Xcursor_INCLUDE_PATH AND X11_Xcursor_LIB)
 
-  IF (X11_Xscreensaver_INCLUDE_PATH AND X11_Xscreensaver_LIB)
-     SET(X11_Xscreensaver_FOUND TRUE)
-     SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xscreensaver_INCLUDE_PATH})
-  ENDIF (X11_Xscreensaver_INCLUDE_PATH AND X11_Xscreensaver_LIB)
+  if (X11_Xscreensaver_INCLUDE_PATH AND X11_Xscreensaver_LIB)
+     set(X11_Xscreensaver_FOUND TRUE)
+     set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xscreensaver_INCLUDE_PATH})
+  endif (X11_Xscreensaver_INCLUDE_PATH AND X11_Xscreensaver_LIB)
 
-  IF (X11_dpms_INCLUDE_PATH)
-     SET(X11_dpms_FOUND TRUE)
-     SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_dpms_INCLUDE_PATH})
-  ENDIF (X11_dpms_INCLUDE_PATH)
+  if (X11_dpms_INCLUDE_PATH)
+     set(X11_dpms_FOUND TRUE)
+     set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_dpms_INCLUDE_PATH})
+  endif (X11_dpms_INCLUDE_PATH)
 
-  IF (X11_Xkb_INCLUDE_PATH AND X11_Xkblib_INCLUDE_PATH AND X11_Xlib_INCLUDE_PATH)
-     SET(X11_Xkb_FOUND TRUE)
-     SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkb_INCLUDE_PATH} )
-  ENDIF (X11_Xkb_INCLUDE_PATH AND X11_Xkblib_INCLUDE_PATH AND X11_Xlib_INCLUDE_PATH)
+  if (X11_Xkb_INCLUDE_PATH AND X11_Xkblib_INCLUDE_PATH AND X11_Xlib_INCLUDE_PATH)
+     set(X11_Xkb_FOUND TRUE)
+     set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkb_INCLUDE_PATH} )
+  endif (X11_Xkb_INCLUDE_PATH AND X11_Xkblib_INCLUDE_PATH AND X11_Xlib_INCLUDE_PATH)
 
-  IF (X11_Xkbfile_INCLUDE_PATH AND X11_Xkbfile_LIB AND X11_Xlib_INCLUDE_PATH)
-     SET(X11_Xkbfile_FOUND TRUE)
-     SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkbfile_INCLUDE_PATH} )
-  ENDIF (X11_Xkbfile_INCLUDE_PATH AND X11_Xkbfile_LIB AND X11_Xlib_INCLUDE_PATH)
+  if (X11_Xkbfile_INCLUDE_PATH AND X11_Xkbfile_LIB AND X11_Xlib_INCLUDE_PATH)
+     set(X11_Xkbfile_FOUND TRUE)
+     set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkbfile_INCLUDE_PATH} )
+  endif (X11_Xkbfile_INCLUDE_PATH AND X11_Xkbfile_LIB AND X11_Xlib_INCLUDE_PATH)
 
-  IF (X11_Xmu_INCLUDE_PATH AND X11_Xmu_LIB)
-     SET(X11_Xmu_FOUND TRUE)
-     SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xmu_INCLUDE_PATH})
-  ENDIF (X11_Xmu_INCLUDE_PATH AND X11_Xmu_LIB)
+  if (X11_Xmu_INCLUDE_PATH AND X11_Xmu_LIB)
+     set(X11_Xmu_FOUND TRUE)
+     set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xmu_INCLUDE_PATH})
+  endif (X11_Xmu_INCLUDE_PATH AND X11_Xmu_LIB)
 
-  IF (X11_Xinput_INCLUDE_PATH AND X11_Xinput_LIB)
-     SET(X11_Xinput_FOUND TRUE)
-     SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinput_INCLUDE_PATH})
-  ENDIF (X11_Xinput_INCLUDE_PATH AND X11_Xinput_LIB)
+  if (X11_Xinput_INCLUDE_PATH AND X11_Xinput_LIB)
+     set(X11_Xinput_FOUND TRUE)
+     set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinput_INCLUDE_PATH})
+  endif (X11_Xinput_INCLUDE_PATH AND X11_Xinput_LIB)
 
-  IF (X11_XSync_INCLUDE_PATH)
-     SET(X11_XSync_FOUND TRUE)
-     SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XSync_INCLUDE_PATH})
-  ENDIF (X11_XSync_INCLUDE_PATH)
+  if (X11_XSync_INCLUDE_PATH)
+     set(X11_XSync_FOUND TRUE)
+     set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XSync_INCLUDE_PATH})
+  endif (X11_XSync_INCLUDE_PATH)
 
-  IF(X11_ICE_LIB AND X11_ICE_INCLUDE_PATH)
-     SET(X11_ICE_FOUND TRUE)
-  ENDIF(X11_ICE_LIB AND X11_ICE_INCLUDE_PATH)
+  if(X11_ICE_LIB AND X11_ICE_INCLUDE_PATH)
+     set(X11_ICE_FOUND TRUE)
+  endif(X11_ICE_LIB AND X11_ICE_INCLUDE_PATH)
 
-  IF(X11_SM_LIB AND X11_SM_INCLUDE_PATH)
-     SET(X11_SM_FOUND TRUE)
-  ENDIF(X11_SM_LIB AND X11_SM_INCLUDE_PATH)
+  if(X11_SM_LIB AND X11_SM_INCLUDE_PATH)
+     set(X11_SM_FOUND TRUE)
+  endif(X11_SM_LIB AND X11_SM_INCLUDE_PATH)
 
 
   # Deprecated variable for backwards compatibility with CMake 1.4
-  IF (X11_X11_INCLUDE_PATH AND X11_LIBRARIES)
-    SET(X11_FOUND 1)
-  ENDIF (X11_X11_INCLUDE_PATH AND X11_LIBRARIES)
+  if (X11_X11_INCLUDE_PATH AND X11_LIBRARIES)
+    set(X11_FOUND 1)
+  endif (X11_X11_INCLUDE_PATH AND X11_LIBRARIES)
 
-  IF(X11_FOUND)
-    INCLUDE(CheckFunctionExists)
-    INCLUDE(CheckLibraryExists)
+  if(X11_FOUND)
+    include(CheckFunctionExists)
+    include(CheckLibraryExists)
 
     # Translated from an autoconf-generated configure script.
     # See libs.m4 in autoconf's m4 directory.
-    IF($ENV{ISC} MATCHES "^yes$")
-      SET(X11_X_EXTRA_LIBS -lnsl_s -linet)
-    ELSE($ENV{ISC} MATCHES "^yes$")
-      SET(X11_X_EXTRA_LIBS "")
+    if($ENV{ISC} MATCHES "^yes$")
+      set(X11_X_EXTRA_LIBS -lnsl_s -linet)
+    else($ENV{ISC} MATCHES "^yes$")
+      set(X11_X_EXTRA_LIBS "")
 
       # See if XOpenDisplay in X11 works by itself.
       CHECK_LIBRARY_EXISTS("${X11_LIBRARIES}" "XOpenDisplay" "${X11_LIBRARY_DIR}" X11_LIB_X11_SOLO)
-      IF(NOT X11_LIB_X11_SOLO)
+      if(NOT X11_LIB_X11_SOLO)
         # Find library needed for dnet_ntoa.
         CHECK_LIBRARY_EXISTS("dnet" "dnet_ntoa" "" X11_LIB_DNET_HAS_DNET_NTOA)
-        IF (X11_LIB_DNET_HAS_DNET_NTOA)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet)
-        ELSE (X11_LIB_DNET_HAS_DNET_NTOA)
+        if (X11_LIB_DNET_HAS_DNET_NTOA)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet)
+        else (X11_LIB_DNET_HAS_DNET_NTOA)
           CHECK_LIBRARY_EXISTS("dnet_stub" "dnet_ntoa" "" X11_LIB_DNET_STUB_HAS_DNET_NTOA)
-          IF (X11_LIB_DNET_STUB_HAS_DNET_NTOA)
-            SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet_stub)
-          ENDIF (X11_LIB_DNET_STUB_HAS_DNET_NTOA)
-        ENDIF (X11_LIB_DNET_HAS_DNET_NTOA)
-      ENDIF(NOT X11_LIB_X11_SOLO)
+          if (X11_LIB_DNET_STUB_HAS_DNET_NTOA)
+            set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet_stub)
+          endif (X11_LIB_DNET_STUB_HAS_DNET_NTOA)
+        endif (X11_LIB_DNET_HAS_DNET_NTOA)
+      endif(NOT X11_LIB_X11_SOLO)
 
       # Find library needed for gethostbyname.
       CHECK_FUNCTION_EXISTS("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME)
-      IF(NOT CMAKE_HAVE_GETHOSTBYNAME)
+      if(NOT CMAKE_HAVE_GETHOSTBYNAME)
         CHECK_LIBRARY_EXISTS("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
-        IF (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl)
-        ELSE (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
+        if (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl)
+        else (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
           CHECK_LIBRARY_EXISTS("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
-          IF (CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
-            SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd)
-          ENDIF (CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
-        ENDIF (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
-      ENDIF(NOT CMAKE_HAVE_GETHOSTBYNAME)
+          if (CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
+            set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd)
+          endif (CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
+        endif (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
+      endif(NOT CMAKE_HAVE_GETHOSTBYNAME)
 
       # Find library needed for connect.
       CHECK_FUNCTION_EXISTS("connect" CMAKE_HAVE_CONNECT)
-      IF(NOT CMAKE_HAVE_CONNECT)
+      if(NOT CMAKE_HAVE_CONNECT)
         CHECK_LIBRARY_EXISTS("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT)
-        IF (CMAKE_LIB_SOCKET_HAS_CONNECT)
-          SET (X11_X_EXTRA_LIBS -lsocket ${X11_X_EXTRA_LIBS})
-        ENDIF (CMAKE_LIB_SOCKET_HAS_CONNECT)
-      ENDIF(NOT CMAKE_HAVE_CONNECT)
+        if (CMAKE_LIB_SOCKET_HAS_CONNECT)
+          set (X11_X_EXTRA_LIBS -lsocket ${X11_X_EXTRA_LIBS})
+        endif (CMAKE_LIB_SOCKET_HAS_CONNECT)
+      endif(NOT CMAKE_HAVE_CONNECT)
 
       # Find library needed for remove.
       CHECK_FUNCTION_EXISTS("remove" CMAKE_HAVE_REMOVE)
-      IF(NOT CMAKE_HAVE_REMOVE)
+      if(NOT CMAKE_HAVE_REMOVE)
         CHECK_LIBRARY_EXISTS("posix" "remove" "" CMAKE_LIB_POSIX_HAS_REMOVE)
-        IF (CMAKE_LIB_POSIX_HAS_REMOVE)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lposix)
-        ENDIF (CMAKE_LIB_POSIX_HAS_REMOVE)
-      ENDIF(NOT CMAKE_HAVE_REMOVE)
+        if (CMAKE_LIB_POSIX_HAS_REMOVE)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lposix)
+        endif (CMAKE_LIB_POSIX_HAS_REMOVE)
+      endif(NOT CMAKE_HAVE_REMOVE)
 
       # Find library needed for shmat.
       CHECK_FUNCTION_EXISTS("shmat" CMAKE_HAVE_SHMAT)
-      IF(NOT CMAKE_HAVE_SHMAT)
+      if(NOT CMAKE_HAVE_SHMAT)
         CHECK_LIBRARY_EXISTS("ipc" "shmat" "" CMAKE_LIB_IPS_HAS_SHMAT)
-        IF (CMAKE_LIB_IPS_HAS_SHMAT)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lipc)
-        ENDIF (CMAKE_LIB_IPS_HAS_SHMAT)
-      ENDIF(NOT CMAKE_HAVE_SHMAT)
-    ENDIF($ENV{ISC} MATCHES "^yes$")
+        if (CMAKE_LIB_IPS_HAS_SHMAT)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lipc)
+        endif (CMAKE_LIB_IPS_HAS_SHMAT)
+      endif(NOT CMAKE_HAVE_SHMAT)
+    endif($ENV{ISC} MATCHES "^yes$")
 
-    IF (X11_ICE_FOUND)
+    if (X11_ICE_FOUND)
       CHECK_LIBRARY_EXISTS("ICE" "IceConnectionNumber" "${X11_LIBRARY_DIR}"
                             CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
-      IF(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
-        SET (X11_X_PRE_LIBS ${X11_ICE_LIB})
-        IF(X11_SM_LIB)
-          SET (X11_X_PRE_LIBS ${X11_SM_LIB} ${X11_X_PRE_LIBS})
-        ENDIF(X11_SM_LIB)
-      ENDIF(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
-    ENDIF (X11_ICE_FOUND)
+      if(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
+        set (X11_X_PRE_LIBS ${X11_ICE_LIB})
+        if(X11_SM_LIB)
+          set (X11_X_PRE_LIBS ${X11_SM_LIB} ${X11_X_PRE_LIBS})
+        endif(X11_SM_LIB)
+      endif(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
+    endif (X11_ICE_FOUND)
 
     # Build the final list of libraries.
-    SET(X11_LIBRARIES ${X11_X_PRE_LIBS} ${X11_LIBRARIES} ${X11_X_EXTRA_LIBS})
+    set(X11_LIBRARIES ${X11_X_PRE_LIBS} ${X11_LIBRARIES} ${X11_X_EXTRA_LIBS})
 
-    INCLUDE(FindPackageMessage)
+    include(FindPackageMessage)
     FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
       "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
-  ELSE (X11_FOUND)
-    IF (X11_FIND_REQUIRED)
-      MESSAGE(FATAL_ERROR "Could not find X11")
-    ENDIF (X11_FIND_REQUIRED)
-  ENDIF (X11_FOUND)
+  else (X11_FOUND)
+    if (X11_FIND_REQUIRED)
+      message(FATAL_ERROR "Could not find X11")
+    endif (X11_FIND_REQUIRED)
+  endif (X11_FOUND)
 
-  MARK_AS_ADVANCED(
+  mark_as_advanced(
     X11_X11_INCLUDE_PATH
     X11_X11_LIB
     X11_Xext_LIB
@@ -486,7 +486,7 @@ IF (UNIX)
     X11_SM_INCLUDE_PATH
     X11_XSync_INCLUDE_PATH
   )
-  SET(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_SAVE})
-ENDIF (UNIX)
+  set(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_SAVE})
+endif (UNIX)
 
 # X11_FIND_REQUIRED_<component> could be checked too
diff --git a/Modules/FindXMLRPC.cmake b/Modules/FindXMLRPC.cmake
index eccfb487a..0fae1d718 100644
--- a/Modules/FindXMLRPC.cmake
+++ b/Modules/FindXMLRPC.cmake
@@ -10,7 +10,7 @@
 #  cgi-server     CGI-based server
 #  abyss-server   ABYSS-based server
 # Typical usage:
-#  FIND_PACKAGE(XMLRPC REQUIRED libwww-client)
+#  find_package(XMLRPC REQUIRED libwww-client)
 
 #=============================================================================
 # Copyright 2001-2009 Kitware, Inc.
@@ -26,121 +26,121 @@
 #  License text for the above reference.)
 
 # First find the config script from which to obtain other values.
-FIND_PROGRAM(XMLRPC_C_CONFIG NAMES xmlrpc-c-config)
+find_program(XMLRPC_C_CONFIG NAMES xmlrpc-c-config)
 
 # Check whether we found anything.
-IF(XMLRPC_C_CONFIG)
-  SET(XMLRPC_FOUND 1)
-ELSE(XMLRPC_C_CONFIG)
-  SET(XMLRPC_FOUND 0)
-ENDIF(XMLRPC_C_CONFIG)
+if(XMLRPC_C_CONFIG)
+  set(XMLRPC_FOUND 1)
+else(XMLRPC_C_CONFIG)
+  set(XMLRPC_FOUND 0)
+endif(XMLRPC_C_CONFIG)
 
 # Lookup the include directories needed for the components requested.
-IF(XMLRPC_FOUND)
+if(XMLRPC_FOUND)
   # Use the newer EXECUTE_PROCESS command if it is available.
-  IF(COMMAND EXECUTE_PROCESS)
-    EXECUTE_PROCESS(
+  if(COMMAND EXECUTE_PROCESS)
+    execute_process(
       COMMAND ${XMLRPC_C_CONFIG} ${XMLRPC_FIND_COMPONENTS} --cflags
       OUTPUT_VARIABLE XMLRPC_C_CONFIG_CFLAGS
       OUTPUT_STRIP_TRAILING_WHITESPACE
       RESULT_VARIABLE XMLRPC_C_CONFIG_RESULT
       )
-  ELSE(COMMAND EXECUTE_PROCESS)
-    EXEC_PROGRAM(${XMLRPC_C_CONFIG} ARGS "${XMLRPC_FIND_COMPONENTS} --cflags"
+  else(COMMAND EXECUTE_PROCESS)
+    exec_program(${XMLRPC_C_CONFIG} ARGS "${XMLRPC_FIND_COMPONENTS} --cflags"
       OUTPUT_VARIABLE XMLRPC_C_CONFIG_CFLAGS
       RETURN_VALUE XMLRPC_C_CONFIG_RESULT
       )
-  ENDIF(COMMAND EXECUTE_PROCESS)
+  endif(COMMAND EXECUTE_PROCESS)
 
   # Parse the include flags.
-  IF("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
+  if("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
     # Convert the compile flags to a CMake list.
-    STRING(REGEX REPLACE " +" ";"
+    string(REGEX REPLACE " +" ";"
       XMLRPC_C_CONFIG_CFLAGS "${XMLRPC_C_CONFIG_CFLAGS}")
 
     # Look for -I options.
-    SET(XMLRPC_INCLUDE_DIRS)
-    FOREACH(flag ${XMLRPC_C_CONFIG_CFLAGS})
-      IF("${flag}" MATCHES "^-I")
-        STRING(REGEX REPLACE "^-I" "" DIR "${flag}")
-        FILE(TO_CMAKE_PATH "${DIR}" DIR)
-        SET(XMLRPC_INCLUDE_DIRS ${XMLRPC_INCLUDE_DIRS} "${DIR}")
-      ENDIF("${flag}" MATCHES "^-I")
-    ENDFOREACH(flag)
-  ELSE("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
-    MESSAGE("Error running ${XMLRPC_C_CONFIG}: [${XMLRPC_C_CONFIG_RESULT}]")
-    SET(XMLRPC_FOUND 0)
-  ENDIF("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
-ENDIF(XMLRPC_FOUND)
+    set(XMLRPC_INCLUDE_DIRS)
+    foreach(flag ${XMLRPC_C_CONFIG_CFLAGS})
+      if("${flag}" MATCHES "^-I")
+        string(REGEX REPLACE "^-I" "" DIR "${flag}")
+        file(TO_CMAKE_PATH "${DIR}" DIR)
+        set(XMLRPC_INCLUDE_DIRS ${XMLRPC_INCLUDE_DIRS} "${DIR}")
+      endif("${flag}" MATCHES "^-I")
+    endforeach(flag)
+  else("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
+    message("Error running ${XMLRPC_C_CONFIG}: [${XMLRPC_C_CONFIG_RESULT}]")
+    set(XMLRPC_FOUND 0)
+  endif("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
+endif(XMLRPC_FOUND)
 
 # Lookup the libraries needed for the components requested.
-IF(XMLRPC_FOUND)
+if(XMLRPC_FOUND)
   # Use the newer EXECUTE_PROCESS command if it is available.
-  IF(COMMAND EXECUTE_PROCESS)
-    EXECUTE_PROCESS(
+  if(COMMAND EXECUTE_PROCESS)
+    execute_process(
       COMMAND ${XMLRPC_C_CONFIG} ${XMLRPC_FIND_COMPONENTS} --libs
       OUTPUT_VARIABLE XMLRPC_C_CONFIG_LIBS
       OUTPUT_STRIP_TRAILING_WHITESPACE
       RESULT_VARIABLE XMLRPC_C_CONFIG_RESULT
       )
-  ELSE(COMMAND EXECUTE_PROCESS)
-    EXEC_PROGRAM(${XMLRPC_C_CONFIG} ARGS "${XMLRPC_FIND_COMPONENTS} --libs"
+  else(COMMAND EXECUTE_PROCESS)
+    exec_program(${XMLRPC_C_CONFIG} ARGS "${XMLRPC_FIND_COMPONENTS} --libs"
       OUTPUT_VARIABLE XMLRPC_C_CONFIG_LIBS
       RETURN_VALUE XMLRPC_C_CONFIG_RESULT
       )
-  ENDIF(COMMAND EXECUTE_PROCESS)
+  endif(COMMAND EXECUTE_PROCESS)
 
   # Parse the library names and directories.
-  IF("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
-    STRING(REGEX REPLACE " +" ";"
+  if("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
+    string(REGEX REPLACE " +" ";"
       XMLRPC_C_CONFIG_LIBS "${XMLRPC_C_CONFIG_LIBS}")
 
     # Look for -L flags for directories and -l flags for library names.
-    SET(XMLRPC_LIBRARY_DIRS)
-    SET(XMLRPC_LIBRARY_NAMES)
-    FOREACH(flag ${XMLRPC_C_CONFIG_LIBS})
-      IF("${flag}" MATCHES "^-L")
-        STRING(REGEX REPLACE "^-L" "" DIR "${flag}")
-        FILE(TO_CMAKE_PATH "${DIR}" DIR)
-        SET(XMLRPC_LIBRARY_DIRS ${XMLRPC_LIBRARY_DIRS} "${DIR}")
-      ELSEIF("${flag}" MATCHES "^-l")
-        STRING(REGEX REPLACE "^-l" "" NAME "${flag}")
-        SET(XMLRPC_LIBRARY_NAMES ${XMLRPC_LIBRARY_NAMES} "${NAME}")
-      ENDIF("${flag}" MATCHES "^-L")
-    ENDFOREACH(flag)
+    set(XMLRPC_LIBRARY_DIRS)
+    set(XMLRPC_LIBRARY_NAMES)
+    foreach(flag ${XMLRPC_C_CONFIG_LIBS})
+      if("${flag}" MATCHES "^-L")
+        string(REGEX REPLACE "^-L" "" DIR "${flag}")
+        file(TO_CMAKE_PATH "${DIR}" DIR)
+        set(XMLRPC_LIBRARY_DIRS ${XMLRPC_LIBRARY_DIRS} "${DIR}")
+      elseif("${flag}" MATCHES "^-l")
+        string(REGEX REPLACE "^-l" "" NAME "${flag}")
+        set(XMLRPC_LIBRARY_NAMES ${XMLRPC_LIBRARY_NAMES} "${NAME}")
+      endif("${flag}" MATCHES "^-L")
+    endforeach(flag)
 
     # Search for each library needed using the directories given.
-    FOREACH(name ${XMLRPC_LIBRARY_NAMES})
+    foreach(name ${XMLRPC_LIBRARY_NAMES})
       # Look for this library.
-      FIND_LIBRARY(XMLRPC_${name}_LIBRARY
+      find_library(XMLRPC_${name}_LIBRARY
         NAMES ${name}
         HINTS ${XMLRPC_LIBRARY_DIRS}
         )
-      MARK_AS_ADVANCED(XMLRPC_${name}_LIBRARY)
+      mark_as_advanced(XMLRPC_${name}_LIBRARY)
 
       # If any library is not found then the whole package is not found.
-      IF(NOT XMLRPC_${name}_LIBRARY)
-        SET(XMLRPC_FOUND 0)
-      ENDIF(NOT XMLRPC_${name}_LIBRARY)
+      if(NOT XMLRPC_${name}_LIBRARY)
+        set(XMLRPC_FOUND 0)
+      endif(NOT XMLRPC_${name}_LIBRARY)
 
       # Build an ordered list of all the libraries needed.
-      SET(XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES} "${XMLRPC_${name}_LIBRARY}")
-    ENDFOREACH(name)
-  ELSE("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
-    MESSAGE("Error running ${XMLRPC_C_CONFIG}: [${XMLRPC_C_CONFIG_RESULT}]")
-    SET(XMLRPC_FOUND 0)
-  ENDIF("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
-ENDIF(XMLRPC_FOUND)
+      set(XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES} "${XMLRPC_${name}_LIBRARY}")
+    endforeach(name)
+  else("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
+    message("Error running ${XMLRPC_C_CONFIG}: [${XMLRPC_C_CONFIG_RESULT}]")
+    set(XMLRPC_FOUND 0)
+  endif("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
+endif(XMLRPC_FOUND)
 
 # Report the results.
-IF(NOT XMLRPC_FOUND)
-  SET(XMLRPC_DIR_MESSAGE
+if(NOT XMLRPC_FOUND)
+  set(XMLRPC_DIR_MESSAGE
     "XMLRPC was not found. Make sure the entries XMLRPC_* are set.")
-  IF(NOT XMLRPC_FIND_QUIETLY)
-    MESSAGE(STATUS "${XMLRPC_DIR_MESSAGE}")
-  ELSE(NOT XMLRPC_FIND_QUIETLY)
-    IF(XMLRPC_FIND_REQUIRED)
-      MESSAGE(FATAL_ERROR "${XMLRPC_DIR_MESSAGE}")
-    ENDIF(XMLRPC_FIND_REQUIRED)
-  ENDIF(NOT XMLRPC_FIND_QUIETLY)
-ENDIF(NOT XMLRPC_FOUND)
+  if(NOT XMLRPC_FIND_QUIETLY)
+    message(STATUS "${XMLRPC_DIR_MESSAGE}")
+  else(NOT XMLRPC_FIND_QUIETLY)
+    if(XMLRPC_FIND_REQUIRED)
+      message(FATAL_ERROR "${XMLRPC_DIR_MESSAGE}")
+    endif(XMLRPC_FIND_REQUIRED)
+  endif(NOT XMLRPC_FIND_QUIETLY)
+endif(NOT XMLRPC_FOUND)
diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake
index e42b5a416..6b3c4cf94 100644
--- a/Modules/FindZLIB.cmake
+++ b/Modules/FindZLIB.cmake
@@ -34,59 +34,59 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-SET(_ZLIB_SEARCHES)
+set(_ZLIB_SEARCHES)
 
 # Search ZLIB_ROOT first if it is set.
-IF(ZLIB_ROOT)
-  SET(_ZLIB_SEARCH_ROOT PATHS ${ZLIB_ROOT} NO_DEFAULT_PATH)
-  LIST(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_ROOT)
-ENDIF()
+if(ZLIB_ROOT)
+  set(_ZLIB_SEARCH_ROOT PATHS ${ZLIB_ROOT} NO_DEFAULT_PATH)
+  list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_ROOT)
+endif()
 
 # Normal search.
-SET(_ZLIB_SEARCH_NORMAL
+set(_ZLIB_SEARCH_NORMAL
   PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]"
         "$ENV{PROGRAMFILES}/zlib"
   )
-LIST(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_NORMAL)
+list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_NORMAL)
 
-SET(ZLIB_NAMES z zlib zdll zlib1 zlibd zlibd1)
+set(ZLIB_NAMES z zlib zdll zlib1 zlibd zlibd1)
 
 # Try each search configuration.
-FOREACH(search ${_ZLIB_SEARCHES})
-  FIND_PATH(ZLIB_INCLUDE_DIR NAMES zlib.h        ${${search}} PATH_SUFFIXES include)
-  FIND_LIBRARY(ZLIB_LIBRARY  NAMES ${ZLIB_NAMES} ${${search}} PATH_SUFFIXES lib)
-ENDFOREACH()
+foreach(search ${_ZLIB_SEARCHES})
+  find_path(ZLIB_INCLUDE_DIR NAMES zlib.h        ${${search}} PATH_SUFFIXES include)
+  find_library(ZLIB_LIBRARY  NAMES ${ZLIB_NAMES} ${${search}} PATH_SUFFIXES lib)
+endforeach()
 
-MARK_AS_ADVANCED(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
+mark_as_advanced(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
 
-IF(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
-    FILE(STRINGS "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H REGEX "^#define ZLIB_VERSION \"[^\"]*\"$")
+if(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
+    file(STRINGS "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H REGEX "^#define ZLIB_VERSION \"[^\"]*\"$")
 
-    STRING(REGEX REPLACE "^.*ZLIB_VERSION \"([0-9]+).*$" "\\1" ZLIB_VERSION_MAJOR "${ZLIB_H}")
-    STRING(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_MINOR  "${ZLIB_H}")
-    STRING(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_PATCH "${ZLIB_H}")
-    SET(ZLIB_VERSION_STRING "${ZLIB_VERSION_MAJOR}.${ZLIB_VERSION_MINOR}.${ZLIB_VERSION_PATCH}")
+    string(REGEX REPLACE "^.*ZLIB_VERSION \"([0-9]+).*$" "\\1" ZLIB_VERSION_MAJOR "${ZLIB_H}")
+    string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_MINOR  "${ZLIB_H}")
+    string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_PATCH "${ZLIB_H}")
+    set(ZLIB_VERSION_STRING "${ZLIB_VERSION_MAJOR}.${ZLIB_VERSION_MINOR}.${ZLIB_VERSION_PATCH}")
 
     # only append a TWEAK version if it exists:
-    SET(ZLIB_VERSION_TWEAK "")
-    IF( "${ZLIB_H}" MATCHES "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$")
-        SET(ZLIB_VERSION_TWEAK "${CMAKE_MATCH_1}")
-        SET(ZLIB_VERSION_STRING "${ZLIB_VERSION_STRING}.${ZLIB_VERSION_TWEAK}")
-    ENDIF( "${ZLIB_H}" MATCHES "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$")
+    set(ZLIB_VERSION_TWEAK "")
+    if( "${ZLIB_H}" MATCHES "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$")
+        set(ZLIB_VERSION_TWEAK "${CMAKE_MATCH_1}")
+        set(ZLIB_VERSION_STRING "${ZLIB_VERSION_STRING}.${ZLIB_VERSION_TWEAK}")
+    endif( "${ZLIB_H}" MATCHES "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$")
 
-    SET(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}")
-    SET(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}")
-    SET(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}")
-ENDIF()
+    set(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}")
+    set(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}")
+    set(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}")
+endif()
 
 # handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
 # all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_DIR
                                        VERSION_VAR ZLIB_VERSION_STRING)
 
-IF(ZLIB_FOUND)
-    SET(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
-    SET(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
-ENDIF()
+if(ZLIB_FOUND)
+    set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
+    set(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
+endif()
 
diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake
index bf45dc616..b1a17a89a 100644
--- a/Modules/FindwxWidgets.cmake
+++ b/Modules/FindwxWidgets.cmake
@@ -4,7 +4,7 @@
 # modules that you will use, you need to name them as components to
 # the package:
 #
-# FIND_PACKAGE(wxWidgets COMPONENTS core base ...)
+# find_package(wxWidgets COMPONENTS core base ...)
 #
 # There are two search branches: a windows style and a unix style. For
 # windows, the following variables are searched for and set to
@@ -38,7 +38,7 @@
 # example, to use the base toolkit found in the /usr/local path, set
 # the variable (before calling the FIND_PACKAGE command) as such:
 #
-#  SET(wxWidgets_CONFIG_OPTIONS --toolkit=base --prefix=/usr)
+#  set(wxWidgets_CONFIG_OPTIONS --toolkit=base --prefix=/usr)
 #
 # The following are set after the configuration is done for both
 # windows and unix style:
@@ -62,18 +62,18 @@
 #
 # Sample usage:
 #   # Note that for MinGW users the order of libs is important!
-#   FIND_PACKAGE(wxWidgets COMPONENTS net gl core base)
-#   IF(wxWidgets_FOUND)
-#     INCLUDE(${wxWidgets_USE_FILE})
+#   find_package(wxWidgets COMPONENTS net gl core base)
+#   if(wxWidgets_FOUND)
+#     include(${wxWidgets_USE_FILE})
 #     # and for each of your dependent executable/library targets:
-#     TARGET_LINK_LIBRARIES(<YourTarget> ${wxWidgets_LIBRARIES})
-#   ENDIF(wxWidgets_FOUND)
+#     target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
+#   endif(wxWidgets_FOUND)
 #
 # If wxWidgets is required (i.e., not an optional part):
-#   FIND_PACKAGE(wxWidgets REQUIRED net gl core base)
-#   INCLUDE(${wxWidgets_USE_FILE})
+#   find_package(wxWidgets REQUIRED net gl core base)
+#   include(${wxWidgets_USE_FILE})
 #   # and for each of your dependent executable/library targets:
-#   TARGET_LINK_LIBRARIES(<YourTarget> ${wxWidgets_LIBRARIES})
+#   target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
 
 #=============================================================================
 # Copyright 2004-2009 Kitware, Inc.
@@ -94,7 +94,7 @@
 #        Remember to connect back to the upper text.
 # Sample usage with monolithic wx build:
 #
-#   FIND_PACKAGE(wxWidgets COMPONENTS mono)
+#   find_package(wxWidgets COMPONENTS mono)
 #   ...
 
 # NOTES
@@ -143,21 +143,21 @@
 #
 # Helper macro to control the debugging output globally. There are
 # two versions for controlling how verbose your output should be.
-MACRO(DBG_MSG _MSG)
-#  MESSAGE(STATUS
+macro(DBG_MSG _MSG)
+#  message(STATUS
 #    "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}")
-ENDMACRO(DBG_MSG)
-MACRO(DBG_MSG_V _MSG)
-#  MESSAGE(STATUS
+endmacro(DBG_MSG)
+macro(DBG_MSG_V _MSG)
+#  message(STATUS
 #    "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}")
-ENDMACRO(DBG_MSG_V)
+endmacro(DBG_MSG_V)
 
 # Clear return values in case the module is loaded more than once.
-SET(wxWidgets_FOUND FALSE)
-SET(wxWidgets_INCLUDE_DIRS "")
-SET(wxWidgets_LIBRARIES    "")
-SET(wxWidgets_LIBRARY_DIRS "")
-SET(wxWidgets_CXX_FLAGS    "")
+set(wxWidgets_FOUND FALSE)
+set(wxWidgets_INCLUDE_DIRS "")
+set(wxWidgets_LIBRARIES    "")
+set(wxWidgets_LIBRARY_DIRS "")
+set(wxWidgets_CXX_FLAGS    "")
 
 # Using SYSTEM with INCLUDE_DIRECTORIES in conjunction with wxWidgets on
 # the Mac produces compiler errors. Set wxWidgets_INCLUDE_DIRS_NO_SYSTEM
@@ -167,9 +167,9 @@ SET(wxWidgets_CXX_FLAGS    "")
 #   http://www.cmake.org/pipermail/cmake/2008-April/021115.html
 #   http://www.cmake.org/pipermail/cmake/2008-April/021146.html
 #
-IF(APPLE OR CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
-  SET(wxWidgets_INCLUDE_DIRS_NO_SYSTEM 1)
-ENDIF()
+if(APPLE OR CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
+  set(wxWidgets_INCLUDE_DIRS_NO_SYSTEM 1)
+endif()
 
 # DEPRECATED: This is a patch to support the DEPRECATED use of
 # wxWidgets_USE_LIBS.
@@ -177,9 +177,9 @@ ENDIF()
 # If wxWidgets_USE_LIBS is set:
 # - if using <components>, then override wxWidgets_USE_LIBS
 # - else set wxWidgets_FIND_COMPONENTS to wxWidgets_USE_LIBS
-IF(wxWidgets_USE_LIBS AND NOT wxWidgets_FIND_COMPONENTS)
-  SET(wxWidgets_FIND_COMPONENTS ${wxWidgets_USE_LIBS})
-ENDIF(wxWidgets_USE_LIBS AND NOT wxWidgets_FIND_COMPONENTS)
+if(wxWidgets_USE_LIBS AND NOT wxWidgets_FIND_COMPONENTS)
+  set(wxWidgets_FIND_COMPONENTS ${wxWidgets_USE_LIBS})
+endif(wxWidgets_USE_LIBS AND NOT wxWidgets_FIND_COMPONENTS)
 DBG_MSG("wxWidgets_FIND_COMPONENTS : ${wxWidgets_FIND_COMPONENTS}")
 
 # Add the convenience use file if available.
@@ -187,50 +187,50 @@ DBG_MSG("wxWidgets_FIND_COMPONENTS : ${wxWidgets_FIND_COMPONENTS}")
 # Get dir of this file which may reside in:
 # - CMAKE_MAKE_ROOT/Modules on CMake installation
 # - CMAKE_MODULE_PATH if user prefers his own specialized version
-SET(wxWidgets_USE_FILE "")
-GET_FILENAME_COMPONENT(
+set(wxWidgets_USE_FILE "")
+get_filename_component(
   wxWidgets_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
 # Prefer an existing customized version, but the user might override
 # the FindwxWidgets module and not the UsewxWidgets one.
-IF(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
-  SET(wxWidgets_USE_FILE
+if(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
+  set(wxWidgets_USE_FILE
     "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
-ELSE(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
-  SET(wxWidgets_USE_FILE UsewxWidgets)
-ENDIF(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
+else(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
+  set(wxWidgets_USE_FILE UsewxWidgets)
+endif(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
 
 #=====================================================================
 #=====================================================================
-IF(WIN32 AND NOT CYGWIN AND NOT MSYS)
-  SET(wxWidgets_FIND_STYLE "win32")
-ELSE(WIN32 AND NOT CYGWIN AND NOT MSYS)
-  IF(UNIX OR MSYS)
-    SET(wxWidgets_FIND_STYLE "unix")
-  ENDIF(UNIX OR MSYS)
-ENDIF(WIN32 AND NOT CYGWIN AND NOT MSYS)
+if(WIN32 AND NOT CYGWIN AND NOT MSYS)
+  set(wxWidgets_FIND_STYLE "win32")
+else(WIN32 AND NOT CYGWIN AND NOT MSYS)
+  if(UNIX OR MSYS)
+    set(wxWidgets_FIND_STYLE "unix")
+  endif(UNIX OR MSYS)
+endif(WIN32 AND NOT CYGWIN AND NOT MSYS)
 
 #=====================================================================
 # WIN32_FIND_STYLE
 #=====================================================================
-IF(wxWidgets_FIND_STYLE STREQUAL "win32")
+if(wxWidgets_FIND_STYLE STREQUAL "win32")
   # Useful common wx libs needed by almost all components.
-  SET(wxWidgets_COMMON_LIBRARIES png tiff jpeg zlib regex expat)
+  set(wxWidgets_COMMON_LIBRARIES png tiff jpeg zlib regex expat)
 
-  # DEPRECATED: Use FIND_PACKAGE(wxWidgets COMPONENTS mono) instead.
-  IF(NOT wxWidgets_FIND_COMPONENTS)
-    IF(wxWidgets_USE_MONOLITHIC)
-      SET(wxWidgets_FIND_COMPONENTS mono)
-    ELSE(wxWidgets_USE_MONOLITHIC)
-      SET(wxWidgets_FIND_COMPONENTS core base) # this is default
-    ENDIF(wxWidgets_USE_MONOLITHIC)
-  ENDIF(NOT wxWidgets_FIND_COMPONENTS)
+  # DEPRECATED: Use find_package(wxWidgets COMPONENTS mono) instead.
+  if(NOT wxWidgets_FIND_COMPONENTS)
+    if(wxWidgets_USE_MONOLITHIC)
+      set(wxWidgets_FIND_COMPONENTS mono)
+    else(wxWidgets_USE_MONOLITHIC)
+      set(wxWidgets_FIND_COMPONENTS core base) # this is default
+    endif(wxWidgets_USE_MONOLITHIC)
+  endif(NOT wxWidgets_FIND_COMPONENTS)
 
   # Add the common (usually required libs) unless
   # wxWidgets_EXCLUDE_COMMON_LIBRARIES has been set.
-  IF(NOT wxWidgets_EXCLUDE_COMMON_LIBRARIES)
-    LIST(APPEND wxWidgets_FIND_COMPONENTS
+  if(NOT wxWidgets_EXCLUDE_COMMON_LIBRARIES)
+    list(APPEND wxWidgets_FIND_COMPONENTS
       ${wxWidgets_COMMON_LIBRARIES})
-  ENDIF(NOT wxWidgets_EXCLUDE_COMMON_LIBRARIES)
+  endif(NOT wxWidgets_EXCLUDE_COMMON_LIBRARIES)
 
   #-------------------------------------------------------------------
   # WIN32: Helper MACROS
@@ -240,19 +240,19 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
   #   if _CONFIGURATION = mswunivud, then _UNV=univ, _UCD=u _DBG=d
   #   if _CONFIGURATION = mswu,      then _UNV="",   _UCD=u _DBG=""
   #
-  MACRO(WX_GET_NAME_COMPONENTS _CONFIGURATION _UNV _UCD _DBG)
-    STRING(REGEX MATCH "univ" ${_UNV} "${_CONFIGURATION}")
-    STRING(REGEX REPLACE "msw.*(u)[d]*$" "u" ${_UCD} "${_CONFIGURATION}")
-    IF(${_UCD} STREQUAL ${_CONFIGURATION})
-      SET(${_UCD} "")
-    ENDIF(${_UCD} STREQUAL ${_CONFIGURATION})
-    STRING(REGEX MATCH "d$" ${_DBG} "${_CONFIGURATION}")
-  ENDMACRO(WX_GET_NAME_COMPONENTS)
+  macro(WX_GET_NAME_COMPONENTS _CONFIGURATION _UNV _UCD _DBG)
+    string(REGEX MATCH "univ" ${_UNV} "${_CONFIGURATION}")
+    string(REGEX REPLACE "msw.*(u)[d]*$" "u" ${_UCD} "${_CONFIGURATION}")
+    if(${_UCD} STREQUAL ${_CONFIGURATION})
+      set(${_UCD} "")
+    endif(${_UCD} STREQUAL ${_CONFIGURATION})
+    string(REGEX MATCH "d$" ${_DBG} "${_CONFIGURATION}")
+  endmacro(WX_GET_NAME_COMPONENTS)
 
   #
   # Find libraries associated to a configuration.
   #
-  MACRO(WX_FIND_LIBS _UNV _UCD _DBG)
+  macro(WX_FIND_LIBS _UNV _UCD _DBG)
     DBG_MSG_V("m_unv = ${_UNV}")
     DBG_MSG_V("m_ucd = ${_UCD}")
     DBG_MSG_V("m_dbg = ${_DBG}")
@@ -260,19 +260,19 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
     # FIXME: What if both regex libs are available. regex should be
     # found outside the loop and only wx${LIB}${_UCD}${_DBG}.
     # Find wxWidgets common libraries.
-    FOREACH(LIB ${wxWidgets_COMMON_LIBRARIES} scintilla)
-      FIND_LIBRARY(WX_${LIB}${_DBG}
+    foreach(LIB ${wxWidgets_COMMON_LIBRARIES} scintilla)
+      find_library(WX_${LIB}${_DBG}
         NAMES
         wx${LIB}${_UCD}${_DBG} # for regex
         wx${LIB}${_DBG}
         PATHS ${WX_LIB_DIR}
         NO_DEFAULT_PATH
         )
-      MARK_AS_ADVANCED(WX_${LIB}${_DBG})
-    ENDFOREACH(LIB)
+      mark_as_advanced(WX_${LIB}${_DBG})
+    endforeach(LIB)
 
     # Find wxWidgets multilib base libraries.
-    FIND_LIBRARY(WX_base${_DBG}
+    find_library(WX_base${_DBG}
       NAMES
       wxbase29${_UCD}${_DBG}
       wxbase28${_UCD}${_DBG}
@@ -282,9 +282,9 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
       PATHS ${WX_LIB_DIR}
       NO_DEFAULT_PATH
       )
-    MARK_AS_ADVANCED(WX_base${_DBG})
-    FOREACH(LIB net odbc xml)
-      FIND_LIBRARY(WX_${LIB}${_DBG}
+    mark_as_advanced(WX_base${_DBG})
+    foreach(LIB net odbc xml)
+      find_library(WX_${LIB}${_DBG}
         NAMES
         wxbase29${_UCD}${_DBG}_${LIB}
         wxbase28${_UCD}${_DBG}_${LIB}
@@ -294,11 +294,11 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
         PATHS ${WX_LIB_DIR}
         NO_DEFAULT_PATH
         )
-      MARK_AS_ADVANCED(WX_${LIB}${_DBG})
-    ENDFOREACH(LIB)
+      mark_as_advanced(WX_${LIB}${_DBG})
+    endforeach(LIB)
 
     # Find wxWidgets monolithic library.
-    FIND_LIBRARY(WX_mono${_DBG}
+    find_library(WX_mono${_DBG}
       NAMES
       wxmsw${_UNV}29${_UCD}${_DBG}
       wxmsw${_UNV}28${_UCD}${_DBG}
@@ -308,12 +308,12 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
       PATHS ${WX_LIB_DIR}
       NO_DEFAULT_PATH
       )
-    MARK_AS_ADVANCED(WX_mono${_DBG})
+    mark_as_advanced(WX_mono${_DBG})
 
     # Find wxWidgets multilib libraries.
-    FOREACH(LIB core adv aui html media xrc dbgrid gl qa richtext
+    foreach(LIB core adv aui html media xrc dbgrid gl qa richtext
                 stc ribbon propgrid webview)
-      FIND_LIBRARY(WX_${LIB}${_DBG}
+      find_library(WX_${LIB}${_DBG}
         NAMES
         wxmsw${_UNV}29${_UCD}${_DBG}_${LIB}
         wxmsw${_UNV}28${_UCD}${_DBG}_${LIB}
@@ -323,102 +323,102 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
         PATHS ${WX_LIB_DIR}
         NO_DEFAULT_PATH
         )
-      MARK_AS_ADVANCED(WX_${LIB}${_DBG})
-    ENDFOREACH(LIB)
-  ENDMACRO(WX_FIND_LIBS)
+      mark_as_advanced(WX_${LIB}${_DBG})
+    endforeach(LIB)
+  endmacro(WX_FIND_LIBS)
 
   #
   # Clear all library paths, so that FIND_LIBRARY refinds them.
   #
   # Clear a lib, reset its found flag, and mark as advanced.
-  MACRO(WX_CLEAR_LIB _LIB)
-    SET(${_LIB} "${_LIB}-NOTFOUND" CACHE FILEPATH "Cleared." FORCE)
-    SET(${_LIB}_FOUND FALSE)
-    MARK_AS_ADVANCED(${_LIB})
-  ENDMACRO(WX_CLEAR_LIB)
+  macro(WX_CLEAR_LIB _LIB)
+    set(${_LIB} "${_LIB}-NOTFOUND" CACHE FILEPATH "Cleared." FORCE)
+    set(${_LIB}_FOUND FALSE)
+    mark_as_advanced(${_LIB})
+  endmacro(WX_CLEAR_LIB)
   # Clear all debug or release library paths (arguments are "d" or "").
-  MACRO(WX_CLEAR_ALL_LIBS _DBG)
+  macro(WX_CLEAR_ALL_LIBS _DBG)
     # Clear wxWidgets common libraries.
-    FOREACH(LIB ${wxWidgets_COMMON_LIBRARIES} scintilla)
+    foreach(LIB ${wxWidgets_COMMON_LIBRARIES} scintilla)
       WX_CLEAR_LIB(WX_${LIB}${_DBG})
-    ENDFOREACH(LIB)
+    endforeach(LIB)
 
     # Clear wxWidgets multilib base libraries.
     WX_CLEAR_LIB(WX_base${_DBG})
-    FOREACH(LIB net odbc xml)
+    foreach(LIB net odbc xml)
       WX_CLEAR_LIB(WX_${LIB}${_DBG})
-    ENDFOREACH(LIB)
+    endforeach(LIB)
 
     # Clear wxWidgets monolithic library.
     WX_CLEAR_LIB(WX_mono${_DBG})
 
     # Clear wxWidgets multilib libraries.
-    FOREACH(LIB core adv aui html media xrc dbgrid gl qa richtext
+    foreach(LIB core adv aui html media xrc dbgrid gl qa richtext
                 stc ribbon propgrid)
       WX_CLEAR_LIB(WX_${LIB}${_DBG})
-    ENDFOREACH(LIB)
-  ENDMACRO(WX_CLEAR_ALL_LIBS)
+    endforeach(LIB)
+  endmacro(WX_CLEAR_ALL_LIBS)
   # Clear all wxWidgets debug libraries.
-  MACRO(WX_CLEAR_ALL_DBG_LIBS)
+  macro(WX_CLEAR_ALL_DBG_LIBS)
     WX_CLEAR_ALL_LIBS("d")
-  ENDMACRO(WX_CLEAR_ALL_DBG_LIBS)
+  endmacro(WX_CLEAR_ALL_DBG_LIBS)
   # Clear all wxWidgets release libraries.
-  MACRO(WX_CLEAR_ALL_REL_LIBS)
+  macro(WX_CLEAR_ALL_REL_LIBS)
     WX_CLEAR_ALL_LIBS("")
-  ENDMACRO(WX_CLEAR_ALL_REL_LIBS)
+  endmacro(WX_CLEAR_ALL_REL_LIBS)
 
   #
   # Set the wxWidgets_LIBRARIES variable.
   # Also, Sets output variable wxWidgets_FOUND to FALSE if it fails.
   #
-  MACRO(WX_SET_LIBRARIES _LIBS _DBG)
+  macro(WX_SET_LIBRARIES _LIBS _DBG)
     DBG_MSG_V("Looking for ${${_LIBS}}")
-    IF(WX_USE_REL_AND_DBG)
-      FOREACH(LIB ${${_LIBS}})
+    if(WX_USE_REL_AND_DBG)
+      foreach(LIB ${${_LIBS}})
         DBG_MSG_V("Searching for ${LIB} and ${LIB}d")
         DBG_MSG_V("WX_${LIB}  : ${WX_${LIB}}")
         DBG_MSG_V("WX_${LIB}d : ${WX_${LIB}d}")
-        IF(WX_${LIB} AND WX_${LIB}d)
+        if(WX_${LIB} AND WX_${LIB}d)
           DBG_MSG_V("Found ${LIB} and ${LIB}d")
-          LIST(APPEND wxWidgets_LIBRARIES
+          list(APPEND wxWidgets_LIBRARIES
             debug ${WX_${LIB}d} optimized ${WX_${LIB}}
             )
-        ELSE(WX_${LIB} AND WX_${LIB}d)
+        else(WX_${LIB} AND WX_${LIB}d)
           DBG_MSG_V("- not found due to missing WX_${LIB}=${WX_${LIB}} or WX_${LIB}d=${WX_${LIB}d}")
-          SET(wxWidgets_FOUND FALSE)
-        ENDIF(WX_${LIB} AND WX_${LIB}d)
-      ENDFOREACH(LIB)
-    ELSE(WX_USE_REL_AND_DBG)
-      FOREACH(LIB ${${_LIBS}})
+          set(wxWidgets_FOUND FALSE)
+        endif(WX_${LIB} AND WX_${LIB}d)
+      endforeach(LIB)
+    else(WX_USE_REL_AND_DBG)
+      foreach(LIB ${${_LIBS}})
         DBG_MSG_V("Searching for ${LIB}${_DBG}")
         DBG_MSG_V("WX_${LIB}${_DBG} : ${WX_${LIB}${_DBG}}")
-        IF(WX_${LIB}${_DBG})
+        if(WX_${LIB}${_DBG})
           DBG_MSG_V("Found ${LIB}${_DBG}")
-          LIST(APPEND wxWidgets_LIBRARIES ${WX_${LIB}${_DBG}})
-        ELSE(WX_${LIB}${_DBG})
+          list(APPEND wxWidgets_LIBRARIES ${WX_${LIB}${_DBG}})
+        else(WX_${LIB}${_DBG})
           DBG_MSG_V(
             "- not found due to missing WX_${LIB}${_DBG}=${WX_${LIB}${_DBG}}")
-          SET(wxWidgets_FOUND FALSE)
-        ENDIF(WX_${LIB}${_DBG})
-      ENDFOREACH(LIB)
-    ENDIF(WX_USE_REL_AND_DBG)
+          set(wxWidgets_FOUND FALSE)
+        endif(WX_${LIB}${_DBG})
+      endforeach(LIB)
+    endif(WX_USE_REL_AND_DBG)
 
     DBG_MSG_V("OpenGL")
-    LIST(FIND ${_LIBS} gl WX_USE_GL)
-    IF(NOT WX_USE_GL EQUAL -1)
+    list(FIND ${_LIBS} gl WX_USE_GL)
+    if(NOT WX_USE_GL EQUAL -1)
       DBG_MSG_V("- is required.")
-      LIST(APPEND wxWidgets_LIBRARIES opengl32 glu32)
-    ENDIF(NOT WX_USE_GL EQUAL -1)
+      list(APPEND wxWidgets_LIBRARIES opengl32 glu32)
+    endif(NOT WX_USE_GL EQUAL -1)
 
-    LIST(APPEND wxWidgets_LIBRARIES winmm comctl32 rpcrt4 wsock32)
-  ENDMACRO(WX_SET_LIBRARIES)
+    list(APPEND wxWidgets_LIBRARIES winmm comctl32 rpcrt4 wsock32)
+  endmacro(WX_SET_LIBRARIES)
 
   #-------------------------------------------------------------------
   # WIN32: Start actual work.
   #-------------------------------------------------------------------
 
   # Look for an installation tree.
-  FIND_PATH(wxWidgets_ROOT_DIR
+  find_path(wxWidgets_ROOT_DIR
     NAMES include/wx/wx.h
     PATHS
       $ENV{wxWidgets_ROOT_DIR}
@@ -462,24 +462,24 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
     )
 
   # If wxWidgets_ROOT_DIR changed, clear lib dir.
-  IF(NOT WX_ROOT_DIR STREQUAL wxWidgets_ROOT_DIR)
-    SET(WX_ROOT_DIR ${wxWidgets_ROOT_DIR}
+  if(NOT WX_ROOT_DIR STREQUAL wxWidgets_ROOT_DIR)
+    set(WX_ROOT_DIR ${wxWidgets_ROOT_DIR}
         CACHE INTERNAL "wxWidgets_ROOT_DIR")
-    SET(wxWidgets_LIB_DIR "wxWidgets_LIB_DIR-NOTFOUND"
+    set(wxWidgets_LIB_DIR "wxWidgets_LIB_DIR-NOTFOUND"
         CACHE PATH "Cleared." FORCE)
-  ENDIF(NOT WX_ROOT_DIR STREQUAL wxWidgets_ROOT_DIR)
+  endif(NOT WX_ROOT_DIR STREQUAL wxWidgets_ROOT_DIR)
 
-  IF(WX_ROOT_DIR)
+  if(WX_ROOT_DIR)
     # Select one default tree inside the already determined wx tree.
     # Prefer static/shared order usually consistent with build
     # settings.
-    IF(MINGW)
-      SET(WX_LIB_DIR_PREFIX gcc)
-    ELSE(MINGW)
-      SET(WX_LIB_DIR_PREFIX vc)
-    ENDIF(MINGW)
-    IF(BUILD_SHARED_LIBS)
-      FIND_PATH(wxWidgets_LIB_DIR
+    if(MINGW)
+      set(WX_LIB_DIR_PREFIX gcc)
+    else(MINGW)
+      set(WX_LIB_DIR_PREFIX vc)
+    endif(MINGW)
+    if(BUILD_SHARED_LIBS)
+      find_path(wxWidgets_LIB_DIR
         NAMES
           msw/wx/setup.h
           mswd/wx/setup.h
@@ -495,8 +495,8 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
         DOC "Path to wxWidgets libraries?"
         NO_DEFAULT_PATH
         )
-    ELSE(BUILD_SHARED_LIBS)
-      FIND_PATH(wxWidgets_LIB_DIR
+    else(BUILD_SHARED_LIBS)
+      find_path(wxWidgets_LIB_DIR
         NAMES
           msw/wx/setup.h
           mswd/wx/setup.h
@@ -512,202 +512,202 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
         DOC "Path to wxWidgets libraries?"
         NO_DEFAULT_PATH
         )
-    ENDIF(BUILD_SHARED_LIBS)
+    endif(BUILD_SHARED_LIBS)
 
     # If wxWidgets_LIB_DIR changed, clear all libraries.
-    IF(NOT WX_LIB_DIR STREQUAL wxWidgets_LIB_DIR)
-      SET(WX_LIB_DIR ${wxWidgets_LIB_DIR} CACHE INTERNAL "wxWidgets_LIB_DIR")
+    if(NOT WX_LIB_DIR STREQUAL wxWidgets_LIB_DIR)
+      set(WX_LIB_DIR ${wxWidgets_LIB_DIR} CACHE INTERNAL "wxWidgets_LIB_DIR")
       WX_CLEAR_ALL_DBG_LIBS()
       WX_CLEAR_ALL_REL_LIBS()
-    ENDIF(NOT WX_LIB_DIR STREQUAL wxWidgets_LIB_DIR)
+    endif(NOT WX_LIB_DIR STREQUAL wxWidgets_LIB_DIR)
 
-    IF(WX_LIB_DIR)
+    if(WX_LIB_DIR)
       # If building shared libs, define WXUSINGDLL to use dllimport.
-      IF(WX_LIB_DIR MATCHES ".*[dD][lL][lL].*")
-        SET(wxWidgets_DEFINITIONS WXUSINGDLL)
+      if(WX_LIB_DIR MATCHES ".*[dD][lL][lL].*")
+        set(wxWidgets_DEFINITIONS WXUSINGDLL)
         DBG_MSG_V("detected SHARED/DLL tree WX_LIB_DIR=${WX_LIB_DIR}")
-      ENDIF(WX_LIB_DIR MATCHES ".*[dD][lL][lL].*")
+      endif(WX_LIB_DIR MATCHES ".*[dD][lL][lL].*")
 
       # Search for available configuration types.
-      FOREACH(CFG mswunivud mswunivd mswud mswd mswunivu mswuniv mswu msw)
-        SET(WX_${CFG}_FOUND FALSE)
-        IF(EXISTS ${WX_LIB_DIR}/${CFG})
-          LIST(APPEND WX_CONFIGURATION_LIST ${CFG})
-          SET(WX_${CFG}_FOUND TRUE)
-          SET(WX_CONFIGURATION ${CFG})
-        ENDIF(EXISTS ${WX_LIB_DIR}/${CFG})
-      ENDFOREACH(CFG)
+      foreach(CFG mswunivud mswunivd mswud mswd mswunivu mswuniv mswu msw)
+        set(WX_${CFG}_FOUND FALSE)
+        if(EXISTS ${WX_LIB_DIR}/${CFG})
+          list(APPEND WX_CONFIGURATION_LIST ${CFG})
+          set(WX_${CFG}_FOUND TRUE)
+          set(WX_CONFIGURATION ${CFG})
+        endif(EXISTS ${WX_LIB_DIR}/${CFG})
+      endforeach(CFG)
       DBG_MSG_V("WX_CONFIGURATION_LIST=${WX_CONFIGURATION_LIST}")
 
-      IF(WX_CONFIGURATION)
-        SET(wxWidgets_FOUND TRUE)
+      if(WX_CONFIGURATION)
+        set(wxWidgets_FOUND TRUE)
 
         # If the selected configuration wasn't found force the default
         # one. Otherwise, use it but still force a refresh for
         # updating the doc string with the current list of available
         # configurations.
-        IF(NOT WX_${wxWidgets_CONFIGURATION}_FOUND)
-          SET(wxWidgets_CONFIGURATION ${WX_CONFIGURATION} CACHE STRING
+        if(NOT WX_${wxWidgets_CONFIGURATION}_FOUND)
+          set(wxWidgets_CONFIGURATION ${WX_CONFIGURATION} CACHE STRING
             "Set wxWidgets configuration (${WX_CONFIGURATION_LIST})" FORCE)
-        ELSE(NOT WX_${wxWidgets_CONFIGURATION}_FOUND)
-          SET(wxWidgets_CONFIGURATION ${wxWidgets_CONFIGURATION} CACHE STRING
+        else(NOT WX_${wxWidgets_CONFIGURATION}_FOUND)
+          set(wxWidgets_CONFIGURATION ${wxWidgets_CONFIGURATION} CACHE STRING
             "Set wxWidgets configuration (${WX_CONFIGURATION_LIST})" FORCE)
-        ENDIF(NOT WX_${wxWidgets_CONFIGURATION}_FOUND)
+        endif(NOT WX_${wxWidgets_CONFIGURATION}_FOUND)
 
         # If release config selected, and both release/debug exist.
-        IF(WX_${wxWidgets_CONFIGURATION}d_FOUND)
-          OPTION(wxWidgets_USE_REL_AND_DBG
+        if(WX_${wxWidgets_CONFIGURATION}d_FOUND)
+          option(wxWidgets_USE_REL_AND_DBG
             "Use release and debug configurations?" TRUE)
-          SET(WX_USE_REL_AND_DBG ${wxWidgets_USE_REL_AND_DBG})
-        ELSE(WX_${wxWidgets_CONFIGURATION}d_FOUND)
+          set(WX_USE_REL_AND_DBG ${wxWidgets_USE_REL_AND_DBG})
+        else(WX_${wxWidgets_CONFIGURATION}d_FOUND)
           # If the option exists (already in cache), force it false.
-          IF(wxWidgets_USE_REL_AND_DBG)
-            SET(wxWidgets_USE_REL_AND_DBG FALSE CACHE BOOL
+          if(wxWidgets_USE_REL_AND_DBG)
+            set(wxWidgets_USE_REL_AND_DBG FALSE CACHE BOOL
               "No ${wxWidgets_CONFIGURATION}d found." FORCE)
-          ENDIF(wxWidgets_USE_REL_AND_DBG)
-          SET(WX_USE_REL_AND_DBG FALSE)
-        ENDIF(WX_${wxWidgets_CONFIGURATION}d_FOUND)
+          endif(wxWidgets_USE_REL_AND_DBG)
+          set(WX_USE_REL_AND_DBG FALSE)
+        endif(WX_${wxWidgets_CONFIGURATION}d_FOUND)
 
         # Get configuration parameters from the name.
         WX_GET_NAME_COMPONENTS(${wxWidgets_CONFIGURATION} UNV UCD DBG)
 
         # Set wxWidgets lib setup include directory.
-        IF(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h)
-          SET(wxWidgets_INCLUDE_DIRS
+        if(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h)
+          set(wxWidgets_INCLUDE_DIRS
             ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION})
-        ELSE(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h)
+        else(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h)
           DBG_MSG("wxWidgets_FOUND FALSE because ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h does not exists.")
-          SET(wxWidgets_FOUND FALSE)
-        ENDIF(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h)
+          set(wxWidgets_FOUND FALSE)
+        endif(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h)
 
         # Set wxWidgets main include directory.
-        IF(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h)
-          LIST(APPEND wxWidgets_INCLUDE_DIRS ${WX_ROOT_DIR}/include)
-        ELSE(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h)
+        if(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h)
+          list(APPEND wxWidgets_INCLUDE_DIRS ${WX_ROOT_DIR}/include)
+        else(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h)
           DBG_MSG("wxWidgets_FOUND FALSE because WX_ROOT_DIR=${WX_ROOT_DIR} has no ${WX_ROOT_DIR}/include/wx/wx.h")
-          SET(wxWidgets_FOUND FALSE)
-        ENDIF(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h)
+          set(wxWidgets_FOUND FALSE)
+        endif(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h)
 
         # Find wxWidgets libraries.
         WX_FIND_LIBS("${UNV}" "${UCD}" "${DBG}")
-        IF(WX_USE_REL_AND_DBG)
+        if(WX_USE_REL_AND_DBG)
           WX_FIND_LIBS("${UNV}" "${UCD}" "d")
-        ENDIF(WX_USE_REL_AND_DBG)
+        endif(WX_USE_REL_AND_DBG)
 
         # Settings for requested libs (i.e., include dir, libraries, etc.).
         WX_SET_LIBRARIES(wxWidgets_FIND_COMPONENTS "${DBG}")
 
         # Add necessary definitions for unicode builds
-        IF("${UCD}" STREQUAL "u")
-          LIST(APPEND wxWidgets_DEFINITIONS UNICODE _UNICODE)
-        ENDIF("${UCD}" STREQUAL "u")
+        if("${UCD}" STREQUAL "u")
+          list(APPEND wxWidgets_DEFINITIONS UNICODE _UNICODE)
+        endif("${UCD}" STREQUAL "u")
 
         # Add necessary definitions for debug builds
-        SET(wxWidgets_DEFINITIONS_DEBUG _DEBUG __WXDEBUG__)
+        set(wxWidgets_DEFINITIONS_DEBUG _DEBUG __WXDEBUG__)
 
-      ENDIF(WX_CONFIGURATION)
-    ENDIF(WX_LIB_DIR)
-  ENDIF(WX_ROOT_DIR)
+      endif(WX_CONFIGURATION)
+    endif(WX_LIB_DIR)
+  endif(WX_ROOT_DIR)
 
 #=====================================================================
 # UNIX_FIND_STYLE
 #=====================================================================
-ELSE(wxWidgets_FIND_STYLE STREQUAL "win32")
-  IF(wxWidgets_FIND_STYLE STREQUAL "unix")
+else(wxWidgets_FIND_STYLE STREQUAL "win32")
+  if(wxWidgets_FIND_STYLE STREQUAL "unix")
     #-----------------------------------------------------------------
     # UNIX: Helper MACROS
     #-----------------------------------------------------------------
     #
     # Set the default values based on "wx-config --selected-config".
     #
-    MACRO(WX_CONFIG_SELECT_GET_DEFAULT)
-      EXECUTE_PROCESS(
+    macro(WX_CONFIG_SELECT_GET_DEFAULT)
+      execute_process(
         COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
           ${wxWidgets_CONFIG_OPTIONS} --selected-config
         OUTPUT_VARIABLE _wx_selected_config
         RESULT_VARIABLE _wx_result
         ERROR_QUIET
         )
-      IF(_wx_result EQUAL 0)
-        FOREACH(_opt_name debug static unicode universal)
-          STRING(TOUPPER ${_opt_name} _upper_opt_name)
-          IF(_wx_selected_config MATCHES ".*${_opt_name}.*")
-            SET(wxWidgets_DEFAULT_${_upper_opt_name} ON)
-          ELSE(_wx_selected_config MATCHES ".*${_opt_name}.*")
-            SET(wxWidgets_DEFAULT_${_upper_opt_name} OFF)
-          ENDIF(_wx_selected_config MATCHES ".*${_opt_name}.*")
-        ENDFOREACH(_opt_name)
-      ELSE(_wx_result EQUAL 0)
-        FOREACH(_upper_opt_name DEBUG STATIC UNICODE UNIVERSAL)
-          SET(wxWidgets_DEFAULT_${_upper_opt_name} OFF)
-        ENDFOREACH(_upper_opt_name)
-      ENDIF(_wx_result EQUAL 0)
-    ENDMACRO(WX_CONFIG_SELECT_GET_DEFAULT)
+      if(_wx_result EQUAL 0)
+        foreach(_opt_name debug static unicode universal)
+          string(TOUPPER ${_opt_name} _upper_opt_name)
+          if(_wx_selected_config MATCHES ".*${_opt_name}.*")
+            set(wxWidgets_DEFAULT_${_upper_opt_name} ON)
+          else(_wx_selected_config MATCHES ".*${_opt_name}.*")
+            set(wxWidgets_DEFAULT_${_upper_opt_name} OFF)
+          endif(_wx_selected_config MATCHES ".*${_opt_name}.*")
+        endforeach(_opt_name)
+      else(_wx_result EQUAL 0)
+        foreach(_upper_opt_name DEBUG STATIC UNICODE UNIVERSAL)
+          set(wxWidgets_DEFAULT_${_upper_opt_name} OFF)
+        endforeach(_upper_opt_name)
+      endif(_wx_result EQUAL 0)
+    endmacro(WX_CONFIG_SELECT_GET_DEFAULT)
 
     #
     # Query a boolean configuration option to determine if the system
     # has both builds available. If so, provide the selection option
     # to the user.
     #
-    MACRO(WX_CONFIG_SELECT_QUERY_BOOL _OPT_NAME _OPT_HELP)
-      EXECUTE_PROCESS(
+    macro(WX_CONFIG_SELECT_QUERY_BOOL _OPT_NAME _OPT_HELP)
+      execute_process(
         COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
           ${wxWidgets_CONFIG_OPTIONS} --${_OPT_NAME}=yes
         RESULT_VARIABLE _wx_result_yes
         OUTPUT_QUIET
         ERROR_QUIET
         )
-      EXECUTE_PROCESS(
+      execute_process(
         COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
           ${wxWidgets_CONFIG_OPTIONS} --${_OPT_NAME}=no
         RESULT_VARIABLE _wx_result_no
         OUTPUT_QUIET
         ERROR_QUIET
         )
-      STRING(TOUPPER ${_OPT_NAME} _UPPER_OPT_NAME)
-      IF(_wx_result_yes EQUAL 0 AND _wx_result_no EQUAL 0)
-        OPTION(wxWidgets_USE_${_UPPER_OPT_NAME}
+      string(TOUPPER ${_OPT_NAME} _UPPER_OPT_NAME)
+      if(_wx_result_yes EQUAL 0 AND _wx_result_no EQUAL 0)
+        option(wxWidgets_USE_${_UPPER_OPT_NAME}
           ${_OPT_HELP} ${wxWidgets_DEFAULT_${_UPPER_OPT_NAME}})
-      ELSE(_wx_result_yes EQUAL 0 AND _wx_result_no EQUAL 0)
+      else(_wx_result_yes EQUAL 0 AND _wx_result_no EQUAL 0)
         # If option exists (already in cache), force to available one.
-        IF(DEFINED wxWidgets_USE_${_UPPER_OPT_NAME})
-          IF(_wx_result_yes EQUAL 0)
-            SET(wxWidgets_USE_${_UPPER_OPT_NAME} ON  CACHE BOOL ${_OPT_HELP} FORCE)
-          ELSE(_wx_result_yes EQUAL 0)
-            SET(wxWidgets_USE_${_UPPER_OPT_NAME} OFF CACHE BOOL ${_OPT_HELP} FORCE)
-          ENDIF(_wx_result_yes EQUAL 0)
-        ENDIF(DEFINED wxWidgets_USE_${_UPPER_OPT_NAME})
-      ENDIF(_wx_result_yes EQUAL 0 AND _wx_result_no EQUAL 0)
-    ENDMACRO(WX_CONFIG_SELECT_QUERY_BOOL)
+        if(DEFINED wxWidgets_USE_${_UPPER_OPT_NAME})
+          if(_wx_result_yes EQUAL 0)
+            set(wxWidgets_USE_${_UPPER_OPT_NAME} ON  CACHE BOOL ${_OPT_HELP} FORCE)
+          else(_wx_result_yes EQUAL 0)
+            set(wxWidgets_USE_${_UPPER_OPT_NAME} OFF CACHE BOOL ${_OPT_HELP} FORCE)
+          endif(_wx_result_yes EQUAL 0)
+        endif(DEFINED wxWidgets_USE_${_UPPER_OPT_NAME})
+      endif(_wx_result_yes EQUAL 0 AND _wx_result_no EQUAL 0)
+    endmacro(WX_CONFIG_SELECT_QUERY_BOOL)
 
     #
     # Set wxWidgets_SELECT_OPTIONS to wx-config options for selecting
     # among multiple builds.
     #
-    MACRO(WX_CONFIG_SELECT_SET_OPTIONS)
-      SET(wxWidgets_SELECT_OPTIONS ${wxWidgets_CONFIG_OPTIONS})
-      FOREACH(_opt_name debug static unicode universal)
-        STRING(TOUPPER ${_opt_name} _upper_opt_name)
-        IF(DEFINED wxWidgets_USE_${_upper_opt_name})
-          IF(wxWidgets_USE_${_upper_opt_name})
-            LIST(APPEND wxWidgets_SELECT_OPTIONS --${_opt_name}=yes)
-          ELSE(wxWidgets_USE_${_upper_opt_name})
-            LIST(APPEND wxWidgets_SELECT_OPTIONS --${_opt_name}=no)
-          ENDIF(wxWidgets_USE_${_upper_opt_name})
-        ENDIF(DEFINED wxWidgets_USE_${_upper_opt_name})
-      ENDFOREACH(_opt_name)
-    ENDMACRO(WX_CONFIG_SELECT_SET_OPTIONS)
+    macro(WX_CONFIG_SELECT_SET_OPTIONS)
+      set(wxWidgets_SELECT_OPTIONS ${wxWidgets_CONFIG_OPTIONS})
+      foreach(_opt_name debug static unicode universal)
+        string(TOUPPER ${_opt_name} _upper_opt_name)
+        if(DEFINED wxWidgets_USE_${_upper_opt_name})
+          if(wxWidgets_USE_${_upper_opt_name})
+            list(APPEND wxWidgets_SELECT_OPTIONS --${_opt_name}=yes)
+          else(wxWidgets_USE_${_upper_opt_name})
+            list(APPEND wxWidgets_SELECT_OPTIONS --${_opt_name}=no)
+          endif(wxWidgets_USE_${_upper_opt_name})
+        endif(DEFINED wxWidgets_USE_${_upper_opt_name})
+      endforeach(_opt_name)
+    endmacro(WX_CONFIG_SELECT_SET_OPTIONS)
 
     #-----------------------------------------------------------------
     # UNIX: Start actual work.
     #-----------------------------------------------------------------
     # Support cross-compiling, only search in the target platform.
-    FIND_PROGRAM(wxWidgets_CONFIG_EXECUTABLE wx-config
+    find_program(wxWidgets_CONFIG_EXECUTABLE wx-config
       ONLY_CMAKE_FIND_ROOT_PATH
       )
 
-    IF(wxWidgets_CONFIG_EXECUTABLE)
-      SET(wxWidgets_FOUND TRUE)
+    if(wxWidgets_CONFIG_EXECUTABLE)
+      set(wxWidgets_FOUND TRUE)
 
       # get defaults based on "wx-config --selected-config"
       WX_CONFIG_SELECT_GET_DEFAULT()
@@ -723,99 +723,99 @@ ELSE(wxWidgets_FIND_STYLE STREQUAL "win32")
       DBG_MSG("wxWidgets_SELECT_OPTIONS=${wxWidgets_SELECT_OPTIONS}")
 
       # run the wx-config program to get cxxflags
-      EXECUTE_PROCESS(
+      execute_process(
         COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
           ${wxWidgets_SELECT_OPTIONS} --cxxflags
         OUTPUT_VARIABLE wxWidgets_CXX_FLAGS
         RESULT_VARIABLE RET
         ERROR_QUIET
         )
-      IF(RET EQUAL 0)
-        STRING(STRIP "${wxWidgets_CXX_FLAGS}" wxWidgets_CXX_FLAGS)
-        SEPARATE_ARGUMENTS(wxWidgets_CXX_FLAGS)
+      if(RET EQUAL 0)
+        string(STRIP "${wxWidgets_CXX_FLAGS}" wxWidgets_CXX_FLAGS)
+        separate_arguments(wxWidgets_CXX_FLAGS)
 
         DBG_MSG_V("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}")
 
         # parse definitions from cxxflags;
         #   drop -D* from CXXFLAGS and the -D prefix
-        STRING(REGEX MATCHALL "-D[^;]+"
+        string(REGEX MATCHALL "-D[^;]+"
           wxWidgets_DEFINITIONS  "${wxWidgets_CXX_FLAGS}")
-        STRING(REGEX REPLACE "-D[^;]+(;|$)" ""
+        string(REGEX REPLACE "-D[^;]+(;|$)" ""
           wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}")
-        STRING(REGEX REPLACE ";$" ""
+        string(REGEX REPLACE ";$" ""
           wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}")
-        STRING(REPLACE "-D" ""
+        string(REPLACE "-D" ""
           wxWidgets_DEFINITIONS "${wxWidgets_DEFINITIONS}")
 
         # parse include dirs from cxxflags; drop -I prefix
-        STRING(REGEX MATCHALL "-I[^;]+"
+        string(REGEX MATCHALL "-I[^;]+"
           wxWidgets_INCLUDE_DIRS "${wxWidgets_CXX_FLAGS}")
-        STRING(REGEX REPLACE "-I[^;]+;" ""
+        string(REGEX REPLACE "-I[^;]+;" ""
           wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}")
-        STRING(REPLACE "-I" ""
+        string(REPLACE "-I" ""
           wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}")
 
         DBG_MSG_V("wxWidgets_DEFINITIONS=${wxWidgets_DEFINITIONS}")
         DBG_MSG_V("wxWidgets_INCLUDE_DIRS=${wxWidgets_INCLUDE_DIRS}")
         DBG_MSG_V("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}")
 
-      ELSE(RET EQUAL 0)
-        SET(wxWidgets_FOUND FALSE)
+      else(RET EQUAL 0)
+        set(wxWidgets_FOUND FALSE)
         DBG_MSG_V(
           "${wxWidgets_CONFIG_EXECUTABLE} --cxxflags FAILED with RET=${RET}")
-      ENDIF(RET EQUAL 0)
+      endif(RET EQUAL 0)
 
       # run the wx-config program to get the libs
       # - NOTE: wx-config doesn't verify that the libs requested exist
       #         it just produces the names. Maybe a TRY_COMPILE would
       #         be useful here...
-      STRING(REPLACE ";" ","
+      string(REPLACE ";" ","
         wxWidgets_FIND_COMPONENTS "${wxWidgets_FIND_COMPONENTS}")
-      EXECUTE_PROCESS(
+      execute_process(
         COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
           ${wxWidgets_SELECT_OPTIONS} --libs ${wxWidgets_FIND_COMPONENTS}
         OUTPUT_VARIABLE wxWidgets_LIBRARIES
         RESULT_VARIABLE RET
         ERROR_QUIET
         )
-      IF(RET EQUAL 0)
-        STRING(STRIP "${wxWidgets_LIBRARIES}" wxWidgets_LIBRARIES)
-        SEPARATE_ARGUMENTS(wxWidgets_LIBRARIES)
-        STRING(REPLACE "-framework;" "-framework "
+      if(RET EQUAL 0)
+        string(STRIP "${wxWidgets_LIBRARIES}" wxWidgets_LIBRARIES)
+        separate_arguments(wxWidgets_LIBRARIES)
+        string(REPLACE "-framework;" "-framework "
           wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}")
-        STRING(REPLACE "-arch;" "-arch "
+        string(REPLACE "-arch;" "-arch "
           wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}")
-        STRING(REPLACE "-isysroot;" "-isysroot "
+        string(REPLACE "-isysroot;" "-isysroot "
           wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}")
 
         # extract linkdirs (-L) for rpath (i.e., LINK_DIRECTORIES)
-        STRING(REGEX MATCHALL "-L[^;]+"
+        string(REGEX MATCHALL "-L[^;]+"
           wxWidgets_LIBRARY_DIRS "${wxWidgets_LIBRARIES}")
-        STRING(REPLACE "-L" ""
+        string(REPLACE "-L" ""
           wxWidgets_LIBRARY_DIRS "${wxWidgets_LIBRARY_DIRS}")
 
         DBG_MSG_V("wxWidgets_LIBRARIES=${wxWidgets_LIBRARIES}")
         DBG_MSG_V("wxWidgets_LIBRARY_DIRS=${wxWidgets_LIBRARY_DIRS}")
 
-      ELSE(RET EQUAL 0)
-        SET(wxWidgets_FOUND FALSE)
+      else(RET EQUAL 0)
+        set(wxWidgets_FOUND FALSE)
         DBG_MSG("${wxWidgets_CONFIG_EXECUTABLE} --libs ${wxWidgets_FIND_COMPONENTS} FAILED with RET=${RET}")
-      ENDIF(RET EQUAL 0)
-    ENDIF(wxWidgets_CONFIG_EXECUTABLE)
+      endif(RET EQUAL 0)
+    endif(wxWidgets_CONFIG_EXECUTABLE)
 
 #=====================================================================
 # Neither UNIX_FIND_STYLE, nor WIN32_FIND_STYLE
 #=====================================================================
-  ELSE(wxWidgets_FIND_STYLE STREQUAL "unix")
-    IF(NOT wxWidgets_FIND_QUIETLY)
-      MESSAGE(STATUS
+  else(wxWidgets_FIND_STYLE STREQUAL "unix")
+    if(NOT wxWidgets_FIND_QUIETLY)
+      message(STATUS
         "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): \n"
         "  Platform unknown/unsupported. It's neither WIN32 nor UNIX "
         "find style."
         )
-    ENDIF(NOT wxWidgets_FIND_QUIETLY)
-  ENDIF(wxWidgets_FIND_STYLE STREQUAL "unix")
-ENDIF(wxWidgets_FIND_STYLE STREQUAL "win32")
+    endif(NOT wxWidgets_FIND_QUIETLY)
+  endif(wxWidgets_FIND_STYLE STREQUAL "unix")
+endif(wxWidgets_FIND_STYLE STREQUAL "win32")
 
 # Debug output:
 DBG_MSG("wxWidgets_FOUND           : ${wxWidgets_FOUND}")
@@ -827,10 +827,10 @@ DBG_MSG("wxWidgets_USE_FILE        : ${wxWidgets_USE_FILE}")
 
 #=====================================================================
 #=====================================================================
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(wxWidgets DEFAULT_MSG wxWidgets_FOUND)
 # Maintain consistency with all other variables.
-SET(wxWidgets_FOUND ${WXWIDGETS_FOUND})
+set(wxWidgets_FOUND ${WXWIDGETS_FOUND})
 
 #=====================================================================
 # Macros for use in wxWidgets apps.
@@ -841,7 +841,7 @@ SET(wxWidgets_FOUND ${WXWIDGETS_FOUND})
 #=====================================================================
 
 # Resource file compiler.
-FIND_PROGRAM(wxWidgets_wxrc_EXECUTABLE wxrc
+find_program(wxWidgets_wxrc_EXECUTABLE wxrc
   ${wxWidgets_ROOT_DIR}/utils/wxrc/vc_msw
   )
 
@@ -852,10 +852,10 @@ FIND_PROGRAM(wxWidgets_wxrc_EXECUTABLE wxrc
 # respectively, of <keyword>.
 #
 # Example usage:
-#  FUNCTION(WXWIDGETS_ADD_RESOURCES outfiles)
+#  function(WXWIDGETS_ADD_RESOURCES outfiles)
 #    WX_SPLIT_ARGUMENTS_ON(OPTIONS wxrc_files wxrc_options ${ARGN})
 #    ...
-#  ENDFUNCTION(WXWIDGETS_ADD_RESOURCES)
+#  endfunction(WXWIDGETS_ADD_RESOURCES)
 #
 #  WXWIDGETS_ADD_RESOURCES(sources ${xrc_files} OPTIONS -e -o file.C)
 #
@@ -866,29 +866,29 @@ FIND_PROGRAM(wxWidgets_wxrc_EXECUTABLE wxrc
 # here a bit more generalized. So, there are already two find modules
 # using this approach.
 #
-FUNCTION(WX_SPLIT_ARGUMENTS_ON _keyword _leftvar _rightvar)
+function(WX_SPLIT_ARGUMENTS_ON _keyword _leftvar _rightvar)
   # FIXME: Document that the input variables will be cleared.
-  #LIST(APPEND ${_leftvar}  "")
-  #LIST(APPEND ${_rightvar} "")
-  SET(${_leftvar}  "")
-  SET(${_rightvar} "")
+  #list(APPEND ${_leftvar}  "")
+  #list(APPEND ${_rightvar} "")
+  set(${_leftvar}  "")
+  set(${_rightvar} "")
 
-  SET(_doing_right FALSE)
-  FOREACH(element ${ARGN})
-    IF("${element}" STREQUAL "${_keyword}")
-      SET(_doing_right TRUE)
-    ELSE("${element}" STREQUAL "${_keyword}")
-      IF(_doing_right)
-        LIST(APPEND ${_rightvar} "${element}")
-      ELSE(_doing_right)
-        LIST(APPEND ${_leftvar} "${element}")
-      ENDIF(_doing_right)
-    ENDIF("${element}" STREQUAL "${_keyword}")
-  ENDFOREACH(element)
+  set(_doing_right FALSE)
+  foreach(element ${ARGN})
+    if("${element}" STREQUAL "${_keyword}")
+      set(_doing_right TRUE)
+    else("${element}" STREQUAL "${_keyword}")
+      if(_doing_right)
+        list(APPEND ${_rightvar} "${element}")
+      else(_doing_right)
+        list(APPEND ${_leftvar} "${element}")
+      endif(_doing_right)
+    endif("${element}" STREQUAL "${_keyword}")
+  endforeach(element)
 
-  SET(${_leftvar}  ${${_leftvar}}  PARENT_SCOPE)
-  SET(${_rightvar} ${${_rightvar}} PARENT_SCOPE)
-ENDFUNCTION(WX_SPLIT_ARGUMENTS_ON)
+  set(${_leftvar}  ${${_leftvar}}  PARENT_SCOPE)
+  set(${_rightvar} ${${_rightvar}} PARENT_SCOPE)
+endfunction(WX_SPLIT_ARGUMENTS_ON)
 
 #
 # WX_GET_DEPENDENCIES_FROM_XML(
@@ -901,7 +901,7 @@ ENDFUNCTION(WX_SPLIT_ARGUMENTS_ON)
 #
 # FIXME: Add documentation here...
 #
-FUNCTION(WX_GET_DEPENDENCIES_FROM_XML
+function(WX_GET_DEPENDENCIES_FROM_XML
     _depends
     _match_patt
     _clean_patt
@@ -909,25 +909,25 @@ FUNCTION(WX_GET_DEPENDENCIES_FROM_XML
     _depends_path
     )
 
-  STRING(REGEX MATCHALL
+  string(REGEX MATCHALL
     ${_match_patt}
     dep_file_list
     "${${_xml_contents}}"
     )
-  FOREACH(dep_file ${dep_file_list})
-    STRING(REGEX REPLACE ${_clean_patt} "" dep_file "${dep_file}")
+  foreach(dep_file ${dep_file_list})
+    string(REGEX REPLACE ${_clean_patt} "" dep_file "${dep_file}")
 
     # make the file have an absolute path
-    IF(NOT IS_ABSOLUTE "${dep_file}")
-      SET(dep_file "${${_depends_path}}/${dep_file}")
-    ENDIF(NOT IS_ABSOLUTE "${dep_file}")
+    if(NOT IS_ABSOLUTE "${dep_file}")
+      set(dep_file "${${_depends_path}}/${dep_file}")
+    endif(NOT IS_ABSOLUTE "${dep_file}")
 
     # append file to dependency list
-    LIST(APPEND ${_depends} "${dep_file}")
-  ENDFOREACH(dep_file)
+    list(APPEND ${_depends} "${dep_file}")
+  endforeach(dep_file)
 
-  SET(${_depends} ${${_depends}} PARENT_SCOPE)
-ENDFUNCTION(WX_GET_DEPENDENCIES_FROM_XML)
+  set(${_depends} ${${_depends}} PARENT_SCOPE)
+endfunction(WX_GET_DEPENDENCIES_FROM_XML)
 
 #
 # WXWIDGETS_ADD_RESOURCES(<sources> <xrc_files>
@@ -940,21 +940,21 @@ ENDFUNCTION(WX_GET_DEPENDENCIES_FROM_XML)
 #   WXWIDGETS_ADD_RESOURCES(sources xrc/main_frame.xrc)
 #   WXWIDGETS_ADD_RESOURCES(sources ${xrc_files} OPTIONS -e -o altname.cxx)
 #
-FUNCTION(WXWIDGETS_ADD_RESOURCES _outfiles)
+function(WXWIDGETS_ADD_RESOURCES _outfiles)
   WX_SPLIT_ARGUMENTS_ON(OPTIONS rc_file_list rc_options ${ARGN})
 
   # Parse files for dependencies.
-  SET(rc_file_list_abs "")
-  SET(rc_depends       "")
-  FOREACH(rc_file ${rc_file_list})
-    GET_FILENAME_COMPONENT(depends_path ${rc_file} PATH)
+  set(rc_file_list_abs "")
+  set(rc_depends       "")
+  foreach(rc_file ${rc_file_list})
+    get_filename_component(depends_path ${rc_file} PATH)
 
-    GET_FILENAME_COMPONENT(rc_file_abs ${rc_file} ABSOLUTE)
-    LIST(APPEND rc_file_list_abs "${rc_file_abs}")
+    get_filename_component(rc_file_abs ${rc_file} ABSOLUTE)
+    list(APPEND rc_file_list_abs "${rc_file_abs}")
 
     # All files have absolute paths or paths relative to the location
     # of the rc file.
-    FILE(READ "${rc_file_abs}" rc_file_contents)
+    file(READ "${rc_file_abs}" rc_file_contents)
 
     # get bitmap/bitmap2 files
     WX_GET_DEPENDENCIES_FROM_XML(
@@ -982,63 +982,63 @@ FUNCTION(WXWIDGETS_ADD_RESOURCES _outfiles)
       rc_file_contents
       depends_path
       )
-  ENDFOREACH(rc_file)
+  endforeach(rc_file)
 
   #
   # Parse options.
   #
   # If NO_CPP_CODE option specified, then produce .xrs file rather
   # than a .cpp file (i.e., don't add the default --cpp-code option).
-  LIST(FIND rc_options NO_CPP_CODE index)
-  IF(index EQUAL -1)
-    LIST(APPEND rc_options --cpp-code)
+  list(FIND rc_options NO_CPP_CODE index)
+  if(index EQUAL -1)
+    list(APPEND rc_options --cpp-code)
     # wxrc's default output filename for cpp code.
-    SET(outfile resource.cpp)
-  ELSE(index EQUAL -1)
-    LIST(REMOVE_AT rc_options ${index})
+    set(outfile resource.cpp)
+  else(index EQUAL -1)
+    list(REMOVE_AT rc_options ${index})
     # wxrc's default output filename for xrs file.
-    SET(outfile resource.xrs)
-  ENDIF(index EQUAL -1)
+    set(outfile resource.xrs)
+  endif(index EQUAL -1)
 
   # Get output name for use in ADD_CUSTOM_COMMAND.
   # - short option scanning
-  LIST(FIND rc_options -o index)
-  IF(NOT index EQUAL -1)
-    MATH(EXPR filename_index "${index} + 1")
-    LIST(GET rc_options ${filename_index} outfile)
-    #LIST(REMOVE_AT rc_options ${index} ${filename_index})
-  ENDIF(NOT index EQUAL -1)
+  list(FIND rc_options -o index)
+  if(NOT index EQUAL -1)
+    math(EXPR filename_index "${index} + 1")
+    list(GET rc_options ${filename_index} outfile)
+    #list(REMOVE_AT rc_options ${index} ${filename_index})
+  endif(NOT index EQUAL -1)
   # - long option scanning
-  STRING(REGEX MATCH "--output=[^;]*" outfile_opt "${rc_options}")
-  IF(outfile_opt)
-    STRING(REPLACE "--output=" "" outfile "${outfile_opt}")
-  ENDIF(outfile_opt)
-  #STRING(REGEX REPLACE "--output=[^;]*;?" "" rc_options "${rc_options}")
-  #STRING(REGEX REPLACE ";$" "" rc_options "${rc_options}")
+  string(REGEX MATCH "--output=[^;]*" outfile_opt "${rc_options}")
+  if(outfile_opt)
+    string(REPLACE "--output=" "" outfile "${outfile_opt}")
+  endif(outfile_opt)
+  #string(REGEX REPLACE "--output=[^;]*;?" "" rc_options "${rc_options}")
+  #string(REGEX REPLACE ";$" "" rc_options "${rc_options}")
 
-  IF(NOT IS_ABSOLUTE "${outfile}")
-    SET(outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}")
-  ENDIF(NOT IS_ABSOLUTE "${outfile}")
-  ADD_CUSTOM_COMMAND(
+  if(NOT IS_ABSOLUTE "${outfile}")
+    set(outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}")
+  endif(NOT IS_ABSOLUTE "${outfile}")
+  add_custom_command(
     OUTPUT "${outfile}"
     COMMAND ${wxWidgets_wxrc_EXECUTABLE} ${rc_options} ${rc_file_list_abs}
     DEPENDS ${rc_file_list_abs} ${rc_depends}
     )
 
   # Add generated header to output file list.
-  LIST(FIND rc_options -e short_index)
-  LIST(FIND rc_options --extra-cpp-code long_index)
-  IF(NOT short_index EQUAL -1 OR NOT long_index EQUAL -1)
-    GET_FILENAME_COMPONENT(outfile_ext ${outfile} EXT)
-    STRING(REPLACE "${outfile_ext}" ".h" outfile_header "${outfile}")
-    LIST(APPEND ${_outfiles} "${outfile_header}")
-    SET_SOURCE_FILES_PROPERTIES(
+  list(FIND rc_options -e short_index)
+  list(FIND rc_options --extra-cpp-code long_index)
+  if(NOT short_index EQUAL -1 OR NOT long_index EQUAL -1)
+    get_filename_component(outfile_ext ${outfile} EXT)
+    string(REPLACE "${outfile_ext}" ".h" outfile_header "${outfile}")
+    list(APPEND ${_outfiles} "${outfile_header}")
+    set_source_files_properties(
       "${outfile_header}" PROPERTIES GENERATED TRUE
       )
-  ENDIF(NOT short_index EQUAL -1 OR NOT long_index EQUAL -1)
+  endif(NOT short_index EQUAL -1 OR NOT long_index EQUAL -1)
 
   # Add generated file to output file list.
-  LIST(APPEND ${_outfiles} "${outfile}")
+  list(APPEND ${_outfiles} "${outfile}")
 
-  SET(${_outfiles} ${${_outfiles}} PARENT_SCOPE)
-ENDFUNCTION(WXWIDGETS_ADD_RESOURCES)
+  set(${_outfiles} ${${_outfiles}} PARENT_SCOPE)
+endfunction(WXWIDGETS_ADD_RESOURCES)
diff --git a/Modules/FindwxWindows.cmake b/Modules/FindwxWindows.cmake
index dfb28ff90..66373cdcc 100644
--- a/Modules/FindwxWindows.cmake
+++ b/Modules/FindwxWindows.cmake
@@ -20,17 +20,17 @@
 #
 # OPTIONS
 # If you need OpenGL support please
-#  SET(WXWINDOWS_USE_GL 1)
+#  set(WXWINDOWS_USE_GL 1)
 # in your CMakeLists.txt *before* you include this file.
 #
 #  HAVE_ISYSTEM      - true required to replace -I by -isystem on g++
 #
 # For convenience include Use_wxWindows.cmake in your project's
-# CMakeLists.txt using INCLUDE(Use_wxWindows).
+# CMakeLists.txt using include(Use_wxWindows).
 #
 # USAGE
-#  SET(WXWINDOWS_USE_GL 1)
-#  FIND_PACKAGE(wxWindows)
+#  set(WXWINDOWS_USE_GL 1)
+#  find_package(wxWindows)
 #
 # NOTES
 # wxWidgets 2.6.x is supported for monolithic builds
@@ -83,19 +83,19 @@
 #
 
 
-IF(WIN32)
-  SET(WIN32_STYLE_FIND 1)
-ENDIF(WIN32)
-IF(MINGW)
-  SET(WIN32_STYLE_FIND 0)
-  SET(UNIX_STYLE_FIND 1)
-ENDIF(MINGW)
-IF(UNIX)
-  SET(UNIX_STYLE_FIND 1)
-ENDIF(UNIX)
+if(WIN32)
+  set(WIN32_STYLE_FIND 1)
+endif(WIN32)
+if(MINGW)
+  set(WIN32_STYLE_FIND 0)
+  set(UNIX_STYLE_FIND 1)
+endif(MINGW)
+if(UNIX)
+  set(UNIX_STYLE_FIND 1)
+endif(UNIX)
 
 
-IF(WIN32_STYLE_FIND)
+if(WIN32_STYLE_FIND)
 
   ## ######################################################################
   ##
@@ -106,7 +106,7 @@ IF(WIN32_STYLE_FIND)
   ## fix the root dir to avoid mixing of headers/libs from different
   ## versions/builds:
 
-  SET (WXWINDOWS_POSSIBLE_ROOT_PATHS
+  set (WXWINDOWS_POSSIBLE_ROOT_PATHS
     $ENV{WXWIN}
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWidgets_is1;Inno Setup: App Path]"  ## WX 2.6.x
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWindows_is1;Inno Setup: App Path]"  ## WX 2.4.x
@@ -121,54 +121,54 @@ IF(WIN32_STYLE_FIND)
   ## WX supports monolithic and multiple smaller libs (since 2.5.x), we prefer monolithic for now.
   ## monolithic = WX is built as a single big library
   ## e.g. compile on WIN32 as  "nmake -f makefile.vc MONOLITHIC=1 BUILD=debug SHARED=0 USE_OPENGL=1" (JW)
-  OPTION(WXWINDOWS_USE_MONOLITHIC "Use monolithic build of WX??" ON)
-  MARK_AS_ADVANCED(WXWINDOWS_USE_MONOLITHIC)
+  option(WXWINDOWS_USE_MONOLITHIC "Use monolithic build of WX??" ON)
+  mark_as_advanced(WXWINDOWS_USE_MONOLITHIC)
 
   ## GL libs used?
-  OPTION(WXWINDOWS_USE_GL "Use Wx with GL support(glcanvas)?" ON)
-  MARK_AS_ADVANCED(WXWINDOWS_USE_GL)
+  option(WXWINDOWS_USE_GL "Use Wx with GL support(glcanvas)?" ON)
+  mark_as_advanced(WXWINDOWS_USE_GL)
 
 
   ## avoid mixing of headers and libs between multiple installed WX versions,
   ## select just one tree here:
-  FIND_PATH(WXWINDOWS_ROOT_DIR  include/wx/wx.h
+  find_path(WXWINDOWS_ROOT_DIR  include/wx/wx.h
     ${WXWINDOWS_POSSIBLE_ROOT_PATHS} )
-  # MESSAGE("DBG found WXWINDOWS_ROOT_DIR: ${WXWINDOWS_ROOT_DIR}")
+  # message("DBG found WXWINDOWS_ROOT_DIR: ${WXWINDOWS_ROOT_DIR}")
 
 
   ## find libs for combination of static/shared with release/debug
   ## be careful if you add something here,
   ## avoid mixing of headers and libs of different wx versions,
   ## there may be multiple WX versions installed.
-  SET (WXWINDOWS_POSSIBLE_LIB_PATHS
+  set (WXWINDOWS_POSSIBLE_LIB_PATHS
     "${WXWINDOWS_ROOT_DIR}/lib"
     )
 
   ## monolithic?
-  IF (WXWINDOWS_USE_MONOLITHIC)
+  if (WXWINDOWS_USE_MONOLITHIC)
 
-    FIND_LIBRARY(WXWINDOWS_STATIC_LIBRARY
+    find_library(WXWINDOWS_STATIC_LIBRARY
       NAMES wx wxmsw wxmsw26
       PATHS
       "${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
       ${WXWINDOWS_POSSIBLE_LIB_PATHS}
       DOC "wxWindows static release build library" )
 
-    FIND_LIBRARY(WXWINDOWS_STATIC_DEBUG_LIBRARY
+    find_library(WXWINDOWS_STATIC_DEBUG_LIBRARY
       NAMES wxd wxmswd wxmsw26d
       PATHS
       "${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
       ${WXWINDOWS_POSSIBLE_LIB_PATHS}
       DOC "wxWindows static debug build library" )
 
-    FIND_LIBRARY(WXWINDOWS_SHARED_LIBRARY
+    find_library(WXWINDOWS_SHARED_LIBRARY
       NAMES wxmsw26 wxmsw262 wxmsw24 wxmsw242 wxmsw241 wxmsw240 wx23_2 wx22_9
       PATHS
       "${WXWINDOWS_ROOT_DIR}/lib/vc_dll"
       ${WXWINDOWS_POSSIBLE_LIB_PATHS}
       DOC "wxWindows shared release build library" )
 
-    FIND_LIBRARY(WXWINDOWS_SHARED_DEBUG_LIBRARY
+    find_library(WXWINDOWS_SHARED_DEBUG_LIBRARY
       NAMES wxmsw26d wxmsw262d wxmsw24d wxmsw241d wxmsw240d wx23_2d wx22_9d
       PATHS
       "${WXWINDOWS_ROOT_DIR}/lib/vc_dll"
@@ -180,14 +180,14 @@ IF(WIN32_STYLE_FIND)
     ## required for WXWINDOWS_USE_GL
     ## gl lib is always build separate:
     ##
-    FIND_LIBRARY(WXWINDOWS_STATIC_LIBRARY_GL
+    find_library(WXWINDOWS_STATIC_LIBRARY_GL
       NAMES wx_gl wxmsw_gl wxmsw26_gl
       PATHS
       "${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
       ${WXWINDOWS_POSSIBLE_LIB_PATHS}
       DOC "wxWindows static release build GL library" )
 
-    FIND_LIBRARY(WXWINDOWS_STATIC_DEBUG_LIBRARY_GL
+    find_library(WXWINDOWS_STATIC_DEBUG_LIBRARY_GL
       NAMES wxd_gl wxmswd_gl wxmsw26d_gl
       PATHS
       "${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
@@ -195,70 +195,70 @@ IF(WIN32_STYLE_FIND)
       DOC "wxWindows static debug build GL library" )
 
 
-    FIND_LIBRARY(WXWINDOWS_STATIC_DEBUG_LIBRARY_PNG
+    find_library(WXWINDOWS_STATIC_DEBUG_LIBRARY_PNG
       NAMES wxpngd
       PATHS
       "${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
       ${WXWINDOWS_POSSIBLE_LIB_PATHS}
       DOC "wxWindows static debug png library" )
 
-    FIND_LIBRARY(WXWINDOWS_STATIC_LIBRARY_PNG
+    find_library(WXWINDOWS_STATIC_LIBRARY_PNG
       NAMES wxpng
       PATHS
       "${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
       ${WXWINDOWS_POSSIBLE_LIB_PATHS}
       DOC "wxWindows static png library" )
 
-    FIND_LIBRARY(WXWINDOWS_STATIC_DEBUG_LIBRARY_TIFF
+    find_library(WXWINDOWS_STATIC_DEBUG_LIBRARY_TIFF
       NAMES wxtiffd
       PATHS
       "${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
       ${WXWINDOWS_POSSIBLE_LIB_PATHS}
       DOC "wxWindows static debug tiff library" )
 
-    FIND_LIBRARY(WXWINDOWS_STATIC_LIBRARY_TIFF
+    find_library(WXWINDOWS_STATIC_LIBRARY_TIFF
       NAMES wxtiff
       PATHS
       "${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
       ${WXWINDOWS_POSSIBLE_LIB_PATHS}
       DOC "wxWindows static tiff library" )
 
-    FIND_LIBRARY(WXWINDOWS_STATIC_DEBUG_LIBRARY_JPEG
+    find_library(WXWINDOWS_STATIC_DEBUG_LIBRARY_JPEG
       NAMES wxjpegd  wxjpgd
       PATHS
       "${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
       ${WXWINDOWS_POSSIBLE_LIB_PATHS}
       DOC "wxWindows static debug jpeg library" )
 
-    FIND_LIBRARY(WXWINDOWS_STATIC_LIBRARY_JPEG
+    find_library(WXWINDOWS_STATIC_LIBRARY_JPEG
       NAMES wxjpeg wxjpg
       PATHS
       "${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
       ${WXWINDOWS_POSSIBLE_LIB_PATHS}
       DOC "wxWindows static jpeg library" )
 
-    FIND_LIBRARY(WXWINDOWS_STATIC_DEBUG_LIBRARY_ZLIB
+    find_library(WXWINDOWS_STATIC_DEBUG_LIBRARY_ZLIB
       NAMES wxzlibd
       PATHS
       "${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
       ${WXWINDOWS_POSSIBLE_LIB_PATHS}
       DOC "wxWindows static debug zlib library" )
 
-    FIND_LIBRARY(WXWINDOWS_STATIC_LIBRARY_ZLIB
+    find_library(WXWINDOWS_STATIC_LIBRARY_ZLIB
       NAMES wxzlib
       PATHS
       "${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
       ${WXWINDOWS_POSSIBLE_LIB_PATHS}
       DOC "wxWindows static zib library" )
 
-    FIND_LIBRARY(WXWINDOWS_STATIC_DEBUG_LIBRARY_REGEX
+    find_library(WXWINDOWS_STATIC_DEBUG_LIBRARY_REGEX
       NAMES wxregexd
       PATHS
       "${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
       ${WXWINDOWS_POSSIBLE_LIB_PATHS}
       DOC "wxWindows static debug regex library" )
 
-    FIND_LIBRARY(WXWINDOWS_STATIC_LIBRARY_REGEX
+    find_library(WXWINDOWS_STATIC_LIBRARY_REGEX
       NAMES wxregex
       PATHS
       "${WXWINDOWS_ROOT_DIR}/lib/vc_lib"
@@ -268,14 +268,14 @@ IF(WIN32_STYLE_FIND)
 
 
     ## untested:
-    FIND_LIBRARY(WXWINDOWS_SHARED_LIBRARY_GL
+    find_library(WXWINDOWS_SHARED_LIBRARY_GL
       NAMES wx_gl wxmsw_gl wxmsw26_gl
       PATHS
       "${WXWINDOWS_ROOT_DIR}/lib/vc_dll"
       ${WXWINDOWS_POSSIBLE_LIB_PATHS}
       DOC "wxWindows shared release build GL library" )
 
-    FIND_LIBRARY(WXWINDOWS_SHARED_DEBUG_LIBRARY_GL
+    find_library(WXWINDOWS_SHARED_DEBUG_LIBRARY_GL
       NAMES wxd_gl wxmswd_gl wxmsw26d_gl
       PATHS
       "${WXWINDOWS_ROOT_DIR}/lib/vc_dll"
@@ -283,11 +283,11 @@ IF(WIN32_STYLE_FIND)
       DOC "wxWindows shared debug build GL library" )
 
 
-  ELSE (WXWINDOWS_USE_MONOLITHIC)
+  else (WXWINDOWS_USE_MONOLITHIC)
     ## WX is built as multiple small pieces libraries instead of monolithic
 
     ## DEPECATED (jw) replaced by more general WXWINDOWS_USE_MONOLITHIC ON/OFF
-    # OPTION(WXWINDOWS_SEPARATE_LIBS_BUILD "Is wxWindows build with separate libs?" OFF)
+    # option(WXWINDOWS_SEPARATE_LIBS_BUILD "Is wxWindows build with separate libs?" OFF)
 
     ## HACK: This is very dirty.
     ## because the libs of a particular version are explicitly listed
@@ -297,9 +297,9 @@ IF(WIN32_STYLE_FIND)
     ## -->  about 288 combinations
     ## thus we need a different approach so solve this correctly ...
 
-    MESSAGE(STATUS "Warning: You are trying to use wxWidgets without monolithic build (WXWINDOWS_SEPARATE_LIBS_BUILD). This is a HACK, libraries are not verified! (JW).")
+    message(STATUS "Warning: You are trying to use wxWidgets without monolithic build (WXWINDOWS_SEPARATE_LIBS_BUILD). This is a HACK, libraries are not verified! (JW).")
 
-    SET(WXWINDOWS_STATIC_LIBS ${WXWINDOWS_STATIC_LIBS}
+    set(WXWINDOWS_STATIC_LIBS ${WXWINDOWS_STATIC_LIBS}
       wxbase26
       wxbase26_net
       wxbase26_odbc
@@ -323,7 +323,7 @@ IF(WIN32_STYLE_FIND)
       wsock32
       )
     ## HACK: feed in to optimized / debug libaries if both were FOUND.
-    SET(WXWINDOWS_STATIC_DEBUG_LIBS ${WXWINDOWS_STATIC_DEBUG_LIBS}
+    set(WXWINDOWS_STATIC_DEBUG_LIBS ${WXWINDOWS_STATIC_DEBUG_LIBS}
       wxbase26d
       wxbase26d_net
       wxbase26d_odbc
@@ -346,7 +346,7 @@ IF(WIN32_STYLE_FIND)
       rpcrt4
       wsock32
       )
-  ENDIF (WXWINDOWS_USE_MONOLITHIC)
+  endif (WXWINDOWS_USE_MONOLITHIC)
 
 
   ##
@@ -356,22 +356,22 @@ IF(WIN32_STYLE_FIND)
 
   ## if there is at least one shared lib available
   ## let user choose wether to use shared or static wxwindows libs
-  IF(WXWINDOWS_SHARED_LIBRARY OR WXWINDOWS_SHARED_DEBUG_LIBRARY)
+  if(WXWINDOWS_SHARED_LIBRARY OR WXWINDOWS_SHARED_DEBUG_LIBRARY)
     ## default value OFF because wxWindows MSVS default build is static
-    OPTION(WXWINDOWS_USE_SHARED_LIBS
+    option(WXWINDOWS_USE_SHARED_LIBS
       "Use shared versions (dll) of wxWindows libraries?" OFF)
-    MARK_AS_ADVANCED(WXWINDOWS_USE_SHARED_LIBS)
-  ENDIF(WXWINDOWS_SHARED_LIBRARY OR WXWINDOWS_SHARED_DEBUG_LIBRARY)
+    mark_as_advanced(WXWINDOWS_USE_SHARED_LIBS)
+  endif(WXWINDOWS_SHARED_LIBRARY OR WXWINDOWS_SHARED_DEBUG_LIBRARY)
 
   ## add system libraries wxwindows always seems to depend on
-  SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+  set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
     comctl32
     rpcrt4
     wsock32
     )
 
-  IF (NOT WXWINDOWS_USE_SHARED_LIBS)
-    SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+  if (NOT WXWINDOWS_USE_SHARED_LIBS)
+    set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
       ##  these ones dont seem required, in particular  ctl3d32 is not neccesary (Jan Woetzel 07/2003)
       #   ctl3d32
       debug ${WXWINDOWS_STATIC_DEBUG_LIBRARY_ZLIB}   optimized ${WXWINDOWS_STATIC_LIBRARY_ZLIB}
@@ -380,15 +380,15 @@ IF(WIN32_STYLE_FIND)
       debug ${WXWINDOWS_STATIC_DEBUG_LIBRARY_JPEG}   optimized ${WXWINDOWS_STATIC_LIBRARY_JPEG}
       debug ${WXWINDOWS_STATIC_DEBUG_LIBRARY_TIFF}   optimized ${WXWINDOWS_STATIC_LIBRARY_TIFF}
       )
-  ENDIF (NOT WXWINDOWS_USE_SHARED_LIBS)
+  endif (NOT WXWINDOWS_USE_SHARED_LIBS)
 
   ## opengl/glu: TODO/FIXME: better use FindOpenGL.cmake here
   ## assume release versions of glu an dopengl, here.
-  IF (WXWINDOWS_USE_GL)
-    SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+  if (WXWINDOWS_USE_GL)
+    set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
       opengl32
       glu32 )
-  ENDIF (WXWINDOWS_USE_GL)
+  endif (WXWINDOWS_USE_GL)
 
   ##
   ## select between use of  shared or static wxWindows lib then set libs to use
@@ -399,162 +399,162 @@ IF(WIN32_STYLE_FIND)
   ## then add the build specific include dir for wx/setup.h
   ##
 
-  IF(WXWINDOWS_USE_SHARED_LIBS)
-    ##MESSAGE("DBG wxWindows use shared lib selected.")
+  if(WXWINDOWS_USE_SHARED_LIBS)
+    ##message("DBG wxWindows use shared lib selected.")
     ## assume that both builds use the same setup(.h) for simplicity
 
     ## shared: both wx (debug and release) found?
     ## assume that both builds use the same setup(.h) for simplicity
-    IF(WXWINDOWS_SHARED_DEBUG_LIBRARY AND WXWINDOWS_SHARED_LIBRARY)
-      ##MESSAGE("DBG wx shared: debug and optimized found.")
-      FIND_PATH(WXWINDOWS_INCLUDE_DIR_SETUPH  wx/setup.h
+    if(WXWINDOWS_SHARED_DEBUG_LIBRARY AND WXWINDOWS_SHARED_LIBRARY)
+      ##message("DBG wx shared: debug and optimized found.")
+      find_path(WXWINDOWS_INCLUDE_DIR_SETUPH  wx/setup.h
         ${WXWINDOWS_ROOT_DIR}/lib/mswdlld
         ${WXWINDOWS_ROOT_DIR}/lib/mswdll
         ${WXWINDOWS_ROOT_DIR}/lib/vc_dll/mswd
         ${WXWINDOWS_ROOT_DIR}/lib/vc_dll/msw )
-      SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+      set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
         debug     ${WXWINDOWS_SHARED_DEBUG_LIBRARY}
         optimized ${WXWINDOWS_SHARED_LIBRARY} )
-      IF (WXWINDOWS_USE_GL)
-        SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+      if (WXWINDOWS_USE_GL)
+        set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
           debug     ${WXWINDOWS_SHARED_DEBUG_LIBRARY_GL}
           optimized ${WXWINDOWS_SHARED_LIBRARY_GL} )
-      ENDIF (WXWINDOWS_USE_GL)
-    ENDIF(WXWINDOWS_SHARED_DEBUG_LIBRARY AND WXWINDOWS_SHARED_LIBRARY)
+      endif (WXWINDOWS_USE_GL)
+    endif(WXWINDOWS_SHARED_DEBUG_LIBRARY AND WXWINDOWS_SHARED_LIBRARY)
 
     ## shared: only debug wx lib found?
-    IF(WXWINDOWS_SHARED_DEBUG_LIBRARY)
-      IF(NOT WXWINDOWS_SHARED_LIBRARY)
-        ##MESSAGE("DBG wx shared: debug (but no optimized) found.")
-        FIND_PATH(WXWINDOWS_INCLUDE_DIR_SETUPH  wx/setup.h
+    if(WXWINDOWS_SHARED_DEBUG_LIBRARY)
+      if(NOT WXWINDOWS_SHARED_LIBRARY)
+        ##message("DBG wx shared: debug (but no optimized) found.")
+        find_path(WXWINDOWS_INCLUDE_DIR_SETUPH  wx/setup.h
           ${WXWINDOWS_ROOT_DIR}/lib/mswdlld
           ${WXWINDOWS_ROOT_DIR}/lib/vc_dll/mswd  )
-        SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+        set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
           ${WXWINDOWS_SHARED_DEBUG_LIBRARY} )
-        IF (WXWINDOWS_USE_GL)
-          SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+        if (WXWINDOWS_USE_GL)
+          set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
             ${WXWINDOWS_SHARED_DEBUG_LIBRARY_GL} )
-        ENDIF (WXWINDOWS_USE_GL)
-      ENDIF(NOT WXWINDOWS_SHARED_LIBRARY)
-    ENDIF(WXWINDOWS_SHARED_DEBUG_LIBRARY)
+        endif (WXWINDOWS_USE_GL)
+      endif(NOT WXWINDOWS_SHARED_LIBRARY)
+    endif(WXWINDOWS_SHARED_DEBUG_LIBRARY)
 
     ## shared: only release wx lib found?
-    IF(NOT WXWINDOWS_SHARED_DEBUG_LIBRARY)
-      IF(WXWINDOWS_SHARED_LIBRARY)
-        ##MESSAGE("DBG wx shared: optimized (but no debug) found.")
-        FIND_PATH(WXWINDOWS_INCLUDE_DIR_SETUPH  wx/setup.h
+    if(NOT WXWINDOWS_SHARED_DEBUG_LIBRARY)
+      if(WXWINDOWS_SHARED_LIBRARY)
+        ##message("DBG wx shared: optimized (but no debug) found.")
+        find_path(WXWINDOWS_INCLUDE_DIR_SETUPH  wx/setup.h
           ${WXWINDOWS_ROOT_DIR}/lib/mswdll
           ${WXWINDOWS_ROOT_DIR}/lib/vc_dll/msw  )
-        SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+        set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
           ${WXWINDOWS_SHARED_DEBUG_LIBRARY} )
-        IF (WXWINDOWS_USE_GL)
-          SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+        if (WXWINDOWS_USE_GL)
+          set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
             ${WXWINDOWS_SHARED_DEBUG_LIBRARY_GL} )
-        ENDIF (WXWINDOWS_USE_GL)
-      ENDIF(WXWINDOWS_SHARED_LIBRARY)
-    ENDIF(NOT WXWINDOWS_SHARED_DEBUG_LIBRARY)
+        endif (WXWINDOWS_USE_GL)
+      endif(WXWINDOWS_SHARED_LIBRARY)
+    endif(NOT WXWINDOWS_SHARED_DEBUG_LIBRARY)
 
     ## shared: none found?
-    IF(NOT WXWINDOWS_SHARED_DEBUG_LIBRARY)
-      IF(NOT WXWINDOWS_SHARED_LIBRARY)
-        MESSAGE(STATUS
+    if(NOT WXWINDOWS_SHARED_DEBUG_LIBRARY)
+      if(NOT WXWINDOWS_SHARED_LIBRARY)
+        message(STATUS
           "No shared wxWindows lib found, but WXWINDOWS_USE_SHARED_LIBS=${WXWINDOWS_USE_SHARED_LIBS}.")
-      ENDIF(NOT WXWINDOWS_SHARED_LIBRARY)
-    ENDIF(NOT WXWINDOWS_SHARED_DEBUG_LIBRARY)
+      endif(NOT WXWINDOWS_SHARED_LIBRARY)
+    endif(NOT WXWINDOWS_SHARED_DEBUG_LIBRARY)
 
     #########################################################################################
-  ELSE(WXWINDOWS_USE_SHARED_LIBS)
+  else(WXWINDOWS_USE_SHARED_LIBS)
 
-    ##jw: DEPRECATED IF(NOT WXWINDOWS_SEPARATE_LIBS_BUILD)
+    ##jw: DEPRECATED if(NOT WXWINDOWS_SEPARATE_LIBS_BUILD)
 
     ## static: both wx (debug and release) found?
     ## assume that both builds use the same setup(.h) for simplicity
-    IF(WXWINDOWS_STATIC_DEBUG_LIBRARY AND WXWINDOWS_STATIC_LIBRARY)
-      ##MESSAGE("DBG wx static: debug and optimized found.")
-      FIND_PATH(WXWINDOWS_INCLUDE_DIR_SETUPH  wx/setup.h
+    if(WXWINDOWS_STATIC_DEBUG_LIBRARY AND WXWINDOWS_STATIC_LIBRARY)
+      ##message("DBG wx static: debug and optimized found.")
+      find_path(WXWINDOWS_INCLUDE_DIR_SETUPH  wx/setup.h
         ${WXWINDOWS_ROOT_DIR}/lib/mswd
         ${WXWINDOWS_ROOT_DIR}/lib/msw
         ${WXWINDOWS_ROOT_DIR}/lib/vc_lib/mswd
         ${WXWINDOWS_ROOT_DIR}/lib/vc_lib/msw )
-      SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+      set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
         debug     ${WXWINDOWS_STATIC_DEBUG_LIBRARY}
         optimized ${WXWINDOWS_STATIC_LIBRARY} )
-      IF (WXWINDOWS_USE_GL)
-        SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+      if (WXWINDOWS_USE_GL)
+        set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
           debug     ${WXWINDOWS_STATIC_DEBUG_LIBRARY_GL}
           optimized ${WXWINDOWS_STATIC_LIBRARY_GL} )
-      ENDIF (WXWINDOWS_USE_GL)
-    ENDIF(WXWINDOWS_STATIC_DEBUG_LIBRARY AND WXWINDOWS_STATIC_LIBRARY)
+      endif (WXWINDOWS_USE_GL)
+    endif(WXWINDOWS_STATIC_DEBUG_LIBRARY AND WXWINDOWS_STATIC_LIBRARY)
 
     ## static: only debug wx lib found?
-    IF(WXWINDOWS_STATIC_DEBUG_LIBRARY)
-      IF(NOT WXWINDOWS_STATIC_LIBRARY)
-        ##MESSAGE("DBG wx static: debug (but no optimized) found.")
-        FIND_PATH(WXWINDOWS_INCLUDE_DIR_SETUPH  wx/setup.h
+    if(WXWINDOWS_STATIC_DEBUG_LIBRARY)
+      if(NOT WXWINDOWS_STATIC_LIBRARY)
+        ##message("DBG wx static: debug (but no optimized) found.")
+        find_path(WXWINDOWS_INCLUDE_DIR_SETUPH  wx/setup.h
           ${WXWINDOWS_ROOT_DIR}/lib/mswd
           ${WXWINDOWS_ROOT_DIR}/lib/vc_lib/mswd  )
-        SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+        set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
           ${WXWINDOWS_STATIC_DEBUG_LIBRARY} )
-        IF (WXWINDOWS_USE_GL)
-          SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+        if (WXWINDOWS_USE_GL)
+          set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
             ${WXWINDOWS_STATIC_DEBUG_LIBRARY_GL} )
-        ENDIF (WXWINDOWS_USE_GL)
-      ENDIF(NOT WXWINDOWS_STATIC_LIBRARY)
-    ENDIF(WXWINDOWS_STATIC_DEBUG_LIBRARY)
+        endif (WXWINDOWS_USE_GL)
+      endif(NOT WXWINDOWS_STATIC_LIBRARY)
+    endif(WXWINDOWS_STATIC_DEBUG_LIBRARY)
 
     ## static: only release wx lib found?
-    IF(NOT WXWINDOWS_STATIC_DEBUG_LIBRARY)
-      IF(WXWINDOWS_STATIC_LIBRARY)
-        ##MESSAGE("DBG wx static: optimized (but no debug) found.")
-        FIND_PATH(WXWINDOWS_INCLUDE_DIR_SETUPH  wx/setup.h
+    if(NOT WXWINDOWS_STATIC_DEBUG_LIBRARY)
+      if(WXWINDOWS_STATIC_LIBRARY)
+        ##message("DBG wx static: optimized (but no debug) found.")
+        find_path(WXWINDOWS_INCLUDE_DIR_SETUPH  wx/setup.h
           ${WXWINDOWS_ROOT_DIR}/lib/msw
           ${WXWINDOWS_ROOT_DIR}/lib/vc_lib/msw )
-        SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+        set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
           ${WXWINDOWS_STATIC_LIBRARY} )
-        IF (WXWINDOWS_USE_GL)
-          SET(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
+        if (WXWINDOWS_USE_GL)
+          set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
             ${WXWINDOWS_STATIC_LIBRARY_GL} )
-        ENDIF (WXWINDOWS_USE_GL)
-      ENDIF(WXWINDOWS_STATIC_LIBRARY)
-    ENDIF(NOT WXWINDOWS_STATIC_DEBUG_LIBRARY)
+        endif (WXWINDOWS_USE_GL)
+      endif(WXWINDOWS_STATIC_LIBRARY)
+    endif(NOT WXWINDOWS_STATIC_DEBUG_LIBRARY)
 
     ## static: none found?
-    IF(NOT WXWINDOWS_STATIC_DEBUG_LIBRARY AND NOT WXWINDOWS_SEPARATE_LIBS_BUILD)
-      IF(NOT WXWINDOWS_STATIC_LIBRARY)
-        MESSAGE(STATUS
+    if(NOT WXWINDOWS_STATIC_DEBUG_LIBRARY AND NOT WXWINDOWS_SEPARATE_LIBS_BUILD)
+      if(NOT WXWINDOWS_STATIC_LIBRARY)
+        message(STATUS
           "No static wxWindows lib found, but WXWINDOWS_USE_SHARED_LIBS=${WXWINDOWS_USE_SHARED_LIBS}.")
-      ENDIF(NOT WXWINDOWS_STATIC_LIBRARY)
-    ENDIF(NOT WXWINDOWS_STATIC_DEBUG_LIBRARY AND NOT WXWINDOWS_SEPARATE_LIBS_BUILD)
-  ENDIF(WXWINDOWS_USE_SHARED_LIBS)
+      endif(NOT WXWINDOWS_STATIC_LIBRARY)
+    endif(NOT WXWINDOWS_STATIC_DEBUG_LIBRARY AND NOT WXWINDOWS_SEPARATE_LIBS_BUILD)
+  endif(WXWINDOWS_USE_SHARED_LIBS)
 
 
   ## not neccessary in wxWindows 2.4.1 and 2.6.2
   ## but it may fix a previous bug, see
   ## http://lists.wxwindows.org/cgi-bin/ezmlm-cgi?8:mss:37574:200305:mpdioeneabobmgjenoap
-  OPTION(WXWINDOWS_SET_DEFINITIONS "Set additional defines for wxWindows" OFF)
-  MARK_AS_ADVANCED(WXWINDOWS_SET_DEFINITIONS)
-  IF (WXWINDOWS_SET_DEFINITIONS)
-    SET(WXWINDOWS_DEFINITIONS "-DWINVER=0x400")
-  ELSE (WXWINDOWS_SET_DEFINITIONS)
+  option(WXWINDOWS_SET_DEFINITIONS "Set additional defines for wxWindows" OFF)
+  mark_as_advanced(WXWINDOWS_SET_DEFINITIONS)
+  if (WXWINDOWS_SET_DEFINITIONS)
+    set(WXWINDOWS_DEFINITIONS "-DWINVER=0x400")
+  else (WXWINDOWS_SET_DEFINITIONS)
     # clear:
-    SET(WXWINDOWS_DEFINITIONS "")
-  ENDIF (WXWINDOWS_SET_DEFINITIONS)
+    set(WXWINDOWS_DEFINITIONS "")
+  endif (WXWINDOWS_SET_DEFINITIONS)
 
 
 
   ## Find the include directories for wxwindows
   ## the first, build specific for wx/setup.h was determined before.
   ## add inc dir for general for "wx/wx.h"
-  FIND_PATH(WXWINDOWS_INCLUDE_DIR  wx/wx.h
+  find_path(WXWINDOWS_INCLUDE_DIR  wx/wx.h
     "${WXWINDOWS_ROOT_DIR}/include" )
   ## append the build specific include dir for wx/setup.h:
-  IF (WXWINDOWS_INCLUDE_DIR_SETUPH)
-    SET(WXWINDOWS_INCLUDE_DIR ${WXWINDOWS_INCLUDE_DIR} ${WXWINDOWS_INCLUDE_DIR_SETUPH} )
-  ENDIF (WXWINDOWS_INCLUDE_DIR_SETUPH)
+  if (WXWINDOWS_INCLUDE_DIR_SETUPH)
+    set(WXWINDOWS_INCLUDE_DIR ${WXWINDOWS_INCLUDE_DIR} ${WXWINDOWS_INCLUDE_DIR_SETUPH} )
+  endif (WXWINDOWS_INCLUDE_DIR_SETUPH)
 
 
 
-  MARK_AS_ADVANCED(
+  mark_as_advanced(
     WXWINDOWS_ROOT_DIR
     WXWINDOWS_INCLUDE_DIR
     WXWINDOWS_INCLUDE_DIR_SETUPH
@@ -579,9 +579,9 @@ IF(WIN32_STYLE_FIND)
     )
 
 
-ELSE(WIN32_STYLE_FIND)
+else(WIN32_STYLE_FIND)
 
-  IF (UNIX_STYLE_FIND)
+  if (UNIX_STYLE_FIND)
     ## ######################################################################
     ##
     ## UNIX/Linux specific:
@@ -590,85 +590,85 @@ ELSE(WIN32_STYLE_FIND)
     ## 06/2003 Jan Woetzel
     ##
 
-    OPTION(WXWINDOWS_USE_SHARED_LIBS "Use shared versions (.so) of wxWindows libraries" ON)
-    MARK_AS_ADVANCED(WXWINDOWS_USE_SHARED_LIBS)
+    option(WXWINDOWS_USE_SHARED_LIBS "Use shared versions (.so) of wxWindows libraries" ON)
+    mark_as_advanced(WXWINDOWS_USE_SHARED_LIBS)
 
     # JW removed option and force the develper th SET it.
-    # OPTION(WXWINDOWS_USE_GL "use wxWindows with GL support (use additional
+    # option(WXWINDOWS_USE_GL "use wxWindows with GL support (use additional
     # --gl-libs for wx-config)?" OFF)
 
     # wx-config should be in your path anyhow, usually no need to set WXWIN or
     # search in ../wx or ../../wx
-    FIND_PROGRAM(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE wx-config
+    find_program(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE wx-config
       $ENV{WXWIN}
       $ENV{WXWIN}/bin
       ../wx/bin
       ../../wx/bin )
 
     # check wether wx-config was found:
-    IF(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE)
+    if(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE)
 
       # use shared/static wx lib?
       # remember: always link shared to use systems GL etc. libs (no static
       # linking, just link *against* static .a libs)
-      IF(WXWINDOWS_USE_SHARED_LIBS)
-        SET(WX_CONFIG_ARGS_LIBS "--libs")
-      ELSE(WXWINDOWS_USE_SHARED_LIBS)
-        SET(WX_CONFIG_ARGS_LIBS "--static --libs")
-      ENDIF(WXWINDOWS_USE_SHARED_LIBS)
+      if(WXWINDOWS_USE_SHARED_LIBS)
+        set(WX_CONFIG_ARGS_LIBS "--libs")
+      else(WXWINDOWS_USE_SHARED_LIBS)
+        set(WX_CONFIG_ARGS_LIBS "--static --libs")
+      endif(WXWINDOWS_USE_SHARED_LIBS)
 
       # do we need additionial wx GL stuff like GLCanvas ?
-      IF(WXWINDOWS_USE_GL)
-        SET(WX_CONFIG_ARGS_LIBS "${WX_CONFIG_ARGS_LIBS} --gl-libs" )
-      ENDIF(WXWINDOWS_USE_GL)
-      ##MESSAGE("DBG: WX_CONFIG_ARGS_LIBS=${WX_CONFIG_ARGS_LIBS}===")
+      if(WXWINDOWS_USE_GL)
+        set(WX_CONFIG_ARGS_LIBS "${WX_CONFIG_ARGS_LIBS} --gl-libs" )
+      endif(WXWINDOWS_USE_GL)
+      ##message("DBG: WX_CONFIG_ARGS_LIBS=${WX_CONFIG_ARGS_LIBS}===")
 
       # set CXXFLAGS to be fed into CMAKE_CXX_FLAGS by the user:
-      IF (HAVE_ISYSTEM) # does the compiler support -isystem ?
-              IF (NOT APPLE) # -isystem seem sto be unsuppored on Mac
-                IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX )
-            IF (CMAKE_CXX_COMPILER MATCHES g\\+\\+)
-              SET(CMAKE_WXWINDOWS_CXX_FLAGS "`${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} --cxxflags|sed -e s/-I/-isystem/g`")
-            ELSE(CMAKE_CXX_COMPILER MATCHES g\\+\\+)
-              SET(CMAKE_WXWINDOWS_CXX_FLAGS "`${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} --cxxflags`")
-            ENDIF(CMAKE_CXX_COMPILER MATCHES g\\+\\+)
-                ENDIF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX )
-              ENDIF (NOT APPLE)
-      ENDIF (HAVE_ISYSTEM)
-      ##MESSAGE("DBG: for compilation:
+      if (HAVE_ISYSTEM) # does the compiler support -isystem ?
+              if (NOT APPLE) # -isystem seem sto be unsuppored on Mac
+                if(CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX )
+            if (CMAKE_CXX_COMPILER MATCHES g\\+\\+)
+              set(CMAKE_WXWINDOWS_CXX_FLAGS "`${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} --cxxflags|sed -e s/-I/-isystem/g`")
+            else(CMAKE_CXX_COMPILER MATCHES g\\+\\+)
+              set(CMAKE_WXWINDOWS_CXX_FLAGS "`${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} --cxxflags`")
+            endif(CMAKE_CXX_COMPILER MATCHES g\\+\\+)
+                endif(CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX )
+              endif (NOT APPLE)
+      endif (HAVE_ISYSTEM)
+      ##message("DBG: for compilation:
       ##CMAKE_WXWINDOWS_CXX_FLAGS=${CMAKE_WXWINDOWS_CXX_FLAGS}===")
 
       # keep the back-quoted string for clarity
-      SET(WXWINDOWS_LIBRARIES "`${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} ${WX_CONFIG_ARGS_LIBS}`")
-      ##MESSAGE("DBG2: for linking:
+      set(WXWINDOWS_LIBRARIES "`${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} ${WX_CONFIG_ARGS_LIBS}`")
+      ##message("DBG2: for linking:
       ##WXWINDOWS_LIBRARIES=${WXWINDOWS_LIBRARIES}===")
 
       # evaluate wx-config output to separate linker flags and linkdirs for
       # rpath:
-      EXEC_PROGRAM(${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE}
+      exec_program(${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE}
         ARGS ${WX_CONFIG_ARGS_LIBS}
         OUTPUT_VARIABLE WX_CONFIG_LIBS )
 
       ## extract linkdirs (-L) for rpath
       ## use regular expression to match wildcard equivalent "-L*<endchar>"
       ## with <endchar> is a space or a semicolon
-      STRING(REGEX MATCHALL "[-][L]([^ ;])+" WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX "${WX_CONFIG_LIBS}" )
-      # MESSAGE("DBG  WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX=${WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX}")
+      string(REGEX MATCHALL "[-][L]([^ ;])+" WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX "${WX_CONFIG_LIBS}" )
+      # message("DBG  WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX=${WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX}")
 
       ## remove prefix -L because we need the pure directory for LINK_DIRECTORIES
       ## replace -L by ; because the separator seems to be lost otherwise (bug or
       ## feature?)
-      IF(WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX)
-        STRING(REGEX REPLACE "[-][L]" ";" WXWINDOWS_LINK_DIRECTORIES ${WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX} )
-        # MESSAGE("DBG  WXWINDOWS_LINK_DIRECTORIES=${WXWINDOWS_LINK_DIRECTORIES}")
-      ENDIF(WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX)
+      if(WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX)
+        string(REGEX REPLACE "[-][L]" ";" WXWINDOWS_LINK_DIRECTORIES ${WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX} )
+        # message("DBG  WXWINDOWS_LINK_DIRECTORIES=${WXWINDOWS_LINK_DIRECTORIES}")
+      endif(WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX)
 
 
       ## replace space separated string by semicolon separated vector to make it
       ## work with LINK_DIRECTORIES
-      SEPARATE_ARGUMENTS(WXWINDOWS_LINK_DIRECTORIES)
+      separate_arguments(WXWINDOWS_LINK_DIRECTORIES)
 
-      MARK_AS_ADVANCED(
+      mark_as_advanced(
         CMAKE_WXWINDOWS_CXX_FLAGS
         WXWINDOWS_INCLUDE_DIR
         WXWINDOWS_LIBRARIES
@@ -677,30 +677,30 @@ ELSE(WIN32_STYLE_FIND)
 
 
       ## we really need wx-config...
-    ELSE(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE)
-      MESSAGE(STATUS "Cannot find wx-config anywhere on the system. Please put the file into your path or specify it in CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE.")
-      MARK_AS_ADVANCED(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE)
-    ENDIF(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE)
+    else(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE)
+      message(STATUS "Cannot find wx-config anywhere on the system. Please put the file into your path or specify it in CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE.")
+      mark_as_advanced(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE)
+    endif(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE)
 
 
 
-  ELSE(UNIX_STYLE_FIND)
-    MESSAGE(STATUS "FindwxWindows.cmake:  Platform unknown/unsupported by FindwxWindows.cmake. It's neither WIN32 nor UNIX")
-  ENDIF(UNIX_STYLE_FIND)
-ENDIF(WIN32_STYLE_FIND)
+  else(UNIX_STYLE_FIND)
+    message(STATUS "FindwxWindows.cmake:  Platform unknown/unsupported by FindwxWindows.cmake. It's neither WIN32 nor UNIX")
+  endif(UNIX_STYLE_FIND)
+endif(WIN32_STYLE_FIND)
 
 
-IF(WXWINDOWS_LIBRARIES)
-  IF(WXWINDOWS_INCLUDE_DIR OR CMAKE_WXWINDOWS_CXX_FLAGS)
+if(WXWINDOWS_LIBRARIES)
+  if(WXWINDOWS_INCLUDE_DIR OR CMAKE_WXWINDOWS_CXX_FLAGS)
     ## found all we need.
-    SET(WXWINDOWS_FOUND 1)
+    set(WXWINDOWS_FOUND 1)
 
     ## set deprecated variables for backward compatibility:
-    SET(CMAKE_WX_CAN_COMPILE   ${WXWINDOWS_FOUND})
-    SET(WXWINDOWS_LIBRARY     ${WXWINDOWS_LIBRARIES})
-    SET(WXWINDOWS_INCLUDE_PATH ${WXWINDOWS_INCLUDE_DIR})
-    SET(WXWINDOWS_LINK_DIRECTORIES ${WXWINDOWS_LINK_DIRECTORIES})
-    SET(CMAKE_WX_CXX_FLAGS     ${CMAKE_WXWINDOWS_CXX_FLAGS})
+    set(CMAKE_WX_CAN_COMPILE   ${WXWINDOWS_FOUND})
+    set(WXWINDOWS_LIBRARY     ${WXWINDOWS_LIBRARIES})
+    set(WXWINDOWS_INCLUDE_PATH ${WXWINDOWS_INCLUDE_DIR})
+    set(WXWINDOWS_LINK_DIRECTORIES ${WXWINDOWS_LINK_DIRECTORIES})
+    set(CMAKE_WX_CXX_FLAGS     ${CMAKE_WXWINDOWS_CXX_FLAGS})
 
-  ENDIF(WXWINDOWS_INCLUDE_DIR OR CMAKE_WXWINDOWS_CXX_FLAGS)
-ENDIF(WXWINDOWS_LIBRARIES)
+  endif(WXWINDOWS_INCLUDE_DIR OR CMAKE_WXWINDOWS_CXX_FLAGS)
+endif(WXWINDOWS_LIBRARIES)
diff --git a/Modules/ITKCompatibility.cmake b/Modules/ITKCompatibility.cmake
index efd9c284e..ca2d69bfb 100644
--- a/Modules/ITKCompatibility.cmake
+++ b/Modules/ITKCompatibility.cmake
@@ -13,5 +13,5 @@
 #  License text for the above reference.)
 
 # work around an old bug in ITK prior to verison 3.0
-SET(TIFF_RIGHT_VERSION 1)
+set(TIFF_RIGHT_VERSION 1)
 
diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake
index 65d254a4a..f6b185f14 100644
--- a/Modules/InstallRequiredSystemLibraries.cmake
+++ b/Modules/InstallRequiredSystemLibraries.cmake
@@ -1,6 +1,6 @@
 # By including this file, all library files listed in the variable
 # CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS will be installed with
-# INSTALL(PROGRAMS ...) into bin for WIN32 and lib
+# install(PROGRAMS ...) into bin for WIN32 and lib
 # for non-WIN32. If CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP is set to TRUE
 # before including this file, then the INSTALL command is not called.
 # The user can use the variable CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS to use a
@@ -36,196 +36,196 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-IF(MSVC)
-  FILE(TO_CMAKE_PATH "$ENV{SYSTEMROOT}" SYSTEMROOT)
+if(MSVC)
+  file(TO_CMAKE_PATH "$ENV{SYSTEMROOT}" SYSTEMROOT)
 
-  IF(CMAKE_CL_64)
-    IF(MSVC_VERSION GREATER 1599)
+  if(CMAKE_CL_64)
+    if(MSVC_VERSION GREATER 1599)
       # VS 10 and later:
-      SET(CMAKE_MSVC_ARCH x64)
-    ELSE()
+      set(CMAKE_MSVC_ARCH x64)
+    else()
       # VS 9 and earlier:
-      SET(CMAKE_MSVC_ARCH amd64)
-    ENDIF()
-  ELSE(CMAKE_CL_64)
-    SET(CMAKE_MSVC_ARCH x86)
-  ENDIF(CMAKE_CL_64)
+      set(CMAKE_MSVC_ARCH amd64)
+    endif()
+  else(CMAKE_CL_64)
+    set(CMAKE_MSVC_ARCH x86)
+  endif(CMAKE_CL_64)
 
-  GET_FILENAME_COMPONENT(devenv_dir "${CMAKE_MAKE_PROGRAM}" PATH)
-  GET_FILENAME_COMPONENT(base_dir "${devenv_dir}/../.." ABSOLUTE)
+  get_filename_component(devenv_dir "${CMAKE_MAKE_PROGRAM}" PATH)
+  get_filename_component(base_dir "${devenv_dir}/../.." ABSOLUTE)
 
-  IF(MSVC70)
-    SET(__install__libs
+  if(MSVC70)
+    set(__install__libs
       "${SYSTEMROOT}/system32/msvcp70.dll"
       "${SYSTEMROOT}/system32/msvcr70.dll"
       )
-  ENDIF(MSVC70)
+  endif(MSVC70)
 
-  IF(MSVC71)
-    SET(__install__libs
+  if(MSVC71)
+    set(__install__libs
       "${SYSTEMROOT}/system32/msvcp71.dll"
       "${SYSTEMROOT}/system32/msvcr71.dll"
       )
-  ENDIF(MSVC71)
+  endif(MSVC71)
 
-  IF(MSVC80)
+  if(MSVC80)
     # Find the runtime library redistribution directory.
-    GET_FILENAME_COMPONENT(msvc_install_dir
+    get_filename_component(msvc_install_dir
       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]" ABSOLUTE)
-    FIND_PATH(MSVC80_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest
+    find_path(MSVC80_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest
       PATHS
         "${msvc_install_dir}/../../VC/redist"
         "${base_dir}/VC/redist"
       )
-    MARK_AS_ADVANCED(MSVC80_REDIST_DIR)
-    SET(MSVC80_CRT_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT")
+    mark_as_advanced(MSVC80_REDIST_DIR)
+    set(MSVC80_CRT_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT")
 
     # Install the manifest that allows DLLs to be loaded from the
     # directory containing the executable.
-    IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
-      SET(__install__libs
+    if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+      set(__install__libs
         "${MSVC80_CRT_DIR}/Microsoft.VC80.CRT.manifest"
         "${MSVC80_CRT_DIR}/msvcm80.dll"
         "${MSVC80_CRT_DIR}/msvcp80.dll"
         "${MSVC80_CRT_DIR}/msvcr80.dll"
         )
-    ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+    endif(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
 
-    IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
-      SET(MSVC80_CRT_DIR
+    if(CMAKE_INSTALL_DEBUG_LIBRARIES)
+      set(MSVC80_CRT_DIR
         "${MSVC80_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugCRT")
-      SET(__install__libs ${__install__libs}
+      set(__install__libs ${__install__libs}
         "${MSVC80_CRT_DIR}/Microsoft.VC80.DebugCRT.manifest"
         "${MSVC80_CRT_DIR}/msvcm80d.dll"
         "${MSVC80_CRT_DIR}/msvcp80d.dll"
         "${MSVC80_CRT_DIR}/msvcr80d.dll"
         )
-    ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
-  ENDIF(MSVC80)
+    endif(CMAKE_INSTALL_DEBUG_LIBRARIES)
+  endif(MSVC80)
 
-  IF(MSVC90)
+  if(MSVC90)
     # Find the runtime library redistribution directory.
-    GET_FILENAME_COMPONENT(msvc_install_dir
+    get_filename_component(msvc_install_dir
       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir]" ABSOLUTE)
-    GET_FILENAME_COMPONENT(msvc_express_install_dir
+    get_filename_component(msvc_express_install_dir
       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\9.0;InstallDir]" ABSOLUTE)
-    FIND_PATH(MSVC90_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
+    find_path(MSVC90_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
       PATHS
         "${msvc_install_dir}/../../VC/redist"
         "${msvc_express_install_dir}/../../VC/redist"
         "${base_dir}/VC/redist"
       )
-    MARK_AS_ADVANCED(MSVC90_REDIST_DIR)
-    SET(MSVC90_CRT_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT")
+    mark_as_advanced(MSVC90_REDIST_DIR)
+    set(MSVC90_CRT_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT")
 
     # Install the manifest that allows DLLs to be loaded from the
     # directory containing the executable.
-    IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
-      SET(__install__libs
+    if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+      set(__install__libs
         "${MSVC90_CRT_DIR}/Microsoft.VC90.CRT.manifest"
         "${MSVC90_CRT_DIR}/msvcm90.dll"
         "${MSVC90_CRT_DIR}/msvcp90.dll"
         "${MSVC90_CRT_DIR}/msvcr90.dll"
         )
-    ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+    endif(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
 
-    IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
-      SET(MSVC90_CRT_DIR
+    if(CMAKE_INSTALL_DEBUG_LIBRARIES)
+      set(MSVC90_CRT_DIR
         "${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugCRT")
-      SET(__install__libs ${__install__libs}
+      set(__install__libs ${__install__libs}
         "${MSVC90_CRT_DIR}/Microsoft.VC90.DebugCRT.manifest"
         "${MSVC90_CRT_DIR}/msvcm90d.dll"
         "${MSVC90_CRT_DIR}/msvcp90d.dll"
         "${MSVC90_CRT_DIR}/msvcr90d.dll"
         )
-    ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
-  ENDIF(MSVC90)
+    endif(CMAKE_INSTALL_DEBUG_LIBRARIES)
+  endif(MSVC90)
 
-  MACRO(MSVCRT_FILES_FOR_VERSION version)
-    SET(v "${version}")
+  macro(MSVCRT_FILES_FOR_VERSION version)
+    set(v "${version}")
 
     # Find the runtime library redistribution directory.
-    GET_FILENAME_COMPONENT(msvc_install_dir
+    get_filename_component(msvc_install_dir
       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${v}.0;InstallDir]" ABSOLUTE)
-    FIND_PATH(MSVC${v}_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.CRT
+    find_path(MSVC${v}_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.CRT
       PATHS
         "${msvc_install_dir}/../../VC/redist"
         "${base_dir}/VC/redist"
         "$ENV{ProgramFiles}/Microsoft Visual Studio ${v}.0/VC/redist"
         "$ENV{ProgramFiles(x86)}/Microsoft Visual Studio ${v}.0/VC/redist"
       )
-    MARK_AS_ADVANCED(MSVC${v}_REDIST_DIR)
-    SET(MSVC${v}_CRT_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.CRT")
+    mark_as_advanced(MSVC${v}_REDIST_DIR)
+    set(MSVC${v}_CRT_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.CRT")
 
-    IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
-      SET(__install__libs
+    if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+      set(__install__libs
         "${MSVC${v}_CRT_DIR}/msvcp${v}0.dll"
         "${MSVC${v}_CRT_DIR}/msvcr${v}0.dll"
         )
-    ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+    endif(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
 
-    IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
-      SET(MSVC${v}_CRT_DIR
+    if(CMAKE_INSTALL_DEBUG_LIBRARIES)
+      set(MSVC${v}_CRT_DIR
         "${MSVC${v}_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.DebugCRT")
-      SET(__install__libs ${__install__libs}
+      set(__install__libs ${__install__libs}
         "${MSVC${v}_CRT_DIR}/msvcp${v}0d.dll"
         "${MSVC${v}_CRT_DIR}/msvcr${v}0d.dll"
         )
-    ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
-  ENDMACRO()
+    endif(CMAKE_INSTALL_DEBUG_LIBRARIES)
+  endmacro()
 
-  IF(MSVC10)
+  if(MSVC10)
     MSVCRT_FILES_FOR_VERSION(10)
-  ENDIF()
+  endif()
 
-  IF(MSVC11)
+  if(MSVC11)
     MSVCRT_FILES_FOR_VERSION(11)
-  ENDIF()
+  endif()
 
-  IF(CMAKE_INSTALL_MFC_LIBRARIES)
-    IF(MSVC70)
-      SET(__install__libs ${__install__libs}
+  if(CMAKE_INSTALL_MFC_LIBRARIES)
+    if(MSVC70)
+      set(__install__libs ${__install__libs}
         "${SYSTEMROOT}/system32/mfc70.dll"
         )
-    ENDIF(MSVC70)
+    endif(MSVC70)
 
-    IF(MSVC71)
-      SET(__install__libs ${__install__libs}
+    if(MSVC71)
+      set(__install__libs ${__install__libs}
         "${SYSTEMROOT}/system32/mfc71.dll"
         )
-    ENDIF(MSVC71)
+    endif(MSVC71)
 
-    IF(MSVC80)
-      IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
-        SET(MSVC80_MFC_DIR
+    if(MSVC80)
+      if(CMAKE_INSTALL_DEBUG_LIBRARIES)
+        set(MSVC80_MFC_DIR
           "${MSVC80_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugMFC")
-        SET(__install__libs ${__install__libs}
+        set(__install__libs ${__install__libs}
           "${MSVC80_MFC_DIR}/Microsoft.VC80.DebugMFC.manifest"
           "${MSVC80_MFC_DIR}/mfc80d.dll"
           "${MSVC80_MFC_DIR}/mfc80ud.dll"
           "${MSVC80_MFC_DIR}/mfcm80d.dll"
           "${MSVC80_MFC_DIR}/mfcm80ud.dll"
           )
-      ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
+      endif(CMAKE_INSTALL_DEBUG_LIBRARIES)
 
-      SET(MSVC80_MFC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFC")
+      set(MSVC80_MFC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFC")
       # Install the manifest that allows DLLs to be loaded from the
       # directory containing the executable.
-      IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
-        SET(__install__libs ${__install__libs}
+      if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+        set(__install__libs ${__install__libs}
           "${MSVC80_MFC_DIR}/Microsoft.VC80.MFC.manifest"
           "${MSVC80_MFC_DIR}/mfc80.dll"
           "${MSVC80_MFC_DIR}/mfc80u.dll"
           "${MSVC80_MFC_DIR}/mfcm80.dll"
           "${MSVC80_MFC_DIR}/mfcm80u.dll"
           )
-      ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+      endif(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
 
       # include the language dll's for vs8 as well as the actuall dll's
-      SET(MSVC80_MFCLOC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFCLOC")
+      set(MSVC80_MFCLOC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFCLOC")
       # Install the manifest that allows DLLs to be loaded from the
       # directory containing the executable.
-      SET(__install__libs ${__install__libs}
+      set(__install__libs ${__install__libs}
         "${MSVC80_MFCLOC_DIR}/Microsoft.VC80.MFCLOC.manifest"
         "${MSVC80_MFCLOC_DIR}/mfc80chs.dll"
         "${MSVC80_MFCLOC_DIR}/mfc80cht.dll"
@@ -237,39 +237,39 @@ IF(MSVC)
         "${MSVC80_MFCLOC_DIR}/mfc80jpn.dll"
         "${MSVC80_MFCLOC_DIR}/mfc80kor.dll"
         )
-    ENDIF(MSVC80)
+    endif(MSVC80)
 
-    IF(MSVC90)
-      IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
-        SET(MSVC90_MFC_DIR
+    if(MSVC90)
+      if(CMAKE_INSTALL_DEBUG_LIBRARIES)
+        set(MSVC90_MFC_DIR
           "${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugMFC")
-        SET(__install__libs ${__install__libs}
+        set(__install__libs ${__install__libs}
           "${MSVC90_MFC_DIR}/Microsoft.VC90.DebugMFC.manifest"
           "${MSVC90_MFC_DIR}/mfc90d.dll"
           "${MSVC90_MFC_DIR}/mfc90ud.dll"
           "${MSVC90_MFC_DIR}/mfcm90d.dll"
           "${MSVC90_MFC_DIR}/mfcm90ud.dll"
           )
-      ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
+      endif(CMAKE_INSTALL_DEBUG_LIBRARIES)
 
-      SET(MSVC90_MFC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFC")
+      set(MSVC90_MFC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFC")
       # Install the manifest that allows DLLs to be loaded from the
       # directory containing the executable.
-      IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
-        SET(__install__libs ${__install__libs}
+      if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+        set(__install__libs ${__install__libs}
           "${MSVC90_MFC_DIR}/Microsoft.VC90.MFC.manifest"
           "${MSVC90_MFC_DIR}/mfc90.dll"
           "${MSVC90_MFC_DIR}/mfc90u.dll"
           "${MSVC90_MFC_DIR}/mfcm90.dll"
           "${MSVC90_MFC_DIR}/mfcm90u.dll"
           )
-      ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+      endif(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
 
       # include the language dll's for vs9 as well as the actuall dll's
-      SET(MSVC90_MFCLOC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFCLOC")
+      set(MSVC90_MFCLOC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFCLOC")
       # Install the manifest that allows DLLs to be loaded from the
       # directory containing the executable.
-      SET(__install__libs ${__install__libs}
+      set(__install__libs ${__install__libs}
         "${MSVC90_MFCLOC_DIR}/Microsoft.VC90.MFCLOC.manifest"
         "${MSVC90_MFCLOC_DIR}/mfc90chs.dll"
         "${MSVC90_MFCLOC_DIR}/mfc90cht.dll"
@@ -281,35 +281,35 @@ IF(MSVC)
         "${MSVC90_MFCLOC_DIR}/mfc90jpn.dll"
         "${MSVC90_MFCLOC_DIR}/mfc90kor.dll"
         )
-    ENDIF(MSVC90)
+    endif(MSVC90)
 
-    MACRO(MFC_FILES_FOR_VERSION version)
-      SET(v "${version}")
+    macro(MFC_FILES_FOR_VERSION version)
+      set(v "${version}")
 
-      IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
-        SET(MSVC${v}_MFC_DIR
+      if(CMAKE_INSTALL_DEBUG_LIBRARIES)
+        set(MSVC${v}_MFC_DIR
           "${MSVC${v}_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.DebugMFC")
-        SET(__install__libs ${__install__libs}
+        set(__install__libs ${__install__libs}
           "${MSVC${v}_MFC_DIR}/mfc${v}0d.dll"
           "${MSVC${v}_MFC_DIR}/mfc${v}0ud.dll"
           "${MSVC${v}_MFC_DIR}/mfcm${v}0d.dll"
           "${MSVC${v}_MFC_DIR}/mfcm${v}0ud.dll"
           )
-      ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
+      endif(CMAKE_INSTALL_DEBUG_LIBRARIES)
 
-      SET(MSVC${v}_MFC_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.MFC")
-      IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
-        SET(__install__libs ${__install__libs}
+      set(MSVC${v}_MFC_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.MFC")
+      if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+        set(__install__libs ${__install__libs}
           "${MSVC${v}_MFC_DIR}/mfc${v}0.dll"
           "${MSVC${v}_MFC_DIR}/mfc${v}0u.dll"
           "${MSVC${v}_MFC_DIR}/mfcm${v}0.dll"
           "${MSVC${v}_MFC_DIR}/mfcm${v}0u.dll"
           )
-      ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+      endif(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
 
       # include the language dll's as well as the actuall dll's
-      SET(MSVC${v}_MFCLOC_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.MFCLOC")
-      SET(__install__libs ${__install__libs}
+      set(MSVC${v}_MFCLOC_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.MFCLOC")
+      set(__install__libs ${__install__libs}
         "${MSVC${v}_MFCLOC_DIR}/mfc${v}0chs.dll"
         "${MSVC${v}_MFCLOC_DIR}/mfc${v}0cht.dll"
         "${MSVC${v}_MFCLOC_DIR}/mfc${v}0enu.dll"
@@ -320,82 +320,82 @@ IF(MSVC)
         "${MSVC${v}_MFCLOC_DIR}/mfc${v}0jpn.dll"
         "${MSVC${v}_MFCLOC_DIR}/mfc${v}0kor.dll"
         )
-    ENDMACRO()
+    endmacro()
 
-    IF(MSVC10)
+    if(MSVC10)
       MFC_FILES_FOR_VERSION(10)
-    ENDIF()
+    endif()
 
-    IF(MSVC11)
+    if(MSVC11)
       MFC_FILES_FOR_VERSION(11)
-    ENDIF()
-  ENDIF(CMAKE_INSTALL_MFC_LIBRARIES)
+    endif()
+  endif(CMAKE_INSTALL_MFC_LIBRARIES)
 
-  FOREACH(lib
+  foreach(lib
       ${__install__libs}
       )
-    IF(EXISTS ${lib})
-      SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
+    if(EXISTS ${lib})
+      set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
         ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
-    ELSE(EXISTS ${lib})
-      IF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
-        MESSAGE(WARNING "system runtime library file does not exist: '${lib}'")
+    else(EXISTS ${lib})
+      if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
+        message(WARNING "system runtime library file does not exist: '${lib}'")
         # This warning indicates an incomplete Visual Studio installation
         # or a bug somewhere above here in this file.
         # If you would like to avoid this warning, fix the real problem, or
         # set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including
         # this file.
-      ENDIF()
-    ENDIF(EXISTS ${lib})
-  ENDFOREACH(lib)
-ENDIF(MSVC)
+      endif()
+    endif(EXISTS ${lib})
+  endforeach(lib)
+endif(MSVC)
 
-IF(WATCOM)
-  GET_FILENAME_COMPONENT( CompilerPath ${CMAKE_C_COMPILER} PATH )
-  IF(WATCOM17)
-     SET( __install__libs ${CompilerPath}/clbr17.dll
+if(WATCOM)
+  get_filename_component( CompilerPath ${CMAKE_C_COMPILER} PATH )
+  if(WATCOM17)
+     set( __install__libs ${CompilerPath}/clbr17.dll
        ${CompilerPath}/mt7r17.dll ${CompilerPath}/plbr17.dll )
-  ENDIF()
-  IF(WATCOM18)
-     SET( __install__libs ${CompilerPath}/clbr18.dll
+  endif()
+  if(WATCOM18)
+     set( __install__libs ${CompilerPath}/clbr18.dll
        ${CompilerPath}/mt7r18.dll ${CompilerPath}/plbr18.dll )
-  ENDIF()
-  IF(WATCOM19)
-     SET( __install__libs ${CompilerPath}/clbr19.dll
+  endif()
+  if(WATCOM19)
+     set( __install__libs ${CompilerPath}/clbr19.dll
        ${CompilerPath}/mt7r19.dll ${CompilerPath}/plbr19.dll )
-  ENDIF()
-  FOREACH(lib
+  endif()
+  foreach(lib
       ${__install__libs}
       )
-    IF(EXISTS ${lib})
-      SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
+    if(EXISTS ${lib})
+      set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
         ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
-    ELSE()
-      IF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
-        MESSAGE(WARNING "system runtime library file does not exist: '${lib}'")
+    else()
+      if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
+        message(WARNING "system runtime library file does not exist: '${lib}'")
         # This warning indicates an incomplete Watcom installation
         # or a bug somewhere above here in this file.
         # If you would like to avoid this warning, fix the real problem, or
         # set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including
         # this file.
-      ENDIF()
-    ENDIF()
-  ENDFOREACH()
-ENDIF()
+      endif()
+    endif()
+  endforeach()
+endif()
 
 
 # Include system runtime libraries in the installation if any are
 # specified by CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS.
-IF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
-  IF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
-    IF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION)
-      IF(WIN32)
-        SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION bin)
-      ELSE(WIN32)
-        SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION lib)
-      ENDIF(WIN32)
-    ENDIF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION)
-    INSTALL(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
+if(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
+  if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
+    if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION)
+      if(WIN32)
+        set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION bin)
+      else(WIN32)
+        set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION lib)
+      endif(WIN32)
+    endif(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION)
+    install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
       DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION})
-  ENDIF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
-ENDIF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
+  endif(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
+endif(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
diff --git a/Modules/KDE3Macros.cmake b/Modules/KDE3Macros.cmake
index 5b76000e8..858b7d63f 100644
--- a/Modules/KDE3Macros.cmake
+++ b/Modules/KDE3Macros.cmake
@@ -32,157 +32,157 @@
 
 #neundorf@kde.org
 
-INCLUDE(AddFileDependencies)
+include(AddFileDependencies)
 
 #create the kidl and skeletion file for dcop stuff
 #usage: KDE_ADD_COP_SKELS(foo_SRCS ${dcop_headers})
-MACRO(KDE3_ADD_DCOP_SKELS _sources)
-   FOREACH (_current_FILE ${ARGN})
+macro(KDE3_ADD_DCOP_SKELS _sources)
+   foreach (_current_FILE ${ARGN})
 
-      GET_FILENAME_COMPONENT(_tmp_FILE ${_current_FILE} ABSOLUTE)
-      GET_FILENAME_COMPONENT(_basename ${_tmp_FILE} NAME_WE)
+      get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)
+      get_filename_component(_basename ${_tmp_FILE} NAME_WE)
 
-      SET(_skel ${CMAKE_CURRENT_BINARY_DIR}/${_basename}_skel.cpp)
-      SET(_kidl ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.kidl)
+      set(_skel ${CMAKE_CURRENT_BINARY_DIR}/${_basename}_skel.cpp)
+      set(_kidl ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.kidl)
 
-      IF (NOT HAVE_${_basename}_KIDL_RULE)
-         SET(HAVE_${_basename}_KIDL_RULE ON)
+      if (NOT HAVE_${_basename}_KIDL_RULE)
+         set(HAVE_${_basename}_KIDL_RULE ON)
 
-          ADD_CUSTOM_COMMAND(OUTPUT ${_kidl}
+          add_custom_command(OUTPUT ${_kidl}
           COMMAND ${KDE3_DCOPIDL_EXECUTABLE}
           ARGS ${_tmp_FILE} > ${_kidl}
           DEPENDS ${_tmp_FILE}
          )
 
-       ENDIF (NOT HAVE_${_basename}_KIDL_RULE)
+       endif (NOT HAVE_${_basename}_KIDL_RULE)
 
-      IF (NOT HAVE_${_basename}_SKEL_RULE)
-        SET(HAVE_${_basename}_SKEL_RULE ON)
+      if (NOT HAVE_${_basename}_SKEL_RULE)
+        set(HAVE_${_basename}_SKEL_RULE ON)
 
-       ADD_CUSTOM_COMMAND(OUTPUT ${_skel}
+       add_custom_command(OUTPUT ${_skel}
           COMMAND ${KDE3_DCOPIDL2CPP_EXECUTABLE}
           ARGS --c++-suffix cpp --no-signals --no-stub ${_kidl}
           DEPENDS ${_kidl}
           )
 
-      ENDIF (NOT HAVE_${_basename}_SKEL_RULE)
+      endif (NOT HAVE_${_basename}_SKEL_RULE)
 
-      SET(${_sources} ${${_sources}} ${_skel})
+      set(${_sources} ${${_sources}} ${_skel})
 
-   ENDFOREACH (_current_FILE)
+   endforeach (_current_FILE)
 
-ENDMACRO(KDE3_ADD_DCOP_SKELS)
+endmacro(KDE3_ADD_DCOP_SKELS)
 
 
-MACRO(KDE3_ADD_DCOP_STUBS _sources)
-   FOREACH (_current_FILE ${ARGN})
+macro(KDE3_ADD_DCOP_STUBS _sources)
+   foreach (_current_FILE ${ARGN})
 
-      GET_FILENAME_COMPONENT(_tmp_FILE ${_current_FILE} ABSOLUTE)
+      get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)
 
-      GET_FILENAME_COMPONENT(_basename ${_tmp_FILE} NAME_WE)
+      get_filename_component(_basename ${_tmp_FILE} NAME_WE)
 
-      SET(_stub_CPP ${CMAKE_CURRENT_BINARY_DIR}/${_basename}_stub.cpp)
-      SET(_kidl ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.kidl)
+      set(_stub_CPP ${CMAKE_CURRENT_BINARY_DIR}/${_basename}_stub.cpp)
+      set(_kidl ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.kidl)
 
-      IF (NOT HAVE_${_basename}_KIDL_RULE)
-        SET(HAVE_${_basename}_KIDL_RULE ON)
+      if (NOT HAVE_${_basename}_KIDL_RULE)
+        set(HAVE_${_basename}_KIDL_RULE ON)
 
 
-        ADD_CUSTOM_COMMAND(OUTPUT ${_kidl}
+        add_custom_command(OUTPUT ${_kidl}
            COMMAND ${KDE3_DCOPIDL_EXECUTABLE}
            ARGS ${_tmp_FILE} > ${_kidl}
            DEPENDS ${_tmp_FILE}
            )
 
-      ENDIF (NOT HAVE_${_basename}_KIDL_RULE)
+      endif (NOT HAVE_${_basename}_KIDL_RULE)
 
 
-      IF (NOT HAVE_${_basename}_STUB_RULE)
-        SET(HAVE_${_basename}_STUB_RULE ON)
+      if (NOT HAVE_${_basename}_STUB_RULE)
+        set(HAVE_${_basename}_STUB_RULE ON)
 
-        ADD_CUSTOM_COMMAND(OUTPUT ${_stub_CPP}
+        add_custom_command(OUTPUT ${_stub_CPP}
            COMMAND ${KDE3_DCOPIDL2CPP_EXECUTABLE}
            ARGS --c++-suffix cpp --no-signals --no-skel ${_kidl}
            DEPENDS ${_kidl}
          )
 
-      ENDIF (NOT HAVE_${_basename}_STUB_RULE)
+      endif (NOT HAVE_${_basename}_STUB_RULE)
 
-      SET(${_sources} ${${_sources}} ${_stub_CPP})
+      set(${_sources} ${${_sources}} ${_stub_CPP})
 
-   ENDFOREACH (_current_FILE)
+   endforeach (_current_FILE)
 
-ENDMACRO(KDE3_ADD_DCOP_STUBS)
+endmacro(KDE3_ADD_DCOP_STUBS)
 
 
-MACRO(KDE3_ADD_KCFG_FILES _sources)
-   FOREACH (_current_FILE ${ARGN})
+macro(KDE3_ADD_KCFG_FILES _sources)
+   foreach (_current_FILE ${ARGN})
 
-      GET_FILENAME_COMPONENT(_tmp_FILE ${_current_FILE} ABSOLUTE)
+      get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)
 
-      GET_FILENAME_COMPONENT(_basename ${_tmp_FILE} NAME_WE)
+      get_filename_component(_basename ${_tmp_FILE} NAME_WE)
 
-      FILE(READ ${_tmp_FILE} _contents)
-      STRING(REGEX REPLACE "^(.*\n)?File=([^\n]+)\n.*$" "\\2"  _kcfg_FILE "${_contents}")
+      file(READ ${_tmp_FILE} _contents)
+      string(REGEX REPLACE "^(.*\n)?File=([^\n]+)\n.*$" "\\2"  _kcfg_FILE "${_contents}")
 
-      SET(_src_FILE    ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp)
-      SET(_header_FILE ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h)
+      set(_src_FILE    ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp)
+      set(_header_FILE ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h)
 
-      ADD_CUSTOM_COMMAND(OUTPUT ${_src_FILE}
+      add_custom_command(OUTPUT ${_src_FILE}
          COMMAND ${KDE3_KCFGC_EXECUTABLE}
          ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${_kcfg_FILE} ${_tmp_FILE}
          DEPENDS ${_tmp_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/${_kcfg_FILE} )
 
-      SET(${_sources} ${${_sources}} ${_src_FILE})
+      set(${_sources} ${${_sources}} ${_src_FILE})
 
-   ENDFOREACH (_current_FILE)
+   endforeach (_current_FILE)
 
-ENDMACRO(KDE3_ADD_KCFG_FILES)
+endmacro(KDE3_ADD_KCFG_FILES)
 
 
 #create the moc files and add them to the list of sources
 #usage: KDE_ADD_MOC_FILES(foo_SRCS ${moc_headers})
-MACRO(KDE3_ADD_MOC_FILES _sources)
-   FOREACH (_current_FILE ${ARGN})
+macro(KDE3_ADD_MOC_FILES _sources)
+   foreach (_current_FILE ${ARGN})
 
-      GET_FILENAME_COMPONENT(_tmp_FILE ${_current_FILE} ABSOLUTE)
+      get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)
 
-      GET_FILENAME_COMPONENT(_basename ${_tmp_FILE} NAME_WE)
-      SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc.cpp)
+      get_filename_component(_basename ${_tmp_FILE} NAME_WE)
+      set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc.cpp)
 
-      ADD_CUSTOM_COMMAND(OUTPUT ${_moc}
+      add_custom_command(OUTPUT ${_moc}
          COMMAND ${QT_MOC_EXECUTABLE}
          ARGS ${_tmp_FILE} -o ${_moc}
          DEPENDS ${_tmp_FILE}
       )
 
-      SET(${_sources} ${${_sources}} ${_moc})
+      set(${_sources} ${${_sources}} ${_moc})
 
-   ENDFOREACH (_current_FILE)
-ENDMACRO(KDE3_ADD_MOC_FILES)
+   endforeach (_current_FILE)
+endmacro(KDE3_ADD_MOC_FILES)
 
 
-GET_FILENAME_COMPONENT( KDE3_MODULE_DIR  ${CMAKE_CURRENT_LIST_FILE} PATH)
+get_filename_component( KDE3_MODULE_DIR  ${CMAKE_CURRENT_LIST_FILE} PATH)
 
 #create the implementation files from the ui files and add them to the list of sources
 #usage: KDE_ADD_UI_FILES(foo_SRCS ${ui_files})
-MACRO(KDE3_ADD_UI_FILES _sources )
-   FOREACH (_current_FILE ${ARGN})
+macro(KDE3_ADD_UI_FILES _sources )
+   foreach (_current_FILE ${ARGN})
 
-      GET_FILENAME_COMPONENT(_tmp_FILE ${_current_FILE} ABSOLUTE)
+      get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)
 
-      GET_FILENAME_COMPONENT(_basename ${_tmp_FILE} NAME_WE)
-      SET(_header ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h)
-      SET(_src ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp)
-      SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc.cpp)
+      get_filename_component(_basename ${_tmp_FILE} NAME_WE)
+      set(_header ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h)
+      set(_src ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp)
+      set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc.cpp)
 
-      ADD_CUSTOM_COMMAND(OUTPUT ${_header}
+      add_custom_command(OUTPUT ${_header}
          COMMAND ${QT_UIC_EXECUTABLE}
          ARGS  -L ${KDE3_LIB_DIR}/kde3/plugins/designer -nounload -o ${_header} ${CMAKE_CURRENT_SOURCE_DIR}/${_current_FILE}
          DEPENDS ${_tmp_FILE}
       )
 
-      ADD_CUSTOM_COMMAND(OUTPUT ${_src}
+      add_custom_command(OUTPUT ${_src}
          COMMAND ${CMAKE_COMMAND}
          ARGS
          -DKDE_UIC_PLUGIN_DIR:FILEPATH=${KDE3_LIB_DIR}/kde3/plugins/designer
@@ -194,23 +194,23 @@ MACRO(KDE3_ADD_UI_FILES _sources )
          DEPENDS ${_header}
       )
 
-      ADD_CUSTOM_COMMAND(OUTPUT ${_moc}
+      add_custom_command(OUTPUT ${_moc}
          COMMAND ${QT_MOC_EXECUTABLE}
          ARGS ${_header} -o ${_moc}
          DEPENDS ${_header}
       )
 
-      SET(${_sources} ${${_sources}} ${_src} ${_moc} )
+      set(${_sources} ${${_sources}} ${_src} ${_moc} )
 
-   ENDFOREACH (_current_FILE)
-ENDMACRO(KDE3_ADD_UI_FILES)
+   endforeach (_current_FILE)
+endmacro(KDE3_ADD_UI_FILES)
 
 
-MACRO(KDE3_AUTOMOC)
-   SET(_matching_FILES )
-   FOREACH (_current_FILE ${ARGN})
+macro(KDE3_AUTOMOC)
+   set(_matching_FILES )
+   foreach (_current_FILE ${ARGN})
 
-      GET_FILENAME_COMPONENT(_abs_FILE ${_current_FILE} ABSOLUTE)
+      get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE)
 
       # if "SKIP_AUTOMOC" is set to true, we will not handle this file here.
       # here. this is required to make bouic work correctly:
@@ -219,25 +219,25 @@ MACRO(KDE3_AUTOMOC)
       # cmake is run for the very first time on them -> however the .cpp files might
       # exist at a later run. at that time we need to skip them, so that we don't add two
       # different rules for the same moc file
-      GET_SOURCE_FILE_PROPERTY(_skip ${_abs_FILE} SKIP_AUTOMOC)
+      get_source_file_property(_skip ${_abs_FILE} SKIP_AUTOMOC)
 
-      IF (EXISTS ${_abs_FILE} AND NOT _skip)
+      if (EXISTS ${_abs_FILE} AND NOT _skip)
 
-         FILE(READ ${_abs_FILE} _contents)
+         file(READ ${_abs_FILE} _contents)
 
-         GET_FILENAME_COMPONENT(_abs_PATH ${_abs_FILE} PATH)
+         get_filename_component(_abs_PATH ${_abs_FILE} PATH)
 
-         STRING(REGEX MATCHALL "#include +[^ ]+\\.moc[\">]" _match "${_contents}")
-         IF(_match)
-            FOREACH (_current_MOC_INC ${_match})
-               STRING(REGEX MATCH "[^ <\"]+\\.moc" _current_MOC "${_current_MOC_INC}")
+         string(REGEX MATCHALL "#include +[^ ]+\\.moc[\">]" _match "${_contents}")
+         if(_match)
+            foreach (_current_MOC_INC ${_match})
+               string(REGEX MATCH "[^ <\"]+\\.moc" _current_MOC "${_current_MOC_INC}")
 
-               GET_FILENAME_COMPONENT(_basename ${_current_MOC} NAME_WE)
-#               SET(_header ${CMAKE_CURRENT_SOURCE_DIR}/${_basename}.h)
-               SET(_header ${_abs_PATH}/${_basename}.h)
-               SET(_moc    ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC})
+               get_filename_component(_basename ${_current_MOC} NAME_WE)
+#               set(_header ${CMAKE_CURRENT_SOURCE_DIR}/${_basename}.h)
+               set(_header ${_abs_PATH}/${_basename}.h)
+               set(_moc    ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC})
 
-               ADD_CUSTOM_COMMAND(OUTPUT ${_moc}
+               add_custom_command(OUTPUT ${_moc}
                   COMMAND ${QT_MOC_EXECUTABLE}
                   ARGS ${_header} -o ${_moc}
                   DEPENDS ${_header}
@@ -245,167 +245,167 @@ MACRO(KDE3_AUTOMOC)
 
                ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc})
 
-            ENDFOREACH (_current_MOC_INC)
-         ENDIF(_match)
+            endforeach (_current_MOC_INC)
+         endif(_match)
 
-      ENDIF (EXISTS ${_abs_FILE} AND NOT _skip)
-   ENDFOREACH (_current_FILE)
-ENDMACRO(KDE3_AUTOMOC)
+      endif (EXISTS ${_abs_FILE} AND NOT _skip)
+   endforeach (_current_FILE)
+endmacro(KDE3_AUTOMOC)
 
 # only used internally by KDE3_INSTALL_ICONS
-MACRO (_KDE3_ADD_ICON_INSTALL_RULE _install_SCRIPT _install_PATH _group _orig_NAME _install_NAME)
+macro (_KDE3_ADD_ICON_INSTALL_RULE _install_SCRIPT _install_PATH _group _orig_NAME _install_NAME)
 
    # if the string doesn't match the pattern, the result is the full string, so all three have the same content
-   IF (NOT ${_group} STREQUAL ${_install_NAME} )
-      SET(_icon_GROUP "actions")
+   if (NOT ${_group} STREQUAL ${_install_NAME} )
+      set(_icon_GROUP "actions")
 
-      IF (${_group} STREQUAL "mime")
-         SET(_icon_GROUP  "mimetypes")
-      ENDIF (${_group} STREQUAL "mime")
+      if (${_group} STREQUAL "mime")
+         set(_icon_GROUP  "mimetypes")
+      endif (${_group} STREQUAL "mime")
 
-      IF (${_group} STREQUAL "filesys")
-         SET(_icon_GROUP  "filesystems")
-      ENDIF (${_group} STREQUAL "filesys")
+      if (${_group} STREQUAL "filesys")
+         set(_icon_GROUP  "filesystems")
+      endif (${_group} STREQUAL "filesys")
 
-      IF (${_group} STREQUAL "device")
-         SET(_icon_GROUP  "devices")
-      ENDIF (${_group} STREQUAL "device")
+      if (${_group} STREQUAL "device")
+         set(_icon_GROUP  "devices")
+      endif (${_group} STREQUAL "device")
 
-      IF (${_group} STREQUAL "app")
-         SET(_icon_GROUP  "apps")
-      ENDIF (${_group} STREQUAL "app")
+      if (${_group} STREQUAL "app")
+         set(_icon_GROUP  "apps")
+      endif (${_group} STREQUAL "app")
 
-      IF (${_group} STREQUAL "action")
-         SET(_icon_GROUP  "actions")
-      ENDIF (${_group} STREQUAL "action")
+      if (${_group} STREQUAL "action")
+         set(_icon_GROUP  "actions")
+      endif (${_group} STREQUAL "action")
 
 #      message(STATUS "icon: ${_current_ICON} size: ${_size} group: ${_group} name: ${_name}" )
-   INSTALL(FILES ${_orig_NAME} DESTINATION ${_install_PATH}/${_icon_GROUP}/ RENAME ${_install_NAME} )
-   ENDIF (NOT ${_group} STREQUAL ${_install_NAME} )
+   install(FILES ${_orig_NAME} DESTINATION ${_install_PATH}/${_icon_GROUP}/ RENAME ${_install_NAME} )
+   endif (NOT ${_group} STREQUAL ${_install_NAME} )
 
-ENDMACRO (_KDE3_ADD_ICON_INSTALL_RULE)
+endmacro (_KDE3_ADD_ICON_INSTALL_RULE)
 
 
-MACRO (KDE3_INSTALL_ICONS _theme )
-   SET(_defaultpath "${CMAKE_INSTALL_PREFIX}/share/icons")
+macro (KDE3_INSTALL_ICONS _theme )
+   set(_defaultpath "${CMAKE_INSTALL_PREFIX}/share/icons")
    # first the png icons
-   FILE(GLOB _icons *.png)
-   FOREACH (_current_ICON ${_icons} )
-      STRING(REGEX REPLACE "^.*/[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\1" _size  "${_current_ICON}")
-      STRING(REGEX REPLACE "^.*/[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\2" _group "${_current_ICON}")
-      STRING(REGEX REPLACE "^.*/[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\3" _name  "${_current_ICON}")
+   file(GLOB _icons *.png)
+   foreach (_current_ICON ${_icons} )
+      string(REGEX REPLACE "^.*/[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\1" _size  "${_current_ICON}")
+      string(REGEX REPLACE "^.*/[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\2" _group "${_current_ICON}")
+      string(REGEX REPLACE "^.*/[a-zA-Z]+([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" "\\3" _name  "${_current_ICON}")
       _KDE3_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake
          ${_defaultpath}/${_theme}/${_size}x${_size}
          ${_group} ${_current_ICON} ${_name})
-   ENDFOREACH (_current_ICON)
+   endforeach (_current_ICON)
 
    # and now the svg icons
-   FILE(GLOB _icons *.svgz)
-   FOREACH (_current_ICON ${_icons} )
-      STRING(REGEX REPLACE "^.*/crsc\\-([a-z]+)\\-(.+\\.svgz)$" "\\1" _group "${_current_ICON}")
-      STRING(REGEX REPLACE "^.*/crsc\\-([a-z]+)\\-(.+\\.svgz)$" "\\2" _name "${_current_ICON}")
+   file(GLOB _icons *.svgz)
+   foreach (_current_ICON ${_icons} )
+      string(REGEX REPLACE "^.*/crsc\\-([a-z]+)\\-(.+\\.svgz)$" "\\1" _group "${_current_ICON}")
+      string(REGEX REPLACE "^.*/crsc\\-([a-z]+)\\-(.+\\.svgz)$" "\\2" _name "${_current_ICON}")
       _KDE3_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake
                                  ${_defaultpath}/${_theme}/scalable
                                  ${_group} ${_current_ICON} ${_name})
-   ENDFOREACH (_current_ICON)
+   endforeach (_current_ICON)
 
-ENDMACRO (KDE3_INSTALL_ICONS)
+endmacro (KDE3_INSTALL_ICONS)
 
-MACRO(KDE3_INSTALL_LIBTOOL_FILE _target)
-   GET_TARGET_PROPERTY(_target_location ${_target} LOCATION)
+macro(KDE3_INSTALL_LIBTOOL_FILE _target)
+   get_target_property(_target_location ${_target} LOCATION)
 
-   GET_FILENAME_COMPONENT(_laname ${_target_location} NAME_WE)
-   GET_FILENAME_COMPONENT(_soname ${_target_location} NAME)
-   SET(_laname ${CMAKE_CURRENT_BINARY_DIR}/${_laname}.la)
+   get_filename_component(_laname ${_target_location} NAME_WE)
+   get_filename_component(_soname ${_target_location} NAME)
+   set(_laname ${CMAKE_CURRENT_BINARY_DIR}/${_laname}.la)
 
-   FILE(WRITE ${_laname} "# ${_laname} - a libtool library file, generated by cmake \n")
-   FILE(APPEND ${_laname} "# The name that we can dlopen(3).\n")
-   FILE(APPEND ${_laname} "dlname='${_soname}'\n")
-   FILE(APPEND ${_laname} "# Names of this library\n")
-   IF(CYGWIN)
-     FILE(APPEND ${_laname} "library_names='${_soname}'\n")
-   ELSE(CYGWIN)
-     FILE(APPEND ${_laname} "library_names='${_soname} ${_soname} ${_soname}'\n")
-   ENDIF(CYGWIN)
-   FILE(APPEND ${_laname} "# The name of the static archive\n")
-   FILE(APPEND ${_laname} "old_library=''\n")
-   FILE(APPEND ${_laname} "# Libraries that this one depends upon.\n")
-   FILE(APPEND ${_laname} "dependency_libs=''\n")
-#   FILE(APPEND ${_laname} "dependency_libs='${${_target}_LIB_DEPENDS}'\n")
-   FILE(APPEND ${_laname} "# Version information.\ncurrent=0\nage=0\nrevision=0\n")
-   FILE(APPEND ${_laname} "# Is this an already installed library?\ninstalled=yes\n")
-   FILE(APPEND ${_laname} "# Should we warn about portability when linking against -modules?\nshouldnotlink=yes\n")
-   FILE(APPEND ${_laname} "# Files to dlopen/dlpreopen\ndlopen=''\ndlpreopen=''\n")
-   FILE(APPEND ${_laname} "# Directory that this library needs to be installed in:\n")
-   FILE(APPEND ${_laname} "libdir='${CMAKE_INSTALL_PREFIX}/lib/kde3'\n")
+   file(WRITE ${_laname} "# ${_laname} - a libtool library file, generated by cmake \n")
+   file(APPEND ${_laname} "# The name that we can dlopen(3).\n")
+   file(APPEND ${_laname} "dlname='${_soname}'\n")
+   file(APPEND ${_laname} "# Names of this library\n")
+   if(CYGWIN)
+     file(APPEND ${_laname} "library_names='${_soname}'\n")
+   else(CYGWIN)
+     file(APPEND ${_laname} "library_names='${_soname} ${_soname} ${_soname}'\n")
+   endif(CYGWIN)
+   file(APPEND ${_laname} "# The name of the static archive\n")
+   file(APPEND ${_laname} "old_library=''\n")
+   file(APPEND ${_laname} "# Libraries that this one depends upon.\n")
+   file(APPEND ${_laname} "dependency_libs=''\n")
+#   file(APPEND ${_laname} "dependency_libs='${${_target}_LIB_DEPENDS}'\n")
+   file(APPEND ${_laname} "# Version information.\ncurrent=0\nage=0\nrevision=0\n")
+   file(APPEND ${_laname} "# Is this an already installed library?\ninstalled=yes\n")
+   file(APPEND ${_laname} "# Should we warn about portability when linking against -modules?\nshouldnotlink=yes\n")
+   file(APPEND ${_laname} "# Files to dlopen/dlpreopen\ndlopen=''\ndlpreopen=''\n")
+   file(APPEND ${_laname} "# Directory that this library needs to be installed in:\n")
+   file(APPEND ${_laname} "libdir='${CMAKE_INSTALL_PREFIX}/lib/kde3'\n")
 
-   INSTALL_FILES(${KDE3_LIBTOOL_DIR} FILES ${_laname})
-ENDMACRO(KDE3_INSTALL_LIBTOOL_FILE)
+   install_files(${KDE3_LIBTOOL_DIR} FILES ${_laname})
+endmacro(KDE3_INSTALL_LIBTOOL_FILE)
 
 
-MACRO(KDE3_CREATE_FINAL_FILE _filename)
-   FILE(WRITE ${_filename} "//autogenerated file\n")
-   FOREACH (_current_FILE ${ARGN})
-      FILE(APPEND ${_filename} "#include \"${_current_FILE}\"\n")
-   ENDFOREACH (_current_FILE)
+macro(KDE3_CREATE_FINAL_FILE _filename)
+   file(WRITE ${_filename} "//autogenerated file\n")
+   foreach (_current_FILE ${ARGN})
+      file(APPEND ${_filename} "#include \"${_current_FILE}\"\n")
+   endforeach (_current_FILE)
 
-ENDMACRO(KDE3_CREATE_FINAL_FILE)
+endmacro(KDE3_CREATE_FINAL_FILE)
 
 
-# OPTION(KDE3_ENABLE_FINAL "Enable final all-in-one compilation")
-OPTION(KDE3_BUILD_TESTS  "Build the tests")
+# option(KDE3_ENABLE_FINAL "Enable final all-in-one compilation")
+option(KDE3_BUILD_TESTS  "Build the tests")
 
 
-MACRO(KDE3_ADD_KPART _target_NAME _with_PREFIX)
+macro(KDE3_ADD_KPART _target_NAME _with_PREFIX)
 #is the first argument is "WITH_PREFIX" then keep the standard "lib" prefix, otherwise SET the prefix empty
-   IF (${_with_PREFIX} STREQUAL "WITH_PREFIX")
-      SET(_first_SRC)
-   ELSE (${_with_PREFIX} STREQUAL "WITH_PREFIX")
-      SET(_first_SRC ${_with_PREFIX})
-   ENDIF (${_with_PREFIX} STREQUAL "WITH_PREFIX")
+   if (${_with_PREFIX} STREQUAL "WITH_PREFIX")
+      set(_first_SRC)
+   else (${_with_PREFIX} STREQUAL "WITH_PREFIX")
+      set(_first_SRC ${_with_PREFIX})
+   endif (${_with_PREFIX} STREQUAL "WITH_PREFIX")
 
-#    IF (KDE3_ENABLE_FINAL)
+#    if (KDE3_ENABLE_FINAL)
 #       KDE3_CREATE_FINAL_FILE(${_target_NAME}_final.cpp ${_first_SRC} ${ARGN})
-#       ADD_LIBRARY(${_target_NAME} MODULE  ${_target_NAME}_final.cpp)
-#    ELSE (KDE3_ENABLE_FINAL)
-   ADD_LIBRARY(${_target_NAME} MODULE ${_first_SRC} ${ARGN})
-#    ENDIF (KDE3_ENABLE_FINAL)
+#       add_library(${_target_NAME} MODULE  ${_target_NAME}_final.cpp)
+#    else (KDE3_ENABLE_FINAL)
+   add_library(${_target_NAME} MODULE ${_first_SRC} ${ARGN})
+#    endif (KDE3_ENABLE_FINAL)
 
-   IF(_first_SRC)
-      SET_TARGET_PROPERTIES(${_target_NAME} PROPERTIES PREFIX "")
-   ENDIF(_first_SRC)
+   if(_first_SRC)
+      set_target_properties(${_target_NAME} PROPERTIES PREFIX "")
+   endif(_first_SRC)
 
    KDE3_INSTALL_LIBTOOL_FILE(${_target_NAME})
 
-ENDMACRO(KDE3_ADD_KPART)
+endmacro(KDE3_ADD_KPART)
 
 
-MACRO(KDE3_ADD_KDEINIT_EXECUTABLE _target_NAME )
+macro(KDE3_ADD_KDEINIT_EXECUTABLE _target_NAME )
 
-#    IF (KDE3_ENABLE_FINAL)
+#    if (KDE3_ENABLE_FINAL)
 #       KDE3_CREATE_FINAL_FILE(${_target_NAME}_final.cpp ${ARGN})
-#       ADD_LIBRARY(kdeinit_${_target_NAME} SHARED  ${_target_NAME}_final.cpp)
-#    ELSE (KDE3_ENABLE_FINAL)
-   ADD_LIBRARY(kdeinit_${_target_NAME} SHARED ${ARGN} )
-#    ENDIF (KDE3_ENABLE_FINAL)
+#       add_library(kdeinit_${_target_NAME} SHARED  ${_target_NAME}_final.cpp)
+#    else (KDE3_ENABLE_FINAL)
+   add_library(kdeinit_${_target_NAME} SHARED ${ARGN} )
+#    endif (KDE3_ENABLE_FINAL)
 
-   CONFIGURE_FILE(${KDE3_MODULE_DIR}/kde3init_dummy.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp)
+   configure_file(${KDE3_MODULE_DIR}/kde3init_dummy.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp)
 
-   ADD_EXECUTABLE( ${_target_NAME} ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp )
-   TARGET_LINK_LIBRARIES( ${_target_NAME} kdeinit_${_target_NAME} )
+   add_executable( ${_target_NAME} ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp )
+   target_link_libraries( ${_target_NAME} kdeinit_${_target_NAME} )
 
-ENDMACRO(KDE3_ADD_KDEINIT_EXECUTABLE)
+endmacro(KDE3_ADD_KDEINIT_EXECUTABLE)
 
 
-MACRO(KDE3_ADD_EXECUTABLE _target_NAME )
+macro(KDE3_ADD_EXECUTABLE _target_NAME )
 
-#    IF (KDE3_ENABLE_FINAL)
+#    if (KDE3_ENABLE_FINAL)
 #       KDE3_CREATE_FINAL_FILE(${_target_NAME}_final.cpp ${ARGN})
-#       ADD_EXECUTABLE(${_target_NAME} ${_target_NAME}_final.cpp)
-#    ELSE (KDE3_ENABLE_FINAL)
-   ADD_EXECUTABLE(${_target_NAME} ${ARGN} )
-#    ENDIF (KDE3_ENABLE_FINAL)
+#       add_executable(${_target_NAME} ${_target_NAME}_final.cpp)
+#    else (KDE3_ENABLE_FINAL)
+   add_executable(${_target_NAME} ${ARGN} )
+#    endif (KDE3_ENABLE_FINAL)
 
-ENDMACRO(KDE3_ADD_EXECUTABLE)
+endmacro(KDE3_ADD_EXECUTABLE)
 
 
diff --git a/Modules/MacroAddFileDependencies.cmake b/Modules/MacroAddFileDependencies.cmake
index 36a217a2b..5ed5b8d90 100644
--- a/Modules/MacroAddFileDependencies.cmake
+++ b/Modules/MacroAddFileDependencies.cmake
@@ -4,7 +4,7 @@
 #
 # MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...) is just a convenience
 # wrapper around the OBJECT_DEPENDS source file property. You can just
-# use SET_PROPERTY(SOURCE <file> APPEND PROPERTY OBJECT_DEPENDS depend_files) instead.
+# use set_property(SOURCE <file> APPEND PROPERTY OBJECT_DEPENDS depend_files) instead.
 
 #=============================================================================
 # Copyright 2006-2009 Kitware, Inc.
@@ -19,15 +19,15 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-MACRO (MACRO_ADD_FILE_DEPENDENCIES _file)
+macro (MACRO_ADD_FILE_DEPENDENCIES _file)
 
-   GET_SOURCE_FILE_PROPERTY(_deps ${_file} OBJECT_DEPENDS)
-   IF (_deps)
-      SET(_deps ${_deps} ${ARGN})
-   ELSE (_deps)
-      SET(_deps ${ARGN})
-   ENDIF (_deps)
+   get_source_file_property(_deps ${_file} OBJECT_DEPENDS)
+   if (_deps)
+      set(_deps ${_deps} ${ARGN})
+   else (_deps)
+      set(_deps ${ARGN})
+   endif (_deps)
 
-   SET_SOURCE_FILES_PROPERTIES(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}")
+   set_source_files_properties(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}")
 
-ENDMACRO (MACRO_ADD_FILE_DEPENDENCIES)
+endmacro (MACRO_ADD_FILE_DEPENDENCIES)
diff --git a/Modules/Platform/AIX.cmake b/Modules/Platform/AIX.cmake
index a9f773ed1..78221b04f 100644
--- a/Modules/Platform/AIX.cmake
+++ b/Modules/Platform/AIX.cmake
@@ -1,6 +1,6 @@
-SET(CMAKE_SHARED_LIBRARY_PREFIX "lib")          # lib
-SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so")          # .so
-SET(CMAKE_DL_LIBS "-lld")
+set(CMAKE_SHARED_LIBRARY_PREFIX "lib")          # lib
+set(CMAKE_SHARED_LIBRARY_SUFFIX ".so")          # .so
+set(CMAKE_DL_LIBS "-lld")
 
 # RPATH support on AIX is called libpath.  By default the runtime
 # libpath is paths specified by -L followed by /usr/lib and /lib.  In
@@ -8,10 +8,10 @@ SET(CMAKE_DL_LIBS "-lld")
 # -Wl,-blibpath:/usr/lib:/lib whether RPATH support is on or not.
 # When our own RPATH is to be added it may be inserted before the
 # "always" paths.
-SET(CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH /usr/lib /lib)
+set(CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH /usr/lib /lib)
 
 # Files named "libfoo.a" may actually be shared libraries.
-SET_PROPERTY(GLOBAL PROPERTY TARGET_ARCHIVES_MAY_BE_SHARED_LIBS 1)
+set_property(GLOBAL PROPERTY TARGET_ARCHIVES_MAY_BE_SHARED_LIBS 1)
 
 # since .a can be a static or shared library on AIX, we can not do this.
 # at some point if we wanted it, we would have to figure out if a .a is
@@ -21,9 +21,9 @@ SET_PROPERTY(GLOBAL PROPERTY TARGET_ARCHIVES_MAY_BE_SHARED_LIBS 1)
 # building a shared library, shared module, or executable that links
 # to other libraries to select whether to use the static or shared
 # versions of the libraries.
-#FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
-#  SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-bstatic")
-#  SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-bdynamic")
-#ENDFOREACH(type)
+#foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+#  set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-bstatic")
+#  set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-bdynamic")
+#endforeach(type)
 
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/BSDOS.cmake b/Modules/Platform/BSDOS.cmake
index cf9d17bfd..47852f8e1 100644
--- a/Modules/Platform/BSDOS.cmake
+++ b/Modules/Platform/BSDOS.cmake
@@ -1,2 +1,2 @@
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
 
diff --git a/Modules/Platform/BeOS.cmake b/Modules/Platform/BeOS.cmake
index 3ffb67cb8..ef811bd9c 100644
--- a/Modules/Platform/BeOS.cmake
+++ b/Modules/Platform/BeOS.cmake
@@ -1,12 +1,12 @@
-SET(BEOS 1)
+set(BEOS 1)
 
-SET(CMAKE_DL_LIBS root be)
-SET(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
-SET(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-nostart")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
-SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
+set(CMAKE_DL_LIBS root be)
+set(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
+set(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-nostart")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
+set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
 
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/BlueGeneL.cmake b/Modules/Platform/BlueGeneL.cmake
index 4021147e7..b2158f5d7 100644
--- a/Modules/Platform/BlueGeneL.cmake
+++ b/Modules/Platform/BlueGeneL.cmake
@@ -1,40 +1,40 @@
 #the compute nodes on BlueGene/L don't support shared libs
-SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
+set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
 
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "")            # -pic
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "")       # -shared
-SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")         # +s, flag for exe link to use shared lib
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "")       # -rpath
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "")   # : or empty
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "")            # -pic
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "")       # -shared
+set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")         # +s, flag for exe link to use shared lib
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "")       # -rpath
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "")   # : or empty
 
-SET(CMAKE_LINK_LIBRARY_SUFFIX "")
-SET(CMAKE_STATIC_LIBRARY_PREFIX "lib")
-SET(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
-SET(CMAKE_SHARED_LIBRARY_PREFIX "lib")          # lib
-SET(CMAKE_SHARED_LIBRARY_SUFFIX ".a")           # .a
-SET(CMAKE_EXECUTABLE_SUFFIX "")          # .exe
-SET(CMAKE_DL_LIBS "" )
+set(CMAKE_LINK_LIBRARY_SUFFIX "")
+set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
+set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
+set(CMAKE_SHARED_LIBRARY_PREFIX "lib")          # lib
+set(CMAKE_SHARED_LIBRARY_SUFFIX ".a")           # .a
+set(CMAKE_EXECUTABLE_SUFFIX "")          # .exe
+set(CMAKE_DL_LIBS "" )
 
-SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
-SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
+set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
 
 
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
 
-IF(CMAKE_COMPILER_IS_GNUCC)
-  SET(CMAKE_C_LINK_EXECUTABLE
+if(CMAKE_COMPILER_IS_GNUCC)
+  set(CMAKE_C_LINK_EXECUTABLE
     "<CMAKE_C_COMPILER> -Wl,-relax <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS>  -o <TARGET> <LINK_LIBRARIES> -Wl,-lgcc,-lc -lnss_files -lnss_dns -lresolv")
-ELSE(CMAKE_COMPILER_IS_GNUCC)
+else(CMAKE_COMPILER_IS_GNUCC)
   # when using IBM xlc we probably don't want to link to -lgcc
-  SET(CMAKE_C_LINK_EXECUTABLE
+  set(CMAKE_C_LINK_EXECUTABLE
     "<CMAKE_C_COMPILER> -Wl,-relax <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS>  -o <TARGET> <LINK_LIBRARIES> -Wl,-lc -lnss_files -lnss_dns -lresolv")
-ENDIF(CMAKE_COMPILER_IS_GNUCC)
+endif(CMAKE_COMPILER_IS_GNUCC)
 
-IF(CMAKE_COMPILER_IS_GNUCXX)
-  SET(CMAKE_CXX_LINK_EXECUTABLE
+if(CMAKE_COMPILER_IS_GNUCXX)
+  set(CMAKE_CXX_LINK_EXECUTABLE
     "<CMAKE_CXX_COMPILER> -Wl,-relax <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS>  -o <TARGET> <LINK_LIBRARIES> -Wl,-lstdc++,-lgcc,-lc -lnss_files -lnss_dns -lresolv")
-ELSE(CMAKE_COMPILER_IS_GNUCXX)
+else(CMAKE_COMPILER_IS_GNUCXX)
   # when using the IBM xlC we probably don't want to link to -lgcc
-  SET(CMAKE_CXX_LINK_EXECUTABLE
+  set(CMAKE_CXX_LINK_EXECUTABLE
     "<CMAKE_CXX_COMPILER> -Wl,-relax <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS>  -o <TARGET> <LINK_LIBRARIES> -Wl,-lstdc++,-lc -lnss_files -lnss_dns -lresolv")
-ENDIF(CMAKE_COMPILER_IS_GNUCXX)
+endif(CMAKE_COMPILER_IS_GNUCXX)
diff --git a/Modules/Platform/CYGWIN-GNU.cmake b/Modules/Platform/CYGWIN-GNU.cmake
index eae313a50..2ec22191d 100644
--- a/Modules/Platform/CYGWIN-GNU.cmake
+++ b/Modules/Platform/CYGWIN-GNU.cmake
@@ -44,10 +44,10 @@ macro(__cygwin_compiler_gnu lang)
   # building a shared library, shared module, or executable that links
   # to other libraries to select whether to use the static or shared
   # versions of the libraries.
-  FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
-    SET(CMAKE_${type}_LINK_STATIC_${lang}_FLAGS "-Wl,-Bstatic")
-    SET(CMAKE_${type}_LINK_DYNAMIC_${lang}_FLAGS "-Wl,-Bdynamic")
-  ENDFOREACH(type)
+  foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+    set(CMAKE_${type}_LINK_STATIC_${lang}_FLAGS "-Wl,-Bstatic")
+    set(CMAKE_${type}_LINK_DYNAMIC_${lang}_FLAGS "-Wl,-Bdynamic")
+  endforeach(type)
 
   set(CMAKE_EXE_EXPORTS_${lang}_FLAG "-Wl,--export-all-symbols")
   # TODO: Is -Wl,--enable-auto-import now always default?
diff --git a/Modules/Platform/CYGWIN-windres.cmake b/Modules/Platform/CYGWIN-windres.cmake
index 8bc1b15e9..01d6be3df 100644
--- a/Modules/Platform/CYGWIN-windres.cmake
+++ b/Modules/Platform/CYGWIN-windres.cmake
@@ -1 +1 @@
-SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <FLAGS> <DEFINES> <SOURCE> <OBJECT>")
+set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <FLAGS> <DEFINES> <SOURCE> <OBJECT>")
diff --git a/Modules/Platform/CYGWIN.cmake b/Modules/Platform/CYGWIN.cmake
index b7ad2cee1..22816e77a 100644
--- a/Modules/Platform/CYGWIN.cmake
+++ b/Modules/Platform/CYGWIN.cmake
@@ -43,22 +43,22 @@ if(DEFINED __USE_CMAKE_LEGACY_CYGWIN_WIN32)
   unset(__USE_CMAKE_LEGACY_CYGWIN_WIN32)
 endif()
 
-SET(CYGWIN 1)
+set(CYGWIN 1)
 
-SET(CMAKE_SHARED_LIBRARY_PREFIX "cyg")
-SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dll")
-SET(CMAKE_SHARED_MODULE_PREFIX "cyg")
-SET(CMAKE_SHARED_MODULE_SUFFIX ".dll")
-SET(CMAKE_IMPORT_LIBRARY_PREFIX "lib")
-SET(CMAKE_IMPORT_LIBRARY_SUFFIX ".dll.a")
-SET(CMAKE_EXECUTABLE_SUFFIX ".exe")          # .exe
+set(CMAKE_SHARED_LIBRARY_PREFIX "cyg")
+set(CMAKE_SHARED_LIBRARY_SUFFIX ".dll")
+set(CMAKE_SHARED_MODULE_PREFIX "cyg")
+set(CMAKE_SHARED_MODULE_SUFFIX ".dll")
+set(CMAKE_IMPORT_LIBRARY_PREFIX "lib")
+set(CMAKE_IMPORT_LIBRARY_SUFFIX ".dll.a")
+set(CMAKE_EXECUTABLE_SUFFIX ".exe")          # .exe
 # Modules have a different default prefix that shared libs.
-SET(CMAKE_MODULE_EXISTS 1)
+set(CMAKE_MODULE_EXISTS 1)
 
-SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
-SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".a")
+set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".a")
 
 # Shared libraries on cygwin can be named with their version number.
-SET(CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION 1)
+set(CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION 1)
 
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/Catamount.cmake b/Modules/Platform/Catamount.cmake
index cf672c9ce..7e9e02171 100644
--- a/Modules/Platform/Catamount.cmake
+++ b/Modules/Platform/Catamount.cmake
@@ -1,26 +1,26 @@
 #Catamount, which runs on the compute nodes of Cray machines, e.g. RedStorm, doesn't support shared libs
-SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
+set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
 
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "")            # -pic
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "")       # -shared
-SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")         # +s, flag for exe link to use shared lib
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "")       # -rpath
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "")   # : or empty
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "")            # -pic
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "")       # -shared
+set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")         # +s, flag for exe link to use shared lib
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "")       # -rpath
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "")   # : or empty
 
-SET(CMAKE_LINK_LIBRARY_SUFFIX "")
-SET(CMAKE_STATIC_LIBRARY_PREFIX "lib")
-SET(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
-SET(CMAKE_SHARED_LIBRARY_PREFIX "lib")          # lib
-SET(CMAKE_SHARED_LIBRARY_SUFFIX ".a")           # .a
-SET(CMAKE_EXECUTABLE_SUFFIX "")          # .exe
-SET(CMAKE_DL_LIBS "" )
+set(CMAKE_LINK_LIBRARY_SUFFIX "")
+set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
+set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
+set(CMAKE_SHARED_LIBRARY_PREFIX "lib")          # lib
+set(CMAKE_SHARED_LIBRARY_SUFFIX ".a")           # .a
+set(CMAKE_EXECUTABLE_SUFFIX "")          # .exe
+set(CMAKE_DL_LIBS "" )
 
-SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
-SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
+set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
 
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
 
-SET(CMAKE_CXX_LINK_SHARED_LIBRARY)
-SET(CMAKE_CXX_LINK_MODULE_LIBRARY)
-SET(CMAKE_C_LINK_SHARED_LIBRARY)
-SET(CMAKE_C_LINK_MODULE_LIBRARY)
+set(CMAKE_CXX_LINK_SHARED_LIBRARY)
+set(CMAKE_CXX_LINK_MODULE_LIBRARY)
+set(CMAKE_C_LINK_SHARED_LIBRARY)
+set(CMAKE_C_LINK_MODULE_LIBRARY)
diff --git a/Modules/Platform/Darwin-GNU.cmake b/Modules/Platform/Darwin-GNU.cmake
index 8a50a6ab9..5e9f8f096 100644
--- a/Modules/Platform/Darwin-GNU.cmake
+++ b/Modules/Platform/Darwin-GNU.cmake
@@ -59,6 +59,6 @@ macro(cmake_gnu_set_osx_deployment_target_flag lang)
       message(STATUS "Checking whether ${_doc} - no")
       set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "")
     endif()
-    set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG_CODE "SET(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG \"${CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG}\")")
+    set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG_CODE "set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG \"${CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG}\")")
   endif()
 endmacro()
diff --git a/Modules/Platform/Darwin-XL-C.cmake b/Modules/Platform/Darwin-XL-C.cmake
index 934ebcc8c..42e94a9d6 100644
--- a/Modules/Platform/Darwin-XL-C.cmake
+++ b/Modules/Platform/Darwin-XL-C.cmake
@@ -1,5 +1,5 @@
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-qmkshrobj")
-SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle")
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-qmkshrobj")
+set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle")
 
 # Enable shared library versioning.
-SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-install_name")
+set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-install_name")
diff --git a/Modules/Platform/Darwin-XL-CXX.cmake b/Modules/Platform/Darwin-XL-CXX.cmake
index 22ae0183a..65c76f8b7 100644
--- a/Modules/Platform/Darwin-XL-CXX.cmake
+++ b/Modules/Platform/Darwin-XL-CXX.cmake
@@ -1,5 +1,5 @@
-SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-qmkshrobj")
-SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS "-bundle")
+set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-qmkshrobj")
+set(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS "-bundle")
 
 # Enable shared library versioning.
-SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-Wl,-install_name")
+set(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-Wl,-install_name")
diff --git a/Modules/Platform/Darwin-icc.cmake b/Modules/Platform/Darwin-icc.cmake
index 621905c41..b8e1bdfba 100644
--- a/Modules/Platform/Darwin-icc.cmake
+++ b/Modules/Platform/Darwin-icc.cmake
@@ -1,102 +1,102 @@
-SET(CMAKE_C_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS "" )
-SET(CMAKE_CXX_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS "")
+set(CMAKE_C_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS "" )
+set(CMAKE_CXX_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS "")
 
 # Setup for Leopard Compatibility
-EXEC_PROGRAM(sw_vers ARGS -productVersion OUTPUT_VARIABLE _OSX_VERSION)
-# MESSAGE (STATUS "_OSX_VERSION: ${_OSX_VERSION}")
-IF ( _OSX_VERSION MATCHES "^10.4" )
-  #IF(CMAKE_COMPILER_IS_GNUCC)
-    SET (CMAKE_C_FLAGS_INIT "")
-    SET (CMAKE_C_FLAGS_DEBUG_INIT "-gdwarf-2")
-    SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
-    SET (CMAKE_C_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
-    SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -gdwarf-2")
-    SET (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
-    SET (CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
- # ENDIF(CMAKE_COMPILER_IS_GNUCC)
+exec_program(sw_vers ARGS -productVersion OUTPUT_VARIABLE _OSX_VERSION)
+# message (STATUS "_OSX_VERSION: ${_OSX_VERSION}")
+if ( _OSX_VERSION MATCHES "^10.4" )
+  #if(CMAKE_COMPILER_IS_GNUCC)
+    set (CMAKE_C_FLAGS_INIT "")
+    set (CMAKE_C_FLAGS_DEBUG_INIT "-gdwarf-2")
+    set (CMAKE_C_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
+    set (CMAKE_C_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
+    set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -gdwarf-2")
+    set (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+    set (CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
+ # endif(CMAKE_COMPILER_IS_GNUCC)
 
-#  IF(CMAKE_COMPILER_IS_GNUCXX)
-    SET (CMAKE_CXX_FLAGS_INIT "")
-    SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-gdwarf-2")
-    SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
-    SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
-    SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -gdwarf-2")
-    SET (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
-    SET (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
-#  ENDIF(CMAKE_COMPILER_IS_GNUCXX)
-ENDIF ( _OSX_VERSION MATCHES "^10.4" )
+#  if(CMAKE_COMPILER_IS_GNUCXX)
+    set (CMAKE_CXX_FLAGS_INIT "")
+    set (CMAKE_CXX_FLAGS_DEBUG_INIT "-gdwarf-2")
+    set (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
+    set (CMAKE_CXX_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
+    set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -gdwarf-2")
+    set (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+    set (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
+#  endif(CMAKE_COMPILER_IS_GNUCXX)
+endif ( _OSX_VERSION MATCHES "^10.4" )
 
 
-SET(CMAKE_SHARED_LIBRARY_PREFIX "lib")
-SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dylib")
-SET(CMAKE_SHARED_MODULE_PREFIX "lib")
-SET(CMAKE_SHARED_MODULE_SUFFIX ".so")
-SET(CMAKE_MODULE_EXISTS 1)
-SET(CMAKE_DL_LIBS "")
-SET(CMAKE_C_LINK_FLAGS "-Wl,-headerpad_max_install_names")
-SET(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names")
-SET(CMAKE_PLATFORM_HAS_INSTALLNAME 1)
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names")
-SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -Wl,-headerpad_max_install_names")
-SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a")
+set(CMAKE_SHARED_LIBRARY_PREFIX "lib")
+set(CMAKE_SHARED_LIBRARY_SUFFIX ".dylib")
+set(CMAKE_SHARED_MODULE_PREFIX "lib")
+set(CMAKE_SHARED_MODULE_SUFFIX ".so")
+set(CMAKE_MODULE_EXISTS 1)
+set(CMAKE_DL_LIBS "")
+set(CMAKE_C_LINK_FLAGS "-Wl,-headerpad_max_install_names")
+set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names")
+set(CMAKE_PLATFORM_HAS_INSTALLNAME 1)
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names")
+set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -Wl,-headerpad_max_install_names")
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a")
 
 
 # setup for universal binaries if sysroot exists
-IF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk)
+if(EXISTS /Developer/SDKs/MacOSX10.4u.sdk)
   # set the sysroot to be used if CMAKE_OSX_ARCHITECTURES
   # has more than one value
-  SET(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.4u.sdk CACHE STRING
+  set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.4u.sdk CACHE STRING
     "isysroot used for universal binary support")
   # set _CMAKE_OSX_MACHINE to umame -m
-  EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE _CMAKE_OSX_MACHINE)
+  exec_program(uname ARGS -m OUTPUT_VARIABLE _CMAKE_OSX_MACHINE)
 
   # check for environment variable CMAKE_OSX_ARCHITECTURES
   # if it is set.
-  IF(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
-    SET(_CMAKE_OSX_MACHINE "$ENV{CMAKE_OSX_ARCHITECTURES}")
-  ENDIF(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
+  if(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
+    set(_CMAKE_OSX_MACHINE "$ENV{CMAKE_OSX_ARCHITECTURES}")
+  endif(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
   # now put _CMAKE_OSX_MACHINE into the cache
-  SET(CMAKE_OSX_ARCHITECTURES ${_CMAKE_OSX_MACHINE}
+  set(CMAKE_OSX_ARCHITECTURES ${_CMAKE_OSX_MACHINE}
     CACHE STRING "Build architectures for OSX")
-ENDIF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk)
+endif(EXISTS /Developer/SDKs/MacOSX10.4u.sdk)
 
 
-IF("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$")
-  SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
+if("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$")
+  set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
     "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -flat_namespace -undefined suppress")
-ENDIF("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$")
+endif("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$")
 
-IF(NOT XCODE)
+if(NOT XCODE)
   # Enable shared library versioning.  This flag is not actually referenced
   # but the fact that the setting exists will cause the generators to support
   # soname computation.
-  SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name")
-  SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-install_name")
-  SET(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG "-install_name")
-ENDIF(NOT XCODE)
+  set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name")
+  set(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-install_name")
+  set(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG "-install_name")
+endif(NOT XCODE)
 
 # Xcode does not support -isystem yet.
-IF(XCODE)
-  SET(CMAKE_INCLUDE_SYSTEM_FLAG_C)
-  SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
-ENDIF(XCODE)
+if(XCODE)
+  set(CMAKE_INCLUDE_SYSTEM_FLAG_C)
+  set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
+endif(XCODE)
 
-SET(CMAKE_MacOSX_Content_COMPILE_OBJECT "\"${CMAKE_COMMAND}\" -E copy_if_different <SOURCE> <OBJECT>")
+set(CMAKE_MacOSX_Content_COMPILE_OBJECT "\"${CMAKE_COMMAND}\" -E copy_if_different <SOURCE> <OBJECT>")
 
-SET(CMAKE_C_CREATE_SHARED_LIBRARY
+set(CMAKE_C_CREATE_SHARED_LIBRARY
   "<CMAKE_C_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
-SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
+set(CMAKE_CXX_CREATE_SHARED_LIBRARY
   "<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
-SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY
+set(CMAKE_Fortran_CREATE_SHARED_LIBRARY
   "<CMAKE_Fortran_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
 
-SET(CMAKE_CXX_CREATE_SHARED_MODULE
+set(CMAKE_CXX_CREATE_SHARED_MODULE
       "<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
 
-SET(CMAKE_C_CREATE_SHARED_MODULE
+set(CMAKE_C_CREATE_SHARED_MODULE
       "<CMAKE_C_COMPILER>  <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_MODULE_CREATE_C_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
 
-SET(CMAKE_Fortran_CREATE_SHARED_MODULE
+set(CMAKE_Fortran_CREATE_SHARED_MODULE
       "<CMAKE_Fortran_COMPILER>  <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
 
 
@@ -106,26 +106,26 @@ SET(CMAKE_Fortran_CREATE_SHARED_MODULE
 
 
 # default to searching for frameworks first
-IF(NOT DEFINED CMAKE_FIND_FRAMEWORK)
-  SET(CMAKE_FIND_FRAMEWORK FIRST)
-ENDIF()
+if(NOT DEFINED CMAKE_FIND_FRAMEWORK)
+  set(CMAKE_FIND_FRAMEWORK FIRST)
+endif()
 # set up the default search directories for frameworks
-SET(CMAKE_SYSTEM_FRAMEWORK_PATH
+set(CMAKE_SYSTEM_FRAMEWORK_PATH
   ~/Library/Frameworks
   /Library/Frameworks
   /Network/Library/Frameworks
   /System/Library/Frameworks)
 
 # default to searching for application bundles first
-IF(NOT DEFINED CMAKE_FIND_APPBUNDLE)
-  SET(CMAKE_FIND_APPBUNDLE FIRST)
-ENDIF()
+if(NOT DEFINED CMAKE_FIND_APPBUNDLE)
+  set(CMAKE_FIND_APPBUNDLE FIRST)
+endif()
 # set up the default search directories for application bundles
-SET(CMAKE_SYSTEM_APPBUNDLE_PATH
+set(CMAKE_SYSTEM_APPBUNDLE_PATH
   ~/Applications
   /Applications
   /Developer/Applications)
 
-INCLUDE(Platform/UnixPaths)
-SET(CMAKE_SYSTEM_INCLUDE_PATH ${CMAKE_SYSTEM_INCLUDE_PATH} /sw/include)
-SET(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH} /sw/lib)
+include(Platform/UnixPaths)
+set(CMAKE_SYSTEM_INCLUDE_PATH ${CMAKE_SYSTEM_INCLUDE_PATH} /sw/include)
+set(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH} /sw/lib)
diff --git a/Modules/Platform/Darwin-icpc.cmake b/Modules/Platform/Darwin-icpc.cmake
index e247bae28..549feb7f5 100644
--- a/Modules/Platform/Darwin-icpc.cmake
+++ b/Modules/Platform/Darwin-icpc.cmake
@@ -1,3 +1,3 @@
-GET_FILENAME_COMPONENT(CURRENT_SOURCE_PARENT ${CMAKE_CURRENT_LIST_FILE} PATH)
-#MESSAGE (STATUS "CURRENT_SOURCE_PARENT: ${CURRENT_SOURCE_PARENT}")
-INCLUDE ( ${CURRENT_SOURCE_PARENT}/Darwin-icc.cmake)
+get_filename_component(CURRENT_SOURCE_PARENT ${CMAKE_CURRENT_LIST_FILE} PATH)
+#message (STATUS "CURRENT_SOURCE_PARENT: ${CURRENT_SOURCE_PARENT}")
+include ( ${CURRENT_SOURCE_PARENT}/Darwin-icc.cmake)
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index eff07b295..8e665d1cd 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -1,4 +1,4 @@
-SET(APPLE 1)
+set(APPLE 1)
 
 # Darwin versions:
 #   6.x == Mac OSX 10.2 (Jaguar)
@@ -8,131 +8,131 @@ SET(APPLE 1)
 #  10.x == Mac OSX 10.6 (Snow Leopard)
 #  11.x == Mac OSX 10.7 (Lion)
 #  12.x == Mac OSX 10.8 (Mountain Lion)
-STRING(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\1" DARWIN_MAJOR_VERSION "${CMAKE_SYSTEM_VERSION}")
-STRING(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\2" DARWIN_MINOR_VERSION "${CMAKE_SYSTEM_VERSION}")
+string(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\1" DARWIN_MAJOR_VERSION "${CMAKE_SYSTEM_VERSION}")
+string(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\2" DARWIN_MINOR_VERSION "${CMAKE_SYSTEM_VERSION}")
 
 # Do not use the "-Wl,-search_paths_first" flag with the OSX 10.2 compiler.
 # Done this way because it is too early to do a TRY_COMPILE.
-IF(NOT DEFINED HAVE_FLAG_SEARCH_PATHS_FIRST)
-  SET(HAVE_FLAG_SEARCH_PATHS_FIRST 0)
-  IF("${DARWIN_MAJOR_VERSION}" GREATER 6)
-    SET(HAVE_FLAG_SEARCH_PATHS_FIRST 1)
-  ENDIF("${DARWIN_MAJOR_VERSION}" GREATER 6)
-ENDIF(NOT DEFINED HAVE_FLAG_SEARCH_PATHS_FIRST)
+if(NOT DEFINED HAVE_FLAG_SEARCH_PATHS_FIRST)
+  set(HAVE_FLAG_SEARCH_PATHS_FIRST 0)
+  if("${DARWIN_MAJOR_VERSION}" GREATER 6)
+    set(HAVE_FLAG_SEARCH_PATHS_FIRST 1)
+  endif("${DARWIN_MAJOR_VERSION}" GREATER 6)
+endif(NOT DEFINED HAVE_FLAG_SEARCH_PATHS_FIRST)
 # More desirable, but does not work:
-  #INCLUDE(CheckCXXCompilerFlag)
+  #include(CheckCXXCompilerFlag)
   #CHECK_CXX_COMPILER_FLAG("-Wl,-search_paths_first" HAVE_FLAG_SEARCH_PATHS_FIRST)
 
-SET(CMAKE_SHARED_LIBRARY_PREFIX "lib")
-SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dylib")
-SET(CMAKE_SHARED_MODULE_PREFIX "lib")
-SET(CMAKE_SHARED_MODULE_SUFFIX ".so")
-SET(CMAKE_MODULE_EXISTS 1)
-SET(CMAKE_DL_LIBS "")
+set(CMAKE_SHARED_LIBRARY_PREFIX "lib")
+set(CMAKE_SHARED_LIBRARY_SUFFIX ".dylib")
+set(CMAKE_SHARED_MODULE_PREFIX "lib")
+set(CMAKE_SHARED_MODULE_SUFFIX ".so")
+set(CMAKE_MODULE_EXISTS 1)
+set(CMAKE_DL_LIBS "")
 
-SET(CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ")
-SET(CMAKE_C_OSX_CURRENT_VERSION_FLAG "-current_version ")
-SET(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}")
-SET(CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}")
+set(CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ")
+set(CMAKE_C_OSX_CURRENT_VERSION_FLAG "-current_version ")
+set(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}")
+set(CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}")
 
-SET(CMAKE_C_LINK_FLAGS "-Wl,-headerpad_max_install_names")
-SET(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names")
+set(CMAKE_C_LINK_FLAGS "-Wl,-headerpad_max_install_names")
+set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names")
 
-IF(HAVE_FLAG_SEARCH_PATHS_FIRST)
-  SET(CMAKE_C_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}")
-  SET(CMAKE_CXX_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}")
-ENDIF(HAVE_FLAG_SEARCH_PATHS_FIRST)
+if(HAVE_FLAG_SEARCH_PATHS_FIRST)
+  set(CMAKE_C_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}")
+  set(CMAKE_CXX_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}")
+endif(HAVE_FLAG_SEARCH_PATHS_FIRST)
 
-SET(CMAKE_PLATFORM_HAS_INSTALLNAME 1)
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names")
-SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -Wl,-headerpad_max_install_names")
-SET(CMAKE_SHARED_MODULE_LOADER_C_FLAG "-Wl,-bundle_loader,")
-SET(CMAKE_SHARED_MODULE_LOADER_CXX_FLAG "-Wl,-bundle_loader,")
-SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a")
+set(CMAKE_PLATFORM_HAS_INSTALLNAME 1)
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names")
+set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -Wl,-headerpad_max_install_names")
+set(CMAKE_SHARED_MODULE_LOADER_C_FLAG "-Wl,-bundle_loader,")
+set(CMAKE_SHARED_MODULE_LOADER_CXX_FLAG "-Wl,-bundle_loader,")
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a")
 
 # hack: if a new cmake (which uses CMAKE_INSTALL_NAME_TOOL) runs on an old build tree
 # (where install_name_tool was hardcoded) and where CMAKE_INSTALL_NAME_TOOL isn't in the cache
 # and still cmake didn't fail in CMakeFindBinUtils.cmake (because it isn't rerun)
 # hardcode CMAKE_INSTALL_NAME_TOOL here to install_name_tool, so it behaves as it did before, Alex
-IF(NOT DEFINED CMAKE_INSTALL_NAME_TOOL)
-  FIND_PROGRAM(CMAKE_INSTALL_NAME_TOOL install_name_tool)
-  MARK_AS_ADVANCED(CMAKE_INSTALL_NAME_TOOL)
-ENDIF(NOT DEFINED CMAKE_INSTALL_NAME_TOOL)
+if(NOT DEFINED CMAKE_INSTALL_NAME_TOOL)
+  find_program(CMAKE_INSTALL_NAME_TOOL install_name_tool)
+  mark_as_advanced(CMAKE_INSTALL_NAME_TOOL)
+endif(NOT DEFINED CMAKE_INSTALL_NAME_TOOL)
 
 # Set the assumed (Pre 10.5 or Default) location of the developer tools
-SET(OSX_DEVELOPER_ROOT "/Developer")
+set(OSX_DEVELOPER_ROOT "/Developer")
 
 # Use the xcode-select tool if it's available (Xcode >= 3.0 installations)
-FIND_PROGRAM(CMAKE_XCODE_SELECT xcode-select)
-MARK_AS_ADVANCED(CMAKE_XCODE_SELECT)
-IF(CMAKE_XCODE_SELECT)
-  EXECUTE_PROCESS(COMMAND ${CMAKE_XCODE_SELECT} "-print-path"
+find_program(CMAKE_XCODE_SELECT xcode-select)
+mark_as_advanced(CMAKE_XCODE_SELECT)
+if(CMAKE_XCODE_SELECT)
+  execute_process(COMMAND ${CMAKE_XCODE_SELECT} "-print-path"
     OUTPUT_VARIABLE OSX_DEVELOPER_ROOT
     OUTPUT_STRIP_TRAILING_WHITESPACE)
-ENDIF(CMAKE_XCODE_SELECT)
+endif(CMAKE_XCODE_SELECT)
 
 # Find installed SDKs
 # Start with Xcode-4.3+ default SDKs directory
-SET(_CMAKE_OSX_SDKS_DIR
+set(_CMAKE_OSX_SDKS_DIR
   "${OSX_DEVELOPER_ROOT}/Platforms/MacOSX.platform/Developer/SDKs")
-FILE(GLOB _CMAKE_OSX_SDKS "${_CMAKE_OSX_SDKS_DIR}/*")
+file(GLOB _CMAKE_OSX_SDKS "${_CMAKE_OSX_SDKS_DIR}/*")
 
 # If not present, try pre-4.3 SDKs directory
-IF(NOT _CMAKE_OSX_SDKS)
-SET(_CMAKE_OSX_SDKS_DIR "${OSX_DEVELOPER_ROOT}/SDKs")
-  FILE(GLOB _CMAKE_OSX_SDKS "${_CMAKE_OSX_SDKS_DIR}/*")
-ENDIF(NOT _CMAKE_OSX_SDKS)
+if(NOT _CMAKE_OSX_SDKS)
+set(_CMAKE_OSX_SDKS_DIR "${OSX_DEVELOPER_ROOT}/SDKs")
+  file(GLOB _CMAKE_OSX_SDKS "${_CMAKE_OSX_SDKS_DIR}/*")
+endif(NOT _CMAKE_OSX_SDKS)
 
-EXECUTE_PROCESS(COMMAND sw_vers -productVersion
+execute_process(COMMAND sw_vers -productVersion
   OUTPUT_VARIABLE CURRENT_OSX_VERSION
   OUTPUT_STRIP_TRAILING_WHITESPACE)
 
 #----------------------------------------------------------------------------
 # _CURRENT_OSX_VERSION - as a two-component string: 10.5, 10.6, ...
 #
-STRING(REGEX REPLACE "^([0-9]+\\.[0-9]+).*$" "\\1"
+string(REGEX REPLACE "^([0-9]+\\.[0-9]+).*$" "\\1"
   _CURRENT_OSX_VERSION "${CURRENT_OSX_VERSION}")
 
 #----------------------------------------------------------------------------
 # CMAKE_OSX_DEPLOYMENT_TARGET
 
 # Set cache variable - end user may change this during ccmake or cmake-gui configure.
-IF(_CURRENT_OSX_VERSION VERSION_GREATER 10.3)
-  SET(CMAKE_OSX_DEPLOYMENT_TARGET "$ENV{MACOSX_DEPLOYMENT_TARGET}" CACHE STRING
+if(_CURRENT_OSX_VERSION VERSION_GREATER 10.3)
+  set(CMAKE_OSX_DEPLOYMENT_TARGET "$ENV{MACOSX_DEPLOYMENT_TARGET}" CACHE STRING
     "Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value.")
-ENDIF(_CURRENT_OSX_VERSION VERSION_GREATER 10.3)
+endif(_CURRENT_OSX_VERSION VERSION_GREATER 10.3)
 
 #----------------------------------------------------------------------------
 # CMAKE_OSX_SYSROOT
 
 # Environment variable set by the user overrides our default.
 # Use the same environment variable that Xcode uses.
-SET(ENV_SDKROOT "$ENV{SDKROOT}")
+set(ENV_SDKROOT "$ENV{SDKROOT}")
 
 # Set CMAKE_OSX_SYSROOT_DEFAULT based on _CURRENT_OSX_VERSION,
 # accounting for the known specially named SDKs.
-SET(CMAKE_OSX_SYSROOT_DEFAULT
+set(CMAKE_OSX_SYSROOT_DEFAULT
   "${_CMAKE_OSX_SDKS_DIR}/MacOSX${_CURRENT_OSX_VERSION}.sdk")
 
-IF(_CURRENT_OSX_VERSION STREQUAL "10.4")
-  SET(CMAKE_OSX_SYSROOT_DEFAULT
+if(_CURRENT_OSX_VERSION STREQUAL "10.4")
+  set(CMAKE_OSX_SYSROOT_DEFAULT
     "${_CMAKE_OSX_SDKS_DIR}/MacOSX10.4u.sdk")
-ENDIF(_CURRENT_OSX_VERSION STREQUAL "10.4")
+endif(_CURRENT_OSX_VERSION STREQUAL "10.4")
 
-IF(_CURRENT_OSX_VERSION STREQUAL "10.3")
-  SET(CMAKE_OSX_SYSROOT_DEFAULT
+if(_CURRENT_OSX_VERSION STREQUAL "10.3")
+  set(CMAKE_OSX_SYSROOT_DEFAULT
     "${_CMAKE_OSX_SDKS_DIR}/MacOSX10.3.9.sdk")
-ENDIF(_CURRENT_OSX_VERSION STREQUAL "10.3")
+endif(_CURRENT_OSX_VERSION STREQUAL "10.3")
 
 # Use environment or default as initial cache value:
-IF(NOT ENV_SDKROOT STREQUAL "")
-  SET(CMAKE_OSX_SYSROOT_VALUE ${ENV_SDKROOT})
-ELSE(NOT ENV_SDKROOT STREQUAL "")
-  SET(CMAKE_OSX_SYSROOT_VALUE ${CMAKE_OSX_SYSROOT_DEFAULT})
-ENDIF(NOT ENV_SDKROOT STREQUAL "")
+if(NOT ENV_SDKROOT STREQUAL "")
+  set(CMAKE_OSX_SYSROOT_VALUE ${ENV_SDKROOT})
+else(NOT ENV_SDKROOT STREQUAL "")
+  set(CMAKE_OSX_SYSROOT_VALUE ${CMAKE_OSX_SYSROOT_DEFAULT})
+endif(NOT ENV_SDKROOT STREQUAL "")
 
 # Set cache variable - end user may change this during ccmake or cmake-gui configure.
-SET(CMAKE_OSX_SYSROOT ${CMAKE_OSX_SYSROOT_VALUE} CACHE PATH
+set(CMAKE_OSX_SYSROOT ${CMAKE_OSX_SYSROOT_VALUE} CACHE PATH
   "The product will be built against the headers and libraries located inside the indicated SDK.")
 
 #----------------------------------------------------------------------------
@@ -156,113 +156,113 @@ endfunction(SanityCheckSDKAndDeployTarget)
 SanityCheckSDKAndDeployTarget("${CMAKE_OSX_SYSROOT}" "${CMAKE_OSX_DEPLOYMENT_TARGET}")
 
 # set _CMAKE_OSX_MACHINE to uname -m
-EXECUTE_PROCESS(COMMAND uname -m
+execute_process(COMMAND uname -m
   OUTPUT_STRIP_TRAILING_WHITESPACE
   OUTPUT_VARIABLE _CMAKE_OSX_MACHINE)
 
 # check for Power PC and change to ppc
-IF(_CMAKE_OSX_MACHINE MATCHES "Power")
-  SET(_CMAKE_OSX_MACHINE ppc)
-ENDIF(_CMAKE_OSX_MACHINE MATCHES "Power")
+if(_CMAKE_OSX_MACHINE MATCHES "Power")
+  set(_CMAKE_OSX_MACHINE ppc)
+endif(_CMAKE_OSX_MACHINE MATCHES "Power")
 
 # check for environment variable CMAKE_OSX_ARCHITECTURES
 # if it is set.
-IF(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
-  SET(CMAKE_OSX_ARCHITECTURES_VALUE "$ENV{CMAKE_OSX_ARCHITECTURES}")
-ELSE(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
-  SET(CMAKE_OSX_ARCHITECTURES_VALUE "")
-ENDIF(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
+if(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
+  set(CMAKE_OSX_ARCHITECTURES_VALUE "$ENV{CMAKE_OSX_ARCHITECTURES}")
+else(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
+  set(CMAKE_OSX_ARCHITECTURES_VALUE "")
+endif(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
 
 # now put _CMAKE_OSX_MACHINE into the cache
-SET(CMAKE_OSX_ARCHITECTURES ${CMAKE_OSX_ARCHITECTURES_VALUE} CACHE STRING
+set(CMAKE_OSX_ARCHITECTURES ${CMAKE_OSX_ARCHITECTURES_VALUE} CACHE STRING
   "Build architectures for OSX")
 
 
-IF("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$")
-  SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
+if("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$")
+  set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
     "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -flat_namespace -undefined suppress")
-ENDIF("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$")
+endif("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$")
 
-IF(NOT XCODE)
+if(NOT XCODE)
   # Enable shared library versioning.  This flag is not actually referenced
   # but the fact that the setting exists will cause the generators to support
   # soname computation.
-  SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name")
-ENDIF(NOT XCODE)
+  set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name")
+endif(NOT XCODE)
 
 # Xcode does not support -isystem yet.
-IF(XCODE)
-  SET(CMAKE_INCLUDE_SYSTEM_FLAG_C)
-  SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
-ENDIF(XCODE)
+if(XCODE)
+  set(CMAKE_INCLUDE_SYSTEM_FLAG_C)
+  set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
+endif(XCODE)
 
-IF("${_CURRENT_OSX_VERSION}" VERSION_LESS "10.5")
+if("${_CURRENT_OSX_VERSION}" VERSION_LESS "10.5")
   # Need to list dependent shared libraries on link line.  When building
   # with -isysroot (for universal binaries), the linker always looks for
   # dependent libraries under the sysroot.  Listing them on the link
   # line works around the problem.
-  SET(CMAKE_LINK_DEPENDENT_LIBRARY_FILES 1)
-ENDIF()
+  set(CMAKE_LINK_DEPENDENT_LIBRARY_FILES 1)
+endif()
 
-SET(CMAKE_C_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS -w)
-SET(CMAKE_CXX_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS -w)
-SET(CMAKE_C_CREATE_SHARED_LIBRARY
+set(CMAKE_C_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS -w)
+set(CMAKE_CXX_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS -w)
+set(CMAKE_C_CREATE_SHARED_LIBRARY
   "<CMAKE_C_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
-SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
+set(CMAKE_CXX_CREATE_SHARED_LIBRARY
   "<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
-SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY
+set(CMAKE_Fortran_CREATE_SHARED_LIBRARY
   "<CMAKE_Fortran_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
 
-SET(CMAKE_CXX_CREATE_SHARED_MODULE
+set(CMAKE_CXX_CREATE_SHARED_MODULE
       "<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
 
-SET(CMAKE_C_CREATE_SHARED_MODULE
+set(CMAKE_C_CREATE_SHARED_MODULE
       "<CMAKE_C_COMPILER>  <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_MODULE_CREATE_C_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
 
-SET(CMAKE_Fortran_CREATE_SHARED_MODULE
+set(CMAKE_Fortran_CREATE_SHARED_MODULE
       "<CMAKE_Fortran_COMPILER>  <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
 
-SET(CMAKE_C_CREATE_MACOSX_FRAMEWORK
+set(CMAKE_C_CREATE_MACOSX_FRAMEWORK
       "<CMAKE_C_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
-SET(CMAKE_CXX_CREATE_MACOSX_FRAMEWORK
+set(CMAKE_CXX_CREATE_MACOSX_FRAMEWORK
       "<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
 
 
 # default to searching for frameworks first
-IF(NOT DEFINED CMAKE_FIND_FRAMEWORK)
-  SET(CMAKE_FIND_FRAMEWORK FIRST)
-ENDIF()
+if(NOT DEFINED CMAKE_FIND_FRAMEWORK)
+  set(CMAKE_FIND_FRAMEWORK FIRST)
+endif()
 # set up the default search directories for frameworks
-SET(CMAKE_SYSTEM_FRAMEWORK_PATH
+set(CMAKE_SYSTEM_FRAMEWORK_PATH
   ~/Library/Frameworks
   /Library/Frameworks
   /Network/Library/Frameworks
   /System/Library/Frameworks)
 
 # default to searching for application bundles first
-IF(NOT DEFINED CMAKE_FIND_APPBUNDLE)
-  SET(CMAKE_FIND_APPBUNDLE FIRST)
-ENDIF()
+if(NOT DEFINED CMAKE_FIND_APPBUNDLE)
+  set(CMAKE_FIND_APPBUNDLE FIRST)
+endif()
 # set up the default search directories for application bundles
-SET(_apps_paths)
-FOREACH(_path
+set(_apps_paths)
+foreach(_path
   "~/Applications"
   "/Applications"
   "${OSX_DEVELOPER_ROOT}/../Applications" # Xcode 4.3+
   "${OSX_DEVELOPER_ROOT}/Applications"    # pre-4.3
   )
-  GET_FILENAME_COMPONENT(_apps "${_path}" ABSOLUTE)
-  IF(EXISTS "${_apps}")
-    LIST(APPEND _apps_paths "${_apps}")
-  ENDIF()
-ENDFOREACH()
-LIST(REMOVE_DUPLICATES _apps_paths)
-SET(CMAKE_SYSTEM_APPBUNDLE_PATH
+  get_filename_component(_apps "${_path}" ABSOLUTE)
+  if(EXISTS "${_apps}")
+    list(APPEND _apps_paths "${_apps}")
+  endif()
+endforeach()
+list(REMOVE_DUPLICATES _apps_paths)
+set(CMAKE_SYSTEM_APPBUNDLE_PATH
   ${_apps_paths})
-UNSET(_apps_paths)
+unset(_apps_paths)
 
-INCLUDE(Platform/UnixPaths)
-LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH
+include(Platform/UnixPaths)
+list(APPEND CMAKE_SYSTEM_PREFIX_PATH
   /sw        # Fink
   /opt/local # MacPorts
   )
diff --git a/Modules/Platform/DragonFly.cmake b/Modules/Platform/DragonFly.cmake
index f6e0f810f..c22677b9d 100644
--- a/Modules/Platform/DragonFly.cmake
+++ b/Modules/Platform/DragonFly.cmake
@@ -2,4 +2,4 @@
 # http://www.dragonflybsd.org
 # see http://archive.netbsd.se/?ml=dfbsd-users&a=2007-07&m=4678361
 
-INCLUDE(Platform/FreeBSD)
+include(Platform/FreeBSD)
diff --git a/Modules/Platform/FreeBSD.cmake b/Modules/Platform/FreeBSD.cmake
index 82fe961fb..b5779023f 100644
--- a/Modules/Platform/FreeBSD.cmake
+++ b/Modules/Platform/FreeBSD.cmake
@@ -1,28 +1,28 @@
-IF(EXISTS /usr/include/dlfcn.h)
-  SET(CMAKE_DL_LIBS "")
-  SET(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
-  SET(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
-  SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")            # -pic
-  SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")       # -shared
-  SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")         # +s, flag for exe link to use shared lib
-  SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")       # -rpath
-  SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")   # : or empty
-  SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
-  SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
-  SET(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
-ENDIF(EXISTS /usr/include/dlfcn.h)
+if(EXISTS /usr/include/dlfcn.h)
+  set(CMAKE_DL_LIBS "")
+  set(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
+  set(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
+  set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")            # -pic
+  set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")       # -shared
+  set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")         # +s, flag for exe link to use shared lib
+  set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")       # -rpath
+  set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")   # : or empty
+  set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
+  set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
+  set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
+endif(EXISTS /usr/include/dlfcn.h)
 
 # Shared libraries with no builtin soname may not be linked safely by
 # specifying the file path.
-SET(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
+set(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
 
 # Initialize C link type selection flags.  These flags are used when
 # building a shared library, shared module, or executable that links
 # to other libraries to select whether to use the static or shared
 # versions of the libraries.
-FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
-  SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
-  SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
-ENDFOREACH(type)
+foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+  set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
+  set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
+endforeach(type)
 
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/GNU.cmake b/Modules/Platform/GNU.cmake
index 4bcfd51ce..e8c3b657b 100644
--- a/Modules/Platform/GNU.cmake
+++ b/Modules/Platform/GNU.cmake
@@ -1,13 +1,13 @@
 # GCC is the default compiler on GNU/Hurd.
-SET(CMAKE_DL_LIBS "dl")
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
-SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
-SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
-SET(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
+set(CMAKE_DL_LIBS "dl")
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
+set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
+set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
+set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
 
-SET(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-gnu[a-z0-9_]*")
+set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-gnu[a-z0-9_]*")
 
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/Generic-ADSP-ASM.cmake b/Modules/Platform/Generic-ADSP-ASM.cmake
index cec4c2f68..63a1388ce 100644
--- a/Modules/Platform/Generic-ADSP-ASM.cmake
+++ b/Modules/Platform/Generic-ADSP-ASM.cmake
@@ -1,7 +1,7 @@
-INCLUDE(Platform/Generic-ADSP-Common)
+include(Platform/Generic-ADSP-Common)
 
-SET(CMAKE_ASM_SOURCE_FILE_EXTENSIONS asm)
-SET(CMAKE_ASM_OUTPUT_EXTENSION ".doj" )
-SET(CMAKE_ASM_COMPILE_OBJECT
+set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS asm)
+set(CMAKE_ASM_OUTPUT_EXTENSION ".doj" )
+set(CMAKE_ASM_COMPILE_OBJECT
     "<CMAKE_ASM_COMPILER> <FLAGS> -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -o <OBJECT> <SOURCE>")
 
diff --git a/Modules/Platform/Generic-ADSP-C.cmake b/Modules/Platform/Generic-ADSP-C.cmake
index d35307bc7..4b9ed9d07 100644
--- a/Modules/Platform/Generic-ADSP-C.cmake
+++ b/Modules/Platform/Generic-ADSP-C.cmake
@@ -1,20 +1,20 @@
 
-INCLUDE(Platform/Generic-ADSP-Common)
+include(Platform/Generic-ADSP-Common)
 
 
-SET(CMAKE_C_OUTPUT_EXTENSION ".doj")
+set(CMAKE_C_OUTPUT_EXTENSION ".doj")
 
-SET(CMAKE_C_FLAGS_DEBUG_INIT "-g")
-SET(CMAKE_C_FLAGS_MINSIZEREL_INIT "")
-SET(CMAKE_C_FLAGS_RELEASE_INIT "")
-SET(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "")
+set(CMAKE_C_FLAGS_DEBUG_INIT "-g")
+set(CMAKE_C_FLAGS_MINSIZEREL_INIT "")
+set(CMAKE_C_FLAGS_RELEASE_INIT "")
+set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "")
 
-SET(CMAKE_C_CREATE_STATIC_LIBRARY
+set(CMAKE_C_CREATE_STATIC_LIBRARY
     "<CMAKE_C_COMPILER> -build-lib -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -o <TARGET> <CMAKE_C_LINK_FLAGS> <OBJECTS>")
 
-SET(CMAKE_C_LINK_EXECUTABLE
+set(CMAKE_C_LINK_EXECUTABLE
     "<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
 
-SET(CMAKE_C_CREATE_SHARED_LIBRARY)
-SET(CMAKE_C_CREATE_MODULE_LIBRARY)
+set(CMAKE_C_CREATE_SHARED_LIBRARY)
+set(CMAKE_C_CREATE_MODULE_LIBRARY)
 
diff --git a/Modules/Platform/Generic-ADSP-CXX.cmake b/Modules/Platform/Generic-ADSP-CXX.cmake
index 42d3d56ac..9673aef40 100644
--- a/Modules/Platform/Generic-ADSP-CXX.cmake
+++ b/Modules/Platform/Generic-ADSP-CXX.cmake
@@ -1,18 +1,18 @@
-INCLUDE(Platform/Generic-ADSP-Common)
+include(Platform/Generic-ADSP-Common)
 
-SET(CMAKE_CXX_OUTPUT_EXTENSION ".doj")
+set(CMAKE_CXX_OUTPUT_EXTENSION ".doj")
 
-SET(CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
-SET(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "")
-SET(CMAKE_CXX_FLAGS_RELEASE_INIT "")
-SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "")
+set(CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
+set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "")
+set(CMAKE_CXX_FLAGS_RELEASE_INIT "")
+set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "")
 
-SET(CMAKE_CXX_CREATE_STATIC_LIBRARY
+set(CMAKE_CXX_CREATE_STATIC_LIBRARY
      "<CMAKE_CXX_COMPILER> -build-lib -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -o <TARGET> <CMAKE_CXX_LINK_FLAGS> <OBJECTS>")
 
-SET(CMAKE_CXX_LINK_EXECUTABLE
+set(CMAKE_CXX_LINK_EXECUTABLE
      "<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
 
-SET(CMAKE_CXX_CREATE_SHARED_LIBRARY)
-SET(CMAKE_CXX_CREATE_MODULE_LIBRARY)
+set(CMAKE_CXX_CREATE_SHARED_LIBRARY)
+set(CMAKE_CXX_CREATE_MODULE_LIBRARY)
 
diff --git a/Modules/Platform/Generic-ADSP-Common.cmake b/Modules/Platform/Generic-ADSP-Common.cmake
index 14b92e95a..9120eed11 100644
--- a/Modules/Platform/Generic-ADSP-Common.cmake
+++ b/Modules/Platform/Generic-ADSP-Common.cmake
@@ -6,115 +6,115 @@
 # TS (TigerShark)
 # 21k (Sharc 21xxx)
 
-IF(NOT ADSP)
+if(NOT ADSP)
 
-  SET(ADSP TRUE)
+  set(ADSP TRUE)
 
-  SET(CMAKE_STATIC_LIBRARY_SUFFIX ".dlb")
-  SET(CMAKE_SHARED_LIBRARY_SUFFIX "")
-  SET(CMAKE_EXECUTABLE_SUFFIX ".dxe")
+  set(CMAKE_STATIC_LIBRARY_SUFFIX ".dlb")
+  set(CMAKE_SHARED_LIBRARY_SUFFIX "")
+  set(CMAKE_EXECUTABLE_SUFFIX ".dxe")
 
   # if ADSP_PROCESSOR has not been set, but CMAKE_SYSTEM_PROCESSOR has,
   # assume that this is the processor name to use for the compiler
-  IF(CMAKE_SYSTEM_PROCESSOR AND NOT ADSP_PROCESSOR)
-    SET(ADSP_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR})
-  ENDIF(CMAKE_SYSTEM_PROCESSOR AND NOT ADSP_PROCESSOR)
+  if(CMAKE_SYSTEM_PROCESSOR AND NOT ADSP_PROCESSOR)
+    set(ADSP_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR})
+  endif(CMAKE_SYSTEM_PROCESSOR AND NOT ADSP_PROCESSOR)
 
   # if ADSP_PROCESSOR_SILICIUM_REVISION has not been set, use "none"
-  IF(NOT ADSP_PROCESSOR_SILICIUM_REVISION)
-    SET(ADSP_PROCESSOR_SILICIUM_REVISION "none")
-  ENDIF(NOT ADSP_PROCESSOR_SILICIUM_REVISION)
+  if(NOT ADSP_PROCESSOR_SILICIUM_REVISION)
+    set(ADSP_PROCESSOR_SILICIUM_REVISION "none")
+  endif(NOT ADSP_PROCESSOR_SILICIUM_REVISION)
 
   # this file is included from the C and CXX files, so handle both here
 
-  GET_FILENAME_COMPONENT(_ADSP_DIR "${CMAKE_C_COMPILER}" PATH)
-  IF(NOT _ADSP_DIR)
-    GET_FILENAME_COMPONENT(_ADSP_DIR "${CMAKE_CXX_COMPILER}" PATH)
-  ENDIF(NOT _ADSP_DIR)
-  IF(NOT _ADSP_DIR)
-    GET_FILENAME_COMPONENT(_ADSP_DIR "${CMAKE_ASM_COMPILER}" PATH)
-  ENDIF(NOT _ADSP_DIR)
+  get_filename_component(_ADSP_DIR "${CMAKE_C_COMPILER}" PATH)
+  if(NOT _ADSP_DIR)
+    get_filename_component(_ADSP_DIR "${CMAKE_CXX_COMPILER}" PATH)
+  endif(NOT _ADSP_DIR)
+  if(NOT _ADSP_DIR)
+    get_filename_component(_ADSP_DIR "${CMAKE_ASM_COMPILER}" PATH)
+  endif(NOT _ADSP_DIR)
 
   # detect architecture
 
-  IF(CMAKE_C_COMPILER MATCHES ccblkfn OR CMAKE_CXX_COMPILER MATCHES ccblkfn OR CMAKE_ASM_COMPILER MATCHES easmBLKFN)
-    IF(NOT ADSP_PROCESSOR)
-      SET(ADSP_PROCESSOR "ADSP-BF561")
-    ENDIF(NOT ADSP_PROCESSOR)
-    SET(ADSP_BLACKFIN TRUE)
-    SET(_ADSP_FAMILY_DIR "${_ADSP_DIR}/Blackfin")
-  ENDIF(CMAKE_C_COMPILER MATCHES ccblkfn OR CMAKE_CXX_COMPILER MATCHES ccblkfn OR CMAKE_ASM_COMPILER MATCHES easmBLKFN)
+  if(CMAKE_C_COMPILER MATCHES ccblkfn OR CMAKE_CXX_COMPILER MATCHES ccblkfn OR CMAKE_ASM_COMPILER MATCHES easmBLKFN)
+    if(NOT ADSP_PROCESSOR)
+      set(ADSP_PROCESSOR "ADSP-BF561")
+    endif(NOT ADSP_PROCESSOR)
+    set(ADSP_BLACKFIN TRUE)
+    set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/Blackfin")
+  endif(CMAKE_C_COMPILER MATCHES ccblkfn OR CMAKE_CXX_COMPILER MATCHES ccblkfn OR CMAKE_ASM_COMPILER MATCHES easmBLKFN)
 
-  IF(CMAKE_C_COMPILER MATCHES ccts OR CMAKE_CXX_COMPILER MATCHES ccts OR CMAKE_ASM_COMPILER MATCHES easmTS)
-    IF(NOT ADSP_PROCESSOR)
-      SET(ADSP_PROCESSOR "ADSP-TS101")
-    ENDIF(NOT ADSP_PROCESSOR)
-    SET(ADSP_TS TRUE)
-    SET(_ADSP_FAMILY_DIR "${_ADSP_DIR}/TS")
-  ENDIF(CMAKE_C_COMPILER MATCHES ccts OR CMAKE_CXX_COMPILER MATCHES ccts OR CMAKE_ASM_COMPILER MATCHES easmTS)
+  if(CMAKE_C_COMPILER MATCHES ccts OR CMAKE_CXX_COMPILER MATCHES ccts OR CMAKE_ASM_COMPILER MATCHES easmTS)
+    if(NOT ADSP_PROCESSOR)
+      set(ADSP_PROCESSOR "ADSP-TS101")
+    endif(NOT ADSP_PROCESSOR)
+    set(ADSP_TS TRUE)
+    set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/TS")
+  endif(CMAKE_C_COMPILER MATCHES ccts OR CMAKE_CXX_COMPILER MATCHES ccts OR CMAKE_ASM_COMPILER MATCHES easmTS)
 
-  IF(CMAKE_C_COMPILER MATCHES cc21k OR CMAKE_CXX_COMPILER MATCHES cc21k OR CMAKE_ASM_COMPILER MATCHES easm21k)
-    IF(NOT ADSP_PROCESSOR)
-      SET(ADSP_PROCESSOR "ADSP-21060")
-    ENDIF(NOT ADSP_PROCESSOR)
-    SET(ADSP_21K TRUE)
+  if(CMAKE_C_COMPILER MATCHES cc21k OR CMAKE_CXX_COMPILER MATCHES cc21k OR CMAKE_ASM_COMPILER MATCHES easm21k)
+    if(NOT ADSP_PROCESSOR)
+      set(ADSP_PROCESSOR "ADSP-21060")
+    endif(NOT ADSP_PROCESSOR)
+    set(ADSP_21K TRUE)
 
-    SET(_ADSP_FAMILY_DIR "${_ADSP_DIR}/21k")  # default if nothing matches
-    IF   (ADSP_PROCESSOR MATCHES "210..$")
-      SET(_ADSP_FAMILY_DIR "${_ADSP_DIR}/21k")
-    ENDIF(ADSP_PROCESSOR MATCHES "210..$")
+    set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/21k")  # default if nothing matches
+    if   (ADSP_PROCESSOR MATCHES "210..$")
+      set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/21k")
+    endif(ADSP_PROCESSOR MATCHES "210..$")
 
-    IF   (ADSP_PROCESSOR MATCHES "211..$")
-      SET(_ADSP_FAMILY_DIR "${_ADSP_DIR}/211k")
-    ENDIF(ADSP_PROCESSOR MATCHES "211..$")
+    if   (ADSP_PROCESSOR MATCHES "211..$")
+      set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/211k")
+    endif(ADSP_PROCESSOR MATCHES "211..$")
 
-    IF   (ADSP_PROCESSOR MATCHES "212..$")
-      SET(_ADSP_FAMILY_DIR "${_ADSP_DIR}/212k")
-    ENDIF(ADSP_PROCESSOR MATCHES "212..$")
+    if   (ADSP_PROCESSOR MATCHES "212..$")
+      set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/212k")
+    endif(ADSP_PROCESSOR MATCHES "212..$")
 
-    IF   (ADSP_PROCESSOR MATCHES "213..$")
-      SET(_ADSP_FAMILY_DIR "${_ADSP_DIR}/213k")
-    ENDIF(ADSP_PROCESSOR MATCHES "213..$")
+    if   (ADSP_PROCESSOR MATCHES "213..$")
+      set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/213k")
+    endif(ADSP_PROCESSOR MATCHES "213..$")
 
-    SET(_ADSP_FAMILY_DIR "${_ADSP_DIR}/21k")
-  ENDIF(CMAKE_C_COMPILER MATCHES cc21k OR CMAKE_CXX_COMPILER MATCHES cc21k OR CMAKE_ASM_COMPILER MATCHES easm21k)
+    set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/21k")
+  endif(CMAKE_C_COMPILER MATCHES cc21k OR CMAKE_CXX_COMPILER MATCHES cc21k OR CMAKE_ASM_COMPILER MATCHES easm21k)
 
 
-  LINK_DIRECTORIES("${_ADSP_FAMILY_DIR}/lib")
+  link_directories("${_ADSP_FAMILY_DIR}/lib")
 
   # vdk support
-  FIND_PROGRAM( ADSP_VDKGEN_EXECUTABLE vdkgen "${_ADSP_FAMILY_DIR}/vdk" )
+  find_program( ADSP_VDKGEN_EXECUTABLE vdkgen "${_ADSP_FAMILY_DIR}/vdk" )
 
-  MACRO(ADSP_GENERATE_VDK VDK_GENERATED_HEADER VDK_GENERATED_SOURCE VDK_KERNEL_SUPPORT_FILE)
-    ADD_CUSTOM_COMMAND(
+  macro(ADSP_GENERATE_VDK VDK_GENERATED_HEADER VDK_GENERATED_SOURCE VDK_KERNEL_SUPPORT_FILE)
+    add_custom_command(
       OUTPUT ${VDK_GENERATED_HEADER} ${VDK_GENERATED_SOURCE}
       COMMAND ${ADSP_VDKGEN_EXECUTABLE} ${VDK_KERNEL_SUPPORT_FILE} -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -MM
       DEPENDS ${VDK_KERNEL_SUPPORT_FILE}
       )
-  ENDMACRO(ADSP_GENERATE_VDK VDK_GENERATED_HEADER VDK_GENERATED_SOURCE VDK_KERNEL_SUPPORT_FILE)
+  endmacro(ADSP_GENERATE_VDK VDK_GENERATED_HEADER VDK_GENERATED_SOURCE VDK_KERNEL_SUPPORT_FILE)
 
   # loader support
-  FIND_PROGRAM( ADSP_ELFLOADER_EXECUTABLE elfloader "${_ADSP_FAMILY_DIR}" )
+  find_program( ADSP_ELFLOADER_EXECUTABLE elfloader "${_ADSP_FAMILY_DIR}" )
 
   # BOOT_MODE: prom, flash, spi, spislave, UART, TWI, FIFO
   # FORMAT: hex, ASCII, binary, include
   # WIDTH: 8, 16
-  MACRO(ADSP_CREATE_LOADER_FILE TARGET_NAME BOOT_MODE FORMAT WIDTH)
-    ADD_CUSTOM_COMMAND(
+  macro(ADSP_CREATE_LOADER_FILE TARGET_NAME BOOT_MODE FORMAT WIDTH)
+    add_custom_command(
       TARGET ${TARGET_NAME}
       POST_BUILD
       COMMAND ${ADSP_ELFLOADER_EXECUTABLE} ${EXECUTABLE_OUTPUT_PATH}/${TARGET_NAME}.dxe -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -b ${BOOT_MODE} -f ${FORMAT} -width ${WIDTH} -o ${EXECUTABLE_OUTPUT_PATH}/${TARGET_NAME}.ldr
       COMMENT "Building the loader file"
       )
-  ENDMACRO(ADSP_CREATE_LOADER_FILE TARGET_NAME BOOT_MODE FORMAT WIDTH)
+  endmacro(ADSP_CREATE_LOADER_FILE TARGET_NAME BOOT_MODE FORMAT WIDTH)
 
-  MACRO(ADSP_CREATE_LOADER_FILE_INIT TARGET_NAME BOOT_MODE FORMAT WIDTH INITIALIZATION_FILE)
-    ADD_CUSTOM_COMMAND(
+  macro(ADSP_CREATE_LOADER_FILE_INIT TARGET_NAME BOOT_MODE FORMAT WIDTH INITIALIZATION_FILE)
+    add_custom_command(
       TARGET ${TARGET_NAME}
       POST_BUILD
       COMMAND ${ADSP_ELFLOADER_EXECUTABLE} ${EXECUTABLE_OUTPUT_PATH}/${TARGET_NAME}.dxe -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -b ${BOOT_MODE} -f ${FORMAT} -width ${WIDTH} -o ${EXECUTABLE_OUTPUT_PATH}/${TARGET_NAME}.ldr -init ${INITIALIZATION_FILE}
       COMMENT "Building the loader file"
       )
-  ENDMACRO(ADSP_CREATE_LOADER_FILE_INIT TARGET_NAME BOOT_MODE FORMAT WIDTH INITIALIZATION_FILE)
+  endmacro(ADSP_CREATE_LOADER_FILE_INIT TARGET_NAME BOOT_MODE FORMAT WIDTH INITIALIZATION_FILE)
 
-ENDIF(NOT ADSP)
+endif(NOT ADSP)
diff --git a/Modules/Platform/Generic-SDCC-C.cmake b/Modules/Platform/Generic-SDCC-C.cmake
index 6c36445d7..fc7eb42b8 100644
--- a/Modules/Platform/Generic-SDCC-C.cmake
+++ b/Modules/Platform/Generic-SDCC-C.cmake
@@ -4,51 +4,51 @@
 # To use it either a toolchain file is required or cmake has to be run like this:
 # cmake -DCMAKE_C_COMPILER=sdcc -DCMAKE_SYSTEM_NAME=Generic <dir...>
 # Since sdcc doesn't support C++, C++ support should be disabled in the
-# CMakeLists.txt using the PROJECT() command:
-# PROJECT(my_project C)
+# CMakeLists.txt using the project() command:
+# project(my_project C)
 
-SET(CMAKE_STATIC_LIBRARY_PREFIX "")
-SET(CMAKE_STATIC_LIBRARY_SUFFIX ".lib")
-SET(CMAKE_SHARED_LIBRARY_PREFIX "")          # lib
-SET(CMAKE_SHARED_LIBRARY_SUFFIX ".lib")          # .so
-SET(CMAKE_IMPORT_LIBRARY_PREFIX )
-SET(CMAKE_IMPORT_LIBRARY_SUFFIX )
-SET(CMAKE_EXECUTABLE_SUFFIX ".ihx")          # intel hex file
-SET(CMAKE_LINK_LIBRARY_SUFFIX ".lib")
-SET(CMAKE_DL_LIBS "")
+set(CMAKE_STATIC_LIBRARY_PREFIX "")
+set(CMAKE_STATIC_LIBRARY_SUFFIX ".lib")
+set(CMAKE_SHARED_LIBRARY_PREFIX "")          # lib
+set(CMAKE_SHARED_LIBRARY_SUFFIX ".lib")          # .so
+set(CMAKE_IMPORT_LIBRARY_PREFIX )
+set(CMAKE_IMPORT_LIBRARY_SUFFIX )
+set(CMAKE_EXECUTABLE_SUFFIX ".ihx")          # intel hex file
+set(CMAKE_LINK_LIBRARY_SUFFIX ".lib")
+set(CMAKE_DL_LIBS "")
 
-SET(CMAKE_C_OUTPUT_EXTENSION ".rel")
+set(CMAKE_C_OUTPUT_EXTENSION ".rel")
 
 # find sdcclib as CMAKE_AR
 # since cmake may already have searched for "ar", sdcclib has to
 # be searched with a different variable name (SDCCLIB_EXECUTABLE)
 # and must then be forced into the cache
-GET_FILENAME_COMPONENT(SDCC_LOCATION "${CMAKE_C_COMPILER}" PATH)
-FIND_PROGRAM(SDCCLIB_EXECUTABLE sdcclib PATHS "${SDCC_LOCATION}" NO_DEFAULT_PATH)
-FIND_PROGRAM(SDCCLIB_EXECUTABLE sdcclib)
-SET(CMAKE_AR "${SDCCLIB_EXECUTABLE}" CACHE FILEPATH "The sdcc librarian" FORCE)
+get_filename_component(SDCC_LOCATION "${CMAKE_C_COMPILER}" PATH)
+find_program(SDCCLIB_EXECUTABLE sdcclib PATHS "${SDCC_LOCATION}" NO_DEFAULT_PATH)
+find_program(SDCCLIB_EXECUTABLE sdcclib)
+set(CMAKE_AR "${SDCCLIB_EXECUTABLE}" CACHE FILEPATH "The sdcc librarian" FORCE)
 
 # CMAKE_C_FLAGS_INIT and CMAKE_EXE_LINKER_FLAGS_INIT should be set in a CMAKE_SYSTEM_PROCESSOR file
-IF(NOT DEFINED CMAKE_C_FLAGS_INIT)
-  SET(CMAKE_C_FLAGS_INIT "-mmcs51 --model-small")
-ENDIF(NOT DEFINED CMAKE_C_FLAGS_INIT)
+if(NOT DEFINED CMAKE_C_FLAGS_INIT)
+  set(CMAKE_C_FLAGS_INIT "-mmcs51 --model-small")
+endif(NOT DEFINED CMAKE_C_FLAGS_INIT)
 
-IF(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_INIT)
-  SET (CMAKE_EXE_LINKER_FLAGS_INIT --model-small)
-ENDIF(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_INIT)
+if(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_INIT)
+  set (CMAKE_EXE_LINKER_FLAGS_INIT --model-small)
+endif(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_INIT)
 
 # compile a C file into an object file
-SET(CMAKE_C_COMPILE_OBJECT  "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
+set(CMAKE_C_COMPILE_OBJECT  "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
 
 # link object files to an executable
-SET(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <FLAGS> <OBJECTS> --out-fmt-ihx -o  <TARGET> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>")
+set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <FLAGS> <OBJECTS> --out-fmt-ihx -o  <TARGET> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>")
 
 # needs sdcc 2.7.0 + sddclib from cvs
-SET(CMAKE_C_CREATE_STATIC_LIBRARY
+set(CMAKE_C_CREATE_STATIC_LIBRARY
       "\"${CMAKE_COMMAND}\" -E remove <TARGET>"
       "<CMAKE_AR> -a <TARGET> <LINK_FLAGS> <OBJECTS> ")
 
 # not supported by sdcc
-SET(CMAKE_C_CREATE_SHARED_LIBRARY "")
-SET(CMAKE_C_CREATE_MODULE_LIBRARY "")
+set(CMAKE_C_CREATE_SHARED_LIBRARY "")
+set(CMAKE_C_CREATE_MODULE_LIBRARY "")
 
diff --git a/Modules/Platform/Generic.cmake b/Modules/Platform/Generic.cmake
index e6f8b2b1e..fcb2699d6 100644
--- a/Modules/Platform/Generic.cmake
+++ b/Modules/Platform/Generic.cmake
@@ -8,10 +8,10 @@
 # and/or ${CMAKE_SYSTEM_NAME}-<compiler_basename>-${CMAKE_SYSTEM_PROCESSOR}.cmake
 
 # (embedded) targets without operating system usually don't support shared libraries
-SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
+set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
 
 # To help the find_xxx() commands, set at least the following so CMAKE_FIND_ROOT_PATH
 # works at least for some simple cases:
-SET(CMAKE_SYSTEM_INCLUDE_PATH /include )
-SET(CMAKE_SYSTEM_LIBRARY_PATH /lib )
-SET(CMAKE_SYSTEM_PROGRAM_PATH /bin )
+set(CMAKE_SYSTEM_INCLUDE_PATH /include )
+set(CMAKE_SYSTEM_LIBRARY_PATH /lib )
+set(CMAKE_SYSTEM_PROGRAM_PATH /bin )
diff --git a/Modules/Platform/HP-UX.cmake b/Modules/Platform/HP-UX.cmake
index ab3dc2266..33257f973 100644
--- a/Modules/Platform/HP-UX.cmake
+++ b/Modules/Platform/HP-UX.cmake
@@ -1,22 +1,22 @@
-SET(CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH /usr/lib)
+set(CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH /usr/lib)
 
-SET(CMAKE_SHARED_LIBRARY_SUFFIX ".sl")          # .so
-SET(CMAKE_DL_LIBS "dld")
-SET(CMAKE_FIND_LIBRARY_SUFFIXES ".sl" ".so" ".a")
-SET(CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES ".so")
+set(CMAKE_SHARED_LIBRARY_SUFFIX ".sl")          # .so
+set(CMAKE_DL_LIBS "dld")
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".sl" ".so" ".a")
+set(CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES ".so")
 
 # The HP linker needs to find transitive shared library dependencies
 # in the -L path.  Therefore the runtime path must be added to the
 # link line with -L flags.
-SET(CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH 1)
-SET(CMAKE_LINK_DEPENDENT_LIBRARY_DIRS 1)
+set(CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH 1)
+set(CMAKE_LINK_DEPENDENT_LIBRARY_DIRS 1)
 
 # Shared libraries with no builtin soname may not be linked safely by
 # specifying the file path.
-SET(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
+set(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
 
 # set flags for gcc support
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
 
 # Look in both 32-bit and 64-bit implict link directories, but tell
 # CMake not to pass the paths to the linker.  The linker will find the
@@ -25,9 +25,9 @@ INCLUDE(Platform/UnixPaths)
 # CMAKE_SIZEOF_VOID_P is not set until after this file executes, we
 # would need to append to CMAKE_SYSTEM_LIBRARY_PATH at a later point
 # (after CMakeTest(LANG)Compiler.cmake runs for at least one language).
-LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH /usr/lib/hpux32)
-LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH /usr/lib/hpux64)
-LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
+list(APPEND CMAKE_SYSTEM_LIBRARY_PATH /usr/lib/hpux32)
+list(APPEND CMAKE_SYSTEM_LIBRARY_PATH /usr/lib/hpux64)
+list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
   /usr/lib/hpux32 /usr/lib/hpux64)
 
 # Initialize C and CXX link type selection flags.  These flags are
@@ -35,16 +35,16 @@ LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
 # that links to other libraries to select whether to use the static or
 # shared versions of the libraries.  Note that C modules and shared
 # libs are built using ld directly so we leave off the "-Wl," portion.
-FOREACH(type SHARED_LIBRARY SHARED_MODULE)
-  SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-a archive")
-  SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-a default")
-ENDFOREACH(type)
-FOREACH(type EXE)
-  SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-a,archive")
-  SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-a,default")
-ENDFOREACH(type)
-FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
-  SET(CMAKE_${type}_LINK_STATIC_CXX_FLAGS "-Wl,-a,archive")
-  SET(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS "-Wl,-a,default")
-ENDFOREACH(type)
+foreach(type SHARED_LIBRARY SHARED_MODULE)
+  set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-a archive")
+  set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-a default")
+endforeach(type)
+foreach(type EXE)
+  set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-a,archive")
+  set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-a,default")
+endforeach(type)
+foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+  set(CMAKE_${type}_LINK_STATIC_CXX_FLAGS "-Wl,-a,archive")
+  set(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS "-Wl,-a,default")
+endforeach(type)
 
diff --git a/Modules/Platform/Haiku.cmake b/Modules/Platform/Haiku.cmake
index 9dda3c528..ec0b8fafb 100644
--- a/Modules/Platform/Haiku.cmake
+++ b/Modules/Platform/Haiku.cmake
@@ -1,24 +1,24 @@
-SET(BEOS 1)
+set(BEOS 1)
 
-SET(CMAKE_DL_LIBS root be)
-SET(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
-SET(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-nostart")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
-SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
+set(CMAKE_DL_LIBS root be)
+set(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
+set(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-nostart")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
+set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
 
-INCLUDE(Platform/UnixPaths)
-LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH /boot/common)
-LIST(APPEND CMAKE_SYSTEM_INCLUDE_PATH /boot/common/include)
-LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH /boot/common/lib)
-LIST(APPEND CMAKE_SYSTEM_PROGRAM_PATH /boot/common/bin)
-LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES /boot/common/lib)
-LIST(APPEND CMAKE_SYSTEM_INCLUDE_PATH /boot/develop/headers/3rdparty)
-LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH /boot/develop/lib/x86)
+include(Platform/UnixPaths)
+list(APPEND CMAKE_SYSTEM_PREFIX_PATH /boot/common)
+list(APPEND CMAKE_SYSTEM_INCLUDE_PATH /boot/common/include)
+list(APPEND CMAKE_SYSTEM_LIBRARY_PATH /boot/common/lib)
+list(APPEND CMAKE_SYSTEM_PROGRAM_PATH /boot/common/bin)
+list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES /boot/common/lib)
+list(APPEND CMAKE_SYSTEM_INCLUDE_PATH /boot/develop/headers/3rdparty)
+list(APPEND CMAKE_SYSTEM_LIBRARY_PATH /boot/develop/lib/x86)
 
-IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
-  SET(CMAKE_INSTALL_PREFIX "/boot/common" CACHE PATH
+if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+  set(CMAKE_INSTALL_PREFIX "/boot/common" CACHE PATH
     "Install path prefix, prepended onto install directories." FORCE)
-ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
diff --git a/Modules/Platform/IRIX.cmake b/Modules/Platform/IRIX.cmake
index fac941f3b..221a61df6 100644
--- a/Modules/Platform/IRIX.cmake
+++ b/Modules/Platform/IRIX.cmake
@@ -1,45 +1,45 @@
-SET(CMAKE_DL_LIBS "")
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -rdata_shared")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")       # -rpath
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "")   # : or empty
-IF(NOT CMAKE_COMPILER_IS_GNUCXX)
-  SET(CMAKE_CXX_CREATE_STATIC_LIBRARY
+set(CMAKE_DL_LIBS "")
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -rdata_shared")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")       # -rpath
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "")   # : or empty
+if(NOT CMAKE_COMPILER_IS_GNUCXX)
+  set(CMAKE_CXX_CREATE_STATIC_LIBRARY
       "<CMAKE_CXX_COMPILER> -ar -o <TARGET> <OBJECTS>")
-  SET (CMAKE_CXX_FLAGS_INIT "")
-  SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
-  SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O3 -DNDEBUG")
-  SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
-  SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
-  SET (CMAKE_C_FLAGS_INIT "")
-ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
+  set (CMAKE_CXX_FLAGS_INIT "")
+  set (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
+  set (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O3 -DNDEBUG")
+  set (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
+  set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
+  set (CMAKE_C_FLAGS_INIT "")
+endif(NOT CMAKE_COMPILER_IS_GNUCXX)
 # set flags for gcc support
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
 
-IF(NOT CMAKE_COMPILER_IS_GNUCC)
-  SET (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
-  SET (CMAKE_C_CREATE_ASSEMBLY_SOURCE
+if(NOT CMAKE_COMPILER_IS_GNUCC)
+  set (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+  set (CMAKE_C_CREATE_ASSEMBLY_SOURCE
     "<CMAKE_C_COMPILER> <FLAGS> -S <SOURCE>"
     "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
     )
-ENDIF(NOT CMAKE_COMPILER_IS_GNUCC)
+endif(NOT CMAKE_COMPILER_IS_GNUCC)
 
-IF(NOT CMAKE_COMPILER_IS_GNUCXX)
-  SET (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
-  SET (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE
+if(NOT CMAKE_COMPILER_IS_GNUCXX)
+  set (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+  set (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE
     "<CMAKE_CXX_COMPILER> <FLAGS> -S <SOURCE>"
     "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
     )
-ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
+endif(NOT CMAKE_COMPILER_IS_GNUCXX)
 
 # Initialize C link type selection flags.  These flags are used when
 # building a shared library, shared module, or executable that links
 # to other libraries to select whether to use the static or shared
 # versions of the libraries.
-FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
-  SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
-  SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
-ENDFOREACH(type)
+foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+  set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
+  set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
+endforeach(type)
 
 # The IRIX linker needs to find transitive shared library dependencies
 # in the -L path.
-SET(CMAKE_LINK_DEPENDENT_LIBRARY_DIRS 1)
+set(CMAKE_LINK_DEPENDENT_LIBRARY_DIRS 1)
diff --git a/Modules/Platform/IRIX64.cmake b/Modules/Platform/IRIX64.cmake
index 09fa99884..191dfcc20 100644
--- a/Modules/Platform/IRIX64.cmake
+++ b/Modules/Platform/IRIX64.cmake
@@ -1,73 +1,73 @@
-SET(CMAKE_DL_LIBS "")
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -rdata_shared")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")       # -rpath
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "")   # : or empty
-SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
-IF(NOT CMAKE_COMPILER_IS_GNUCC)
+set(CMAKE_DL_LIBS "")
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -rdata_shared")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")       # -rpath
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "")   # : or empty
+set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
+if(NOT CMAKE_COMPILER_IS_GNUCC)
   # Set default flags init.
-  SET(CMAKE_C_FLAGS_INIT "")
-  SET(CMAKE_CXX_FLAGS_INIT "")
-  SET(CMAKE_Fortran_FLAGS_INIT "")
-  SET(CMAKE_EXE_LINKER_FLAGS_INIT "")
-  SET(CMAKE_SHARED_LINKER_FLAGS_INIT "")
-  SET(CMAKE_MODULE_LINKER_FLAGS_INIT "")
+  set(CMAKE_C_FLAGS_INIT "")
+  set(CMAKE_CXX_FLAGS_INIT "")
+  set(CMAKE_Fortran_FLAGS_INIT "")
+  set(CMAKE_EXE_LINKER_FLAGS_INIT "")
+  set(CMAKE_SHARED_LINKER_FLAGS_INIT "")
+  set(CMAKE_MODULE_LINKER_FLAGS_INIT "")
 
   # If no -o32, -n32, or -64 flag is given, set a reasonable default.
-  IF("$ENV{CFLAGS} $ENV{CXXFLAGS} $ENV{LDFLAGS}" MATCHES "-([no]32|64)")
-  ELSE("$ENV{CFLAGS} $ENV{CXXFLAGS} $ENV{LDFLAGS}" MATCHES "-([no]32|64)")
+  if("$ENV{CFLAGS} $ENV{CXXFLAGS} $ENV{LDFLAGS}" MATCHES "-([no]32|64)")
+  else("$ENV{CFLAGS} $ENV{CXXFLAGS} $ENV{LDFLAGS}" MATCHES "-([no]32|64)")
     # Check if this is a 64-bit CMake.
-    IF(CMAKE_FILE_SELF MATCHES "^CMAKE_FILE_SELF$")
-      EXEC_PROGRAM(file ARGS ${CMAKE_COMMAND} OUTPUT_VARIABLE CMAKE_FILE_SELF)
-      SET(CMAKE_FILE_SELF "${CMAKE_FILE_SELF}" CACHE INTERNAL
+    if(CMAKE_FILE_SELF MATCHES "^CMAKE_FILE_SELF$")
+      exec_program(file ARGS ${CMAKE_COMMAND} OUTPUT_VARIABLE CMAKE_FILE_SELF)
+      set(CMAKE_FILE_SELF "${CMAKE_FILE_SELF}" CACHE INTERNAL
         "Output of file command on ${CMAKE_COMMAND}.")
-    ENDIF(CMAKE_FILE_SELF MATCHES "^CMAKE_FILE_SELF$")
+    endif(CMAKE_FILE_SELF MATCHES "^CMAKE_FILE_SELF$")
 
     # Set initial flags to match cmake executable.
-    IF(CMAKE_FILE_SELF MATCHES " 64-bit ")
-      SET(CMAKE_C_FLAGS_INIT "-64")
-      SET(CMAKE_CXX_FLAGS_INIT "-64")
-      SET(CMAKE_Fortran_FLAGS_INIT "-64")
-      SET(CMAKE_EXE_LINKER_FLAGS_INIT "-64")
-      SET(CMAKE_SHARED_LINKER_FLAGS_INIT "-64")
-      SET(CMAKE_MODULE_LINKER_FLAGS_INIT "-64")
-    ENDIF(CMAKE_FILE_SELF MATCHES " 64-bit ")
-  ENDIF("$ENV{CFLAGS} $ENV{CXXFLAGS} $ENV{LDFLAGS}" MATCHES "-([no]32|64)")
+    if(CMAKE_FILE_SELF MATCHES " 64-bit ")
+      set(CMAKE_C_FLAGS_INIT "-64")
+      set(CMAKE_CXX_FLAGS_INIT "-64")
+      set(CMAKE_Fortran_FLAGS_INIT "-64")
+      set(CMAKE_EXE_LINKER_FLAGS_INIT "-64")
+      set(CMAKE_SHARED_LINKER_FLAGS_INIT "-64")
+      set(CMAKE_MODULE_LINKER_FLAGS_INIT "-64")
+    endif(CMAKE_FILE_SELF MATCHES " 64-bit ")
+  endif("$ENV{CFLAGS} $ENV{CXXFLAGS} $ENV{LDFLAGS}" MATCHES "-([no]32|64)")
 
   # Set remaining defaults.
-  SET(CMAKE_CXX_CREATE_STATIC_LIBRARY
+  set(CMAKE_CXX_CREATE_STATIC_LIBRARY
       "<CMAKE_CXX_COMPILER> -ar -o <TARGET> <OBJECTS>")
-  SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
-  SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O3 -DNDEBUG")
-  SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
-  SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
-ENDIF(NOT CMAKE_COMPILER_IS_GNUCC)
-INCLUDE(Platform/UnixPaths)
+  set (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
+  set (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O3 -DNDEBUG")
+  set (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
+  set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
+endif(NOT CMAKE_COMPILER_IS_GNUCC)
+include(Platform/UnixPaths)
 
-IF(NOT CMAKE_COMPILER_IS_GNUCC)
-  SET (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
-  SET (CMAKE_C_CREATE_ASSEMBLY_SOURCE
+if(NOT CMAKE_COMPILER_IS_GNUCC)
+  set (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+  set (CMAKE_C_CREATE_ASSEMBLY_SOURCE
     "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE>"
     "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
     )
-ENDIF(NOT CMAKE_COMPILER_IS_GNUCC)
+endif(NOT CMAKE_COMPILER_IS_GNUCC)
 
-IF(NOT CMAKE_COMPILER_IS_GNUCXX)
-  SET (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
-  SET (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE
+if(NOT CMAKE_COMPILER_IS_GNUCXX)
+  set (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+  set (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE
     "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -S <SOURCE>"
     "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
     )
-ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
+endif(NOT CMAKE_COMPILER_IS_GNUCXX)
 
 # Initialize C link type selection flags.  These flags are used when
 # building a shared library, shared module, or executable that links
 # to other libraries to select whether to use the static or shared
 # versions of the libraries.
-FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
-  SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
-  SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
-ENDFOREACH(type)
+foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+  set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
+  set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
+endforeach(type)
 
 # The IRIX linker needs to find transitive shared library dependencies
 # in the -L path.
-SET(CMAKE_LINK_DEPENDENT_LIBRARY_DIRS 1)
+set(CMAKE_LINK_DEPENDENT_LIBRARY_DIRS 1)
diff --git a/Modules/Platform/Linux-Clang-C.cmake b/Modules/Platform/Linux-Clang-C.cmake
index dbf89564a..2a77d2710 100644
--- a/Modules/Platform/Linux-Clang-C.cmake
+++ b/Modules/Platform/Linux-Clang-C.cmake
@@ -1 +1 @@
-INCLUDE(Platform/Linux-GNU-C)
+include(Platform/Linux-GNU-C)
diff --git a/Modules/Platform/Linux-Clang-CXX.cmake b/Modules/Platform/Linux-Clang-CXX.cmake
index 8fe251c4d..9d9a4df66 100644
--- a/Modules/Platform/Linux-Clang-CXX.cmake
+++ b/Modules/Platform/Linux-Clang-CXX.cmake
@@ -1 +1 @@
-INCLUDE(Platform/Linux-GNU-CXX)
+include(Platform/Linux-GNU-CXX)
diff --git a/Modules/Platform/Linux-GNU-C.cmake b/Modules/Platform/Linux-GNU-C.cmake
index 3ab142f13..84dd49269 100644
--- a/Modules/Platform/Linux-GNU-C.cmake
+++ b/Modules/Platform/Linux-GNU-C.cmake
@@ -1,2 +1,2 @@
-INCLUDE(Platform/Linux-GNU)
+include(Platform/Linux-GNU)
 __linux_compiler_gnu(C)
diff --git a/Modules/Platform/Linux-GNU-CXX.cmake b/Modules/Platform/Linux-GNU-CXX.cmake
index 9e4f904f2..416233531 100644
--- a/Modules/Platform/Linux-GNU-CXX.cmake
+++ b/Modules/Platform/Linux-GNU-CXX.cmake
@@ -1,2 +1,2 @@
-INCLUDE(Platform/Linux-GNU)
+include(Platform/Linux-GNU)
 __linux_compiler_gnu(CXX)
diff --git a/Modules/Platform/Linux-GNU-Fortran.cmake b/Modules/Platform/Linux-GNU-Fortran.cmake
index e364c872a..68e95404b 100644
--- a/Modules/Platform/Linux-GNU-Fortran.cmake
+++ b/Modules/Platform/Linux-GNU-Fortran.cmake
@@ -1,2 +1,2 @@
-INCLUDE(Platform/Linux-GNU)
+include(Platform/Linux-GNU)
 __linux_compiler_gnu(Fortran)
diff --git a/Modules/Platform/Linux-Intel-C.cmake b/Modules/Platform/Linux-Intel-C.cmake
index c909e68fc..d1694d64a 100644
--- a/Modules/Platform/Linux-Intel-C.cmake
+++ b/Modules/Platform/Linux-Intel-C.cmake
@@ -1,2 +1,2 @@
-INCLUDE(Platform/Linux-Intel)
+include(Platform/Linux-Intel)
 __linux_compiler_intel(C)
diff --git a/Modules/Platform/Linux-Intel-CXX.cmake b/Modules/Platform/Linux-Intel-CXX.cmake
index 0b7daf475..66df3ac2a 100644
--- a/Modules/Platform/Linux-Intel-CXX.cmake
+++ b/Modules/Platform/Linux-Intel-CXX.cmake
@@ -1,2 +1,2 @@
-INCLUDE(Platform/Linux-Intel)
+include(Platform/Linux-Intel)
 __linux_compiler_intel(CXX)
diff --git a/Modules/Platform/Linux-Intel-Fortran.cmake b/Modules/Platform/Linux-Intel-Fortran.cmake
index 342b5c2fa..bb671eeb2 100644
--- a/Modules/Platform/Linux-Intel-Fortran.cmake
+++ b/Modules/Platform/Linux-Intel-Fortran.cmake
@@ -1,4 +1,4 @@
-INCLUDE(Platform/Linux-Intel)
+include(Platform/Linux-Intel)
 __linux_compiler_intel(Fortran)
 set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS} -i_dynamic -nofor_main")
 set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-i_dynamic")
diff --git a/Modules/Platform/Linux-SunPro-CXX.cmake b/Modules/Platform/Linux-SunPro-CXX.cmake
index 8ee96586d..a07f1ec84 100644
--- a/Modules/Platform/Linux-SunPro-CXX.cmake
+++ b/Modules/Platform/Linux-SunPro-CXX.cmake
@@ -6,4 +6,4 @@ if("${_cxx_flags}" MATCHES "\n-W[^\n]*component")
 else()
   set(CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG "-rpath-link ")
 endif()
-SET(CMAKE_EXE_EXPORTS_CXX_FLAG "--export-dynamic")
+set(CMAKE_EXE_EXPORTS_CXX_FLAG "--export-dynamic")
diff --git a/Modules/Platform/Linux-TinyCC-C.cmake b/Modules/Platform/Linux-TinyCC-C.cmake
index b753268ea..f78e708f9 100644
--- a/Modules/Platform/Linux-TinyCC-C.cmake
+++ b/Modules/Platform/Linux-TinyCC-C.cmake
@@ -1,4 +1,4 @@
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "")
-SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "")
-SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-soname ")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "")
+set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "")
+set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-soname ")
diff --git a/Modules/Platform/Linux-XL-C.cmake b/Modules/Platform/Linux-XL-C.cmake
index b1b07f617..f1c584ce5 100644
--- a/Modules/Platform/Linux-XL-C.cmake
+++ b/Modules/Platform/Linux-XL-C.cmake
@@ -1 +1 @@
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-qmkshrobj")
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-qmkshrobj")
diff --git a/Modules/Platform/Linux-XL-CXX.cmake b/Modules/Platform/Linux-XL-CXX.cmake
index 071a975ed..abd3fa497 100644
--- a/Modules/Platform/Linux-XL-CXX.cmake
+++ b/Modules/Platform/Linux-XL-CXX.cmake
@@ -1 +1 @@
-SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-qmkshrobj")
+set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-qmkshrobj")
diff --git a/Modules/Platform/Linux-XL-Fortran.cmake b/Modules/Platform/Linux-XL-Fortran.cmake
index 5da574e2e..cdd1f702b 100644
--- a/Modules/Platform/Linux-XL-Fortran.cmake
+++ b/Modules/Platform/Linux-XL-Fortran.cmake
@@ -1 +1 @@
-SET(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-qmkshrobj")
+set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-qmkshrobj")
diff --git a/Modules/Platform/Linux-como.cmake b/Modules/Platform/Linux-como.cmake
index 7ea732082..d1550d201 100644
--- a/Modules/Platform/Linux-como.cmake
+++ b/Modules/Platform/Linux-como.cmake
@@ -1,17 +1,17 @@
 # create a shared C++ library
-SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
+set(CMAKE_CXX_CREATE_SHARED_LIBRARY
     "<CMAKE_CXX_COMPILER> --prelink_objects <OBJECTS>"
     "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
 
 # create a C++ static library
-SET(CMAKE_CXX_CREATE_STATIC_LIBRARY
+set(CMAKE_CXX_CREATE_STATIC_LIBRARY
     "<CMAKE_CXX_COMPILER> --prelink_objects <OBJECTS>"
     "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> "
     "<CMAKE_RANLIB> <TARGET> ")
 
-SET(CMAKE_CXX_LINK_EXECUTABLE
+set(CMAKE_CXX_LINK_EXECUTABLE
     "<CMAKE_CXX_COMPILER> --prelink_objects <OBJECTS>"
     "<CMAKE_CXX_COMPILER> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <FLAGS> <OBJECTS>  -o <TARGET> <LINK_LIBRARIES>")
 
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "")
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "")
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "")
diff --git a/Modules/Platform/Linux.cmake b/Modules/Platform/Linux.cmake
index 38f469b33..c1dc6420b 100644
--- a/Modules/Platform/Linux.cmake
+++ b/Modules/Platform/Linux.cmake
@@ -1,22 +1,22 @@
-SET(CMAKE_DL_LIBS "dl")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
-SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
-SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
-SET(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
+set(CMAKE_DL_LIBS "dl")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
+set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
+set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
+set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
 
 # Shared libraries with no builtin soname may not be linked safely by
 # specifying the file path.
-SET(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
+set(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
 
 # Initialize C link type selection flags.  These flags are used when
 # building a shared library, shared module, or executable that links
 # to other libraries to select whether to use the static or shared
 # versions of the libraries.
-FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
-  SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
-  SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
-ENDFOREACH(type)
+foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+  set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
+  set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
+endforeach(type)
 
 # Debian policy requires that shared libraries be installed without
 # executable permission.  Fedora policy requires that shared libraries
@@ -26,32 +26,32 @@ ENDFOREACH(type)
 # default.  In order to support debian packages we provide an option
 # here.  The option default is based on the current distribution, but
 # packagers can set it explicitly on the command line.
-IF(DEFINED CMAKE_INSTALL_SO_NO_EXE)
+if(DEFINED CMAKE_INSTALL_SO_NO_EXE)
   # Store the decision variable in the cache.  This preserves any
   # setting the user provides on the command line.
-  SET(CMAKE_INSTALL_SO_NO_EXE "${CMAKE_INSTALL_SO_NO_EXE}" CACHE INTERNAL
+  set(CMAKE_INSTALL_SO_NO_EXE "${CMAKE_INSTALL_SO_NO_EXE}" CACHE INTERNAL
     "Install .so files without execute permission.")
-ELSE(DEFINED CMAKE_INSTALL_SO_NO_EXE)
+else(DEFINED CMAKE_INSTALL_SO_NO_EXE)
   # Store the decision variable as an internal cache entry to avoid
   # checking the platform every time.  This option is advanced enough
   # that only package maintainers should need to adjust it.  They are
   # capable of providing a setting on the command line.
-  IF(EXISTS "/etc/debian_version")
-    SET(CMAKE_INSTALL_SO_NO_EXE 1 CACHE INTERNAL
+  if(EXISTS "/etc/debian_version")
+    set(CMAKE_INSTALL_SO_NO_EXE 1 CACHE INTERNAL
       "Install .so files without execute permission.")
-  ELSE(EXISTS "/etc/debian_version")
-    SET(CMAKE_INSTALL_SO_NO_EXE 0 CACHE INTERNAL
+  else(EXISTS "/etc/debian_version")
+    set(CMAKE_INSTALL_SO_NO_EXE 0 CACHE INTERNAL
       "Install .so files without execute permission.")
-  ENDIF(EXISTS "/etc/debian_version")
-ENDIF(DEFINED CMAKE_INSTALL_SO_NO_EXE)
+  endif(EXISTS "/etc/debian_version")
+endif(DEFINED CMAKE_INSTALL_SO_NO_EXE)
 
 # Match multiarch library directory names.
-SET(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-linux-gnu[a-z0-9_]*")
+set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-linux-gnu[a-z0-9_]*")
 
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
 
 # Debian has lib64 paths only for compatibility so they should not be
 # searched.
-IF(EXISTS "/etc/debian_version")
-  SET_PROPERTY(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
-ENDIF(EXISTS "/etc/debian_version")
+if(EXISTS "/etc/debian_version")
+  set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
+endif(EXISTS "/etc/debian_version")
diff --git a/Modules/Platform/MP-RAS.cmake b/Modules/Platform/MP-RAS.cmake
index ff22a4fda..ae5fa612e 100644
--- a/Modules/Platform/MP-RAS.cmake
+++ b/Modules/Platform/MP-RAS.cmake
@@ -1,14 +1,14 @@
-IF(CMAKE_SYSTEM MATCHES "MP-RAS-02*.")
-  SET(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC)
-  SET(CMAKE_C_COMPILE_OPTIONS_PIE -K PIE)
-  SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
-ELSE(CMAKE_SYSTEM MATCHES "MP-RAS-02*.")
-  SET(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC)
-  SET(CMAKE_C_COMPILE_OPTIONS_PIE -K PIE)
-  SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
-  SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-Bexport")
-ENDIF(CMAKE_SYSTEM MATCHES "MP-RAS-02*.")
+if(CMAKE_SYSTEM MATCHES "MP-RAS-02*.")
+  set(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC)
+  set(CMAKE_C_COMPILE_OPTIONS_PIE -K PIE)
+  set(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
+else(CMAKE_SYSTEM MATCHES "MP-RAS-02*.")
+  set(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC)
+  set(CMAKE_C_COMPILE_OPTIONS_PIE -K PIE)
+  set(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
+  set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-Bexport")
+endif(CMAKE_SYSTEM MATCHES "MP-RAS-02*.")
 
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
 
 
diff --git a/Modules/Platform/NetBSD.cmake b/Modules/Platform/NetBSD.cmake
index e1b66b84c..24dd15c7a 100644
--- a/Modules/Platform/NetBSD.cmake
+++ b/Modules/Platform/NetBSD.cmake
@@ -1,15 +1,15 @@
-IF(EXISTS /usr/include/dlfcn.h)
-  SET(CMAKE_DL_LIBS "")
-  SET(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
-  SET(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
-  SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")            # -pic
-  SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")       # -shared
-  SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")         # +s, flag for exe link to use shared lib
-  SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")       # -rpath
-  SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")   # : or empty
-  SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
-  SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
-  SET(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
-ENDIF(EXISTS /usr/include/dlfcn.h)
+if(EXISTS /usr/include/dlfcn.h)
+  set(CMAKE_DL_LIBS "")
+  set(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
+  set(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
+  set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")            # -pic
+  set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")       # -shared
+  set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")         # +s, flag for exe link to use shared lib
+  set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")       # -rpath
+  set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")   # : or empty
+  set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
+  set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
+  set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
+endif(EXISTS /usr/include/dlfcn.h)
 
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/OSF1.cmake b/Modules/Platform/OSF1.cmake
index 3017a07c8..e720e4061 100644
--- a/Modules/Platform/OSF1.cmake
+++ b/Modules/Platform/OSF1.cmake
@@ -1,47 +1,47 @@
-SET(CMAKE_DL_LIBS "")
+set(CMAKE_DL_LIBS "")
 
-IF(CMAKE_SYSTEM MATCHES "OSF1-1.[012]")
-ENDIF(CMAKE_SYSTEM MATCHES "OSF1-1.[012]")
-IF(CMAKE_SYSTEM MATCHES "OSF1-1.*")
+if(CMAKE_SYSTEM MATCHES "OSF1-1.[012]")
+endif(CMAKE_SYSTEM MATCHES "OSF1-1.[012]")
+if(CMAKE_SYSTEM MATCHES "OSF1-1.*")
   # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
-  SET(CMAKE_C_COMPILE_OPTIONS_PIC "-fpic")
-  SET(CMAKE_C_COMPILE_OPTIONS_PIE "-fpie")
-  SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fpic")     # -pic
-  SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-fpic")   # -pic
-ENDIF(CMAKE_SYSTEM MATCHES "OSF1-1.*")
+  set(CMAKE_C_COMPILE_OPTIONS_PIC "-fpic")
+  set(CMAKE_C_COMPILE_OPTIONS_PIE "-fpie")
+  set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fpic")     # -pic
+  set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-fpic")   # -pic
+endif(CMAKE_SYSTEM MATCHES "OSF1-1.*")
 
 
 
-IF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
-  SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-expect_unresolved,\\*")       # -shared
-  IF(CMAKE_COMPILER_IS_GNUCXX)
-    SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-Wl,-rpath,")
-  ELSE(CMAKE_COMPILER_IS_GNUCXX)
-    SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-rpath ")
-  ENDIF(CMAKE_COMPILER_IS_GNUCXX)
-  IF(CMAKE_COMPILER_IS_GNUCC)
-    SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
-  ELSE(CMAKE_COMPILER_IS_GNUCC)
-    SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-rpath ")
-  ENDIF(CMAKE_COMPILER_IS_GNUCC)
-  SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
-ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
+if(CMAKE_SYSTEM MATCHES "OSF1-V.*")
+  set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-expect_unresolved,\\*")       # -shared
+  if(CMAKE_COMPILER_IS_GNUCXX)
+    set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-Wl,-rpath,")
+  else(CMAKE_COMPILER_IS_GNUCXX)
+    set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-rpath ")
+  endif(CMAKE_COMPILER_IS_GNUCXX)
+  if(CMAKE_COMPILER_IS_GNUCC)
+    set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
+  else(CMAKE_COMPILER_IS_GNUCC)
+    set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-rpath ")
+  endif(CMAKE_COMPILER_IS_GNUCC)
+  set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
+endif(CMAKE_SYSTEM MATCHES "OSF1-V.*")
 
-SET(CMAKE_MAKE_INCLUDE_FROM_ROOT 1) # include $(CMAKE_BINARY_DIR)/...
+set(CMAKE_MAKE_INCLUDE_FROM_ROOT 1) # include $(CMAKE_BINARY_DIR)/...
 
-IF(CMAKE_COMPILER_IS_GNUCXX)
+if(CMAKE_COMPILER_IS_GNUCXX)
   # include the gcc flags
-ELSE (CMAKE_COMPILER_IS_GNUCXX)
+else (CMAKE_COMPILER_IS_GNUCXX)
   # use default OSF compiler flags
-  SET (CMAKE_C_FLAGS_INIT "")
-  SET (CMAKE_C_FLAGS_DEBUG_INIT "-g")
-  SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-O2 -DNDEBUG")
-  SET (CMAKE_C_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
-  SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2")
-  SET (CMAKE_CXX_FLAGS_INIT "")
-  SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
-  SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O2 -DNDEBUG")
-  SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
-  SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
-ENDIF(CMAKE_COMPILER_IS_GNUCXX)
-INCLUDE(Platform/UnixPaths)
+  set (CMAKE_C_FLAGS_INIT "")
+  set (CMAKE_C_FLAGS_DEBUG_INIT "-g")
+  set (CMAKE_C_FLAGS_MINSIZEREL_INIT "-O2 -DNDEBUG")
+  set (CMAKE_C_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
+  set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2")
+  set (CMAKE_CXX_FLAGS_INIT "")
+  set (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
+  set (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O2 -DNDEBUG")
+  set (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
+  set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
+endif(CMAKE_COMPILER_IS_GNUCXX)
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/OpenBSD.cmake b/Modules/Platform/OpenBSD.cmake
index b4ed66fb0..df240e01b 100644
--- a/Modules/Platform/OpenBSD.cmake
+++ b/Modules/Platform/OpenBSD.cmake
@@ -1,18 +1,18 @@
-INCLUDE(Platform/NetBSD)
+include(Platform/NetBSD)
 
 # On OpenBSD, the compile time linker does not share it's configuration with
 # the runtime linker.  This will extract the library search paths from the
 # system's ld.so.hints file which will allow CMake to set the appropriate
 # -rpath-link flags
-IF(NOT CMAKE_PLATFORM_RUNTIME_PATH)
-  EXECUTE_PROCESS(COMMAND /sbin/ldconfig -r
+if(NOT CMAKE_PLATFORM_RUNTIME_PATH)
+  execute_process(COMMAND /sbin/ldconfig -r
                   OUTPUT_VARIABLE LDCONFIG_HINTS
                   ERROR_QUIET)
-  STRING(REGEX REPLACE ".*search\\ directories:\\ ([^\n]*).*" "\\1"
+  string(REGEX REPLACE ".*search\\ directories:\\ ([^\n]*).*" "\\1"
          LDCONFIG_HINTS "${LDCONFIG_HINTS}")
-  STRING(REGEX REPLACE ":" ";"
+  string(REGEX REPLACE ":" ";"
          CMAKE_PLATFORM_RUNTIME_PATH
          "${LDCONFIG_HINTS}")
-ENDIF()
+endif()
 
-SET_PROPERTY(GLOBAL PROPERTY FIND_LIBRARY_USE_OPENBSD_VERSIONING 1)
+set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_OPENBSD_VERSIONING 1)
diff --git a/Modules/Platform/OpenVMS.cmake b/Modules/Platform/OpenVMS.cmake
index c52effab6..b10da2388 100644
--- a/Modules/Platform/OpenVMS.cmake
+++ b/Modules/Platform/OpenVMS.cmake
@@ -1,8 +1,8 @@
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
 
-SET(CMAKE_C_CREATE_STATIC_LIBRARY
+set(CMAKE_C_CREATE_STATIC_LIBRARY
   "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>"
   "<CMAKE_RANLIB> <TARGET>"
   )
-SET(CMAKE_CXX_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY})
-SET(CMAKE_EXECUTABLE_SUFFIX ".exe")          # .exe
+set(CMAKE_CXX_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY})
+set(CMAKE_EXECUTABLE_SUFFIX ".exe")          # .exe
diff --git a/Modules/Platform/QNX.cmake b/Modules/Platform/QNX.cmake
index 8cdbe02c1..fedc0b41b 100644
--- a/Modules/Platform/QNX.cmake
+++ b/Modules/Platform/QNX.cmake
@@ -1,33 +1,33 @@
-SET(QNXNTO 1)
+set(QNXNTO 1)
 
 # The QNX GCC does not seem to have -isystem so remove the flag.
-SET(CMAKE_INCLUDE_SYSTEM_FLAG_C)
-SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
+set(CMAKE_INCLUDE_SYSTEM_FLAG_C)
+set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
 
-SET(CMAKE_DL_LIBS "")
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "")
-SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "")
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
-SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
-SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
-SET(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
+set(CMAKE_DL_LIBS "")
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "")
+set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "")
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
+set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
+set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
+set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
 
 # Shared libraries with no builtin soname may not be linked safely by
 # specifying the file path.
-SET(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
+set(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
 
 # Initialize C link type selection flags.  These flags are used when
 # building a shared library, shared module, or executable that links
 # to other libraries to select whether to use the static or shared
 # versions of the libraries.
-FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
-  SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
-  SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
-ENDFOREACH(type)
+foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+  set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
+  set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
+endforeach(type)
 # force the language to be c++ since qnx only has gcc and not g++ and c++?
-SET(CMAKE_CXX_COMPILE_OBJECT
+set(CMAKE_CXX_COMPILE_OBJECT
   "<CMAKE_CXX_COMPILER> -x c++ <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
 
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/RISCos.cmake b/Modules/Platform/RISCos.cmake
index 3b2a092bf..570cd7b5b 100644
--- a/Modules/Platform/RISCos.cmake
+++ b/Modules/Platform/RISCos.cmake
@@ -1,6 +1,6 @@
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-G 0")
-SET(CMAKE_SHARED_LIBRARY_SUFFIX "..o")
-SET(CMAKE_DL_LIBS "")
-SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-D,08000000")
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "-G 0")
+set(CMAKE_SHARED_LIBRARY_SUFFIX "..o")
+set(CMAKE_DL_LIBS "")
+set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-D,08000000")
 
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/SCO_SV.cmake b/Modules/Platform/SCO_SV.cmake
index cbdcb7dae..ddd960083 100644
--- a/Modules/Platform/SCO_SV.cmake
+++ b/Modules/Platform/SCO_SV.cmake
@@ -1,2 +1,2 @@
-SET(CMAKE_DL_LIBS "")
-INCLUDE(Platform/UnixPaths)
+set(CMAKE_DL_LIBS "")
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/SINIX.cmake b/Modules/Platform/SINIX.cmake
index e0809f8e3..c37a113d3 100644
--- a/Modules/Platform/SINIX.cmake
+++ b/Modules/Platform/SINIX.cmake
@@ -1,4 +1,4 @@
-SET(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC)
-SET(CMAKE_C_COMPILE_OPTIONS_PIE "")
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
-INCLUDE(Platform/UnixPaths)
+set(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC)
+set(CMAKE_C_COMPILE_OPTIONS_PIE "")
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/SunOS.cmake b/Modules/Platform/SunOS.cmake
index 39cb48cd7..a1fc72f20 100644
--- a/Modules/Platform/SunOS.cmake
+++ b/Modules/Platform/SunOS.cmake
@@ -1,32 +1,32 @@
-IF(CMAKE_SYSTEM MATCHES "SunOS-4.*")
-   SET(CMAKE_C_COMPILE_OPTIONS_PIC "-PIC")
-   SET(CMAKE_C_COMPILE_OPTIONS_PIE "-PIE")
-   SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-PIC")
-   SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-r")
-   SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-R")
-   SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
-ENDIF(CMAKE_SYSTEM MATCHES "SunOS-4.*")
+if(CMAKE_SYSTEM MATCHES "SunOS-4.*")
+   set(CMAKE_C_COMPILE_OPTIONS_PIC "-PIC")
+   set(CMAKE_C_COMPILE_OPTIONS_PIE "-PIE")
+   set(CMAKE_SHARED_LIBRARY_C_FLAGS "-PIC")
+   set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-r")
+   set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-R")
+   set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
+endif(CMAKE_SYSTEM MATCHES "SunOS-4.*")
 
-IF(CMAKE_COMPILER_IS_GNUCXX)
-  IF(CMAKE_COMPILER_IS_GNUCC)
-    SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
+if(CMAKE_COMPILER_IS_GNUCXX)
+  if(CMAKE_COMPILER_IS_GNUCC)
+    set(CMAKE_CXX_CREATE_SHARED_LIBRARY
         "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS>  <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
-  ELSE(CMAKE_COMPILER_IS_GNUCC)
+  else(CMAKE_COMPILER_IS_GNUCC)
     # Take default rule from CMakeDefaultMakeRuleVariables.cmake.
-  ENDIF(CMAKE_COMPILER_IS_GNUCC)
-ENDIF(CMAKE_COMPILER_IS_GNUCXX)
-INCLUDE(Platform/UnixPaths)
+  endif(CMAKE_COMPILER_IS_GNUCC)
+endif(CMAKE_COMPILER_IS_GNUCXX)
+include(Platform/UnixPaths)
 
 # Add the compiler's implicit link directories.
-IF("${CMAKE_C_COMPILER_ID} ${CMAKE_CXX_COMPILER_ID}" MATCHES SunPro)
-  LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
+if("${CMAKE_C_COMPILER_ID} ${CMAKE_CXX_COMPILER_ID}" MATCHES SunPro)
+  list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
     /opt/SUNWspro/lib /opt/SUNWspro/prod/lib /usr/ccs/lib)
-ENDIF("${CMAKE_C_COMPILER_ID} ${CMAKE_CXX_COMPILER_ID}" MATCHES SunPro)
+endif("${CMAKE_C_COMPILER_ID} ${CMAKE_CXX_COMPILER_ID}" MATCHES SunPro)
 
 # The Sun linker needs to find transitive shared library dependencies
 # in the -L path.
-SET(CMAKE_LINK_DEPENDENT_LIBRARY_DIRS 1)
+set(CMAKE_LINK_DEPENDENT_LIBRARY_DIRS 1)
 
 # Shared libraries with no builtin soname may not be linked safely by
 # specifying the file path.
-SET(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
+set(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
diff --git a/Modules/Platform/Tru64.cmake b/Modules/Platform/Tru64.cmake
index cf9d17bfd..47852f8e1 100644
--- a/Modules/Platform/Tru64.cmake
+++ b/Modules/Platform/Tru64.cmake
@@ -1,2 +1,2 @@
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
 
diff --git a/Modules/Platform/ULTRIX.cmake b/Modules/Platform/ULTRIX.cmake
index 154d7e6ac..9db4c7c20 100644
--- a/Modules/Platform/ULTRIX.cmake
+++ b/Modules/Platform/ULTRIX.cmake
@@ -1,5 +1,5 @@
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-G 0")
-SET(CMAKE_SHARED_LIBRARY_SUFFIX "..o")
-SET(CMAKE_DL_LIBS "")
-SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-D,08000000")
-INCLUDE(Platform/UnixPaths)
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "-G 0")
+set(CMAKE_SHARED_LIBRARY_SUFFIX "..o")
+set(CMAKE_DL_LIBS "")
+set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-D,08000000")
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/UNIX_SV.cmake b/Modules/Platform/UNIX_SV.cmake
index 869b3a6a0..1ec96aea2 100644
--- a/Modules/Platform/UNIX_SV.cmake
+++ b/Modules/Platform/UNIX_SV.cmake
@@ -1,5 +1,5 @@
-SET(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC)
-SET(CMAKE_C_COMPILE_OPTIONS_PIE "")
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
-SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-Bexport")
-INCLUDE(Platform/UnixPaths)
+set(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC)
+set(CMAKE_C_COMPILE_OPTIONS_PIE "")
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
+set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-Bexport")
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake
index 6aef11180..ccb266330 100644
--- a/Modules/Platform/UnixPaths.cmake
+++ b/Modules/Platform/UnixPaths.cmake
@@ -17,21 +17,21 @@
 # "CMakeSystemSpecificInformation.cmake" already included it.
 # The extra inclusion is a work-around documented next to the include()
 # call, so this can be removed when the work-around is removed.
-IF(__UNIX_PATHS_INCLUDED)
-  RETURN()
-ENDIF()
-SET(__UNIX_PATHS_INCLUDED 1)
+if(__UNIX_PATHS_INCLUDED)
+  return()
+endif()
+set(__UNIX_PATHS_INCLUDED 1)
 
-SET(UNIX 1)
+set(UNIX 1)
 
 # also add the install directory of the running cmake to the search directories
 # CMAKE_ROOT is CMAKE_INSTALL_PREFIX/share/cmake, so we need to go two levels up
-GET_FILENAME_COMPONENT(_CMAKE_INSTALL_DIR "${CMAKE_ROOT}" PATH)
-GET_FILENAME_COMPONENT(_CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" PATH)
+get_filename_component(_CMAKE_INSTALL_DIR "${CMAKE_ROOT}" PATH)
+get_filename_component(_CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" PATH)
 
 # List common installation prefixes.  These will be used for all
 # search types.
-LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH
+list(APPEND CMAKE_SYSTEM_PREFIX_PATH
   # Standard
   /usr/local /usr /
 
@@ -43,7 +43,7 @@ LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH
   )
 
 # List common include file locations not under the common prefixes.
-LIST(APPEND CMAKE_SYSTEM_INCLUDE_PATH
+list(APPEND CMAKE_SYSTEM_INCLUDE_PATH
   # Windows API on Cygwin
   /usr/include/w32api
 
@@ -56,7 +56,7 @@ LIST(APPEND CMAKE_SYSTEM_INCLUDE_PATH
   /usr/openwin/include
   )
 
-LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH
+list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
   # Windows API on Cygwin
   /usr/lib/w32api
 
@@ -69,20 +69,20 @@ LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH
   /usr/openwin/lib
   )
 
-LIST(APPEND CMAKE_SYSTEM_PROGRAM_PATH
+list(APPEND CMAKE_SYSTEM_PROGRAM_PATH
   /usr/pkg/bin
   )
 
-LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
+list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
   /lib /usr/lib /usr/lib32 /usr/lib64
   )
 
-LIST(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
+list(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
   /usr/include
   )
-LIST(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
+list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
   /usr/include
   )
 
 # Enable use of lib64 search path variants by default.
-SET_PROPERTY(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)
+set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)
diff --git a/Modules/Platform/UnixWare.cmake b/Modules/Platform/UnixWare.cmake
index 3112ee1ef..e649bd2a4 100644
--- a/Modules/Platform/UnixWare.cmake
+++ b/Modules/Platform/UnixWare.cmake
@@ -1,5 +1,5 @@
-SET(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC)
-SET(CMAKE_C_COMPILE_OPTIONS_PIE "")
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-Wl,-Bexport")
-INCLUDE(Platform/UnixPaths)
+set(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC)
+set(CMAKE_C_COMPILE_OPTIONS_PIE "")
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-Wl,-Bexport")
+include(Platform/UnixPaths)
diff --git a/Modules/Platform/Windows-Embarcadero.cmake b/Modules/Platform/Windows-Embarcadero.cmake
index 62e8eb704..1662ac969 100644
--- a/Modules/Platform/Windows-Embarcadero.cmake
+++ b/Modules/Platform/Windows-Embarcadero.cmake
@@ -18,7 +18,7 @@ if(__WINDOWS_EMBARCADERO)
 endif()
 set(__WINDOWS_EMBARCADERO 1)
 
-SET(BORLAND 1)
+set(BORLAND 1)
 
 if("${CMAKE_${_lang}_COMPILER_VERSION}" VERSION_LESS 6.30)
   # Borland target type flags (bcc32 -h -t):
@@ -43,36 +43,36 @@ endif()
 set(_COMPILE_C "-c")
 set(_COMPILE_CXX "-P -c")
 
-SET(CMAKE_LIBRARY_PATH_FLAG "-L")
-SET(CMAKE_LINK_LIBRARY_FLAG "")
+set(CMAKE_LIBRARY_PATH_FLAG "-L")
+set(CMAKE_LINK_LIBRARY_FLAG "")
 
-SET(CMAKE_FIND_LIBRARY_SUFFIXES "-bcc.lib" ".lib")
+set(CMAKE_FIND_LIBRARY_SUFFIXES "-bcc.lib" ".lib")
 
 # uncomment these out to debug makefiles
-#SET(CMAKE_START_TEMP_FILE "")
-#SET(CMAKE_END_TEMP_FILE "")
-#SET(CMAKE_VERBOSE_MAKEFILE 1)
+#set(CMAKE_START_TEMP_FILE "")
+#set(CMAKE_END_TEMP_FILE "")
+#set(CMAKE_VERBOSE_MAKEFILE 1)
 
 # Borland cannot handle + in the file name, so mangle object file name
-SET (CMAKE_MANGLE_OBJECT_FILE_NAMES "ON")
+set (CMAKE_MANGLE_OBJECT_FILE_NAMES "ON")
 
 # extra flags for a win32 exe
-SET(CMAKE_CREATE_WIN32_EXE "${_tW}" )
+set(CMAKE_CREATE_WIN32_EXE "${_tW}" )
 # extra flags for a console app
-SET(CMAKE_CREATE_CONSOLE_EXE "${_tC}" )
+set(CMAKE_CREATE_CONSOLE_EXE "${_tC}" )
 
-SET (CMAKE_BUILD_TYPE Debug CACHE STRING
+set (CMAKE_BUILD_TYPE Debug CACHE STRING
      "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel.")
 
-SET (CMAKE_EXE_LINKER_FLAGS_INIT "${_tM} -lS:10000000 -lSc:10000000 ")
-SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "-v")
-SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "-v")
-SET (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT})
-SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT})
+set (CMAKE_EXE_LINKER_FLAGS_INIT "${_tM} -lS:10000000 -lSc:10000000 ")
+set (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "-v")
+set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "-v")
+set (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT})
+set (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
+set (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT})
 
 
 macro(__embarcadero_language lang)
diff --git a/Modules/Platform/Windows-Intel-Fortran.cmake b/Modules/Platform/Windows-Intel-Fortran.cmake
index 5c016a8fd..40523ffe5 100644
--- a/Modules/Platform/Windows-Intel-Fortran.cmake
+++ b/Modules/Platform/Windows-Intel-Fortran.cmake
@@ -4,8 +4,8 @@ set(_COMPILE_Fortran " /fpp")
 set(CMAKE_Fortran_MODDIR_FLAG "-module:")
 set(CMAKE_Fortran_STANDARD_LIBRARIES_INIT "user32.lib")
 __windows_compiler_intel(Fortran)
-SET (CMAKE_Fortran_FLAGS_INIT "/W1 /nologo /fpp /libs:dll /threads")
-SET (CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full /dbglibs")
-SET (CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/O1 /D NDEBUG")
-SET (CMAKE_Fortran_FLAGS_RELEASE_INIT "/O2 /D NDEBUG")
-SET (CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/O2 /debug:full /D NDEBUG")
+set (CMAKE_Fortran_FLAGS_INIT "/W1 /nologo /fpp /libs:dll /threads")
+set (CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full /dbglibs")
+set (CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/O1 /D NDEBUG")
+set (CMAKE_Fortran_FLAGS_RELEASE_INIT "/O2 /D NDEBUG")
+set (CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/O2 /debug:full /D NDEBUG")
diff --git a/Modules/Platform/Windows-Intel.cmake b/Modules/Platform/Windows-Intel.cmake
index 16b3c814b..ec78886e1 100644
--- a/Modules/Platform/Windows-Intel.cmake
+++ b/Modules/Platform/Windows-Intel.cmake
@@ -19,65 +19,65 @@ endif()
 set(__WINDOWS_INTEL 1)
 
 # make sure to enable languages after setting configuration types
-ENABLE_LANGUAGE(RC)
-SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
+enable_language(RC)
+set(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
 
-SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:")
-SET(CMAKE_LINK_LIBRARY_FLAG "")
-SET(WIN32 1)
-IF(CMAKE_VERBOSE_MAKEFILE)
-  SET(CMAKE_CL_NOLOGO)
-ELSE(CMAKE_VERBOSE_MAKEFILE)
-  SET(CMAKE_CL_NOLOGO "/nologo")
-ENDIF(CMAKE_VERBOSE_MAKEFILE)
-SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
-SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows)
-SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console)
+set(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:")
+set(CMAKE_LINK_LIBRARY_FLAG "")
+set(WIN32 1)
+if(CMAKE_VERBOSE_MAKEFILE)
+  set(CMAKE_CL_NOLOGO)
+else(CMAKE_VERBOSE_MAKEFILE)
+  set(CMAKE_CL_NOLOGO "/nologo")
+endif(CMAKE_VERBOSE_MAKEFILE)
+set(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
+set(CMAKE_CREATE_WIN32_EXE /subsystem:windows)
+set(CMAKE_CREATE_CONSOLE_EXE /subsystem:console)
 
 # default to Debug builds
-#SET(CMAKE_BUILD_TYPE_INIT Debug)
-SET(CMAKE_BUILD_TYPE_INIT Release)
+#set(CMAKE_BUILD_TYPE_INIT Debug)
+set(CMAKE_BUILD_TYPE_INIT Release)
 
-SET(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib")
-SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
+set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib")
+set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
 
 # executable linker flags
-SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:")
-IF(MSVC_C_ARCHITECTURE_ID)
-  SET(_MACHINE_ARCH_FLAG "/machine:${MSVC_C_ARCHITECTURE_ID}")
-ELSEIF(MSVC_CXX_ARCHITECTURE_ID)
-  SET(_MACHINE_ARCH_FLAG "/machine:${MSVC_CXX_ARCHITECTURE_ID}")
-ELSEIF(MSVC_Fortran_ARCHITECTURE_ID)
-  SET(_MACHINE_ARCH_FLAG "/machine:${MSVC_Fortran_ARCHITECTURE_ID}")
-ENDIF()
-SET (CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /INCREMENTAL:YES ${_MACHINE_ARCH_FLAG}")
-SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug")
-SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug")
+set (CMAKE_LINK_DEF_FILE_FLAG "/DEF:")
+if(MSVC_C_ARCHITECTURE_ID)
+  set(_MACHINE_ARCH_FLAG "/machine:${MSVC_C_ARCHITECTURE_ID}")
+elseif(MSVC_CXX_ARCHITECTURE_ID)
+  set(_MACHINE_ARCH_FLAG "/machine:${MSVC_CXX_ARCHITECTURE_ID}")
+elseif(MSVC_Fortran_ARCHITECTURE_ID)
+  set(_MACHINE_ARCH_FLAG "/machine:${MSVC_Fortran_ARCHITECTURE_ID}")
+endif()
+set (CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /INCREMENTAL:YES ${_MACHINE_ARCH_FLAG}")
+set (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug")
+set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug")
 
-SET (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT})
-SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT})
+set (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT})
+set (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
+set (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT})
 
-INCLUDE("${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake" OPTIONAL)
+include("${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake" OPTIONAL)
 
-IF(NOT _INTEL_XILINK_TEST_RUN)
-  EXECUTE_PROCESS(COMMAND xilink /?
+if(NOT _INTEL_XILINK_TEST_RUN)
+  execute_process(COMMAND xilink /?
     ERROR_VARIABLE _XILINK_ERR
     OUTPUT_VARIABLE _XILINK_HELP)
-  IF(_XILINK_HELP MATCHES MANIFEST)
-    SET(_INTEL_COMPILER_SUPPORTS_MANIFEST 1)
-  ENDIF(_XILINK_HELP MATCHES MANIFEST)
-  IF(NOT  EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake")
-    FILE(WRITE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake
+  if(_XILINK_HELP MATCHES MANIFEST)
+    set(_INTEL_COMPILER_SUPPORTS_MANIFEST 1)
+  endif(_XILINK_HELP MATCHES MANIFEST)
+  if(NOT  EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake")
+    file(WRITE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake
       "
-SET(_INTEL_XILINK_TEST_RUN 1)
-SET(_INTEL_COMPILER_SUPPORTS_MANIFEST ${_INTEL_COMPILER_SUPPORTS_MANIFEST})
+set(_INTEL_XILINK_TEST_RUN 1)
+set(_INTEL_COMPILER_SUPPORTS_MANIFEST ${_INTEL_COMPILER_SUPPORTS_MANIFEST})
 ")
-  ENDIF(NOT  EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake")
-ENDIF(NOT _INTEL_XILINK_TEST_RUN)
+  endif(NOT  EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake")
+endif(NOT _INTEL_XILINK_TEST_RUN)
 
 macro(__windows_compiler_intel lang)
   set(CMAKE_${lang}_COMPILE_OBJECT
@@ -98,11 +98,11 @@ macro(__windows_compiler_intel lang)
   set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "/DNDEBUG /MD /Zi /O2")
 
   if(_INTEL_COMPILER_SUPPORTS_MANIFEST)
-    SET(CMAKE_${lang}_LINK_EXECUTABLE
+    set(CMAKE_${lang}_LINK_EXECUTABLE
       "<CMAKE_COMMAND> -E vs_link_exe ${CMAKE_${lang}_LINK_EXECUTABLE}")
-    SET(CMAKE_${lang}_CREATE_SHARED_LIBRARY
+    set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
       "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_${lang}_CREATE_SHARED_LIBRARY}")
-    SET(CMAKE_${lang}_CREATE_SHARED_MODULE
+    set(CMAKE_${lang}_CREATE_SHARED_MODULE
       "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_${lang}_CREATE_SHARED_MODULE}")
   endif()
 endmacro()
diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake
index 34b11253e..216419f78 100644
--- a/Modules/Platform/Windows-cl.cmake
+++ b/Modules/Platform/Windows-cl.cmake
@@ -1,32 +1,32 @@
 # try to load any previously computed information for C on this platform
-INCLUDE( ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake OPTIONAL)
+include( ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake OPTIONAL)
 # try to load any previously computed information for CXX on this platform
-INCLUDE( ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake OPTIONAL)
+include( ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake OPTIONAL)
 
-SET(WIN32 1)
+set(WIN32 1)
 
-INCLUDE(Platform/cl)
+include(Platform/cl)
 
-SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows)
-SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console)
+set(CMAKE_CREATE_WIN32_EXE /subsystem:windows)
+set(CMAKE_CREATE_CONSOLE_EXE /subsystem:console)
 
-IF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
-   SET (CMAKE_NO_BUILD_TYPE 1)
-ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
-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
+if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
+   set (CMAKE_NO_BUILD_TYPE 1)
+endif(CMAKE_GENERATOR MATCHES "Visual Studio 6")
+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(NOT CMAKE_NO_BUILD_TYPE AND CMAKE_GENERATOR MATCHES "Visual Studio")
+  mark_as_advanced(CMAKE_CONFIGURATION_TYPES)
+endif(NOT CMAKE_NO_BUILD_TYPE AND CMAKE_GENERATOR MATCHES "Visual Studio")
 # does the compiler support pdbtype and is it the newer compiler
-IF(CMAKE_GENERATOR MATCHES  "Visual Studio 8")
-  SET(CMAKE_COMPILER_2005 1)
-ENDIF(CMAKE_GENERATOR MATCHES  "Visual Studio 8")
+if(CMAKE_GENERATOR MATCHES  "Visual Studio 8")
+  set(CMAKE_COMPILER_2005 1)
+endif(CMAKE_GENERATOR MATCHES  "Visual Studio 8")
 
 # make sure to enable languages after setting configuration types
-ENABLE_LANGUAGE(RC)
-SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
+enable_language(RC)
+set(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
 
 # for nmake we need to compute some information about the compiler
 # that is being used.
@@ -36,218 +36,218 @@ SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
 # test results are saved in CMakeCPlatform.cmake, a file
 # that is automatically copied into try_compile directories
 # by the global generator.
-SET(MSVC_IDE 1)
-IF(CMAKE_GENERATOR MATCHES "Makefiles" OR CMAKE_GENERATOR MATCHES "Ninja")
-  SET(MSVC_IDE 0)
-  IF(NOT CMAKE_VC_COMPILER_TESTS_RUN)
-    SET(CMAKE_VC_COMPILER_TESTS 1)
-    SET(testNmakeCLVersionFile
+set(MSVC_IDE 1)
+if(CMAKE_GENERATOR MATCHES "Makefiles" OR CMAKE_GENERATOR MATCHES "Ninja")
+  set(MSVC_IDE 0)
+  if(NOT CMAKE_VC_COMPILER_TESTS_RUN)
+    set(CMAKE_VC_COMPILER_TESTS 1)
+    set(testNmakeCLVersionFile
       "${CMAKE_ROOT}/Modules/CMakeTestNMakeCLVersion.c")
-    STRING(REGEX REPLACE "/" "\\\\" testNmakeCLVersionFile "${testNmakeCLVersionFile}")
-    MESSAGE(STATUS "Check for CL compiler version")
-    SET(CMAKE_TEST_COMPILER ${CMAKE_C_COMPILER})
-    IF (NOT CMAKE_C_COMPILER)
-      SET(CMAKE_TEST_COMPILER ${CMAKE_CXX_COMPILER})
-    ENDIF(NOT CMAKE_C_COMPILER)
-    EXEC_PROGRAM(${CMAKE_TEST_COMPILER}
+    string(REGEX REPLACE "/" "\\\\" testNmakeCLVersionFile "${testNmakeCLVersionFile}")
+    message(STATUS "Check for CL compiler version")
+    set(CMAKE_TEST_COMPILER ${CMAKE_C_COMPILER})
+    if (NOT CMAKE_C_COMPILER)
+      set(CMAKE_TEST_COMPILER ${CMAKE_CXX_COMPILER})
+    endif(NOT CMAKE_C_COMPILER)
+    exec_program(${CMAKE_TEST_COMPILER}
       ARGS /nologo -EP \"${testNmakeCLVersionFile}\"
       OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT
       RETURN_VALUE CMAKE_COMPILER_RETURN
       )
-    IF(NOT CMAKE_COMPILER_RETURN)
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    if(NOT CMAKE_COMPILER_RETURN)
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining the version of compiler passed with the following output:\n"
         "${CMAKE_COMPILER_OUTPUT}\n\n")
-      STRING(REGEX REPLACE "\n" " " compilerVersion "${CMAKE_COMPILER_OUTPUT}")
-      STRING(REGEX REPLACE ".*VERSION=(.*)" "\\1"
+      string(REGEX REPLACE "\n" " " compilerVersion "${CMAKE_COMPILER_OUTPUT}")
+      string(REGEX REPLACE ".*VERSION=(.*)" "\\1"
         compilerVersion "${compilerVersion}")
-      MESSAGE(STATUS "Check for CL compiler version - ${compilerVersion}")
-      SET(MSVC60)
-      SET(MSVC70)
-      SET(MSVC71)
-      SET(MSVC80)
-      SET(CMAKE_COMPILER_2005)
-      IF("${compilerVersion}" LESS 1300)
-        SET(MSVC60 1)
-        SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 1)
-      ENDIF("${compilerVersion}" LESS 1300)
-      IF("${compilerVersion}" EQUAL 1300)
-        SET(MSVC70 1)
-        SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0)
-      ENDIF("${compilerVersion}" EQUAL 1300)
-      IF("${compilerVersion}" EQUAL 1310)
-        SET(MSVC71 1)
-        SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0)
-      ENDIF("${compilerVersion}" EQUAL 1310)
-      IF("${compilerVersion}" EQUAL 1400)
-        SET(MSVC80 1)
-        SET(CMAKE_COMPILER_2005 1)
-      ENDIF("${compilerVersion}" EQUAL 1400)
-      IF("${compilerVersion}" EQUAL 1500)
-        SET(MSVC90 1)
-      ENDIF("${compilerVersion}" EQUAL 1500)
-      IF("${compilerVersion}" EQUAL 1600)
-        SET(MSVC10 1)
-      ENDIF("${compilerVersion}" EQUAL 1600)
-      SET(MSVC_VERSION "${compilerVersion}")
-    ELSE(NOT CMAKE_COMPILER_RETURN)
-      MESSAGE(STATUS "Check for CL compiler version - failed")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+      message(STATUS "Check for CL compiler version - ${compilerVersion}")
+      set(MSVC60)
+      set(MSVC70)
+      set(MSVC71)
+      set(MSVC80)
+      set(CMAKE_COMPILER_2005)
+      if("${compilerVersion}" LESS 1300)
+        set(MSVC60 1)
+        set(CMAKE_COMPILER_SUPPORTS_PDBTYPE 1)
+      endif("${compilerVersion}" LESS 1300)
+      if("${compilerVersion}" EQUAL 1300)
+        set(MSVC70 1)
+        set(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0)
+      endif("${compilerVersion}" EQUAL 1300)
+      if("${compilerVersion}" EQUAL 1310)
+        set(MSVC71 1)
+        set(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0)
+      endif("${compilerVersion}" EQUAL 1310)
+      if("${compilerVersion}" EQUAL 1400)
+        set(MSVC80 1)
+        set(CMAKE_COMPILER_2005 1)
+      endif("${compilerVersion}" EQUAL 1400)
+      if("${compilerVersion}" EQUAL 1500)
+        set(MSVC90 1)
+      endif("${compilerVersion}" EQUAL 1500)
+      if("${compilerVersion}" EQUAL 1600)
+        set(MSVC10 1)
+      endif("${compilerVersion}" EQUAL 1600)
+      set(MSVC_VERSION "${compilerVersion}")
+    else(NOT CMAKE_COMPILER_RETURN)
+      message(STATUS "Check for CL compiler version - failed")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining the version of compiler failed with the following output:\n"
         "${CMAKE_COMPILER_OUTPUT}\n\n")
-    ENDIF(NOT CMAKE_COMPILER_RETURN)
+    endif(NOT CMAKE_COMPILER_RETURN)
     # try to figure out if we are running the free command line
     # tools from Microsoft.  These tools do not provide debug libraries,
     # so the link flags used have to be different.
-    MAKE_DIRECTORY("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp2")
-    SET(testForFreeVCFile
+    make_directory("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp2")
+    set(testForFreeVCFile
       "${CMAKE_ROOT}/Modules/CMakeTestForFreeVC.cxx")
-    STRING(REGEX REPLACE "/" "\\\\" testForFreeVCFile "${testForFreeVCFile}")
-    MESSAGE(STATUS "Check if this is a free VC compiler")
-    EXEC_PROGRAM(${CMAKE_TEST_COMPILER} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp2
+    string(REGEX REPLACE "/" "\\\\" testForFreeVCFile "${testForFreeVCFile}")
+    message(STATUS "Check if this is a free VC compiler")
+    exec_program(${CMAKE_TEST_COMPILER} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp2
       ARGS /nologo /MD /EHsc
       \"${testForFreeVCFile}\"
       OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT
       RETURN_VALUE CMAKE_COMPILER_RETURN
       )
-    IF(CMAKE_COMPILER_RETURN)
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+    if(CMAKE_COMPILER_RETURN)
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if this is a free VC compiler failed with the following output:\n"
         "${CMAKE_COMPILER_OUTPUT}\n\n")
-      MESSAGE(STATUS "Check if this is a free VC compiler - yes")
-      SET(CMAKE_USING_VC_FREE_TOOLS 1)
-    ELSE(CMAKE_COMPILER_RETURN)
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+      message(STATUS "Check if this is a free VC compiler - yes")
+      set(CMAKE_USING_VC_FREE_TOOLS 1)
+    else(CMAKE_COMPILER_RETURN)
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if this is a free VC compiler passed with the following output:\n"
         "${CMAKE_COMPILER_OUTPUT}\n\n")
-      MESSAGE(STATUS "Check if this is a free VC compiler - no")
-      SET(CMAKE_USING_VC_FREE_TOOLS 0)
-    ENDIF(CMAKE_COMPILER_RETURN)
-    MAKE_DIRECTORY("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3")
-  ENDIF(NOT CMAKE_VC_COMPILER_TESTS_RUN)
-ENDIF(CMAKE_GENERATOR MATCHES "Makefiles" OR CMAKE_GENERATOR MATCHES "Ninja")
+      message(STATUS "Check if this is a free VC compiler - no")
+      set(CMAKE_USING_VC_FREE_TOOLS 0)
+    endif(CMAKE_COMPILER_RETURN)
+    make_directory("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3")
+  endif(NOT CMAKE_VC_COMPILER_TESTS_RUN)
+endif(CMAKE_GENERATOR MATCHES "Makefiles" OR CMAKE_GENERATOR MATCHES "Ninja")
 
-IF(MSVC_C_ARCHITECTURE_ID MATCHES 64)
-  SET(CMAKE_CL_64 1)
-ELSE(MSVC_C_ARCHITECTURE_ID MATCHES 64)
-  SET(CMAKE_CL_64 0)
-ENDIF(MSVC_C_ARCHITECTURE_ID MATCHES 64)
-IF(CMAKE_FORCE_WIN64 OR CMAKE_FORCE_IA64)
-  SET(CMAKE_CL_64 1)
-ENDIF(CMAKE_FORCE_WIN64 OR CMAKE_FORCE_IA64)
+if(MSVC_C_ARCHITECTURE_ID MATCHES 64)
+  set(CMAKE_CL_64 1)
+else(MSVC_C_ARCHITECTURE_ID MATCHES 64)
+  set(CMAKE_CL_64 0)
+endif(MSVC_C_ARCHITECTURE_ID MATCHES 64)
+if(CMAKE_FORCE_WIN64 OR CMAKE_FORCE_IA64)
+  set(CMAKE_CL_64 1)
+endif(CMAKE_FORCE_WIN64 OR CMAKE_FORCE_IA64)
 
-IF("${MSVC_VERSION}" GREATER 1599)
-  SET(MSVC_INCREMENTAL_DEFAULT ON)
-ENDIF()
+if("${MSVC_VERSION}" GREATER 1599)
+  set(MSVC_INCREMENTAL_DEFAULT ON)
+endif()
 
 # default to Debug builds
-IF(MSVC_VERSION GREATER 1310)
+if(MSVC_VERSION GREATER 1310)
   # for 2005 make sure the manifest is put in the dll with mt
-  SET(CMAKE_CXX_CREATE_SHARED_LIBRARY "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
-  SET(CMAKE_CXX_CREATE_SHARED_MODULE "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_CXX_CREATE_SHARED_MODULE}")
+  set(CMAKE_CXX_CREATE_SHARED_LIBRARY "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
+  set(CMAKE_CXX_CREATE_SHARED_MODULE "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_CXX_CREATE_SHARED_MODULE}")
   # create a C shared library
-  SET(CMAKE_C_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
+  set(CMAKE_C_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
   # create a C shared module just copy the shared library rule
-  SET(CMAKE_C_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_MODULE}")
-  SET(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_COMMAND> -E vs_link_exe ${CMAKE_CXX_LINK_EXECUTABLE}")
-  SET(CMAKE_C_LINK_EXECUTABLE "<CMAKE_COMMAND> -E vs_link_exe ${CMAKE_C_LINK_EXECUTABLE}")
+  set(CMAKE_C_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_MODULE}")
+  set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_COMMAND> -E vs_link_exe ${CMAKE_CXX_LINK_EXECUTABLE}")
+  set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_COMMAND> -E vs_link_exe ${CMAKE_C_LINK_EXECUTABLE}")
 
-  SET(CMAKE_BUILD_TYPE_INIT Debug)
-  SET (CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR")
-  SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1")
-  SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
-  SET (CMAKE_CXX_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
-  SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
-  SET (CMAKE_C_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000")
-  SET (CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi  /Ob0 /Od /RTC1")
-  SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
-  SET (CMAKE_C_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
-  SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
-  SET (CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ")
-  SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT}")
-ELSE(MSVC_VERSION GREATER 1310)
-  IF(CMAKE_USING_VC_FREE_TOOLS)
-    MESSAGE(STATUS "Using FREE VC TOOLS, NO DEBUG available")
-    SET(CMAKE_BUILD_TYPE_INIT Release)
-    SET (CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR")
-    SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MTd /Zi  /Ob0 /Od /GZ")
-    SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "/MT /O1 /Ob1 /D NDEBUG")
-    SET (CMAKE_CXX_FLAGS_RELEASE_INIT "/MT /O2 /Ob2 /D NDEBUG")
-    SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2 /Ob1 /D NDEBUG")
-    SET (CMAKE_C_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000")
-    SET (CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MTd /Zi  /Ob0 /Od /GZ")
-    SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MT /O1 /Ob1 /D NDEBUG")
-    SET (CMAKE_C_FLAGS_RELEASE_INIT "/MT /O2 /Ob2 /D NDEBUG")
-    SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2 /Ob1 /D NDEBUG")
-  ELSE(CMAKE_USING_VC_FREE_TOOLS)
-    SET(CMAKE_BUILD_TYPE_INIT Debug)
-    SET (CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR")
-    SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi  /Ob0 /Od /GZ")
-    SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
-    SET (CMAKE_CXX_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
-    SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
-    SET (CMAKE_C_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000")
-    SET (CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od /GZ")
-    SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
-    SET (CMAKE_C_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
-    SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
-  ENDIF(CMAKE_USING_VC_FREE_TOOLS)
-  SET (CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib")
-ENDIF(MSVC_VERSION GREATER 1310)
+  set(CMAKE_BUILD_TYPE_INIT Debug)
+  set (CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR")
+  set (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1")
+  set (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
+  set (CMAKE_CXX_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
+  set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
+  set (CMAKE_C_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000")
+  set (CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi  /Ob0 /Od /RTC1")
+  set (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
+  set (CMAKE_C_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
+  set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
+  set (CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ")
+  set (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT}")
+else(MSVC_VERSION GREATER 1310)
+  if(CMAKE_USING_VC_FREE_TOOLS)
+    message(STATUS "Using FREE VC TOOLS, NO DEBUG available")
+    set(CMAKE_BUILD_TYPE_INIT Release)
+    set (CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR")
+    set (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MTd /Zi  /Ob0 /Od /GZ")
+    set (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "/MT /O1 /Ob1 /D NDEBUG")
+    set (CMAKE_CXX_FLAGS_RELEASE_INIT "/MT /O2 /Ob2 /D NDEBUG")
+    set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2 /Ob1 /D NDEBUG")
+    set (CMAKE_C_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000")
+    set (CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MTd /Zi  /Ob0 /Od /GZ")
+    set (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MT /O1 /Ob1 /D NDEBUG")
+    set (CMAKE_C_FLAGS_RELEASE_INIT "/MT /O2 /Ob2 /D NDEBUG")
+    set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2 /Ob1 /D NDEBUG")
+  else(CMAKE_USING_VC_FREE_TOOLS)
+    set(CMAKE_BUILD_TYPE_INIT Debug)
+    set (CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR")
+    set (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi  /Ob0 /Od /GZ")
+    set (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
+    set (CMAKE_CXX_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
+    set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
+    set (CMAKE_C_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000")
+    set (CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od /GZ")
+    set (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
+    set (CMAKE_C_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
+    set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
+  endif(CMAKE_USING_VC_FREE_TOOLS)
+  set (CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib")
+endif(MSVC_VERSION GREATER 1310)
 
-SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
+set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
 
 # executable linker flags
-SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:")
+set (CMAKE_LINK_DEF_FILE_FLAG "/DEF:")
 # set the stack size and the machine type
-SET(_MACHINE_ARCH_FLAG ${MSVC_C_ARCHITECTURE_ID})
-IF(NOT _MACHINE_ARCH_FLAG)
-  SET(_MACHINE_ARCH_FLAG ${MSVC_CXX_ARCHITECTURE_ID})
-ENDIF(NOT _MACHINE_ARCH_FLAG)
-SET (CMAKE_EXE_LINKER_FLAGS_INIT
+set(_MACHINE_ARCH_FLAG ${MSVC_C_ARCHITECTURE_ID})
+if(NOT _MACHINE_ARCH_FLAG)
+  set(_MACHINE_ARCH_FLAG ${MSVC_CXX_ARCHITECTURE_ID})
+endif(NOT _MACHINE_ARCH_FLAG)
+set (CMAKE_EXE_LINKER_FLAGS_INIT
     "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:${_MACHINE_ARCH_FLAG}")
 
 # add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtype
 # on versions that support it
-SET( MSVC_INCREMENTAL_YES_FLAG "")
-IF(NOT MSVC_INCREMENTAL_DEFAULT)
-  SET( MSVC_INCREMENTAL_YES_FLAG "/INCREMENTAL:YES")
-ELSE()
-  SET(  MSVC_INCREMENTAL_YES_FLAG "/INCREMENTAL" )
-ENDIF()
+set( MSVC_INCREMENTAL_YES_FLAG "")
+if(NOT MSVC_INCREMENTAL_DEFAULT)
+  set( MSVC_INCREMENTAL_YES_FLAG "/INCREMENTAL:YES")
+else()
+  set(  MSVC_INCREMENTAL_YES_FLAG "/INCREMENTAL" )
+endif()
 
-IF (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
-  SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /pdbtype:sept ${MSVC_INCREMENTAL_YES_FLAG}")
-  SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /pdbtype:sept ${MSVC_INCREMENTAL_YES_FLAG}")
-ELSE (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
-  SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug ${MSVC_INCREMENTAL_YES_FLAG}")
-  SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug ${MSVC_INCREMENTAL_YES_FLAG}")
-ENDIF (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
+if (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
+  set (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /pdbtype:sept ${MSVC_INCREMENTAL_YES_FLAG}")
+  set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /pdbtype:sept ${MSVC_INCREMENTAL_YES_FLAG}")
+else (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
+  set (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug ${MSVC_INCREMENTAL_YES_FLAG}")
+  set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug ${MSVC_INCREMENTAL_YES_FLAG}")
+endif (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
 # for release and minsize release default to no incremental linking
-SET(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT "/INCREMENTAL:NO")
-SET(CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT "/INCREMENTAL:NO")
+set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT "/INCREMENTAL:NO")
+set(CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT "/INCREMENTAL:NO")
 
 # copy the EXE_LINKER flags to SHARED and MODULE linker flags
 # shared linker flags
-SET (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT})
-SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT})
-SET (CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL_INIT ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT})
+set (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT})
+set (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
+set (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
+set (CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT})
+set (CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL_INIT ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT})
 # module linker flags
-SET (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_RELEASE_INIT ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_RELEASE_INIT ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT})
 
 # save computed information for this platform
-IF(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake")
-  CONFIGURE_FILE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake.in
+if(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake")
+  configure_file(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake.in
     ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCPlatform.cmake IMMEDIATE)
-ENDIF(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake")
+endif(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake")
 
-IF(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake")
-  CONFIGURE_FILE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake.in
+if(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake")
+  configure_file(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake.in
                ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXPlatform.cmake IMMEDIATE)
-ENDIF(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake")
+endif(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake")
diff --git a/Modules/Platform/Windows-cl.cmake.in b/Modules/Platform/Windows-cl.cmake.in
index 82a0e595f..4f3ec3ee8 100644
--- a/Modules/Platform/Windows-cl.cmake.in
+++ b/Modules/Platform/Windows-cl.cmake.in
@@ -1,14 +1,14 @@
-SET(CMAKE_VC_COMPILER_TESTS_RUN 1)
-SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE @CMAKE_COMPILER_SUPPORTS_PDBTYPE@)
-SET(CMAKE_COMPILER_2005 @CMAKE_COMPILER_2005@)
-SET(CMAKE_USING_VC_FREE_TOOLS @CMAKE_USING_VC_FREE_TOOLS@)
-SET(CMAKE_CL_64 @CMAKE_CL_64@)
-SET(MSVC60 @MSVC60@)
-SET(MSVC70 @MSVC70@)
-SET(MSVC71 @MSVC71@)
-SET(MSVC80 @MSVC80@)
-SET(MSVC90 @MSVC90@)
-SET(MSVC10 @MSVC10@)
-SET(MSVC_IDE @MSVC_IDE@)
-SET(MSVC_VERSION @MSVC_VERSION@)
-SET(WIN32 1)
+set(CMAKE_VC_COMPILER_TESTS_RUN 1)
+set(CMAKE_COMPILER_SUPPORTS_PDBTYPE @CMAKE_COMPILER_SUPPORTS_PDBTYPE@)
+set(CMAKE_COMPILER_2005 @CMAKE_COMPILER_2005@)
+set(CMAKE_USING_VC_FREE_TOOLS @CMAKE_USING_VC_FREE_TOOLS@)
+set(CMAKE_CL_64 @CMAKE_CL_64@)
+set(MSVC60 @MSVC60@)
+set(MSVC70 @MSVC70@)
+set(MSVC71 @MSVC71@)
+set(MSVC80 @MSVC80@)
+set(MSVC90 @MSVC90@)
+set(MSVC10 @MSVC10@)
+set(MSVC_IDE @MSVC_IDE@)
+set(MSVC_VERSION @MSVC_VERSION@)
+set(WIN32 1)
diff --git a/Modules/Platform/Windows-df.cmake b/Modules/Platform/Windows-df.cmake
index f5046bf35..dff58c575 100644
--- a/Modules/Platform/Windows-df.cmake
+++ b/Modules/Platform/Windows-df.cmake
@@ -1,70 +1,70 @@
 # compiler support for fortran CVF compiler on windows
 
-SET(CMAKE_WINDOWS_OBJECT_PATH 1)
-SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:")
-SET(CMAKE_LINK_LIBRARY_FLAG "")
-SET(WIN32 1)
-IF(CMAKE_VERBOSE_MAKEFILE)
-  SET(CMAKE_CL_NOLOGO)
-ELSE(CMAKE_VERBOSE_MAKEFILE)
-  SET(CMAKE_CL_NOLOGO "/nologo")
-ENDIF(CMAKE_VERBOSE_MAKEFILE)
+set(CMAKE_WINDOWS_OBJECT_PATH 1)
+set(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:")
+set(CMAKE_LINK_LIBRARY_FLAG "")
+set(WIN32 1)
+if(CMAKE_VERBOSE_MAKEFILE)
+  set(CMAKE_CL_NOLOGO)
+else(CMAKE_VERBOSE_MAKEFILE)
+  set(CMAKE_CL_NOLOGO "/nologo")
+endif(CMAKE_VERBOSE_MAKEFILE)
 
-SET(CMAKE_Fortran_MODDIR_FLAG "-module:")
+set(CMAKE_Fortran_MODDIR_FLAG "-module:")
 
-SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY
+set(CMAKE_Fortran_CREATE_SHARED_LIBRARY
  "link ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE}  /out:<TARGET> /dll  <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
 
-SET(CMAKE_Fortran_CREATE_SHARED_MODULE ${CMAKE_Fortran_CREATE_SHARED_LIBRARY})
+set(CMAKE_Fortran_CREATE_SHARED_MODULE ${CMAKE_Fortran_CREATE_SHARED_LIBRARY})
 
 # create a C++ static library
-SET(CMAKE_Fortran_CREATE_STATIC_LIBRARY  "lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
+set(CMAKE_Fortran_CREATE_STATIC_LIBRARY  "lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
 
 # compile a C++ file into an object file
-SET(CMAKE_Fortran_COMPILE_OBJECT
+set(CMAKE_Fortran_COMPILE_OBJECT
     "<CMAKE_Fortran_COMPILER>  ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} /object:<OBJECT> <FLAGS> /compile_only <SOURCE>${CMAKE_END_TEMP_FILE}")
 
-SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
+set(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
 
-SET(CMAKE_Fortran_LINK_EXECUTABLE
+set(CMAKE_Fortran_LINK_EXECUTABLE
     "<CMAKE_Fortran_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /exe:<TARGET> /link <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
 
-SET(CMAKE_CREATE_WIN32_EXE /winapp)
-SET(CMAKE_CREATE_CONSOLE_EXE )
+set(CMAKE_CREATE_WIN32_EXE /winapp)
+set(CMAKE_CREATE_CONSOLE_EXE )
 
-IF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
-   SET (CMAKE_NO_BUILD_TYPE 1)
-ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
-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
+if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
+   set (CMAKE_NO_BUILD_TYPE 1)
+endif(CMAKE_GENERATOR MATCHES "Visual Studio 6")
+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(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8")
+endif(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8")
 # does the compiler support pdbtype and is it the newer compiler
 
-SET(CMAKE_BUILD_TYPE_INIT Debug)
-SET (CMAKE_Fortran_FLAGS_INIT "")
-SET (CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full")
-SET (CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/Optimize:2 /Define:NDEBUG")
-SET (CMAKE_Fortran_FLAGS_RELEASE_INIT "/Optimize:1 /Define:NDEBUG")
-SET (CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/Optimize:1 /debug:full /Define:NDEBUG")
+set(CMAKE_BUILD_TYPE_INIT Debug)
+set (CMAKE_Fortran_FLAGS_INIT "")
+set (CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full")
+set (CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/Optimize:2 /Define:NDEBUG")
+set (CMAKE_Fortran_FLAGS_RELEASE_INIT "/Optimize:1 /Define:NDEBUG")
+set (CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/Optimize:1 /debug:full /Define:NDEBUG")
 
-SET (CMAKE_Fortran_STANDARD_LIBRARIES_INIT "user32.lib")
+set (CMAKE_Fortran_STANDARD_LIBRARIES_INIT "user32.lib")
 
 # executable linker flags
-SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:")
-SET (CMAKE_EXE_LINKER_FLAGS_INIT " /INCREMENTAL:YES")
-IF (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
-  SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /pdbtype:sept")
-  SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /pdbtype:sept")
-ELSE (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
-  SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug")
-  SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug")
-ENDIF (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
+set (CMAKE_LINK_DEF_FILE_FLAG "/DEF:")
+set (CMAKE_EXE_LINKER_FLAGS_INIT " /INCREMENTAL:YES")
+if (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
+  set (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /pdbtype:sept")
+  set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /pdbtype:sept")
+else (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
+  set (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug")
+  set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug")
+endif (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
 
-SET (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT})
-SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT})
-SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT})
+set (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT})
+set (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
+set (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT})
diff --git a/Modules/Platform/Windows-wcl386.cmake b/Modules/Platform/Windows-wcl386.cmake
index 21c4a6907..977531d44 100644
--- a/Modules/Platform/Windows-wcl386.cmake
+++ b/Modules/Platform/Windows-wcl386.cmake
@@ -1,87 +1,87 @@
-SET(CMAKE_LIBRARY_PATH_FLAG "libpath ")
-SET(CMAKE_LINK_LIBRARY_FLAG "library ")
-SET(CMAKE_LINK_LIBRARY_FILE_FLAG "library")
+set(CMAKE_LIBRARY_PATH_FLAG "libpath ")
+set(CMAKE_LINK_LIBRARY_FLAG "library ")
+set(CMAKE_LINK_LIBRARY_FILE_FLAG "library")
 
-IF(CMAKE_VERBOSE_MAKEFILE)
-  SET(CMAKE_WCL_QUIET)
-  SET(CMAKE_WLINK_QUIET)
-  SET(CMAKE_LIB_QUIET)
-ELSE(CMAKE_VERBOSE_MAKEFILE)
-  SET(CMAKE_WCL_QUIET "-zq")
-  SET(CMAKE_WLINK_QUIET "option quiet")
-  SET(CMAKE_LIB_QUIET "-q")
-ENDIF(CMAKE_VERBOSE_MAKEFILE)
+if(CMAKE_VERBOSE_MAKEFILE)
+  set(CMAKE_WCL_QUIET)
+  set(CMAKE_WLINK_QUIET)
+  set(CMAKE_LIB_QUIET)
+else(CMAKE_VERBOSE_MAKEFILE)
+  set(CMAKE_WCL_QUIET "-zq")
+  set(CMAKE_WLINK_QUIET "option quiet")
+  set(CMAKE_LIB_QUIET "-q")
+endif(CMAKE_VERBOSE_MAKEFILE)
 
 set(CMAKE_CREATE_WIN32_EXE "system nt_win" )
-SET(CMAKE_CREATE_CONSOLE_EXE "system nt" )
+set(CMAKE_CREATE_CONSOLE_EXE "system nt" )
 
-SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "debug all" )
-SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT "debug all" )
-SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "debug all" )
-SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT "debug all" )
+set (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "debug all" )
+set (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT "debug all" )
+set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "debug all" )
+set (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT "debug all" )
 
 set(CMAKE_C_COMPILE_OPTIONS_DLL "-bd") # Note: This variable is a ';' separated list
 set(CMAKE_SHARED_LIBRARY_C_FLAGS "-bd") # ... while this is a space separated string.
 
-SET(CMAKE_RC_COMPILER "rc" )
+set(CMAKE_RC_COMPILER "rc" )
 
-SET(CMAKE_BUILD_TYPE_INIT Debug)
-SET (CMAKE_CXX_FLAGS_INIT "-w=3 -xs")
-SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-br -bm -d2")
-SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-br -bm -os -dNDEBUG")
-SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-br -bm -ot -dNDEBUG")
-SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-br -bm  -d2 -ot -dNDEBUG")
-SET (CMAKE_C_FLAGS_INIT "-w=3 ")
-SET (CMAKE_C_FLAGS_DEBUG_INIT "-br -bm -d2 -od")
-SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-br -bm -os -dNDEBUG")
-SET (CMAKE_C_FLAGS_RELEASE_INIT "-br -bm -ot -dNDEBUG")
-SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-br -bm -d2 -ot -dNDEBUG")
-SET (CMAKE_C_STANDARD_LIBRARIES_INIT "library clbrdll.lib library plbrdll.lib  library kernel32.lib library user32.lib library gdi32.lib library winspool.lib library comdlg32.lib library advapi32.lib library shell32.lib library ole32.lib library oleaut32.lib library uuid.lib library odbc32.lib library odbccp32.lib")
-SET (CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
+set(CMAKE_BUILD_TYPE_INIT Debug)
+set (CMAKE_CXX_FLAGS_INIT "-w=3 -xs")
+set (CMAKE_CXX_FLAGS_DEBUG_INIT "-br -bm -d2")
+set (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-br -bm -os -dNDEBUG")
+set (CMAKE_CXX_FLAGS_RELEASE_INIT "-br -bm -ot -dNDEBUG")
+set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-br -bm  -d2 -ot -dNDEBUG")
+set (CMAKE_C_FLAGS_INIT "-w=3 ")
+set (CMAKE_C_FLAGS_DEBUG_INIT "-br -bm -d2 -od")
+set (CMAKE_C_FLAGS_MINSIZEREL_INIT "-br -bm -os -dNDEBUG")
+set (CMAKE_C_FLAGS_RELEASE_INIT "-br -bm -ot -dNDEBUG")
+set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-br -bm -d2 -ot -dNDEBUG")
+set (CMAKE_C_STANDARD_LIBRARIES_INIT "library clbrdll.lib library plbrdll.lib  library kernel32.lib library user32.lib library gdi32.lib library winspool.lib library comdlg32.lib library advapi32.lib library shell32.lib library ole32.lib library oleaut32.lib library uuid.lib library odbc32.lib library odbccp32.lib")
+set (CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
 
-SET(CMAKE_C_CREATE_IMPORT_LIBRARY
+set(CMAKE_C_CREATE_IMPORT_LIBRARY
   "wlib -c -q -n -b <TARGET_IMPLIB> +'<TARGET_UNQUOTED>'")
-SET(CMAKE_CXX_CREATE_IMPORT_LIBRARY ${CMAKE_C_CREATE_IMPORT_LIBRARY})
+set(CMAKE_CXX_CREATE_IMPORT_LIBRARY ${CMAKE_C_CREATE_IMPORT_LIBRARY})
 
-SET(CMAKE_C_LINK_EXECUTABLE
+set(CMAKE_C_LINK_EXECUTABLE
     "wlink ${CMAKE_START_TEMP_FILE} ${CMAKE_WLINK_QUIET} name '<TARGET_UNQUOTED>' <LINK_FLAGS> option caseexact file {<OBJECTS>} <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
 
 
-SET(CMAKE_CXX_LINK_EXECUTABLE ${CMAKE_C_LINK_EXECUTABLE})
+set(CMAKE_CXX_LINK_EXECUTABLE ${CMAKE_C_LINK_EXECUTABLE})
 
 # compile a C++ file into an object file
-SET(CMAKE_CXX_COMPILE_OBJECT
+set(CMAKE_CXX_COMPILE_OBJECT
     "<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} <FLAGS> -dWIN32 -d+ <DEFINES> -fo<OBJECT> -c -cc++ <SOURCE>${CMAKE_END_TEMP_FILE}")
 
 # compile a C file into an object file
-SET(CMAKE_C_COMPILE_OBJECT
+set(CMAKE_C_COMPILE_OBJECT
     "<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} <FLAGS> -dWIN32 -d+ <DEFINES> -fo<OBJECT> -c -cc <SOURCE>${CMAKE_END_TEMP_FILE}")
 
 # preprocess a C source file
-SET(CMAKE_C_CREATE_PREPROCESSED_SOURCE
+set(CMAKE_C_CREATE_PREPROCESSED_SOURCE
     "<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} <FLAGS> -dWIN32 -d+ <DEFINES> -fo<PREPROCESSED_SOURCE> -pl -cc <SOURCE>${CMAKE_END_TEMP_FILE}")
 
 # preprocess a C++ source file
-SET(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE
+set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE
     "<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} <FLAGS> -dWIN32 -d+ <DEFINES> -fo<PREPROCESSED_SOURCE> -pl -cc++ <SOURCE>${CMAKE_END_TEMP_FILE}")
 
-SET(CMAKE_CXX_CREATE_SHARED_MODULE
+set(CMAKE_CXX_CREATE_SHARED_MODULE
  "wlink ${CMAKE_START_TEMP_FILE} system nt_dll  ${CMAKE_WLINK_QUIET} name '<TARGET_UNQUOTED>' <LINK_FLAGS> option caseexact  file {<OBJECTS>} <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
-SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
+set(CMAKE_CXX_CREATE_SHARED_LIBRARY
   ${CMAKE_CXX_CREATE_SHARED_MODULE}
   ${CMAKE_CXX_CREATE_IMPORT_LIBRARY})
 
 # create a C shared library
-SET(CMAKE_C_CREATE_SHARED_LIBRARY ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
+set(CMAKE_C_CREATE_SHARED_LIBRARY ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
 
 # create a C shared module
-SET(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_MODULE})
+set(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_MODULE})
 
 # create a C++ static library
-SET(CMAKE_CXX_CREATE_STATIC_LIBRARY  "wlib ${CMAKE_LIB_QUIET} -c -n -b '<TARGET_UNQUOTED>' <LINK_FLAGS> <OBJECTS> ")
+set(CMAKE_CXX_CREATE_STATIC_LIBRARY  "wlib ${CMAKE_LIB_QUIET} -c -n -b '<TARGET_UNQUOTED>' <LINK_FLAGS> <OBJECTS> ")
 
 # create a C static library
-SET(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY})
+set(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY})
 
 if(NOT _CMAKE_WATCOM_VERSION)
   set(_CMAKE_WATCOM_VERSION 1)
diff --git a/Modules/Platform/Windows-windres.cmake b/Modules/Platform/Windows-windres.cmake
index 8bc1b15e9..01d6be3df 100644
--- a/Modules/Platform/Windows-windres.cmake
+++ b/Modules/Platform/Windows-windres.cmake
@@ -1 +1 @@
-SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <FLAGS> <DEFINES> <SOURCE> <OBJECT>")
+set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <FLAGS> <DEFINES> <SOURCE> <OBJECT>")
diff --git a/Modules/Platform/Windows.cmake b/Modules/Platform/Windows.cmake
index 09cb8d303..9481baa8e 100644
--- a/Modules/Platform/Windows.cmake
+++ b/Modules/Platform/Windows.cmake
@@ -1,36 +1,36 @@
-SET(WIN32 1)
+set(WIN32 1)
 
-SET(CMAKE_STATIC_LIBRARY_PREFIX "")
-SET(CMAKE_STATIC_LIBRARY_SUFFIX ".lib")
-SET(CMAKE_SHARED_LIBRARY_PREFIX "")          # lib
-SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dll")          # .so
-SET(CMAKE_IMPORT_LIBRARY_PREFIX "")
-SET(CMAKE_IMPORT_LIBRARY_SUFFIX ".lib")
-SET(CMAKE_EXECUTABLE_SUFFIX ".exe")          # .exe
-SET(CMAKE_LINK_LIBRARY_SUFFIX ".lib")
-SET(CMAKE_DL_LIBS "")
+set(CMAKE_STATIC_LIBRARY_PREFIX "")
+set(CMAKE_STATIC_LIBRARY_SUFFIX ".lib")
+set(CMAKE_SHARED_LIBRARY_PREFIX "")          # lib
+set(CMAKE_SHARED_LIBRARY_SUFFIX ".dll")          # .so
+set(CMAKE_IMPORT_LIBRARY_PREFIX "")
+set(CMAKE_IMPORT_LIBRARY_SUFFIX ".lib")
+set(CMAKE_EXECUTABLE_SUFFIX ".exe")          # .exe
+set(CMAKE_LINK_LIBRARY_SUFFIX ".lib")
+set(CMAKE_DL_LIBS "")
 
-SET(CMAKE_FIND_LIBRARY_PREFIXES "")
-SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
+set(CMAKE_FIND_LIBRARY_PREFIXES "")
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
 
 # for borland make long command lines are redirected to a file
 # with the following syntax, see Windows-bcc32.cmake for use
-IF(CMAKE_GENERATOR MATCHES "Borland")
-  SET(CMAKE_START_TEMP_FILE "@&&|\n")
-  SET(CMAKE_END_TEMP_FILE "\n|")
-ENDIF(CMAKE_GENERATOR MATCHES "Borland")
+if(CMAKE_GENERATOR MATCHES "Borland")
+  set(CMAKE_START_TEMP_FILE "@&&|\n")
+  set(CMAKE_END_TEMP_FILE "\n|")
+endif(CMAKE_GENERATOR MATCHES "Borland")
 
 # for nmake make long command lines are redirected to a file
 # with the following syntax, see Windows-bcc32.cmake for use
-IF(CMAKE_GENERATOR MATCHES "NMake")
-  SET(CMAKE_START_TEMP_FILE "@<<\n")
-  SET(CMAKE_END_TEMP_FILE "\n<<")
-ENDIF(CMAKE_GENERATOR MATCHES "NMake")
+if(CMAKE_GENERATOR MATCHES "NMake")
+  set(CMAKE_START_TEMP_FILE "@<<\n")
+  set(CMAKE_END_TEMP_FILE "\n<<")
+endif(CMAKE_GENERATOR MATCHES "NMake")
 
-INCLUDE(Platform/WindowsPaths)
+include(Platform/WindowsPaths)
 
 # uncomment these out to debug nmake and borland makefiles
-#SET(CMAKE_START_TEMP_FILE "")
-#SET(CMAKE_END_TEMP_FILE "")
-#SET(CMAKE_VERBOSE_MAKEFILE 1)
+#set(CMAKE_START_TEMP_FILE "")
+#set(CMAKE_END_TEMP_FILE "")
+#set(CMAKE_VERBOSE_MAKEFILE 1)
 
diff --git a/Modules/Platform/WindowsPaths.cmake b/Modules/Platform/WindowsPaths.cmake
index c7b15b342..bd31da021 100644
--- a/Modules/Platform/WindowsPaths.cmake
+++ b/Modules/Platform/WindowsPaths.cmake
@@ -17,10 +17,10 @@
 # "CMakeSystemSpecificInformation.cmake" already included it.
 # The extra inclusion is a work-around documented next to the include()
 # call, so this can be removed when the work-around is removed.
-IF(__WINDOWS_PATHS_INCLUDED)
-  RETURN()
-ENDIF()
-SET(__WINDOWS_PATHS_INCLUDED 1)
+if(__WINDOWS_PATHS_INCLUDED)
+  return()
+endif()
+set(__WINDOWS_PATHS_INCLUDED 1)
 
 # Add the program-files folder(s) to the list of installation
 # prefixes.
@@ -42,39 +42,39 @@ SET(__WINDOWS_PATHS_INCLUDED 1)
 #   ENV{ProgramFiles(x86)} = <not set>
 #   ENV{ProgramFiles} = [C:\Program Files (x86)]
 #   ENV{ProgramW6432} = [C:\Program Files]
-IF(DEFINED "ENV{ProgramW6432}")
+if(DEFINED "ENV{ProgramW6432}")
   # 32-bit binary on 64-bit windows.
   # The 64-bit program files are in ProgramW6432.
-  LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{ProgramW6432}")
+  list(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{ProgramW6432}")
 
   # The 32-bit program files are in ProgramFiles.
-  IF(DEFINED "ENV{ProgramFiles}")
-    LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{ProgramFiles}")
-  ENDIF()
-ELSE()
+  if(DEFINED "ENV{ProgramFiles}")
+    list(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{ProgramFiles}")
+  endif()
+else()
   # 64-bit binary, or 32-bit binary on 32-bit windows.
-  IF(DEFINED "ENV{ProgramFiles}")
-    LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{ProgramFiles}")
-  ENDIF()
-  IF(DEFINED "ENV{ProgramFiles(x86)}")
+  if(DEFINED "ENV{ProgramFiles}")
+    list(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{ProgramFiles}")
+  endif()
+  if(DEFINED "ENV{ProgramFiles(x86)}")
     # 64-bit binary.  32-bit program files are in ProgramFiles(x86).
-    LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{ProgramFiles(x86)}")
-  ELSEIF(DEFINED "ENV{SystemDrive}")
+    list(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{ProgramFiles(x86)}")
+  elseif(DEFINED "ENV{SystemDrive}")
     # Guess the 32-bit program files location.
-    IF(EXISTS "$ENV{SystemDrive}/Program Files (x86)")
-      LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH
+    if(EXISTS "$ENV{SystemDrive}/Program Files (x86)")
+      list(APPEND CMAKE_SYSTEM_PREFIX_PATH
         "$ENV{SystemDrive}/Program Files (x86)")
-    ENDIF()
-  ENDIF()
-ENDIF()
+    endif()
+  endif()
+endif()
 
 # Add the CMake install location.
-GET_FILENAME_COMPONENT(_CMAKE_INSTALL_DIR "${CMAKE_ROOT}" PATH)
-GET_FILENAME_COMPONENT(_CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" PATH)
-LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH "${_CMAKE_INSTALL_DIR}")
+get_filename_component(_CMAKE_INSTALL_DIR "${CMAKE_ROOT}" PATH)
+get_filename_component(_CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" PATH)
+list(APPEND CMAKE_SYSTEM_PREFIX_PATH "${_CMAKE_INSTALL_DIR}")
 
 # Add other locations.
-LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH
+list(APPEND CMAKE_SYSTEM_PREFIX_PATH
   # Project install destination.
   "${CMAKE_INSTALL_PREFIX}"
 
@@ -82,15 +82,15 @@ LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH
   /
   )
 
-LIST(APPEND CMAKE_SYSTEM_INCLUDE_PATH
+list(APPEND CMAKE_SYSTEM_INCLUDE_PATH
   )
 
 # mingw can also link against dlls which can also be in /bin, so list this too
-LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH
+list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
   "${CMAKE_INSTALL_PREFIX}/bin"
   "${_CMAKE_INSTALL_DIR}/bin"
   /bin
   )
 
-LIST(APPEND CMAKE_SYSTEM_PROGRAM_PATH
+list(APPEND CMAKE_SYSTEM_PROGRAM_PATH
   )
diff --git a/Modules/Platform/Xenix.cmake b/Modules/Platform/Xenix.cmake
index cf9d17bfd..47852f8e1 100644
--- a/Modules/Platform/Xenix.cmake
+++ b/Modules/Platform/Xenix.cmake
@@ -1,2 +1,2 @@
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
 
diff --git a/Modules/Platform/cl.cmake b/Modules/Platform/cl.cmake
index c0f014b58..c8dc02563 100644
--- a/Modules/Platform/cl.cmake
+++ b/Modules/Platform/cl.cmake
@@ -1,62 +1,62 @@
-SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:")
-SET(CMAKE_LINK_LIBRARY_FLAG "")
-SET(MSVC 1)
+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
 # (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
-IF(NOT DEFINED CMAKE_LINKER)
-   SET(CMAKE_LINKER link)
-ENDIF(NOT DEFINED CMAKE_LINKER)
+if(NOT DEFINED CMAKE_LINKER)
+   set(CMAKE_LINKER link)
+endif(NOT DEFINED CMAKE_LINKER)
 
-IF(CMAKE_VERBOSE_MAKEFILE)
-  SET(CMAKE_CL_NOLOGO)
-ELSE(CMAKE_VERBOSE_MAKEFILE)
-  SET(CMAKE_CL_NOLOGO "/nologo")
-ENDIF(CMAKE_VERBOSE_MAKEFILE)
+if(CMAKE_VERBOSE_MAKEFILE)
+  set(CMAKE_CL_NOLOGO)
+else(CMAKE_VERBOSE_MAKEFILE)
+  set(CMAKE_CL_NOLOGO "/nologo")
+endif(CMAKE_VERBOSE_MAKEFILE)
 # create a shared C++ library
-SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
+set(CMAKE_CXX_CREATE_SHARED_LIBRARY
   "<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
-SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
+set(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
 
 # create a C shared library
-SET(CMAKE_C_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
+set(CMAKE_C_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
 
 # create a C shared module
-SET(CMAKE_C_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_MODULE}")
+set(CMAKE_C_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_MODULE}")
 
 # create a C++ static library
-SET(CMAKE_CXX_CREATE_STATIC_LIBRARY  "<CMAKE_LINKER> /lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
+set(CMAKE_CXX_CREATE_STATIC_LIBRARY  "<CMAKE_LINKER> /lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
 
 # create a C static library
-SET(CMAKE_C_CREATE_STATIC_LIBRARY "${CMAKE_CXX_CREATE_STATIC_LIBRARY}")
+set(CMAKE_C_CREATE_STATIC_LIBRARY "${CMAKE_CXX_CREATE_STATIC_LIBRARY}")
 
 # compile a C++ file into an object file
-SET(CMAKE_CXX_COMPILE_OBJECT
+set(CMAKE_CXX_COMPILE_OBJECT
     "<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> <DEFINES> /TP /Fo<OBJECT> /Fd<TARGET_PDB> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
 
 # compile a C file into an object file
-SET(CMAKE_C_COMPILE_OBJECT
+set(CMAKE_C_COMPILE_OBJECT
     "<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> <DEFINES> /Fo<OBJECT> /Fd<TARGET_PDB> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
 
-SET(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1)
-SET(CMAKE_C_LINK_EXECUTABLE
+set(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1)
+set(CMAKE_C_LINK_EXECUTABLE
     "<CMAKE_C_COMPILER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> /Fd<TARGET_PDB> -link /implib:<TARGET_IMPLIB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
 
-SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1)
-SET(CMAKE_CXX_LINK_EXECUTABLE
+set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1)
+set(CMAKE_CXX_LINK_EXECUTABLE
     "<CMAKE_CXX_COMPILER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> /Fd<TARGET_PDB> -link /implib:<TARGET_IMPLIB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
 
-SET(CMAKE_C_CREATE_PREPROCESSED_SOURCE
+set(CMAKE_C_CREATE_PREPROCESSED_SOURCE
     "<CMAKE_C_COMPILER> > <PREPROCESSED_SOURCE> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> <DEFINES> -E <SOURCE>${CMAKE_END_TEMP_FILE}")
 
-SET(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE
+set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE
     "<CMAKE_CXX_COMPILER> > <PREPROCESSED_SOURCE> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> <DEFINES> /TP -E <SOURCE>${CMAKE_END_TEMP_FILE}")
 
-SET(CMAKE_C_CREATE_ASSEMBLY_SOURCE
+set(CMAKE_C_CREATE_ASSEMBLY_SOURCE
     "<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> /FAs /FoNUL /Fa<ASSEMBLY_SOURCE> /c <SOURCE>${CMAKE_END_TEMP_FILE}")
 
-SET(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE
+set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE
     "<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> /TP /FAs /FoNUL /Fa<ASSEMBLY_SOURCE> /c <SOURCE>${CMAKE_END_TEMP_FILE}")
 
diff --git a/Modules/Platform/eCos.cmake b/Modules/Platform/eCos.cmake
index b437c1a9b..c839b0ebb 100644
--- a/Modules/Platform/eCos.cmake
+++ b/Modules/Platform/eCos.cmake
@@ -1,65 +1,65 @@
 # support for eCos http://ecos.sourceware.org
 
 # Guard against multiple inclusion, which e.g. leads to multiple calls to add_definition() #12987
-IF(__ECOS_CMAKE_INCLUDED)
-  RETURN()
-ENDIF()
-SET(__ECOS_CMAKE_INCLUDED TRUE)
+if(__ECOS_CMAKE_INCLUDED)
+  return()
+endif()
+set(__ECOS_CMAKE_INCLUDED TRUE)
 
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "")            # -pic
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "")       # -shared
-SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")         # +s, flag for exe link to use shared lib
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "")       # -rpath
-SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "")   # : or empty
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "")            # -pic
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "")       # -shared
+set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")         # +s, flag for exe link to use shared lib
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "")       # -rpath
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "")   # : or empty
 
-SET(CMAKE_LINK_LIBRARY_SUFFIX "")
-SET(CMAKE_STATIC_LIBRARY_PREFIX "lib")
-SET(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
-SET(CMAKE_SHARED_LIBRARY_PREFIX "lib")          # lib
-SET(CMAKE_SHARED_LIBRARY_SUFFIX ".a")           # .a
-SET(CMAKE_EXECUTABLE_SUFFIX ".elf")             # same suffix as if built using UseEcos.cmake
-SET(CMAKE_DL_LIBS "" )
+set(CMAKE_LINK_LIBRARY_SUFFIX "")
+set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
+set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
+set(CMAKE_SHARED_LIBRARY_PREFIX "lib")          # lib
+set(CMAKE_SHARED_LIBRARY_SUFFIX ".a")           # .a
+set(CMAKE_EXECUTABLE_SUFFIX ".elf")             # same suffix as if built using UseEcos.cmake
+set(CMAKE_DL_LIBS "" )
 
-SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
-SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
+set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
 
 
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
 
 # eCos can be built only with gcc
-GET_PROPERTY(_IN_TC GLOBAL PROPERTY IN_TRY_COMPILE)
-IF(CMAKE_C_COMPILER AND NOT  "${CMAKE_C_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC)
-  MESSAGE(FATAL_ERROR "GNU gcc is required for eCos")
-ENDIF(CMAKE_C_COMPILER AND NOT  "${CMAKE_C_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC)
-IF(CMAKE_CXX_COMPILER AND NOT  "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC)
-  MESSAGE(FATAL_ERROR "GNU g++ is required for eCos")
-ENDIF(CMAKE_CXX_COMPILER AND NOT  "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC)
+get_property(_IN_TC GLOBAL PROPERTY IN_TRY_COMPILE)
+if(CMAKE_C_COMPILER AND NOT  "${CMAKE_C_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC)
+  message(FATAL_ERROR "GNU gcc is required for eCos")
+endif(CMAKE_C_COMPILER AND NOT  "${CMAKE_C_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC)
+if(CMAKE_CXX_COMPILER AND NOT  "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC)
+  message(FATAL_ERROR "GNU g++ is required for eCos")
+endif(CMAKE_CXX_COMPILER AND NOT  "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC)
 
 # find eCos system files
-FIND_PATH(ECOS_SYSTEM_CONFIG_HEADER_PATH NAMES pkgconf/system.h)
-FIND_LIBRARY(ECOS_SYSTEM_TARGET_LIBRARY NAMES libtarget.a)
+find_path(ECOS_SYSTEM_CONFIG_HEADER_PATH NAMES pkgconf/system.h)
+find_library(ECOS_SYSTEM_TARGET_LIBRARY NAMES libtarget.a)
 
-IF(NOT ECOS_SYSTEM_CONFIG_HEADER_PATH)
-  MESSAGE(FATAL_ERROR "Could not find eCos pkgconf/system.h. Build eCos first and set up CMAKE_FIND_ROOT_PATH correctly.")
-ENDIF(NOT ECOS_SYSTEM_CONFIG_HEADER_PATH)
+if(NOT ECOS_SYSTEM_CONFIG_HEADER_PATH)
+  message(FATAL_ERROR "Could not find eCos pkgconf/system.h. Build eCos first and set up CMAKE_FIND_ROOT_PATH correctly.")
+endif(NOT ECOS_SYSTEM_CONFIG_HEADER_PATH)
 
-IF(NOT ECOS_SYSTEM_TARGET_LIBRARY)
-  MESSAGE(FATAL_ERROR "Could not find eCos \"libtarget.a\". Build eCos first and set up CMAKE_FIND_ROOT_PATH correctly.")
-ENDIF(NOT ECOS_SYSTEM_TARGET_LIBRARY)
+if(NOT ECOS_SYSTEM_TARGET_LIBRARY)
+  message(FATAL_ERROR "Could not find eCos \"libtarget.a\". Build eCos first and set up CMAKE_FIND_ROOT_PATH correctly.")
+endif(NOT ECOS_SYSTEM_TARGET_LIBRARY)
 
-GET_FILENAME_COMPONENT(ECOS_LIBTARGET_DIRECTORY "${ECOS_SYSTEM_TARGET_LIBRARY}" PATH)
-INCLUDE_DIRECTORIES(${ECOS_SYSTEM_CONFIG_HEADER_PATH})
-ADD_DEFINITIONS(-D__ECOS__=1 -D__ECOS=1)
+get_filename_component(ECOS_LIBTARGET_DIRECTORY "${ECOS_SYSTEM_TARGET_LIBRARY}" PATH)
+include_directories(${ECOS_SYSTEM_CONFIG_HEADER_PATH})
+add_definitions(-D__ECOS__=1 -D__ECOS=1)
 
 # special link commands for eCos executables
-SET(CMAKE_CXX_LINK_EXECUTABLE  "<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -nostdlib -nostartfiles -L${ECOS_LIBTARGET_DIRECTORY} -Ttarget.ld  <LINK_LIBRARIES>")
-SET(CMAKE_C_LINK_EXECUTABLE    "<CMAKE_C_COMPILER>   <FLAGS> <CMAKE_C_LINK_FLAGS>   <LINK_FLAGS> <OBJECTS> -o <TARGET> -nostdlib -nostartfiles -L${ECOS_LIBTARGET_DIRECTORY} -Ttarget.ld  <LINK_LIBRARIES>")
+set(CMAKE_CXX_LINK_EXECUTABLE  "<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -nostdlib -nostartfiles -L${ECOS_LIBTARGET_DIRECTORY} -Ttarget.ld  <LINK_LIBRARIES>")
+set(CMAKE_C_LINK_EXECUTABLE    "<CMAKE_C_COMPILER>   <FLAGS> <CMAKE_C_LINK_FLAGS>   <LINK_FLAGS> <OBJECTS> -o <TARGET> -nostdlib -nostartfiles -L${ECOS_LIBTARGET_DIRECTORY} -Ttarget.ld  <LINK_LIBRARIES>")
 
 # eCos doesn't support shared libs
-SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
+set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
 
-SET(CMAKE_CXX_LINK_SHARED_LIBRARY )
-SET(CMAKE_CXX_LINK_MODULE_LIBRARY )
-SET(CMAKE_C_LINK_SHARED_LIBRARY )
-SET(CMAKE_C_LINK_MODULE_LIBRARY )
+set(CMAKE_CXX_LINK_SHARED_LIBRARY )
+set(CMAKE_CXX_LINK_MODULE_LIBRARY )
+set(CMAKE_C_LINK_SHARED_LIBRARY )
+set(CMAKE_C_LINK_MODULE_LIBRARY )
 
diff --git a/Modules/Platform/gas.cmake b/Modules/Platform/gas.cmake
index b9d2a6582..6ac3b559f 100644
--- a/Modules/Platform/gas.cmake
+++ b/Modules/Platform/gas.cmake
@@ -1,19 +1,19 @@
-IF(UNIX)
-  SET(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .o)
-ELSE(UNIX)
-  SET(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .obj)
-ENDIF(UNIX)
+if(UNIX)
+  set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .o)
+else(UNIX)
+  set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .obj)
+endif(UNIX)
 
-SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> -o <OBJECT> <SOURCE>")
+set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> -o <OBJECT> <SOURCE>")
 
-SET(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY
+set(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY
       "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> "
       "<CMAKE_RANLIB> <TARGET> ")
 
-SET(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE
+set(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE
     "<CMAKE_LINKER> <FLAGS> <CMAKE_ASM${ASM_DIALECT}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS>  -o <TARGET> <LINK_LIBRARIES>")
 
 # to be done
-SET(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
-SET(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
+set(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
+set(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
 
diff --git a/Modules/Platform/kFreeBSD.cmake b/Modules/Platform/kFreeBSD.cmake
index c1295fb0d..c1db2594d 100644
--- a/Modules/Platform/kFreeBSD.cmake
+++ b/Modules/Platform/kFreeBSD.cmake
@@ -1,4 +1,4 @@
 # kFreeBSD looks just like Linux.
-INCLUDE(Platform/Linux)
+include(Platform/Linux)
 
-SET(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-kfreebsd-gnu[a-z0-9_]*")
+set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-kfreebsd-gnu[a-z0-9_]*")
diff --git a/Modules/Platform/syllable.cmake b/Modules/Platform/syllable.cmake
index 2d11d08b3..50c695f66 100644
--- a/Modules/Platform/syllable.cmake
+++ b/Modules/Platform/syllable.cmake
@@ -9,25 +9,25 @@
 # @bindir@/. and @bindir@/../lib are in DLL_PATH
 
 
-SET(CMAKE_DL_LIBS "dl")
-SET(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
-SET(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")            # -pic
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")       # -shared
-SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")         # +s, flag for exe link to use shared lib
-SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
-#SET(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
+set(CMAKE_DL_LIBS "dl")
+set(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
+set(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")            # -pic
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")       # -shared
+set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")         # +s, flag for exe link to use shared lib
+set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
+#set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
 
 # Initialize C link type selection flags.  These flags are used when
 # building a shared library, shared module, or executable that links
 # to other libraries to select whether to use the static or shared
 # versions of the libraries.
-FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
-  SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
-  SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
-ENDFOREACH(type)
+foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+  set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
+  set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
+endforeach(type)
 
-INCLUDE(Platform/UnixPaths)
+include(Platform/UnixPaths)
 
 # these are Syllable specific:
-LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH /usr/indexes)
+list(APPEND CMAKE_SYSTEM_PREFIX_PATH /usr/indexes)
diff --git a/Modules/Qt4ConfigDependentSettings.cmake b/Modules/Qt4ConfigDependentSettings.cmake
index 665d2747e..2a7a1ce7d 100644
--- a/Modules/Qt4ConfigDependentSettings.cmake
+++ b/Modules/Qt4ConfigDependentSettings.cmake
@@ -26,270 +26,270 @@
 # if a user needs the dependencies, and they couldn't be found, they can set
 # the variables themselves.
 
-SET(QT_QTGUI_LIB_DEPENDENCIES "")
-SET(QT_QTCORE_LIB_DEPENDENCIES "")
-SET(QT_QTNETWORK_LIB_DEPENDENCIES "")
-SET(QT_QTOPENGL_LIB_DEPENDENCIES "")
-SET(QT_QTDBUS_LIB_DEPENDENCIES "")
-SET(QT_QTHELP_LIB_DEPENDENCIES ${QT_QTCLUCENE_LIBRARY})
+set(QT_QTGUI_LIB_DEPENDENCIES "")
+set(QT_QTCORE_LIB_DEPENDENCIES "")
+set(QT_QTNETWORK_LIB_DEPENDENCIES "")
+set(QT_QTOPENGL_LIB_DEPENDENCIES "")
+set(QT_QTDBUS_LIB_DEPENDENCIES "")
+set(QT_QTHELP_LIB_DEPENDENCIES ${QT_QTCLUCENE_LIBRARY})
 
 
-IF(Q_WS_WIN)
+if(Q_WS_WIN)
   # On Windows, qconfig.pri has "shared" for shared library builds
-  IF(NOT QT_CONFIG MATCHES "shared")
-    SET(QT_IS_STATIC 1)
-  ENDIF(NOT QT_CONFIG MATCHES "shared")
-ELSE(Q_WS_WIN)
+  if(NOT QT_CONFIG MATCHES "shared")
+    set(QT_IS_STATIC 1)
+  endif(NOT QT_CONFIG MATCHES "shared")
+else(Q_WS_WIN)
   # On other platforms, check file extension to know if its static
-  IF(QT_QTCORE_LIBRARY_RELEASE)
-    GET_FILENAME_COMPONENT(qtcore_lib_ext "${QT_QTCORE_LIBRARY_RELEASE}" EXT)
-    IF("${qtcore_lib_ext}" STREQUAL "${CMAKE_STATIC_LIBRARY_SUFFIX}")
-      SET(QT_IS_STATIC 1)
-    ENDIF("${qtcore_lib_ext}" STREQUAL "${CMAKE_STATIC_LIBRARY_SUFFIX}")
-  ENDIF(QT_QTCORE_LIBRARY_RELEASE)
-  IF(QT_QTCORE_LIBRARY_DEBUG)
-    GET_FILENAME_COMPONENT(qtcore_lib_ext "${QT_QTCORE_LIBRARY_DEBUG}" EXT)
-    IF(${qtcore_lib_ext} STREQUAL ${CMAKE_STATIC_LIBRARY_SUFFIX})
-      SET(QT_IS_STATIC 1)
-    ENDIF(${qtcore_lib_ext} STREQUAL ${CMAKE_STATIC_LIBRARY_SUFFIX})
-  ENDIF(QT_QTCORE_LIBRARY_DEBUG)
-ENDIF(Q_WS_WIN)
+  if(QT_QTCORE_LIBRARY_RELEASE)
+    get_filename_component(qtcore_lib_ext "${QT_QTCORE_LIBRARY_RELEASE}" EXT)
+    if("${qtcore_lib_ext}" STREQUAL "${CMAKE_STATIC_LIBRARY_SUFFIX}")
+      set(QT_IS_STATIC 1)
+    endif("${qtcore_lib_ext}" STREQUAL "${CMAKE_STATIC_LIBRARY_SUFFIX}")
+  endif(QT_QTCORE_LIBRARY_RELEASE)
+  if(QT_QTCORE_LIBRARY_DEBUG)
+    get_filename_component(qtcore_lib_ext "${QT_QTCORE_LIBRARY_DEBUG}" EXT)
+    if(${qtcore_lib_ext} STREQUAL ${CMAKE_STATIC_LIBRARY_SUFFIX})
+      set(QT_IS_STATIC 1)
+    endif(${qtcore_lib_ext} STREQUAL ${CMAKE_STATIC_LIBRARY_SUFFIX})
+  endif(QT_QTCORE_LIBRARY_DEBUG)
+endif(Q_WS_WIN)
 
 # build using shared Qt needs -DQT_DLL on Windows
-IF(Q_WS_WIN  AND  NOT QT_IS_STATIC)
-  SET(QT_DEFINITIONS ${QT_DEFINITIONS} -DQT_DLL)
-ENDIF(Q_WS_WIN  AND  NOT QT_IS_STATIC)
+if(Q_WS_WIN  AND  NOT QT_IS_STATIC)
+  set(QT_DEFINITIONS ${QT_DEFINITIONS} -DQT_DLL)
+endif(Q_WS_WIN  AND  NOT QT_IS_STATIC)
 
-IF(NOT QT_IS_STATIC)
-  RETURN()
-ENDIF(NOT QT_IS_STATIC)
+if(NOT QT_IS_STATIC)
+  return()
+endif(NOT QT_IS_STATIC)
 
 # QtOpenGL dependencies
 find_package(OpenGL)
-SET (QT_QTOPENGL_LIB_DEPENDENCIES ${OPENGL_glu_LIBRARY} ${OPENGL_gl_LIBRARY})
+set (QT_QTOPENGL_LIB_DEPENDENCIES ${OPENGL_glu_LIBRARY} ${OPENGL_gl_LIBRARY})
 
 
 ## system png
-IF(QT_QCONFIG MATCHES "system-png")
+if(QT_QCONFIG MATCHES "system-png")
   find_package(PNG)
-  SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${PNG_LIBRARY})
-ENDIF(QT_QCONFIG MATCHES "system-png")
+  set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${PNG_LIBRARY})
+endif(QT_QCONFIG MATCHES "system-png")
 
 ## system jpeg
-IF(QT_QCONFIG MATCHES "system-jpeg")
+if(QT_QCONFIG MATCHES "system-jpeg")
   find_package(JPEG)
-  SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${JPEG_LIBRARIES})
-ENDIF(QT_QCONFIG MATCHES "system-jpeg")
+  set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${JPEG_LIBRARIES})
+endif(QT_QCONFIG MATCHES "system-jpeg")
 
 ## system tiff
-IF(QT_QCONFIG MATCHES "system-tiff")
+if(QT_QCONFIG MATCHES "system-tiff")
   find_package(TIFF)
-  SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${TIFF_LIBRARIES})
-ENDIF(QT_QCONFIG MATCHES "system-tiff")
+  set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${TIFF_LIBRARIES})
+endif(QT_QCONFIG MATCHES "system-tiff")
 
 ## system mng
-IF(QT_QCONFIG MATCHES "system-mng")
+if(QT_QCONFIG MATCHES "system-mng")
   find_library(MNG_LIBRARY NAMES mng)
-  SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${MNG_LIBRARY})
-ENDIF(QT_QCONFIG MATCHES "system-mng")
+  set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${MNG_LIBRARY})
+endif(QT_QCONFIG MATCHES "system-mng")
 
 # for X11, get X11 library directory
-IF(Q_WS_X11)
-  FIND_PACKAGE(X11)
-ENDIF(Q_WS_X11)
+if(Q_WS_X11)
+  find_package(X11)
+endif(Q_WS_X11)
 
 
 ## X11 SM
-IF(QT_QCONFIG MATCHES "x11sm")
-  IF(X11_SM_LIB AND X11_ICE_LIB)
-    SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_SM_LIB} ${X11_ICE_LIB})
-  ENDIF(X11_SM_LIB AND X11_ICE_LIB)
-ENDIF(QT_QCONFIG MATCHES "x11sm")
+if(QT_QCONFIG MATCHES "x11sm")
+  if(X11_SM_LIB AND X11_ICE_LIB)
+    set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_SM_LIB} ${X11_ICE_LIB})
+  endif(X11_SM_LIB AND X11_ICE_LIB)
+endif(QT_QCONFIG MATCHES "x11sm")
 
 
 ## Xi
-IF(QT_QCONFIG MATCHES "tablet")
-  IF(X11_Xi_LIB)
-    SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xi_LIB})
-  ENDIF(X11_Xi_LIB)
-ENDIF(QT_QCONFIG MATCHES "tablet")
+if(QT_QCONFIG MATCHES "tablet")
+  if(X11_Xi_LIB)
+    set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xi_LIB})
+  endif(X11_Xi_LIB)
+endif(QT_QCONFIG MATCHES "tablet")
 
 
 ## Xrender
-IF(QT_QCONFIG MATCHES "xrender")
-  IF(X11_Xrender_LIB)
-    SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xrender_LIB})
-  ENDIF(X11_Xrender_LIB)
-ENDIF(QT_QCONFIG MATCHES "xrender")
+if(QT_QCONFIG MATCHES "xrender")
+  if(X11_Xrender_LIB)
+    set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xrender_LIB})
+  endif(X11_Xrender_LIB)
+endif(QT_QCONFIG MATCHES "xrender")
 
 
 ## Xrandr
-IF(QT_QCONFIG MATCHES "xrandr")
-  IF(X11_Xrandr_LIB)
-    SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xrandr_LIB})
-  ENDIF(X11_Xrandr_LIB)
-ENDIF(QT_QCONFIG MATCHES "xrandr")
+if(QT_QCONFIG MATCHES "xrandr")
+  if(X11_Xrandr_LIB)
+    set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xrandr_LIB})
+  endif(X11_Xrandr_LIB)
+endif(QT_QCONFIG MATCHES "xrandr")
 
 
 ## Xcursor
-IF(QT_QCONFIG MATCHES "xcursor")
-  IF(X11_Xcursor_LIB)
-    SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xcursor_LIB})
-  ENDIF(X11_Xcursor_LIB)
-ENDIF(QT_QCONFIG MATCHES "xcursor")
+if(QT_QCONFIG MATCHES "xcursor")
+  if(X11_Xcursor_LIB)
+    set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xcursor_LIB})
+  endif(X11_Xcursor_LIB)
+endif(QT_QCONFIG MATCHES "xcursor")
 
 
 ## Xinerama
-IF(QT_QCONFIG MATCHES "xinerama")
-  IF(X11_Xinerama_LIB)
-    SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xinerama_LIB})
-  ENDIF(X11_Xinerama_LIB)
-ENDIF(QT_QCONFIG MATCHES "xinerama")
+if(QT_QCONFIG MATCHES "xinerama")
+  if(X11_Xinerama_LIB)
+    set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xinerama_LIB})
+  endif(X11_Xinerama_LIB)
+endif(QT_QCONFIG MATCHES "xinerama")
 
 
 ## Xfixes
-IF(QT_QCONFIG MATCHES "xfixes")
-  IF(X11_Xfixes_LIB)
-    SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xfixes_LIB})
-  ENDIF(X11_Xfixes_LIB)
-ENDIF(QT_QCONFIG MATCHES "xfixes")
+if(QT_QCONFIG MATCHES "xfixes")
+  if(X11_Xfixes_LIB)
+    set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xfixes_LIB})
+  endif(X11_Xfixes_LIB)
+endif(QT_QCONFIG MATCHES "xfixes")
 
 
 ## fontconfig
-IF(QT_QCONFIG MATCHES "fontconfig")
-  FIND_LIBRARY(QT_FONTCONFIG_LIBRARY NAMES fontconfig)
-  MARK_AS_ADVANCED(QT_FONTCONFIG_LIBRARY)
-  IF(QT_FONTCONFIG_LIBRARY)
-    SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_FONTCONFIG_LIBRARY})
-  ENDIF(QT_FONTCONFIG_LIBRARY)
-ENDIF(QT_QCONFIG MATCHES "fontconfig")
+if(QT_QCONFIG MATCHES "fontconfig")
+  find_library(QT_FONTCONFIG_LIBRARY NAMES fontconfig)
+  mark_as_advanced(QT_FONTCONFIG_LIBRARY)
+  if(QT_FONTCONFIG_LIBRARY)
+    set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_FONTCONFIG_LIBRARY})
+  endif(QT_FONTCONFIG_LIBRARY)
+endif(QT_QCONFIG MATCHES "fontconfig")
 
 
 ## system-freetype
-IF(QT_QCONFIG MATCHES "system-freetype")
+if(QT_QCONFIG MATCHES "system-freetype")
   find_package(Freetype)
   if(FREETYPE_LIBRARIES)
-    SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${FREETYPE_LIBRARIES})
+    set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${FREETYPE_LIBRARIES})
   endif(FREETYPE_LIBRARIES)
-ENDIF(QT_QCONFIG MATCHES "system-freetype")
+endif(QT_QCONFIG MATCHES "system-freetype")
 
 
 ## system-zlib
-IF(QT_QCONFIG MATCHES "system-zlib")
+if(QT_QCONFIG MATCHES "system-zlib")
   find_package(ZLIB)
-  SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${ZLIB_LIBRARIES})
-ENDIF(QT_QCONFIG MATCHES "system-zlib")
+  set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${ZLIB_LIBRARIES})
+endif(QT_QCONFIG MATCHES "system-zlib")
 
 
 ## openssl
-IF(NOT Q_WS_WIN)
-  SET(_QT_NEED_OPENSSL 0)
-  IF(QT_VERSION_MINOR LESS 4 AND QT_QCONFIG MATCHES "openssl")
-    SET(_QT_NEED_OPENSSL 1)
-  ENDIF(QT_VERSION_MINOR LESS 4 AND QT_QCONFIG MATCHES "openssl")
-  IF(QT_VERSION_MINOR GREATER 3 AND QT_QCONFIG MATCHES "openssl-linked")
-    SET(_QT_NEED_OPENSSL 1)
-  ENDIF(QT_VERSION_MINOR GREATER 3 AND QT_QCONFIG MATCHES "openssl-linked")
-  IF(_QT_NEED_OPENSSL)
-    FIND_PACKAGE(OpenSSL)
-    IF(OPENSSL_LIBRARIES)
-      SET(QT_QTNETWORK_LIB_DEPENDENCIES ${QT_QTNETWORK_LIB_DEPENDENCIES} ${OPENSSL_LIBRARIES})
-    ENDIF(OPENSSL_LIBRARIES)
-  ENDIF(_QT_NEED_OPENSSL)
-ENDIF(NOT Q_WS_WIN)
+if(NOT Q_WS_WIN)
+  set(_QT_NEED_OPENSSL 0)
+  if(QT_VERSION_MINOR LESS 4 AND QT_QCONFIG MATCHES "openssl")
+    set(_QT_NEED_OPENSSL 1)
+  endif(QT_VERSION_MINOR LESS 4 AND QT_QCONFIG MATCHES "openssl")
+  if(QT_VERSION_MINOR GREATER 3 AND QT_QCONFIG MATCHES "openssl-linked")
+    set(_QT_NEED_OPENSSL 1)
+  endif(QT_VERSION_MINOR GREATER 3 AND QT_QCONFIG MATCHES "openssl-linked")
+  if(_QT_NEED_OPENSSL)
+    find_package(OpenSSL)
+    if(OPENSSL_LIBRARIES)
+      set(QT_QTNETWORK_LIB_DEPENDENCIES ${QT_QTNETWORK_LIB_DEPENDENCIES} ${OPENSSL_LIBRARIES})
+    endif(OPENSSL_LIBRARIES)
+  endif(_QT_NEED_OPENSSL)
+endif(NOT Q_WS_WIN)
 
 
 ## dbus
-IF(QT_QCONFIG MATCHES "dbus")
+if(QT_QCONFIG MATCHES "dbus")
 
-  FIND_LIBRARY(QT_DBUS_LIBRARY NAMES dbus-1 )
-  IF(QT_DBUS_LIBRARY)
-    SET(QT_QTDBUS_LIB_DEPENDENCIES ${QT_QTDBUS_LIB_DEPENDENCIES} ${QT_DBUS_LIBRARY})
-  ENDIF(QT_DBUS_LIBRARY)
-  MARK_AS_ADVANCED(QT_DBUS_LIBRARY)
+  find_library(QT_DBUS_LIBRARY NAMES dbus-1 )
+  if(QT_DBUS_LIBRARY)
+    set(QT_QTDBUS_LIB_DEPENDENCIES ${QT_QTDBUS_LIB_DEPENDENCIES} ${QT_DBUS_LIBRARY})
+  endif(QT_DBUS_LIBRARY)
+  mark_as_advanced(QT_DBUS_LIBRARY)
 
-ENDIF(QT_QCONFIG MATCHES "dbus")
+endif(QT_QCONFIG MATCHES "dbus")
 
 
 ## glib
-IF(QT_QCONFIG MATCHES "glib")
+if(QT_QCONFIG MATCHES "glib")
 
   # Qt 4.2.0+ uses glib-2.0
-  FIND_LIBRARY(QT_GLIB_LIBRARY NAMES glib-2.0 )
-  FIND_LIBRARY(QT_GTHREAD_LIBRARY NAMES gthread-2.0 )
-  MARK_AS_ADVANCED(QT_GLIB_LIBRARY)
-  MARK_AS_ADVANCED(QT_GTHREAD_LIBRARY)
+  find_library(QT_GLIB_LIBRARY NAMES glib-2.0 )
+  find_library(QT_GTHREAD_LIBRARY NAMES gthread-2.0 )
+  mark_as_advanced(QT_GLIB_LIBRARY)
+  mark_as_advanced(QT_GTHREAD_LIBRARY)
 
-  IF(QT_GLIB_LIBRARY AND QT_GTHREAD_LIBRARY)
-    SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES}
+  if(QT_GLIB_LIBRARY AND QT_GTHREAD_LIBRARY)
+    set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES}
         ${QT_GTHREAD_LIBRARY} ${QT_GLIB_LIBRARY})
-  ENDIF(QT_GLIB_LIBRARY AND QT_GTHREAD_LIBRARY)
+  endif(QT_GLIB_LIBRARY AND QT_GTHREAD_LIBRARY)
 
 
   # Qt 4.5+ also links to gobject-2.0
-  IF(QT_VERSION_MINOR GREATER 4)
-     FIND_LIBRARY(QT_GOBJECT_LIBRARY NAMES gobject-2.0 PATHS ${_glib_query_output} )
-     MARK_AS_ADVANCED(QT_GOBJECT_LIBRARY)
+  if(QT_VERSION_MINOR GREATER 4)
+     find_library(QT_GOBJECT_LIBRARY NAMES gobject-2.0 PATHS ${_glib_query_output} )
+     mark_as_advanced(QT_GOBJECT_LIBRARY)
 
-     IF(QT_GOBJECT_LIBRARY)
-       SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES}
+     if(QT_GOBJECT_LIBRARY)
+       set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES}
            ${QT_GOBJECT_LIBRARY})
-     ENDIF(QT_GOBJECT_LIBRARY)
-  ENDIF(QT_VERSION_MINOR GREATER 4)
+     endif(QT_GOBJECT_LIBRARY)
+  endif(QT_VERSION_MINOR GREATER 4)
 
-ENDIF(QT_QCONFIG MATCHES "glib")
+endif(QT_QCONFIG MATCHES "glib")
 
 
 ## clock-monotonic, just see if we need to link with rt
-IF(QT_QCONFIG MATCHES "clock-monotonic")
-  SET(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES})
-  SET(CMAKE_REQUIRED_LIBRARIES rt)
+if(QT_QCONFIG MATCHES "clock-monotonic")
+  set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES})
+  set(CMAKE_REQUIRED_LIBRARIES rt)
   CHECK_SYMBOL_EXISTS(_POSIX_TIMERS "unistd.h;time.h" QT_POSIX_TIMERS)
-  SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE})
-  IF(QT_POSIX_TIMERS)
-    FIND_LIBRARY(QT_RT_LIBRARY NAMES rt)
-    MARK_AS_ADVANCED(QT_RT_LIBRARY)
-    IF(QT_RT_LIBRARY)
-      SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${QT_RT_LIBRARY})
-    ENDIF(QT_RT_LIBRARY)
-  ENDIF(QT_POSIX_TIMERS)
-ENDIF(QT_QCONFIG MATCHES "clock-monotonic")
+  set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE})
+  if(QT_POSIX_TIMERS)
+    find_library(QT_RT_LIBRARY NAMES rt)
+    mark_as_advanced(QT_RT_LIBRARY)
+    if(QT_RT_LIBRARY)
+      set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${QT_RT_LIBRARY})
+    endif(QT_RT_LIBRARY)
+  endif(QT_POSIX_TIMERS)
+endif(QT_QCONFIG MATCHES "clock-monotonic")
 
 
-IF(Q_WS_X11)
+if(Q_WS_X11)
   # X11 libraries Qt always depends on
-  SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xext_LIB} ${X11_X11_LIB})
+  set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xext_LIB} ${X11_X11_LIB})
 
   set(CMAKE_THREAD_PREFER_PTHREADS 1)
   find_package(Threads)
   if(CMAKE_USE_PTHREADS_INIT)
-    SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${CMAKE_THREAD_LIBS_INIT})
+    set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${CMAKE_THREAD_LIBS_INIT})
   endif(CMAKE_USE_PTHREADS_INIT)
 
-  SET (QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${CMAKE_DL_LIBS})
+  set (QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${CMAKE_DL_LIBS})
 
-ENDIF(Q_WS_X11)
+endif(Q_WS_X11)
 
 
-IF(Q_WS_WIN)
-  SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} imm32 winmm)
-  SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ws2_32)
-ENDIF(Q_WS_WIN)
+if(Q_WS_WIN)
+  set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} imm32 winmm)
+  set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ws2_32)
+endif(Q_WS_WIN)
 
 
-IF(Q_WS_MAC)
-  SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-framework Carbon")
+if(Q_WS_MAC)
+  set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-framework Carbon")
 
   # Qt 4.0, 4.1, 4.2 use QuickTime
-  IF(QT_VERSION_MINOR LESS 3)
-    SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-framework QuickTime")
-  ENDIF(QT_VERSION_MINOR LESS 3)
+  if(QT_VERSION_MINOR LESS 3)
+    set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-framework QuickTime")
+  endif(QT_VERSION_MINOR LESS 3)
 
   # Qt 4.2+ use AppKit
-  IF(QT_VERSION_MINOR GREATER 1)
-    SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-framework AppKit")
-  ENDIF(QT_VERSION_MINOR GREATER 1)
+  if(QT_VERSION_MINOR GREATER 1)
+    set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-framework AppKit")
+  endif(QT_VERSION_MINOR GREATER 1)
 
-  SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} "-framework ApplicationServices")
-ENDIF(Q_WS_MAC)
+  set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} "-framework ApplicationServices")
+endif(Q_WS_MAC)
 
diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake
index 27a8ee878..1e19ff292 100644
--- a/Modules/Qt4Macros.cmake
+++ b/Modules/Qt4Macros.cmake
@@ -21,322 +21,322 @@
 ######################################
 
 
-MACRO (QT4_EXTRACT_OPTIONS _qt4_files _qt4_options)
-  SET(${_qt4_files})
-  SET(${_qt4_options})
-  SET(_QT4_DOING_OPTIONS FALSE)
-  FOREACH(_currentArg ${ARGN})
-    IF ("${_currentArg}" STREQUAL "OPTIONS")
-      SET(_QT4_DOING_OPTIONS TRUE)
-    ELSE ("${_currentArg}" STREQUAL "OPTIONS")
-      IF(_QT4_DOING_OPTIONS)
-        LIST(APPEND ${_qt4_options} "${_currentArg}")
-      ELSE(_QT4_DOING_OPTIONS)
-        LIST(APPEND ${_qt4_files} "${_currentArg}")
-      ENDIF(_QT4_DOING_OPTIONS)
-    ENDIF ("${_currentArg}" STREQUAL "OPTIONS")
-  ENDFOREACH(_currentArg)
-ENDMACRO (QT4_EXTRACT_OPTIONS)
+macro (QT4_EXTRACT_OPTIONS _qt4_files _qt4_options)
+  set(${_qt4_files})
+  set(${_qt4_options})
+  set(_QT4_DOING_OPTIONS FALSE)
+  foreach(_currentArg ${ARGN})
+    if ("${_currentArg}" STREQUAL "OPTIONS")
+      set(_QT4_DOING_OPTIONS TRUE)
+    else ("${_currentArg}" STREQUAL "OPTIONS")
+      if(_QT4_DOING_OPTIONS)
+        list(APPEND ${_qt4_options} "${_currentArg}")
+      else(_QT4_DOING_OPTIONS)
+        list(APPEND ${_qt4_files} "${_currentArg}")
+      endif(_QT4_DOING_OPTIONS)
+    endif ("${_currentArg}" STREQUAL "OPTIONS")
+  endforeach(_currentArg)
+endmacro (QT4_EXTRACT_OPTIONS)
 
 
 # macro used to create the names of output files preserving relative dirs
-MACRO (QT4_MAKE_OUTPUT_FILE infile prefix ext outfile )
-  STRING(LENGTH ${CMAKE_CURRENT_BINARY_DIR} _binlength)
-  STRING(LENGTH ${infile} _infileLength)
-  SET(_checkinfile ${CMAKE_CURRENT_SOURCE_DIR})
-  IF(_infileLength GREATER _binlength)
-    STRING(SUBSTRING "${infile}" 0 ${_binlength} _checkinfile)
-    IF(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
-      FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_BINARY_DIR} ${infile})
-    ELSE(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
-      FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
-    ENDIF(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
-  ELSE(_infileLength GREATER _binlength)
-    FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
-  ENDIF(_infileLength GREATER _binlength)
-  IF(WIN32 AND rel MATCHES "^[a-zA-Z]:") # absolute path
-    STRING(REGEX REPLACE "^([a-zA-Z]):(.*)$" "\\1_\\2" rel "${rel}")
-  ENDIF(WIN32 AND rel MATCHES "^[a-zA-Z]:")
-  SET(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}")
-  STRING(REPLACE ".." "__" _outfile ${_outfile})
-  GET_FILENAME_COMPONENT(outpath ${_outfile} PATH)
-  GET_FILENAME_COMPONENT(_outfile ${_outfile} NAME_WE)
-  FILE(MAKE_DIRECTORY ${outpath})
-  SET(${outfile} ${outpath}/${prefix}${_outfile}.${ext})
-ENDMACRO (QT4_MAKE_OUTPUT_FILE )
+macro (QT4_MAKE_OUTPUT_FILE infile prefix ext outfile )
+  string(LENGTH ${CMAKE_CURRENT_BINARY_DIR} _binlength)
+  string(LENGTH ${infile} _infileLength)
+  set(_checkinfile ${CMAKE_CURRENT_SOURCE_DIR})
+  if(_infileLength GREATER _binlength)
+    string(SUBSTRING "${infile}" 0 ${_binlength} _checkinfile)
+    if(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
+      file(RELATIVE_PATH rel ${CMAKE_CURRENT_BINARY_DIR} ${infile})
+    else(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
+      file(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
+    endif(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
+  else(_infileLength GREATER _binlength)
+    file(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
+  endif(_infileLength GREATER _binlength)
+  if(WIN32 AND rel MATCHES "^[a-zA-Z]:") # absolute path
+    string(REGEX REPLACE "^([a-zA-Z]):(.*)$" "\\1_\\2" rel "${rel}")
+  endif(WIN32 AND rel MATCHES "^[a-zA-Z]:")
+  set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}")
+  string(REPLACE ".." "__" _outfile ${_outfile})
+  get_filename_component(outpath ${_outfile} PATH)
+  get_filename_component(_outfile ${_outfile} NAME_WE)
+  file(MAKE_DIRECTORY ${outpath})
+  set(${outfile} ${outpath}/${prefix}${_outfile}.${ext})
+endmacro (QT4_MAKE_OUTPUT_FILE )
 
 
-MACRO (QT4_GET_MOC_FLAGS _moc_flags)
-  SET(${_moc_flags})
-  GET_DIRECTORY_PROPERTY(_inc_DIRS INCLUDE_DIRECTORIES)
+macro (QT4_GET_MOC_FLAGS _moc_flags)
+  set(${_moc_flags})
+  get_directory_property(_inc_DIRS INCLUDE_DIRECTORIES)
 
-  FOREACH(_current ${_inc_DIRS})
-    IF("${_current}" MATCHES "\\.framework/?$")
-      STRING(REGEX REPLACE "/[^/]+\\.framework" "" framework_path "${_current}")
-      SET(${_moc_flags} ${${_moc_flags}} "-F${framework_path}")
-    ELSE("${_current}" MATCHES "\\.framework/?$")
-      SET(${_moc_flags} ${${_moc_flags}} "-I${_current}")
-    ENDIF("${_current}" MATCHES "\\.framework/?$")
-  ENDFOREACH(_current ${_inc_DIRS})
+  foreach(_current ${_inc_DIRS})
+    if("${_current}" MATCHES "\\.framework/?$")
+      string(REGEX REPLACE "/[^/]+\\.framework" "" framework_path "${_current}")
+      set(${_moc_flags} ${${_moc_flags}} "-F${framework_path}")
+    else("${_current}" MATCHES "\\.framework/?$")
+      set(${_moc_flags} ${${_moc_flags}} "-I${_current}")
+    endif("${_current}" MATCHES "\\.framework/?$")
+  endforeach(_current ${_inc_DIRS})
 
-  GET_DIRECTORY_PROPERTY(_defines COMPILE_DEFINITIONS)
-  FOREACH(_current ${_defines})
-    SET(${_moc_flags} ${${_moc_flags}} "-D${_current}")
-  ENDFOREACH(_current ${_defines})
+  get_directory_property(_defines COMPILE_DEFINITIONS)
+  foreach(_current ${_defines})
+    set(${_moc_flags} ${${_moc_flags}} "-D${_current}")
+  endforeach(_current ${_defines})
 
-  IF(Q_WS_WIN)
-    SET(${_moc_flags} ${${_moc_flags}} -DWIN32)
-  ENDIF(Q_WS_WIN)
+  if(Q_WS_WIN)
+    set(${_moc_flags} ${${_moc_flags}} -DWIN32)
+  endif(Q_WS_WIN)
 
-ENDMACRO(QT4_GET_MOC_FLAGS)
+endmacro(QT4_GET_MOC_FLAGS)
 
 
 # helper macro to set up a moc rule
-MACRO (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options)
+macro (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options)
   # For Windows, create a parameters file to work around command line length limit
-  IF (WIN32)
+  if (WIN32)
     # Pass the parameters in a file.  Set the working directory to
     # be that containing the parameters file and reference it by
     # just the file name.  This is necessary because the moc tool on
     # MinGW builds does not seem to handle spaces in the path to the
     # file given with the @ syntax.
-    GET_FILENAME_COMPONENT(_moc_outfile_name "${outfile}" NAME)
-    GET_FILENAME_COMPONENT(_moc_outfile_dir "${outfile}" PATH)
-    IF(_moc_outfile_dir)
-      SET(_moc_working_dir WORKING_DIRECTORY ${_moc_outfile_dir})
-    ENDIF(_moc_outfile_dir)
-    SET (_moc_parameters_file ${outfile}_parameters)
-    SET (_moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}")
-    STRING (REPLACE ";" "\n" _moc_parameters "${_moc_parameters}")
-    FILE (WRITE ${_moc_parameters_file} "${_moc_parameters}")
-    ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+    get_filename_component(_moc_outfile_name "${outfile}" NAME)
+    get_filename_component(_moc_outfile_dir "${outfile}" PATH)
+    if(_moc_outfile_dir)
+      set(_moc_working_dir WORKING_DIRECTORY ${_moc_outfile_dir})
+    endif(_moc_outfile_dir)
+    set (_moc_parameters_file ${outfile}_parameters)
+    set (_moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}")
+    string (REPLACE ";" "\n" _moc_parameters "${_moc_parameters}")
+    file (WRITE ${_moc_parameters_file} "${_moc_parameters}")
+    add_custom_command(OUTPUT ${outfile}
                        COMMAND ${QT_MOC_EXECUTABLE} @${_moc_outfile_name}_parameters
                        DEPENDS ${infile}
                        ${_moc_working_dir}
                        VERBATIM)
-  ELSE (WIN32)
-    ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+  else (WIN32)
+    add_custom_command(OUTPUT ${outfile}
                        COMMAND ${QT_MOC_EXECUTABLE}
                        ARGS ${moc_flags} ${moc_options} -o ${outfile} ${infile}
                        DEPENDS ${infile} VERBATIM)
-  ENDIF (WIN32)
-ENDMACRO (QT4_CREATE_MOC_COMMAND)
+  endif (WIN32)
+endmacro (QT4_CREATE_MOC_COMMAND)
 
 
-MACRO (QT4_GENERATE_MOC infile outfile )
+macro (QT4_GENERATE_MOC infile outfile )
 # get include dirs and flags
    QT4_GET_MOC_FLAGS(moc_flags)
-   GET_FILENAME_COMPONENT(abs_infile ${infile} ABSOLUTE)
-   SET(_outfile "${outfile}")
-   IF(NOT IS_ABSOLUTE "${outfile}")
-     SET(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}")
-   ENDIF(NOT IS_ABSOLUTE "${outfile}")
+   get_filename_component(abs_infile ${infile} ABSOLUTE)
+   set(_outfile "${outfile}")
+   if(NOT IS_ABSOLUTE "${outfile}")
+     set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}")
+   endif(NOT IS_ABSOLUTE "${outfile}")
    QT4_CREATE_MOC_COMMAND(${abs_infile} ${_outfile} "${moc_flags}" "")
-   SET_SOURCE_FILES_PROPERTIES(${outfile} PROPERTIES SKIP_AUTOMOC TRUE)  # dont run automoc on this file
-ENDMACRO (QT4_GENERATE_MOC)
+   set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC TRUE)  # dont run automoc on this file
+endmacro (QT4_GENERATE_MOC)
 
 
 # QT4_WRAP_CPP(outfiles inputfile ... )
 
-MACRO (QT4_WRAP_CPP outfiles )
+macro (QT4_WRAP_CPP outfiles )
   # get include dirs
   QT4_GET_MOC_FLAGS(moc_flags)
   QT4_EXTRACT_OPTIONS(moc_files moc_options ${ARGN})
 
-  FOREACH (it ${moc_files})
-    GET_FILENAME_COMPONENT(it ${it} ABSOLUTE)
+  foreach (it ${moc_files})
+    get_filename_component(it ${it} ABSOLUTE)
     QT4_MAKE_OUTPUT_FILE(${it} moc_ cxx outfile)
     QT4_CREATE_MOC_COMMAND(${it} ${outfile} "${moc_flags}" "${moc_options}")
-    SET(${outfiles} ${${outfiles}} ${outfile})
-  ENDFOREACH(it)
+    set(${outfiles} ${${outfiles}} ${outfile})
+  endforeach(it)
 
-ENDMACRO (QT4_WRAP_CPP)
+endmacro (QT4_WRAP_CPP)
 
 
 # QT4_WRAP_UI(outfiles inputfile ... )
 
-MACRO (QT4_WRAP_UI outfiles )
+macro (QT4_WRAP_UI outfiles )
   QT4_EXTRACT_OPTIONS(ui_files ui_options ${ARGN})
 
-  FOREACH (it ${ui_files})
-    GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
-    GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
-    SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h)
-    ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+  foreach (it ${ui_files})
+    get_filename_component(outfile ${it} NAME_WE)
+    get_filename_component(infile ${it} ABSOLUTE)
+    set(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h)
+    add_custom_command(OUTPUT ${outfile}
       COMMAND ${QT_UIC_EXECUTABLE}
       ARGS ${ui_options} -o ${outfile} ${infile}
       MAIN_DEPENDENCY ${infile} VERBATIM)
-    SET(${outfiles} ${${outfiles}} ${outfile})
-  ENDFOREACH (it)
+    set(${outfiles} ${${outfiles}} ${outfile})
+  endforeach (it)
 
-ENDMACRO (QT4_WRAP_UI)
+endmacro (QT4_WRAP_UI)
 
 
 # QT4_ADD_RESOURCES(outfiles inputfile ... )
 
-MACRO (QT4_ADD_RESOURCES outfiles )
+macro (QT4_ADD_RESOURCES outfiles )
   QT4_EXTRACT_OPTIONS(rcc_files rcc_options ${ARGN})
 
-  FOREACH (it ${rcc_files})
-    GET_FILENAME_COMPONENT(outfilename ${it} NAME_WE)
-    GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
-    GET_FILENAME_COMPONENT(rc_path ${infile} PATH)
-    SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cxx)
+  foreach (it ${rcc_files})
+    get_filename_component(outfilename ${it} NAME_WE)
+    get_filename_component(infile ${it} ABSOLUTE)
+    get_filename_component(rc_path ${infile} PATH)
+    set(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cxx)
 
-    SET(_RC_DEPENDS)
-    IF(EXISTS "${infile}")
+    set(_RC_DEPENDS)
+    if(EXISTS "${infile}")
       #  parse file for dependencies
       #  all files are absolute paths or relative to the location of the qrc file
-      FILE(READ "${infile}" _RC_FILE_CONTENTS)
-      STRING(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}")
-      FOREACH(_RC_FILE ${_RC_FILES})
-        STRING(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}")
-        IF(NOT IS_ABSOLUTE "${_RC_FILE}")
-          SET(_RC_FILE "${rc_path}/${_RC_FILE}")
-        ENDIF(NOT IS_ABSOLUTE "${_RC_FILE}")
-        SET(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}")
-      ENDFOREACH(_RC_FILE)
+      file(READ "${infile}" _RC_FILE_CONTENTS)
+      string(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}")
+      foreach(_RC_FILE ${_RC_FILES})
+        string(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}")
+        if(NOT IS_ABSOLUTE "${_RC_FILE}")
+          set(_RC_FILE "${rc_path}/${_RC_FILE}")
+        endif(NOT IS_ABSOLUTE "${_RC_FILE}")
+        set(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}")
+      endforeach(_RC_FILE)
       # Since this cmake macro is doing the dependency scanning for these files,
       # let's make a configured file and add it as a dependency so cmake is run
       # again when dependencies need to be recomputed.
       QT4_MAKE_OUTPUT_FILE("${infile}" "" "qrc.depends" out_depends)
-      CONFIGURE_FILE("${infile}" "${out_depends}" COPY_ONLY)
-    ELSE(EXISTS "${infile}")
+      configure_file("${infile}" "${out_depends}" COPY_ONLY)
+    else(EXISTS "${infile}")
       # The .qrc file does not exist (yet). Let's add a dependency and hope
       # that it will be generated later
-      SET(out_depends)
-    ENDIF(EXISTS "${infile}")
+      set(out_depends)
+    endif(EXISTS "${infile}")
 
-    ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+    add_custom_command(OUTPUT ${outfile}
       COMMAND ${QT_RCC_EXECUTABLE}
       ARGS ${rcc_options} -name ${outfilename} -o ${outfile} ${infile}
       MAIN_DEPENDENCY ${infile}
       DEPENDS ${_RC_DEPENDS} "${out_depends}" VERBATIM)
-    SET(${outfiles} ${${outfiles}} ${outfile})
-  ENDFOREACH (it)
+    set(${outfiles} ${${outfiles}} ${outfile})
+  endforeach (it)
 
-ENDMACRO (QT4_ADD_RESOURCES)
+endmacro (QT4_ADD_RESOURCES)
 
 
-MACRO(QT4_ADD_DBUS_INTERFACE _sources _interface _basename)
-  GET_FILENAME_COMPONENT(_infile ${_interface} ABSOLUTE)
-  SET(_header "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h")
-  SET(_impl   "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp")
-  SET(_moc    "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc")
+macro(QT4_ADD_DBUS_INTERFACE _sources _interface _basename)
+  get_filename_component(_infile ${_interface} ABSOLUTE)
+  set(_header "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h")
+  set(_impl   "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp")
+  set(_moc    "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc")
 
-  GET_SOURCE_FILE_PROPERTY(_nonamespace ${_interface} NO_NAMESPACE)
-  IF(_nonamespace)
-    SET(_params -N -m)
-  ELSE(_nonamespace)
-    SET(_params -m)
-  ENDIF(_nonamespace)
+  get_source_file_property(_nonamespace ${_interface} NO_NAMESPACE)
+  if(_nonamespace)
+    set(_params -N -m)
+  else(_nonamespace)
+    set(_params -m)
+  endif(_nonamespace)
 
-  GET_SOURCE_FILE_PROPERTY(_classname ${_interface} CLASSNAME)
-  IF(_classname)
-    SET(_params ${_params} -c ${_classname})
-  ENDIF(_classname)
+  get_source_file_property(_classname ${_interface} CLASSNAME)
+  if(_classname)
+    set(_params ${_params} -c ${_classname})
+  endif(_classname)
 
-  GET_SOURCE_FILE_PROPERTY(_include ${_interface} INCLUDE)
-  IF(_include)
-    SET(_params ${_params} -i ${_include})
-  ENDIF(_include)
+  get_source_file_property(_include ${_interface} INCLUDE)
+  if(_include)
+    set(_params ${_params} -i ${_include})
+  endif(_include)
 
-  ADD_CUSTOM_COMMAND(OUTPUT "${_impl}" "${_header}"
+  add_custom_command(OUTPUT "${_impl}" "${_header}"
       COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} ${_params} -p ${_basename} ${_infile}
       DEPENDS ${_infile} VERBATIM)
 
-  SET_SOURCE_FILES_PROPERTIES("${_impl}" PROPERTIES SKIP_AUTOMOC TRUE)
+  set_source_files_properties("${_impl}" PROPERTIES SKIP_AUTOMOC TRUE)
 
   QT4_GENERATE_MOC("${_header}" "${_moc}")
 
-  LIST(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}")
+  list(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}")
   MACRO_ADD_FILE_DEPENDENCIES("${_impl}" "${_moc}")
 
-ENDMACRO(QT4_ADD_DBUS_INTERFACE)
+endmacro(QT4_ADD_DBUS_INTERFACE)
 
 
-MACRO(QT4_ADD_DBUS_INTERFACES _sources)
-  FOREACH (_current_FILE ${ARGN})
-    GET_FILENAME_COMPONENT(_infile ${_current_FILE} ABSOLUTE)
-    GET_FILENAME_COMPONENT(_basename ${_current_FILE} NAME)
+macro(QT4_ADD_DBUS_INTERFACES _sources)
+  foreach (_current_FILE ${ARGN})
+    get_filename_component(_infile ${_current_FILE} ABSOLUTE)
+    get_filename_component(_basename ${_current_FILE} NAME)
     # get the part before the ".xml" suffix
-    STRING(TOLOWER ${_basename} _basename)
-    STRING(REGEX REPLACE "(.*\\.)?([^\\.]+)\\.xml" "\\2" _basename ${_basename})
+    string(TOLOWER ${_basename} _basename)
+    string(REGEX REPLACE "(.*\\.)?([^\\.]+)\\.xml" "\\2" _basename ${_basename})
     QT4_ADD_DBUS_INTERFACE(${_sources} ${_infile} ${_basename}interface)
-  ENDFOREACH (_current_FILE)
-ENDMACRO(QT4_ADD_DBUS_INTERFACES)
+  endforeach (_current_FILE)
+endmacro(QT4_ADD_DBUS_INTERFACES)
 
 
-MACRO(QT4_GENERATE_DBUS_INTERFACE _header) # _customName OPTIONS -some -options )
+macro(QT4_GENERATE_DBUS_INTERFACE _header) # _customName OPTIONS -some -options )
   QT4_EXTRACT_OPTIONS(_customName _qt4_dbus_options ${ARGN})
 
-  GET_FILENAME_COMPONENT(_in_file ${_header} ABSOLUTE)
-  GET_FILENAME_COMPONENT(_basename ${_header} NAME_WE)
+  get_filename_component(_in_file ${_header} ABSOLUTE)
+  get_filename_component(_basename ${_header} NAME_WE)
 
-  IF (_customName)
+  if (_customName)
     if (IS_ABSOLUTE ${_customName})
       get_filename_component(_containingDir ${_customName} PATH)
       if (NOT EXISTS ${_containingDir})
         file(MAKE_DIRECTORY "${_containingDir}")
       endif()
-      SET(_target ${_customName})
+      set(_target ${_customName})
     else()
-      SET(_target ${CMAKE_CURRENT_BINARY_DIR}/${_customName})
+      set(_target ${CMAKE_CURRENT_BINARY_DIR}/${_customName})
     endif()
-  ELSE (_customName)
-    SET(_target ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.xml)
-  ENDIF (_customName)
+  else (_customName)
+    set(_target ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.xml)
+  endif (_customName)
 
-  ADD_CUSTOM_COMMAND(OUTPUT ${_target}
+  add_custom_command(OUTPUT ${_target}
       COMMAND ${QT_DBUSCPP2XML_EXECUTABLE} ${_qt4_dbus_options} ${_in_file} -o ${_target}
       DEPENDS ${_in_file} VERBATIM
   )
-ENDMACRO(QT4_GENERATE_DBUS_INTERFACE)
+endmacro(QT4_GENERATE_DBUS_INTERFACE)
 
 
-MACRO(QT4_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # _optionalBasename _optionalClassName)
-  GET_FILENAME_COMPONENT(_infile ${_xml_file} ABSOLUTE)
+macro(QT4_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # _optionalBasename _optionalClassName)
+  get_filename_component(_infile ${_xml_file} ABSOLUTE)
 
-  SET(_optionalBasename "${ARGV4}")
-  IF (_optionalBasename)
-    SET(_basename ${_optionalBasename} )
-  ELSE (_optionalBasename)
-    STRING(REGEX REPLACE "(.*[/\\.])?([^\\.]+)\\.xml" "\\2adaptor" _basename ${_infile})
-    STRING(TOLOWER ${_basename} _basename)
-  ENDIF (_optionalBasename)
+  set(_optionalBasename "${ARGV4}")
+  if (_optionalBasename)
+    set(_basename ${_optionalBasename} )
+  else (_optionalBasename)
+    string(REGEX REPLACE "(.*[/\\.])?([^\\.]+)\\.xml" "\\2adaptor" _basename ${_infile})
+    string(TOLOWER ${_basename} _basename)
+  endif (_optionalBasename)
 
-  SET(_optionalClassName "${ARGV5}")
-  SET(_header "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h")
-  SET(_impl   "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp")
-  SET(_moc    "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc")
+  set(_optionalClassName "${ARGV5}")
+  set(_header "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h")
+  set(_impl   "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp")
+  set(_moc    "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc")
 
-  IF(_optionalClassName)
-    ADD_CUSTOM_COMMAND(OUTPUT "${_impl}" "${_header}"
+  if(_optionalClassName)
+    add_custom_command(OUTPUT "${_impl}" "${_header}"
        COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -c ${_optionalClassName} -i ${_include} -l ${_parentClass} ${_infile}
        DEPENDS ${_infile} VERBATIM
     )
-  ELSE(_optionalClassName)
-    ADD_CUSTOM_COMMAND(OUTPUT "${_impl}" "${_header}"
+  else(_optionalClassName)
+    add_custom_command(OUTPUT "${_impl}" "${_header}"
        COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -i ${_include} -l ${_parentClass} ${_infile}
        DEPENDS ${_infile} VERBATIM
      )
-  ENDIF(_optionalClassName)
+  endif(_optionalClassName)
 
   QT4_GENERATE_MOC("${_header}" "${_moc}")
-  SET_SOURCE_FILES_PROPERTIES("${_impl}" PROPERTIES SKIP_AUTOMOC TRUE)
+  set_source_files_properties("${_impl}" PROPERTIES SKIP_AUTOMOC TRUE)
   MACRO_ADD_FILE_DEPENDENCIES("${_impl}" "${_moc}")
 
-  LIST(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}")
-ENDMACRO(QT4_ADD_DBUS_ADAPTOR)
+  list(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}")
+endmacro(QT4_ADD_DBUS_ADAPTOR)
 
 
-MACRO(QT4_AUTOMOC)
+macro(QT4_AUTOMOC)
   QT4_GET_MOC_FLAGS(_moc_INCS)
 
-  SET(_matching_FILES )
-  FOREACH (_current_FILE ${ARGN})
+  set(_matching_FILES )
+  foreach (_current_FILE ${ARGN})
 
-    GET_FILENAME_COMPONENT(_abs_FILE ${_current_FILE} ABSOLUTE)
+    get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE)
     # if "SKIP_AUTOMOC" is set to true, we will not handle this file here.
     # This is required to make uic work correctly:
     # we need to add generated .cpp files to the sources (to compile them),
@@ -344,98 +344,98 @@ MACRO(QT4_AUTOMOC)
     # cmake is run for the very first time on them -> however the .cpp files might
     # exist at a later run. at that time we need to skip them, so that we don't add two
     # different rules for the same moc file
-    GET_SOURCE_FILE_PROPERTY(_skip ${_abs_FILE} SKIP_AUTOMOC)
+    get_source_file_property(_skip ${_abs_FILE} SKIP_AUTOMOC)
 
-    IF ( NOT _skip AND EXISTS ${_abs_FILE} )
+    if ( NOT _skip AND EXISTS ${_abs_FILE} )
 
-      FILE(READ ${_abs_FILE} _contents)
+      file(READ ${_abs_FILE} _contents)
 
-      GET_FILENAME_COMPONENT(_abs_PATH ${_abs_FILE} PATH)
+      get_filename_component(_abs_PATH ${_abs_FILE} PATH)
 
-      STRING(REGEX MATCHALL "# *include +[^ ]+\\.moc[\">]" _match "${_contents}")
-      IF(_match)
-        FOREACH (_current_MOC_INC ${_match})
-          STRING(REGEX MATCH "[^ <\"]+\\.moc" _current_MOC "${_current_MOC_INC}")
+      string(REGEX MATCHALL "# *include +[^ ]+\\.moc[\">]" _match "${_contents}")
+      if(_match)
+        foreach (_current_MOC_INC ${_match})
+          string(REGEX MATCH "[^ <\"]+\\.moc" _current_MOC "${_current_MOC_INC}")
 
-          GET_FILENAME_COMPONENT(_basename ${_current_MOC} NAME_WE)
-          IF(EXISTS ${_abs_PATH}/${_basename}.hpp)
-            SET(_header ${_abs_PATH}/${_basename}.hpp)
-          ELSE(EXISTS ${_abs_PATH}/${_basename}.hpp)
-            SET(_header ${_abs_PATH}/${_basename}.h)
-          ENDIF(EXISTS ${_abs_PATH}/${_basename}.hpp)
-          SET(_moc    ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC})
+          get_filename_component(_basename ${_current_MOC} NAME_WE)
+          if(EXISTS ${_abs_PATH}/${_basename}.hpp)
+            set(_header ${_abs_PATH}/${_basename}.hpp)
+          else(EXISTS ${_abs_PATH}/${_basename}.hpp)
+            set(_header ${_abs_PATH}/${_basename}.h)
+          endif(EXISTS ${_abs_PATH}/${_basename}.hpp)
+          set(_moc    ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC})
           QT4_CREATE_MOC_COMMAND(${_header} ${_moc} "${_moc_INCS}" "")
           MACRO_ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc})
-        ENDFOREACH (_current_MOC_INC)
-      ENDIF(_match)
-    ENDIF ( NOT _skip AND EXISTS ${_abs_FILE} )
-  ENDFOREACH (_current_FILE)
-ENDMACRO(QT4_AUTOMOC)
+        endforeach (_current_MOC_INC)
+      endif(_match)
+    endif ( NOT _skip AND EXISTS ${_abs_FILE} )
+  endforeach (_current_FILE)
+endmacro(QT4_AUTOMOC)
 
 
-MACRO(QT4_CREATE_TRANSLATION _qm_files)
+macro(QT4_CREATE_TRANSLATION _qm_files)
    QT4_EXTRACT_OPTIONS(_lupdate_files _lupdate_options ${ARGN})
-   SET(_my_sources)
-   SET(_my_dirs)
-   SET(_my_tsfiles)
-   SET(_ts_pro)
-   FOREACH (_file ${_lupdate_files})
-     GET_FILENAME_COMPONENT(_ext ${_file} EXT)
-     GET_FILENAME_COMPONENT(_abs_FILE ${_file} ABSOLUTE)
-     IF(_ext MATCHES "ts")
-       LIST(APPEND _my_tsfiles ${_abs_FILE})
-     ELSE(_ext MATCHES "ts")
-       IF(NOT _ext)
-         LIST(APPEND _my_dirs ${_abs_FILE})
-       ELSE(NOT _ext)
-         LIST(APPEND _my_sources ${_abs_FILE})
-       ENDIF(NOT _ext)
-     ENDIF(_ext MATCHES "ts")
-   ENDFOREACH(_file)
-   FOREACH(_ts_file ${_my_tsfiles})
-     IF(_my_sources)
+   set(_my_sources)
+   set(_my_dirs)
+   set(_my_tsfiles)
+   set(_ts_pro)
+   foreach (_file ${_lupdate_files})
+     get_filename_component(_ext ${_file} EXT)
+     get_filename_component(_abs_FILE ${_file} ABSOLUTE)
+     if(_ext MATCHES "ts")
+       list(APPEND _my_tsfiles ${_abs_FILE})
+     else(_ext MATCHES "ts")
+       if(NOT _ext)
+         list(APPEND _my_dirs ${_abs_FILE})
+       else(NOT _ext)
+         list(APPEND _my_sources ${_abs_FILE})
+       endif(NOT _ext)
+     endif(_ext MATCHES "ts")
+   endforeach(_file)
+   foreach(_ts_file ${_my_tsfiles})
+     if(_my_sources)
        # make a .pro file to call lupdate on, so we don't make our commands too
        # long for some systems
-       GET_FILENAME_COMPONENT(_ts_name ${_ts_file} NAME_WE)
-       SET(_ts_pro ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_ts_name}_lupdate.pro)
-       SET(_pro_srcs)
-       FOREACH(_pro_src ${_my_sources})
-         SET(_pro_srcs "${_pro_srcs} \"${_pro_src}\"")
-       ENDFOREACH(_pro_src ${_my_sources})
-       SET(_pro_includes)
-       GET_DIRECTORY_PROPERTY(_inc_DIRS INCLUDE_DIRECTORIES)
-       FOREACH(_pro_include ${_inc_DIRS})
-         GET_FILENAME_COMPONENT(_abs_include "${_pro_include}" ABSOLUTE)
-         SET(_pro_includes "${_pro_includes} \"${_abs_include}\"")
-       ENDFOREACH(_pro_include ${CMAKE_CXX_INCLUDE_PATH})
-       FILE(WRITE ${_ts_pro} "SOURCES = ${_pro_srcs}\nINCLUDEPATH = ${_pro_includes}\n")
-     ENDIF(_my_sources)
-     ADD_CUSTOM_COMMAND(OUTPUT ${_ts_file}
+       get_filename_component(_ts_name ${_ts_file} NAME_WE)
+       set(_ts_pro ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_ts_name}_lupdate.pro)
+       set(_pro_srcs)
+       foreach(_pro_src ${_my_sources})
+         set(_pro_srcs "${_pro_srcs} \"${_pro_src}\"")
+       endforeach(_pro_src ${_my_sources})
+       set(_pro_includes)
+       get_directory_property(_inc_DIRS INCLUDE_DIRECTORIES)
+       foreach(_pro_include ${_inc_DIRS})
+         get_filename_component(_abs_include "${_pro_include}" ABSOLUTE)
+         set(_pro_includes "${_pro_includes} \"${_abs_include}\"")
+       endforeach(_pro_include ${CMAKE_CXX_INCLUDE_PATH})
+       file(WRITE ${_ts_pro} "SOURCES = ${_pro_srcs}\nINCLUDEPATH = ${_pro_includes}\n")
+     endif(_my_sources)
+     add_custom_command(OUTPUT ${_ts_file}
         COMMAND ${QT_LUPDATE_EXECUTABLE}
         ARGS ${_lupdate_options} ${_ts_pro} ${_my_dirs} -ts ${_ts_file}
         DEPENDS ${_my_sources} ${_ts_pro} VERBATIM)
-   ENDFOREACH(_ts_file)
+   endforeach(_ts_file)
    QT4_ADD_TRANSLATION(${_qm_files} ${_my_tsfiles})
-ENDMACRO(QT4_CREATE_TRANSLATION)
+endmacro(QT4_CREATE_TRANSLATION)
 
 
-MACRO(QT4_ADD_TRANSLATION _qm_files)
-  FOREACH (_current_FILE ${ARGN})
-    GET_FILENAME_COMPONENT(_abs_FILE ${_current_FILE} ABSOLUTE)
-    GET_FILENAME_COMPONENT(qm ${_abs_FILE} NAME_WE)
-    GET_SOURCE_FILE_PROPERTY(output_location ${_abs_FILE} OUTPUT_LOCATION)
-    IF(output_location)
-      FILE(MAKE_DIRECTORY "${output_location}")
-      SET(qm "${output_location}/${qm}.qm")
-    ELSE(output_location)
-      SET(qm "${CMAKE_CURRENT_BINARY_DIR}/${qm}.qm")
-    ENDIF(output_location)
+macro(QT4_ADD_TRANSLATION _qm_files)
+  foreach (_current_FILE ${ARGN})
+    get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE)
+    get_filename_component(qm ${_abs_FILE} NAME_WE)
+    get_source_file_property(output_location ${_abs_FILE} OUTPUT_LOCATION)
+    if(output_location)
+      file(MAKE_DIRECTORY "${output_location}")
+      set(qm "${output_location}/${qm}.qm")
+    else(output_location)
+      set(qm "${CMAKE_CURRENT_BINARY_DIR}/${qm}.qm")
+    endif(output_location)
 
-    ADD_CUSTOM_COMMAND(OUTPUT ${qm}
+    add_custom_command(OUTPUT ${qm}
        COMMAND ${QT_LRELEASE_EXECUTABLE}
        ARGS ${_abs_FILE} -qm ${qm}
        DEPENDS ${_abs_FILE} VERBATIM
     )
-    SET(${_qm_files} ${${_qm_files}} ${qm})
-  ENDFOREACH (_current_FILE)
-ENDMACRO(QT4_ADD_TRANSLATION)
+    set(${_qm_files} ${${_qm_files}} ${qm})
+  endforeach (_current_FILE)
+endmacro(QT4_ADD_TRANSLATION)
diff --git a/Modules/SystemInformation.cmake b/Modules/SystemInformation.cmake
index 443c7aa84..73674e6fa 100644
--- a/Modules/SystemInformation.cmake
+++ b/Modules/SystemInformation.cmake
@@ -12,92 +12,92 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})
-PROJECT(DumpInformation)
+cmake_minimum_required(VERSION ${CMAKE_VERSION})
+project(DumpInformation)
 
 # first get the standard information for th platform
-INCLUDE_DIRECTORIES("This does not exists")
-GET_DIRECTORY_PROPERTY(incl INCLUDE_DIRECTORIES)
-SET_DIRECTORY_PROPERTIES(PROPERTIES INCLUDE_DIRECTORIES "${DumpInformation_BINARY_DIR};${DumpInformation_SOURCE_DIR}")
+include_directories("This does not exists")
+get_directory_property(incl INCLUDE_DIRECTORIES)
+set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${DumpInformation_BINARY_DIR};${DumpInformation_SOURCE_DIR}")
 
-CONFIGURE_FILE("${CMAKE_ROOT}/Modules/SystemInformation.in" "${RESULT_FILE}")
+configure_file("${CMAKE_ROOT}/Modules/SystemInformation.in" "${RESULT_FILE}")
 
 
-FILE(APPEND "${RESULT_FILE}"
+file(APPEND "${RESULT_FILE}"
   "\n=================================================================\n")
-FILE(APPEND "${RESULT_FILE}"
+file(APPEND "${RESULT_FILE}"
   "=== VARIABLES\n")
-FILE(APPEND "${RESULT_FILE}"
+file(APPEND "${RESULT_FILE}"
   "=================================================================\n")
-GET_CMAKE_PROPERTY(res VARIABLES)
-FOREACH(var ${res})
-  FILE(APPEND "${RESULT_FILE}" "${var} \"${${var}}\"\n")
-ENDFOREACH(var ${res})
+get_cmake_property(res VARIABLES)
+foreach(var ${res})
+  file(APPEND "${RESULT_FILE}" "${var} \"${${var}}\"\n")
+endforeach(var ${res})
 
-FILE(APPEND "${RESULT_FILE}"
+file(APPEND "${RESULT_FILE}"
   "\n=================================================================\n")
-FILE(APPEND "${RESULT_FILE}"
+file(APPEND "${RESULT_FILE}"
   "=== COMMANDS\n")
-FILE(APPEND "${RESULT_FILE}"
+file(APPEND "${RESULT_FILE}"
   "=================================================================\n")
-GET_CMAKE_PROPERTY(res COMMANDS)
-FOREACH(var ${res})
-  FILE(APPEND "${RESULT_FILE}" "${var}\n")
-ENDFOREACH(var ${res})
+get_cmake_property(res COMMANDS)
+foreach(var ${res})
+  file(APPEND "${RESULT_FILE}" "${var}\n")
+endforeach(var ${res})
 
-FILE(APPEND "${RESULT_FILE}"
+file(APPEND "${RESULT_FILE}"
   "\n=================================================================\n")
-FILE(APPEND "${RESULT_FILE}"
+file(APPEND "${RESULT_FILE}"
   "=== MACROS\n")
-FILE(APPEND "${RESULT_FILE}"
+file(APPEND "${RESULT_FILE}"
   "=================================================================\n")
-FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt "")
-GET_CMAKE_PROPERTY(res MACROS)
-FOREACH(var ${res})
-  FILE(APPEND "${RESULT_FILE}" "${var}\n")
-ENDFOREACH(var ${res})
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt "")
+get_cmake_property(res MACROS)
+foreach(var ${res})
+  file(APPEND "${RESULT_FILE}" "${var}\n")
+endforeach(var ${res})
 
-FILE(APPEND "${RESULT_FILE}"
+file(APPEND "${RESULT_FILE}"
   "\n=================================================================\n")
-FILE(APPEND "${RESULT_FILE}"
+file(APPEND "${RESULT_FILE}"
   "=== OTHER\n")
-FILE(APPEND "${RESULT_FILE}"
+file(APPEND "${RESULT_FILE}"
   "=================================================================\n")
-GET_DIRECTORY_PROPERTY(res INCLUDE_DIRECTORIES)
-FOREACH(var ${res})
-  FILE(APPEND "${RESULT_FILE}" "INCLUDE_DIRECTORY: ${var}\n")
-ENDFOREACH(var)
+get_directory_property(res INCLUDE_DIRECTORIES)
+foreach(var ${res})
+  file(APPEND "${RESULT_FILE}" "INCLUDE_DIRECTORY: ${var}\n")
+endforeach(var)
 
-GET_DIRECTORY_PROPERTY(res LINK_DIRECTORIES)
-FOREACH(var ${res})
-  FILE(APPEND "${RESULT_FILE}" "LINK_DIRECTORIES: ${var}\n")
-ENDFOREACH(var)
+get_directory_property(res LINK_DIRECTORIES)
+foreach(var ${res})
+  file(APPEND "${RESULT_FILE}" "LINK_DIRECTORIES: ${var}\n")
+endforeach(var)
 
-GET_DIRECTORY_PROPERTY(res INCLUDE_REGULAR_EXPRESSION)
-FILE(APPEND "${RESULT_FILE}" "INCLUDE_REGULAR_EXPRESSION: ${res}\n")
+get_directory_property(res INCLUDE_REGULAR_EXPRESSION)
+file(APPEND "${RESULT_FILE}" "INCLUDE_REGULAR_EXPRESSION: ${res}\n")
 
 # include other files if they are present, such as when run from within the
 # binary tree
-MACRO(DUMP_FILE THE_FILE)
-  IF (EXISTS "${THE_FILE}")
-    FILE(APPEND "${RESULT_FILE}"
+macro(DUMP_FILE THE_FILE)
+  if (EXISTS "${THE_FILE}")
+    file(APPEND "${RESULT_FILE}"
       "\n=================================================================\n")
-    FILE(APPEND "${RESULT_FILE}"
+    file(APPEND "${RESULT_FILE}"
       "=== ${THE_FILE}\n")
-    FILE(APPEND "${RESULT_FILE}"
+    file(APPEND "${RESULT_FILE}"
       "=================================================================\n")
 
-    FILE(READ "${THE_FILE}" FILE_CONTENTS LIMIT 50000)
-    FILE(APPEND "${RESULT_FILE}" "${FILE_CONTENTS}")
-  ENDIF (EXISTS "${THE_FILE}")
-ENDMACRO(DUMP_FILE)
+    file(READ "${THE_FILE}" FILE_CONTENTS LIMIT 50000)
+    file(APPEND "${RESULT_FILE}" "${FILE_CONTENTS}")
+  endif (EXISTS "${THE_FILE}")
+endmacro(DUMP_FILE)
 
 DUMP_FILE("../CMakeCache.txt")
 DUMP_FILE("../CMakeFiles/CMakeOutput.log")
 DUMP_FILE("../CMakeFiles/CMakeError.log")
 DUMP_FILE("../CMakeFiles/CMakeSystem.cmake")
 
-FOREACH (EXTRA_FILE ${EXTRA_DUMP_FILES})
+foreach (EXTRA_FILE ${EXTRA_DUMP_FILES})
   DUMP_FILE("${EXTRA_FILE}")
-ENDFOREACH (EXTRA_FILE)
+endforeach (EXTRA_FILE)
 
diff --git a/Modules/TestBigEndian.cmake b/Modules/TestBigEndian.cmake
index bca7979df..d162f13e7 100644
--- a/Modules/TestBigEndian.cmake
+++ b/Modules/TestBigEndian.cmake
@@ -17,96 +17,96 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-MACRO(TEST_BIG_ENDIAN VARIABLE)
-  IF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
-    MESSAGE(STATUS "Check if the system is big endian")
-    MESSAGE(STATUS "Searching 16 bit integer")
+macro(TEST_BIG_ENDIAN VARIABLE)
+  if("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
+    message(STATUS "Check if the system is big endian")
+    message(STATUS "Searching 16 bit integer")
 
-    INCLUDE(CheckTypeSize)
+    include(CheckTypeSize)
 
     CHECK_TYPE_SIZE("unsigned short" CMAKE_SIZEOF_UNSIGNED_SHORT)
-    IF(CMAKE_SIZEOF_UNSIGNED_SHORT EQUAL 2)
-      MESSAGE(STATUS "Using unsigned short")
-      SET(CMAKE_16BIT_TYPE "unsigned short")
-    ELSE(CMAKE_SIZEOF_UNSIGNED_SHORT EQUAL 2)
+    if(CMAKE_SIZEOF_UNSIGNED_SHORT EQUAL 2)
+      message(STATUS "Using unsigned short")
+      set(CMAKE_16BIT_TYPE "unsigned short")
+    else(CMAKE_SIZEOF_UNSIGNED_SHORT EQUAL 2)
       CHECK_TYPE_SIZE("unsigned int"   CMAKE_SIZEOF_UNSIGNED_INT)
-      IF(CMAKE_SIZEOF_UNSIGNED_INT)
-        MESSAGE(STATUS "Using unsigned int")
-        SET(CMAKE_16BIT_TYPE "unsigned int")
+      if(CMAKE_SIZEOF_UNSIGNED_INT)
+        message(STATUS "Using unsigned int")
+        set(CMAKE_16BIT_TYPE "unsigned int")
 
-      ELSE(CMAKE_SIZEOF_UNSIGNED_INT)
+      else(CMAKE_SIZEOF_UNSIGNED_INT)
 
         CHECK_TYPE_SIZE("unsigned long"  CMAKE_SIZEOF_UNSIGNED_LONG)
-        IF(CMAKE_SIZEOF_UNSIGNED_LONG)
-          MESSAGE(STATUS "Using unsigned long")
-          SET(CMAKE_16BIT_TYPE "unsigned long")
-        ELSE(CMAKE_SIZEOF_UNSIGNED_LONG)
-          MESSAGE(FATAL_ERROR "no suitable type found")
-        ENDIF(CMAKE_SIZEOF_UNSIGNED_LONG)
+        if(CMAKE_SIZEOF_UNSIGNED_LONG)
+          message(STATUS "Using unsigned long")
+          set(CMAKE_16BIT_TYPE "unsigned long")
+        else(CMAKE_SIZEOF_UNSIGNED_LONG)
+          message(FATAL_ERROR "no suitable type found")
+        endif(CMAKE_SIZEOF_UNSIGNED_LONG)
 
-      ENDIF(CMAKE_SIZEOF_UNSIGNED_INT)
+      endif(CMAKE_SIZEOF_UNSIGNED_INT)
 
-    ENDIF(CMAKE_SIZEOF_UNSIGNED_SHORT EQUAL 2)
+    endif(CMAKE_SIZEOF_UNSIGNED_SHORT EQUAL 2)
 
 
-    CONFIGURE_FILE("${CMAKE_ROOT}/Modules/TestEndianess.c.in"
+    configure_file("${CMAKE_ROOT}/Modules/TestEndianess.c.in"
                    "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/TestEndianess.c"
                     IMMEDIATE @ONLY)
 
-     FILE(READ "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/TestEndianess.c"
+     file(READ "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/TestEndianess.c"
           TEST_ENDIANESS_FILE_CONTENT)
 
-     TRY_COMPILE(HAVE_${VARIABLE}
+     try_compile(HAVE_${VARIABLE}
       "${CMAKE_BINARY_DIR}"
       "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/TestEndianess.c"
       OUTPUT_VARIABLE OUTPUT
       COPY_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestEndianess.bin" )
 
-      IF(HAVE_${VARIABLE})
+      if(HAVE_${VARIABLE})
 
-        FILE(STRINGS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestEndianess.bin"
+        file(STRINGS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestEndianess.bin"
             CMAKE_TEST_ENDIANESS_STRINGS_LE LIMIT_COUNT 1 REGEX "THIS IS LITTLE ENDIAN")
 
-        FILE(STRINGS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestEndianess.bin"
+        file(STRINGS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestEndianess.bin"
             CMAKE_TEST_ENDIANESS_STRINGS_BE LIMIT_COUNT 1 REGEX "THIS IS BIG ENDIAN")
 
         # on mac, if there are universal binaries built both will be true
         # return the result depending on the machine on which cmake runs
-        IF(CMAKE_TEST_ENDIANESS_STRINGS_BE  AND  CMAKE_TEST_ENDIANESS_STRINGS_LE)
-          IF(CMAKE_SYSTEM_PROCESSOR MATCHES powerpc)
-            SET(CMAKE_TEST_ENDIANESS_STRINGS_BE TRUE)
-            SET(CMAKE_TEST_ENDIANESS_STRINGS_LE FALSE)
-          ELSE(CMAKE_SYSTEM_PROCESSOR MATCHES powerpc)
-            SET(CMAKE_TEST_ENDIANESS_STRINGS_BE FALSE)
-            SET(CMAKE_TEST_ENDIANESS_STRINGS_LE TRUE)
-          ENDIF(CMAKE_SYSTEM_PROCESSOR MATCHES powerpc)
-          MESSAGE(STATUS "TEST_BIG_ENDIAN found different results, consider setting CMAKE_OSX_ARCHITECTURES or CMAKE_TRY_COMPILE_OSX_ARCHITECTURES to one or no architecture !")
-        ENDIF(CMAKE_TEST_ENDIANESS_STRINGS_BE  AND  CMAKE_TEST_ENDIANESS_STRINGS_LE)
+        if(CMAKE_TEST_ENDIANESS_STRINGS_BE  AND  CMAKE_TEST_ENDIANESS_STRINGS_LE)
+          if(CMAKE_SYSTEM_PROCESSOR MATCHES powerpc)
+            set(CMAKE_TEST_ENDIANESS_STRINGS_BE TRUE)
+            set(CMAKE_TEST_ENDIANESS_STRINGS_LE FALSE)
+          else(CMAKE_SYSTEM_PROCESSOR MATCHES powerpc)
+            set(CMAKE_TEST_ENDIANESS_STRINGS_BE FALSE)
+            set(CMAKE_TEST_ENDIANESS_STRINGS_LE TRUE)
+          endif(CMAKE_SYSTEM_PROCESSOR MATCHES powerpc)
+          message(STATUS "TEST_BIG_ENDIAN found different results, consider setting CMAKE_OSX_ARCHITECTURES or CMAKE_TRY_COMPILE_OSX_ARCHITECTURES to one or no architecture !")
+        endif(CMAKE_TEST_ENDIANESS_STRINGS_BE  AND  CMAKE_TEST_ENDIANESS_STRINGS_LE)
 
-        IF(CMAKE_TEST_ENDIANESS_STRINGS_LE)
-          SET(${VARIABLE} 0 CACHE INTERNAL "Result of TEST_BIG_ENDIAN" FORCE)
-          MESSAGE(STATUS "Check if the system is big endian - little endian")
-        ENDIF(CMAKE_TEST_ENDIANESS_STRINGS_LE)
+        if(CMAKE_TEST_ENDIANESS_STRINGS_LE)
+          set(${VARIABLE} 0 CACHE INTERNAL "Result of TEST_BIG_ENDIAN" FORCE)
+          message(STATUS "Check if the system is big endian - little endian")
+        endif(CMAKE_TEST_ENDIANESS_STRINGS_LE)
 
-        IF(CMAKE_TEST_ENDIANESS_STRINGS_BE)
-          SET(${VARIABLE} 1 CACHE INTERNAL "Result of TEST_BIG_ENDIAN" FORCE)
-          MESSAGE(STATUS "Check if the system is big endian - big endian")
-        ENDIF(CMAKE_TEST_ENDIANESS_STRINGS_BE)
+        if(CMAKE_TEST_ENDIANESS_STRINGS_BE)
+          set(${VARIABLE} 1 CACHE INTERNAL "Result of TEST_BIG_ENDIAN" FORCE)
+          message(STATUS "Check if the system is big endian - big endian")
+        endif(CMAKE_TEST_ENDIANESS_STRINGS_BE)
 
-        IF(NOT CMAKE_TEST_ENDIANESS_STRINGS_BE  AND  NOT CMAKE_TEST_ENDIANESS_STRINGS_LE)
-          MESSAGE(SEND_ERROR "TEST_BIG_ENDIAN found no result!")
-        ENDIF(NOT CMAKE_TEST_ENDIANESS_STRINGS_BE  AND  NOT CMAKE_TEST_ENDIANESS_STRINGS_LE)
+        if(NOT CMAKE_TEST_ENDIANESS_STRINGS_BE  AND  NOT CMAKE_TEST_ENDIANESS_STRINGS_LE)
+          message(SEND_ERROR "TEST_BIG_ENDIAN found no result!")
+        endif(NOT CMAKE_TEST_ENDIANESS_STRINGS_BE  AND  NOT CMAKE_TEST_ENDIANESS_STRINGS_LE)
 
-        FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+        file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
           "Determining if the system is big endian passed with the following output:\n${OUTPUT}\nTestEndianess.c:\n${TEST_ENDIANESS_FILE_CONTENT}\n\n")
 
-      ELSE(HAVE_${VARIABLE})
-        MESSAGE(STATUS "Check if the system is big endian - failed")
-        FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+      else(HAVE_${VARIABLE})
+        message(STATUS "Check if the system is big endian - failed")
+        file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
           "Determining if the system is big endian failed with the following output:\n${OUTPUT}\nTestEndianess.c:\n${TEST_ENDIANESS_FILE_CONTENT}\n\n")
-        SET(${VARIABLE})
-      ENDIF(HAVE_${VARIABLE})
-  ENDIF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
-ENDMACRO(TEST_BIG_ENDIAN)
+        set(${VARIABLE})
+      endif(HAVE_${VARIABLE})
+  endif("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
+endmacro(TEST_BIG_ENDIAN)
 
 
diff --git a/Modules/TestCXXAcceptsFlag.cmake b/Modules/TestCXXAcceptsFlag.cmake
index 0d945bbdc..58623f8c4 100644
--- a/Modules/TestCXXAcceptsFlag.cmake
+++ b/Modules/TestCXXAcceptsFlag.cmake
@@ -20,24 +20,24 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-MACRO(CHECK_CXX_ACCEPTS_FLAG FLAGS  VARIABLE)
-  IF(NOT DEFINED ${VARIABLE})
-    MESSAGE(STATUS "Checking to see if CXX compiler accepts flag ${FLAGS}")
-    TRY_COMPILE(${VARIABLE}
+macro(CHECK_CXX_ACCEPTS_FLAG FLAGS  VARIABLE)
+  if(NOT DEFINED ${VARIABLE})
+    message(STATUS "Checking to see if CXX compiler accepts flag ${FLAGS}")
+    try_compile(${VARIABLE}
       ${CMAKE_BINARY_DIR}
       ${CMAKE_ROOT}/Modules/DummyCXXFile.cxx
       CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${FLAGS}
       OUTPUT_VARIABLE OUTPUT)
-    IF(${VARIABLE})
-      MESSAGE(STATUS "Checking to see if CXX compiler accepts flag ${FLAGS} - yes")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    if(${VARIABLE})
+      message(STATUS "Checking to see if CXX compiler accepts flag ${FLAGS} - yes")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if the CXX compiler accepts the flag ${FLAGS} passed with "
         "the following output:\n${OUTPUT}\n\n")
-    ELSE(${VARIABLE})
-      MESSAGE(STATUS "Checking to see if CXX compiler accepts flag ${FLAGS} - no")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+    else(${VARIABLE})
+      message(STATUS "Checking to see if CXX compiler accepts flag ${FLAGS} - no")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if the CXX compiler accepts the flag ${FLAGS} failed with "
         "the following output:\n${OUTPUT}\n\n")
-    ENDIF(${VARIABLE})
-  ENDIF(NOT DEFINED ${VARIABLE})
-ENDMACRO(CHECK_CXX_ACCEPTS_FLAG)
+    endif(${VARIABLE})
+  endif(NOT DEFINED ${VARIABLE})
+endmacro(CHECK_CXX_ACCEPTS_FLAG)
diff --git a/Modules/TestForANSIForScope.cmake b/Modules/TestForANSIForScope.cmake
index a60719e1a..d7e2c926f 100644
--- a/Modules/TestForANSIForScope.cmake
+++ b/Modules/TestForANSIForScope.cmake
@@ -16,27 +16,27 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-IF("CMAKE_ANSI_FOR_SCOPE" MATCHES "^CMAKE_ANSI_FOR_SCOPE$")
-  MESSAGE(STATUS "Check for ANSI scope")
-  TRY_COMPILE(CMAKE_ANSI_FOR_SCOPE  ${CMAKE_BINARY_DIR}
+if("CMAKE_ANSI_FOR_SCOPE" MATCHES "^CMAKE_ANSI_FOR_SCOPE$")
+  message(STATUS "Check for ANSI scope")
+  try_compile(CMAKE_ANSI_FOR_SCOPE  ${CMAKE_BINARY_DIR}
     ${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx
     OUTPUT_VARIABLE OUTPUT)
-  IF (CMAKE_ANSI_FOR_SCOPE)
-    MESSAGE(STATUS "Check for ANSI scope - found")
-    SET (CMAKE_NO_ANSI_FOR_SCOPE 0 CACHE INTERNAL
+  if (CMAKE_ANSI_FOR_SCOPE)
+    message(STATUS "Check for ANSI scope - found")
+    set (CMAKE_NO_ANSI_FOR_SCOPE 0 CACHE INTERNAL
       "Does the compiler support ansi for scope.")
-    FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining if the CXX compiler understands ansi for scopes passed with "
       "the following output:\n${OUTPUT}\n\n")
-  ELSE (CMAKE_ANSI_FOR_SCOPE)
-    MESSAGE(STATUS "Check for ANSI scope - not found")
-    SET (CMAKE_NO_ANSI_FOR_SCOPE 1 CACHE INTERNAL
+  else (CMAKE_ANSI_FOR_SCOPE)
+    message(STATUS "Check for ANSI scope - not found")
+    set (CMAKE_NO_ANSI_FOR_SCOPE 1 CACHE INTERNAL
       "Does the compiler support ansi for scope.")
-    FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+    file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
       "Determining if the CXX compiler understands ansi for scopes failed with "
       "the following output:\n${OUTPUT}\n\n")
-  ENDIF (CMAKE_ANSI_FOR_SCOPE)
-ENDIF("CMAKE_ANSI_FOR_SCOPE" MATCHES "^CMAKE_ANSI_FOR_SCOPE$")
+  endif (CMAKE_ANSI_FOR_SCOPE)
+endif("CMAKE_ANSI_FOR_SCOPE" MATCHES "^CMAKE_ANSI_FOR_SCOPE$")
 
 
 
diff --git a/Modules/TestForANSIStreamHeaders.cmake b/Modules/TestForANSIStreamHeaders.cmake
index b542b7481..1ed532ed5 100644
--- a/Modules/TestForANSIStreamHeaders.cmake
+++ b/Modules/TestForANSIStreamHeaders.cmake
@@ -16,19 +16,19 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-INCLUDE(CheckIncludeFileCXX)
+include(CheckIncludeFileCXX)
 
-IF(NOT CMAKE_NO_ANSI_STREAM_HEADERS)
+if(NOT CMAKE_NO_ANSI_STREAM_HEADERS)
   CHECK_INCLUDE_FILE_CXX(iostream CMAKE_ANSI_STREAM_HEADERS)
-  IF (CMAKE_ANSI_STREAM_HEADERS)
-    SET (CMAKE_NO_ANSI_STREAM_HEADERS 0 CACHE INTERNAL
+  if (CMAKE_ANSI_STREAM_HEADERS)
+    set (CMAKE_NO_ANSI_STREAM_HEADERS 0 CACHE INTERNAL
          "Does the compiler support headers like iostream.")
-  ELSE (CMAKE_ANSI_STREAM_HEADERS)
-    SET (CMAKE_NO_ANSI_STREAM_HEADERS 1 CACHE INTERNAL
+  else (CMAKE_ANSI_STREAM_HEADERS)
+    set (CMAKE_NO_ANSI_STREAM_HEADERS 1 CACHE INTERNAL
        "Does the compiler support headers like iostream.")
-  ENDIF (CMAKE_ANSI_STREAM_HEADERS)
+  endif (CMAKE_ANSI_STREAM_HEADERS)
 
-  MARK_AS_ADVANCED(CMAKE_NO_ANSI_STREAM_HEADERS)
-ENDIF(NOT CMAKE_NO_ANSI_STREAM_HEADERS)
+  mark_as_advanced(CMAKE_NO_ANSI_STREAM_HEADERS)
+endif(NOT CMAKE_NO_ANSI_STREAM_HEADERS)
 
 
diff --git a/Modules/TestForSSTREAM.cmake b/Modules/TestForSSTREAM.cmake
index 30ff3bcb9..cdd809111 100644
--- a/Modules/TestForSSTREAM.cmake
+++ b/Modules/TestForSSTREAM.cmake
@@ -16,27 +16,27 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-IF("CMAKE_HAS_ANSI_STRING_STREAM" MATCHES "^CMAKE_HAS_ANSI_STRING_STREAM$")
-  MESSAGE(STATUS "Check for sstream")
-  TRY_COMPILE(CMAKE_HAS_ANSI_STRING_STREAM  ${CMAKE_BINARY_DIR}
+if("CMAKE_HAS_ANSI_STRING_STREAM" MATCHES "^CMAKE_HAS_ANSI_STRING_STREAM$")
+  message(STATUS "Check for sstream")
+  try_compile(CMAKE_HAS_ANSI_STRING_STREAM  ${CMAKE_BINARY_DIR}
     ${CMAKE_ROOT}/Modules/TestForSSTREAM.cxx
     OUTPUT_VARIABLE OUTPUT)
-  IF (CMAKE_HAS_ANSI_STRING_STREAM)
-    MESSAGE(STATUS "Check for sstream - found")
-    SET (CMAKE_NO_ANSI_STRING_STREAM 0 CACHE INTERNAL
+  if (CMAKE_HAS_ANSI_STRING_STREAM)
+    message(STATUS "Check for sstream - found")
+    set (CMAKE_NO_ANSI_STRING_STREAM 0 CACHE INTERNAL
          "Does the compiler support sstream")
-    FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining if the CXX compiler has sstream passed with "
       "the following output:\n${OUTPUT}\n\n")
-  ELSE (CMAKE_HAS_ANSI_STRING_STREAM)
-    MESSAGE(STATUS "Check for sstream - not found")
-    SET (CMAKE_NO_ANSI_STRING_STREAM 1 CACHE INTERNAL
+  else (CMAKE_HAS_ANSI_STRING_STREAM)
+    message(STATUS "Check for sstream - not found")
+    set (CMAKE_NO_ANSI_STRING_STREAM 1 CACHE INTERNAL
        "Does the compiler support sstream")
-    FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+    file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
       "Determining if the CXX compiler has sstream failed with "
       "the following output:\n${OUTPUT}\n\n")
-  ENDIF (CMAKE_HAS_ANSI_STRING_STREAM)
-ENDIF("CMAKE_HAS_ANSI_STRING_STREAM" MATCHES "^CMAKE_HAS_ANSI_STRING_STREAM$")
+  endif (CMAKE_HAS_ANSI_STRING_STREAM)
+endif("CMAKE_HAS_ANSI_STRING_STREAM" MATCHES "^CMAKE_HAS_ANSI_STRING_STREAM$")
 
 
 
diff --git a/Modules/TestForSTDNamespace.cmake b/Modules/TestForSTDNamespace.cmake
index 65e0de044..848aa8722 100644
--- a/Modules/TestForSTDNamespace.cmake
+++ b/Modules/TestForSTDNamespace.cmake
@@ -16,27 +16,27 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-IF("CMAKE_STD_NAMESPACE" MATCHES "^CMAKE_STD_NAMESPACE$")
-  MESSAGE(STATUS "Check for STD namespace")
-  TRY_COMPILE(CMAKE_STD_NAMESPACE  ${CMAKE_BINARY_DIR}
+if("CMAKE_STD_NAMESPACE" MATCHES "^CMAKE_STD_NAMESPACE$")
+  message(STATUS "Check for STD namespace")
+  try_compile(CMAKE_STD_NAMESPACE  ${CMAKE_BINARY_DIR}
     ${CMAKE_ROOT}/Modules/TestForSTDNamespace.cxx
     OUTPUT_VARIABLE OUTPUT)
-  IF (CMAKE_STD_NAMESPACE)
-    MESSAGE(STATUS "Check for STD namespace - found")
-    SET (CMAKE_NO_STD_NAMESPACE 0 CACHE INTERNAL
+  if (CMAKE_STD_NAMESPACE)
+    message(STATUS "Check for STD namespace - found")
+    set (CMAKE_NO_STD_NAMESPACE 0 CACHE INTERNAL
          "Does the compiler support std::.")
-    FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining if the CXX compiler has std namespace passed with "
       "the following output:\n${OUTPUT}\n\n")
-  ELSE (CMAKE_STD_NAMESPACE)
-    MESSAGE(STATUS "Check for STD namespace - not found")
-    SET (CMAKE_NO_STD_NAMESPACE 1 CACHE INTERNAL
+  else (CMAKE_STD_NAMESPACE)
+    message(STATUS "Check for STD namespace - not found")
+    set (CMAKE_NO_STD_NAMESPACE 1 CACHE INTERNAL
        "Does the compiler support std::.")
-    FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+    file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
       "Determining if the CXX compiler has std namespace failed with "
       "the following output:\n${OUTPUT}\n\n")
-  ENDIF (CMAKE_STD_NAMESPACE)
-ENDIF("CMAKE_STD_NAMESPACE" MATCHES "^CMAKE_STD_NAMESPACE$")
+  endif (CMAKE_STD_NAMESPACE)
+endif("CMAKE_STD_NAMESPACE" MATCHES "^CMAKE_STD_NAMESPACE$")
 
 
 
diff --git a/Modules/UseEcos.cmake b/Modules/UseEcos.cmake
index 60e1e46b4..e3e7798d8 100644
--- a/Modules/UseEcos.cmake
+++ b/Modules/UseEcos.cmake
@@ -30,89 +30,89 @@
 #  License text for the above reference.)
 
 # first check that ecosconfig is available
-FIND_PROGRAM(ECOSCONFIG_EXECUTABLE NAMES ecosconfig)
-IF(NOT ECOSCONFIG_EXECUTABLE)
-   MESSAGE(SEND_ERROR "ecosconfig was not found. Either include it in the system path or set it manually using ccmake.")
-ELSE(NOT ECOSCONFIG_EXECUTABLE)
-   MESSAGE(STATUS "Found ecosconfig: ${ECOSCONFIG_EXECUTABLE}")
-ENDIF(NOT ECOSCONFIG_EXECUTABLE)
+find_program(ECOSCONFIG_EXECUTABLE NAMES ecosconfig)
+if(NOT ECOSCONFIG_EXECUTABLE)
+   message(SEND_ERROR "ecosconfig was not found. Either include it in the system path or set it manually using ccmake.")
+else(NOT ECOSCONFIG_EXECUTABLE)
+   message(STATUS "Found ecosconfig: ${ECOSCONFIG_EXECUTABLE}")
+endif(NOT ECOSCONFIG_EXECUTABLE)
 
 # check that ECOS_REPOSITORY is set correctly
-IF (NOT EXISTS $ENV{ECOS_REPOSITORY}/ecos.db)
-   MESSAGE(SEND_ERROR "The environment variable ECOS_REPOSITORY is not set correctly. Set it to the directory which contains the file ecos.db")
-ELSE (NOT EXISTS $ENV{ECOS_REPOSITORY}/ecos.db)
-   MESSAGE(STATUS "ECOS_REPOSITORY is set to $ENV{ECOS_REPOSITORY}")
-ENDIF (NOT EXISTS $ENV{ECOS_REPOSITORY}/ecos.db)
+if (NOT EXISTS $ENV{ECOS_REPOSITORY}/ecos.db)
+   message(SEND_ERROR "The environment variable ECOS_REPOSITORY is not set correctly. Set it to the directory which contains the file ecos.db")
+else (NOT EXISTS $ENV{ECOS_REPOSITORY}/ecos.db)
+   message(STATUS "ECOS_REPOSITORY is set to $ENV{ECOS_REPOSITORY}")
+endif (NOT EXISTS $ENV{ECOS_REPOSITORY}/ecos.db)
 
 # check that tclsh (coming with TCL) is available, otherwise ecosconfig doesn't work
-FIND_PACKAGE(Tclsh)
-IF (NOT TCL_TCLSH)
-   MESSAGE(SEND_ERROR "The TCL tclsh was not found. Please install TCL, it is required for building eCos applications.")
-ELSE (NOT TCL_TCLSH)
-   MESSAGE(STATUS "tlcsh found: ${TCL_TCLSH}")
-ENDIF (NOT TCL_TCLSH)
+find_package(Tclsh)
+if (NOT TCL_TCLSH)
+   message(SEND_ERROR "The TCL tclsh was not found. Please install TCL, it is required for building eCos applications.")
+else (NOT TCL_TCLSH)
+   message(STATUS "tlcsh found: ${TCL_TCLSH}")
+endif (NOT TCL_TCLSH)
 
 #add the globale include-diretories
 #usage: ECOS_ADD_INCLUDE_DIRECTORIES()
-MACRO(ECOS_ADD_INCLUDE_DIRECTORIES)
+macro(ECOS_ADD_INCLUDE_DIRECTORIES)
 #check for ProjectSources.txt one level higher
-   IF (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../ProjectSources.txt)
-      INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../)
-   ELSE (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../ProjectSources.txt)
-      INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/)
-   ENDIF (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../ProjectSources.txt)
+   if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../ProjectSources.txt)
+      include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../)
+   else (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../ProjectSources.txt)
+      include_directories(${CMAKE_CURRENT_SOURCE_DIR}/)
+   endif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../ProjectSources.txt)
 
 #the ecos include directory
-   INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/ecos/install/include/)
+   include_directories(${CMAKE_CURRENT_BINARY_DIR}/ecos/install/include/)
 
-ENDMACRO(ECOS_ADD_INCLUDE_DIRECTORIES)
+endmacro(ECOS_ADD_INCLUDE_DIRECTORIES)
 
 
 #we want to compile for the xscale processor, in this case the following macro has to be called
 #usage: ECOS_USE_ARM_ELF_TOOLS()
-MACRO (ECOS_USE_ARM_ELF_TOOLS)
-   SET(CMAKE_CXX_COMPILER "arm-elf-c++")
-   SET(CMAKE_COMPILER_IS_GNUCXX 1)
-   SET(CMAKE_C_COMPILER "arm-elf-gcc")
-   SET(CMAKE_AR "arm-elf-ar")
-   SET(CMAKE_RANLIB "arm-elf-ranlib")
+macro (ECOS_USE_ARM_ELF_TOOLS)
+   set(CMAKE_CXX_COMPILER "arm-elf-c++")
+   set(CMAKE_COMPILER_IS_GNUCXX 1)
+   set(CMAKE_C_COMPILER "arm-elf-gcc")
+   set(CMAKE_AR "arm-elf-ar")
+   set(CMAKE_RANLIB "arm-elf-ranlib")
 #for linking
-   SET(ECOS_LD_MCPU "-mcpu=xscale")
+   set(ECOS_LD_MCPU "-mcpu=xscale")
 #for compiling
-   ADD_DEFINITIONS(-mcpu=xscale -mapcs-frame)
+   add_definitions(-mcpu=xscale -mapcs-frame)
 #for the obj-tools
-   SET(ECOS_ARCH_PREFIX "arm-elf-")
-ENDMACRO (ECOS_USE_ARM_ELF_TOOLS)
+   set(ECOS_ARCH_PREFIX "arm-elf-")
+endmacro (ECOS_USE_ARM_ELF_TOOLS)
 
 #usage: ECOS_USE_PPC_EABI_TOOLS()
-MACRO (ECOS_USE_PPC_EABI_TOOLS)
-   SET(CMAKE_CXX_COMPILER "powerpc-eabi-c++")
-   SET(CMAKE_COMPILER_IS_GNUCXX 1)
-   SET(CMAKE_C_COMPILER "powerpc-eabi-gcc")
-   SET(CMAKE_AR "powerpc-eabi-ar")
-   SET(CMAKE_RANLIB "powerpc-eabi-ranlib")
+macro (ECOS_USE_PPC_EABI_TOOLS)
+   set(CMAKE_CXX_COMPILER "powerpc-eabi-c++")
+   set(CMAKE_COMPILER_IS_GNUCXX 1)
+   set(CMAKE_C_COMPILER "powerpc-eabi-gcc")
+   set(CMAKE_AR "powerpc-eabi-ar")
+   set(CMAKE_RANLIB "powerpc-eabi-ranlib")
 #for linking
-   SET(ECOS_LD_MCPU "")
+   set(ECOS_LD_MCPU "")
 #for compiling
-   ADD_DEFINITIONS()
+   add_definitions()
 #for the obj-tools
-   SET(ECOS_ARCH_PREFIX "powerpc-eabi-")
-ENDMACRO (ECOS_USE_PPC_EABI_TOOLS)
+   set(ECOS_ARCH_PREFIX "powerpc-eabi-")
+endmacro (ECOS_USE_PPC_EABI_TOOLS)
 
 #usage: ECOS_USE_I386_ELF_TOOLS()
-MACRO (ECOS_USE_I386_ELF_TOOLS)
-   SET(CMAKE_CXX_COMPILER "i386-elf-c++")
-   SET(CMAKE_COMPILER_IS_GNUCXX 1)
-   SET(CMAKE_C_COMPILER "i386-elf-gcc")
-   SET(CMAKE_AR "i386-elf-ar")
-   SET(CMAKE_RANLIB "i386-elf-ranlib")
+macro (ECOS_USE_I386_ELF_TOOLS)
+   set(CMAKE_CXX_COMPILER "i386-elf-c++")
+   set(CMAKE_COMPILER_IS_GNUCXX 1)
+   set(CMAKE_C_COMPILER "i386-elf-gcc")
+   set(CMAKE_AR "i386-elf-ar")
+   set(CMAKE_RANLIB "i386-elf-ranlib")
 #for linking
-   SET(ECOS_LD_MCPU "")
+   set(ECOS_LD_MCPU "")
 #for compiling
-   ADD_DEFINITIONS()
+   add_definitions()
 #for the obj-tools
-   SET(ECOS_ARCH_PREFIX "i386-elf-")
-ENDMACRO (ECOS_USE_I386_ELF_TOOLS)
+   set(ECOS_ARCH_PREFIX "i386-elf-")
+endmacro (ECOS_USE_I386_ELF_TOOLS)
 
 
 #since the actual sources are located one level upwards
@@ -121,84 +121,84 @@ ENDMACRO (ECOS_USE_I386_ELF_TOOLS)
 #is the name of the new list of source files with adjusted paths,
 #followed by all source files
 #usage: ECOS_ADJUST_DIRECTORY(adjusted_SRCS ${my_srcs})
-MACRO(ECOS_ADJUST_DIRECTORY _target_FILES )
-   FOREACH (_current_FILE ${ARGN})
-      GET_FILENAME_COMPONENT(_abs_FILE ${_current_FILE} ABSOLUTE)
-      IF (NOT ${_abs_FILE} STREQUAL ${_current_FILE})
-         GET_FILENAME_COMPONENT(_abs_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../${_current_FILE} ABSOLUTE)
-      ENDIF (NOT ${_abs_FILE} STREQUAL ${_current_FILE})
-      LIST(APPEND ${_target_FILES} ${_abs_FILE})
-   ENDFOREACH (_current_FILE)
-ENDMACRO(ECOS_ADJUST_DIRECTORY)
+macro(ECOS_ADJUST_DIRECTORY _target_FILES )
+   foreach (_current_FILE ${ARGN})
+      get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE)
+      if (NOT ${_abs_FILE} STREQUAL ${_current_FILE})
+         get_filename_component(_abs_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../${_current_FILE} ABSOLUTE)
+      endif (NOT ${_abs_FILE} STREQUAL ${_current_FILE})
+      list(APPEND ${_target_FILES} ${_abs_FILE})
+   endforeach (_current_FILE)
+endmacro(ECOS_ADJUST_DIRECTORY)
 
 # the default ecos config file name
 # maybe in the future also out-of-source builds may be possible
-SET(ECOS_CONFIG_FILE ecos.ecc)
+set(ECOS_CONFIG_FILE ecos.ecc)
 
 #creates the dependancy from all source files on the ecos target.ld,
 #adds the command for compiling ecos
-MACRO(ECOS_ADD_TARGET_LIB)
+macro(ECOS_ADD_TARGET_LIB)
 # when building out-of-source, create the ecos/ subdir
-    IF(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/ecos)
-        FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ecos)
-    ENDIF(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/ecos)
+    if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/ecos)
+        file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ecos)
+    endif(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/ecos)
 
 #sources depend on target.ld
-   SET_SOURCE_FILES_PROPERTIES(
+   set_source_files_properties(
       ${ARGN}
       PROPERTIES
       OBJECT_DEPENDS
       ${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib/target.ld
    )
 
-   ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib/target.ld
+   add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib/target.ld
       COMMAND sh -c \"make -C ${CMAKE_CURRENT_BINARY_DIR}/ecos || exit -1\; if [ -e ${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib/target.ld ] \; then touch ${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib/target.ld\; fi\"
       DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ecos/makefile
    )
 
-   ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ecos/makefile
+   add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ecos/makefile
       COMMAND sh -c \" cd ${CMAKE_CURRENT_BINARY_DIR}/ecos\; ${ECOSCONFIG_EXECUTABLE} --config=${CMAKE_CURRENT_SOURCE_DIR}/ecos/${ECOS_CONFIG_FILE} tree || exit -1\;\"
       DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ecos/${ECOS_CONFIG_FILE}
    )
 
-   ADD_CUSTOM_TARGET( ecos make -C ${CMAKE_CURRENT_BINARY_DIR}/ecos/ DEPENDS  ${CMAKE_CURRENT_BINARY_DIR}/ecos/makefile )
-ENDMACRO(ECOS_ADD_TARGET_LIB)
+   add_custom_target( ecos make -C ${CMAKE_CURRENT_BINARY_DIR}/ecos/ DEPENDS  ${CMAKE_CURRENT_BINARY_DIR}/ecos/makefile )
+endmacro(ECOS_ADD_TARGET_LIB)
 
 # get the directory of the current file, used later on in the file
-GET_FILENAME_COMPONENT( ECOS_CMAKE_MODULE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
+get_filename_component( ECOS_CMAKE_MODULE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
 
 #macro for creating an executable ecos application
 #the first parameter is the name of the executable,
 #the second is the list of all source files (where the path
 #has been adjusted beforehand by calling ECOS_ADJUST_DIRECTORY()
 #usage: ECOS_ADD_EXECUTABLE(my_app ${adjusted_SRCS})
-MACRO(ECOS_ADD_EXECUTABLE _exe_NAME )
+macro(ECOS_ADD_EXECUTABLE _exe_NAME )
    #definitions, valid for all ecos projects
    #the optimization and "-g" for debugging has to be enabled
    #in the project-specific CMakeLists.txt
-   ADD_DEFINITIONS(-D__ECOS__=1 -D__ECOS=1)
-   SET(ECOS_DEFINITIONS -Wall -Wno-long-long -pipe -fno-builtin)
+   add_definitions(-D__ECOS__=1 -D__ECOS=1)
+   set(ECOS_DEFINITIONS -Wall -Wno-long-long -pipe -fno-builtin)
 
 #the executable depends on ecos target.ld
    ECOS_ADD_TARGET_LIB(${ARGN})
 
 # when using nmake makefiles, the custom buildtype supresses the default cl.exe flags
 # and the rules for creating objects are adjusted for gcc
-   SET(CMAKE_BUILD_TYPE CUSTOM_ECOS_BUILD)
-   SET(CMAKE_C_COMPILE_OBJECT     "<CMAKE_C_COMPILER>   <FLAGS> -o <OBJECT> -c <SOURCE>")
-   SET(CMAKE_CXX_COMPILE_OBJECT   "<CMAKE_CXX_COMPILER> <FLAGS> -o <OBJECT> -c <SOURCE>")
+   set(CMAKE_BUILD_TYPE CUSTOM_ECOS_BUILD)
+   set(CMAKE_C_COMPILE_OBJECT     "<CMAKE_C_COMPILER>   <FLAGS> -o <OBJECT> -c <SOURCE>")
+   set(CMAKE_CXX_COMPILE_OBJECT   "<CMAKE_CXX_COMPILER> <FLAGS> -o <OBJECT> -c <SOURCE>")
 # special link commands for ecos-executables
-   SET(CMAKE_CXX_LINK_EXECUTABLE  "<CMAKE_CXX_COMPILER> <CMAKE_CXX_LINK_FLAGS> <OBJECTS>  -o <TARGET> ${_ecos_EXTRA_LIBS} -nostdlib  -nostartfiles -L${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib -Ttarget.ld ${ECOS_LD_MCPU}")
-   SET(CMAKE_C_LINK_EXECUTABLE    "<CMAKE_C_COMPILER>   <CMAKE_C_LINK_FLAGS>   <OBJECTS>  -o <TARGET> ${_ecos_EXTRA_LIBS} -nostdlib  -nostartfiles -L${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib -Ttarget.ld ${ECOS_LD_MCPU}")
+   set(CMAKE_CXX_LINK_EXECUTABLE  "<CMAKE_CXX_COMPILER> <CMAKE_CXX_LINK_FLAGS> <OBJECTS>  -o <TARGET> ${_ecos_EXTRA_LIBS} -nostdlib  -nostartfiles -L${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib -Ttarget.ld ${ECOS_LD_MCPU}")
+   set(CMAKE_C_LINK_EXECUTABLE    "<CMAKE_C_COMPILER>   <CMAKE_C_LINK_FLAGS>   <OBJECTS>  -o <TARGET> ${_ecos_EXTRA_LIBS} -nostdlib  -nostartfiles -L${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib -Ttarget.ld ${ECOS_LD_MCPU}")
 # some strict compiler flags
-   SET (CMAKE_C_FLAGS "-Wstrict-prototypes")
-   SET (CMAKE_CXX_FLAGS "-Woverloaded-virtual -fno-rtti -Wctor-dtor-privacy -fno-strict-aliasing -fno-exceptions")
+   set (CMAKE_C_FLAGS "-Wstrict-prototypes")
+   set (CMAKE_CXX_FLAGS "-Woverloaded-virtual -fno-rtti -Wctor-dtor-privacy -fno-strict-aliasing -fno-exceptions")
 
-   ADD_EXECUTABLE(${_exe_NAME} ${ARGN})
-   SET_TARGET_PROPERTIES(${_exe_NAME} PROPERTIES SUFFIX ".elf")
+   add_executable(${_exe_NAME} ${ARGN})
+   set_target_properties(${_exe_NAME} PROPERTIES SUFFIX ".elf")
 
 #create a binary file
-   ADD_CUSTOM_COMMAND(
+   add_custom_command(
       TARGET ${_exe_NAME}
       POST_BUILD
       COMMAND ${ECOS_ARCH_PREFIX}objcopy
@@ -206,7 +206,7 @@ MACRO(ECOS_ADD_EXECUTABLE _exe_NAME )
    )
 
 #and an srec file
-   ADD_CUSTOM_COMMAND(
+   add_custom_command(
       TARGET ${_exe_NAME}
       POST_BUILD
       COMMAND ${ECOS_ARCH_PREFIX}objcopy
@@ -214,17 +214,17 @@ MACRO(ECOS_ADD_EXECUTABLE _exe_NAME )
    )
 
 #add the created files to the clean-files
-   SET_DIRECTORY_PROPERTIES(
+   set_directory_properties(
       PROPERTIES
        ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.bin;${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.srec;${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst;"
    )
 
-   ADD_CUSTOM_TARGET(ecosclean ${CMAKE_COMMAND} -DECOS_DIR=${CMAKE_CURRENT_BINARY_DIR}/ecos/ -P ${ECOS_CMAKE_MODULE_DIR}/ecos_clean.cmake  )
-   ADD_CUSTOM_TARGET(normalclean ${CMAKE_MAKE_PROGRAM} clean WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
-   ADD_DEPENDENCIES (ecosclean normalclean)
+   add_custom_target(ecosclean ${CMAKE_COMMAND} -DECOS_DIR=${CMAKE_CURRENT_BINARY_DIR}/ecos/ -P ${ECOS_CMAKE_MODULE_DIR}/ecos_clean.cmake  )
+   add_custom_target(normalclean ${CMAKE_MAKE_PROGRAM} clean WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+   add_dependencies (ecosclean normalclean)
 
 
-   ADD_CUSTOM_TARGET( listing
+   add_custom_target( listing
       COMMAND echo -e   \"\\n--- Symbols sorted by address ---\\n\" > ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst
       COMMAND ${ECOS_ARCH_PREFIX}nm -S -C -n ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.elf >> ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst
       COMMAND echo -e \"\\n--- Symbols sorted by size ---\\n\" >> ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst
@@ -232,5 +232,5 @@ MACRO(ECOS_ADD_EXECUTABLE _exe_NAME )
       COMMAND echo -e \"\\n--- Full assembly listing ---\\n\" >> ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst
       COMMAND ${ECOS_ARCH_PREFIX}objdump -S -x -d -C ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.elf >> ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst )
 
-ENDMACRO(ECOS_ADD_EXECUTABLE)
+endmacro(ECOS_ADD_EXECUTABLE)
 
diff --git a/Modules/UsePkgConfig.cmake b/Modules/UsePkgConfig.cmake
index 7f4318f05..b4517f75f 100644
--- a/Modules/UsePkgConfig.cmake
+++ b/Modules/UsePkgConfig.cmake
@@ -24,55 +24,55 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PROGRAM(PKGCONFIG_EXECUTABLE NAMES pkg-config )
+find_program(PKGCONFIG_EXECUTABLE NAMES pkg-config )
 
-MACRO(PKGCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags)
-  MESSAGE(STATUS
+macro(PKGCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags)
+  message(STATUS
     "WARNING: you are using the obsolete 'PKGCONFIG' macro, use FindPkgConfig")
 # reset the variables at the beginning
-  SET(${_include_DIR})
-  SET(${_link_DIR})
-  SET(${_link_FLAGS})
-  SET(${_cflags})
+  set(${_include_DIR})
+  set(${_link_DIR})
+  set(${_link_FLAGS})
+  set(${_cflags})
 
   # if pkg-config has been found
-  IF(PKGCONFIG_EXECUTABLE)
+  if(PKGCONFIG_EXECUTABLE)
 
-    EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --exists RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
+    exec_program(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --exists RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
 
     # and if the package of interest also exists for pkg-config, then get the information
-    IF(NOT _return_VALUE)
+    if(NOT _return_VALUE)
 
-      EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --variable=includedir
+      exec_program(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --variable=includedir
         OUTPUT_VARIABLE ${_include_DIR} )
-      STRING(REGEX REPLACE "[\r\n]" " " ${_include_DIR} "${${_include_DIR}}")
+      string(REGEX REPLACE "[\r\n]" " " ${_include_DIR} "${${_include_DIR}}")
 
 
-      EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --variable=libdir
+      exec_program(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --variable=libdir
         OUTPUT_VARIABLE ${_link_DIR} )
-      STRING(REGEX REPLACE "[\r\n]" " " ${_link_DIR} "${${_link_DIR}}")
+      string(REGEX REPLACE "[\r\n]" " " ${_link_DIR} "${${_link_DIR}}")
 
-      EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --libs
+      exec_program(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --libs
         OUTPUT_VARIABLE ${_link_FLAGS} )
-      STRING(REGEX REPLACE "[\r\n]" " " ${_link_FLAGS} "${${_link_FLAGS}}")
+      string(REGEX REPLACE "[\r\n]" " " ${_link_FLAGS} "${${_link_FLAGS}}")
 
-      EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --cflags
+      exec_program(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --cflags
         OUTPUT_VARIABLE ${_cflags} )
-      STRING(REGEX REPLACE "[\r\n]" " " ${_cflags} "${${_cflags}}")
+      string(REGEX REPLACE "[\r\n]" " " ${_cflags} "${${_cflags}}")
 
-    ELSE( NOT _return_VALUE)
+    else( NOT _return_VALUE)
 
-      MESSAGE(STATUS "PKGCONFIG() indicates that ${_package} is not installed (install the package which contains ${_package}.pc if you want to support this feature)")
+      message(STATUS "PKGCONFIG() indicates that ${_package} is not installed (install the package which contains ${_package}.pc if you want to support this feature)")
 
-    ENDIF(NOT _return_VALUE)
+    endif(NOT _return_VALUE)
 
   # if pkg-config has NOT been found, INFORM the user
-  ELSE(PKGCONFIG_EXECUTABLE)
+  else(PKGCONFIG_EXECUTABLE)
 
-    MESSAGE(STATUS "WARNING: PKGCONFIG() indicates that the tool pkg-config has not been found on your system. You should install it.")
+    message(STATUS "WARNING: PKGCONFIG() indicates that the tool pkg-config has not been found on your system. You should install it.")
 
-  ENDIF(PKGCONFIG_EXECUTABLE)
+  endif(PKGCONFIG_EXECUTABLE)
 
-ENDMACRO(PKGCONFIG _include_DIR _link_DIR _link_FLAGS _cflags)
+endmacro(PKGCONFIG _include_DIR _link_DIR _link_FLAGS _cflags)
 
-MARK_AS_ADVANCED(PKGCONFIG_EXECUTABLE)
+mark_as_advanced(PKGCONFIG_EXECUTABLE)
diff --git a/Modules/UseQt4.cmake b/Modules/UseQt4.cmake
index d4852a083..260c3cd29 100644
--- a/Modules/UseQt4.cmake
+++ b/Modules/UseQt4.cmake
@@ -16,93 +16,93 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-ADD_DEFINITIONS(${QT_DEFINITIONS})
-SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG QT_DEBUG)
-SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE QT_NO_DEBUG)
-SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO QT_NO_DEBUG)
-SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL QT_NO_DEBUG)
-IF(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
-  SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS QT_NO_DEBUG)
-ENDIF()
+add_definitions(${QT_DEFINITIONS})
+set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG QT_DEBUG)
+set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE QT_NO_DEBUG)
+set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO QT_NO_DEBUG)
+set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL QT_NO_DEBUG)
+if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
+  set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS QT_NO_DEBUG)
+endif()
 
-INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR})
+include_directories(${QT_INCLUDE_DIR})
 
-SET(QT_LIBRARIES "")
-SET(QT_LIBRARIES_PLUGINS "")
+set(QT_LIBRARIES "")
+set(QT_LIBRARIES_PLUGINS "")
 
-IF (QT_USE_QTMAIN)
-  IF (Q_WS_WIN)
-    SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY})
-  ENDIF (Q_WS_WIN)
-ENDIF (QT_USE_QTMAIN)
+if (QT_USE_QTMAIN)
+  if (Q_WS_WIN)
+    set(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY})
+  endif (Q_WS_WIN)
+endif (QT_USE_QTMAIN)
 
-IF(QT_DONT_USE_QTGUI)
-  SET(QT_USE_QTGUI 0)
-ELSE(QT_DONT_USE_QTGUI)
-  SET(QT_USE_QTGUI 1)
-ENDIF(QT_DONT_USE_QTGUI)
+if(QT_DONT_USE_QTGUI)
+  set(QT_USE_QTGUI 0)
+else(QT_DONT_USE_QTGUI)
+  set(QT_USE_QTGUI 1)
+endif(QT_DONT_USE_QTGUI)
 
-IF(QT_DONT_USE_QTCORE)
-  SET(QT_USE_QTCORE 0)
-ELSE(QT_DONT_USE_QTCORE)
-  SET(QT_USE_QTCORE 1)
-ENDIF(QT_DONT_USE_QTCORE)
+if(QT_DONT_USE_QTCORE)
+  set(QT_USE_QTCORE 0)
+else(QT_DONT_USE_QTCORE)
+  set(QT_USE_QTCORE 1)
+endif(QT_DONT_USE_QTCORE)
 
-IF (QT_USE_QT3SUPPORT)
-  ADD_DEFINITIONS(-DQT3_SUPPORT)
-ENDIF (QT_USE_QT3SUPPORT)
+if (QT_USE_QT3SUPPORT)
+  add_definitions(-DQT3_SUPPORT)
+endif (QT_USE_QT3SUPPORT)
 
 # list dependent modules, so dependent libraries are added
-SET(QT_QT3SUPPORT_MODULE_DEPENDS QTGUI QTSQL QTXML QTNETWORK QTCORE)
-SET(QT_QTSVG_MODULE_DEPENDS QTGUI QTXML QTCORE)
-SET(QT_QTUITOOLS_MODULE_DEPENDS QTGUI QTXML QTCORE)
-SET(QT_QTHELP_MODULE_DEPENDS QTGUI QTSQL QTXML QTNETWORK QTCORE)
-IF(QT_QTDBUS_FOUND)
-  SET(QT_PHONON_MODULE_DEPENDS QTGUI QTDBUS QTCORE)
-ELSE(QT_QTDBUS_FOUND)
-  SET(QT_PHONON_MODULE_DEPENDS QTGUI QTCORE)
-ENDIF(QT_QTDBUS_FOUND)
-SET(QT_QTDBUS_MODULE_DEPENDS QTXML QTCORE)
-SET(QT_QTXMLPATTERNS_MODULE_DEPENDS QTNETWORK QTCORE)
-SET(QT_QAXCONTAINER_MODULE_DEPENDS QTGUI QTCORE)
-SET(QT_QAXSERVER_MODULE_DEPENDS QTGUI QTCORE)
-SET(QT_QTSCRIPTTOOLS_MODULE_DEPENDS QTGUI QTCORE)
-SET(QT_QTWEBKIT_MODULE_DEPENDS QTXMLPATTERNS QTGUI QTCORE)
-SET(QT_QTDECLARATIVE_MODULE_DEPENDS QTSCRIPT QTSVG QTSQL QTXMLPATTERNS QTGUI QTCORE)
-SET(QT_QTMULTIMEDIA_MODULE_DEPENDS QTGUI QTCORE)
-SET(QT_QTOPENGL_MODULE_DEPENDS QTGUI QTCORE)
-SET(QT_QTSCRIPT_MODULE_DEPENDS QTCORE)
-SET(QT_QTGUI_MODULE_DEPENDS QTCORE)
-SET(QT_QTTEST_MODULE_DEPENDS QTCORE)
-SET(QT_QTXML_MODULE_DEPENDS QTCORE)
-SET(QT_QTSQL_MODULE_DEPENDS QTCORE)
-SET(QT_QTNETWORK_MODULE_DEPENDS QTCORE)
+set(QT_QT3SUPPORT_MODULE_DEPENDS QTGUI QTSQL QTXML QTNETWORK QTCORE)
+set(QT_QTSVG_MODULE_DEPENDS QTGUI QTXML QTCORE)
+set(QT_QTUITOOLS_MODULE_DEPENDS QTGUI QTXML QTCORE)
+set(QT_QTHELP_MODULE_DEPENDS QTGUI QTSQL QTXML QTNETWORK QTCORE)
+if(QT_QTDBUS_FOUND)
+  set(QT_PHONON_MODULE_DEPENDS QTGUI QTDBUS QTCORE)
+else(QT_QTDBUS_FOUND)
+  set(QT_PHONON_MODULE_DEPENDS QTGUI QTCORE)
+endif(QT_QTDBUS_FOUND)
+set(QT_QTDBUS_MODULE_DEPENDS QTXML QTCORE)
+set(QT_QTXMLPATTERNS_MODULE_DEPENDS QTNETWORK QTCORE)
+set(QT_QAXCONTAINER_MODULE_DEPENDS QTGUI QTCORE)
+set(QT_QAXSERVER_MODULE_DEPENDS QTGUI QTCORE)
+set(QT_QTSCRIPTTOOLS_MODULE_DEPENDS QTGUI QTCORE)
+set(QT_QTWEBKIT_MODULE_DEPENDS QTXMLPATTERNS QTGUI QTCORE)
+set(QT_QTDECLARATIVE_MODULE_DEPENDS QTSCRIPT QTSVG QTSQL QTXMLPATTERNS QTGUI QTCORE)
+set(QT_QTMULTIMEDIA_MODULE_DEPENDS QTGUI QTCORE)
+set(QT_QTOPENGL_MODULE_DEPENDS QTGUI QTCORE)
+set(QT_QTSCRIPT_MODULE_DEPENDS QTCORE)
+set(QT_QTGUI_MODULE_DEPENDS QTCORE)
+set(QT_QTTEST_MODULE_DEPENDS QTCORE)
+set(QT_QTXML_MODULE_DEPENDS QTCORE)
+set(QT_QTSQL_MODULE_DEPENDS QTCORE)
+set(QT_QTNETWORK_MODULE_DEPENDS QTCORE)
 
 # Qt modules  (in order of dependence)
-FOREACH(module QT3SUPPORT QTOPENGL QTASSISTANT QTDESIGNER QTMOTIF QTNSPLUGIN
+foreach(module QT3SUPPORT QTOPENGL QTASSISTANT QTDESIGNER QTMOTIF QTNSPLUGIN
                QAXSERVER QAXCONTAINER QTDECLARATIVE QTSCRIPT QTSVG QTUITOOLS QTHELP
                QTWEBKIT PHONON QTSCRIPTTOOLS QTMULTIMEDIA QTXMLPATTERNS QTGUI QTTEST
                QTDBUS QTXML QTSQL QTNETWORK QTCORE)
 
-  IF (QT_USE_${module} OR QT_USE_${module}_DEPENDS)
-    IF (QT_${module}_FOUND)
-      IF(QT_USE_${module})
-        STRING(REPLACE "QT" "" qt_module_def "${module}")
-        ADD_DEFINITIONS(-DQT_${qt_module_def}_LIB)
-        INCLUDE_DIRECTORIES(${QT_${module}_INCLUDE_DIR})
-      ENDIF(QT_USE_${module})
-      SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIBRARY})
-      SET(QT_LIBRARIES_PLUGINS ${QT_LIBRARIES_PLUGINS} ${QT_${module}_PLUGINS})
-      IF(QT_IS_STATIC)
-        SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIB_DEPENDENCIES})
-      ENDIF(QT_IS_STATIC)
-      FOREACH(depend_module ${QT_${module}_MODULE_DEPENDS})
-        SET(QT_USE_${depend_module}_DEPENDS 1)
-      ENDFOREACH(depend_module ${QT_${module}_MODULE_DEPENDS})
-    ELSE (QT_${module}_FOUND)
-      MESSAGE("Qt ${module} library not found.")
-    ENDIF (QT_${module}_FOUND)
-  ENDIF (QT_USE_${module} OR QT_USE_${module}_DEPENDS)
+  if (QT_USE_${module} OR QT_USE_${module}_DEPENDS)
+    if (QT_${module}_FOUND)
+      if(QT_USE_${module})
+        string(REPLACE "QT" "" qt_module_def "${module}")
+        add_definitions(-DQT_${qt_module_def}_LIB)
+        include_directories(${QT_${module}_INCLUDE_DIR})
+      endif(QT_USE_${module})
+      set(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIBRARY})
+      set(QT_LIBRARIES_PLUGINS ${QT_LIBRARIES_PLUGINS} ${QT_${module}_PLUGINS})
+      if(QT_IS_STATIC)
+        set(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIB_DEPENDENCIES})
+      endif(QT_IS_STATIC)
+      foreach(depend_module ${QT_${module}_MODULE_DEPENDS})
+        set(QT_USE_${depend_module}_DEPENDS 1)
+      endforeach(depend_module ${QT_${module}_MODULE_DEPENDS})
+    else (QT_${module}_FOUND)
+      message("Qt ${module} library not found.")
+    endif (QT_${module}_FOUND)
+  endif (QT_USE_${module} OR QT_USE_${module}_DEPENDS)
 
-ENDFOREACH(module)
+endforeach(module)
 
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index a7085ee31..e4e72c2aa 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -15,7 +15,7 @@
 # The name-specific variable SWIG_MODULE_<name>_EXTRA_DEPS may be used
 # to specify extra dependencies for the generated modules.
 # If the source file generated by swig need some special flag you can use
-# SET_SOURCE_FILES_PROPERTIES( ${swig_generated_file_fullname}
+# set_source_files_properties( ${swig_generated_file_fullname}
 #        PROPERTIES COMPILE_FLAGS "-bla")
 
 
@@ -33,136 +33,136 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-SET(SWIG_CXX_EXTENSION "cxx")
-SET(SWIG_EXTRA_LIBRARIES "")
+set(SWIG_CXX_EXTENSION "cxx")
+set(SWIG_EXTRA_LIBRARIES "")
 
-SET(SWIG_PYTHON_EXTRA_FILE_EXTENSION "py")
+set(SWIG_PYTHON_EXTRA_FILE_EXTENSION "py")
 
 #
 # For given swig module initialize variables associated with it
 #
-MACRO(SWIG_MODULE_INITIALIZE name language)
-  STRING(TOUPPER "${language}" swig_uppercase_language)
-  STRING(TOLOWER "${language}" swig_lowercase_language)
-  SET(SWIG_MODULE_${name}_LANGUAGE "${swig_uppercase_language}")
-  SET(SWIG_MODULE_${name}_SWIG_LANGUAGE_FLAG "${swig_lowercase_language}")
+macro(SWIG_MODULE_INITIALIZE name language)
+  string(TOUPPER "${language}" swig_uppercase_language)
+  string(TOLOWER "${language}" swig_lowercase_language)
+  set(SWIG_MODULE_${name}_LANGUAGE "${swig_uppercase_language}")
+  set(SWIG_MODULE_${name}_SWIG_LANGUAGE_FLAG "${swig_lowercase_language}")
 
-  SET(SWIG_MODULE_${name}_REAL_NAME "${name}")
-  IF("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "UNKNOWN")
-    MESSAGE(FATAL_ERROR "SWIG Error: Language \"${language}\" not found")
-  ELSEIF("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "PYTHON")
+  set(SWIG_MODULE_${name}_REAL_NAME "${name}")
+  if("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "UNKNOWN")
+    message(FATAL_ERROR "SWIG Error: Language \"${language}\" not found")
+  elseif("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "PYTHON")
     # when swig is used without the -interface it will produce in the module.py
     # a 'import _modulename' statement, which implies having a corresponding
     # _modulename.so (*NIX), _modulename.pyd (Win32).
-    SET(SWIG_MODULE_${name}_REAL_NAME "_${name}")
-  ELSEIF("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "PERL")
-    SET(SWIG_MODULE_${name}_EXTRA_FLAGS "-shadow")
-  ENDIF()
-ENDMACRO(SWIG_MODULE_INITIALIZE)
+    set(SWIG_MODULE_${name}_REAL_NAME "_${name}")
+  elseif("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "PERL")
+    set(SWIG_MODULE_${name}_EXTRA_FLAGS "-shadow")
+  endif()
+endmacro(SWIG_MODULE_INITIALIZE)
 
 #
 # For a given language, input file, and output file, determine extra files that
 # will be generated. This is internal swig macro.
 #
 
-MACRO(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile)
-  SET(${outfiles} "")
-  GET_SOURCE_FILE_PROPERTY(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename
+macro(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile)
+  set(${outfiles} "")
+  get_source_file_property(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename
     ${infile} SWIG_MODULE_NAME)
-  IF(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename STREQUAL "NOTFOUND")
-    GET_FILENAME_COMPONENT(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename "${infile}" NAME_WE)
-  ENDIF(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename STREQUAL "NOTFOUND")
-  FOREACH(it ${SWIG_${language}_EXTRA_FILE_EXTENSION})
-    SET(${outfiles} ${${outfiles}}
+  if(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename STREQUAL "NOTFOUND")
+    get_filename_component(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename "${infile}" NAME_WE)
+  endif(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename STREQUAL "NOTFOUND")
+  foreach(it ${SWIG_${language}_EXTRA_FILE_EXTENSION})
+    set(${outfiles} ${${outfiles}}
       "${generatedpath}/${SWIG_GET_EXTRA_OUTPUT_FILES_module_basename}.${it}")
-  ENDFOREACH(it)
-ENDMACRO(SWIG_GET_EXTRA_OUTPUT_FILES)
+  endforeach(it)
+endmacro(SWIG_GET_EXTRA_OUTPUT_FILES)
 
 #
 # Take swig (*.i) file and add proper custom commands for it
 #
-MACRO(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
-  SET(swig_full_infile ${infile})
-  GET_FILENAME_COMPONENT(swig_source_file_path "${infile}" PATH)
-  GET_FILENAME_COMPONENT(swig_source_file_name_we "${infile}" NAME_WE)
-  GET_SOURCE_FILE_PROPERTY(swig_source_file_generated ${infile} GENERATED)
-  GET_SOURCE_FILE_PROPERTY(swig_source_file_cplusplus ${infile} CPLUSPLUS)
-  GET_SOURCE_FILE_PROPERTY(swig_source_file_flags ${infile} SWIG_FLAGS)
-  IF("${swig_source_file_flags}" STREQUAL "NOTFOUND")
-    SET(swig_source_file_flags "")
-  ENDIF("${swig_source_file_flags}" STREQUAL "NOTFOUND")
-  SET(swig_source_file_fullname "${infile}")
-  IF(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}")
-    STRING(REGEX REPLACE
+macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
+  set(swig_full_infile ${infile})
+  get_filename_component(swig_source_file_path "${infile}" PATH)
+  get_filename_component(swig_source_file_name_we "${infile}" NAME_WE)
+  get_source_file_property(swig_source_file_generated ${infile} GENERATED)
+  get_source_file_property(swig_source_file_cplusplus ${infile} CPLUSPLUS)
+  get_source_file_property(swig_source_file_flags ${infile} SWIG_FLAGS)
+  if("${swig_source_file_flags}" STREQUAL "NOTFOUND")
+    set(swig_source_file_flags "")
+  endif("${swig_source_file_flags}" STREQUAL "NOTFOUND")
+  set(swig_source_file_fullname "${infile}")
+  if(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}")
+    string(REGEX REPLACE
       "^${CMAKE_CURRENT_SOURCE_DIR}" ""
       swig_source_file_relative_path
       "${swig_source_file_path}")
-  ELSE(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}")
-    IF(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_BINARY_DIR}")
-      STRING(REGEX REPLACE
+  else(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}")
+    if(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_BINARY_DIR}")
+      string(REGEX REPLACE
         "^${CMAKE_CURRENT_BINARY_DIR}" ""
         swig_source_file_relative_path
         "${swig_source_file_path}")
-      SET(swig_source_file_generated 1)
-    ELSE(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_BINARY_DIR}")
-      SET(swig_source_file_relative_path "${swig_source_file_path}")
-      IF(swig_source_file_generated)
-        SET(swig_source_file_fullname "${CMAKE_CURRENT_BINARY_DIR}/${infile}")
-      ELSE(swig_source_file_generated)
-        SET(swig_source_file_fullname "${CMAKE_CURRENT_SOURCE_DIR}/${infile}")
-      ENDIF(swig_source_file_generated)
-    ENDIF(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_BINARY_DIR}")
-  ENDIF(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}")
+      set(swig_source_file_generated 1)
+    else(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_BINARY_DIR}")
+      set(swig_source_file_relative_path "${swig_source_file_path}")
+      if(swig_source_file_generated)
+        set(swig_source_file_fullname "${CMAKE_CURRENT_BINARY_DIR}/${infile}")
+      else(swig_source_file_generated)
+        set(swig_source_file_fullname "${CMAKE_CURRENT_SOURCE_DIR}/${infile}")
+      endif(swig_source_file_generated)
+    endif(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_BINARY_DIR}")
+  endif(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}")
 
-  SET(swig_generated_file_fullname
+  set(swig_generated_file_fullname
     "${CMAKE_CURRENT_BINARY_DIR}")
-  IF(swig_source_file_relative_path)
-    SET(swig_generated_file_fullname
+  if(swig_source_file_relative_path)
+    set(swig_generated_file_fullname
       "${swig_generated_file_fullname}/${swig_source_file_relative_path}")
-  ENDIF(swig_source_file_relative_path)
+  endif(swig_source_file_relative_path)
   # If CMAKE_SWIG_OUTDIR was specified then pass it to -outdir
-  IF(CMAKE_SWIG_OUTDIR)
-    SET(swig_outdir ${CMAKE_SWIG_OUTDIR})
-  ELSE(CMAKE_SWIG_OUTDIR)
-    SET(swig_outdir ${CMAKE_CURRENT_BINARY_DIR})
-  ENDIF(CMAKE_SWIG_OUTDIR)
+  if(CMAKE_SWIG_OUTDIR)
+    set(swig_outdir ${CMAKE_SWIG_OUTDIR})
+  else(CMAKE_SWIG_OUTDIR)
+    set(swig_outdir ${CMAKE_CURRENT_BINARY_DIR})
+  endif(CMAKE_SWIG_OUTDIR)
   SWIG_GET_EXTRA_OUTPUT_FILES(${SWIG_MODULE_${name}_LANGUAGE}
     swig_extra_generated_files
     "${swig_outdir}"
     "${infile}")
-  SET(swig_generated_file_fullname
+  set(swig_generated_file_fullname
     "${swig_generated_file_fullname}/${swig_source_file_name_we}")
   # add the language into the name of the file (i.e. TCL_wrap)
   # this allows for the same .i file to be wrapped into different languages
-  SET(swig_generated_file_fullname
+  set(swig_generated_file_fullname
     "${swig_generated_file_fullname}${SWIG_MODULE_${name}_LANGUAGE}_wrap")
 
-  IF(swig_source_file_cplusplus)
-    SET(swig_generated_file_fullname
+  if(swig_source_file_cplusplus)
+    set(swig_generated_file_fullname
       "${swig_generated_file_fullname}.${SWIG_CXX_EXTENSION}")
-  ELSE(swig_source_file_cplusplus)
-    SET(swig_generated_file_fullname
+  else(swig_source_file_cplusplus)
+    set(swig_generated_file_fullname
       "${swig_generated_file_fullname}.c")
-  ENDIF(swig_source_file_cplusplus)
+  endif(swig_source_file_cplusplus)
 
-  #MESSAGE("Full path to source file: ${swig_source_file_fullname}")
-  #MESSAGE("Full path to the output file: ${swig_generated_file_fullname}")
-  GET_DIRECTORY_PROPERTY(cmake_include_directories INCLUDE_DIRECTORIES)
-  SET(swig_include_dirs)
-  FOREACH(it ${cmake_include_directories})
-    SET(swig_include_dirs ${swig_include_dirs} "-I${it}")
-  ENDFOREACH(it)
+  #message("Full path to source file: ${swig_source_file_fullname}")
+  #message("Full path to the output file: ${swig_generated_file_fullname}")
+  get_directory_property(cmake_include_directories INCLUDE_DIRECTORIES)
+  set(swig_include_dirs)
+  foreach(it ${cmake_include_directories})
+    set(swig_include_dirs ${swig_include_dirs} "-I${it}")
+  endforeach(it)
 
-  SET(swig_special_flags)
+  set(swig_special_flags)
   # default is c, so add c++ flag if it is c++
-  IF(swig_source_file_cplusplus)
-    SET(swig_special_flags ${swig_special_flags} "-c++")
-  ENDIF(swig_source_file_cplusplus)
-  SET(swig_extra_flags)
-  IF(SWIG_MODULE_${name}_EXTRA_FLAGS)
-    SET(swig_extra_flags ${swig_extra_flags} ${SWIG_MODULE_${name}_EXTRA_FLAGS})
-  ENDIF(SWIG_MODULE_${name}_EXTRA_FLAGS)
-  ADD_CUSTOM_COMMAND(
+  if(swig_source_file_cplusplus)
+    set(swig_special_flags ${swig_special_flags} "-c++")
+  endif(swig_source_file_cplusplus)
+  set(swig_extra_flags)
+  if(SWIG_MODULE_${name}_EXTRA_FLAGS)
+    set(swig_extra_flags ${swig_extra_flags} ${SWIG_MODULE_${name}_EXTRA_FLAGS})
+  endif(SWIG_MODULE_${name}_EXTRA_FLAGS)
+  add_custom_command(
     OUTPUT "${swig_generated_file_fullname}" ${swig_extra_generated_files}
     # Let's create the ${swig_outdir} at execution time, in case dir contains $(OutDir)
     COMMAND ${CMAKE_COMMAND} -E make_directory ${swig_outdir}
@@ -179,53 +179,53 @@ MACRO(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
     MAIN_DEPENDENCY "${swig_source_file_fullname}"
     DEPENDS ${SWIG_MODULE_${name}_EXTRA_DEPS}
     COMMENT "Swig source")
-  SET_SOURCE_FILES_PROPERTIES("${swig_generated_file_fullname}" ${swig_extra_generated_files}
+  set_source_files_properties("${swig_generated_file_fullname}" ${swig_extra_generated_files}
     PROPERTIES GENERATED 1)
-  SET(${outfiles} "${swig_generated_file_fullname}" ${swig_extra_generated_files})
-ENDMACRO(SWIG_ADD_SOURCE_TO_MODULE)
+  set(${outfiles} "${swig_generated_file_fullname}" ${swig_extra_generated_files})
+endmacro(SWIG_ADD_SOURCE_TO_MODULE)
 
 #
 # Create Swig module
 #
-MACRO(SWIG_ADD_MODULE name language)
+macro(SWIG_ADD_MODULE name language)
   SWIG_MODULE_INITIALIZE(${name} ${language})
-  SET(swig_dot_i_sources)
-  SET(swig_other_sources)
-  FOREACH(it ${ARGN})
-    IF(${it} MATCHES ".*\\.i$")
-      SET(swig_dot_i_sources ${swig_dot_i_sources} "${it}")
-    ELSE(${it} MATCHES ".*\\.i$")
-      SET(swig_other_sources ${swig_other_sources} "${it}")
-    ENDIF(${it} MATCHES ".*\\.i$")
-  ENDFOREACH(it)
+  set(swig_dot_i_sources)
+  set(swig_other_sources)
+  foreach(it ${ARGN})
+    if(${it} MATCHES ".*\\.i$")
+      set(swig_dot_i_sources ${swig_dot_i_sources} "${it}")
+    else(${it} MATCHES ".*\\.i$")
+      set(swig_other_sources ${swig_other_sources} "${it}")
+    endif(${it} MATCHES ".*\\.i$")
+  endforeach(it)
 
-  SET(swig_generated_sources)
-  FOREACH(it ${swig_dot_i_sources})
+  set(swig_generated_sources)
+  foreach(it ${swig_dot_i_sources})
     SWIG_ADD_SOURCE_TO_MODULE(${name} swig_generated_source ${it})
-    SET(swig_generated_sources ${swig_generated_sources} "${swig_generated_source}")
-  ENDFOREACH(it)
-  GET_DIRECTORY_PROPERTY(swig_extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES)
-  SET_DIRECTORY_PROPERTIES(PROPERTIES
+    set(swig_generated_sources ${swig_generated_sources} "${swig_generated_source}")
+  endforeach(it)
+  get_directory_property(swig_extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES)
+  set_directory_properties(PROPERTIES
     ADDITIONAL_MAKE_CLEAN_FILES "${swig_extra_clean_files};${swig_generated_sources}")
-  ADD_LIBRARY(${SWIG_MODULE_${name}_REAL_NAME}
+  add_library(${SWIG_MODULE_${name}_REAL_NAME}
     MODULE
     ${swig_generated_sources}
     ${swig_other_sources})
-  STRING(TOLOWER "${language}" swig_lowercase_language)
-  IF ("${swig_lowercase_language}" STREQUAL "java")
-    IF (APPLE)
+  string(TOLOWER "${language}" swig_lowercase_language)
+  if ("${swig_lowercase_language}" STREQUAL "java")
+    if (APPLE)
         # In java you want:
         #      System.loadLibrary("LIBRARY");
         # then JNI will look for a library whose name is platform dependent, namely
         #   MacOS  : libLIBRARY.jnilib
         #   Windows: LIBRARY.dll
         #   Linux  : libLIBRARY.so
-        SET_TARGET_PROPERTIES (${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".jnilib")
-      ENDIF (APPLE)
-  ENDIF ("${swig_lowercase_language}" STREQUAL "java")
-  IF ("${swig_lowercase_language}" STREQUAL "python")
+        set_target_properties (${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".jnilib")
+      endif (APPLE)
+  endif ("${swig_lowercase_language}" STREQUAL "java")
+  if ("${swig_lowercase_language}" STREQUAL "python")
     # this is only needed for the python case where a _modulename.so is generated
-    SET_TARGET_PROPERTIES(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES PREFIX "")
+    set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES PREFIX "")
     # Python extension modules on Windows must have the extension ".pyd"
     # instead of ".dll" as of Python 2.5.  Older python versions do support
     # this suffix.
@@ -234,20 +234,20 @@ MACRO(SWIG_ADD_MODULE name language)
     # Windows: .dll is no longer supported as a filename extension for extension modules.
     # .pyd is now the only filename extension that will be searched for.
     # </quote>
-    IF(WIN32 AND NOT CYGWIN)
-      SET_TARGET_PROPERTIES(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".pyd")
-    ENDIF(WIN32 AND NOT CYGWIN)
-  ENDIF ("${swig_lowercase_language}" STREQUAL "python")
-ENDMACRO(SWIG_ADD_MODULE)
+    if(WIN32 AND NOT CYGWIN)
+      set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".pyd")
+    endif(WIN32 AND NOT CYGWIN)
+  endif ("${swig_lowercase_language}" STREQUAL "python")
+endmacro(SWIG_ADD_MODULE)
 
 #
 # Like TARGET_LINK_LIBRARIES but for swig modules
 #
-MACRO(SWIG_LINK_LIBRARIES name)
-  IF(SWIG_MODULE_${name}_REAL_NAME)
-    TARGET_LINK_LIBRARIES(${SWIG_MODULE_${name}_REAL_NAME} ${ARGN})
-  ELSE(SWIG_MODULE_${name}_REAL_NAME)
-    MESSAGE(SEND_ERROR "Cannot find Swig library \"${name}\".")
-  ENDIF(SWIG_MODULE_${name}_REAL_NAME)
-ENDMACRO(SWIG_LINK_LIBRARIES name)
+macro(SWIG_LINK_LIBRARIES name)
+  if(SWIG_MODULE_${name}_REAL_NAME)
+    target_link_libraries(${SWIG_MODULE_${name}_REAL_NAME} ${ARGN})
+  else(SWIG_MODULE_${name}_REAL_NAME)
+    message(SEND_ERROR "Cannot find Swig library \"${name}\".")
+  endif(SWIG_MODULE_${name}_REAL_NAME)
+endmacro(SWIG_LINK_LIBRARIES name)
 
diff --git a/Modules/UseVTK40.cmake b/Modules/UseVTK40.cmake
index c1157d6be..d6bdaaa52 100644
--- a/Modules/UseVTK40.cmake
+++ b/Modules/UseVTK40.cmake
@@ -19,11 +19,11 @@
 # to point here.
 
 # Add compiler flags needed to use VTK.
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${VTK_REQUIRED_C_FLAGS}")
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${VTK_REQUIRED_CXX_FLAGS}")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${VTK_REQUIRED_C_FLAGS}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${VTK_REQUIRED_CXX_FLAGS}")
 
 # Add include directories needed to use VTK.
-INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS})
+include_directories(${VTK_INCLUDE_DIRS})
 
 # Add link directories needed to use VTK.
-LINK_DIRECTORIES(${VTK_LIBRARY_DIRS})
+link_directories(${VTK_LIBRARY_DIRS})
diff --git a/Modules/UseVTKBuildSettings40.cmake b/Modules/UseVTKBuildSettings40.cmake
index 4df59b9dd..474f67c9c 100644
--- a/Modules/UseVTKBuildSettings40.cmake
+++ b/Modules/UseVTKBuildSettings40.cmake
@@ -16,23 +16,23 @@
 # Implementation detail for FindVTK.cmake to let it provide a
 # VTK_BUILD_SETTINGS_FILE for VTK 4.0.
 
-SET(CMAKE_BUILD_SETTING_CMAKE_MAJOR_VERSION "${VTK40_CMAKE_MAJOR_VERSION}")
-SET(CMAKE_BUILD_SETTING_CMAKE_MINOR_VERSION "${VTK40_CMAKE_MINOR_VERSION}")
-SET(CMAKE_BUILD_SETTING_PROJECT_NAME "VTK")
+set(CMAKE_BUILD_SETTING_CMAKE_MAJOR_VERSION "${VTK40_CMAKE_MAJOR_VERSION}")
+set(CMAKE_BUILD_SETTING_CMAKE_MINOR_VERSION "${VTK40_CMAKE_MINOR_VERSION}")
+set(CMAKE_BUILD_SETTING_PROJECT_NAME "VTK")
 
-SET(CMAKE_BUILD_SETTING_C_COMPILER "${VTK40_CMAKE_C_COMPILER}")
-SET(CMAKE_BUILD_SETTING_C_FLAGS "${VTK40_CMAKE_C_FLAGS}")
-SET(CMAKE_BUILD_SETTING_C_FLAGS_DEBUG "${VTK40_CMAKE_C_FLAGS_DEBUG}")
-SET(CMAKE_BUILD_SETTING_C_FLAGS_RELEASE "${VTK40_CMAKE_C_FLAGS_RELEASE}")
-SET(CMAKE_BUILD_SETTING_C_FLAGS_MINSIZEREL "${VTK40_CMAKE_C_FLAGS_MINSIZEREL}")
-SET(CMAKE_BUILD_SETTING_C_FLAGS_RELWITHDEBINFO "${VTK40_CMAKE_C_FLAGS_RELWITHDEBINFO}")
+set(CMAKE_BUILD_SETTING_C_COMPILER "${VTK40_CMAKE_C_COMPILER}")
+set(CMAKE_BUILD_SETTING_C_FLAGS "${VTK40_CMAKE_C_FLAGS}")
+set(CMAKE_BUILD_SETTING_C_FLAGS_DEBUG "${VTK40_CMAKE_C_FLAGS_DEBUG}")
+set(CMAKE_BUILD_SETTING_C_FLAGS_RELEASE "${VTK40_CMAKE_C_FLAGS_RELEASE}")
+set(CMAKE_BUILD_SETTING_C_FLAGS_MINSIZEREL "${VTK40_CMAKE_C_FLAGS_MINSIZEREL}")
+set(CMAKE_BUILD_SETTING_C_FLAGS_RELWITHDEBINFO "${VTK40_CMAKE_C_FLAGS_RELWITHDEBINFO}")
 
-SET(CMAKE_BUILD_SETTING_CXX_COMPILER "${VTK40_CMAKE_CXX_COMPILER}")
-SET(CMAKE_BUILD_SETTING_CXX_FLAGS "${VTK40_CMAKE_CXX_FLAGS}")
-SET(CMAKE_BUILD_SETTING_CXX_FLAGS_DEBUG "${VTK40_CMAKE_CXX_FLAGS_DEBUG}")
-SET(CMAKE_BUILD_SETTING_CXX_FLAGS_RELEASE "${VTK40_CMAKE_CXX_FLAGS_RELEASE}")
-SET(CMAKE_BUILD_SETTING_CXX_FLAGS_MINSIZEREL "${VTK40_CMAKE_CXX_FLAGS_MINSIZEREL}")
-SET(CMAKE_BUILD_SETTING_CXX_FLAGS_RELWITHDEBINFO "${VTK40_CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
+set(CMAKE_BUILD_SETTING_CXX_COMPILER "${VTK40_CMAKE_CXX_COMPILER}")
+set(CMAKE_BUILD_SETTING_CXX_FLAGS "${VTK40_CMAKE_CXX_FLAGS}")
+set(CMAKE_BUILD_SETTING_CXX_FLAGS_DEBUG "${VTK40_CMAKE_CXX_FLAGS_DEBUG}")
+set(CMAKE_BUILD_SETTING_CXX_FLAGS_RELEASE "${VTK40_CMAKE_CXX_FLAGS_RELEASE}")
+set(CMAKE_BUILD_SETTING_CXX_FLAGS_MINSIZEREL "${VTK40_CMAKE_CXX_FLAGS_MINSIZEREL}")
+set(CMAKE_BUILD_SETTING_CXX_FLAGS_RELWITHDEBINFO "${VTK40_CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
 
-SET(CMAKE_BUILD_SETTING_BUILD_TYPE "${VTK40_CMAKE_BUILD_TYPE}")
-SET(CMAKE_BUILD_SETTING_BUILD_TOOL "${VTK40_CMAKE_BUILD_TOOL}")
+set(CMAKE_BUILD_SETTING_BUILD_TYPE "${VTK40_CMAKE_BUILD_TYPE}")
+set(CMAKE_BUILD_SETTING_BUILD_TOOL "${VTK40_CMAKE_BUILD_TOOL}")
diff --git a/Modules/UseVTKConfig40.cmake b/Modules/UseVTKConfig40.cmake
index ca5e7aa3c..549a792e3 100644
--- a/Modules/UseVTKConfig40.cmake
+++ b/Modules/UseVTKConfig40.cmake
@@ -17,21 +17,21 @@
 # FindVTK.cmake module.  Do not include directly.
 
 # Hard-code the version number since it isn't provided by VTK 4.0.
-SET(VTK_MAJOR_VERSION 4)
-SET(VTK_MINOR_VERSION 0)
-SET(VTK_BUILD_VERSION 2)
+set(VTK_MAJOR_VERSION 4)
+set(VTK_MINOR_VERSION 0)
+set(VTK_BUILD_VERSION 2)
 
 # Provide a new UseVTK file that doesn't do a full LOAD_CACHE.
-SET(VTK_USE_FILE ${CMAKE_ROOT}/Modules/UseVTK40.cmake)
+set(VTK_USE_FILE ${CMAKE_ROOT}/Modules/UseVTK40.cmake)
 
 # Provide a build settings file.
-SET(VTK_BUILD_SETTINGS_FILE ${CMAKE_ROOT}/Modules/UseVTKBuildSettings40.cmake)
+set(VTK_BUILD_SETTINGS_FILE ${CMAKE_ROOT}/Modules/UseVTKBuildSettings40.cmake)
 
 # There are no CMake extensions for VTK 4.0.
-SET(VTK_CMAKE_EXTENSIONS_DIR "")
+set(VTK_CMAKE_EXTENSIONS_DIR "")
 
 # grep "VTK40_" UseVTKConfig40.cmake |sed 's/.*VTK40_\([A-Za-z0-9_]*\).*/  \1/'
-LOAD_CACHE(${VTK_DIR} READ_WITH_PREFIX VTK40_
+load_cache(${VTK_DIR} READ_WITH_PREFIX VTK40_
   BUILD_SHARED_LIBS
   CMAKE_BUILD_TOOL
   CMAKE_BUILD_TYPE
@@ -132,124 +132,124 @@ LOAD_CACHE(${VTK_DIR} READ_WITH_PREFIX VTK40_
 )
 
 # Copy needed settings from the VTK 4.0 cache.
-SET(VTK_BUILD_SHARED ${VTK40_BUILD_SHARED_LIBS})
-SET(VTK_DEBUG_LEAKS ${VTK40_VTK_DEBUG_LEAKS})
-SET(VTK_HAVE_VG500 ${VTK40_VTK_HAVE_VG500})
-SET(VTK_HAVE_VP1000 ${VTK40_VTK_HAVE_VP1000})
-SET(VTK_USE_MANGLED_MESA ${VTK40_VTK_MANGLE_MESA})
-SET(VTK_MPIRUN_EXE ${VTK40_MPIRUN})
-SET(VTK_MPI_POSTFLAGS ${VTK40_MPI_POSTFLAGS})
-SET(VTK_MPI_PREFLAGS ${VTK40_MPI_PREFLAGS})
-SET(VTK_OPENGL_HAS_OSMESA ${VTK40_VTK_OPENGL_HAS_OSMESA})
-SET(VTK_USE_64BIT_IDS ${VTK40_VTK_USE_64BIT_IDS})
-SET(VTK_USE_ANSI_STDLIB ${VTK40_VTK_USE_ANSI_STDLIB})
-SET(VTK_USE_HYBRID ${VTK40_VTK_USE_HYBRID})
-SET(VTK_USE_MATROX_IMAGING ${VTK40_VTK_USE_MATROX_IMAGING})
-SET(VTK_USE_MPI ${VTK40_VTK_USE_MPI})
-SET(VTK_USE_PARALLEL ${VTK40_VTK_USE_PARALLEL})
-SET(VTK_USE_PATENTED ${VTK40_VTK_USE_PATENTED})
-SET(VTK_USE_RENDERING ${VTK40_VTK_USE_RENDERING})
-SET(VTK_USE_VIDEO_FOR_WINDOWS ${VTK40_VTK_USE_VIDEO_FOR_WINDOWS})
-SET(VTK_USE_VOLUMEPRO ${VTK40_VTK_USE_VOLUMEPRO})
-SET(VTK_USE_X ${VTK40_VTK_USE_X})
-SET(VTK_WRAP_JAVA ${VTK40_VTK_WRAP_JAVA})
-SET(VTK_WRAP_PYTHON ${VTK40_VTK_WRAP_PYTHON})
-SET(VTK_WRAP_TCL ${VTK40_VTK_WRAP_TCL})
+set(VTK_BUILD_SHARED ${VTK40_BUILD_SHARED_LIBS})
+set(VTK_DEBUG_LEAKS ${VTK40_VTK_DEBUG_LEAKS})
+set(VTK_HAVE_VG500 ${VTK40_VTK_HAVE_VG500})
+set(VTK_HAVE_VP1000 ${VTK40_VTK_HAVE_VP1000})
+set(VTK_USE_MANGLED_MESA ${VTK40_VTK_MANGLE_MESA})
+set(VTK_MPIRUN_EXE ${VTK40_MPIRUN})
+set(VTK_MPI_POSTFLAGS ${VTK40_MPI_POSTFLAGS})
+set(VTK_MPI_PREFLAGS ${VTK40_MPI_PREFLAGS})
+set(VTK_OPENGL_HAS_OSMESA ${VTK40_VTK_OPENGL_HAS_OSMESA})
+set(VTK_USE_64BIT_IDS ${VTK40_VTK_USE_64BIT_IDS})
+set(VTK_USE_ANSI_STDLIB ${VTK40_VTK_USE_ANSI_STDLIB})
+set(VTK_USE_HYBRID ${VTK40_VTK_USE_HYBRID})
+set(VTK_USE_MATROX_IMAGING ${VTK40_VTK_USE_MATROX_IMAGING})
+set(VTK_USE_MPI ${VTK40_VTK_USE_MPI})
+set(VTK_USE_PARALLEL ${VTK40_VTK_USE_PARALLEL})
+set(VTK_USE_PATENTED ${VTK40_VTK_USE_PATENTED})
+set(VTK_USE_RENDERING ${VTK40_VTK_USE_RENDERING})
+set(VTK_USE_VIDEO_FOR_WINDOWS ${VTK40_VTK_USE_VIDEO_FOR_WINDOWS})
+set(VTK_USE_VOLUMEPRO ${VTK40_VTK_USE_VOLUMEPRO})
+set(VTK_USE_X ${VTK40_VTK_USE_X})
+set(VTK_WRAP_JAVA ${VTK40_VTK_WRAP_JAVA})
+set(VTK_WRAP_PYTHON ${VTK40_VTK_WRAP_PYTHON})
+set(VTK_WRAP_TCL ${VTK40_VTK_WRAP_TCL})
 
 # Create the list of available kits.
-SET(VTK_KITS COMMON FILTERING GRAPHICS IMAGING IO)
-IF(VTK_USE_RENDERING)
-  SET(VTK_KITS ${VTK_KITS} RENDERING)
-ENDIF(VTK_USE_RENDERING)
-IF(VTK_USE_HYBRID)
-  SET(VTK_KITS ${VTK_KITS} HYBRID)
-ENDIF(VTK_USE_HYBRID)
-IF(VTK_USE_PARALLEL)
-  SET(VTK_KITS ${VTK_KITS} PARALLEL)
-ENDIF(VTK_USE_PARALLEL)
-IF(VTK_USE_PATENTED)
-  SET(VTK_KITS ${VTK_KITS} PATENTED)
-ENDIF(VTK_USE_PATENTED)
+set(VTK_KITS COMMON FILTERING GRAPHICS IMAGING IO)
+if(VTK_USE_RENDERING)
+  set(VTK_KITS ${VTK_KITS} RENDERING)
+endif(VTK_USE_RENDERING)
+if(VTK_USE_HYBRID)
+  set(VTK_KITS ${VTK_KITS} HYBRID)
+endif(VTK_USE_HYBRID)
+if(VTK_USE_PARALLEL)
+  set(VTK_KITS ${VTK_KITS} PARALLEL)
+endif(VTK_USE_PARALLEL)
+if(VTK_USE_PATENTED)
+  set(VTK_KITS ${VTK_KITS} PATENTED)
+endif(VTK_USE_PATENTED)
 
 # Create the list of available languages.
-SET(VTK_LANGUAGES "")
-IF(VTK_WRAP_TCL)
-  SET(VTK_LANGUAGES ${VTK_LANGUAGES} TCL)
-ENDIF(VTK_WRAP_TCL)
-IF(VTK_WRAP_PYTHON)
-  SET(VTK_LANGUAGES ${VTK_LANGUAGES} PYTHON)
-ENDIF(VTK_WRAP_PYTHON)
-IF(VTK_WRAP_JAVA)
-  SET(VTK_LANGUAGES ${VTK_LANGUAGES} JAVA)
-ENDIF(VTK_WRAP_JAVA)
+set(VTK_LANGUAGES "")
+if(VTK_WRAP_TCL)
+  set(VTK_LANGUAGES ${VTK_LANGUAGES} TCL)
+endif(VTK_WRAP_TCL)
+if(VTK_WRAP_PYTHON)
+  set(VTK_LANGUAGES ${VTK_LANGUAGES} PYTHON)
+endif(VTK_WRAP_PYTHON)
+if(VTK_WRAP_JAVA)
+  set(VTK_LANGUAGES ${VTK_LANGUAGES} JAVA)
+endif(VTK_WRAP_JAVA)
 
 # Include directories for other projects installed on the system and
 # used by VTK.
-SET(VTK_INCLUDE_DIRS_SYS "")
-IF(VTK_USE_RENDERING)
-  SET(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
+set(VTK_INCLUDE_DIRS_SYS "")
+if(VTK_USE_RENDERING)
+  set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
       ${VTK40_OPENGL_INCLUDE_PATH} ${VTK40_OPENGL_INCLUDE_DIR})
-  IF(VTK_USE_X)
-    SET(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
+  if(VTK_USE_X)
+    set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
         ${VTK40_CMAKE_Xlib_INCLUDE_PATH} ${VTK40_CMAKE_Xutil_INCLUDE_PATH})
-  ENDIF(VTK_USE_X)
-ENDIF(VTK_USE_RENDERING)
+  endif(VTK_USE_X)
+endif(VTK_USE_RENDERING)
 
-IF(VTK_OPENGL_HAS_OSMESA)
-  SET(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
+if(VTK_OPENGL_HAS_OSMESA)
+  set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
       ${VTK40_OSMESA_INCLUDE_PATH})
-ENDIF(VTK_OPENGL_HAS_OSMESA)
+endif(VTK_OPENGL_HAS_OSMESA)
 
-IF(VTK_USE_MPI)
-  SET(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_MPI_INCLUDE_PATH})
-ENDIF(VTK_USE_MPI)
+if(VTK_USE_MPI)
+  set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_MPI_INCLUDE_PATH})
+endif(VTK_USE_MPI)
 
-IF(VTK_WRAP_TCL)
-  SET(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_TCL_INCLUDE_PATH})
-ENDIF(VTK_WRAP_TCL)
+if(VTK_WRAP_TCL)
+  set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_TCL_INCLUDE_PATH})
+endif(VTK_WRAP_TCL)
 
-IF(VTK_WRAP_PYTHON)
-  SET(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_PYTHON_INCLUDE_PATH})
-ENDIF(VTK_WRAP_PYTHON)
+if(VTK_WRAP_PYTHON)
+  set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_PYTHON_INCLUDE_PATH})
+endif(VTK_WRAP_PYTHON)
 
-IF(VTK_WRAP_JAVA)
-  SET(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
+if(VTK_WRAP_JAVA)
+  set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
       ${VTK40_JAVA_INCLUDE_PATH} ${VTK40_JAVA_INCLUDE_PATH2})
-ENDIF(VTK_WRAP_JAVA)
+endif(VTK_WRAP_JAVA)
 
-IF(VTK_HAVE_VG500)
-  SET(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
+if(VTK_HAVE_VG500)
+  set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
       ${VTK40_VLI_INCLUDE_PATH_FOR_VG500})
-ENDIF(VTK_HAVE_VG500)
+endif(VTK_HAVE_VG500)
 
-IF(VTK_HAVE_VP1000)
-  SET(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
+if(VTK_HAVE_VP1000)
+  set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
       ${VTK40_VLI_INCLUDE_PATH_FOR_VP1000})
-ENDIF(VTK_HAVE_VP1000)
+endif(VTK_HAVE_VP1000)
 
 # See if this is a build tree or install tree.
-IF(EXISTS ${VTK_DIR}/Common)
+if(EXISTS ${VTK_DIR}/Common)
   # This is a VTK 4.0 build tree.
 
-  SET(VTK_LIBRARY_DIRS ${VTK40_LIBRARY_OUTPUT_PATH})
+  set(VTK_LIBRARY_DIRS ${VTK40_LIBRARY_OUTPUT_PATH})
 
   # Determine the include directories needed.
-  SET(VTK_INCLUDE_DIRS ${VTK40_VTK_BINARY_DIR})
-  IF(VTK_USE_PARALLEL)
-    SET(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Parallel)
-  ENDIF(VTK_USE_PARALLEL)
-  IF(VTK_USE_HYBRID)
-    SET(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Hybrid)
-  ENDIF(VTK_USE_HYBRID)
-  IF(VTK_USE_PATENTED)
-    SET(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Patented)
-  ENDIF(VTK_USE_PATENTED)
-  IF(VTK_USE_RENDERING)
-    SET(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Rendering)
-  ENDIF(VTK_USE_RENDERING)
+  set(VTK_INCLUDE_DIRS ${VTK40_VTK_BINARY_DIR})
+  if(VTK_USE_PARALLEL)
+    set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Parallel)
+  endif(VTK_USE_PARALLEL)
+  if(VTK_USE_HYBRID)
+    set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Hybrid)
+  endif(VTK_USE_HYBRID)
+  if(VTK_USE_PATENTED)
+    set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Patented)
+  endif(VTK_USE_PATENTED)
+  if(VTK_USE_RENDERING)
+    set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Rendering)
+  endif(VTK_USE_RENDERING)
 
   # These directories are always needed.
-  SET(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS}
+  set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS}
     ${VTK40_VTK_SOURCE_DIR}/IO
     ${VTK40_VTK_SOURCE_DIR}/Imaging
     ${VTK40_VTK_SOURCE_DIR}/Graphics
@@ -257,119 +257,119 @@ IF(EXISTS ${VTK_DIR}/Common)
     ${VTK40_VTK_SOURCE_DIR}/Common)
 
   # Give access to a few utilities.
-  SET(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS}
+  set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS}
     ${VTK40_VTK_BINARY_DIR}/Utilities/png
     ${VTK40_VTK_SOURCE_DIR}/Utilities/png
     ${VTK40_VTK_BINARY_DIR}/Utilities/zlib
     ${VTK40_VTK_SOURCE_DIR}/Utilities/zlib)
 
   # Executable locations.
-  IF(VTK_WRAP_TCL)
-    SET(VTK_TCL_EXE ${VTK40_EXECUTABLE_OUTPUT_PATH}/vtk)
-    SET(VTK_WRAP_TCL_EXE ${VTK40_VTK_WRAP_TCL_EXE})
-    SET(VTK_TCL_HOME ${VTK40_VTK_SOURCE_DIR}/Wrapping/Tcl)
-  ENDIF(VTK_WRAP_TCL)
-  IF(VTK_WRAP_PYTHON)
-    SET(VTK_WRAP_PYTHON_EXE ${VTK40_VTK_WRAP_PYTHON_EXE})
-  ENDIF(VTK_WRAP_PYTHON)
-  IF(VTK_WRAP_JAVA)
-    SET(VTK_PARSE_JAVA_EXE ${VTK40_VTK_PARSE_JAVA_EXE})
-    SET(VTK_WRAP_JAVA_EXE ${VTK40_VTK_WRAP_JAVA_EXE})
-  ENDIF(VTK_WRAP_JAVA)
+  if(VTK_WRAP_TCL)
+    set(VTK_TCL_EXE ${VTK40_EXECUTABLE_OUTPUT_PATH}/vtk)
+    set(VTK_WRAP_TCL_EXE ${VTK40_VTK_WRAP_TCL_EXE})
+    set(VTK_TCL_HOME ${VTK40_VTK_SOURCE_DIR}/Wrapping/Tcl)
+  endif(VTK_WRAP_TCL)
+  if(VTK_WRAP_PYTHON)
+    set(VTK_WRAP_PYTHON_EXE ${VTK40_VTK_WRAP_PYTHON_EXE})
+  endif(VTK_WRAP_PYTHON)
+  if(VTK_WRAP_JAVA)
+    set(VTK_PARSE_JAVA_EXE ${VTK40_VTK_PARSE_JAVA_EXE})
+    set(VTK_WRAP_JAVA_EXE ${VTK40_VTK_WRAP_JAVA_EXE})
+  endif(VTK_WRAP_JAVA)
 
-ELSE(EXISTS ${VTK_DIR}/Common)
+else(EXISTS ${VTK_DIR}/Common)
   # This is a VTK 4.0 install tree.
 
-  SET(VTK_INCLUDE_DIRS ${VTK_DIR})
-  SET(VTK_LIBRARY_DIRS ${VTK40_CMAKE_INSTALL_PREFIX}/lib/vtk)
+  set(VTK_INCLUDE_DIRS ${VTK_DIR})
+  set(VTK_LIBRARY_DIRS ${VTK40_CMAKE_INSTALL_PREFIX}/lib/vtk)
 
   # Executable locations.
-  IF(VTK_WRAP_TCL)
-    SET(VTK_TCL_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtk)
-    SET(VTK_WRAP_TCL_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkWrapTcl)
-    SET(VTK_TCL_HOME ${VTK40_CMAKE_INSTALL_PREFIX}/lib/vtk/tcl)
-  ENDIF(VTK_WRAP_TCL)
-  IF(VTK_WRAP_PYTHON)
-    SET(VTK_WRAP_PYTHON_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkWrapPython)
-  ENDIF(VTK_WRAP_PYTHON)
-  IF(VTK_WRAP_JAVA)
-    SET(VTK_PARSE_JAVA_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkParseJava)
-    SET(VTK_WRAP_JAVA_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkWrapJava)
-  ENDIF(VTK_WRAP_JAVA)
-ENDIF(EXISTS ${VTK_DIR}/Common)
+  if(VTK_WRAP_TCL)
+    set(VTK_TCL_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtk)
+    set(VTK_WRAP_TCL_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkWrapTcl)
+    set(VTK_TCL_HOME ${VTK40_CMAKE_INSTALL_PREFIX}/lib/vtk/tcl)
+  endif(VTK_WRAP_TCL)
+  if(VTK_WRAP_PYTHON)
+    set(VTK_WRAP_PYTHON_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkWrapPython)
+  endif(VTK_WRAP_PYTHON)
+  if(VTK_WRAP_JAVA)
+    set(VTK_PARSE_JAVA_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkParseJava)
+    set(VTK_WRAP_JAVA_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkWrapJava)
+  endif(VTK_WRAP_JAVA)
+endif(EXISTS ${VTK_DIR}/Common)
 
 # Add the system include directories last.
-SET(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK_INCLUDE_DIRS_SYS})
+set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK_INCLUDE_DIRS_SYS})
 
 # Find the required C and C++ compiler flags.
-IF(CMAKE_COMPILER_IS_GNUCXX)
-  IF(WIN32)
+if(CMAKE_COMPILER_IS_GNUCXX)
+  if(WIN32)
     # The platform is gcc on cygwin.
-    SET(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} -mwin32")
-    SET(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} -mwin32")
-  ENDIF(WIN32)
-ELSE(CMAKE_COMPILER_IS_GNUCXX)
-  IF(CMAKE_ANSI_CFLAGS)
-    SET(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
-  ENDIF(CMAKE_ANSI_CFLAGS)
-  IF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
-     SET(VTK_REQUIRED_CXX_FLAGS
+    set(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} -mwin32")
+    set(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} -mwin32")
+  endif(WIN32)
+else(CMAKE_COMPILER_IS_GNUCXX)
+  if(CMAKE_ANSI_CFLAGS)
+    set(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
+  endif(CMAKE_ANSI_CFLAGS)
+  if(CMAKE_SYSTEM MATCHES "OSF1-V.*")
+     set(VTK_REQUIRED_CXX_FLAGS
          "${VTK_REQUIRED_CXX_FLAGS} -timplicit_local -no_implicit_include")
-  ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
-ENDIF(CMAKE_COMPILER_IS_GNUCXX)
+  endif(CMAKE_SYSTEM MATCHES "OSF1-V.*")
+endif(CMAKE_COMPILER_IS_GNUCXX)
 
-IF(VTK_USE_X)
-  IF(CMAKE_X_CFLAGS)
-    SET(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} ${CMAKE_X_CFLAGS}")
-    SET(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} ${CMAKE_X_CFLAGS}")
-  ENDIF(CMAKE_X_CFLAGS)
-ENDIF(VTK_USE_X)
+if(VTK_USE_X)
+  if(CMAKE_X_CFLAGS)
+    set(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} ${CMAKE_X_CFLAGS}")
+    set(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} ${CMAKE_X_CFLAGS}")
+  endif(CMAKE_X_CFLAGS)
+endif(VTK_USE_X)
 
 # Copy library dependencies.
-SET(vtkCommonJava_LIB_DEPENDS "${VTK40_vtkCommonJava_LIB_DEPENDS}")
-SET(vtkCommonPython_LIB_DEPENDS "${VTK40_vtkCommonPython_LIB_DEPENDS}")
-SET(vtkCommonTCL_LIB_DEPENDS "${VTK40_vtkCommonTCL_LIB_DEPENDS}")
-SET(vtkCommon_LIB_DEPENDS "${VTK40_vtkCommon_LIB_DEPENDS}")
-SET(vtkFilteringJava_LIB_DEPENDS "${VTK40_vtkFilteringJava_LIB_DEPENDS}")
-SET(vtkFilteringPython_LIB_DEPENDS "${VTK40_vtkFilteringPython_LIB_DEPENDS}")
-SET(vtkFilteringTCL_LIB_DEPENDS "${VTK40_vtkFilteringTCL_LIB_DEPENDS}")
-SET(vtkFiltering_LIB_DEPENDS "${VTK40_vtkFiltering_LIB_DEPENDS}")
-SET(vtkGraphicsJava_LIB_DEPENDS "${VTK40_vtkGraphicsJava_LIB_DEPENDS}")
-SET(vtkGraphicsPython_LIB_DEPENDS "${VTK40_vtkGraphicsPython_LIB_DEPENDS}")
-SET(vtkGraphicsTCL_LIB_DEPENDS "${VTK40_vtkGraphicsTCL_LIB_DEPENDS}")
-SET(vtkGraphics_LIB_DEPENDS "${VTK40_vtkGraphics_LIB_DEPENDS}")
-SET(vtkHybridJava_LIB_DEPENDS "${VTK40_vtkHybridJava_LIB_DEPENDS}")
-SET(vtkHybridPython_LIB_DEPENDS "${VTK40_vtkHybridPython_LIB_DEPENDS}")
-SET(vtkHybridTCL_LIB_DEPENDS "${VTK40_vtkHybridTCL_LIB_DEPENDS}")
-SET(vtkHybrid_LIB_DEPENDS "${VTK40_vtkHybrid_LIB_DEPENDS}")
-SET(vtkIOJava_LIB_DEPENDS "${VTK40_vtkIOJava_LIB_DEPENDS}")
-SET(vtkIOPython_LIB_DEPENDS "${VTK40_vtkIOPython_LIB_DEPENDS}")
-SET(vtkIOTCL_LIB_DEPENDS "${VTK40_vtkIOTCL_LIB_DEPENDS}")
-SET(vtkIO_LIB_DEPENDS "${VTK40_vtkIO_LIB_DEPENDS}")
-SET(vtkImagingJava_LIB_DEPENDS "${VTK40_vtkImagingJava_LIB_DEPENDS}")
-SET(vtkImagingPython_LIB_DEPENDS "${VTK40_vtkImagingPython_LIB_DEPENDS}")
-SET(vtkImagingTCL_LIB_DEPENDS "${VTK40_vtkImagingTCL_LIB_DEPENDS}")
-SET(vtkImaging_LIB_DEPENDS "${VTK40_vtkImaging_LIB_DEPENDS}")
-SET(vtkParallelJava_LIB_DEPENDS "${VTK40_vtkParallelJava_LIB_DEPENDS}")
-SET(vtkParallelPython_LIB_DEPENDS "${VTK40_vtkParallelPython_LIB_DEPENDS}")
-SET(vtkParallelTCL_LIB_DEPENDS "${VTK40_vtkParallelTCL_LIB_DEPENDS}")
-SET(vtkParallel_LIB_DEPENDS "${VTK40_vtkParallel_LIB_DEPENDS}")
-SET(vtkPatentedJava_LIB_DEPENDS "${VTK40_vtkPatentedJava_LIB_DEPENDS}")
-SET(vtkPatentedPython_LIB_DEPENDS "${VTK40_vtkPatentedPython_LIB_DEPENDS}")
-SET(vtkPatentedTCL_LIB_DEPENDS "${VTK40_vtkPatentedTCL_LIB_DEPENDS}")
-SET(vtkPatented_LIB_DEPENDS "${VTK40_vtkPatented_LIB_DEPENDS}")
-SET(vtkRenderingJava_LIB_DEPENDS "${VTK40_vtkRenderingJava_LIB_DEPENDS}")
-SET(vtkRenderingPythonTkWidgets_LIB_DEPENDS "${VTK40_vtkRenderingPythonTkWidgets_LIB_DEPENDS}")
-SET(vtkRenderingPython_LIB_DEPENDS "${VTK40_vtkRenderingPython_LIB_DEPENDS}")
-SET(vtkRenderingTCL_LIB_DEPENDS "${VTK40_vtkRenderingTCL_LIB_DEPENDS}")
-SET(vtkRendering_LIB_DEPENDS "${VTK40_vtkRendering_LIB_DEPENDS}")
-SET(vtkjpeg_LIB_DEPENDS "${VTK40_vtkjpeg_LIB_DEPENDS}")
-SET(vtkpng_LIB_DEPENDS "${VTK40_vtkpng_LIB_DEPENDS}")
-SET(vtkzlib_LIB_DEPENDS "${VTK40_vtkzlib_LIB_DEPENDS}")
+set(vtkCommonJava_LIB_DEPENDS "${VTK40_vtkCommonJava_LIB_DEPENDS}")
+set(vtkCommonPython_LIB_DEPENDS "${VTK40_vtkCommonPython_LIB_DEPENDS}")
+set(vtkCommonTCL_LIB_DEPENDS "${VTK40_vtkCommonTCL_LIB_DEPENDS}")
+set(vtkCommon_LIB_DEPENDS "${VTK40_vtkCommon_LIB_DEPENDS}")
+set(vtkFilteringJava_LIB_DEPENDS "${VTK40_vtkFilteringJava_LIB_DEPENDS}")
+set(vtkFilteringPython_LIB_DEPENDS "${VTK40_vtkFilteringPython_LIB_DEPENDS}")
+set(vtkFilteringTCL_LIB_DEPENDS "${VTK40_vtkFilteringTCL_LIB_DEPENDS}")
+set(vtkFiltering_LIB_DEPENDS "${VTK40_vtkFiltering_LIB_DEPENDS}")
+set(vtkGraphicsJava_LIB_DEPENDS "${VTK40_vtkGraphicsJava_LIB_DEPENDS}")
+set(vtkGraphicsPython_LIB_DEPENDS "${VTK40_vtkGraphicsPython_LIB_DEPENDS}")
+set(vtkGraphicsTCL_LIB_DEPENDS "${VTK40_vtkGraphicsTCL_LIB_DEPENDS}")
+set(vtkGraphics_LIB_DEPENDS "${VTK40_vtkGraphics_LIB_DEPENDS}")
+set(vtkHybridJava_LIB_DEPENDS "${VTK40_vtkHybridJava_LIB_DEPENDS}")
+set(vtkHybridPython_LIB_DEPENDS "${VTK40_vtkHybridPython_LIB_DEPENDS}")
+set(vtkHybridTCL_LIB_DEPENDS "${VTK40_vtkHybridTCL_LIB_DEPENDS}")
+set(vtkHybrid_LIB_DEPENDS "${VTK40_vtkHybrid_LIB_DEPENDS}")
+set(vtkIOJava_LIB_DEPENDS "${VTK40_vtkIOJava_LIB_DEPENDS}")
+set(vtkIOPython_LIB_DEPENDS "${VTK40_vtkIOPython_LIB_DEPENDS}")
+set(vtkIOTCL_LIB_DEPENDS "${VTK40_vtkIOTCL_LIB_DEPENDS}")
+set(vtkIO_LIB_DEPENDS "${VTK40_vtkIO_LIB_DEPENDS}")
+set(vtkImagingJava_LIB_DEPENDS "${VTK40_vtkImagingJava_LIB_DEPENDS}")
+set(vtkImagingPython_LIB_DEPENDS "${VTK40_vtkImagingPython_LIB_DEPENDS}")
+set(vtkImagingTCL_LIB_DEPENDS "${VTK40_vtkImagingTCL_LIB_DEPENDS}")
+set(vtkImaging_LIB_DEPENDS "${VTK40_vtkImaging_LIB_DEPENDS}")
+set(vtkParallelJava_LIB_DEPENDS "${VTK40_vtkParallelJava_LIB_DEPENDS}")
+set(vtkParallelPython_LIB_DEPENDS "${VTK40_vtkParallelPython_LIB_DEPENDS}")
+set(vtkParallelTCL_LIB_DEPENDS "${VTK40_vtkParallelTCL_LIB_DEPENDS}")
+set(vtkParallel_LIB_DEPENDS "${VTK40_vtkParallel_LIB_DEPENDS}")
+set(vtkPatentedJava_LIB_DEPENDS "${VTK40_vtkPatentedJava_LIB_DEPENDS}")
+set(vtkPatentedPython_LIB_DEPENDS "${VTK40_vtkPatentedPython_LIB_DEPENDS}")
+set(vtkPatentedTCL_LIB_DEPENDS "${VTK40_vtkPatentedTCL_LIB_DEPENDS}")
+set(vtkPatented_LIB_DEPENDS "${VTK40_vtkPatented_LIB_DEPENDS}")
+set(vtkRenderingJava_LIB_DEPENDS "${VTK40_vtkRenderingJava_LIB_DEPENDS}")
+set(vtkRenderingPythonTkWidgets_LIB_DEPENDS "${VTK40_vtkRenderingPythonTkWidgets_LIB_DEPENDS}")
+set(vtkRenderingPython_LIB_DEPENDS "${VTK40_vtkRenderingPython_LIB_DEPENDS}")
+set(vtkRenderingTCL_LIB_DEPENDS "${VTK40_vtkRenderingTCL_LIB_DEPENDS}")
+set(vtkRendering_LIB_DEPENDS "${VTK40_vtkRendering_LIB_DEPENDS}")
+set(vtkjpeg_LIB_DEPENDS "${VTK40_vtkjpeg_LIB_DEPENDS}")
+set(vtkpng_LIB_DEPENDS "${VTK40_vtkpng_LIB_DEPENDS}")
+set(vtkzlib_LIB_DEPENDS "${VTK40_vtkzlib_LIB_DEPENDS}")
 
 # List of VTK configuration variables set above.
-# grep "^[ ]*SET(VTK" UseVTKConfig40.cmake |sed 's/[ ]*SET(\([^ ]*\) .*/  \1/'
-SET(VTK_SETTINGS
+# grep "^[ ]*set(VTK" UseVTKConfig40.cmake |sed 's/[ ]*set(\([^ ]*\) .*/  \1/'
+set(VTK_SETTINGS
   VTK_BUILD_SHARED
   VTK_BUILD_VERSION
   VTK_DEBUG_LEAKS
diff --git a/Modules/Use_wxWindows.cmake b/Modules/Use_wxWindows.cmake
index 01a15168e..681fe28e3 100644
--- a/Modules/Use_wxWindows.cmake
+++ b/Modules/Use_wxWindows.cmake
@@ -7,10 +7,10 @@
 # USAGE:
 #   just include Use_wxWindows.cmake
 #   in your projects CMakeLists.txt
-# INCLUDE( ${CMAKE_MODULE_PATH}/Use_wxWindows.cmake)
+# include( ${CMAKE_MODULE_PATH}/Use_wxWindows.cmake)
 ##
 #   if you are sure you need GL then
-# SET(WXWINDOWS_USE_GL 1)
+# set(WXWINDOWS_USE_GL 1)
 #   *before* you include this file.
 
 #=============================================================================
@@ -31,34 +31,34 @@
 # 16.Feb.2004: changed INCLUDE to FIND_PACKAGE to read from users own non-system CMAKE_MODULE_PATH (Jan Woetzel JW)
 # 07/2006: rewrite as FindwxWidgets.cmake, kept for backward compatibility JW
 
-MESSAGE(STATUS "Use_wxWindows.cmake is DEPRECATED. \n"
-"Please use FIND_PACKAGE(wxWidgets) and INCLUDE(${wxWidgets_USE_FILE}) instead. (JW)")
+message(STATUS "Use_wxWindows.cmake is DEPRECATED. \n"
+"Please use find_package(wxWidgets) and include(${wxWidgets_USE_FILE}) instead. (JW)")
 
 
 # ------------------------
 
-FIND_PACKAGE( wxWindows )
+find_package( wxWindows )
 
-IF(WXWINDOWS_FOUND)
+if(WXWINDOWS_FOUND)
 
-#MESSAGE("DBG Use_wxWindows.cmake:  WXWINDOWS_INCLUDE_DIR=${WXWINDOWS_INCLUDE_DIR} WXWINDOWS_LINK_DIRECTORIES=${WXWINDOWS_LINK_DIRECTORIES}     WXWINDOWS_LIBRARIES=${WXWINDOWS_LIBRARIES}  CMAKE_WXWINDOWS_CXX_FLAGS=${CMAKE_WXWINDOWS_CXX_FLAGS} WXWINDOWS_DEFINITIONS=${WXWINDOWS_DEFINITIONS}")
+#message("DBG Use_wxWindows.cmake:  WXWINDOWS_INCLUDE_DIR=${WXWINDOWS_INCLUDE_DIR} WXWINDOWS_LINK_DIRECTORIES=${WXWINDOWS_LINK_DIRECTORIES}     WXWINDOWS_LIBRARIES=${WXWINDOWS_LIBRARIES}  CMAKE_WXWINDOWS_CXX_FLAGS=${CMAKE_WXWINDOWS_CXX_FLAGS} WXWINDOWS_DEFINITIONS=${WXWINDOWS_DEFINITIONS}")
 
- IF(WXWINDOWS_INCLUDE_DIR)
-    INCLUDE_DIRECTORIES(${WXWINDOWS_INCLUDE_DIR})
-  ENDIF(WXWINDOWS_INCLUDE_DIR)
- IF(WXWINDOWS_LINK_DIRECTORIES)
-    LINK_DIRECTORIES(${WXWINDOWS_LINK_DIRECTORIES})
-  ENDIF(WXWINDOWS_LINK_DIRECTORIES)
-  IF(WXWINDOWS_LIBRARIES)
-    LINK_LIBRARIES(${WXWINDOWS_LIBRARIES})
-  ENDIF(WXWINDOWS_LIBRARIES)
-  IF (CMAKE_WXWINDOWS_CXX_FLAGS)
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_WXWINDOWS_CXX_FLAGS}")
-  ENDIF(CMAKE_WXWINDOWS_CXX_FLAGS)
-  IF(WXWINDOWS_DEFINITIONS)
-    ADD_DEFINITIONS(${WXWINDOWS_DEFINITIONS})
-  ENDIF(WXWINDOWS_DEFINITIONS)
-ELSE(WXWINDOWS_FOUND)
-  MESSAGE(SEND_ERROR "wxWindows not found by Use_wxWindows.cmake")
-ENDIF(WXWINDOWS_FOUND)
+ if(WXWINDOWS_INCLUDE_DIR)
+    include_directories(${WXWINDOWS_INCLUDE_DIR})
+  endif(WXWINDOWS_INCLUDE_DIR)
+ if(WXWINDOWS_LINK_DIRECTORIES)
+    link_directories(${WXWINDOWS_LINK_DIRECTORIES})
+  endif(WXWINDOWS_LINK_DIRECTORIES)
+  if(WXWINDOWS_LIBRARIES)
+    link_libraries(${WXWINDOWS_LIBRARIES})
+  endif(WXWINDOWS_LIBRARIES)
+  if (CMAKE_WXWINDOWS_CXX_FLAGS)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_WXWINDOWS_CXX_FLAGS}")
+  endif(CMAKE_WXWINDOWS_CXX_FLAGS)
+  if(WXWINDOWS_DEFINITIONS)
+    add_definitions(${WXWINDOWS_DEFINITIONS})
+  endif(WXWINDOWS_DEFINITIONS)
+else(WXWINDOWS_FOUND)
+  message(SEND_ERROR "wxWindows not found by Use_wxWindows.cmake")
+endif(WXWINDOWS_FOUND)
 
diff --git a/Modules/UsewxWidgets.cmake b/Modules/UsewxWidgets.cmake
index a0f2e8632..82a008513 100644
--- a/Modules/UsewxWidgets.cmake
+++ b/Modules/UsewxWidgets.cmake
@@ -4,10 +4,10 @@
 #
 # USAGE
 #  # Note that for MinGW users the order of libs is important!
-#  FIND_PACKAGE(wxWidgets REQUIRED net gl core base)
-#  INCLUDE(${wxWidgets_USE_FILE})
+#  find_package(wxWidgets REQUIRED net gl core base)
+#  include(${wxWidgets_USE_FILE})
 #  # and for each of your dependent executable/library targets:
-#  TARGET_LINK_LIBRARIES(<YourTarget> ${wxWidgets_LIBRARIES})
+#  target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
 #
 # DEPRECATED
 #  LINK_LIBRARIES is not called in favor of adding dependencies per target.
@@ -31,59 +31,59 @@
 
 # debug message and logging.
 # comment these out for distribution
-IF    (NOT LOGFILE )
-  #  SET(LOGFILE "${PROJECT_BINARY_DIR}/CMakeOutput.log")
-ENDIF (NOT LOGFILE )
-MACRO(MSG _MSG)
-  #  FILE(APPEND ${LOGFILE} "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}):   ${_MSG}\n")
-  #  MESSAGE(STATUS "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}")
-ENDMACRO(MSG)
+if    (NOT LOGFILE )
+  #  set(LOGFILE "${PROJECT_BINARY_DIR}/CMakeOutput.log")
+endif (NOT LOGFILE )
+macro(MSG _MSG)
+  #  file(APPEND ${LOGFILE} "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}):   ${_MSG}\n")
+  #  message(STATUS "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}")
+endmacro(MSG)
 
 
 MSG("wxWidgets_FOUND=${wxWidgets_FOUND}")
-IF   (wxWidgets_FOUND)
-  IF   (wxWidgets_INCLUDE_DIRS)
-    IF(wxWidgets_INCLUDE_DIRS_NO_SYSTEM)
-      INCLUDE_DIRECTORIES(${wxWidgets_INCLUDE_DIRS})
-    ELSE(wxWidgets_INCLUDE_DIRS_NO_SYSTEM)
-      INCLUDE_DIRECTORIES(SYSTEM ${wxWidgets_INCLUDE_DIRS})
-    ENDIF(wxWidgets_INCLUDE_DIRS_NO_SYSTEM)
+if   (wxWidgets_FOUND)
+  if   (wxWidgets_INCLUDE_DIRS)
+    if(wxWidgets_INCLUDE_DIRS_NO_SYSTEM)
+      include_directories(${wxWidgets_INCLUDE_DIRS})
+    else(wxWidgets_INCLUDE_DIRS_NO_SYSTEM)
+      include_directories(SYSTEM ${wxWidgets_INCLUDE_DIRS})
+    endif(wxWidgets_INCLUDE_DIRS_NO_SYSTEM)
     MSG("wxWidgets_INCLUDE_DIRS=${wxWidgets_INCLUDE_DIRS}")
-  ENDIF(wxWidgets_INCLUDE_DIRS)
+  endif(wxWidgets_INCLUDE_DIRS)
 
-  IF   (wxWidgets_LIBRARY_DIRS)
-    LINK_DIRECTORIES(${wxWidgets_LIBRARY_DIRS})
+  if   (wxWidgets_LIBRARY_DIRS)
+    link_directories(${wxWidgets_LIBRARY_DIRS})
     MSG("wxWidgets_LIBRARY_DIRS=${wxWidgets_LIBRARY_DIRS}")
-  ENDIF(wxWidgets_LIBRARY_DIRS)
+  endif(wxWidgets_LIBRARY_DIRS)
 
-  IF   (wxWidgets_DEFINITIONS)
-    SET_PROPERTY(DIRECTORY APPEND
+  if   (wxWidgets_DEFINITIONS)
+    set_property(DIRECTORY APPEND
       PROPERTY COMPILE_DEFINITIONS ${wxWidgets_DEFINITIONS})
     MSG("wxWidgets_DEFINITIONS=${wxWidgets_DEFINITIONS}")
-  ENDIF(wxWidgets_DEFINITIONS)
+  endif(wxWidgets_DEFINITIONS)
 
-  IF   (wxWidgets_DEFINITIONS_DEBUG)
-    SET_PROPERTY(DIRECTORY APPEND
+  if   (wxWidgets_DEFINITIONS_DEBUG)
+    set_property(DIRECTORY APPEND
       PROPERTY COMPILE_DEFINITIONS_DEBUG ${wxWidgets_DEFINITIONS_DEBUG})
     MSG("wxWidgets_DEFINITIONS_DEBUG=${wxWidgets_DEFINITIONS_DEBUG}")
-  ENDIF(wxWidgets_DEFINITIONS_DEBUG)
+  endif(wxWidgets_DEFINITIONS_DEBUG)
 
-  IF   (wxWidgets_CXX_FLAGS)
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${wxWidgets_CXX_FLAGS}")
+  if   (wxWidgets_CXX_FLAGS)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${wxWidgets_CXX_FLAGS}")
     MSG("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}")
-  ENDIF(wxWidgets_CXX_FLAGS)
+  endif(wxWidgets_CXX_FLAGS)
 
   # DEPRECATED JW
   # just for backward compatibility: add deps to all targets
-  # library projects better use advanced FIND_PACKAGE(wxWidgets) directly.
-  #IF(wxWidgets_LIBRARIES)
-  #  LINK_LIBRARIES(${wxWidgets_LIBRARIES})
+  # library projects better use advanced find_package(wxWidgets) directly.
+  #if(wxWidgets_LIBRARIES)
+  #  link_libraries(${wxWidgets_LIBRARIES})
   #  # BUG: str too long:  MSG("wxWidgets_LIBRARIES=${wxWidgets_LIBRARIES}")
-  #  IF(LOGFILE)
-  #    FILE(APPEND ${LOGFILE} "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}):   ${wxWidgets_LIBRARIES}\n")
-  #  ENDIF(LOGFILE)
-  #ENDIF(wxWidgets_LIBRARIES)
+  #  if(LOGFILE)
+  #    file(APPEND ${LOGFILE} "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}):   ${wxWidgets_LIBRARIES}\n")
+  #  endif(LOGFILE)
+  #endif(wxWidgets_LIBRARIES)
 
-ELSE (wxWidgets_FOUND)
-  MESSAGE("wxWidgets requested but not found.")
-ENDIF(wxWidgets_FOUND)
+else (wxWidgets_FOUND)
+  message("wxWidgets requested but not found.")
+endif(wxWidgets_FOUND)
diff --git a/Modules/VTKCompatibility.cmake b/Modules/VTKCompatibility.cmake
index 802969f2f..e1abfbb9f 100644
--- a/Modules/VTKCompatibility.cmake
+++ b/Modules/VTKCompatibility.cmake
@@ -12,41 +12,41 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-IF(APPLE)
-  SET(CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_C_CREATE_SHARED_LIBRARY}")
-  SET(CMAKE_CXX_CREATE_SHARED_MODULE "${CMAKE_C_CREATE_SHARED_MODULE}")
-  STRING( REGEX REPLACE "CMAKE_C_COMPILER"
+if(APPLE)
+  set(CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_C_CREATE_SHARED_LIBRARY}")
+  set(CMAKE_CXX_CREATE_SHARED_MODULE "${CMAKE_C_CREATE_SHARED_MODULE}")
+  string( REGEX REPLACE "CMAKE_C_COMPILER"
     CMAKE_CXX_COMPILER CMAKE_CXX_CREATE_SHARED_MODULE
     "${CMAKE_CXX_CREATE_SHARED_MODULE}")
-  STRING( REGEX REPLACE "CMAKE_C_COMPILER"
+  string( REGEX REPLACE "CMAKE_C_COMPILER"
     CMAKE_CXX_COMPILER CMAKE_CXX_CREATE_SHARED_LIBRARY
     "${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
-ENDIF(APPLE)
+endif(APPLE)
 
-SET(VTKFTGL_BINARY_DIR "${VTK_BINARY_DIR}/Utilities/ftgl"
+set(VTKFTGL_BINARY_DIR "${VTK_BINARY_DIR}/Utilities/ftgl"
   CACHE INTERNAL "")
-SET(VTKFREETYPE_BINARY_DIR "${VTK_BINARY_DIR}/Utilities/freetype"
+set(VTKFREETYPE_BINARY_DIR "${VTK_BINARY_DIR}/Utilities/freetype"
   CACHE INTERNAL "")
-SET(VTKFTGL_SOURCE_DIR "${VTK_SOURCE_DIR}/Utilities/ftgl"
+set(VTKFTGL_SOURCE_DIR "${VTK_SOURCE_DIR}/Utilities/ftgl"
   CACHE INTERNAL "")
-SET(VTKFREETYPE_SOURCE_DIR "${VTK_SOURCE_DIR}/Utilities/freetype"
+set(VTKFREETYPE_SOURCE_DIR "${VTK_SOURCE_DIR}/Utilities/freetype"
   CACHE INTERNAL "")
 
-SET(VTK_GLEXT_FILE "${VTK_SOURCE_DIR}/Utilities/ParseOGLExt/headers/glext.h"
+set(VTK_GLEXT_FILE "${VTK_SOURCE_DIR}/Utilities/ParseOGLExt/headers/glext.h"
   CACHE FILEPATH
   "Location of the OpenGL extensions header file (glext.h).")
-SET(VTK_GLXEXT_FILE
+set(VTK_GLXEXT_FILE
   "${VTK_SOURCE_DIR}/Utilities/ParseOGLExt/headers/glxext.h" CACHE FILEPATH
   "Location of the GLX extensions header file (glxext.h).")
-SET(VTK_WGLEXT_FILE "${VTK_SOURCE_DIR}/Utilities/ParseOGLExt/headers/wglext.h"
+set(VTK_WGLEXT_FILE "${VTK_SOURCE_DIR}/Utilities/ParseOGLExt/headers/wglext.h"
   CACHE FILEPATH
   "Location of the WGL extensions header file (wglext.h).")
 
 # work around an old bug in VTK
-SET(TIFF_RIGHT_VERSION 1)
+set(TIFF_RIGHT_VERSION 1)
 
 # for very old VTK (versions prior to 4.2)
-MACRO(SOURCE_FILES)
+macro(SOURCE_FILES)
   message (FATAL_ERROR "You are trying to build a very old version of VTK (prior to VTK 4.2). To do this you need to use CMake 2.0 as it was the last version of CMake to support VTK 4.0.")
-ENDMACRO(SOURCE_FILES)
+endmacro(SOURCE_FILES)
 
diff --git a/Modules/kde3uic.cmake b/Modules/kde3uic.cmake
index 6f904ac92..4ad364b50 100644
--- a/Modules/kde3uic.cmake
+++ b/Modules/kde3uic.cmake
@@ -17,7 +17,7 @@
 # neundorf@kde.org
 
 
-EXECUTE_PROCESS(COMMAND ${KDE_UIC_EXECUTABLE}
+execute_process(COMMAND ${KDE_UIC_EXECUTABLE}
    -L ${KDE_UIC_PLUGIN_DIR} -nounload -tr tr2i18n
    -impl ${KDE_UIC_H_FILE}
    ${KDE_UIC_FILE}
@@ -25,9 +25,9 @@ EXECUTE_PROCESS(COMMAND ${KDE_UIC_EXECUTABLE}
    ERROR_QUIET
   )
 
-STRING(REGEX REPLACE "tr2i18n\\(\"\"\\)" "QString::null" _uic_CONTENTS "${_uic_CONTENTS}" )
-STRING(REGEX REPLACE "tr2i18n\\(\"\", \"\"\\)" "QString::null" _uic_CONTENTS "${_uic_CONTENTS}" )
+string(REGEX REPLACE "tr2i18n\\(\"\"\\)" "QString::null" _uic_CONTENTS "${_uic_CONTENTS}" )
+string(REGEX REPLACE "tr2i18n\\(\"\", \"\"\\)" "QString::null" _uic_CONTENTS "${_uic_CONTENTS}" )
 
-FILE(WRITE ${KDE_UIC_CPP_FILE} "#include <kdialog.h>\n#include <klocale.h>\n\n")
-FILE(APPEND ${KDE_UIC_CPP_FILE} "${_uic_CONTENTS}")
+file(WRITE ${KDE_UIC_CPP_FILE} "#include <kdialog.h>\n#include <klocale.h>\n\n")
+file(APPEND ${KDE_UIC_CPP_FILE} "${_uic_CONTENTS}")
 
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index e9c5a587e..106e78f12 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -9,33 +9,33 @@
 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 # See the License for more information.
 #=============================================================================
-INCLUDE(CheckIncludeFile)
+include(CheckIncludeFile)
 # Check if we can build support for ELF parsing.
 CHECK_INCLUDE_FILE("elf.h" HAVE_ELF_H)
-IF(HAVE_ELF_H)
-  SET(CMAKE_USE_ELF_PARSER 1)
-ELSE(HAVE_ELF_H)
-  SET(CMAKE_USE_ELF_PARSER)
-ENDIF(HAVE_ELF_H)
+if(HAVE_ELF_H)
+  set(CMAKE_USE_ELF_PARSER 1)
+else(HAVE_ELF_H)
+  set(CMAKE_USE_ELF_PARSER)
+endif(HAVE_ELF_H)
 
-SET(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR})
+set(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR})
 
 # configure the .h file
-CONFIGURE_FILE(
+configure_file(
   "${CMake_SOURCE_DIR}/Source/cmConfigure.cmake.h.in"
   "${CMake_BINARY_DIR}/Source/cmConfigure.h"
   )
-CONFIGURE_FILE(
+configure_file(
   "${CMake_SOURCE_DIR}/Source/cmVersionConfig.h.in"
   "${CMake_BINARY_DIR}/Source/cmVersionConfig.h"
   )
-CONFIGURE_FILE(
+configure_file(
   "${CMake_SOURCE_DIR}/Source/CPack/cmCPackConfigure.h.in"
   "${CMake_BINARY_DIR}/Source/CPack/cmCPackConfigure.h"
   )
 
 # add the include path to find the .h
-INCLUDE_DIRECTORIES(
+include_directories(
   "${CMake_BINARY_DIR}/Source"
   "${CMake_SOURCE_DIR}/Source"
   ${CMAKE_ZLIB_INCLUDES}
@@ -45,72 +45,72 @@ INCLUDE_DIRECTORIES(
   )
 
 # let cmake know it is supposed to use it
-ADD_DEFINITIONS(-DCMAKE_BUILD_WITH_CMAKE)
+add_definitions(-DCMAKE_BUILD_WITH_CMAKE)
 
-OPTION(CMAKE_REGENERATE_YACCLEX
+option(CMAKE_REGENERATE_YACCLEX
   "Regenerate YACC and LEXX files" OFF)
-MARK_AS_ADVANCED(CMAKE_REGENERATE_YACCLEX)
-IF(CMAKE_REGENERATE_YACCLEX)
-  SET(parsersLexers cmDependsFortran cmCommandArgument cmExpr)
-  FIND_PROGRAM(YACC_EXECUTABLE
+mark_as_advanced(CMAKE_REGENERATE_YACCLEX)
+if(CMAKE_REGENERATE_YACCLEX)
+  set(parsersLexers cmDependsFortran cmCommandArgument cmExpr)
+  find_program(YACC_EXECUTABLE
     NAMES yacc bison
     PATHS /usr/bin
     DOC "Yacc or Bison executable")
-  FIND_PROGRAM(FLEX_EXECUTABLE
+  find_program(FLEX_EXECUTABLE
     NAMES flex
     PATHS /usr/bin
     DOC "Flex executable")
-  MARK_AS_ADVANCED(YACC_EXECUTABLE FLEX_EXECUTABLE)
-  IF(YACC_EXECUTABLE)
-    SET(BISON_FLAGS)
-    IF(YACC_EXECUTABLE MATCHES "bison")
-      SET(BISON_FLAGS "--yacc")
-    ENDIF(YACC_EXECUTABLE MATCHES "bison")
-    SET(yacc_files)
-    FOREACH(name ${parsersLexers})
-      SET(src "${CMAKE_CURRENT_SOURCE_DIR}/${name}Parser.y")
-      SET(dst "${CMAKE_CURRENT_BINARY_DIR}/${name}Parser.cxx")
-      SET(hdr "${CMAKE_CURRENT_BINARY_DIR}/${name}ParserTokens.h")
-      ADD_CUSTOM_COMMAND(
+  mark_as_advanced(YACC_EXECUTABLE FLEX_EXECUTABLE)
+  if(YACC_EXECUTABLE)
+    set(BISON_FLAGS)
+    if(YACC_EXECUTABLE MATCHES "bison")
+      set(BISON_FLAGS "--yacc")
+    endif(YACC_EXECUTABLE MATCHES "bison")
+    set(yacc_files)
+    foreach(name ${parsersLexers})
+      set(src "${CMAKE_CURRENT_SOURCE_DIR}/${name}Parser.y")
+      set(dst "${CMAKE_CURRENT_BINARY_DIR}/${name}Parser.cxx")
+      set(hdr "${CMAKE_CURRENT_BINARY_DIR}/${name}ParserTokens.h")
+      add_custom_command(
         OUTPUT "${dst}"
         DEPENDS "${src}"
         COMMAND
         ${YACC_EXECUTABLE}
         --name-prefix=${name}_yy --defines=${hdr} -o${dst} ${src}
         )
-      SET(yacc_files ${yacc_files} "${dst}")
-    ENDFOREACH(name)
-    ADD_CUSTOM_TARGET(RerunYacc DEPENDS ${yacc_files})
-  ENDIF(YACC_EXECUTABLE)
-  IF(FLEX_EXECUTABLE)
-    SET(lex_files)
-    FOREACH(name ${parsersLexers})
-      SET(src "${CMAKE_CURRENT_SOURCE_DIR}/${name}Lexer.in.l")
-      SET(dst "${CMAKE_CURRENT_BINARY_DIR}/${name}Lexer.cxx")
-      SET(hdr "${CMAKE_CURRENT_BINARY_DIR}/${name}Lexer.h")
-      ADD_CUSTOM_COMMAND(
+      set(yacc_files ${yacc_files} "${dst}")
+    endforeach(name)
+    add_custom_target(RerunYacc DEPENDS ${yacc_files})
+  endif(YACC_EXECUTABLE)
+  if(FLEX_EXECUTABLE)
+    set(lex_files)
+    foreach(name ${parsersLexers})
+      set(src "${CMAKE_CURRENT_SOURCE_DIR}/${name}Lexer.in.l")
+      set(dst "${CMAKE_CURRENT_BINARY_DIR}/${name}Lexer.cxx")
+      set(hdr "${CMAKE_CURRENT_BINARY_DIR}/${name}Lexer.h")
+      add_custom_command(
         OUTPUT "${dst}"
         DEPENDS "${src}"
         COMMAND
         ${FLEX_EXECUTABLE}
         --prefix=${name}_yy --header-file=${hdr} -o${dst} ${src}
         )
-      SET(lex_files ${lex_files} "${dst}")
-    ENDFOREACH(name)
-    ADD_CUSTOM_TARGET(RerunLex DEPENDS ${lex_files})
-  ENDIF(FLEX_EXECUTABLE)
+      set(lex_files ${lex_files} "${dst}")
+    endforeach(name)
+    add_custom_target(RerunLex DEPENDS ${lex_files})
+  endif(FLEX_EXECUTABLE)
 
-ENDIF(CMAKE_REGENERATE_YACCLEX)
+endif(CMAKE_REGENERATE_YACCLEX)
 
 # Check if we can build the ELF parser.
-IF(CMAKE_USE_ELF_PARSER)
-  SET(ELF_SRCS cmELF.h cmELF.cxx)
-ENDIF(CMAKE_USE_ELF_PARSER)
+if(CMAKE_USE_ELF_PARSER)
+  set(ELF_SRCS cmELF.h cmELF.cxx)
+endif(CMAKE_USE_ELF_PARSER)
 
 #
 # Sources for CMakeLib
 #
-SET(SRCS
+set(SRCS
   cmStandardIncludes.cxx
   cmArchiveWrite.cxx
   cmBootstrapCommands.cxx
@@ -275,30 +275,30 @@ SET(SRCS
   )
 
 # Kdevelop only works on UNIX and not windows
-IF(UNIX)
-  SET(SRCS ${SRCS} cmGlobalKdevelopGenerator.cxx)
-ENDIF(UNIX)
+if(UNIX)
+  set(SRCS ${SRCS} cmGlobalKdevelopGenerator.cxx)
+endif(UNIX)
 
 # Xcode only works on Apple
-IF(APPLE)
-  SET(SRCS ${SRCS}
+if(APPLE)
+  set(SRCS ${SRCS}
     cmXCodeObject.cxx
     cmXCode21Object.cxx
     cmGlobalXCodeGenerator.cxx
     cmGlobalXCodeGenerator.h
     cmLocalXCodeGenerator.cxx
     cmLocalXCodeGenerator.h)
-ENDIF(APPLE)
+endif(APPLE)
 
 
-IF (WIN32)
-  SET(SRCS ${SRCS}
+if (WIN32)
+  set(SRCS ${SRCS}
     cmCallVisualStudioMacro.cxx
     cmCallVisualStudioMacro.h
     )
 
-  IF(NOT UNIX)
-    SET(SRCS ${SRCS}
+  if(NOT UNIX)
+    set(SRCS ${SRCS}
       cmGlobalBorlandMakefileGenerator.cxx
       cmGlobalBorlandMakefileGenerator.h
       cmGlobalMSYSMakefileGenerator.cxx
@@ -356,11 +356,11 @@ IF (WIN32)
       cmWin32ProcessExecution.cxx
       cmWin32ProcessExecution.h
       )
-  ENDIF(NOT UNIX)
-ENDIF (WIN32)
+  endif(NOT UNIX)
+endif (WIN32)
 
 # Ninja support
-SET(SRCS ${SRCS}
+set(SRCS ${SRCS}
   cmGlobalNinjaGenerator.cxx
   cmGlobalNinjaGenerator.h
   cmNinjaTypes.h
@@ -373,34 +373,34 @@ SET(SRCS ${SRCS}
   cmNinjaUtilityTargetGenerator.cxx
   cmNinjaUtilityTargetGenerator.h
   )
-IF(WIN32 AND NOT CYGWIN AND NOT BORLAND)
-  SET_SOURCE_FILES_PROPERTIES(cmcldeps.cxx PROPERTIES COMPILE_DEFINITIONS _WIN32_WINNT=0x0501)
-  ADD_EXECUTABLE(cmcldeps cmcldeps.cxx)
-  TARGET_LINK_LIBRARIES(cmcldeps CMakeLib)
-  INSTALL_TARGETS(/bin cmcldeps)
-ENDIF()
+if(WIN32 AND NOT CYGWIN AND NOT BORLAND)
+  set_source_files_properties(cmcldeps.cxx PROPERTIES COMPILE_DEFINITIONS _WIN32_WINNT=0x0501)
+  add_executable(cmcldeps cmcldeps.cxx)
+  target_link_libraries(cmcldeps CMakeLib)
+  install_targets(/bin cmcldeps)
+endif()
 
 # create a library used by the command line and the GUI
-ADD_LIBRARY(CMakeLib ${SRCS})
-TARGET_LINK_LIBRARIES(CMakeLib cmsys
+add_library(CMakeLib ${SRCS})
+target_link_libraries(CMakeLib cmsys
   ${CMAKE_EXPAT_LIBRARIES} ${CMAKE_ZLIB_LIBRARIES}
   ${CMAKE_TAR_LIBRARIES} ${CMAKE_COMPRESS_LIBRARIES}
   ${CMAKE_CURL_LIBRARIES} )
 
 # On Apple we need CoreFoundation
-IF(APPLE)
-  TARGET_LINK_LIBRARIES(CMakeLib "-framework CoreFoundation")
-ENDIF(APPLE)
+if(APPLE)
+  target_link_libraries(CMakeLib "-framework CoreFoundation")
+endif(APPLE)
 
 # On some platforms we need the rpcrt4 library for the VS 7 generators.
-IF(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW)
-  TARGET_LINK_LIBRARIES(CMakeLib rpcrt4)
-ENDIF(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW)
+if(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW)
+  target_link_libraries(CMakeLib rpcrt4)
+endif(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW)
 
 #
 # CTestLib
 #
-INCLUDE_DIRECTORIES(
+include_directories(
   "${CMake_SOURCE_DIR}/Source/CTest"
   ${CMAKE_XMLRPC_INCLUDES}
   ${CMAKE_CURL_INCLUDES}
@@ -408,7 +408,7 @@ INCLUDE_DIRECTORIES(
 #
 # Sources for CTestLib
 #
-SET(CTEST_SRCS cmCTest.cxx
+set(CTEST_SRCS cmCTest.cxx
   CTest/cmProcess.cxx
   CTest/cmCTestBatchTestHandler.cxx
   CTest/cmCTestBuildAndTestHandler.cxx
@@ -461,13 +461,13 @@ SET(CTEST_SRCS cmCTest.cxx
   )
 
 # Build CTestLib
-ADD_LIBRARY(CTestLib ${CTEST_SRCS})
-TARGET_LINK_LIBRARIES(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES})
+add_library(CTestLib ${CTEST_SRCS})
+target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES})
 
 #
 # Sources for CPack
 #
-SET(CPACK_SRCS
+set(CPACK_SRCS
   CPack/cmCPackArchiveGenerator.cxx
   CPack/cmCPackComponentGroup.cxx
   CPack/cmCPackGeneratorFactory.cxx
@@ -483,82 +483,82 @@ SET(CPACK_SRCS
   CPack/cmCPackDocumentMacros.cxx
   )
 
-IF(CYGWIN)
-  SET(CPACK_SRCS ${CPACK_SRCS}
+if(CYGWIN)
+  set(CPACK_SRCS ${CPACK_SRCS}
     CPack/cmCPackCygwinBinaryGenerator.cxx
     CPack/cmCPackCygwinSourceGenerator.cxx
     )
-ENDIF(CYGWIN)
+endif(CYGWIN)
 
-IF(UNIX)
-  SET(CPACK_SRCS ${CPACK_SRCS}
+if(UNIX)
+  set(CPACK_SRCS ${CPACK_SRCS}
     CPack/cmCPackDebGenerator.cxx
     CPack/cmCPackRPMGenerator.cxx
     )
-ENDIF(UNIX)
+endif(UNIX)
 
-IF(APPLE)
-  SET(CPACK_SRCS ${CPACK_SRCS}
+if(APPLE)
+  set(CPACK_SRCS ${CPACK_SRCS}
     CPack/cmCPackBundleGenerator.cxx
     CPack/cmCPackDragNDropGenerator.cxx
     CPack/cmCPackOSXX11Generator.cxx
     CPack/cmCPackPackageMakerGenerator.cxx
     )
-ENDIF(APPLE)
+endif(APPLE)
 
 # Build CPackLib
-ADD_LIBRARY(CPackLib ${CPACK_SRCS})
-TARGET_LINK_LIBRARIES(CPackLib CMakeLib)
+add_library(CPackLib ${CPACK_SRCS})
+target_link_libraries(CPackLib CMakeLib)
 
-IF(APPLE)
-  ADD_EXECUTABLE(cmakexbuild cmakexbuild.cxx)
-  TARGET_LINK_LIBRARIES(cmakexbuild CMakeLib)
-  ADD_EXECUTABLE(OSXScriptLauncher
+if(APPLE)
+  add_executable(cmakexbuild cmakexbuild.cxx)
+  target_link_libraries(cmakexbuild CMakeLib)
+  add_executable(OSXScriptLauncher
     CPack/OSXScriptLauncher.cxx)
-  TARGET_LINK_LIBRARIES(OSXScriptLauncher cmsys)
-  TARGET_LINK_LIBRARIES(OSXScriptLauncher "-framework CoreFoundation")
-ENDIF(APPLE)
+  target_link_libraries(OSXScriptLauncher cmsys)
+  target_link_libraries(OSXScriptLauncher "-framework CoreFoundation")
+endif(APPLE)
 
 # Build CMake executable
-ADD_EXECUTABLE(cmake cmakemain.cxx)
-TARGET_LINK_LIBRARIES(cmake CMakeLib)
+add_executable(cmake cmakemain.cxx)
+target_link_libraries(cmake CMakeLib)
 
 # Build special executable for running programs on Windows 98
-IF(WIN32)
-  IF(NOT UNIX)
-    ADD_EXECUTABLE(cmw9xcom cmw9xcom.cxx)
-    TARGET_LINK_LIBRARIES(cmw9xcom CMakeLib)
-    INSTALL_TARGETS(/bin cmw9xcom)
-  ENDIF(NOT UNIX)
-ENDIF(WIN32)
+if(WIN32)
+  if(NOT UNIX)
+    add_executable(cmw9xcom cmw9xcom.cxx)
+    target_link_libraries(cmw9xcom CMakeLib)
+    install_targets(/bin cmw9xcom)
+  endif(NOT UNIX)
+endif(WIN32)
 
 # Build CTest executable
-ADD_EXECUTABLE(ctest ctest.cxx)
-TARGET_LINK_LIBRARIES(ctest CTestLib)
+add_executable(ctest ctest.cxx)
+target_link_libraries(ctest CTestLib)
 
 # Build CPack executable
-ADD_EXECUTABLE(cpack CPack/cpack.cxx)
-TARGET_LINK_LIBRARIES(cpack CPackLib)
+add_executable(cpack CPack/cpack.cxx)
+target_link_libraries(cpack CPackLib)
 
 # Curses GUI
-IF(BUILD_CursesDialog)
-  INCLUDE(${CMake_SOURCE_DIR}/Source/CursesDialog/CMakeLists.txt)
-ENDIF(BUILD_CursesDialog)
+if(BUILD_CursesDialog)
+  include(${CMake_SOURCE_DIR}/Source/CursesDialog/CMakeLists.txt)
+endif(BUILD_CursesDialog)
 
 # Qt GUI
-OPTION(BUILD_QtDialog "Build Qt dialog for CMake" FALSE)
-IF(BUILD_QtDialog)
-  SUBDIRS(QtDialog)
-ENDIF(BUILD_QtDialog)
+option(BUILD_QtDialog "Build Qt dialog for CMake" FALSE)
+if(BUILD_QtDialog)
+  subdirs(QtDialog)
+endif(BUILD_QtDialog)
 
-INCLUDE (${CMake_BINARY_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
-INCLUDE (${CMake_SOURCE_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
+include (${CMake_BINARY_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
+include (${CMake_SOURCE_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
 
-INSTALL_TARGETS(/bin cmake)
-INSTALL_TARGETS(/bin ctest)
-INSTALL_TARGETS(/bin cpack)
-IF(APPLE)
-  INSTALL_TARGETS(/bin cmakexbuild)
-ENDIF(APPLE)
+install_targets(/bin cmake)
+install_targets(/bin ctest)
+install_targets(/bin cpack)
+if(APPLE)
+  install_targets(/bin cmakexbuild)
+endif(APPLE)
 
-INSTALL_FILES(${CMAKE_DATA_DIR}/include cmCPluginAPI.h)
+install_files(${CMAKE_DATA_DIR}/include cmCPluginAPI.h)
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 01817226b..a18d8208c 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,6 +1,6 @@
 # CMake version number components.
-SET(CMake_VERSION_MAJOR 2)
-SET(CMake_VERSION_MINOR 8)
-SET(CMake_VERSION_PATCH 9)
-SET(CMake_VERSION_TWEAK 20120813)
-#SET(CMake_VERSION_RC 1)
+set(CMake_VERSION_MAJOR 2)
+set(CMake_VERSION_MINOR 8)
+set(CMake_VERSION_PATCH 9)
+set(CMake_VERSION_TWEAK 20120813)
+#set(CMake_VERSION_RC 1)
diff --git a/Source/CursesDialog/CMakeLists.txt b/Source/CursesDialog/CMakeLists.txt
index 3349ebe96..96e28b491 100644
--- a/Source/CursesDialog/CMakeLists.txt
+++ b/Source/CursesDialog/CMakeLists.txt
@@ -10,7 +10,7 @@
 # See the License for more information.
 #=============================================================================
 
-SET( CURSES_SRCS
+set( CURSES_SRCS
               CursesDialog/cmCursesBoolWidget
               CursesDialog/cmCursesCacheEntryComposite
               CursesDialog/cmCursesDummyWidget
@@ -25,13 +25,13 @@ SET( CURSES_SRCS
               CursesDialog/ccmake
    )
 
-INCLUDE_DIRECTORIES(${CMake_SOURCE_DIR}/Source/CursesDialog/form
+include_directories(${CMake_SOURCE_DIR}/Source/CursesDialog/form
                     ${CMake_BINARY_DIR}/Source/CursesDialog/form)
-INCLUDE_DIRECTORIES(${CURSES_INCLUDE_PATH})
+include_directories(${CURSES_INCLUDE_PATH})
 
 
-ADD_EXECUTABLE(ccmake ${CURSES_SRCS} )
-TARGET_LINK_LIBRARIES(ccmake CMakeLib)
-TARGET_LINK_LIBRARIES(ccmake cmForm)
+add_executable(ccmake ${CURSES_SRCS} )
+target_link_libraries(ccmake CMakeLib)
+target_link_libraries(ccmake cmForm)
 
-INSTALL_TARGETS(/bin ccmake)
+install_targets(/bin ccmake)
diff --git a/Source/CursesDialog/form/CMakeLists.txt b/Source/CursesDialog/form/CMakeLists.txt
index 2435f3935..d5cc1bd07 100644
--- a/Source/CursesDialog/form/CMakeLists.txt
+++ b/Source/CursesDialog/form/CMakeLists.txt
@@ -9,14 +9,14 @@
 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 # See the License for more information.
 #=============================================================================
-PROJECT(CMAKE_FORM)
+project(CMAKE_FORM)
 
-INCLUDE_REGULAR_EXPRESSION("^.*$")
-INCLUDE_DIRECTORIES(${CURSES_INCLUDE_PATH} "${CMAKE_CURRENT_BINARY_DIR}")
+include_regular_expression("^.*$")
+include_directories(${CURSES_INCLUDE_PATH} "${CMAKE_CURRENT_BINARY_DIR}")
 
-CONFIGURE_FILE(cmFormConfigure.h.in "${CMAKE_CURRENT_BINARY_DIR}/cmFormConfigure.h")
+configure_file(cmFormConfigure.h.in "${CMAKE_CURRENT_BINARY_DIR}/cmFormConfigure.h")
 
-SET(  FORM_SRCS
+set(  FORM_SRCS
              fld_arg.c
              fld_attr.c
              fld_current.c
@@ -58,9 +58,9 @@ SET(  FORM_SRCS
              fty_regex.c
    )
              
-INCLUDE_DIRECTORIES(${CMAKE_FORM_SOURCE_DIR})
-ADD_LIBRARY(cmForm ${FORM_SRCS} )
-TARGET_LINK_LIBRARIES(cmForm ${CURSES_LIBRARY})
-IF(CURSES_EXTRA_LIBRARY)
-  TARGET_LINK_LIBRARIES(cmForm ${CURSES_EXTRA_LIBRARY})
-ENDIF(CURSES_EXTRA_LIBRARY)
+include_directories(${CMAKE_FORM_SOURCE_DIR})
+add_library(cmForm ${FORM_SRCS} )
+target_link_libraries(cmForm ${CURSES_LIBRARY})
+if(CURSES_EXTRA_LIBRARY)
+  target_link_libraries(cmForm ${CURSES_EXTRA_LIBRARY})
+endif(CURSES_EXTRA_LIBRARY)
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index 07ec10674..d962d8d41 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -9,17 +9,17 @@
 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 # See the License for more information.
 #=============================================================================
-PROJECT(QtDialog)
-SET(QT_MIN_VERSION "4.4.0")
-FIND_PACKAGE(Qt4 REQUIRED)
+project(QtDialog)
+set(QT_MIN_VERSION "4.4.0")
+find_package(Qt4 REQUIRED)
 
-IF(NOT QT4_FOUND)
-  MESSAGE(SEND_ERROR "Failed to find Qt 4.4 or greater.")
-ELSE(NOT QT4_FOUND)
+if(NOT QT4_FOUND)
+  message(SEND_ERROR "Failed to find Qt 4.4 or greater.")
+else(NOT QT4_FOUND)
 
-  INCLUDE(${QT_USE_FILE})
-  SET(CMAKE_PACKAGE_QTGUI TRUE)
-  SET(SRCS
+  include(${QT_USE_FILE})
+  set(CMAKE_PACKAGE_QTGUI TRUE)
+  set(SRCS
     AddCacheEntry.cxx
     AddCacheEntry.h
     CMakeSetup.cxx
@@ -55,53 +55,53 @@ ELSE(NOT QT4_FOUND)
     )
   QT4_ADD_RESOURCES(RC_SRCS CMakeSetup.qrc)
 
-  SET(SRCS ${SRCS} ${UI_SRCS} ${MOC_SRCS} ${RC_SRCS})
-  IF(Q_WS_WIN)
-    SET(SRCS ${SRCS} CMakeSetup.rc)
-  ENDIF(Q_WS_WIN)
-  IF(Q_WS_MAC)
-    SET(SRCS ${SRCS} CMakeSetup.icns)
-    SET(MACOSX_BUNDLE_ICON_FILE CMakeSetup.icns)
-    SET_SOURCE_FILES_PROPERTIES(CMakeSetup.icns PROPERTIES
+  set(SRCS ${SRCS} ${UI_SRCS} ${MOC_SRCS} ${RC_SRCS})
+  if(Q_WS_WIN)
+    set(SRCS ${SRCS} CMakeSetup.rc)
+  endif(Q_WS_WIN)
+  if(Q_WS_MAC)
+    set(SRCS ${SRCS} CMakeSetup.icns)
+    set(MACOSX_BUNDLE_ICON_FILE CMakeSetup.icns)
+    set_source_files_properties(CMakeSetup.icns PROPERTIES
       MACOSX_PACKAGE_LOCATION Resources)
-  ENDIF(Q_WS_MAC)
+  endif(Q_WS_MAC)
 
-  INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
-  INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
+  include_directories(${CMAKE_CURRENT_BINARY_DIR})
+  include_directories(${CMAKE_CURRENT_SOURCE_DIR})
 
-  ADD_EXECUTABLE(cmake-gui WIN32 MACOSX_BUNDLE ${SRCS})
-  TARGET_LINK_LIBRARIES(cmake-gui CMakeLib ${QT_QTMAIN_LIBRARY} ${QT_LIBRARIES})
-  IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4)
-    IF(APPLE)
-      SET_TARGET_PROPERTIES(cmake-gui PROPERTIES
+  add_executable(cmake-gui WIN32 MACOSX_BUNDLE ${SRCS})
+  target_link_libraries(cmake-gui CMakeLib ${QT_QTMAIN_LIBRARY} ${QT_LIBRARIES})
+  if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4)
+    if(APPLE)
+      set_target_properties(cmake-gui PROPERTIES
        OUTPUT_NAME ${CMAKE_BUNDLE_NAME})
-    ENDIF(APPLE)
-    SET(CMAKE_INSTALL_DESTINATION_ARGS
+    endif(APPLE)
+    set(CMAKE_INSTALL_DESTINATION_ARGS
       BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}")
-  ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4)
+  endif(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4)
 
-  INSTALL(TARGETS cmake-gui RUNTIME DESTINATION bin ${CMAKE_INSTALL_DESTINATION_ARGS})
+  install(TARGETS cmake-gui RUNTIME DESTINATION bin ${CMAKE_INSTALL_DESTINATION_ARGS})
 
-  IF(UNIX)
+  if(UNIX)
     # install a desktop file so CMake appears in the application start menu
     # with an icon
-    INSTALL(FILES CMake.desktop DESTINATION share/applications )
-    INSTALL(FILES CMakeSetup32.png DESTINATION share/pixmaps )
-    INSTALL(FILES cmakecache.xml DESTINATION share/mime/packages )
-  ENDIF(UNIX)
+    install(FILES CMake.desktop DESTINATION share/applications )
+    install(FILES CMakeSetup32.png DESTINATION share/pixmaps )
+    install(FILES cmakecache.xml DESTINATION share/mime/packages )
+  endif(UNIX)
 
-  IF(APPLE)
-    SET(CMAKE_POSTFLIGHT_SCRIPT
+  if(APPLE)
+    set(CMAKE_POSTFLIGHT_SCRIPT
       "${CMake_BINARY_DIR}/Source/QtDialog/postflight.sh")
-    SET(CMAKE_POSTUPGRADE_SCRIPT
+    set(CMAKE_POSTUPGRADE_SCRIPT
       "${CMake_BINARY_DIR}/Source/QtDialog/postupgrade.sh")
     configure_file("${CMake_SOURCE_DIR}/Source/QtDialog/postflight.sh.in"
       "${CMake_BINARY_DIR}/Source/QtDialog/postflight.sh")
     configure_file("${CMake_SOURCE_DIR}/Source/QtDialog/postupgrade.sh.in"
       "${CMake_BINARY_DIR}/Source/QtDialog/postupgrade.sh")
-    INSTALL(CODE "execute_process(COMMAND ln -s \"../MacOS/${CMAKE_BUNDLE_NAME}\" cmake-gui
+    install(CODE "execute_process(COMMAND ln -s \"../MacOS/${CMAKE_BUNDLE_NAME}\" cmake-gui
                   WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin)")
-  ENDIF(APPLE)
+  endif(APPLE)
 
   if(APPLE OR WIN32)
     # install rules for including 3rd party libs such as Qt
@@ -117,7 +117,7 @@ ELSE(NOT QT4_FOUND)
     ")
   endif(APPLE OR WIN32)
 
-  CONFIGURE_FILE("${QtDialog_SOURCE_DIR}/QtDialogCPack.cmake.in"
+  configure_file("${QtDialog_SOURCE_DIR}/QtDialogCPack.cmake.in"
     "${QtDialog_BINARY_DIR}/QtDialogCPack.cmake" @ONLY)
-ENDIF(NOT QT4_FOUND)
+endif(NOT QT4_FOUND)
 
diff --git a/Source/QtDialog/QtDialogCPack.cmake.in b/Source/QtDialog/QtDialogCPack.cmake.in
index e73e23f22..f43e1c33d 100644
--- a/Source/QtDialog/QtDialogCPack.cmake.in
+++ b/Source/QtDialog/QtDialogCPack.cmake.in
@@ -1,18 +1,18 @@
-SET(IS_APPLE @APPLE@)
-SET(CMAKE_PACKAGE_QTGUI @CMAKE_PACKAGE_QTGUI@)
+set(IS_APPLE @APPLE@)
+set(CMAKE_PACKAGE_QTGUI @CMAKE_PACKAGE_QTGUI@)
 
-IF(CMAKE_PACKAGE_QTGUI)
-  SET(CPACK_PACKAGE_EXECUTABLES "cmake-gui" "CMake (cmake-gui)" ${CPACK_PACKAGE_EXECUTABLES})
-  SET(CPACK_CREATE_DESKTOP_LINKS "cmake-gui" ${CPACK_CREATE_DESKTOP_LINKS})
-  IF(IS_APPLE)
+if(CMAKE_PACKAGE_QTGUI)
+  set(CPACK_PACKAGE_EXECUTABLES "cmake-gui" "CMake (cmake-gui)" ${CPACK_PACKAGE_EXECUTABLES})
+  set(CPACK_CREATE_DESKTOP_LINKS "cmake-gui" ${CPACK_CREATE_DESKTOP_LINKS})
+  if(IS_APPLE)
     # for apple install we set the install prefix to
     # / and then install
     # cmake into the bundle for cmake-gui and must use DESTDIR
-    SET(CPACK_SET_DESTDIR TRUE)
+    set(CPACK_SET_DESTDIR TRUE)
     # we also want to run post install stuff to setup command line
-    SET(CPACK_POSTFLIGHT_SCRIPT "@CMAKE_POSTFLIGHT_SCRIPT@")
-    SET(CPACK_POSTUPGRADE_SCRIPT "@CMAKE_POSTUPGRADE_SCRIPT@")
-  ENDIF(IS_APPLE)
-ENDIF(CMAKE_PACKAGE_QTGUI)
+    set(CPACK_POSTFLIGHT_SCRIPT "@CMAKE_POSTFLIGHT_SCRIPT@")
+    set(CPACK_POSTUPGRADE_SCRIPT "@CMAKE_POSTUPGRADE_SCRIPT@")
+  endif(IS_APPLE)
+endif(CMAKE_PACKAGE_QTGUI)
 
 
diff --git a/Templates/CMakeVisualStudio6Configurations.cmake b/Templates/CMakeVisualStudio6Configurations.cmake
index b8e797427..6355969ab 100644
--- a/Templates/CMakeVisualStudio6Configurations.cmake
+++ b/Templates/CMakeVisualStudio6Configurations.cmake
@@ -1,3 +1,3 @@
 # When the dll templates are changed, this list should be
 # updated with the list of possible configurations.
-SET(CMAKE_CONFIGURATION_TYPES Debug Release MinSizeRel RelWithDebInfo)
+set(CMAKE_CONFIGURATION_TYPES Debug Release MinSizeRel RelWithDebInfo)
diff --git a/Templates/CTestScript.cmake.in b/Templates/CTestScript.cmake.in
index 63bd26f47..5fb3529e4 100644
--- a/Templates/CTestScript.cmake.in
+++ b/Templates/CTestScript.cmake.in
@@ -1,26 +1,26 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
+cmake_minimum_required(VERSION 2.4)
 
 # This is a template for the CTest script for this system
 
-SET(CTEST_SITE                          "@SITE@")
-SET(CTEST_BUILD_NAME                    "@BUILDNAME@")
+set(CTEST_SITE                          "@SITE@")
+set(CTEST_BUILD_NAME                    "@BUILDNAME@")
 
 # ---
-SET(CTEST_SOURCE_DIRECTORY              "@CMAKE_SOURCE_DIR@")
-SET(CTEST_BINARY_DIRECTORY              "@CMAKE_BINARY_DIR@")
-SET(CTEST_UPDATE_COMMAND                "@UPDATE_COMMAND@")
-SET(CTEST_UPDATE_OPTIONS                "@UPDATE_OPTIONS@")
-SET(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
-SET(CTEST_BUILD_CONFIGURATION           "Release")
-#SET(CTEST_MEMORYCHECK_COMMAND           "@MEMORYCHECK_COMMAND@")
-#SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@")
-#SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS   "@MEMORYCHECK_COMMAND_OPTIONS@")
-#SET(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
-SET(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+set(CTEST_SOURCE_DIRECTORY              "@CMAKE_SOURCE_DIR@")
+set(CTEST_BINARY_DIRECTORY              "@CMAKE_BINARY_DIR@")
+set(CTEST_UPDATE_COMMAND                "@UPDATE_COMMAND@")
+set(CTEST_UPDATE_OPTIONS                "@UPDATE_OPTIONS@")
+set(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION           "Release")
+#set(CTEST_MEMORYCHECK_COMMAND           "@MEMORYCHECK_COMMAND@")
+#set(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@")
+#set(CTEST_MEMORYCHECK_COMMAND_OPTIONS   "@MEMORYCHECK_COMMAND_OPTIONS@")
+#set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
 
 #CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
 
-SET(CTEST_DROP_METHOD "@DROP_METHOD@")
+set(CTEST_DROP_METHOD "@DROP_METHOD@")
 
 CTEST_START(Experimental TRACK Weekly)
 CTEST_UPDATE(SOURCE "${CTEST_SOURCE_DIRECTORY}")
diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt
index ed8b8bf5d..a258de239 100644
--- a/Tests/BuildDepends/Project/CMakeLists.txt
+++ b/Tests/BuildDepends/Project/CMakeLists.txt
@@ -60,16 +60,16 @@ add_executable(bar bar.cxx
   )
 
 #-----------------------------------------------------------------------------
-IF("${CMAKE_GENERATOR}" MATCHES "Make")
+if("${CMAKE_GENERATOR}" MATCHES "Make")
   # Test the IMPLICIT_DEPENDS feature.
-  SET(ZOT_DEPENDS IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/dep.cxx)
-  SET(ZOT_CUSTOM_DEP
+  set(ZOT_DEPENDS IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/dep.cxx)
+  set(ZOT_CUSTOM_DEP
     IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/dep_custom.cxx)
-ELSE("${CMAKE_GENERATOR}" MATCHES "Make")
+else("${CMAKE_GENERATOR}" MATCHES "Make")
   # No IMPLICIT_DEPENDS...just depend directly.
-  SET(ZOT_DEPENDS DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/zot.hxx.in)
-  SET(ZOT_CUSTOM_DEP DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/zot_custom.hxx.in)
-ENDIF("${CMAKE_GENERATOR}" MATCHES "Make")
+  set(ZOT_DEPENDS DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/zot.hxx.in)
+  set(ZOT_CUSTOM_DEP DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/zot_custom.hxx.in)
+endif("${CMAKE_GENERATOR}" MATCHES "Make")
 add_custom_command(
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zot.hxx
   COMMAND ${CMAKE_COMMAND} -E copy
diff --git a/Tests/BundleGeneratorTest/CMakeLists.txt b/Tests/BundleGeneratorTest/CMakeLists.txt
index e1fc2c1d4..037df09c1 100644
--- a/Tests/BundleGeneratorTest/CMakeLists.txt
+++ b/Tests/BundleGeneratorTest/CMakeLists.txt
@@ -1,23 +1,23 @@
-PROJECT(BundleGeneratorTest)
+project(BundleGeneratorTest)
 
-CMAKE_MINIMUM_REQUIRED(VERSION 2.7)
+cmake_minimum_required(VERSION 2.7)
 
 # Build a shared library and install it in lib/
-ADD_LIBRARY(Library SHARED Library.cxx)
-INSTALL(TARGETS Library DESTINATION lib)
+add_library(Library SHARED Library.cxx)
+install(TARGETS Library DESTINATION lib)
 
 # Build an executable and install it in bin/
-ADD_EXECUTABLE(Executable Executable.cxx)
-TARGET_LINK_LIBRARIES(Executable Library)
-INSTALL(TARGETS Executable DESTINATION bin)
+add_executable(Executable Executable.cxx)
+target_link_libraries(Executable Library)
+install(TARGETS Executable DESTINATION bin)
 
 # Use the bundle-generator for packaging ...
-SET(CPACK_GENERATOR "Bundle")
-SET(CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/BundleIcon.icns")
-SET(CPACK_BUNDLE_NAME "BundleGeneratorTest")
-SET(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist")
-SET(CPACK_BUNDLE_STARTUP_COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/StartupCommand")
-SET(CPACK_PACKAGE_DESCRIPTION "Project for testing OSX bundle generation")
+set(CPACK_GENERATOR "Bundle")
+set(CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/BundleIcon.icns")
+set(CPACK_BUNDLE_NAME "BundleGeneratorTest")
+set(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist")
+set(CPACK_BUNDLE_STARTUP_COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/StartupCommand")
+set(CPACK_PACKAGE_DESCRIPTION "Project for testing OSX bundle generation")
 
 # The custom volume icon is a copy of the normal Mac OSX volume icon, but
 # on a white background. This is to differentiate it from the normal one
@@ -25,9 +25,9 @@ SET(CPACK_PACKAGE_DESCRIPTION "Project for testing OSX bundle generation")
 # visual inspection of the mounted volume... This was added when fixing
 # issue #7523...
 #
-SET(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/CustomVolumeIcon.icns")
+set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/CustomVolumeIcon.icns")
 
-SET(CPACK_PACKAGE_NAME "BundleGeneratorTest")
-SET(CPACK_PACKAGE_VERSION "0.1")
+set(CPACK_PACKAGE_NAME "BundleGeneratorTest")
+set(CPACK_PACKAGE_VERSION "0.1")
 
-INCLUDE(CPack)
+include(CPack)
diff --git a/Tests/BundleTest/BundleSubDir/CMakeLists.txt b/Tests/BundleTest/BundleSubDir/CMakeLists.txt
index 322b2a7d2..1921ce095 100644
--- a/Tests/BundleTest/BundleSubDir/CMakeLists.txt
+++ b/Tests/BundleTest/BundleSubDir/CMakeLists.txt
@@ -1,36 +1,36 @@
-ADD_CUSTOM_COMMAND(
+add_custom_command(
   OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist"
   COMMAND /bin/cp
   ARGS "${BundleTest_SOURCE_DIR}/randomResourceFile.plist.in"
   "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist")
 
-SET_SOURCE_FILES_PROPERTIES(
+set_source_files_properties(
   "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist"
   PROPERTIES
   MACOSX_PACKAGE_LOCATION Resources
   )
 
-SET_SOURCE_FILES_PROPERTIES(
+set_source_files_properties(
   "${BundleTest_SOURCE_DIR}/SomeRandomFile.txt"
   "${BundleTest_SOURCE_DIR}/../../ChangeLog.txt"
   PROPERTIES
   MACOSX_PACKAGE_LOCATION MacOS
   )
 
-ADD_EXECUTABLE(SecondBundle
+add_executable(SecondBundle
   MACOSX_BUNDLE
   "${BundleTest_SOURCE_DIR}/BundleTest.cxx"
   "${BundleTest_SOURCE_DIR}/SomeRandomFile.txt"
   "${BundleTest_SOURCE_DIR}/../../ChangeLog.txt"
   "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist"
   )
-TARGET_LINK_LIBRARIES(SecondBundle BundleTestLib)
+target_link_libraries(SecondBundle BundleTestLib)
 
 # Test bundle installation.
-INSTALL(TARGETS SecondBundle DESTINATION Applications)
+install(TARGETS SecondBundle DESTINATION Applications)
 
 # Test whether bundles respect the output name.  Since the library is
 # installed into a location that uses this output name this will fail if the
 # bundle does not respect the name.  Also the executable will not be found by
 # the test driver if this does not work.
-SET_TARGET_PROPERTIES(SecondBundle PROPERTIES OUTPUT_NAME SecondBundleExe)
+set_target_properties(SecondBundle PROPERTIES OUTPUT_NAME SecondBundleExe)
diff --git a/Tests/BundleTest/CMakeLists.txt b/Tests/BundleTest/CMakeLists.txt
index 5342f49bd..4fb65bfa6 100644
--- a/Tests/BundleTest/CMakeLists.txt
+++ b/Tests/BundleTest/CMakeLists.txt
@@ -1,28 +1,28 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(BundleTest)
-SET(MACOSX_BUNDLE_INFO_STRING "bundle_info_string")
-SET(CMAKE_MacOSX_Content_COMPILE_OBJECT "\"${CMAKE_COMMAND}\" -E copy_if_different <SOURCE> <OBJECT>")
+project(BundleTest)
+set(MACOSX_BUNDLE_INFO_STRING "bundle_info_string")
+set(CMAKE_MacOSX_Content_COMPILE_OBJECT "\"${CMAKE_COMMAND}\" -E copy_if_different <SOURCE> <OBJECT>")
 
-ADD_CUSTOM_COMMAND(
+add_custom_command(
   OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist"
   COMMAND /bin/cp
   ARGS "${CMAKE_CURRENT_SOURCE_DIR}/randomResourceFile.plist.in"
   "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist")
 
-SET_SOURCE_FILES_PROPERTIES(
+set_source_files_properties(
   "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist"
   PROPERTIES
   MACOSX_PACKAGE_LOCATION Resources
   )
 
-SET_SOURCE_FILES_PROPERTIES(
+set_source_files_properties(
   SomeRandomFile.txt
   "${BundleTest_SOURCE_DIR}/../../ChangeLog.txt"
   PROPERTIES
   MACOSX_PACKAGE_LOCATION MacOS
   )
 
-SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}/foobar")
+set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}/foobar")
 
 # Test building a bundle linking to a shared library where the
 # shared library links to CoreFoundation, but the executable does not
@@ -31,74 +31,74 @@ SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}/foobar")
 # if CMake's dependency chaining for libraries with "-framework
 # blah" style dependencies gets broken...
 #
-ADD_LIBRARY(BundleTestLib SHARED BundleLib.cxx)
-TARGET_LINK_LIBRARIES(BundleTestLib "-framework CoreFoundation")
+add_library(BundleTestLib SHARED BundleLib.cxx)
+target_link_libraries(BundleTestLib "-framework CoreFoundation")
 
-ADD_EXECUTABLE(BundleTest
+add_executable(BundleTest
   MACOSX_BUNDLE
   BundleTest.cxx
   SomeRandomFile.txt
   "${BundleTest_SOURCE_DIR}/../../ChangeLog.txt"
   "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist"
   )
-TARGET_LINK_LIBRARIES(BundleTest BundleTestLib)
+target_link_libraries(BundleTest BundleTestLib)
 #
-# DO NOT: TARGET_LINK_LIBRARIES(BundleTest "-framework CoreFoundation")
+# DO NOT: target_link_libraries(BundleTest "-framework CoreFoundation")
 #   (see above comments about CoreFoundation)
 #
 
 # Test bundle installation.
-#INSTALL(TARGETS BundleTestLib DESTINATION Applications/BundleTestExe.app/Contents/Plugins)
-INSTALL(TARGETS BundleTestLib DESTINATION Applications/SecondBundleExe.app/Contents/Plugins)
-INSTALL(TARGETS BundleTest DESTINATION Applications)
+#install(TARGETS BundleTestLib DESTINATION Applications/BundleTestExe.app/Contents/Plugins)
+install(TARGETS BundleTestLib DESTINATION Applications/SecondBundleExe.app/Contents/Plugins)
+install(TARGETS BundleTest DESTINATION Applications)
 
 # Test whether bundles respect the output name.  Since the library is
 # installed into a location that uses this output name this will fail if the
 # bundle does not respect the name.  Also the executable will not be found by
 # the test driver if this does not work.
-SET_TARGET_PROPERTIES(BundleTest PROPERTIES OUTPUT_NAME BundleTestExe)
+set_target_properties(BundleTest PROPERTIES OUTPUT_NAME BundleTestExe)
 
 # Test executable versioning if it is supported.
-IF(NOT XCODE)
-  SET_TARGET_PROPERTIES(BundleTest PROPERTIES VERSION 1)
-ENDIF(NOT XCODE)
+if(NOT XCODE)
+  set_target_properties(BundleTest PROPERTIES VERSION 1)
+endif(NOT XCODE)
 
 # Make sure the executable can find its installed library.
-SET_TARGET_PROPERTIES(BundleTestLib PROPERTIES
+set_target_properties(BundleTestLib PROPERTIES
   INSTALL_NAME_DIR "@executable_path/../Plugins")
 
-INCLUDE(CPack)
+include(CPack)
 
 # test the framework find stuff
-IF(EXISTS /usr/lib/libtcl.dylib
+if(EXISTS /usr/lib/libtcl.dylib
     AND EXISTS /System/Library/Frameworks/Tcl.framework)
-  SET(TCL NOTFOUND)
-  FIND_LIBRARY(TCL tcl)
-  MESSAGE("frame: ${TCL}")
-  IF(NOT "${TCL}" MATCHES .framework)
-    MESSAGE(FATAL_ERROR "Could not find tcl framework, found ${TCL}")
-  ENDIF(NOT "${TCL}" MATCHES .framework)
-  SET(TCL NOTFOUND)
-  SET(CMAKE_FIND_FRAMEWORK LAST)
-  FIND_LIBRARY(TCL tcl)
-  IF("${TCL}" MATCHES .framework)
-    MESSAGE(FATAL_ERROR "Found framework and should have found dylib ${TCL}")
-  ENDIF("${TCL}" MATCHES .framework)
-  SET(TCL NOTFOUND)
-  SET(CMAKE_FIND_FRAMEWORK NEVER)
-  FIND_LIBRARY(TCL tcl)
-  IF("${TCL}" MATCHES .framework)
-    MESSAGE(FATAL_ERROR "Found framework and should have found dylib ${TCL}")
-  ENDIF("${TCL}" MATCHES .framework)
-  MESSAGE("not frame: ${TCL}")
-  SET(TCL NOTFOUND)
-  SET(CMAKE_FIND_FRAMEWORK FIRST)
-  FIND_LIBRARY(TCL tcl)
-  IF(NOT "${TCL}" MATCHES .framework)
-    MESSAGE(FATAL_ERROR "Could not find tcl framework, found ${TCL}")
-  ENDIF(NOT "${TCL}" MATCHES .framework)
-  MESSAGE("frame: ${TCL}")
-ENDIF(EXISTS /usr/lib/libtcl.dylib
+  set(TCL NOTFOUND)
+  find_library(TCL tcl)
+  message("frame: ${TCL}")
+  if(NOT "${TCL}" MATCHES .framework)
+    message(FATAL_ERROR "Could not find tcl framework, found ${TCL}")
+  endif(NOT "${TCL}" MATCHES .framework)
+  set(TCL NOTFOUND)
+  set(CMAKE_FIND_FRAMEWORK LAST)
+  find_library(TCL tcl)
+  if("${TCL}" MATCHES .framework)
+    message(FATAL_ERROR "Found framework and should have found dylib ${TCL}")
+  endif("${TCL}" MATCHES .framework)
+  set(TCL NOTFOUND)
+  set(CMAKE_FIND_FRAMEWORK NEVER)
+  find_library(TCL tcl)
+  if("${TCL}" MATCHES .framework)
+    message(FATAL_ERROR "Found framework and should have found dylib ${TCL}")
+  endif("${TCL}" MATCHES .framework)
+  message("not frame: ${TCL}")
+  set(TCL NOTFOUND)
+  set(CMAKE_FIND_FRAMEWORK FIRST)
+  find_library(TCL tcl)
+  if(NOT "${TCL}" MATCHES .framework)
+    message(FATAL_ERROR "Could not find tcl framework, found ${TCL}")
+  endif(NOT "${TCL}" MATCHES .framework)
+  message("frame: ${TCL}")
+endif(EXISTS /usr/lib/libtcl.dylib
   AND EXISTS /System/Library/Frameworks/Tcl.framework)
 
-SUBDIRS(BundleSubDir)
+subdirs(BundleSubDir)
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 27ae3a072..70d4171fb 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1,9 +1,9 @@
 # a macro for tests that have a simple format where the name matches the
 # directory and project
-MACRO(ADD_TEST_MACRO NAME COMMAND)
-  STRING(REPLACE "." "/" dir "${NAME}")
-  STRING(REGEX REPLACE "[^.]*\\." "" proj "${NAME}")
-  ADD_TEST(${NAME} ${CMAKE_CTEST_COMMAND}
+macro(ADD_TEST_MACRO NAME COMMAND)
+  string(REPLACE "." "/" dir "${NAME}")
+  string(REGEX REPLACE "[^.]*\\." "" proj "${NAME}")
+  add_test(${NAME} ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/${dir}"
     "${CMake_BINARY_DIR}/Tests/${dir}"
@@ -13,69 +13,69 @@ MACRO(ADD_TEST_MACRO NAME COMMAND)
     --build-project ${proj}
     ${${NAME}_EXTRA_OPTIONS}
     --test-command ${COMMAND} ${ARGN})
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${dir}")
-ENDMACRO(ADD_TEST_MACRO)
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${dir}")
+endmacro(ADD_TEST_MACRO)
 
-MACRO(REGEX_ESCAPE_STRING _OUT _IN)
+macro(REGEX_ESCAPE_STRING _OUT _IN)
     # Escape special regex metacharacters with a backslash
     string(REGEX REPLACE "([$^.[|*+?()]|])" "\\\\\\1" ${_OUT} "${_IN}")
-ENDMACRO(REGEX_ESCAPE_STRING _OUT _IN)
+endmacro(REGEX_ESCAPE_STRING _OUT _IN)
 
-INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CheckFortran.cmake)
+include(${CMAKE_CURRENT_SOURCE_DIR}/CheckFortran.cmake)
 
 # Fake a user home directory to avoid polluting the real one.
-IF(DEFINED ENV{HOME} AND NOT CTEST_NO_TEST_HOME)
-  SET(TEST_HOME "${CMake_BINARY_DIR}/Tests/CMakeFiles/TestHome")
-  FILE(MAKE_DIRECTORY "${TEST_HOME}")
-  FILE(WRITE "${TEST_HOME}/.cvspass" ":pserver:anoncvs@www.cmake.org:/cvsroot/KWSys A\n")
-  SET(TEST_HOME_ENV_CODE "# Fake a user home directory to avoid polluting the real one.
+if(DEFINED ENV{HOME} AND NOT CTEST_NO_TEST_HOME)
+  set(TEST_HOME "${CMake_BINARY_DIR}/Tests/CMakeFiles/TestHome")
+  file(MAKE_DIRECTORY "${TEST_HOME}")
+  file(WRITE "${TEST_HOME}/.cvspass" ":pserver:anoncvs@www.cmake.org:/cvsroot/KWSys A\n")
+  set(TEST_HOME_ENV_CODE "# Fake a user home directory to avoid polluting the real one.
 # But provide original ENV{HOME} value in ENV{CTEST_REAL_HOME} for tests that
 # need access to the real HOME directory.
-SET(ENV{CTEST_REAL_HOME} \"\$ENV{HOME}\")
-SET(ENV{HOME} \"${TEST_HOME}\")
+set(ENV{CTEST_REAL_HOME} \"\$ENV{HOME}\")
+set(ENV{HOME} \"${TEST_HOME}\")
 ")
-ENDIF()
+endif()
 
 # Choose a default configuration for CTest tests.
-SET(CTestTest_CONFIG Debug)
-IF(NOT CMAKE_CONFIGURATION_TYPES AND CMAKE_BUILD_TYPE)
-  SET(CTestTest_CONFIG ${CMAKE_BUILD_TYPE})
-ENDIF()
+set(CTestTest_CONFIG Debug)
+if(NOT CMAKE_CONFIGURATION_TYPES AND CMAKE_BUILD_TYPE)
+  set(CTestTest_CONFIG ${CMAKE_BUILD_TYPE})
+endif()
 
-CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/EnforceConfig.cmake.in
+configure_file(${CMake_SOURCE_DIR}/Tests/EnforceConfig.cmake.in
                ${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake @ONLY)
 
 # Testing
-IF(BUILD_TESTING)
-  IF("${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles" OR ("${CMAKE_TEST_GENERATOR}" MATCHES Ninja AND NOT WIN32))
-    SET(TEST_CompileCommandOutput 1)
-  ENDIF()
+if(BUILD_TESTING)
+  if("${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles" OR ("${CMAKE_TEST_GENERATOR}" MATCHES Ninja AND NOT WIN32))
+    set(TEST_CompileCommandOutput 1)
+  endif()
 
-  ADD_SUBDIRECTORY(CMakeLib)
-  ADD_SUBDIRECTORY(CMakeOnly)
-  ADD_SUBDIRECTORY(RunCMake)
+  add_subdirectory(CMakeLib)
+  add_subdirectory(CMakeOnly)
+  add_subdirectory(RunCMake)
 
-  ADD_SUBDIRECTORY(FindPackageModeMakefileTest)
+  add_subdirectory(FindPackageModeMakefileTest)
 
   # Collect a list of all test build directories.
-  SET(TEST_BUILD_DIRS)
+  set(TEST_BUILD_DIRS)
 
   # Should the long tests be run?
-  OPTION(CMAKE_RUN_LONG_TESTS
+  option(CMAKE_RUN_LONG_TESTS
     "Should the long tests be run (such as Bootstrap)." ON)
-  MARK_AS_ADVANCED(CMAKE_RUN_LONG_TESTS)
+  mark_as_advanced(CMAKE_RUN_LONG_TESTS)
 
-  IF (CMAKE_RUN_LONG_TESTS)
-    OPTION(CTEST_TEST_CTEST
+  if (CMAKE_RUN_LONG_TESTS)
+    option(CTEST_TEST_CTEST
       "Should the tests that run a full sub ctest process be run?"
       OFF)
-    MARK_AS_ADVANCED(CTEST_TEST_CTEST)
+    mark_as_advanced(CTEST_TEST_CTEST)
 
-    OPTION(TEST_KDE4_STABLE_BRANCH
+    option(TEST_KDE4_STABLE_BRANCH
       "Should the KDE4 stable branch test be run?"
       OFF)
-    MARK_AS_ADVANCED(TEST_KDE4_STABLE_BRANCH)
-  ENDIF (CMAKE_RUN_LONG_TESTS)
+    mark_as_advanced(TEST_KDE4_STABLE_BRANCH)
+  endif (CMAKE_RUN_LONG_TESTS)
 
   # Should tests that use CVS be run?
   #
@@ -108,35 +108,35 @@ IF(BUILD_TESTING)
   # well-known bug in kwsys process execution that I would love to get
   # time to fix.
   #
-  OPTION(CTEST_TEST_CPACK
+  option(CTEST_TEST_CPACK
     "Should the tests that use '--build-target package' be run?"
     ON)
-  MARK_AS_ADVANCED(CTEST_TEST_CPACK)
-  SET(CTEST_TEST_OSX_ARCH 0)
-  IF(APPLE)
-    EXECUTE_PROCESS(
+  mark_as_advanced(CTEST_TEST_CPACK)
+  set(CTEST_TEST_OSX_ARCH 0)
+  if(APPLE)
+    execute_process(
       COMMAND sw_vers -productVersion
       OUTPUT_VARIABLE OSX_VERSION
       OUTPUT_STRIP_TRAILING_WHITESPACE
       )
-    IF(OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]")
-      MESSAGE(STATUS "Forcing CTEST_TEST_CPACK=OFF on OSX < 10.4")
-      MESSAGE(STATUS "OSX_VERSION='${OSX_VERSION}'")
-      SET(CTEST_TEST_CPACK OFF)
-    ELSE(OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]")
-      SET(CTEST_TEST_OSX_ARCH 1)
-    ENDIF(OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]")
-  ENDIF(APPLE)
+    if(OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]")
+      message(STATUS "Forcing CTEST_TEST_CPACK=OFF on OSX < 10.4")
+      message(STATUS "OSX_VERSION='${OSX_VERSION}'")
+      set(CTEST_TEST_CPACK OFF)
+    else(OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]")
+      set(CTEST_TEST_OSX_ARCH 1)
+    endif(OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]")
+  endif(APPLE)
 
   # Use 1500 or CTEST_TEST_TIMEOUT for long test timeout value,
   # whichever is greater.
-  SET(CMAKE_LONG_TEST_TIMEOUT 1500)
-  IF(CTEST_TEST_TIMEOUT)
-    SET(CMAKE_LONG_TEST_TIMEOUT ${CTEST_TEST_TIMEOUT})
-  ENDIF(CTEST_TEST_TIMEOUT)
-  IF(CMAKE_LONG_TEST_TIMEOUT LESS 1500)
-    SET(CMAKE_LONG_TEST_TIMEOUT 1500)
-  ENDIF(CMAKE_LONG_TEST_TIMEOUT LESS 1500)
+  set(CMAKE_LONG_TEST_TIMEOUT 1500)
+  if(CTEST_TEST_TIMEOUT)
+    set(CMAKE_LONG_TEST_TIMEOUT ${CTEST_TEST_TIMEOUT})
+  endif(CTEST_TEST_TIMEOUT)
+  if(CMAKE_LONG_TEST_TIMEOUT LESS 1500)
+    set(CMAKE_LONG_TEST_TIMEOUT 1500)
+  endif(CMAKE_LONG_TEST_TIMEOUT LESS 1500)
 
   # add a bunch of standard build-and-test style tests
   ADD_TEST_MACRO(CommandLineTest CommandLineTest)
@@ -148,53 +148,53 @@ IF(BUILD_TESTING)
   ADD_TEST_MACRO(SystemInformation SystemInformation)
   ADD_TEST_MACRO(MathTest MathTest)
   # assume no resources building to test
-  SET(TEST_RESOURCES FALSE)
+  set(TEST_RESOURCES FALSE)
   # for windows and cygwin assume we have resources
-  IF(WIN32 OR CYGWIN)
-    SET(TEST_RESOURCES TRUE)
-  ENDIF()
+  if(WIN32 OR CYGWIN)
+    set(TEST_RESOURCES TRUE)
+  endif()
   # for borland and watcom there is no resource support
-  IF("${CMAKE_TEST_GENERATOR}" MATCHES "WMake" OR
+  if("${CMAKE_TEST_GENERATOR}" MATCHES "WMake" OR
       "${CMAKE_TEST_GENERATOR}" MATCHES "Borland")
-    SET(TEST_RESOURCES FALSE)
-  ENDIF()
-  IF(TEST_RESOURCES)
+    set(TEST_RESOURCES FALSE)
+  endif()
+  if(TEST_RESOURCES)
     ADD_TEST_MACRO(VSResource VSResource)
-  ENDIF()
+  endif()
   ADD_TEST_MACRO(Simple Simple)
   ADD_TEST_MACRO(PreOrder PreOrder)
   ADD_TEST_MACRO(MissingSourceFile MissingSourceFile)
-  SET_TESTS_PROPERTIES(MissingSourceFile PROPERTIES
+  set_tests_properties(MissingSourceFile PROPERTIES
     PASS_REGULAR_EXPRESSION "CMake Error at CMakeLists.txt:3 \\(add_executable\\):[ \r\n]*Cannot find source file:[ \r\n]*DoesNotExist/MissingSourceFile.c")
-  IF(CMAKE_Fortran_COMPILER)
+  if(CMAKE_Fortran_COMPILER)
     ADD_TEST_MACRO(FortranOnly FortranOnly)
-  ENDIF()
+  endif()
   # test Visual Studio GNU Fortran mixing with cmake_add_fortran_subdirectory
   # run this project if we have a working fortran compiler or
   # the test is enabled with CMAKE_TEST_CMAKE_ADD_FORTRAN cache variable.
   # If you enable the test, CMake should find the MinGW fortran install,
   # or in some cases you might need to set the PATH so that cmake can find
   # the gfortran from mingw.
-  IF(CMAKE_Fortran_COMPILER OR CMAKE_TEST_CMAKE_ADD_FORTRAN)
-    SET(CMAKE_SKIP_VSGNUFortran FALSE)
+  if(CMAKE_Fortran_COMPILER OR CMAKE_TEST_CMAKE_ADD_FORTRAN)
+    set(CMAKE_SKIP_VSGNUFortran FALSE)
     # disable test for apple builds using ifort if they are building
     # more than one architecture, as ifort does not support that.
-    IF(APPLE AND (CMAKE_Fortran_COMPILER MATCHES ifort))
-      LIST(LENGTH CMAKE_OSX_ARCHITECTURES len)
-      IF("${len}" GREATER 1)
-        MESSAGE(STATUS "Skip VSGNUFortran for ifort dual cpu mac build")
-        SET(CMAKE_SKIP_VSGNUFortran TRUE)
-      ENDIF()
-    ENDIF()
-    IF((CMAKE_C_COMPILER MATCHES lsb)
+    if(APPLE AND (CMAKE_Fortran_COMPILER MATCHES ifort))
+      list(LENGTH CMAKE_OSX_ARCHITECTURES len)
+      if("${len}" GREATER 1)
+        message(STATUS "Skip VSGNUFortran for ifort dual cpu mac build")
+        set(CMAKE_SKIP_VSGNUFortran TRUE)
+      endif()
+    endif()
+    if((CMAKE_C_COMPILER MATCHES lsb)
         AND (CMAKE_Fortran_COMPILER MATCHES ifort))
-      MESSAGE(STATUS "Skip VSGNUFortran for ifort and lsb compilers")
-      SET(CMAKE_SKIP_VSGNUFortran TRUE)
-    ENDIF()
-    IF(NOT CMAKE_SKIP_VSGNUFortran)
+      message(STATUS "Skip VSGNUFortran for ifort and lsb compilers")
+      set(CMAKE_SKIP_VSGNUFortran TRUE)
+    endif()
+    if(NOT CMAKE_SKIP_VSGNUFortran)
       ADD_TEST_MACRO(VSGNUFortran ${CMAKE_COMMAND} -P runtest.cmake)
-    ENDIF()
-  ENDIF()
+    endif()
+  endif()
   ADD_TEST_MACRO(COnly COnly)
   ADD_TEST_MACRO(CxxOnly CxxOnly)
   ADD_TEST_MACRO(IPO COnly/COnly)
@@ -218,44 +218,44 @@ IF(BUILD_TESTING)
   ADD_TEST_MACRO(Unset Unset)
   ADD_TEST_MACRO(PolicyScope PolicyScope)
   ADD_TEST_MACRO(EmptyLibrary EmptyLibrary)
-  SET_TESTS_PROPERTIES(EmptyLibrary PROPERTIES
+  set_tests_properties(EmptyLibrary PROPERTIES
     PASS_REGULAR_EXPRESSION "CMake Error: CMake can not determine linker language for target:test")
   ADD_TEST_MACRO(CrossCompile CrossCompile)
-  SET_TESTS_PROPERTIES(CrossCompile PROPERTIES
+  set_tests_properties(CrossCompile PROPERTIES
     PASS_REGULAR_EXPRESSION "TRY_RUN.. invoked in cross-compiling mode")
-  IF("${CMAKE_TEST_GENERATOR}" MATCHES "Make")
+  if("${CMAKE_TEST_GENERATOR}" MATCHES "Make")
     ADD_TEST_MACRO(Policy0002 Policy0002)
-  ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES "Make")
-  IF(CTEST_TEST_OSX_ARCH)
+  endif("${CMAKE_TEST_GENERATOR}" MATCHES "Make")
+  if(CTEST_TEST_OSX_ARCH)
     ADD_TEST_MACRO(Architecture Architecture)
-    SET_TESTS_PROPERTIES(Architecture PROPERTIES
+    set_tests_properties(Architecture PROPERTIES
       PASS_REGULAR_EXPRESSION "(file is not of required architecture|does not match cputype|not the architecture being linked)")
-  ENDIF(CTEST_TEST_OSX_ARCH)
+  endif(CTEST_TEST_OSX_ARCH)
 
-  LIST(APPEND TEST_BUILD_DIRS ${CMake_TEST_INSTALL_PREFIX})
+  list(APPEND TEST_BUILD_DIRS ${CMake_TEST_INSTALL_PREFIX})
 
-  IF(NOT QT4_FOUND)
-    FIND_PACKAGE(Qt4)
-  ENDIF(NOT QT4_FOUND)
+  if(NOT QT4_FOUND)
+    find_package(Qt4)
+  endif(NOT QT4_FOUND)
 
-  IF(QT4_FOUND)
+  if(QT4_FOUND)
     # test whether the Qt4 which has been found works, on some machines
     # which run nightly builds there were errors like "wrong file format"
     # for libQtCore.so. So first check it works, and only if it does add
     # the automoc test.
-    INCLUDE(CheckCXXSourceCompiles)
-    SET(_save_CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES}")
-    SET(_save_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
+    include(CheckCXXSourceCompiles)
+    set(_save_CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES}")
+    set(_save_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
 
-    SET(CMAKE_REQUIRED_INCLUDES ${QT_INCLUDES})
-    SET(CMAKE_REQUIRED_LIBRARIES ${QT_QTCORE_LIBRARIES})
+    set(CMAKE_REQUIRED_INCLUDES ${QT_INCLUDES})
+    set(CMAKE_REQUIRED_LIBRARIES ${QT_QTCORE_LIBRARIES})
 
     CHECK_CXX_SOURCE_COMPILES("#include <QCoreApplication>\n int main() {return (qApp == 0 ? 0 : 1); }\n"
                               QT4_WORKS)
 
-    SET(CMAKE_REQUIRED_INCLUDES "${_save_CMAKE_REQUIRED_INCLUDES}")
-    SET(CMAKE_REQUIRED_LIBRARIES "${_save_CMAKE_REQUIRED_LIBRARIES}")
-  ENDIF()
+    set(CMAKE_REQUIRED_INCLUDES "${_save_CMAKE_REQUIRED_INCLUDES}")
+    set(CMAKE_REQUIRED_LIBRARIES "${_save_CMAKE_REQUIRED_LIBRARIES}")
+  endif()
 
   # run test for BundleUtilities on supported platforms/compilers
   if(MSVC OR
@@ -263,7 +263,7 @@ IF(BUILD_TESTING)
      CMAKE_SYSTEM_NAME MATCHES "Darwin")
   if(NOT "${CMAKE_TEST_GENERATOR}" STREQUAL "Watcom WMake")
 
-    ADD_TEST(BundleUtilities ${CMAKE_CTEST_COMMAND}
+    add_test(BundleUtilities ${CMAKE_CTEST_COMMAND}
       --build-and-test
       "${CMake_SOURCE_DIR}/Tests/BundleUtilities"
       "${CMake_BINARY_DIR}/Tests/BundleUtilities"
@@ -271,12 +271,12 @@ IF(BUILD_TESTING)
       --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
       --build-project BundleUtilities
       )
-    LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleUtilities")
+    list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleUtilities")
 
     # run test for DeployQt4 on supported platforms/compilers (which depends on BundleUtilities)
     # this test also depends on the existence of the standard qtiff plugin
     if(QT4_WORKS AND QT_QTSQL_FOUND)
-      ADD_TEST(Qt4Deploy ${CMAKE_CTEST_COMMAND}
+      add_test(Qt4Deploy ${CMAKE_CTEST_COMMAND}
         --build-and-test
         "${CMake_SOURCE_DIR}/Tests/Qt4Deploy"
         "${CMake_BINARY_DIR}/Tests/Qt4Deploy"
@@ -287,29 +287,29 @@ IF(BUILD_TESTING)
         -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
         -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
         )
-      LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Deploy")
+      list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Deploy")
     endif()
 
   endif()
   endif()
 
-  SET(CMAKE_BUILD_TEST_SOURCE_DIR "${CMake_SOURCE_DIR}/Tests/COnly")
-  SET(CMAKE_BUILD_TEST_BINARY_DIR "${CMake_BINARY_DIR}/Tests/CMakeBuildCOnly")
-  SET(CMAKE_BUILD_TEST_EXE COnly)
-  CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CMakeBuildTest.cmake.in"
+  set(CMAKE_BUILD_TEST_SOURCE_DIR "${CMake_SOURCE_DIR}/Tests/COnly")
+  set(CMAKE_BUILD_TEST_BINARY_DIR "${CMake_BINARY_DIR}/Tests/CMakeBuildCOnly")
+  set(CMAKE_BUILD_TEST_EXE COnly)
+  configure_file("${CMake_SOURCE_DIR}/Tests/CMakeBuildTest.cmake.in"
     "${CMake_BINARY_DIR}/Tests/CMakeBuildTest.cmake" @ONLY)
-  ADD_TEST(CMakeBuildTest ${CMAKE_CMAKE_COMMAND} -P
+  add_test(CMakeBuildTest ${CMAKE_CMAKE_COMMAND} -P
     "${CMake_BINARY_DIR}/Tests/CMakeBuildTest.cmake")
-  LIST(APPEND TEST_BUILD_DIRS ${CMAKE_BUILD_TEST_BINARY_DIR})
+  list(APPEND TEST_BUILD_DIRS ${CMAKE_BUILD_TEST_BINARY_DIR})
   # now do it again for a project that has two project commands
-  SET(CMAKE_BUILD_TEST_SOURCE_DIR "${CMake_SOURCE_DIR}/Tests/DoubleProject")
-  SET(CMAKE_BUILD_TEST_BINARY_DIR "${CMake_BINARY_DIR}/Tests/DoubleProject")
-  SET(CMAKE_BUILD_TEST_EXE just_silly)
-  CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CMakeBuildTest.cmake.in"
+  set(CMAKE_BUILD_TEST_SOURCE_DIR "${CMake_SOURCE_DIR}/Tests/DoubleProject")
+  set(CMAKE_BUILD_TEST_BINARY_DIR "${CMake_BINARY_DIR}/Tests/DoubleProject")
+  set(CMAKE_BUILD_TEST_EXE just_silly)
+  configure_file("${CMake_SOURCE_DIR}/Tests/CMakeBuildTest.cmake.in"
     "${CMake_BINARY_DIR}/Tests/CMakeBuildDoubleProjectTest.cmake" @ONLY)
-  ADD_TEST(CMakeDoubleProject ${CMAKE_CMAKE_COMMAND} -P
+  add_test(CMakeDoubleProject ${CMAKE_CMAKE_COMMAND} -P
     "${CMake_BINARY_DIR}/Tests/CMakeBuildDoubleProjectTest.cmake")
-  LIST(APPEND TEST_BUILD_DIRS ${CMAKE_BUILD_TEST_BINARY_DIR})
+  list(APPEND TEST_BUILD_DIRS ${CMAKE_BUILD_TEST_BINARY_DIR})
 
   ADD_TEST_MACRO(Module.CheckTypeSize CheckTypeSize)
 
@@ -333,7 +333,7 @@ IF(BUILD_TESTING)
     ADD_TEST_MACRO(PositionIndependentTargets PositionIndependentTargets)
   endif()
 
-  ADD_TEST(LinkFlags-prepare
+  add_test(LinkFlags-prepare
     ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/LinkFlags"
@@ -344,16 +344,16 @@ IF(BUILD_TESTING)
     --build-target LinkFlags
     --build-options -DTEST_CONFIG=\${CTEST_CONFIGURATION_TYPE}
     )
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkFlags")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkFlags")
 
-  MACRO(ADD_LINK_FLAGS_TEST name depends)
-    ADD_TEST(LinkFlags-${name}
+  macro(ADD_LINK_FLAGS_TEST name depends)
+    add_test(LinkFlags-${name}
       ${CMAKE_CMAKE_COMMAND} --build "${CMake_BINARY_DIR}/Tests/LinkFlags"
       --target LinkFlags_${name} --config \${CTEST_CONFIGURATION_TYPE}
       )
-    SET_TESTS_PROPERTIES(LinkFlags-${name} PROPERTIES
+    set_tests_properties(LinkFlags-${name} PROPERTIES
       PASS_REGULAR_EXPRESSION "BADFLAG" DEPENDS LinkFlags-${depends})
-  ENDMACRO()
+  endmacro()
   ADD_LINK_FLAGS_TEST(lib prepare)
   ADD_LINK_FLAGS_TEST(dll lib)
   ADD_LINK_FLAGS_TEST(exe dll)
@@ -365,12 +365,12 @@ IF(BUILD_TESTING)
   # build the "Simple" test with the ExtraGenerators, if available
   # This doesn't test whether the generated project files work (unfortunately),
   # mainly it tests that cmake doesn't crash when generating these project files.
-  IF(${CMAKE_TEST_GENERATOR} MATCHES "Unix Makefiles"  OR  ${CMAKE_TEST_GENERATOR} MATCHES "KDevelop")
+  if(${CMAKE_TEST_GENERATOR} MATCHES "Unix Makefiles"  OR  ${CMAKE_TEST_GENERATOR} MATCHES "KDevelop")
     # check which generators we have
-    EXEC_PROGRAM(${CMAKE_CMAKE_COMMAND} ARGS --help OUTPUT_VARIABLE cmakeOutput )
+    exec_program(${CMAKE_CMAKE_COMMAND} ARGS --help OUTPUT_VARIABLE cmakeOutput )
     # check for the Eclipse generator
-    IF ("${cmakeOutput}" MATCHES Eclipse)
-      ADD_TEST(Simple_EclipseGenerator ${CMAKE_CTEST_COMMAND}
+    if ("${cmakeOutput}" MATCHES Eclipse)
+      add_test(Simple_EclipseGenerator ${CMAKE_CTEST_COMMAND}
          --build-and-test
          "${CMake_SOURCE_DIR}/Tests/Simple"
          "${CMake_BINARY_DIR}/Tests/Simple_EclipseGenerator"
@@ -379,12 +379,12 @@ IF(BUILD_TESTING)
          --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
          --build-project Simple
          --test-command Simple)
-      LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_EclipseGenerator")
-    ENDIF ("${cmakeOutput}" MATCHES Eclipse)
+      list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_EclipseGenerator")
+    endif ("${cmakeOutput}" MATCHES Eclipse)
 
     # check for the CodeBlocks generator
-    IF ("${cmakeOutput}" MATCHES CodeBlocks)
-      ADD_TEST(Simple_CodeBlocksGenerator ${CMAKE_CTEST_COMMAND}
+    if ("${cmakeOutput}" MATCHES CodeBlocks)
+      add_test(Simple_CodeBlocksGenerator ${CMAKE_CTEST_COMMAND}
          --build-and-test
          "${CMake_SOURCE_DIR}/Tests/Simple"
          "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator"
@@ -393,11 +393,11 @@ IF(BUILD_TESTING)
          --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
          --build-project Simple
          --test-command Simple)
-      LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator")
-    ENDIF ("${cmakeOutput}" MATCHES CodeBlocks)
+      list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator")
+    endif ("${cmakeOutput}" MATCHES CodeBlocks)
     # check for the KDevelop3 generator
-    IF ("${cmakeOutput}" MATCHES KDevelop3)
-      ADD_TEST(Simple_KDevelop3Generator ${CMAKE_CTEST_COMMAND}
+    if ("${cmakeOutput}" MATCHES KDevelop3)
+      add_test(Simple_KDevelop3Generator ${CMAKE_CTEST_COMMAND}
          --build-and-test
          "${CMake_SOURCE_DIR}/Tests/Simple"
          "${CMake_BINARY_DIR}/Tests/Simple_KDevelop3Generator"
@@ -406,17 +406,17 @@ IF(BUILD_TESTING)
          --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
          --build-project Simple
          --test-command Simple)
-      LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_KDevelop3Generator")
-    ENDIF ("${cmakeOutput}" MATCHES KDevelop3)
+      list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_KDevelop3Generator")
+    endif ("${cmakeOutput}" MATCHES KDevelop3)
 
-  ENDIF(${CMAKE_TEST_GENERATOR} MATCHES "Unix Makefiles"  OR  ${CMAKE_TEST_GENERATOR} MATCHES "KDevelop")
+  endif(${CMAKE_TEST_GENERATOR} MATCHES "Unix Makefiles"  OR  ${CMAKE_TEST_GENERATOR} MATCHES "KDevelop")
 
   # test for correct sub-project generation
   # not implemented in VS6 or Xcode
-  IF(NOT MSVC60 AND NOT XCODE AND NOT MSVC70)
+  if(NOT MSVC60 AND NOT XCODE AND NOT MSVC70)
     # run cmake and configure all of SubProject
     # but only build the independent executable car
-    ADD_TEST(SubProject ${CMAKE_CTEST_COMMAND}
+    add_test(SubProject ${CMAKE_CTEST_COMMAND}
       --build-and-test
       "${CMake_SOURCE_DIR}/Tests/SubProject"
       "${CMake_BINARY_DIR}/Tests/SubProject"
@@ -427,20 +427,20 @@ IF(BUILD_TESTING)
       --test-command car
       )
 
-    IF(${CMAKE_TEST_GENERATOR} MATCHES "Ninja")
+    if(${CMAKE_TEST_GENERATOR} MATCHES "Ninja")
       # The Ninja generator does not create a recursive build system.  Start
       # from the root directory.
-      SET(SubProject_SUBDIR)
-    ELSE()
-      SET(SubProject_SUBDIR "/foo")
-    ENDIF()
+      set(SubProject_SUBDIR)
+    else()
+      set(SubProject_SUBDIR "/foo")
+    endif()
 
     # For stage 2, do not run cmake again.
     # Then build the foo sub project which should build
     # the bar library which should be referenced because
     # foo links to the static library bar, but bar is not
     # directly in the foo sub project
-    ADD_TEST(SubProject-Stage2  ${CMAKE_CTEST_COMMAND}
+    add_test(SubProject-Stage2  ${CMAKE_CTEST_COMMAND}
       --build-and-test
       "${CMake_SOURCE_DIR}/Tests/SubProject${SubProject_SUBDIR}"
       "${CMake_BINARY_DIR}/Tests/SubProject${SubProject_SUBDIR}"
@@ -452,29 +452,29 @@ IF(BUILD_TESTING)
       --build-exe-dir "${CMake_BINARY_DIR}/Tests/SubProject/foo"
       --test-command foo
       )
-    SET_TESTS_PROPERTIES ( SubProject-Stage2 PROPERTIES DEPENDS SubProject)
-    LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubProject")
-  ENDIF(NOT MSVC60 AND NOT XCODE AND NOT MSVC70)
+    set_tests_properties ( SubProject-Stage2 PROPERTIES DEPENDS SubProject)
+    list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubProject")
+  endif(NOT MSVC60 AND NOT XCODE AND NOT MSVC70)
 
-  IF (CMAKE_STRICT)
+  if (CMAKE_STRICT)
     ADD_TEST_MACRO(DocTest DocTest)
-  ENDIF (CMAKE_STRICT)
+  endif (CMAKE_STRICT)
   # macro to add a test that will build a nightly release
   # of CMake for given platform using the release scripts
-  MACRO(ADD_NIGHTLY_BUILD_TEST name script)
-    SET(_TEST_DIR "${CMake_BINARY_DIR}/Tests/${name}")
-    FILE(MAKE_DIRECTORY "${_TEST_DIR}")
-    FILE(WRITE "${_TEST_DIR}/nightly-cmake.sh"
+  macro(ADD_NIGHTLY_BUILD_TEST name script)
+    set(_TEST_DIR "${CMake_BINARY_DIR}/Tests/${name}")
+    file(MAKE_DIRECTORY "${_TEST_DIR}")
+    file(WRITE "${_TEST_DIR}/nightly-cmake.sh"
       "cd ${_TEST_DIR}
 ${CMake_BINARY_DIR}/bin/cmake -DCMAKE_CREATE_VERSION=nightly -P ${CMake_SOURCE_DIR}/Utilities/Release/${script}
 ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/Release/upload_release.cmake
     ")
-    ADD_TEST(${name} /bin/sh ${_TEST_DIR}/nightly-cmake.sh)
-    IF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY)
-      SET_TESTS_PROPERTIES (${name} PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT})
-    ENDIF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY)
-  ENDMACRO(ADD_NIGHTLY_BUILD_TEST)
-  IF(CMAKE_BUILD_NIGHTLY_RELEASES)
+    add_test(${name} /bin/sh ${_TEST_DIR}/nightly-cmake.sh)
+    if(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY)
+      set_tests_properties (${name} PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT})
+    endif(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY)
+  endmacro(ADD_NIGHTLY_BUILD_TEST)
+  if(CMAKE_BUILD_NIGHTLY_RELEASES)
     ADD_NIGHTLY_BUILD_TEST(CMakeNightlyWindows
       dash2win64_release.cmake)
     ADD_NIGHTLY_BUILD_TEST(CMakeNightlyMac
@@ -483,10 +483,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       dashmacmini5_release.cmake)
     ADD_NIGHTLY_BUILD_TEST(CMakeNightlyLinux
       magrathea_release.cmake)
-  ENDIF(CMAKE_BUILD_NIGHTLY_RELEASES)
+  endif(CMAKE_BUILD_NIGHTLY_RELEASES)
 
   # add tests with more complex invocations
-  ADD_TEST(Framework ${CMAKE_CTEST_COMMAND}
+  add_test(Framework ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/Framework"
     "${CMake_BINARY_DIR}/Tests/Framework"
@@ -497,9 +497,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-options
     "-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/Framework/Install"
     --test-command bar)
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Framework")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Framework")
 
-  ADD_TEST(TargetName ${CMAKE_CTEST_COMMAND}
+  add_test(TargetName ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/TargetName"
     "${CMake_BINARY_DIR}/Tests/TargetName"
@@ -510,9 +510,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --test-command ${CMAKE_CMAKE_COMMAND} -E compare_files
     ${CMake_SOURCE_DIR}/Tests/TargetName/scripts/hello_world
     ${CMake_BINARY_DIR}/Tests/TargetName/scripts/hello_world)
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TargetName")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TargetName")
 
-  ADD_TEST(LibName ${CMAKE_CTEST_COMMAND}
+  add_test(LibName ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/LibName"
     "${CMake_BINARY_DIR}/Tests/LibName"
@@ -523,9 +523,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-exe-dir "${CMake_BINARY_DIR}/Tests/LibName/lib"
     --test-command foobar
     )
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LibName")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LibName")
 
-  ADD_TEST(CustComDepend ${CMAKE_CTEST_COMMAND}
+  add_test(CustComDepend ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/CustComDepend"
     "${CMake_BINARY_DIR}/Tests/CustComDepend"
@@ -536,9 +536,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-exe-dir "${CMake_BINARY_DIR}/Tests/CustComDepend/bin"
     --test-command foo bar.c
     )
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustComDepend")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustComDepend")
 
-  ADD_TEST(ArgumentExpansion  ${CMAKE_CTEST_COMMAND}
+  add_test(ArgumentExpansion  ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/ArgumentExpansion"
     "${CMake_BINARY_DIR}/Tests/ArgumentExpansion"
@@ -547,11 +547,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
     --build-exe-dir "${CMake_BINARY_DIR}/Tests/ArgumentExpansion/bin"
     )
-  SET_TESTS_PROPERTIES(ArgumentExpansion PROPERTIES
+  set_tests_properties(ArgumentExpansion PROPERTIES
     FAIL_REGULAR_EXPRESSION "Unexpected: ")
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ArgumentExpansion")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ArgumentExpansion")
 
-  ADD_TEST(CustomCommand  ${CMAKE_CTEST_COMMAND}
+  add_test(CustomCommand  ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/CustomCommand"
     "${CMake_BINARY_DIR}/Tests/CustomCommand"
@@ -562,9 +562,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-exe-dir "${CMake_BINARY_DIR}/Tests/CustomCommand/bin"
     --test-command CustomCommand
     )
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommand")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommand")
 
-  ADD_TEST(CustomCommandWorkingDirectory  ${CMAKE_CTEST_COMMAND}
+  add_test(CustomCommandWorkingDirectory  ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/CustomCommandWorkingDirectory"
     "${CMake_BINARY_DIR}/Tests/CustomCommandWorkingDirectory"
@@ -574,9 +574,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
     --test-command working
     )
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommandWorkingDirectory")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommandWorkingDirectory")
 
-   #ADD_TEST(SimpleExclude ${CMAKE_CTEST_COMMAND}
+   #add_test(SimpleExclude ${CMAKE_CTEST_COMMAND}
    #  --build-and-test
    #  "${CMake_SOURCE_DIR}/Tests/SimpleExclude"
    #  "${CMake_BINARY_DIR}/Tests/SimpleExclude"
@@ -590,7 +590,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
    #-P "${CMake_BINARY_DIR}/Tests/SimpleExclude/run.cmake"
    #)
 
-#  ADD_TEST(SameName  ${CMAKE_CTEST_COMMAND}
+#  add_test(SameName  ${CMAKE_CTEST_COMMAND}
 #    --build-and-test
 #    "${CMake_SOURCE_DIR}/Tests/SameName"
 #    "${CMake_BINARY_DIR}/Tests/SameName"
@@ -601,7 +601,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
 #    --test-command
 #    "${CMake_BINARY_DIR}/Tests/SameName/Exe1/mytest2")
 
-  ADD_TEST(OutOfSource ${CMAKE_CTEST_COMMAND}
+  add_test(OutOfSource ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/OutOfSource"
     "${CMake_BINARY_DIR}/Tests/OutOfSource"
@@ -611,11 +611,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-two-config
     --test-command
     "${CMake_BINARY_DIR}/Tests/OutOfSource/SubDir/OutOfSourceSubdir/simple")
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/OutOfSource")
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/OutOfSourceDeep")
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/OutOfBinary")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/OutOfSource")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/OutOfSourceDeep")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/OutOfBinary")
 
-  ADD_TEST(BuildDepends ${CMAKE_CTEST_COMMAND}
+  add_test(BuildDepends ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/BuildDepends"
     "${CMake_BINARY_DIR}/Tests/BuildDepends"
@@ -623,11 +623,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-project BuildDepends
     --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
     )
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BuildDepends")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BuildDepends")
 
-  SET(SimpleInstallInstallDir
+  set(SimpleInstallInstallDir
     "${CMake_BINARY_DIR}/Tests/SimpleInstall/InstallDirectory")
-  ADD_TEST(SimpleInstall ${CMAKE_CTEST_COMMAND}
+  add_test(SimpleInstall ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/SimpleInstall"
     "${CMake_BINARY_DIR}/Tests/SimpleInstall"
@@ -639,8 +639,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     "-DCMAKE_INSTALL_PREFIX:PATH=${SimpleInstallInstallDir}"
     "-DCTEST_TEST_CPACK:BOOL=${CTEST_TEST_CPACK}"
     --test-command   ${SimpleInstallInstallDir}/MyTest/bin/SimpleInstExe)
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleInstall")
-  ADD_TEST(SimpleInstall-Stage2 ${CMAKE_CTEST_COMMAND}
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleInstall")
+  add_test(SimpleInstall-Stage2 ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/SimpleInstallS2"
     "${CMake_BINARY_DIR}/Tests/SimpleInstallS2"
@@ -652,7 +652,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     "-DCMAKE_INSTALL_PREFIX:PATH=${SimpleInstallInstallDir}"
     "-DSTAGE2:BOOL=1"
     --test-command   ${SimpleInstallInstallDir}/MyTest/bin/SimpleInstExeS2)
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleInstallS2")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleInstallS2")
 
   # By default, run the CPackComponents test if the CTEST_TEST_CPACK
   # option is ON:
@@ -686,7 +686,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     endif(NSIS_MAKENSIS_EXECUTABLE)
   endif(WIN32)
 
-  IF(CTEST_RUN_CPackComponents)
+  if(CTEST_RUN_CPackComponents)
     set(CPackComponents_EXTRA_OPTIONS)
     if(APPLE)
       set(CPackComponents_EXTRA_OPTIONS -DCPACK_BINARY_DRAGNDROP:BOOL=ON)
@@ -696,7 +696,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         -DCPACK_BINARY_NSIS:BOOL=ON)
     endif(NSIS_MAKENSIS_EXECUTABLE)
 
-    ADD_TEST(CPackComponents ${CMAKE_CTEST_COMMAND}
+    add_test(CPackComponents ${CMAKE_CTEST_COMMAND}
       --build-and-test
       "${CMake_SOURCE_DIR}/Tests/CPackComponents"
       "${CMake_BINARY_DIR}/Tests/CPackComponents"
@@ -713,10 +713,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --test-command ${CMAKE_CMAKE_COMMAND}
         "-DCPackComponents_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackComponents"
         -P "${CMake_SOURCE_DIR}/Tests/CPackComponents/VerifyResult.cmake")
-    LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponents")
-  ENDIF(CTEST_RUN_CPackComponents)
+    list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponents")
+  endif(CTEST_RUN_CPackComponents)
 
-  IF(CTEST_RUN_CPackComponentsForAll)
+  if(CTEST_RUN_CPackComponentsForAll)
     # Check whether if rpmbuild command is found
     # before adding RPM tests
     find_program(RPMBUILD_EXECUTABLE NAMES rpmbuild)
@@ -759,7 +759,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       set(CPackRun_CPackGen  "-DCPackGen=${CPackGen}")
       foreach(CPackComponentWay ${CWAYLST})
         set(CPackRun_CPackComponentWay "-DCPackComponentWay=${CPackComponentWay}")
-        ADD_TEST(CPackComponentsForAll-${CPackGen}-${CPackComponentWay} ${CMAKE_CTEST_COMMAND}
+        add_test(CPackComponentsForAll-${CPackGen}-${CPackComponentWay} ${CMAKE_CTEST_COMMAND}
           --build-and-test
           "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll"
           "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}"
@@ -777,10 +777,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
             "${CPackRun_CPackGen}"
             "${CPackRun_CPackComponentWay}"
             -P "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake")
-        LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}")
+        list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}")
       endforeach(CPackComponentWay)
     endforeach(CPackGen)
-  ENDIF(CTEST_RUN_CPackComponentsForAll)
+  endif(CTEST_RUN_CPackComponentsForAll)
 
   # By default, turn this test off (because it takes a long time...)
   #
@@ -799,8 +799,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       CMAKE_RUN_LONG_TESTS)
   endif(NOT DEFINED CTEST_RUN_CPackTestAllGenerators)
 
-  IF(CTEST_RUN_CPackTestAllGenerators)
-    ADD_TEST(CPackTestAllGenerators ${CMAKE_CTEST_COMMAND}
+  if(CTEST_RUN_CPackTestAllGenerators)
+    add_test(CPackTestAllGenerators ${CMAKE_CTEST_COMMAND}
       --build-and-test
       "${CMake_SOURCE_DIR}/Tests/CPackTestAllGenerators"
       "${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators"
@@ -813,16 +813,16 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         -D cpack=${CMAKE_CPACK_COMMAND}
         -P ${CMake_SOURCE_DIR}/Tests/CPackTestAllGenerators/RunCPack.cmake
       )
-    LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators")
-  ENDIF(CTEST_RUN_CPackTestAllGenerators)
+    list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators")
+  endif(CTEST_RUN_CPackTestAllGenerators)
 
-  IF(CTEST_package_X11_TEST)
-    SET(X11_build_target_arg --build-target package)
-  ELSE(CTEST_package_X11_TEST)
-    SET(X11_build_target_arg)
-  ENDIF(CTEST_package_X11_TEST)
+  if(CTEST_package_X11_TEST)
+    set(X11_build_target_arg --build-target package)
+  else(CTEST_package_X11_TEST)
+    set(X11_build_target_arg)
+  endif(CTEST_package_X11_TEST)
 
-  ADD_TEST(X11 ${CMAKE_CTEST_COMMAND}
+  add_test(X11 ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/X11"
     "${CMake_BINARY_DIR}/Tests/X11"
@@ -832,53 +832,53 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-two-config
     ${X11_build_target_arg}
     --test-command  UseX11)
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/X11")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/X11")
 
   if(NOT DEFINED CTEST_RUN_CMakeTestAllGenerators)
     set(CTEST_RUN_CMakeTestAllGenerators ON)
   endif(NOT DEFINED CTEST_RUN_CMakeTestAllGenerators)
 
-  IF(CTEST_RUN_CMakeTestAllGenerators)
-    ADD_TEST(CMakeTestAllGenerators ${CMAKE_CMAKE_COMMAND}
+  if(CTEST_RUN_CMakeTestAllGenerators)
+    add_test(CMakeTestAllGenerators ${CMAKE_CMAKE_COMMAND}
         -D dir=${CMake_BINARY_DIR}/Tests/CMakeTestAllGenerators
         -D CMake_SOURCE_DIR=${CMake_SOURCE_DIR}
         -P ${CMake_SOURCE_DIR}/Tests/CMakeTestAllGenerators/RunCMake.cmake
       )
-    LIST(APPEND TEST_BUILD_DIRS
+    list(APPEND TEST_BUILD_DIRS
       "${CMake_BINARY_DIR}/Tests/CMakeTestAllGenerators")
-  ENDIF(CTEST_RUN_CMakeTestAllGenerators)
+  endif(CTEST_RUN_CMakeTestAllGenerators)
 
   if(NOT DEFINED CTEST_RUN_CMakeTestBadCommandLines)
     set(CTEST_RUN_CMakeTestBadCommandLines ON)
   endif(NOT DEFINED CTEST_RUN_CMakeTestBadCommandLines)
 
-  IF(CTEST_RUN_CMakeTestBadCommandLines)
-    ADD_TEST(CMakeTestBadCommandLines ${CMAKE_CMAKE_COMMAND}
+  if(CTEST_RUN_CMakeTestBadCommandLines)
+    add_test(CMakeTestBadCommandLines ${CMAKE_CMAKE_COMMAND}
         -D dir=${CMake_BINARY_DIR}/Tests/CMakeTestBadCommandLines
         -D gen=${CMAKE_TEST_GENERATOR}
         -D CMake_SOURCE_DIR=${CMake_SOURCE_DIR}
         -P ${CMake_SOURCE_DIR}/Tests/CMakeTestBadCommandLines/RunCMake.cmake
       )
-    LIST(APPEND TEST_BUILD_DIRS
+    list(APPEND TEST_BUILD_DIRS
       "${CMake_BINARY_DIR}/Tests/CMakeTestBadCommandLines")
-  ENDIF(CTEST_RUN_CMakeTestBadCommandLines)
+  endif(CTEST_RUN_CMakeTestBadCommandLines)
 
   if(NOT DEFINED CTEST_RUN_CMakeTestMultipleConfigures)
     set(CTEST_RUN_CMakeTestMultipleConfigures ON)
   endif(NOT DEFINED CTEST_RUN_CMakeTestMultipleConfigures)
 
-  IF(CTEST_RUN_CMakeTestMultipleConfigures)
-    ADD_TEST(CMakeTestMultipleConfigures ${CMAKE_CMAKE_COMMAND}
+  if(CTEST_RUN_CMakeTestMultipleConfigures)
+    add_test(CMakeTestMultipleConfigures ${CMAKE_CMAKE_COMMAND}
         -D dir=${CMake_BINARY_DIR}/Tests/CMakeTestMultipleConfigures
         -D gen=${CMAKE_TEST_GENERATOR}
         -D CMake_SOURCE_DIR=${CMake_SOURCE_DIR}
         -P ${CMake_SOURCE_DIR}/Tests/CMakeTestMultipleConfigures/RunCMake.cmake
       )
-    LIST(APPEND TEST_BUILD_DIRS
+    list(APPEND TEST_BUILD_DIRS
       "${CMake_BINARY_DIR}/Tests/CMakeTestMultipleConfigures")
-  ENDIF(CTEST_RUN_CMakeTestMultipleConfigures)
+  endif(CTEST_RUN_CMakeTestMultipleConfigures)
 
-  ADD_TEST(LoadedCommandOneConfig  ${CMAKE_CTEST_COMMAND}
+  add_test(LoadedCommandOneConfig  ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/LoadCommandOneConfig"
     "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig"
@@ -887,9 +887,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
     --test-command  LoadedCommand
     )
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig")
 
-  ADD_TEST(complex  ${CMAKE_CTEST_COMMAND}
+  add_test(complex  ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/Complex"
     "${CMake_BINARY_DIR}/Tests/Complex"
@@ -903,9 +903,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
     --test-command complex
     )
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Complex")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Complex")
 
-  ADD_TEST(complexOneConfig  ${CMAKE_CTEST_COMMAND}
+  add_test(complexOneConfig  ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/ComplexOneConfig"
     "${CMake_BINARY_DIR}/Tests/ComplexOneConfig"
@@ -916,11 +916,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-options
     -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
     --test-command complex)
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ComplexOneConfig")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ComplexOneConfig")
   # because of the registry write these tests depend on each other
-  SET_TESTS_PROPERTIES ( complex PROPERTIES DEPENDS complexOneConfig)
+  set_tests_properties ( complex PROPERTIES DEPENDS complexOneConfig)
 
-  ADD_TEST(Example ${CMAKE_CTEST_COMMAND}
+  add_test(Example ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Example"
     "${CMake_BINARY_DIR}/Example"
@@ -930,9 +930,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-exe-dir "${CMake_BINARY_DIR}/Example/Demo"
     --test-command helloDemo
     )
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Example")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Example")
 
-  ADD_TEST(Environment ${CMAKE_CTEST_COMMAND}
+  add_test(Environment ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/Environment"
     "${CMake_BINARY_DIR}/Tests/Environment"
@@ -943,10 +943,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --force-new-ctest-process
     --test-command ${CMAKE_CTEST_COMMAND} -V
     )
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Environment")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Environment")
 
-  IF(QT4_WORKS AND QT_QTGUI_FOUND)
-    ADD_TEST(QtAutomoc ${CMAKE_CTEST_COMMAND}
+  if(QT4_WORKS AND QT_QTGUI_FOUND)
+    add_test(QtAutomoc ${CMAKE_CTEST_COMMAND}
       --build-and-test
       "${CMake_SOURCE_DIR}/Tests/QtAutomoc"
       "${CMake_BINARY_DIR}/Tests/QtAutomoc"
@@ -958,10 +958,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-options -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
       --test-command ${CMAKE_CTEST_COMMAND} -V
       )
-    LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/QtAutomoc")
-  ENDIF()
+    list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/QtAutomoc")
+  endif()
 
-  ADD_TEST(ExternalProject ${CMAKE_CTEST_COMMAND}
+  add_test(ExternalProject ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/ExternalProject"
     "${CMake_BINARY_DIR}/Tests/ExternalProject"
@@ -972,13 +972,13 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --force-new-ctest-process
     --test-command ${CMAKE_CTEST_COMMAND} -V
     )
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProject")
-  SET_TESTS_PROPERTIES(ExternalProject PROPERTIES
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProject")
+  set_tests_properties(ExternalProject PROPERTIES
     TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT})
 
   # do each of the tutorial steps
-  FOREACH(STP RANGE 1 7)
-    ADD_TEST(TutorialStep${STP} ${CMAKE_CTEST_COMMAND}
+  foreach(STP RANGE 1 7)
+    add_test(TutorialStep${STP} ${CMAKE_CTEST_COMMAND}
       --build-and-test
       "${CMake_SOURCE_DIR}/Tests/Tutorial/Step${STP}"
       "${CMake_BINARY_DIR}/Tests/Tutorial/Step${STP}"
@@ -987,10 +987,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
       --build-project Tutorial
       --test-command Tutorial 25.0)
-  ENDFOREACH(STP)
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Tutorial")
+  endforeach(STP)
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Tutorial")
 
-  ADD_TEST(testing ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE}
+  add_test(testing ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/Testing"
     "${CMake_BINARY_DIR}/Tests/Testing"
@@ -999,10 +999,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
     --test-command ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE}
     )
-  SET_TESTS_PROPERTIES(testing PROPERTIES PASS_REGULAR_EXPRESSION "Passed")
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Testing")
+  set_tests_properties(testing PROPERTIES PASS_REGULAR_EXPRESSION "Passed")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Testing")
 
-  ADD_TEST(wrapping  ${CMAKE_CTEST_COMMAND}
+  add_test(wrapping  ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/Wrapping"
     "${CMake_BINARY_DIR}/Tests/Wrapping"
@@ -1012,7 +1012,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
     --test-command wrapping
     )
-  ADD_TEST(qtwrapping  ${CMAKE_CTEST_COMMAND}
+  add_test(qtwrapping  ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/Wrapping"
     "${CMake_BINARY_DIR}/Tests/Wrapping"
@@ -1022,9 +1022,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
       --test-command qtwrapping
       )
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Wrapping")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Wrapping")
 
-  ADD_TEST(testdriver1 ${CMAKE_CTEST_COMMAND}
+  add_test(testdriver1 ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/TestDriver"
     "${CMake_BINARY_DIR}/Tests/TestDriver"
@@ -1035,7 +1035,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --test-command TestDriverTest test1
     )
 
-  ADD_TEST(testdriver2 ${CMAKE_CTEST_COMMAND}
+  add_test(testdriver2 ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/TestDriver"
     "${CMake_BINARY_DIR}/Tests/TestDriver"
@@ -1046,7 +1046,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --test-command TestDriverTest test2
     )
 
-  ADD_TEST(testdriver3  ${CMAKE_CTEST_COMMAND}
+  add_test(testdriver3  ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/TestDriver"
     "${CMake_BINARY_DIR}/Tests/TestDriver"
@@ -1056,9 +1056,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-project TestDriverTest
     --test-command TestDriverTest subdir/test3
     )
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestDriver")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestDriver")
 
-  ADD_TEST(Dependency ${CMAKE_CTEST_COMMAND}
+  add_test(Dependency ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/Dependency"
     "${CMake_BINARY_DIR}/Tests/Dependency"
@@ -1068,9 +1068,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-project Dependency
     --test-command exec
     )
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Dependency")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Dependency")
 
-  IF("${CMAKE_SYSTEM_NAME}" MATCHES syllable)
+  if("${CMAKE_SYSTEM_NAME}" MATCHES syllable)
 
 # RPATH isn't supported under Syllable, so the tests don't
 # find their libraries. In order to fix that LIBRARY_OUTPUT_DIR
@@ -1078,17 +1078,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
 # For now we just require on Syllable that the user adjusts the DLL_PATH
 # environment variable, so except the two tests below all other tests will succeed.
 
-    SET(_DLL_PATH "$ENV{DLL_PATH}")
-    IF(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.(:.*)?$")
-      MESSAGE(FATAL_ERROR "In order to successfully run the CMake test suite on Syllable you need to add \"\\@bindir\\@/.\" to the DLL_PATH environment variable")
-    ENDIF(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.(:.*)?$")
-    IF(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.\\./lib(:.*)?$")
-      MESSAGE(FATAL_ERROR "In order to successfully run the CMake test suite on Syllable you need to add \"\\@bindir\\@/../lib\" to the DLL_PATH environment variable")
-    ENDIF(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.\\./lib(:.*)?$")
+    set(_DLL_PATH "$ENV{DLL_PATH}")
+    if(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.(:.*)?$")
+      message(FATAL_ERROR "In order to successfully run the CMake test suite on Syllable you need to add \"\\@bindir\\@/.\" to the DLL_PATH environment variable")
+    endif(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.(:.*)?$")
+    if(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.\\./lib(:.*)?$")
+      message(FATAL_ERROR "In order to successfully run the CMake test suite on Syllable you need to add \"\\@bindir\\@/../lib\" to the DLL_PATH environment variable")
+    endif(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.\\./lib(:.*)?$")
 
-  ELSE("${CMAKE_SYSTEM_NAME}" MATCHES syllable)
+  else("${CMAKE_SYSTEM_NAME}" MATCHES syllable)
 
-    ADD_TEST(JumpWithLibOut  ${CMAKE_CTEST_COMMAND}
+    add_test(JumpWithLibOut  ${CMAKE_CTEST_COMMAND}
       --build-and-test
       "${CMake_SOURCE_DIR}/Tests/Jump"
       "${CMake_BINARY_DIR}/Tests/Jump/WithLibOut"
@@ -1101,7 +1101,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --test-command jumpExecutable
       )
 
-    ADD_TEST(JumpNoLibOut  ${CMAKE_CTEST_COMMAND}
+    add_test(JumpNoLibOut  ${CMAKE_CTEST_COMMAND}
       --build-and-test
       "${CMake_SOURCE_DIR}/Tests/Jump"
       "${CMake_BINARY_DIR}/Tests/Jump/NoLibOut"
@@ -1112,9 +1112,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
       --test-command jumpExecutable
       )
-    LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Jump")
+    list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Jump")
 
-    ADD_TEST(Plugin ${CMAKE_CTEST_COMMAND}
+    add_test(Plugin ${CMAKE_CTEST_COMMAND}
       --build-and-test
       "${CMake_SOURCE_DIR}/Tests/Plugin"
       "${CMake_BINARY_DIR}/Tests/Plugin"
@@ -1123,14 +1123,14 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
       --build-two-config
       --test-command bin/example)
-    LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Plugin")
+    list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Plugin")
 
-    IF(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG)
+    if(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG)
       ADD_TEST_MACRO(RuntimePath RuntimePath)
-    ENDIF(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG)
-  ENDIF("${CMAKE_SYSTEM_NAME}" MATCHES syllable)
+    endif(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG)
+  endif("${CMAKE_SYSTEM_NAME}" MATCHES syllable)
 
-  ADD_TEST(linkorder1 ${CMAKE_CTEST_COMMAND}
+  add_test(linkorder1 ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/LinkLineOrder"
     "${CMake_BINARY_DIR}/Tests/LinkLineOrder"
@@ -1140,7 +1140,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --test-command Exec1
     )
 
-  ADD_TEST(linkorder2  ${CMAKE_CTEST_COMMAND}
+  add_test(linkorder2  ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/LinkLineOrder"
     "${CMake_BINARY_DIR}/Tests/LinkLineOrder"
@@ -1149,19 +1149,19 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-project LinkLineOrder
     --test-command Exec2
     )
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkLineOrder")
-  SET_TESTS_PROPERTIES ( qtwrapping PROPERTIES DEPENDS wrapping)
-  SET_TESTS_PROPERTIES ( testdriver1 PROPERTIES DEPENDS qtwrapping)
-  SET_TESTS_PROPERTIES ( testdriver2 PROPERTIES DEPENDS testdriver1)
-  SET_TESTS_PROPERTIES ( testdriver3 PROPERTIES DEPENDS testdriver2)
-  SET_TESTS_PROPERTIES ( linkorder2 PROPERTIES DEPENDS linkorder1)
-  SET_TESTS_PROPERTIES ( SimpleInstall-Stage2 PROPERTIES DEPENDS SimpleInstall)
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkLineOrder")
+  set_tests_properties ( qtwrapping PROPERTIES DEPENDS wrapping)
+  set_tests_properties ( testdriver1 PROPERTIES DEPENDS qtwrapping)
+  set_tests_properties ( testdriver2 PROPERTIES DEPENDS testdriver1)
+  set_tests_properties ( testdriver3 PROPERTIES DEPENDS testdriver2)
+  set_tests_properties ( linkorder2 PROPERTIES DEPENDS linkorder1)
+  set_tests_properties ( SimpleInstall-Stage2 PROPERTIES DEPENDS SimpleInstall)
 
   # Test static linking on toolchains known to support it.
-  IF("${CMAKE_C_COMPILER_ID}" MATCHES "^(GNU)$"
+  if("${CMAKE_C_COMPILER_ID}" MATCHES "^(GNU)$"
       AND NOT APPLE AND NOT WIN32 AND NOT CYGWIN
       AND EXISTS "/usr/lib/libm.a")
-    ADD_TEST(LinkStatic  ${CMAKE_CTEST_COMMAND}
+    add_test(LinkStatic  ${CMAKE_CTEST_COMMAND}
       --build-and-test
       "${CMake_SOURCE_DIR}/Tests/LinkStatic"
       "${CMake_BINARY_DIR}/Tests/LinkStatic"
@@ -1171,10 +1171,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-options -DMATH_LIBRARY:FILEPATH=/usr/lib/libm.a
       --test-command LinkStatic
       )
-  ENDIF()
+  endif()
 
-  IF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
-    ADD_TEST(kwsys ${CMAKE_CTEST_COMMAND}
+  if(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
+    add_test(kwsys ${CMAKE_CTEST_COMMAND}
       --build-and-test
       "${CMake_SOURCE_DIR}/Source/kwsys"
       "${CMake_BINARY_DIR}/Tests/kwsys"
@@ -1183,27 +1183,27 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-project kwsys
       --test-command kwsysTestsCxx testIOS
       )
-    LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/kwsys")
-  ENDIF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
-  SET(MAKE_IS_GNU )
-  IF(${CMAKE_TEST_MAKEPROGRAM} MATCHES make)
-    EXEC_PROGRAM(
+    list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/kwsys")
+  endif(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
+  set(MAKE_IS_GNU )
+  if(${CMAKE_TEST_MAKEPROGRAM} MATCHES make)
+    exec_program(
       ${CMAKE_TEST_MAKEPROGRAM} ARGS no_such_target --version
       RETURN_VALUE res OUTPUT_VARIABLE out
       )
-    IF("${res}" EQUAL 0)
-      IF("${out}" MATCHES "GNU")
-        SET(MAKE_IS_GNU 1)
-      ENDIF("${out}" MATCHES "GNU")
-    ENDIF("${res}" EQUAL 0)
-  ENDIF(${CMAKE_TEST_MAKEPROGRAM} MATCHES make)
+    if("${res}" EQUAL 0)
+      if("${out}" MATCHES "GNU")
+        set(MAKE_IS_GNU 1)
+      endif("${out}" MATCHES "GNU")
+    endif("${res}" EQUAL 0)
+  endif(${CMAKE_TEST_MAKEPROGRAM} MATCHES make)
 
   # only add this test on platforms that support it
   # some old versions of make simply cannot handle spaces in paths
-  IF (MAKE_IS_GNU OR
+  if (MAKE_IS_GNU OR
       "${CMAKE_TEST_MAKEPROGRAM}" MATCHES "nmake|gmake|wmake" OR
       "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio|XCode|Borland")
-    ADD_TEST(SubDirSpaces ${CMAKE_CTEST_COMMAND}
+    add_test(SubDirSpaces ${CMAKE_CTEST_COMMAND}
       --build-and-test
       "${CMake_SOURCE_DIR}/Tests/SubDirSpaces"
       "${CMake_BINARY_DIR}/Tests/SubDirSpaces"
@@ -1216,13 +1216,13 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       "${CMake_BINARY_DIR}/Tests/SubDirSpaces/ShouldBeHere"
       "${CMake_BINARY_DIR}/Tests/SubDirSpaces/testfromsubdir.obj"
       )
-    LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDirSpaces")
-  ENDIF (MAKE_IS_GNU OR
+    list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDirSpaces")
+  endif (MAKE_IS_GNU OR
     "${CMAKE_TEST_MAKEPROGRAM}" MATCHES "nmake|gmake|wmake" OR
     "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio|XCode|Borland")
 
-  IF (WIN32)
-    ADD_TEST(SubDir ${CMAKE_CTEST_COMMAND}
+  if (WIN32)
+    add_test(SubDir ${CMAKE_CTEST_COMMAND}
       --build-and-test
       "${CMake_SOURCE_DIR}/Tests/SubDir"
       "${CMake_BINARY_DIR}/Tests/SubDir"
@@ -1234,8 +1234,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere"
       "${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.obj"
       )
-  ELSE (WIN32)
-    ADD_TEST(SubDir ${CMAKE_CTEST_COMMAND}
+  else (WIN32)
+    add_test(SubDir ${CMAKE_CTEST_COMMAND}
       --build-and-test
       "${CMake_SOURCE_DIR}/Tests/SubDir"
       "${CMake_BINARY_DIR}/Tests/SubDir"
@@ -1247,22 +1247,22 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere"
       "${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.o"
       )
-  ENDIF (WIN32)
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDir")
+  endif (WIN32)
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDir")
 
-  IF(CMAKE_TEST_MSVC)
+  if(CMAKE_TEST_MSVC)
     ADD_TEST_MACRO(ForceInclude foo)
     ADD_TEST_MACRO(PrecompiledHeader foo)
-  ENDIF()
-  IF(CMAKE_TEST_MSVC OR
+  endif()
+  if(CMAKE_TEST_MSVC OR
       "${CMAKE_TEST_GENERATOR}" MATCHES "(MSYS|MinGW) Makefiles")
     ADD_TEST_MACRO(ModuleDefinition example_exe)
-  ENDIF()
+  endif()
 
   ADD_TEST_MACRO(CheckCompilerRelatedVariables CheckCompilerRelatedVariables)
 
-  IF("${CMAKE_TEST_GENERATOR}" MATCHES "Makefile")
-    ADD_TEST(MakeClean ${CMAKE_CTEST_COMMAND}
+  if("${CMAKE_TEST_GENERATOR}" MATCHES "Makefile")
+    add_test(MakeClean ${CMAKE_CTEST_COMMAND}
       --build-and-test
       "${CMake_SOURCE_DIR}/Tests/MakeClean"
       "${CMake_BINARY_DIR}/Tests/MakeClean"
@@ -1272,8 +1272,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-exe-dir "${CMake_BINARY_DIR}/MakeClean"
       --test-command check_clean
       )
-    LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MakeClean")
-  ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES "Makefile")
+    list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MakeClean")
+  endif("${CMAKE_TEST_GENERATOR}" MATCHES "Makefile")
 
   if(NOT DEFINED CTEST_RUN_MFC)
     set(CTEST_RUN_MFC OFF)
@@ -1380,12 +1380,12 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MFC")
   endif()
 
-  IF(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio")
-    IF(NOT MSVC60)
+  if(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio")
+    if(NOT MSVC60)
       ADD_TEST_MACRO(SBCS SBCS)
-    ENDIF(NOT MSVC60)
+    endif(NOT MSVC60)
 
-    ADD_TEST(VSExternalInclude ${CMAKE_CTEST_COMMAND}
+    add_test(VSExternalInclude ${CMAKE_CTEST_COMMAND}
       --build-and-test
       "${CMake_SOURCE_DIR}/Tests/VSExternalInclude"
       "${CMake_BINARY_DIR}/Tests/VSExternalInclude"
@@ -1394,9 +1394,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-project VSExternalInclude
       --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
       --test-command VSExternalInclude)
-    LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSExternalInclude")
+    list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSExternalInclude")
 
-    ADD_TEST(VSMidl ${CMAKE_CTEST_COMMAND}
+    add_test(VSMidl ${CMAKE_CTEST_COMMAND}
       --build-and-test
       "${CMake_SOURCE_DIR}/Tests/VSMidl"
       "${CMake_BINARY_DIR}/Tests/VSMidl"
@@ -1405,14 +1405,14 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-project VSMidl
       --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
       --test-command VSMidl)
-    LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSMidl")
-  ENDIF(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio")
+    list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSMidl")
+  endif(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio")
 
-  IF (APPLE)
+  if (APPLE)
     if (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
-      SET(BundleTestInstallDir
+      set(BundleTestInstallDir
         "${CMake_BINARY_DIR}/Tests/BundleTest/InstallDirectory")
-      ADD_TEST(BundleTest ${CMAKE_CTEST_COMMAND}
+      add_test(BundleTest ${CMAKE_CTEST_COMMAND}
         --build-and-test
         "${CMake_SOURCE_DIR}/Tests/BundleTest"
         "${CMake_BINARY_DIR}/Tests/BundleTest"
@@ -1426,9 +1426,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         "-DCMake_SOURCE_DIR:PATH=${CMake_SOURCE_DIR}"
         --test-command
         ${BundleTestInstallDir}/Applications/SecondBundleExe.app/Contents/MacOS/SecondBundleExe)
-      LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleTest")
+      list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleTest")
 
-      ADD_TEST(CFBundleTest ${CMAKE_CTEST_COMMAND}
+      add_test(CFBundleTest ${CMAKE_CTEST_COMMAND}
         --build-and-test
         "${CMake_SOURCE_DIR}/Tests/CFBundleTest"
         "${CMake_BINARY_DIR}/Tests/CFBundleTest"
@@ -1441,14 +1441,14 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         -Ddir=${CMake_BINARY_DIR}/Tests/CFBundleTest
         -Dgen=${CMAKE_TEST_GENERATOR}
         -P ${CMake_SOURCE_DIR}/Tests/CFBundleTest/VerifyResult.cmake)
-      LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CFBundleTest")
+      list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CFBundleTest")
 
       ADD_TEST_MACRO(ObjC++ ObjC++)
-    ENDIF (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
-  ENDIF (APPLE)
+    endif (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+  endif (APPLE)
 
-  IF(APPLE AND CTEST_TEST_CPACK)
-    ADD_TEST(BundleGeneratorTest ${CMAKE_CTEST_COMMAND}
+  if(APPLE AND CTEST_TEST_CPACK)
+    add_test(BundleGeneratorTest ${CMAKE_CTEST_COMMAND}
       --build-and-test
       "${CMake_SOURCE_DIR}/Tests/BundleGeneratorTest"
       "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest"
@@ -1459,10 +1459,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-target package
       --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/BundleGeneratorTest/InstallDirectory"
       )
-    LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest")
-  ENDIF(APPLE AND CTEST_TEST_CPACK)
+    list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest")
+  endif(APPLE AND CTEST_TEST_CPACK)
 
-  ADD_TEST(WarnUnusedUnusedViaSet ${CMAKE_CTEST_COMMAND}
+  add_test(WarnUnusedUnusedViaSet ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/VariableUnusedViaSet"
     "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaSet"
@@ -1471,13 +1471,13 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-noclean
     --build-project WarnUnusedUnusedViaSet
     --build-options "--warn-unused-vars")
-  SET_TESTS_PROPERTIES(WarnUnusedUnusedViaSet PROPERTIES
+  set_tests_properties(WarnUnusedUnusedViaSet PROPERTIES
     PASS_REGULAR_EXPRESSION "unused variable \\(changing definition\\) 'UNUSED_VARIABLE'")
-  SET_TESTS_PROPERTIES(WarnUnusedUnusedViaSet PROPERTIES
+  set_tests_properties(WarnUnusedUnusedViaSet PROPERTIES
     FAIL_REGULAR_EXPRESSION "unused variable \\(unsetting\\) 'UNUSED_VARIABLE'")
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaSet")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaSet")
 
-  ADD_TEST(WarnUnusedUnusedViaUnset ${CMAKE_CTEST_COMMAND}
+  add_test(WarnUnusedUnusedViaUnset ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/VariableUnusedViaUnset"
     "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaUnset"
@@ -1486,13 +1486,13 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-noclean
     --build-project WarnUnusedUnusedViaUnset
     --build-options "--warn-unused-vars")
-  SET_TESTS_PROPERTIES(WarnUnusedUnusedViaUnset PROPERTIES
+  set_tests_properties(WarnUnusedUnusedViaUnset PROPERTIES
     PASS_REGULAR_EXPRESSION "CMake Warning .*:7 \\(set\\):")
-  SET_TESTS_PROPERTIES(WarnUnusedUnusedViaUnset PROPERTIES
+  set_tests_properties(WarnUnusedUnusedViaUnset PROPERTIES
     FAIL_REGULAR_EXPRESSION "CMake Warning .*:5 \\(set\\):")
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaUnset")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaUnset")
 
-  ADD_TEST(WarnUnusedCliUnused ${CMAKE_CTEST_COMMAND}
+  add_test(WarnUnusedCliUnused ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/VariableUsage"
     "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused"
@@ -1501,11 +1501,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-noclean
     --build-project WarnUnusedCliUnused
     --build-options "-DUNUSED_CLI_VARIABLE=Unused")
-  SET_TESTS_PROPERTIES(WarnUnusedCliUnused PROPERTIES
+  set_tests_properties(WarnUnusedCliUnused PROPERTIES
     PASS_REGULAR_EXPRESSION "CMake Warning:.*Manually-specified variables were not used by the project:.*  UNUSED_CLI_VARIABLE")
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused")
 
-  ADD_TEST(WarnUnusedCliUsed ${CMAKE_CTEST_COMMAND}
+  add_test(WarnUnusedCliUsed ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/VariableUsage"
     "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUsed"
@@ -1514,13 +1514,13 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-noclean
     --build-project WarnUnusedCliUsed
     --build-options "-DUSED_VARIABLE=Usage proven")
-  SET_TESTS_PROPERTIES(WarnUnusedCliUsed PROPERTIES
+  set_tests_properties(WarnUnusedCliUsed PROPERTIES
     PASS_REGULAR_EXPRESSION "Usage proven")
-  SET_TESTS_PROPERTIES(WarnUnusedCliUsed PROPERTIES
+  set_tests_properties(WarnUnusedCliUsed PROPERTIES
     FAIL_REGULAR_EXPRESSION "CMake Warning: The variable, 'USED_VARIABLE'")
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUsed")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUsed")
 
-  ADD_TEST(WarnUninitialized ${CMAKE_CTEST_COMMAND}
+  add_test(WarnUninitialized ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/VariableUsage"
     "${CMake_BINARY_DIR}/Tests/WarnUninitialized"
@@ -1529,11 +1529,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-noclean
     --build-project WarnUninitialized
     --build-options "--warn-uninitialized")
-  SET_TESTS_PROPERTIES(WarnUninitialized PROPERTIES
+  set_tests_properties(WarnUninitialized PROPERTIES
     PASS_REGULAR_EXPRESSION "uninitialized variable 'USED_VARIABLE'")
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUninitialized")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUninitialized")
 
-  ADD_TEST(TestsWorkingDirectory ${CMAKE_CTEST_COMMAND}
+  add_test(TestsWorkingDirectory ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/TestsWorkingDirectory"
     "${CMake_BINARY_DIR}/Tests/TestsWorkingDirectory"
@@ -1544,200 +1544,200 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --force-new-ctest-process
     --test-command ${CMAKE_CTEST_COMMAND} -V -C \${CTEST_CONFIGURATION_TYPE}
     )
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestsWorkingDirectory")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestsWorkingDirectory")
 
   # Make sure CTest can handle a test with no newline in output.
-  ADD_TEST(CTest.NoNewline
+  add_test(CTest.NoNewline
     ${CMAKE_CMAKE_COMMAND} -E echo_append "This line has no newline!")
 
   # A simple test for ctest in script mode
-  CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in"
+  configure_file("${CMake_SOURCE_DIR}/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in"
           "${CMake_BINARY_DIR}/Tests/CTestScriptMode/CTestTestScriptMode.cmake" @ONLY)
-#  ADD_TEST(CTest.ScriptMode ${CMAKE_CTEST_COMMAND}
+#  add_test(CTest.ScriptMode ${CMAKE_CTEST_COMMAND}
 #        -S "${CMake_BINARY_DIR}/Tests/CTestScriptMode/CTestTestScriptMode.cmake"
 #        )
 
-  SET(CTEST_TEST_UPDATE 1)
-  IF(CTEST_TEST_UPDATE)
+  set(CTEST_TEST_UPDATE 1)
+  if(CTEST_TEST_UPDATE)
     # Test CTest Update with Subversion
-    FIND_PACKAGE(Subversion QUIET)
-    IF(Subversion_FOUND)
-      GET_FILENAME_COMPONENT(_Subversion_BIN_DIR
+    find_package(Subversion QUIET)
+    if(Subversion_FOUND)
+      get_filename_component(_Subversion_BIN_DIR
         ${Subversion_SVN_EXECUTABLE} PATH)
-      FIND_PROGRAM(Subversion_SVNADMIN_EXECUTABLE svnadmin
+      find_program(Subversion_SVNADMIN_EXECUTABLE svnadmin
         HINTS ${_Subversion_BIN_DIR}
         )
-      MARK_AS_ADVANCED(Subversion_SVNADMIN_EXECUTABLE)
-      IF(NOT Subversion_SVNADMIN_EXECUTABLE)
-        SET(Subversion_FOUND FALSE)
-      ENDIF(NOT Subversion_SVNADMIN_EXECUTABLE)
-    ENDIF(Subversion_FOUND)
-    IF(Subversion_FOUND)
-      SET(CTestUpdateSVN_DIR "CTest UpdateSVN")
-      CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestUpdateSVN.cmake.in"
+      mark_as_advanced(Subversion_SVNADMIN_EXECUTABLE)
+      if(NOT Subversion_SVNADMIN_EXECUTABLE)
+        set(Subversion_FOUND FALSE)
+      endif(NOT Subversion_SVNADMIN_EXECUTABLE)
+    endif(Subversion_FOUND)
+    if(Subversion_FOUND)
+      set(CTestUpdateSVN_DIR "CTest UpdateSVN")
+      configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateSVN.cmake.in"
         "${CMake_BINARY_DIR}/Tests/CTestUpdateSVN.cmake" @ONLY)
-      ADD_TEST(CTest.UpdateSVN ${CMAKE_CMAKE_COMMAND}
+      add_test(CTest.UpdateSVN ${CMAKE_CMAKE_COMMAND}
         -P "${CMake_BINARY_DIR}/Tests/CTestUpdateSVN.cmake"
         )
-      LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateSVN_DIR}")
-    ENDIF(Subversion_FOUND)
+      list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateSVN_DIR}")
+    endif(Subversion_FOUND)
 
     # Test CTest Update with CVS
-    IF(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake)
-      FIND_PACKAGE(CVS QUIET)
-    ELSE(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake)
-      FIND_PROGRAM(CVS_EXECUTABLE NAMES cvs)
-      SET(CVS_FOUND ${CVS_EXECUTABLE})
-    ENDIF(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake)
-    SET(CTEST_TEST_UPDATE_CVS ${CVS_FOUND})
-    IF(CTEST_TEST_UPDATE_CVS AND NOT UNIX)
-      IF("${CVS_EXECUTABLE}" MATCHES "cygwin")
-        MESSAGE(STATUS "No CTest.UpdateCVS test with cygwin cvs.exe outside cygwin!")
-        SET(CTEST_TEST_UPDATE_CVS 0)
-      ENDIF("${CVS_EXECUTABLE}" MATCHES "cygwin")
-    ENDIF(CTEST_TEST_UPDATE_CVS AND NOT UNIX)
-    IF(CTEST_TEST_UPDATE_CVS)
-      SET(CTestUpdateCVS_DIR "CTest UpdateCVS")
-      CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestUpdateCVS.cmake.in"
+    if(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake)
+      find_package(CVS QUIET)
+    else(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake)
+      find_program(CVS_EXECUTABLE NAMES cvs)
+      set(CVS_FOUND ${CVS_EXECUTABLE})
+    endif(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake)
+    set(CTEST_TEST_UPDATE_CVS ${CVS_FOUND})
+    if(CTEST_TEST_UPDATE_CVS AND NOT UNIX)
+      if("${CVS_EXECUTABLE}" MATCHES "cygwin")
+        message(STATUS "No CTest.UpdateCVS test with cygwin cvs.exe outside cygwin!")
+        set(CTEST_TEST_UPDATE_CVS 0)
+      endif("${CVS_EXECUTABLE}" MATCHES "cygwin")
+    endif(CTEST_TEST_UPDATE_CVS AND NOT UNIX)
+    if(CTEST_TEST_UPDATE_CVS)
+      set(CTestUpdateCVS_DIR "CTest UpdateCVS")
+      configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateCVS.cmake.in"
         "${CMake_BINARY_DIR}/Tests/CTestUpdateCVS.cmake" @ONLY)
-      ADD_TEST(CTest.UpdateCVS ${CMAKE_CMAKE_COMMAND}
+      add_test(CTest.UpdateCVS ${CMAKE_CMAKE_COMMAND}
         -P "${CMake_BINARY_DIR}/Tests/CTestUpdateCVS.cmake"
         )
-      LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateCVS_DIR}")
-    ENDIF(CTEST_TEST_UPDATE_CVS)
+      list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateCVS_DIR}")
+    endif(CTEST_TEST_UPDATE_CVS)
 
     # Test CTest Update with BZR
-    FIND_PROGRAM(BZR_EXECUTABLE NAMES bzr)
-    MARK_AS_ADVANCED(BZR_EXECUTABLE)
-    SET(CTEST_TEST_UPDATE_BZR 0)
-    IF(BZR_EXECUTABLE)
-      IF(NOT "${BZR_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
-        SET(CTEST_TEST_UPDATE_BZR 1)
-      ENDIF(NOT "${BZR_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
-    ENDIF(BZR_EXECUTABLE)
-    IF(CTEST_TEST_UPDATE_BZR)
+    find_program(BZR_EXECUTABLE NAMES bzr)
+    mark_as_advanced(BZR_EXECUTABLE)
+    set(CTEST_TEST_UPDATE_BZR 0)
+    if(BZR_EXECUTABLE)
+      if(NOT "${BZR_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
+        set(CTEST_TEST_UPDATE_BZR 1)
+      endif(NOT "${BZR_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
+    endif(BZR_EXECUTABLE)
+    if(CTEST_TEST_UPDATE_BZR)
       # Check if xmloutput plugin is there
-      EXECUTE_PROCESS(COMMAND ${BZR_EXECUTABLE} xmlplugins RESULT_VARIABLE xmlplugres
+      execute_process(COMMAND ${BZR_EXECUTABLE} xmlplugins RESULT_VARIABLE xmlplugres
         OUTPUT_QUIET ERROR_QUIET)
-      IF( NOT ${xmlplugres} )
-        SET(CTestUpdateBZR_DIR "CTest UpdateBZR")
-        CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestUpdateBZR.cmake.in"
+      if( NOT ${xmlplugres} )
+        set(CTestUpdateBZR_DIR "CTest UpdateBZR")
+        configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateBZR.cmake.in"
           "${CMake_BINARY_DIR}/Tests/CTestUpdateBZR.cmake" @ONLY)
-        ADD_TEST(CTest.UpdateBZR ${CMAKE_CMAKE_COMMAND}
+        add_test(CTest.UpdateBZR ${CMAKE_CMAKE_COMMAND}
           -P "${CMake_BINARY_DIR}/Tests/CTestUpdateBZR.cmake"
           )
-        LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateBZR_DIR}")
-        SET(CTestUpdateBZR_DIR "CTest UpdateBZR_CLocale")
-        CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestUpdateBZR.cmake.in"
+        list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateBZR_DIR}")
+        set(CTestUpdateBZR_DIR "CTest UpdateBZR_CLocale")
+        configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateBZR.cmake.in"
           "${CMake_BINARY_DIR}/Tests/CTestUpdateBZR_CLocale.cmake" @ONLY)
-        ADD_TEST(CTest.UpdateBZR.CLocale ${CMAKE_CMAKE_COMMAND}
+        add_test(CTest.UpdateBZR.CLocale ${CMAKE_CMAKE_COMMAND}
           -P "${CMake_BINARY_DIR}/Tests/CTestUpdateBZR_CLocale.cmake"
           )
-        SET_TESTS_PROPERTIES(CTest.UpdateBZR.CLocale PROPERTIES ENVIRONMENT LC_ALL=C)
-        LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateBZR_DIR}")
-      ENDIF( NOT ${xmlplugres} )
-    ENDIF(CTEST_TEST_UPDATE_BZR)
+        set_tests_properties(CTest.UpdateBZR.CLocale PROPERTIES ENVIRONMENT LC_ALL=C)
+        list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateBZR_DIR}")
+      endif( NOT ${xmlplugres} )
+    endif(CTEST_TEST_UPDATE_BZR)
 
     # Test CTest Update with GIT
-    FIND_PROGRAM(GIT_EXECUTABLE NAMES git)
-    MARK_AS_ADVANCED(GIT_EXECUTABLE)
-    SET(CTEST_TEST_UPDATE_GIT 0)
-    IF(GIT_EXECUTABLE)
-      IF(NOT "${GIT_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
-        SET(CTEST_TEST_UPDATE_GIT 1)
-      ENDIF(NOT "${GIT_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
-    ENDIF(GIT_EXECUTABLE)
-    IF(CTEST_TEST_UPDATE_GIT)
-      SET(CTestUpdateGIT_DIR "CTest UpdateGIT")
-      CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestUpdateGIT.cmake.in"
+    find_program(GIT_EXECUTABLE NAMES git)
+    mark_as_advanced(GIT_EXECUTABLE)
+    set(CTEST_TEST_UPDATE_GIT 0)
+    if(GIT_EXECUTABLE)
+      if(NOT "${GIT_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
+        set(CTEST_TEST_UPDATE_GIT 1)
+      endif(NOT "${GIT_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
+    endif(GIT_EXECUTABLE)
+    if(CTEST_TEST_UPDATE_GIT)
+      set(CTestUpdateGIT_DIR "CTest UpdateGIT")
+      configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateGIT.cmake.in"
         "${CMake_BINARY_DIR}/Tests/CTestUpdateGIT.cmake" @ONLY)
-      ADD_TEST(CTest.UpdateGIT ${CMAKE_CMAKE_COMMAND}
+      add_test(CTest.UpdateGIT ${CMAKE_CMAKE_COMMAND}
         -P "${CMake_BINARY_DIR}/Tests/CTestUpdateGIT.cmake"
         )
-      LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateGIT_DIR}")
-    ENDIF(CTEST_TEST_UPDATE_GIT)
+      list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateGIT_DIR}")
+    endif(CTEST_TEST_UPDATE_GIT)
 
     # Test CTest Update with HG
-    FIND_PROGRAM(HG_EXECUTABLE NAMES hg)
-    MARK_AS_ADVANCED(HG_EXECUTABLE)
-    SET(CTEST_TEST_UPDATE_HG 0)
-    IF(HG_EXECUTABLE)
-      IF(NOT "${HG_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
-        SET(CTEST_TEST_UPDATE_HG 1)
-      ENDIF(NOT "${HG_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
-    ENDIF(HG_EXECUTABLE)
-    IF(CTEST_TEST_UPDATE_HG)
-      SET(CTestUpdateHG_DIR "CTest UpdateHG")
-      CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestUpdateHG.cmake.in"
+    find_program(HG_EXECUTABLE NAMES hg)
+    mark_as_advanced(HG_EXECUTABLE)
+    set(CTEST_TEST_UPDATE_HG 0)
+    if(HG_EXECUTABLE)
+      if(NOT "${HG_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
+        set(CTEST_TEST_UPDATE_HG 1)
+      endif(NOT "${HG_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
+    endif(HG_EXECUTABLE)
+    if(CTEST_TEST_UPDATE_HG)
+      set(CTestUpdateHG_DIR "CTest UpdateHG")
+      configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateHG.cmake.in"
         "${CMake_BINARY_DIR}/Tests/CTestUpdateHG.cmake" @ONLY)
-      ADD_TEST(CTest.UpdateHG ${CMAKE_CMAKE_COMMAND}
+      add_test(CTest.UpdateHG ${CMAKE_CMAKE_COMMAND}
         -P "${CMake_BINARY_DIR}/Tests/CTestUpdateHG.cmake"
         )
-      LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateHG_DIR}")
-    ENDIF(CTEST_TEST_UPDATE_HG)
-  ENDIF(CTEST_TEST_UPDATE)
+      list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateHG_DIR}")
+    endif(CTEST_TEST_UPDATE_HG)
+  endif(CTEST_TEST_UPDATE)
 
-  CONFIGURE_FILE(
+  configure_file(
     "${CMake_SOURCE_DIR}/Tests/CTestTestFailure/testNoBuild.cmake.in"
     "${CMake_BINARY_DIR}/Tests/CTestTestFailure/testNoBuild.cmake"
     @ONLY ESCAPE_QUOTES)
-  ADD_TEST(CTestTestNoBuild ${CMAKE_CTEST_COMMAND}
+  add_test(CTestTestNoBuild ${CMAKE_CTEST_COMMAND}
     -S "${CMake_BINARY_DIR}/Tests/CTestTestFailure/testNoBuild.cmake" -V
     --output-log "${CMake_BINARY_DIR}/Tests/CTestTestFailure/testOut1.log"
     )
-  SET_TESTS_PROPERTIES(CTestTestNoBuild PROPERTIES
+  set_tests_properties(CTestTestNoBuild PROPERTIES
     FAIL_REGULAR_EXPRESSION "Error" WILL_FAIL true)
 
-  CONFIGURE_FILE(
+  configure_file(
     "${CMake_SOURCE_DIR}/Tests/CTestTestFailure/testNoExe.cmake.in"
     "${CMake_BINARY_DIR}/Tests/CTestTestFailure/testNoExe.cmake"
     @ONLY ESCAPE_QUOTES)
-  ADD_TEST(CTestTestNoExe ${CMAKE_CTEST_COMMAND}
+  add_test(CTestTestNoExe ${CMAKE_CTEST_COMMAND}
     -S "${CMake_BINARY_DIR}/Tests/CTestTestFailure/testNoExe.cmake" -V
     --output-log "${CMake_BINARY_DIR}/Tests/CTestTestFailure/testOut2.log"
     )
-  SET_TESTS_PROPERTIES(CTestTestNoExe PROPERTIES DEPENDS CTestTestNoBuild
+  set_tests_properties(CTestTestNoExe PROPERTIES DEPENDS CTestTestNoBuild
     PASS_REGULAR_EXPRESSION "Could not find executable"
     FAIL_REGULAR_EXPRESSION "SegFault")
 
-  CONFIGURE_FILE(
+  configure_file(
     "${CMake_SOURCE_DIR}/Tests/CTestTestUpload/test.cmake.in"
     "${CMake_BINARY_DIR}/Tests/CTestTestUpload/test.cmake"
     @ONLY ESCAPE_QUOTES)
-  ADD_TEST(CTestTestUpload ${CMAKE_CTEST_COMMAND}
+  add_test(CTestTestUpload ${CMAKE_CTEST_COMMAND}
     -S "${CMake_BINARY_DIR}/Tests/CTestTestUpload/test.cmake" -V
     --output-log "${CMake_BINARY_DIR}/Tests/CTestTestUpload/testOut.log"
     )
-  SET_TESTS_PROPERTIES(CTestTestUpload PROPERTIES
+  set_tests_properties(CTestTestUpload PROPERTIES
     PASS_REGULAR_EXPRESSION "Upload\\.xml")
 
-  CONFIGURE_FILE(
+  configure_file(
     "${CMake_SOURCE_DIR}/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in"
     "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir1/test1.cmake"
     @ONLY ESCAPE_QUOTES)
-  ADD_TEST(CTestTestConfigFileInBuildDir1 ${CMAKE_CTEST_COMMAND}
+  add_test(CTestTestConfigFileInBuildDir1 ${CMAKE_CTEST_COMMAND}
     -S "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir1/test1.cmake" -V
     --output-log "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir1/testOut1.log"
     )
   REGEX_ESCAPE_STRING(CTEST_TEST_ESCAPED_SOURCE_DIR "${CMake_SOURCE_DIR}")
-  SET_TESTS_PROPERTIES(CTestTestConfigFileInBuildDir1 PROPERTIES DEPENDS CTestTestNoBuild
+  set_tests_properties(CTestTestConfigFileInBuildDir1 PROPERTIES DEPENDS CTestTestNoBuild
     PASS_REGULAR_EXPRESSION
       "Reading ctest configuration file: ${CTEST_TEST_ESCAPED_SOURCE_DIR}.Tests.CTestTestConfigFileInBuildDir.CTestConfig.cmake")
 
-  CONFIGURE_FILE(
+  configure_file(
     "${CMake_SOURCE_DIR}/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in"
     "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/test2.cmake"
     @ONLY ESCAPE_QUOTES)
-  CONFIGURE_FILE(
+  configure_file(
     "${CMake_SOURCE_DIR}/Tests/CTestTestConfigFileInBuildDir/CTestConfig.cmake"
     "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/CTestConfig.cmake"
     @ONLY ESCAPE_QUOTES COPYONLY)
-  ADD_TEST(CTestTestConfigFileInBuildDir2 ${CMAKE_CTEST_COMMAND}
+  add_test(CTestTestConfigFileInBuildDir2 ${CMAKE_CTEST_COMMAND}
     -S "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/test2.cmake" -V
     --output-log "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/testOut2.log"
     )
   REGEX_ESCAPE_STRING(CTEST_TEST_ESCAPED_BINARY_DIR "${CMake_BINARY_DIR}")
-  SET_TESTS_PROPERTIES(CTestTestConfigFileInBuildDir2 PROPERTIES DEPENDS CTestTestNoBuild
+  set_tests_properties(CTestTestConfigFileInBuildDir2 PROPERTIES DEPENDS CTestTestNoBuild
     REQUIRED_FILES ${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/CTestConfig.cmake
     PASS_REGULAR_EXPRESSION
       "Reading ctest configuration file: ${CTEST_TEST_ESCAPED_BINARY_DIR}.Tests.CTestTestConfigFileInBuildDir2.CTestConfig.cmake")
@@ -1829,175 +1829,175 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
 
   ADD_TEST_MACRO(CMakeCommands.target_link_libraries target_link_libraries)
 
-  CONFIGURE_FILE(
+  configure_file(
     "${CMake_SOURCE_DIR}/Tests/CTestTestCrash/test.cmake.in"
     "${CMake_BINARY_DIR}/Tests/CTestTestCrash/test.cmake"
     @ONLY ESCAPE_QUOTES)
-  ADD_TEST(CTestTestCrash ${CMAKE_CTEST_COMMAND}
+  add_test(CTestTestCrash ${CMAKE_CTEST_COMMAND}
     -S "${CMake_BINARY_DIR}/Tests/CTestTestCrash/test.cmake" -V
     --output-log "${CMake_BINARY_DIR}/Tests/CTestTestCrash/testOutput.log"
     )
   # with watcom the SEGFAULT is not found, it just fails
-  IF(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake")
-    SET_TESTS_PROPERTIES(CTestTestCrash PROPERTIES
+  if(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake")
+    set_tests_properties(CTestTestCrash PROPERTIES
       PASS_REGULAR_EXPRESSION "Failed")
-  ELSE(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake")
-    SET_TESTS_PROPERTIES(CTestTestCrash PROPERTIES
+  else(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake")
+    set_tests_properties(CTestTestCrash PROPERTIES
       PASS_REGULAR_EXPRESSION "(Illegal|SegFault)")
-  ENDIF(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake")
+  endif(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake")
 
-  CONFIGURE_FILE(
+  configure_file(
     "${CMake_SOURCE_DIR}/Tests/CTestTestBadExe/test.cmake.in"
     "${CMake_BINARY_DIR}/Tests/CTestTestBadExe/test.cmake"
     @ONLY ESCAPE_QUOTES)
-  ADD_TEST(CTestTestBadExe ${CMAKE_CTEST_COMMAND}
+  add_test(CTestTestBadExe ${CMAKE_CTEST_COMMAND}
     -S "${CMake_BINARY_DIR}/Tests/CTestTestBadExe/test.cmake" -V
     --output-log "${CMake_BINARY_DIR}/Tests/CTestTestBadExe/testOutput.log"
     )
-  SET(CTestTestBadExe_REGEX "BAD_COMMAND")
+  set(CTestTestBadExe_REGEX "BAD_COMMAND")
   # some cygwin can not be made to produce a BAD_COMMAND error
   # the best we can get from it is a failed test
-  IF(CYGWIN)
-    SET(CTestTestBadExe_REGEX "(\\*\\*\\*Failed)|BAD_COMMAND")
-  ENDIF()
-  SET_TESTS_PROPERTIES(CTestTestBadExe PROPERTIES
+  if(CYGWIN)
+    set(CTestTestBadExe_REGEX "(\\*\\*\\*Failed)|BAD_COMMAND")
+  endif()
+  set_tests_properties(CTestTestBadExe PROPERTIES
     PASS_REGULAR_EXPRESSION "${CTestTestBadExe_REGEX}")
 
-  CONFIGURE_FILE(
+  configure_file(
     "${CMake_SOURCE_DIR}/Tests/CTestTestParallel/test.cmake.in"
     "${CMake_BINARY_DIR}/Tests/CTestTestParallel/test.cmake"
     @ONLY ESCAPE_QUOTES)
-  ADD_TEST(CTestTestParallel ${CMAKE_CTEST_COMMAND}
+  add_test(CTestTestParallel ${CMAKE_CTEST_COMMAND}
     -S "${CMake_BINARY_DIR}/Tests/CTestTestParallel/test.cmake" -V
     --output-log "${CMake_BINARY_DIR}/Tests/CTestTestParallel/testOutput.log"
     )
 
-  ADD_TEST(CTestTestPrintLabels ${CMAKE_CTEST_COMMAND} --print-labels)
-  SET_TESTS_PROPERTIES(CTestTestPrintLabels PROPERTIES LABELS "Label1;Label2")
-  SET_TESTS_PROPERTIES(CTestTestPrintLabels PROPERTIES PASS_REGULAR_EXPRESSION
+  add_test(CTestTestPrintLabels ${CMAKE_CTEST_COMMAND} --print-labels)
+  set_tests_properties(CTestTestPrintLabels PROPERTIES LABELS "Label1;Label2")
+  set_tests_properties(CTestTestPrintLabels PROPERTIES PASS_REGULAR_EXPRESSION
     "All Labels:.*  Label1.*  Label2")
 
-  CONFIGURE_FILE(
+  configure_file(
     "${CMake_SOURCE_DIR}/Tests/CTestTestResourceLock/test.cmake.in"
     "${CMake_BINARY_DIR}/Tests/CTestTestResourceLock/test.cmake"
     @ONLY ESCAPE_QUOTES)
-  ADD_TEST(CTestTestResourceLock ${CMAKE_CTEST_COMMAND}
+  add_test(CTestTestResourceLock ${CMAKE_CTEST_COMMAND}
     -S "${CMake_BINARY_DIR}/Tests/CTestTestResourceLock/test.cmake" -V
     --output-log "${CMake_BINARY_DIR}/Tests/CTestTestResourceLock/output.log"
     )
 
-  CONFIGURE_FILE(
+  configure_file(
     "${CMake_SOURCE_DIR}/Tests/CTestTestScheduler/test.cmake.in"
     "${CMake_BINARY_DIR}/Tests/CTestTestScheduler/test.cmake"
     @ONLY ESCAPE_QUOTES)
-  ADD_TEST(CTestTestScheduler ${CMAKE_CTEST_COMMAND}
+  add_test(CTestTestScheduler ${CMAKE_CTEST_COMMAND}
     -S "${CMake_BINARY_DIR}/Tests/CTestTestScheduler/test.cmake" -V
     --output-log "${CMake_BINARY_DIR}/Tests/CTestTestScheduler/testOutput.log"
     )
-  SET_TESTS_PROPERTIES(CTestTestScheduler PROPERTIES
+  set_tests_properties(CTestTestScheduler PROPERTIES
     PASS_REGULAR_EXPRESSION "Start 1.*Start 2.*Start 3.*Start 4.*Start 4.*Start 3.*Start 2.*Start 1"
     RESOURCE_LOCK "CostData")
 
-  CONFIGURE_FILE(
+  configure_file(
     "${CMake_SOURCE_DIR}/Tests/CTestTestCostSerial/test.cmake.in"
     "${CMake_BINARY_DIR}/Tests/CTestTestCostSerial/test.cmake"
     @ONLY ESCAPE_QUOTES)
-  ADD_TEST(CTestTestCostSerial ${CMAKE_CTEST_COMMAND}
+  add_test(CTestTestCostSerial ${CMAKE_CTEST_COMMAND}
     -S "${CMake_BINARY_DIR}/Tests/CTestTestCostSerial/test.cmake" -V
     --output-log "${CMake_BINARY_DIR}/Tests/CTestTestCostSerial/testOutput.log"
     )
-  SET_TESTS_PROPERTIES(CTestTestCostSerial PROPERTIES
+  set_tests_properties(CTestTestCostSerial PROPERTIES
     PASS_REGULAR_EXPRESSION "Start 2.*Start 3.*Start 1.*Start 2.*Start 3.*Start 1"
     RESOURCE_LOCK "CostData")
 
-  CONFIGURE_FILE(
+  configure_file(
     "${CMake_SOURCE_DIR}/Tests/CTestTestStopTime/test.cmake.in"
     "${CMake_BINARY_DIR}/Tests/CTestTestStopTime/test.cmake"
     @ONLY ESCAPE_QUOTES)
-  CONFIGURE_FILE(
+  configure_file(
     "${CMake_SOURCE_DIR}/Tests/CTestTestStopTime/GetDate.cmake"
     "${CMake_BINARY_DIR}/Tests/CTestTestStopTime/GetDate.cmake"
     COPYONLY)
-  ADD_TEST(CTestTestStopTime ${CMAKE_CTEST_COMMAND}
+  add_test(CTestTestStopTime ${CMAKE_CTEST_COMMAND}
     -S "${CMake_BINARY_DIR}/Tests/CTestTestStopTime/test.cmake" -V
     --output-log "${CMake_BINARY_DIR}/Tests/CTestTestStopTime/testOutput.log"
     )
-  SET_TESTS_PROPERTIES(CTestTestStopTime PROPERTIES
+  set_tests_properties(CTestTestStopTime PROPERTIES
     PASS_REGULAR_EXPRESSION "The stop time has been passed")
 
-  CONFIGURE_FILE(
+  configure_file(
     "${CMake_SOURCE_DIR}/Tests/CTestTestSubdir/test.cmake.in"
     "${CMake_BINARY_DIR}/Tests/CTestTestSubdir/test.cmake"
     @ONLY ESCAPE_QUOTES)
-  ADD_TEST(CTestTestSubdir ${CMAKE_CTEST_COMMAND}
+  add_test(CTestTestSubdir ${CMAKE_CTEST_COMMAND}
     -S "${CMake_BINARY_DIR}/Tests/CTestTestSubdir/test.cmake" -V
     --output-log "${CMake_BINARY_DIR}/Tests/CTestTestSubdir/testOutput.log"
     )
   #make sure all 3 subdirs were added
-  SET_TESTS_PROPERTIES(CTestTestSubdir PROPERTIES
+  set_tests_properties(CTestTestSubdir PROPERTIES
     PASS_REGULAR_EXPRESSION "0 tests failed out of 3")
 
-  CONFIGURE_FILE(
+  configure_file(
     "${CMake_SOURCE_DIR}/Tests/CTestTestTimeout/test.cmake.in"
     "${CMake_BINARY_DIR}/Tests/CTestTestTimeout/test.cmake"
     @ONLY ESCAPE_QUOTES)
-  ADD_TEST(CTestTestTimeout ${CMAKE_CTEST_COMMAND}
+  add_test(CTestTestTimeout ${CMAKE_CTEST_COMMAND}
     -C "\${CTestTest_CONFIG}"
     -S "${CMake_BINARY_DIR}/Tests/CTestTestTimeout/test.cmake" -V
     --output-log "${CMake_BINARY_DIR}/Tests/CTestTestTimeout/testOutput.log"
     )
-  SET_TESTS_PROPERTIES(CTestTestTimeout PROPERTIES
+  set_tests_properties(CTestTestTimeout PROPERTIES
     PASS_REGULAR_EXPRESSION "TestTimeout *\\.+ *\\*\\*\\*Timeout.*CheckChild *\\.+ *Passed")
 
-  CONFIGURE_FILE(
+  configure_file(
     "${CMake_SOURCE_DIR}/Tests/CTestTestZeroTimeout/test.cmake.in"
     "${CMake_BINARY_DIR}/Tests/CTestTestZeroTimeout/test.cmake"
     @ONLY ESCAPE_QUOTES)
-  ADD_TEST(CTestTestZeroTimeout ${CMAKE_CTEST_COMMAND}
+  add_test(CTestTestZeroTimeout ${CMAKE_CTEST_COMMAND}
     -S "${CMake_BINARY_DIR}/Tests/CTestTestZeroTimeout/test.cmake" -V
     --output-log
     "${CMake_BINARY_DIR}/Tests/CTestTestZeroTimeout/testOutput.log")
-  SET_TESTS_PROPERTIES(CTestTestZeroTimeout PROPERTIES
+  set_tests_properties(CTestTestZeroTimeout PROPERTIES
     FAIL_REGULAR_EXPRESSION "\\*\\*\\*Timeout")
 
-  CONFIGURE_FILE(
+  configure_file(
     "${CMake_SOURCE_DIR}/Tests/CTestTestDepends/test.cmake.in"
     "${CMake_BINARY_DIR}/Tests/CTestTestDepends/test.cmake"
     @ONLY ESCAPE_QUOTES)
-  ADD_TEST(CTestTestDepends ${CMAKE_CTEST_COMMAND}
+  add_test(CTestTestDepends ${CMAKE_CTEST_COMMAND}
     -C "\${CTestTest_CONFIG}"
     -S "${CMake_BINARY_DIR}/Tests/CTestTestDepends/test.cmake" -V
     --output-log "${CMake_BINARY_DIR}/Tests/CTestTestDepends/testOutput.log"
     )
 
-  CONFIGURE_FILE(
+  configure_file(
     "${CMake_SOURCE_DIR}/Tests/CTestTestCycle/test.cmake.in"
     "${CMake_BINARY_DIR}/Tests/CTestTestCycle/test.cmake"
     @ONLY ESCAPE_QUOTES)
-  ADD_TEST(CTestTestCycle ${CMAKE_CTEST_COMMAND}
+  add_test(CTestTestCycle ${CMAKE_CTEST_COMMAND}
     -C "\${CTestTest_CONFIG}"
     -S "${CMake_BINARY_DIR}/Tests/CTestTestCycle/test.cmake" -V
     --output-log "${CMake_BINARY_DIR}/Tests/CTestTestCycle/testOutput.log"
     )
-  SET_TESTS_PROPERTIES(CTestTestCycle PROPERTIES
+  set_tests_properties(CTestTestCycle PROPERTIES
     PASS_REGULAR_EXPRESSION "a cycle exists in the test dependency graph")
 
-  CONFIGURE_FILE(
+  configure_file(
     "${CMake_SOURCE_DIR}/Tests/CTestTestRunScript/test.cmake.in"
     "${CMake_BINARY_DIR}/Tests/CTestTestRunScript/test.cmake"
     @ONLY ESCAPE_QUOTES)
-  CONFIGURE_FILE(
+  configure_file(
     "${CMake_SOURCE_DIR}/Tests/CTestTestRunScript/hello.cmake.in"
     "${CMake_BINARY_DIR}/Tests/CTestTestRunScript/hello.cmake"
     @ONLY ESCAPE_QUOTES)
-  ADD_TEST(CTestTestRunScript ${CMAKE_CTEST_COMMAND}
+  add_test(CTestTestRunScript ${CMAKE_CTEST_COMMAND}
     -S "${CMake_BINARY_DIR}/Tests/CTestTestRunScript/test.cmake" -V
     --output-log "${CMake_BINARY_DIR}/Tests/CTestTestRunScript/testOutput.log"
     )
 
-  ADD_TEST(CTestTestShowOnly ${CMAKE_CTEST_COMMAND} -N)
+  add_test(CTestTestShowOnly ${CMAKE_CTEST_COMMAND} -N)
 
-  ADD_TEST(CTestBatchTest ${CMAKE_CTEST_COMMAND} -B)
+  add_test(CTestBatchTest ${CMAKE_CTEST_COMMAND} -B)
 
   # Use macro, not function so that build can still be driven by CMake 2.4.
   # After 2.6 is required, this could be a function without the extra 'set'
@@ -2048,120 +2048,120 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
   endforeach()
 
 
-  IF (CMAKE_TESTS_CDASH_SERVER)
-    SET(regex "^([^:]+)://([^/]+)(/.*)$")
+  if (CMAKE_TESTS_CDASH_SERVER)
+    set(regex "^([^:]+)://([^/]+)(/.*)$")
 
-    IF ("${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}")
-      SET(protocol "${CMAKE_MATCH_1}")
-      SET(server "${CMAKE_MATCH_2}")
-      SET(path "${CMAKE_MATCH_3}")
-    ELSE ("${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}")
-      SET(protocol "http")
-      SET(server "www.cdash.org")
-      SET(path "/CDash")
-      MESSAGE("warning: CMAKE_TESTS_CDASH_SERVER does not match expected regex...")
-      MESSAGE("         ...using default url='${protocol}://${server}${path}' for CTestTest[23]")
-    ENDIF ("${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}")
-  ENDIF (CMAKE_TESTS_CDASH_SERVER)
+    if ("${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}")
+      set(protocol "${CMAKE_MATCH_1}")
+      set(server "${CMAKE_MATCH_2}")
+      set(path "${CMAKE_MATCH_3}")
+    else ("${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}")
+      set(protocol "http")
+      set(server "www.cdash.org")
+      set(path "/CDash")
+      message("warning: CMAKE_TESTS_CDASH_SERVER does not match expected regex...")
+      message("         ...using default url='${protocol}://${server}${path}' for CTestTest[23]")
+    endif ("${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}")
+  endif (CMAKE_TESTS_CDASH_SERVER)
 
 
-  IF (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS AND CMAKE_TESTS_CDASH_SERVER)
-    CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestTest/test.cmake.in"
+  if (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS AND CMAKE_TESTS_CDASH_SERVER)
+    configure_file("${CMake_SOURCE_DIR}/Tests/CTestTest/test.cmake.in"
       "${CMake_BINARY_DIR}/Tests/CTestTest/test.cmake" @ONLY ESCAPE_QUOTES)
-    ADD_TEST(CTestTest ${CMAKE_CTEST_COMMAND}
+    add_test(CTestTest ${CMAKE_CTEST_COMMAND}
       -S "${CMake_BINARY_DIR}/Tests/CTestTest/test.cmake" -V
       --output-log "${CMake_BINARY_DIR}/Tests/CTestTest/testOutput.log"
       )
 
-    CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestTest2/test.cmake.in"
+    configure_file("${CMake_SOURCE_DIR}/Tests/CTestTest2/test.cmake.in"
       "${CMake_BINARY_DIR}/Tests/CTestTest2/test.cmake" @ONLY ESCAPE_QUOTES)
-    ADD_TEST(CTestTest2 ${CMAKE_CTEST_COMMAND}
+    add_test(CTestTest2 ${CMAKE_CTEST_COMMAND}
       -S "${CMake_BINARY_DIR}/Tests/CTestTest2/test.cmake" -V
       --output-log "${CMake_BINARY_DIR}/Tests/CTestTest2/testOutput.log"
       )
 
-    CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestTestChecksum/test.cmake.in"
+    configure_file("${CMake_SOURCE_DIR}/Tests/CTestTestChecksum/test.cmake.in"
       "${CMake_BINARY_DIR}/Tests/CTestTestChecksum/test.cmake" @ONLY
       ESCAPE_QUOTES)
-    ADD_TEST(CTestTestChecksum ${CMAKE_CTEST_COMMAND}
+    add_test(CTestTestChecksum ${CMAKE_CTEST_COMMAND}
       -S "${CMake_BINARY_DIR}/Tests/CTestTestChecksum/test.cmake" -V
       --output-log
       "${CMake_BINARY_DIR}/Tests/CTestTestChecksum/testOutput.log"
       )
-    SET_TESTS_PROPERTIES(CTestTestChecksum PROPERTIES PASS_REGULAR_EXPRESSION
+    set_tests_properties(CTestTestChecksum PROPERTIES PASS_REGULAR_EXPRESSION
       "Submission failed: Checksum failed for file")
 
     # these tests take a long time, make sure they have it
     # if timeouts have not already been set
-    GET_TEST_PROPERTY(CTestTest TIMEOUT PREVIOUS_TIMEOUT)
-    IF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
-      SET_TESTS_PROPERTIES ( CTestTest
+    get_test_property(CTestTest TIMEOUT PREVIOUS_TIMEOUT)
+    if ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
+      set_tests_properties ( CTestTest
         PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT})
-    ENDIF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
+    endif ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
 
-    GET_TEST_PROPERTY(CTestTest2 TIMEOUT PREVIOUS_TIMEOUT)
-    IF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
-      SET_TESTS_PROPERTIES ( CTestTest2
+    get_test_property(CTestTest2 TIMEOUT PREVIOUS_TIMEOUT)
+    if ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
+      set_tests_properties ( CTestTest2
         PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT})
-    ENDIF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
-  ENDIF (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS AND CMAKE_TESTS_CDASH_SERVER)
+    endif ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
+  endif (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS AND CMAKE_TESTS_CDASH_SERVER)
 
-  IF (CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH)
-    IF(UNIX)
-      IF(NOT QT4_FOUND)
-         FIND_PACKAGE(Qt4)
-      ENDIF(NOT QT4_FOUND)
+  if (CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH)
+    if(UNIX)
+      if(NOT QT4_FOUND)
+         find_package(Qt4)
+      endif(NOT QT4_FOUND)
 
-      SET(TRY_BUILD_KDE4 TRUE)
-      IF(QT4_FOUND)
+      set(TRY_BUILD_KDE4 TRUE)
+      if(QT4_FOUND)
         # check whether it's Qt 4.5 in a cmake 2.4. compatible way:
-        IF(NOT EXISTS "${QT_QTNETWORK_INCLUDE_DIR}/QAbstractNetworkCache")
-          SET(TRY_BUILD_KDE4 FALSE)
-        ENDIF(NOT EXISTS "${QT_QTNETWORK_INCLUDE_DIR}/QAbstractNetworkCache")
-      ELSE(QT4_FOUND)
-        SET(TRY_BUILD_KDE4 FALSE)
-      ENDIF(QT4_FOUND)
+        if(NOT EXISTS "${QT_QTNETWORK_INCLUDE_DIR}/QAbstractNetworkCache")
+          set(TRY_BUILD_KDE4 FALSE)
+        endif(NOT EXISTS "${QT_QTNETWORK_INCLUDE_DIR}/QAbstractNetworkCache")
+      else(QT4_FOUND)
+        set(TRY_BUILD_KDE4 FALSE)
+      endif(QT4_FOUND)
 
-      FIND_PACKAGE(Perl)
-      IF(NOT PERL_FOUND)
-        SET(TRY_BUILD_KDE4 FALSE)
-      ENDIF(NOT PERL_FOUND)
+      find_package(Perl)
+      if(NOT PERL_FOUND)
+        set(TRY_BUILD_KDE4 FALSE)
+      endif(NOT PERL_FOUND)
 
-      FIND_PACKAGE(ZLIB)
-      IF(NOT ZLIB_FOUND)
-        SET(TRY_BUILD_KDE4 FALSE)
-      ENDIF(NOT ZLIB_FOUND)
+      find_package(ZLIB)
+      if(NOT ZLIB_FOUND)
+        set(TRY_BUILD_KDE4 FALSE)
+      endif(NOT ZLIB_FOUND)
 
-      IF(TRY_BUILD_KDE4)
-        FILE(MAKE_DIRECTORY ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest)
-        SET(TEST_KDE4_BASE_DIR ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest)
-        CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh.in ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh @ONLY)
-        EXECUTE_PROCESS(COMMAND chmod 755 ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh )
-        ADD_TEST(KDE4StableBranchTest ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh)
-      ENDIF(TRY_BUILD_KDE4)
+      if(TRY_BUILD_KDE4)
+        file(MAKE_DIRECTORY ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest)
+        set(TEST_KDE4_BASE_DIR ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest)
+        configure_file(${CMake_SOURCE_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh.in ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh @ONLY)
+        execute_process(COMMAND chmod 755 ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh )
+        add_test(KDE4StableBranchTest ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh)
+      endif(TRY_BUILD_KDE4)
 
-    ENDIF(UNIX)
-  ENDIF (CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH)
+    endif(UNIX)
+  endif (CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH)
 
-  IF("${CMAKE_TEST_GENERATOR}" MATCHES Xcode)
-    SET(CMAKE_SKIP_BOOTSTRAP_TEST 1)
-  ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES Xcode)
-  IF(EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt")
+  if("${CMAKE_TEST_GENERATOR}" MATCHES Xcode)
+    set(CMAKE_SKIP_BOOTSTRAP_TEST 1)
+  endif("${CMAKE_TEST_GENERATOR}" MATCHES Xcode)
+  if(EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt")
     # If there is CMakeLists.txt in the binary tree, assume in-source build
-    SET(CMAKE_SKIP_BOOTSTRAP_TEST 1)
-  ENDIF(EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt")
-  SET(bootstrap "")
-  IF(CMAKE_RUN_LONG_TESTS AND NOT CMAKE_SKIP_BOOTSTRAP_TEST)
-    IF(UNIX)
-      SET(bootstrap ${CMake_SOURCE_DIR}/bootstrap)
-    ELSEIF(MSYS)
-      CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/bootstrap.bat.in
+    set(CMAKE_SKIP_BOOTSTRAP_TEST 1)
+  endif(EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt")
+  set(bootstrap "")
+  if(CMAKE_RUN_LONG_TESTS AND NOT CMAKE_SKIP_BOOTSTRAP_TEST)
+    if(UNIX)
+      set(bootstrap ${CMake_SOURCE_DIR}/bootstrap)
+    elseif(MSYS)
+      configure_file(${CMAKE_CURRENT_SOURCE_DIR}/bootstrap.bat.in
                      ${CMAKE_CURRENT_BINARY_DIR}/bootstrap.bat @ONLY)
-      SET(bootstrap ${CMAKE_CURRENT_BINARY_DIR}/bootstrap.bat)
-    ENDIF()
-  ENDIF()
-  IF(bootstrap)
-    ADD_TEST(BootstrapTest ${CMAKE_CTEST_COMMAND}
+      set(bootstrap ${CMAKE_CURRENT_BINARY_DIR}/bootstrap.bat)
+    endif()
+  endif()
+  if(bootstrap)
+    add_test(BootstrapTest ${CMAKE_CTEST_COMMAND}
       --build-and-test
       ${CMake_SOURCE_DIR}
       ${CMake_BINARY_DIR}/Tests/BootstrapTest
@@ -2171,20 +2171,20 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-generator "${CMAKE_TEST_GENERATOR}"
       --test-command
       ${CMake_BINARY_DIR}/Tests/BootstrapTest/Bootstrap.cmk/cmake)
-    LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BootstrapTest")
+    list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BootstrapTest")
     # Make this test run early during parallel execution
-    SET_TESTS_PROPERTIES(BootstrapTest PROPERTIES COST 5000)
+    set_tests_properties(BootstrapTest PROPERTIES COST 5000)
 
     # provide more time for the bootstrap test
-    GET_TEST_PROPERTY(BootstrapTest TIMEOUT PREVIOUS_TIMEOUT)
-    IF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
-      SET_TESTS_PROPERTIES ( BootstrapTest
+    get_test_property(BootstrapTest TIMEOUT PREVIOUS_TIMEOUT)
+    if ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
+      set_tests_properties ( BootstrapTest
         PROPERTIES TIMEOUT 5400)
-    ENDIF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
-  ENDIF()
+    endif ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
+  endif()
 
-  IF(CMAKE_Fortran_COMPILER)
-    ADD_TEST(Fortran ${CMAKE_CTEST_COMMAND}
+  if(CMAKE_Fortran_COMPILER)
+    add_test(Fortran ${CMAKE_CTEST_COMMAND}
       --build-and-test
       "${CMake_SOURCE_DIR}/Tests/Fortran"
       "${CMake_BINARY_DIR}/Tests/Fortran"
@@ -2193,17 +2193,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
       --build-two-config
       --test-command testf)
-    LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Fortran")
+    list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Fortran")
 
     # FortranCInterface tests.
-    IF(UNIX)
-      CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/FortranC/Flags.cmake.in
+    if(UNIX)
+      configure_file(${CMAKE_CURRENT_SOURCE_DIR}/FortranC/Flags.cmake.in
         ${CMAKE_CURRENT_BINARY_DIR}/FortranC/Flags.cmake @ONLY)
-      ADD_TEST(FortranC.Flags ${CMAKE_CMAKE_COMMAND} -P
+      add_test(FortranC.Flags ${CMAKE_CMAKE_COMMAND} -P
         ${CMAKE_CURRENT_BINARY_DIR}/FortranC/Flags.cmake)
-      LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranC/Flags")
-    ELSE()
-      ADD_TEST(FortranC ${CMAKE_CTEST_COMMAND}
+      list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranC/Flags")
+    else()
+      add_test(FortranC ${CMAKE_CTEST_COMMAND}
         --build-and-test
         "${CMake_SOURCE_DIR}/Tests/FortranC"
         "${CMake_BINARY_DIR}/Tests/FortranC"
@@ -2212,21 +2212,21 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
         --build-two-config
         --test-command CMakeFiles/FortranCInterface/FortranCInterface)
-      LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranC")
-    ENDIF()
-  ENDIF()
+      list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranC")
+    endif()
+  endif()
 
   find_package(Java COMPONENTS Development QUIET)
-  IF(Java_JAVA_EXECUTABLE AND Java_JAVAC_EXECUTABLE AND Java_JAR_EXECUTABLE AND NOT MINGW
+  if(Java_JAVA_EXECUTABLE AND Java_JAVAC_EXECUTABLE AND Java_JAR_EXECUTABLE AND NOT MINGW
       AND NOT "${CMAKE_TEST_GENERATOR}" MATCHES "Xcode")
-    GET_FILENAME_COMPONENT(JNIPATH ${JAVA_COMPILE} PATH)
-    FIND_FILE(JNI_H jni.h
+    get_filename_component(JNIPATH ${JAVA_COMPILE} PATH)
+    find_file(JNI_H jni.h
       "${JNIPATH}/../include"
       "${JNIPATH}/../java/include")
-    IF(JNI_H AND EXISTS "${JNI_H}") # in case jni.h is a broken symlink
-      FILE(READ "${JNI_H}" JNI_FILE)
-      IF("${JNI_FILE}" MATCHES "JDK1_2")
-        ADD_TEST(Java ${CMAKE_CTEST_COMMAND}
+    if(JNI_H AND EXISTS "${JNI_H}") # in case jni.h is a broken symlink
+      file(READ "${JNI_H}" JNI_FILE)
+      if("${JNI_FILE}" MATCHES "JDK1_2")
+        add_test(Java ${CMAKE_CTEST_COMMAND}
           --build-and-test
           "${CMake_SOURCE_DIR}/Tests/Java"
           "${CMake_BINARY_DIR}/Tests/Java"
@@ -2236,19 +2236,19 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
           --build-two-config
           --build-run-dir "${CMake_BINARY_DIR}/Tests/Java/"
           --test-command ${JAVA_RUNTIME} -classpath hello.jar HelloWorld)
-        LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Java")
-      ENDIF("${JNI_FILE}" MATCHES "JDK1_2")
-    ENDIF()
-  ENDIF()
+        list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Java")
+      endif("${JNI_FILE}" MATCHES "JDK1_2")
+    endif()
+  endif()
 
   # add some cross compiler tests, for now only with makefile based generators
-  IF(CMAKE_TEST_GENERATOR MATCHES "Makefiles" OR CMAKE_TEST_GENERATOR MATCHES "KDevelop")
+  if(CMAKE_TEST_GENERATOR MATCHES "Makefiles" OR CMAKE_TEST_GENERATOR MATCHES "KDevelop")
 
     # if sdcc is found, build the SimpleCOnly project with sdcc
-    FIND_PROGRAM(SDCC_EXECUTABLE sdcc)
-    MARK_AS_ADVANCED(SDCC_EXECUTABLE)
-    IF(SDCC_EXECUTABLE)
-      ADD_TEST(SimpleCOnly_sdcc ${CMAKE_CTEST_COMMAND}
+    find_program(SDCC_EXECUTABLE sdcc)
+    mark_as_advanced(SDCC_EXECUTABLE)
+    if(SDCC_EXECUTABLE)
+      add_test(SimpleCOnly_sdcc ${CMAKE_CTEST_COMMAND}
         --build-and-test
         "${CMake_SOURCE_DIR}/Tests/SimpleCOnly"
         "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc"
@@ -2258,16 +2258,16 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         --build-options
         "-DCMAKE_SYSTEM_NAME=Generic"
         "-DCMAKE_C_COMPILER=${SDCC_EXECUTABLE}")
-      LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc")
-    ENDIF(SDCC_EXECUTABLE)
+      list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc")
+    endif(SDCC_EXECUTABLE)
 
     # If a Linux -> MinGW cross compiler is found then try it
-    FIND_PROGRAM(MINGW_CC_LINUX2WIN_EXECUTABLE i586-mingw32msvc-gcc)
-    FIND_PROGRAM(MINGW_CXX_LINUX2WIN_EXECUTABLE i586-mingw32msvc-g++)
-    FIND_PROGRAM(MINGW_RC_LINUX2WIN_EXECUTABLE i586-mingw32msvc-windres)
-    MARK_AS_ADVANCED(MINGW_CC_LINUX2WIN_EXECUTABLE MINGW_CXX_LINUX2WIN_EXECUTABLE MINGW_RC_LINUX2WIN_EXECUTABLE)
-    IF(MINGW_CC_LINUX2WIN_EXECUTABLE AND MINGW_CXX_LINUX2WIN_EXECUTABLE AND MINGW_RC_LINUX2WIN_EXECUTABLE)
-      ADD_TEST(Simple_Mingw_Linux2Win ${CMAKE_CTEST_COMMAND}
+    find_program(MINGW_CC_LINUX2WIN_EXECUTABLE i586-mingw32msvc-gcc)
+    find_program(MINGW_CXX_LINUX2WIN_EXECUTABLE i586-mingw32msvc-g++)
+    find_program(MINGW_RC_LINUX2WIN_EXECUTABLE i586-mingw32msvc-windres)
+    mark_as_advanced(MINGW_CC_LINUX2WIN_EXECUTABLE MINGW_CXX_LINUX2WIN_EXECUTABLE MINGW_RC_LINUX2WIN_EXECUTABLE)
+    if(MINGW_CC_LINUX2WIN_EXECUTABLE AND MINGW_CXX_LINUX2WIN_EXECUTABLE AND MINGW_RC_LINUX2WIN_EXECUTABLE)
+      add_test(Simple_Mingw_Linux2Win ${CMAKE_CTEST_COMMAND}
         --build-and-test
         "${CMake_SOURCE_DIR}/Tests/Simple"
         "${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win"
@@ -2280,63 +2280,63 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         "-DCMAKE_CXX_COMPILER=${MINGW_CXX_LINUX2WIN_EXECUTABLE}"
         "-DCMAKE_RC_COMPILER=${MINGW_RC_LINUX2WIN_EXECUTABLE}"
         )
-      LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win")
-    ENDIF()
-  ENDIF(CMAKE_TEST_GENERATOR MATCHES "Makefiles" OR CMAKE_TEST_GENERATOR MATCHES "KDevelop")
+      list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win")
+    endif()
+  endif(CMAKE_TEST_GENERATOR MATCHES "Makefiles" OR CMAKE_TEST_GENERATOR MATCHES "KDevelop")
 
-  IF(UNIX)
-    STRING(COMPARE EQUAL "${CMAKE_INSTALL_PREFIX}" "${CMake_BINARY_DIR}/Tests/TestShellInstall/Prefix"
+  if(UNIX)
+    string(COMPARE EQUAL "${CMAKE_INSTALL_PREFIX}" "${CMake_BINARY_DIR}/Tests/TestShellInstall/Prefix"
       PREFIX_IS_FOR_TEST)
-    IF(PREFIX_IS_FOR_TEST)
-      CONFIGURE_FILE(
+    if(PREFIX_IS_FOR_TEST)
+      configure_file(
         ${CMake_SOURCE_DIR}/Tests/TestInstall.sh.in
         ${CMake_BINARY_DIR}/Tests/TestShellInstall/TestInstall.sh
         @ONLY IMMEDIATE
         )
-      ADD_TEST(ShellInstall /bin/sh ${CMake_BINARY_DIR}/Tests/TestShellInstall/TestShellInstall.sh)
-    ENDIF(PREFIX_IS_FOR_TEST)
-  ENDIF(UNIX)
+      add_test(ShellInstall /bin/sh ${CMake_BINARY_DIR}/Tests/TestShellInstall/TestShellInstall.sh)
+    endif(PREFIX_IS_FOR_TEST)
+  endif(UNIX)
 
-  IF(CMAKE_TEST_PROJECT_CSE_DIR)
-    SET(script "${CMAKE_TEST_PROJECT_CSE_DIR}/BuildProjectCSE.cmake")
-    IF(NOT EXISTS "${script}")
-      SET(script "${CMAKE_TEST_PROJECT_CSE_DIR}/cse_build.cmake")
-    ENDIF(NOT EXISTS "${script}")
-    IF(NOT EXISTS "${script}")
-      MESSAGE("warning: CMAKE_TEST_PROJECT_CSE_DIR set, but no build script found...")
-    ENDIF(NOT EXISTS "${script}")
+  if(CMAKE_TEST_PROJECT_CSE_DIR)
+    set(script "${CMAKE_TEST_PROJECT_CSE_DIR}/BuildProjectCSE.cmake")
+    if(NOT EXISTS "${script}")
+      set(script "${CMAKE_TEST_PROJECT_CSE_DIR}/cse_build.cmake")
+    endif(NOT EXISTS "${script}")
+    if(NOT EXISTS "${script}")
+      message("warning: CMAKE_TEST_PROJECT_CSE_DIR set, but no build script found...")
+    endif(NOT EXISTS "${script}")
 
-    ADD_TEST(BuildCSE ${CMAKE_CTEST_COMMAND} -V -S "${script}")
-    SET_TESTS_PROPERTIES(BuildCSE PROPERTIES TIMEOUT 5400)
-  ENDIF(CMAKE_TEST_PROJECT_CSE_DIR)
+    add_test(BuildCSE ${CMAKE_CTEST_COMMAND} -V -S "${script}")
+    set_tests_properties(BuildCSE PROPERTIES TIMEOUT 5400)
+  endif(CMAKE_TEST_PROJECT_CSE_DIR)
 
-  IF(CMAKE_TEST_PLPLOT_DIR)
-    ADD_TEST(plplot ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_PLPLOT_DIR}/../../EasyDashboardScripts/plplot.cmake )
-    SET_TESTS_PROPERTIES ( plplot PROPERTIES TIMEOUT 5400)
-  ENDIF(CMAKE_TEST_PLPLOT_DIR)
+  if(CMAKE_TEST_PLPLOT_DIR)
+    add_test(plplot ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_PLPLOT_DIR}/../../EasyDashboardScripts/plplot.cmake )
+    set_tests_properties ( plplot PROPERTIES TIMEOUT 5400)
+  endif(CMAKE_TEST_PLPLOT_DIR)
 
-  IF(CMAKE_TEST_CHICKEN_DIR)
-    ADD_TEST(Chicken ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_CHICKEN_DIR}/../../EasyDashboardScripts/Chicken.cmake )
-    SET_TESTS_PROPERTIES ( Chicken PROPERTIES TIMEOUT 5400)
-  ENDIF(CMAKE_TEST_CHICKEN_DIR)
+  if(CMAKE_TEST_CHICKEN_DIR)
+    add_test(Chicken ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_CHICKEN_DIR}/../../EasyDashboardScripts/Chicken.cmake )
+    set_tests_properties ( Chicken PROPERTIES TIMEOUT 5400)
+  endif(CMAKE_TEST_CHICKEN_DIR)
 
-  IF(CMAKE_TEST_KDELIBS_ALPHA_1_DIR)
-    ADD_TEST(KDELibsAlpha1 ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_KDELIBS_ALPHA_1_DIR}/../../EasyDashboardScripts/kdelibs.cmake )
-    SET_TESTS_PROPERTIES ( KDELibsAlpha1 PROPERTIES TIMEOUT 5400)
-  ENDIF(CMAKE_TEST_KDELIBS_ALPHA_1_DIR)
+  if(CMAKE_TEST_KDELIBS_ALPHA_1_DIR)
+    add_test(KDELibsAlpha1 ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_KDELIBS_ALPHA_1_DIR}/../../EasyDashboardScripts/kdelibs.cmake )
+    set_tests_properties ( KDELibsAlpha1 PROPERTIES TIMEOUT 5400)
+  endif(CMAKE_TEST_KDELIBS_ALPHA_1_DIR)
 
   # If this is not an in-source build, provide a target to wipe out
   # all the test build directories.
-  IF(NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt")
-    CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/test_clean.cmake.in
+  if(NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt")
+    configure_file(${CMake_SOURCE_DIR}/Tests/test_clean.cmake.in
                    ${CMake_BINARY_DIR}/Tests/test_clean.cmake @ONLY)
-    ADD_CUSTOM_TARGET(test_clean
+    add_custom_target(test_clean
       COMMAND ${CMAKE_COMMAND} -P ${CMake_BINARY_DIR}/Tests/test_clean.cmake
       COMMENT "Removing test build directories."
       )
-  ENDIF(NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt")
+  endif(NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt")
 
-  ADD_TEST(CMakeWizardTest ${CMAKE_CMAKE_COMMAND}
+  add_test(CMakeWizardTest ${CMAKE_CMAKE_COMMAND}
     -D build_dir:STRING=${CMAKE_CURRENT_BINARY_DIR}/CMakeWizardTest
     -D source_dir:STRING=${CMAKE_CURRENT_SOURCE_DIR}/Tutorial/Step3
     -D CMAKE_CTEST_COMMAND:STRING=${CMAKE_CTEST_COMMAND}
@@ -2349,33 +2349,33 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
   # with at least one CMakeLists.txt file that uses ExternalProject
   # to download and configure the project. The directory should also
   # contain a RunTest.cmake file that has a single set of the format:
-  # SET(project_RUN_TEST testToRun)
+  # set(project_RUN_TEST testToRun)
   # The testToRun should be a test executable that can be run to
   # smoke test the build.
-  FOREACH(project ${CMAKE_CONTRACT_PROJECTS})
-    INCLUDE(Contracts/${project}/RunTest.cmake)
+  foreach(project ${CMAKE_CONTRACT_PROJECTS})
+    include(Contracts/${project}/RunTest.cmake)
     ADD_TEST_MACRO(Contracts.${project}
       ${${project}_RUN_TEST})
     # Contract test timeout in seconds.
     # Default to 6 hours.
-    IF(DEFINED ${project}_TEST_TIMEOUT)
-      SET(timeout ${${project}_TEST_TIMEOUT})
-    ELSEIF(CMAKE_CONTRACT_TEST_TIMEOUT_DEFAULT)
-      SET(timeout ${CMAKE_CONTRACT_TEST_TIMEOUT_DEFAULT})
-    ELSE()
-      SET(timeout 21600)
-    ENDIF()
-    SET_TESTS_PROPERTIES(Contracts.${project} PROPERTIES TIMEOUT ${timeout})
-  ENDFOREACH()
+    if(DEFINED ${project}_TEST_TIMEOUT)
+      set(timeout ${${project}_TEST_TIMEOUT})
+    elseif(CMAKE_CONTRACT_TEST_TIMEOUT_DEFAULT)
+      set(timeout ${CMAKE_CONTRACT_TEST_TIMEOUT_DEFAULT})
+    else()
+      set(timeout 21600)
+    endif()
+    set_tests_properties(Contracts.${project} PROPERTIES TIMEOUT ${timeout})
+  endforeach()
 
-  IF(TEST_CompileCommandOutput)
-    SET(CompileCommandOutput_EXTRA_OPTIONS
+  if(TEST_CompileCommandOutput)
+    set(CompileCommandOutput_EXTRA_OPTIONS
       --build-options -DMAKE_SUPPORTS_SPACES=${MAKE_IS_GNU})
     ADD_TEST_MACRO(CompileCommandOutput
       "${CMake_BINARY_DIR}/Tests/CMakeLib/runcompilecommands")
-  ENDIF()
+  endif()
 
-  ADD_TEST(IncludeDirectories ${CMAKE_CTEST_COMMAND}
+  add_test(IncludeDirectories ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/IncludeDirectories"
     "${CMake_BINARY_DIR}/Tests/IncludeDirectories"
@@ -2384,21 +2384,21 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-project IncludeDirectories
     --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
     --test-command IncludeDirectories)
-  LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/IncludeDirectories")
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/IncludeDirectories")
 
-  IF(CMAKE_USE_KWSTYLE AND KWSTYLE_EXECUTABLE)
+  if(CMAKE_USE_KWSTYLE AND KWSTYLE_EXECUTABLE)
     # The "make StyleCheck" command line as a test. If the test fails, look
     # for lines like "Error #0 (624) Line length exceed 88 (max=79)" in the
     # output to find where the style errors are...
-    ADD_TEST(KWStyle ${KWSTYLE_EXECUTABLE}
+    add_test(KWStyle ${KWSTYLE_EXECUTABLE}
       -xml ${CMake_BINARY_DIR}/CMake.kws.xml
       -o ${CMake_SOURCE_DIR}/Utilities/KWStyle/CMakeOverwrite.txt
       -v
       -D ${CMake_BINARY_DIR}/CMakeKWSFiles.txt
       )
-    SET_TESTS_PROPERTIES(KWStyle PROPERTIES
+    set_tests_properties(KWStyle PROPERTIES
       WORKING_DIRECTORY ${CMake_BINARY_DIR}/Utilities/KWStyle)
-  ENDIF()
-ENDIF(BUILD_TESTING)
+  endif()
+endif(BUILD_TESTING)
 
-SUBDIRS(CMakeTests)
+subdirs(CMakeTests)
diff --git a/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt b/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt
index 1c978c181..70c186cc2 100644
--- a/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt
+++ b/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt
@@ -7,56 +7,56 @@
 # If you change this test do not forget to change the CheckSymbolExists
 # test, too.
 
-PROJECT(CheckCXXSymbolExists CXX)
+project(CheckCXXSymbolExists CXX)
 
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
 
-SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/../CheckSymbolExists")
+set(CMAKE_REQUIRED_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/../CheckSymbolExists")
 
-INCLUDE(CheckCXXSymbolExists)
+include(CheckCXXSymbolExists)
 
 foreach(_config_type Release RelWithDebInfo MinSizeRel Debug)
   set(CMAKE_TRY_COMPILE_CONFIGURATION ${_config_type})
   unset(CSE_RESULT_${_config_type} CACHE)
-  MESSAGE(STATUS "Testing configuration ${_config_type}")
+  message(STATUS "Testing configuration ${_config_type}")
   check_cxx_symbol_exists(non_existent_function_for_symbol_test "cm_cse.h" CSE_RESULT_${_config_type})
 
-  IF (CSE_RESULT_${_config_type})
-    MESSAGE(SEND_ERROR "CheckCXXSymbolExists reported a nonexistent symbol as existing in configuration ${_config_type}")
-  ENDIF (CSE_RESULT_${_config_type})
+  if (CSE_RESULT_${_config_type})
+    message(SEND_ERROR "CheckCXXSymbolExists reported a nonexistent symbol as existing in configuration ${_config_type}")
+  endif (CSE_RESULT_${_config_type})
 endforeach()
 
 set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE})
 unset(CSE_RESULT_ERRNO_CERRNO CACHE)
 
-MESSAGE(STATUS "Checking <cerrno>")
+message(STATUS "Checking <cerrno>")
 
 check_cxx_symbol_exists(errno "cerrno" CSE_RESULT_ERRNO_CERRNO)
 
-IF (NOT CSE_RESULT_ERRNO_CERRNO)
+if (NOT CSE_RESULT_ERRNO_CERRNO)
   unset(CSE_RESULT_ERRNO_ERRNOH CACHE)
 
-  MESSAGE(STATUS "Checking <errno.h>")
+  message(STATUS "Checking <errno.h>")
 
   check_cxx_symbol_exists(errno "errno.h" CSE_RESULT_ERRNO_ERRNOH)
 
-  IF (NOT CSE_RESULT_ERRNO_ERRNOH)
-    MESSAGE(SEND_ERROR "CheckCXXSymbolExists did not find errno in <cerrno> and <errno.h>")
-  ELSE (NOT CSE_RESULT_ERRNO_ERRNOH)
-    MESSAGE(STATUS "errno found in <errno.h>")
-  ENDIF (NOT CSE_RESULT_ERRNO_ERRNOH)
-ELSE (NOT CSE_RESULT_ERRNO_CERRNO)
-  MESSAGE(STATUS "errno found in <cerrno>")
-ENDIF (NOT CSE_RESULT_ERRNO_CERRNO)
+  if (NOT CSE_RESULT_ERRNO_ERRNOH)
+    message(SEND_ERROR "CheckCXXSymbolExists did not find errno in <cerrno> and <errno.h>")
+  else (NOT CSE_RESULT_ERRNO_ERRNOH)
+    message(STATUS "errno found in <errno.h>")
+  endif (NOT CSE_RESULT_ERRNO_ERRNOH)
+else (NOT CSE_RESULT_ERRNO_CERRNO)
+  message(STATUS "errno found in <cerrno>")
+endif (NOT CSE_RESULT_ERRNO_CERRNO)
 
-IF (CMAKE_COMPILER_IS_GNUCXX)
+if (CMAKE_COMPILER_IS_GNUCXX)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
   unset(CSE_RESULT_O3 CACHE)
-  MESSAGE(STATUS "Testing with optimization -O3")
+  message(STATUS "Testing with optimization -O3")
 
   check_cxx_symbol_exists(non_existent_function_for_symbol_test "cm_cse.h" CSE_RESULT_O3)
 
-  IF (CSE_RESULT_O3)
-    MESSAGE(SEND_ERROR "CheckCXXSymbolExists reported a nonexistent symbol as existing with optimization -O3")
-  ENDIF (CSE_RESULT_O3)
-ENDIF (CMAKE_COMPILER_IS_GNUCXX)
+  if (CSE_RESULT_O3)
+    message(SEND_ERROR "CheckCXXSymbolExists reported a nonexistent symbol as existing with optimization -O3")
+  endif (CSE_RESULT_O3)
+endif (CMAKE_COMPILER_IS_GNUCXX)
diff --git a/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt b/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt
index 7c969d3be..acf0d2df3 100644
--- a/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt
+++ b/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt
@@ -7,24 +7,24 @@
 # If you change this test do not forget to change the CheckCXXSymbolExists
 # test, too.
 
-PROJECT(CheckSymbolExists C)
+project(CheckSymbolExists C)
 
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
 
-SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}")
+set(CMAKE_REQUIRED_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}")
 
-INCLUDE(CheckSymbolExists)
+include(CheckSymbolExists)
 
 foreach(_config_type Release RelWithDebInfo MinSizeRel Debug)
   set(CMAKE_TRY_COMPILE_CONFIGURATION ${_config_type})
   unset(CSE_RESULT_${_config_type} CACHE)
-  MESSAGE(STATUS "Testing configuration ${_config_type}")
+  message(STATUS "Testing configuration ${_config_type}")
 
   check_symbol_exists(non_existent_function_for_symbol_test "cm_cse.h" CSE_RESULT_${_config_type})
 
-  IF (CSE_RESULT_${_config_type})
-    MESSAGE(SEND_ERROR "CheckSymbolExists reported a nonexistent symbol as existing in configuration ${_config_type}")
-  ENDIF (CSE_RESULT_${_config_type})
+  if (CSE_RESULT_${_config_type})
+    message(SEND_ERROR "CheckSymbolExists reported a nonexistent symbol as existing in configuration ${_config_type}")
+  endif (CSE_RESULT_${_config_type})
 endforeach()
 
 set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE})
@@ -32,20 +32,20 @@ unset(CSE_RESULT_ERRNO CACHE)
 
 check_symbol_exists(errno "errno.h" CSE_RESULT_ERRNO)
 
-IF (NOT CSE_RESULT_ERRNO)
-  MESSAGE(SEND_ERROR "CheckSymbolExists did not find errno in <errno.h>")
-ELSE (NOT CSE_RESULT_ERRNO)
-  MESSAGE(STATUS "errno found as expected")
-ENDIF (NOT CSE_RESULT_ERRNO)
+if (NOT CSE_RESULT_ERRNO)
+  message(SEND_ERROR "CheckSymbolExists did not find errno in <errno.h>")
+else (NOT CSE_RESULT_ERRNO)
+  message(STATUS "errno found as expected")
+endif (NOT CSE_RESULT_ERRNO)
 
-IF (CMAKE_COMPILER_IS_GNUCC)
+if (CMAKE_COMPILER_IS_GNUCC)
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
   unset(CSE_RESULT_O3 CACHE)
-  MESSAGE(STATUS "Testing with optimization -O3")
+  message(STATUS "Testing with optimization -O3")
 
   check_symbol_exists(non_existent_function_for_symbol_test "cm_cse.h" CSE_RESULT_O3)
 
-  IF (CSE_RESULT_O3)
-    MESSAGE(SEND_ERROR "CheckSymbolExists reported a nonexistent symbol as existing with optimization -O3")
-  ENDIF (CSE_RESULT_O3)
-ENDIF (CMAKE_COMPILER_IS_GNUCC)
+  if (CSE_RESULT_O3)
+    message(SEND_ERROR "CheckSymbolExists reported a nonexistent symbol as existing with optimization -O3")
+  endif (CSE_RESULT_O3)
+endif (CMAKE_COMPILER_IS_GNUCC)
diff --git a/Tests/CMakeTests/CMakeLists.txt b/Tests/CMakeTests/CMakeLists.txt
index c42c490b0..fadcc1e2a 100644
--- a/Tests/CMakeTests/CMakeLists.txt
+++ b/Tests/CMakeTests/CMakeLists.txt
@@ -1,12 +1,12 @@
-SET(CMAKE_EXECUTABLE "${CMake_BIN_DIR}/cmake")
+set(CMAKE_EXECUTABLE "${CMake_BIN_DIR}/cmake")
 
 
-MACRO(AddCMakeTest TestName PreArgs)
-  CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/${TestName}Test.cmake.in"
+macro(AddCMakeTest TestName PreArgs)
+  configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${TestName}Test.cmake.in"
     "${CMAKE_CURRENT_BINARY_DIR}/${TestName}Test.cmake" @ONLY IMMEDIATE)
-  ADD_TEST(CMake.${TestName} ${CMAKE_EXECUTABLE} ${PreArgs}
+  add_test(CMake.${TestName} ${CMAKE_EXECUTABLE} ${PreArgs}
     -P "${CMAKE_CURRENT_BINARY_DIR}/${TestName}Test.cmake" ${ARGN})
-ENDMACRO(AddCMakeTest)
+endmacro(AddCMakeTest)
 
 
 AddCMakeTest(List "")
@@ -43,12 +43,12 @@ if(HAVE_ELF_H)
   AddCMakeTest(ELF "")
 endif()
 
-SET(EndStuff_PreArgs
+set(EndStuff_PreArgs
   "-Ddir:STRING=${CMAKE_CURRENT_BINARY_DIR}/EndStuffTest"
   )
 AddCMakeTest(EndStuff "${EndStuff_PreArgs}")
 
-SET(GetPrerequisites_PreArgs
+set(GetPrerequisites_PreArgs
   "-DCTEST_CONFIGURATION_TYPE:STRING=\\\${CTEST_CONFIGURATION_TYPE}"
   )
 AddCMakeTest(GetPrerequisites "${GetPrerequisites_PreArgs}")
diff --git a/Tests/CMakeTests/ListTest.cmake.in b/Tests/CMakeTests/ListTest.cmake.in
index cf6f91a70..5db171c3a 100644
--- a/Tests/CMakeTests/ListTest.cmake.in
+++ b/Tests/CMakeTests/ListTest.cmake.in
@@ -1,88 +1,88 @@
-MACRO(TEST command expected)
-  IF("x${result}" STREQUAL "x${expected}")
-    #MESSAGE("TEST \"${command}\" success: \"${result}\" expected: \"${expected}\"")
-  ELSE("x${result}" STREQUAL "x${expected}")
-    MESSAGE(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"")
-  ENDIF("x${result}" STREQUAL "x${expected}")
-ENDMACRO(TEST command expected)
+macro(TEST command expected)
+  if("x${result}" STREQUAL "x${expected}")
+    #message("TEST \"${command}\" success: \"${result}\" expected: \"${expected}\"")
+  else("x${result}" STREQUAL "x${expected}")
+    message(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"")
+  endif("x${result}" STREQUAL "x${expected}")
+endmacro(TEST command expected)
 
-SET(mylist andy bill ken brad)
+set(mylist andy bill ken brad)
 
-LIST(LENGTH mylist result)
+list(LENGTH mylist result)
 TEST("LENGTH mylist result" "4")
-LIST(LENGTH "mylist" result)
+list(LENGTH "mylist" result)
 TEST("LENGTH \"mylist\" result" "4")
 
-LIST(LENGTH "nonexiting_list1" result)
+list(LENGTH "nonexiting_list1" result)
 TEST("LENGTH \"nonexiting_list1\" result" "0")
 
-LIST(GET mylist 3 2 1 0 result)
+list(GET mylist 3 2 1 0 result)
 TEST("GET mylist 3 2 1 0 result" "brad;ken;bill;andy")
 
-LIST(GET mylist 0 item0)
-LIST(GET mylist 1 item1)
-LIST(GET mylist 2 item2)
-LIST(GET mylist 3 item3)
-SET(result "${item3}" "${item0}" "${item1}" "${item2}")
+list(GET mylist 0 item0)
+list(GET mylist 1 item1)
+list(GET mylist 2 item2)
+list(GET mylist 3 item3)
+set(result "${item3}" "${item0}" "${item1}" "${item2}")
 TEST("GET individual 3 2 1 0 result" "brad;andy;bill;ken")
 
-LIST(GET mylist -1 -2 -3 -4 result)
+list(GET mylist -1 -2 -3 -4 result)
 TEST("GET mylist -1 -2 -3 -4 result" "brad;ken;bill;andy")
 
-LIST(GET mylist -1 2 -3 0 result)
+list(GET mylist -1 2 -3 0 result)
 TEST("GET mylist -1 2 -3 0 ${result}" "brad;ken;bill;andy")
 
-LIST(GET "nonexiting_list2" 1 result)
+list(GET "nonexiting_list2" 1 result)
 TEST("GET \"nonexiting_list2\" 1 result" "NOTFOUND")
 
-SET(result andy)
-LIST(APPEND result brad)
+set(result andy)
+list(APPEND result brad)
 TEST("APPEND result brad" "andy;brad")
 
-LIST(APPEND "nonexiting_list3" brad)
-SET(result "${nonexiting_list3}")
+list(APPEND "nonexiting_list3" brad)
+set(result "${nonexiting_list3}")
 TEST("APPEND \"nonexiting_list3\" brad" "brad")
 
-LIST(INSERT "nonexiting_list4" 0 andy bill brad ken)
-SET(result "${nonexiting_list4}")
+list(INSERT "nonexiting_list4" 0 andy bill brad ken)
+set(result "${nonexiting_list4}")
 TEST("APPEND \"nonexiting_list4\" andy bill brad ken" "andy;bill;brad;ken")
 
-SET(result andy brad)
-LIST(INSERT result -1 bill ken)
+set(result andy brad)
+list(INSERT result -1 bill ken)
 TEST("INSERT result -1 bill ken" "andy;bill;ken;brad")
 
-SET(result andy bill brad ken bob)
-LIST(REMOVE_ITEM result bob)
+set(result andy bill brad ken bob)
+list(REMOVE_ITEM result bob)
 TEST("REMOVE_ITEM result bob" "andy;bill;brad;ken")
 
-SET(result andy bill bob brad ken peter)
-LIST(REMOVE_ITEM result peter bob)
+set(result andy bill bob brad ken peter)
+list(REMOVE_ITEM result peter bob)
 TEST("REMOVE_ITEM result peter bob" "andy;bill;brad;ken")
 
-SET(result bob andy bill bob brad ken bob)
-LIST(REMOVE_ITEM result bob)
+set(result bob andy bill bob brad ken bob)
+list(REMOVE_ITEM result bob)
 TEST("REMOVE_ITEM result bob" "andy;bill;brad;ken")
 
-SET(result andy bill bob brad ken peter)
-LIST(REMOVE_AT result 2 -1)
+set(result andy bill bob brad ken peter)
+list(REMOVE_AT result 2 -1)
 TEST("REMOVE_AT result 2 -1" "andy;bill;brad;ken")
 
 # ken is at index 2, nobody is not in the list so -1 should be returned
-SET(mylist andy bill ken brad)
-LIST(FIND mylist ken result)
+set(mylist andy bill ken brad)
+list(FIND mylist ken result)
 TEST("FIND mylist ken result" "2")
 
-LIST(FIND mylist nobody result)
+list(FIND mylist nobody result)
 TEST("FIND mylist nobody result" "-1")
 
-SET(result ken bill andy brad)
-LIST(SORT result)
+set(result ken bill andy brad)
+list(SORT result)
 TEST("SORT result" "andy;bill;brad;ken")
 
-SET(result andy bill brad ken)
-LIST(REVERSE result)
+set(result andy bill brad ken)
+list(REVERSE result)
 TEST("REVERSE result" "ken;brad;bill;andy")
 
-SET(result bill andy bill brad ken ken ken)
-LIST(REMOVE_DUPLICATES result)
+set(result bill andy bill brad ken ken ken)
+list(REMOVE_DUPLICATES result)
 TEST("REMOVE_DUPLICATES result" "bill;andy;brad;ken")
diff --git a/Tests/CMakeTests/ToolchainTest.cmake.in b/Tests/CMakeTests/ToolchainTest.cmake.in
index 179945646..cd258db72 100644
--- a/Tests/CMakeTests/ToolchainTest.cmake.in
+++ b/Tests/CMakeTests/ToolchainTest.cmake.in
@@ -1,7 +1,7 @@
 ############################################################
 # some preparations so that the CMakeDetermineXXX.cmake files will work in scripted mode
 
-# overwrite MARK_AS_ADVANCED(), since this is used in CMakeDetermineCCompiler.cmake
+# overwrite mark_as_advanced(), since this is used in CMakeDetermineCCompiler.cmake
 # which will complain that it can"t be used in script mode
 macro(MARK_AS_ADVANCED)
 endmacro(MARK_AS_ADVANCED)
diff --git a/Tests/CMakeTests/VariableWatchTest.cmake.in b/Tests/CMakeTests/VariableWatchTest.cmake.in
index bdb4f7ec4..3d290d614 100644
--- a/Tests/CMakeTests/VariableWatchTest.cmake.in
+++ b/Tests/CMakeTests/VariableWatchTest.cmake.in
@@ -1,15 +1,15 @@
-MESSAGE("Start")
+message("Start")
 
-VARIABLE_WATCH(TESTVAR MESSAGE)
-VARIABLE_WATCH(TESTVAR1)
+variable_watch(TESTVAR MESSAGE)
+variable_watch(TESTVAR1)
 
 macro(testwatch var access file stack)
-  MESSAGE("There was a ${access} access done on the variable: ${var} in file ${file}")
-  MESSAGE("List file stack is: ${stack}")
+  message("There was a ${access} access done on the variable: ${var} in file ${file}")
+  message("List file stack is: ${stack}")
   set(${var}_watched 1)
 endmacro(testwatch)
 
-VARIABLE_WATCH(somevar testwatch)
+variable_watch(somevar testwatch)
 
 set(TESTVAR1 "1")
 set(TESTVAR "1")
diff --git a/Tests/CTestTest/test.cmake.in b/Tests/CTestTest/test.cmake.in
index 5fede3390..d21dafa43 100644
--- a/Tests/CTestTest/test.cmake.in
+++ b/Tests/CTestTest/test.cmake.in
@@ -4,25 +4,25 @@
 ###################################################################
 
 # this is the cvs module name that should be checked out
-SET (CTEST_MODULE_NAME SmallAndFast)
+set (CTEST_MODULE_NAME SmallAndFast)
 
 # these are the the name of the source and binary directory on disk.
 # They will be appended to DASHBOARD_ROOT
-SET (CTEST_SOURCE_NAME SmallAndFast)
-SET (CTEST_BINARY_NAME SmallAndFastBuild)
+set (CTEST_SOURCE_NAME SmallAndFast)
+set (CTEST_BINARY_NAME SmallAndFastBuild)
 
 # which ctest command to use for running the dashboard
-SET (CTEST_COMMAND
+set (CTEST_COMMAND
   "\"${CTEST_EXECUTABLE_NAME}\" --version"
   "\"${CTEST_EXECUTABLE_NAME}\" -D Experimental -A \"${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}\""
   )
 
 # what cmake command to use for configuring this dashboard
-GET_FILENAME_COMPONENT(CTEST_EXECUTABLE_PATH "${CTEST_EXECUTABLE_NAME}" PATH)
-SET(CTEST_CMAKE_COMMAND "\"${CTEST_EXECUTABLE_PATH}/cmake\"")
+get_filename_component(CTEST_EXECUTABLE_PATH "${CTEST_EXECUTABLE_NAME}" PATH)
+set(CTEST_CMAKE_COMMAND "\"${CTEST_EXECUTABLE_PATH}/cmake\"")
 
-MESSAGE("CTest executable: ${CTEST_EXECUTABLE_NAME}")
-MESSAGE("CMake executable: ${CTEST_CMAKE_COMMAND}")
+message("CTest executable: ${CTEST_EXECUTABLE_NAME}")
+message("CMake executable: ${CTEST_CMAKE_COMMAND}")
 
 CTEST_SLEEP(1)
 CTEST_SLEEP(1 1 1)
@@ -33,11 +33,11 @@ CTEST_SLEEP(1 1 1)
 ####################################################################
 
 # should ctest wipe the binary tree before running
-SET (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE)
+set (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE)
 
 # this is the initial cache to use for the binary tree, be careful to escape
 # any quotes inside of this string if you use it
-SET (CTEST_INITIAL_CACHE "
+set (CTEST_INITIAL_CACHE "
 SITE:STRING=@SITE@
 BUILDNAME:STRING=SmallAndFast-@BUILDNAME@
 CMAKE_GENERATOR:INTERNAL=@CMAKE_GENERATOR@
@@ -57,12 +57,12 @@ COVERAGE_COMMAND:FILEPATH=@COVERAGE_COMMAND@
 # if you do not want to use the default location for a
 # dashboard then set this variable to the directory
 # the dashboard should be in
-SET (CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@/Tests/CTestTest")
+set (CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@/Tests/CTestTest")
 
 
 # set any extra envionment varibles here
-SET (CTEST_ENVIRONMENT
+set (CTEST_ENVIRONMENT
 )
 
-SET (CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTest/SmallAndFast")
-SET (CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTest/${CTEST_BINARY_NAME}")
+set (CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTest/SmallAndFast")
+set (CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTest/${CTEST_BINARY_NAME}")
diff --git a/Tests/CTestTest2/test.cmake.in b/Tests/CTestTest2/test.cmake.in
index b58b6397e..ec756ddc4 100644
--- a/Tests/CTestTest2/test.cmake.in
+++ b/Tests/CTestTest2/test.cmake.in
@@ -1,31 +1,31 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
+cmake_minimum_required(VERSION 2.1)
 
 # Settings:
-SET(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
-SET(CTEST_SITE                          "@SITE@")
-SET(CTEST_BUILD_NAME                    "KWSys-@BUILDNAME@-CTest2")
+set(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
+set(CTEST_SITE                          "@SITE@")
+set(CTEST_BUILD_NAME                    "KWSys-@BUILDNAME@-CTest2")
 
-SET(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Source/kwsys")
-SET(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTest2/kwsysBin")
-SET(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
-SET(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
-SET(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
-SET(CTEST_MEMORYCHECK_COMMAND           "@MEMORYCHECK_COMMAND@")
-SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@")
-SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS   "@MEMORYCHECK_COMMAND_OPTIONS@")
-SET(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
-SET(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Source/kwsys")
+set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTest2/kwsysBin")
+set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_MEMORYCHECK_COMMAND           "@MEMORYCHECK_COMMAND@")
+set(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@")
+set(CTEST_MEMORYCHECK_COMMAND_OPTIONS   "@MEMORYCHECK_COMMAND_OPTIONS@")
+set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
 
 # By default, CTESTTEST2_USE_PURIFY is not defined. If you want to run purify
 # on CTestTest2, set CTESTTEST2_USE_PURIFY to ON in CMake's cache.
-SET(CTESTTEST2_USE_PURIFY @CTESTTEST2_USE_PURIFY@)
-IF("${CTEST_MEMORYCHECK_COMMAND}" MATCHES purify AND NOT CTESTTEST2_USE_PURIFY)
-  SET(CTEST_MEMORYCHECK_COMMAND)
-ENDIF()
+set(CTESTTEST2_USE_PURIFY @CTESTTEST2_USE_PURIFY@)
+if("${CTEST_MEMORYCHECK_COMMAND}" MATCHES purify AND NOT CTESTTEST2_USE_PURIFY)
+  set(CTEST_MEMORYCHECK_COMMAND)
+endif()
 
 #CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
 
-FILE(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
+file(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
 CMAKE_CXX_FLAGS:STRING=@CMAKE_CXX_FLAGS@
 CMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@
 CMAKE_C_COMPILER:STRING=@CMAKE_C_COMPILER@
@@ -55,6 +55,6 @@ set(CTEST_DROP_LOCATION "@path@/submit.php?project=PublicDashboard")
 CTEST_SUBMIT(RETURN_VALUE res)
 
 # Test submission of a subset of parts.
-SET(CTEST_EXTRA_SUBMIT_FILES ${CTEST_NOTES_FILES})
+set(CTEST_EXTRA_SUBMIT_FILES ${CTEST_NOTES_FILES})
 CTEST_SUBMIT(RETURN_VALUE res PARTS ExtraFiles)
-SET(CTEST_EXTRA_SUBMIT_FILES)
+set(CTEST_EXTRA_SUBMIT_FILES)
diff --git a/Tests/CTestTestBadExe/CMakeLists.txt b/Tests/CTestTestBadExe/CMakeLists.txt
index 8a925b62f..c71c21516 100644
--- a/Tests/CTestTestBadExe/CMakeLists.txt
+++ b/Tests/CTestTestBadExe/CMakeLists.txt
@@ -1,7 +1,7 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(CTestTestBadExe)
-INCLUDE(CTest)
+project(CTestTestBadExe)
+include(CTest)
 
-CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/notAnExe.txt" "${CMAKE_CURRENT_BINARY_DIR}/notAnExe.txt" COPYONLY)
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/notAnExe.txt" "${CMAKE_CURRENT_BINARY_DIR}/notAnExe.txt" COPYONLY)
 
-ADD_TEST (TestBadExe "${CMAKE_CURRENT_BINARY_DIR}/notAnExe.txt")
+add_test (TestBadExe "${CMAKE_CURRENT_BINARY_DIR}/notAnExe.txt")
diff --git a/Tests/CTestTestBadExe/test.cmake.in b/Tests/CTestTestBadExe/test.cmake.in
index 5d22d3587..2421b136d 100644
--- a/Tests/CTestTestBadExe/test.cmake.in
+++ b/Tests/CTestTestBadExe/test.cmake.in
@@ -1,17 +1,17 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
+cmake_minimum_required(VERSION 2.1)
 
 # Settings:
-SET(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
-SET(CTEST_SITE                          "@SITE@")
-SET(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-BadExe")
+set(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
+set(CTEST_SITE                          "@SITE@")
+set(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-BadExe")
 
-SET(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestBadExe")
-SET(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestBadExe")
-SET(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
-SET(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
-SET(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
-SET(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
-SET(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestBadExe")
+set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestBadExe")
+set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
 
 #CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
 
diff --git a/Tests/CTestTestChecksum/test.cmake.in b/Tests/CTestTestChecksum/test.cmake.in
index 84135446f..6317500d6 100644
--- a/Tests/CTestTestChecksum/test.cmake.in
+++ b/Tests/CTestTestChecksum/test.cmake.in
@@ -1,25 +1,25 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
+cmake_minimum_required(VERSION 2.1)
 
 # Settings:
-SET(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
-SET(CTEST_SITE                          "@SITE@")
-SET(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-Checksum")
+set(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
+set(CTEST_SITE                          "@SITE@")
+set(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-Checksum")
 
-SET(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestParallel")
-SET(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestParallel")
-SET(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
-SET(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
-SET(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
-SET(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
-SET(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestParallel")
+set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestParallel")
+set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
 
 CTEST_START(Experimental)
 CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
 CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
 CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res PARALLEL_LEVEL 4)
 
-SET(CTEST_DROP_METHOD "@protocol@")
-SET(CTEST_DROP_SITE "@server@")
-SET(CTEST_DROP_LOCATION "@path@/submit.php?project=PublicDashboard")
+set(CTEST_DROP_METHOD "@protocol@")
+set(CTEST_DROP_SITE "@server@")
+set(CTEST_DROP_LOCATION "@path@/submit.php?project=PublicDashboard")
 
 CTEST_SUBMIT(RETRY_DELAY 3 RETRY_COUNT 2 INTERNAL_TEST_CHECKSUM RETURN_VALUE res)
diff --git a/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in b/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in
index 498cab280..feaa5c385 100644
--- a/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in
+++ b/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in
@@ -1,17 +1,17 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8)
 
 # Settings:
-SET(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
-SET(CTEST_SITE                          "@SITE@")
-SET(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-ConfigFileInBuildDir1")
+set(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
+set(CTEST_SITE                          "@SITE@")
+set(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-ConfigFileInBuildDir1")
 
-SET(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestConfigFileInBuildDir")
-SET(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestConfigFileInBuildDir1")
-SET(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
-SET(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
-SET(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
-SET(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
-SET(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestConfigFileInBuildDir")
+set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestConfigFileInBuildDir1")
+set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
 
 CTEST_START(Experimental)
 CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in b/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in
index d359f2d36..f489114cd 100644
--- a/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in
+++ b/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in
@@ -1,17 +1,17 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8)
 
 # Settings:
-SET(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
-SET(CTEST_SITE                          "@SITE@")
-SET(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-ConfigFileInBuildDir2")
+set(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
+set(CTEST_SITE                          "@SITE@")
+set(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-ConfigFileInBuildDir2")
 
-SET(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestConfigFileInBuildDir")
-SET(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestConfigFileInBuildDir2")
-SET(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
-SET(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
-SET(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
-SET(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
-SET(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestConfigFileInBuildDir")
+set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestConfigFileInBuildDir2")
+set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
 
 CTEST_START(Experimental)
 CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestCostSerial/CMakeLists.txt b/Tests/CTestTestCostSerial/CMakeLists.txt
index a9a5c2594..29d2983e8 100644
--- a/Tests/CTestTestCostSerial/CMakeLists.txt
+++ b/Tests/CTestTestCostSerial/CMakeLists.txt
@@ -1,13 +1,13 @@
-CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
-PROJECT (CTestTestCostSerial)
-INCLUDE (CTest)
+cmake_minimum_required (VERSION 2.6)
+project (CTestTestCostSerial)
+include (CTest)
 
-ADD_EXECUTABLE (Sleep sleep.c)
+add_executable (Sleep sleep.c)
 
-FOREACH (index RANGE 1 3)
-  ADD_TEST (TestSleep${index} Sleep)
-ENDFOREACH (index RANGE 1 3)
+foreach (index RANGE 1 3)
+  add_test (TestSleep${index} Sleep)
+endforeach (index RANGE 1 3)
 
-SET_TESTS_PROPERTIES(TestSleep1 PROPERTIES COST -500)
-SET_TESTS_PROPERTIES(TestSleep2 PROPERTIES COST 12)
-SET_TESTS_PROPERTIES(TestSleep3 PROPERTIES COST 0)
+set_tests_properties(TestSleep1 PROPERTIES COST -500)
+set_tests_properties(TestSleep2 PROPERTIES COST 12)
+set_tests_properties(TestSleep3 PROPERTIES COST 0)
diff --git a/Tests/CTestTestCostSerial/test.cmake.in b/Tests/CTestTestCostSerial/test.cmake.in
index ca216e3fc..3f0f6f8e8 100644
--- a/Tests/CTestTestCostSerial/test.cmake.in
+++ b/Tests/CTestTestCostSerial/test.cmake.in
@@ -1,24 +1,24 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
+cmake_minimum_required(VERSION 2.1)
 
 # Settings:
-SET(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
-SET(CTEST_SITE                          "@SITE@")
-SET(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-CostSerial")
+set(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
+set(CTEST_SITE                          "@SITE@")
+set(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-CostSerial")
 
-SET(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestCostSerial")
-SET(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestCostSerial")
-SET(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
-SET(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
-SET(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
-SET(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
-SET(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestCostSerial")
+set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestCostSerial")
+set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
 
 #CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
 
 # Remove old cost data file if it exists
-IF(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt")
-  FILE(REMOVE "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt")
-ENDIF(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt")
+if(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt")
+  file(REMOVE "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt")
+endif(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt")
 
 CTEST_START(Experimental)
 CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestCrash/CMakeLists.txt b/Tests/CTestTestCrash/CMakeLists.txt
index 0ac6ba03c..77986df34 100644
--- a/Tests/CTestTestCrash/CMakeLists.txt
+++ b/Tests/CTestTestCrash/CMakeLists.txt
@@ -1,7 +1,7 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(CTestTestCrash)
-INCLUDE(CTest)
+project(CTestTestCrash)
+include(CTest)
 
-ADD_EXECUTABLE (Crash crash.cxx)
+add_executable (Crash crash.cxx)
 
-ADD_TEST (TestCrash Crash)
+add_test (TestCrash Crash)
diff --git a/Tests/CTestTestCrash/test.cmake.in b/Tests/CTestTestCrash/test.cmake.in
index 5cec594cd..4e27bc2bc 100644
--- a/Tests/CTestTestCrash/test.cmake.in
+++ b/Tests/CTestTestCrash/test.cmake.in
@@ -1,17 +1,17 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
+cmake_minimum_required(VERSION 2.1)
 
 # Settings:
-SET(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
-SET(CTEST_SITE                          "@SITE@")
-SET(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-Crash")
+set(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
+set(CTEST_SITE                          "@SITE@")
+set(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-Crash")
 
-SET(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestCrash")
-SET(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestCrash")
-SET(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
-SET(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
-SET(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
-SET(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
-SET(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestCrash")
+set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestCrash")
+set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
 
 #CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
 
diff --git a/Tests/CTestTestCycle/test.cmake.in b/Tests/CTestTestCycle/test.cmake.in
index 201f6044e..22f33770e 100644
--- a/Tests/CTestTestCycle/test.cmake.in
+++ b/Tests/CTestTestCycle/test.cmake.in
@@ -1,17 +1,17 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
+cmake_minimum_required(VERSION 2.1)
 
 # Settings:
-SET(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
-SET(CTEST_SITE                          "@SITE@")
-SET(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-Cycle")
+set(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
+set(CTEST_SITE                          "@SITE@")
+set(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-Cycle")
 
-SET(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestCycle")
-SET(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestCycle")
-SET(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
-SET(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
-SET(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
-SET(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
-SET(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestCycle")
+set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestCycle")
+set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
 
 CTEST_START(Experimental)
 CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestDepends/test.cmake.in b/Tests/CTestTestDepends/test.cmake.in
index 36a1ebf87..49fc443dd 100644
--- a/Tests/CTestTestDepends/test.cmake.in
+++ b/Tests/CTestTestDepends/test.cmake.in
@@ -1,17 +1,17 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
+cmake_minimum_required(VERSION 2.1)
 
 # Settings:
-SET(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
-SET(CTEST_SITE                          "@SITE@")
-SET(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-Depends")
+set(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
+set(CTEST_SITE                          "@SITE@")
+set(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-Depends")
 
-SET(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestDepends")
-SET(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestDepends")
-SET(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
-SET(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
-SET(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
-SET(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
-SET(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestDepends")
+set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestDepends")
+set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
 
 CTEST_START(Experimental)
 CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestFailedSubmits/test.cmake.in b/Tests/CTestTestFailedSubmits/test.cmake.in
index b0e16322d..394400630 100644
--- a/Tests/CTestTestFailedSubmits/test.cmake.in
+++ b/Tests/CTestTestFailedSubmits/test.cmake.in
@@ -1,4 +1,4 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8)
 
 # CTestConfig.cmake settings:
 set(CTEST_PROJECT_NAME "SmallAndFast")
@@ -9,21 +9,21 @@ set(CTEST_PROJECT_NAME "SmallAndFast")
 set(CTEST_DROP_METHOD "@drop_method@")
 
 # Settings:
-SET(CTEST_USE_LAUNCHERS 1)
+set(CTEST_USE_LAUNCHERS 1)
 
 # Emit these compiler warnings:
 set(ENV{CXXFLAGS} "$ENV{CXXFLAGS} -Wall")
 
-SET(CTEST_SITE                          "@SITE@")
-SET(CTEST_BUILD_NAME                    "CTestTestLaunchers-@drop_method@")
+set(CTEST_SITE                          "@SITE@")
+set(CTEST_BUILD_NAME                    "CTestTestLaunchers-@drop_method@")
 
-SET(CTEST_SOURCE_DIRECTORY              "@source@")
-SET(CTEST_BINARY_DIRECTORY              "@build@")
-SET(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
-SET(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
-SET(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
-SET(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
-SET(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+set(CTEST_SOURCE_DIRECTORY              "@source@")
+set(CTEST_BINARY_DIRECTORY              "@build@")
+set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR               "@CMAKE_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
 
 CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
 
diff --git a/Tests/CTestTestFailure/CMakeLists.txt b/Tests/CTestTestFailure/CMakeLists.txt
index 690fbfc5c..01fbb2c4f 100644
--- a/Tests/CTestTestFailure/CMakeLists.txt
+++ b/Tests/CTestTestFailure/CMakeLists.txt
@@ -1,8 +1,8 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(CTestTestFailure)
-INCLUDE(CTest)
+project(CTestTestFailure)
+include(CTest)
 
-ADD_EXECUTABLE (NoBuild badCode.cxx)
-TARGET_LINK_LIBRARIES (NoBuild ${EXTRA_LIBS})
+add_executable (NoBuild badCode.cxx)
+target_link_libraries (NoBuild ${EXTRA_LIBS})
 
-ADD_TEST (TestNoExe NoBuild)
+add_test (TestNoExe NoBuild)
diff --git a/Tests/CTestTestFailure/testNoBuild.cmake.in b/Tests/CTestTestFailure/testNoBuild.cmake.in
index 7bc921a31..6edd9dd95 100644
--- a/Tests/CTestTestFailure/testNoBuild.cmake.in
+++ b/Tests/CTestTestFailure/testNoBuild.cmake.in
@@ -1,17 +1,17 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
+cmake_minimum_required(VERSION 2.1)
 
 # Settings:
-SET(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
-SET(CTEST_SITE                          "@SITE@")
-SET(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-NoBuild")
+set(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
+set(CTEST_SITE                          "@SITE@")
+set(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-NoBuild")
 
-SET(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestFailure")
-SET(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestFailure")
-SET(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
-SET(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
-SET(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
-SET(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
-SET(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestFailure")
+set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestFailure")
+set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
 
 #CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
 
diff --git a/Tests/CTestTestFailure/testNoExe.cmake.in b/Tests/CTestTestFailure/testNoExe.cmake.in
index 59c18d752..f09594c2b 100644
--- a/Tests/CTestTestFailure/testNoExe.cmake.in
+++ b/Tests/CTestTestFailure/testNoExe.cmake.in
@@ -1,17 +1,17 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
+cmake_minimum_required(VERSION 2.1)
 
 # Settings:
-SET(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
-SET(CTEST_SITE                          "@SITE@")
-SET(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-NoExe")
+set(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
+set(CTEST_SITE                          "@SITE@")
+set(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-NoExe")
 
-SET(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestFailure")
-SET(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestFailure")
-SET(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
-SET(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
-SET(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
-SET(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
-SET(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestFailure")
+set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestFailure")
+set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
 
 #CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
 
diff --git a/Tests/CTestTestParallel/CMakeLists.txt b/Tests/CTestTestParallel/CMakeLists.txt
index fc53f6874..e47085a09 100644
--- a/Tests/CTestTestParallel/CMakeLists.txt
+++ b/Tests/CTestTestParallel/CMakeLists.txt
@@ -1,15 +1,15 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(CTestTestParallel)
-INCLUDE(CTest)
+project(CTestTestParallel)
+include(CTest)
 
-ADD_EXECUTABLE (LockFile lockFile.c)
+add_executable (LockFile lockFile.c)
 
-ADD_TEST (TestRunSerial1 LockFile)
-ADD_TEST (TestRunSerial2 LockFile)
-SET_TESTS_PROPERTIES(TestRunSerial1 TestRunSerial2 PROPERTIES RUN_SERIAL true)
+add_test (TestRunSerial1 LockFile)
+add_test (TestRunSerial2 LockFile)
+set_tests_properties(TestRunSerial1 TestRunSerial2 PROPERTIES RUN_SERIAL true)
 
-ADD_TEST (TestProcessorsGreaterThanMPL1 LockFile)
-ADD_TEST (TestProcessorsGreaterThanMPL2 LockFile)
-SET_TESTS_PROPERTIES(TestProcessorsGreaterThanMPL1 PROPERTIES PROCESSORS 10)
-SET_TESTS_PROPERTIES(TestProcessorsGreaterThanMPL1 PROPERTIES DEPENDS
+add_test (TestProcessorsGreaterThanMPL1 LockFile)
+add_test (TestProcessorsGreaterThanMPL2 LockFile)
+set_tests_properties(TestProcessorsGreaterThanMPL1 PROPERTIES PROCESSORS 10)
+set_tests_properties(TestProcessorsGreaterThanMPL1 PROPERTIES DEPENDS
                      TestProcessorsGreaterThanMPL2)
diff --git a/Tests/CTestTestParallel/test.cmake.in b/Tests/CTestTestParallel/test.cmake.in
index 83845dee4..0418755cf 100644
--- a/Tests/CTestTestParallel/test.cmake.in
+++ b/Tests/CTestTestParallel/test.cmake.in
@@ -1,17 +1,17 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
+cmake_minimum_required(VERSION 2.1)
 
 # Settings:
-SET(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
-SET(CTEST_SITE                          "@SITE@")
-SET(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-Parallel")
+set(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
+set(CTEST_SITE                          "@SITE@")
+set(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-Parallel")
 
-SET(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestParallel")
-SET(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestParallel")
-SET(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
-SET(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
-SET(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
-SET(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
-SET(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestParallel")
+set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestParallel")
+set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
 
 #CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
 
diff --git a/Tests/CTestTestResourceLock/CMakeLists.txt b/Tests/CTestTestResourceLock/CMakeLists.txt
index 1041ef149..4001643fd 100644
--- a/Tests/CTestTestResourceLock/CMakeLists.txt
+++ b/Tests/CTestTestResourceLock/CMakeLists.txt
@@ -1,13 +1,13 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(CTestTestResourceLock)
-INCLUDE(CTest)
+project(CTestTestResourceLock)
+include(CTest)
 
-ADD_EXECUTABLE (LockFile lockFile.c)
+add_executable (LockFile lockFile.c)
 
-ADD_TEST (TestLockedFile1.1 LockFile locked1.txt)
-ADD_TEST (TestLockedFile1.2 LockFile locked1.txt)
-SET_TESTS_PROPERTIES(TestLockedFile1.1 TestLockedFile1.2 PROPERTIES RESOURCE_LOCK "locked1.txt")
+add_test (TestLockedFile1.1 LockFile locked1.txt)
+add_test (TestLockedFile1.2 LockFile locked1.txt)
+set_tests_properties(TestLockedFile1.1 TestLockedFile1.2 PROPERTIES RESOURCE_LOCK "locked1.txt")
 
-ADD_TEST (TestLockedFile2.1 LockFile locked2.txt)
-ADD_TEST (TestLockedFile2.2 LockFile locked2.txt)
-SET_TESTS_PROPERTIES(TestLockedFile2.1 TestLockedFile2.2 PROPERTIES RESOURCE_LOCK "locked2.txt")
+add_test (TestLockedFile2.1 LockFile locked2.txt)
+add_test (TestLockedFile2.2 LockFile locked2.txt)
+set_tests_properties(TestLockedFile2.1 TestLockedFile2.2 PROPERTIES RESOURCE_LOCK "locked2.txt")
diff --git a/Tests/CTestTestResourceLock/test.cmake.in b/Tests/CTestTestResourceLock/test.cmake.in
index 98c5901c4..571cc5050 100644
--- a/Tests/CTestTestResourceLock/test.cmake.in
+++ b/Tests/CTestTestResourceLock/test.cmake.in
@@ -1,17 +1,17 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
+cmake_minimum_required(VERSION 2.1)
 
 # Settings:
-SET(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
-SET(CTEST_SITE                          "@SITE@")
-SET(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-ResourceLock")
+set(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
+set(CTEST_SITE                          "@SITE@")
+set(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-ResourceLock")
 
-SET(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestResourceLock")
-SET(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestResourceLock")
-SET(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
-SET(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
-SET(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
-SET(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
-SET(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestResourceLock")
+set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestResourceLock")
+set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
 
 CTEST_START(Experimental)
 CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestRunScript/hello.cmake.in b/Tests/CTestTestRunScript/hello.cmake.in
index 140df1e02..37905e3c4 100644
--- a/Tests/CTestTestRunScript/hello.cmake.in
+++ b/Tests/CTestTestRunScript/hello.cmake.in
@@ -1,2 +1,2 @@
-SET(CTEST_RUN_CURRENT_SCRIPT 0)
-MESSAGE("hello world")
+set(CTEST_RUN_CURRENT_SCRIPT 0)
+message("hello world")
diff --git a/Tests/CTestTestRunScript/test.cmake.in b/Tests/CTestTestRunScript/test.cmake.in
index 8301a56d3..3074a5156 100644
--- a/Tests/CTestTestRunScript/test.cmake.in
+++ b/Tests/CTestTestRunScript/test.cmake.in
@@ -1,2 +1,2 @@
-SET(CTEST_RUN_CURRENT_SCRIPT 0)
+set(CTEST_RUN_CURRENT_SCRIPT 0)
 CTEST_RUN_SCRIPT("CTestTestRunScript/hello.cmake" RETURN_VALUE res RETURN_VALUE)
diff --git a/Tests/CTestTestScheduler/CMakeLists.txt b/Tests/CTestTestScheduler/CMakeLists.txt
index 882988fd4..d2b3bb45a 100644
--- a/Tests/CTestTestScheduler/CMakeLists.txt
+++ b/Tests/CTestTestScheduler/CMakeLists.txt
@@ -1,9 +1,9 @@
-CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
-PROJECT (CTestTestScheduler)
-INCLUDE (CTest)
+cmake_minimum_required (VERSION 2.6)
+project (CTestTestScheduler)
+include (CTest)
 
-ADD_EXECUTABLE (Sleep sleep.c)
+add_executable (Sleep sleep.c)
 
-FOREACH (time RANGE 1 4)
-  ADD_TEST (TestSleep${time} Sleep ${time})
-ENDFOREACH (time RANGE 1 4)
+foreach (time RANGE 1 4)
+  add_test (TestSleep${time} Sleep ${time})
+endforeach (time RANGE 1 4)
diff --git a/Tests/CTestTestScheduler/test.cmake.in b/Tests/CTestTestScheduler/test.cmake.in
index 505bd7c5b..87a390a64 100644
--- a/Tests/CTestTestScheduler/test.cmake.in
+++ b/Tests/CTestTestScheduler/test.cmake.in
@@ -1,24 +1,24 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
+cmake_minimum_required(VERSION 2.1)
 
 # Settings:
-SET(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
-SET(CTEST_SITE                          "@SITE@")
-SET(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-Scheduler")
+set(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
+set(CTEST_SITE                          "@SITE@")
+set(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-Scheduler")
 
-SET(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestScheduler")
-SET(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestScheduler")
-SET(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
-SET(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
-SET(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
-SET(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
-SET(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestScheduler")
+set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestScheduler")
+set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
 
 #CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
 
 # Remove old cost data file if it exists
-IF(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt")
-  FILE(REMOVE "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt")
-ENDIF(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt")
+if(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt")
+  file(REMOVE "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt")
+endif(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt")
 
 CTEST_START(Experimental)
 CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestStopTime/CMakeLists.txt b/Tests/CTestTestStopTime/CMakeLists.txt
index 5fe30d352..bd8bebdda 100644
--- a/Tests/CTestTestStopTime/CMakeLists.txt
+++ b/Tests/CTestTestStopTime/CMakeLists.txt
@@ -1,11 +1,11 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(CTestTestStopTime)
-INCLUDE(CTest)
+project(CTestTestStopTime)
+include(CTest)
 
-ADD_EXECUTABLE (Sleep sleep.c)
+add_executable (Sleep sleep.c)
 
-ADD_TEST (TestSleep Sleep 30)
-ADD_TEST (ShouldNotRun Sleep 30)
+add_test (TestSleep Sleep 30)
+add_test (ShouldNotRun Sleep 30)
 
-SET_TESTS_PROPERTIES(ShouldNotRun PROPERTIES DEPENDS TestSleep)
-SET_TESTS_PROPERTIES(ShouldNotRun PROPERTIES WILL_FAIL ON)
+set_tests_properties(ShouldNotRun PROPERTIES DEPENDS TestSleep)
+set_tests_properties(ShouldNotRun PROPERTIES WILL_FAIL ON)
diff --git a/Tests/CTestTestStopTime/GetDate.cmake b/Tests/CTestTestStopTime/GetDate.cmake
index b79330691..ac8f65df9 100644
--- a/Tests/CTestTestStopTime/GetDate.cmake
+++ b/Tests/CTestTestStopTime/GetDate.cmake
@@ -1,6 +1,6 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.2)
+cmake_minimum_required(VERSION 2.2)
 
-MACRO(GET_DATE)
+macro(GET_DATE)
   #
   # All macro arguments are optional.
   #   If there's an ARGV0, use it as GD_PREFIX. Default = 'GD_'
@@ -34,20 +34,20 @@ MACRO(GET_DATE)
 
   # If there's an ARGV0, use it as GD_PREFIX:
   #
-  SET(GD_PREFIX "GD_")
-  IF(NOT "${ARGV0}" STREQUAL "")
-    SET(GD_PREFIX "${ARGV0}")
-  ENDIF(NOT "${ARGV0}" STREQUAL "")
-  IF(NOT "${GD_PREFIX}" STREQUAL "GD_")
-    SET(${GD_PREFIX}PREFIX "${GD_PREFIX}")
-  ENDIF(NOT "${GD_PREFIX}" STREQUAL "GD_")
+  set(GD_PREFIX "GD_")
+  if(NOT "${ARGV0}" STREQUAL "")
+    set(GD_PREFIX "${ARGV0}")
+  endif(NOT "${ARGV0}" STREQUAL "")
+  if(NOT "${GD_PREFIX}" STREQUAL "GD_")
+    set(${GD_PREFIX}PREFIX "${GD_PREFIX}")
+  endif(NOT "${GD_PREFIX}" STREQUAL "GD_")
 
   # If there's an ARGV1, use it as ${GD_PREFIX}VERBOSE:
   #
-  SET(${GD_PREFIX}VERBOSE "0")
-  IF(NOT "${ARGV1}" STREQUAL "")
-    SET(${GD_PREFIX}VERBOSE "${ARGV1}")
-  ENDIF(NOT "${ARGV1}" STREQUAL "")
+  set(${GD_PREFIX}VERBOSE "0")
+  if(NOT "${ARGV1}" STREQUAL "")
+    set(${GD_PREFIX}VERBOSE "${ARGV1}")
+  endif(NOT "${ARGV1}" STREQUAL "")
 
   # Retrieve the current date and time in the format:
   #
@@ -57,58 +57,58 @@ MACRO(GET_DATE)
   # Use "echo %DATE% %TIME%" on Windows.
   # Otherwise, try "date" as implemented on most Unix flavors.
   #
-  IF(WIN32)
+  if(WIN32)
     #
     # Use "cmd" shell with %DATE% and %TIME% support...
     # May need adjustment in different locales or for custom date/time formats
     # set in the Windows Control Panel.
     #
-    SET(${GD_PREFIX}CMD "cmd")
-    SET(${GD_PREFIX}ARGS "/c echo %DATE% %TIME%")
-  ELSE(WIN32)
+    set(${GD_PREFIX}CMD "cmd")
+    set(${GD_PREFIX}ARGS "/c echo %DATE% %TIME%")
+  else(WIN32)
     #
     # Match the format returned by default in US English Windows:
     #
-    SET(${GD_PREFIX}CMD "date")
-    SET(${GD_PREFIX}ARGS "\"+%a %m/%d/%Y %H:%M:%S.00\"")
-  ENDIF(WIN32)
+    set(${GD_PREFIX}CMD "date")
+    set(${GD_PREFIX}ARGS "\"+%a %m/%d/%Y %H:%M:%S.00\"")
+  endif(WIN32)
 
-  EXEC_PROGRAM("${${GD_PREFIX}CMD}" "." ARGS "${${GD_PREFIX}ARGS}"
+  exec_program("${${GD_PREFIX}CMD}" "." ARGS "${${GD_PREFIX}ARGS}"
     OUTPUT_VARIABLE ${GD_PREFIX}OV RETURN_VALUE ${GD_PREFIX}RV
     )
 
-  IF(${GD_PREFIX}VERBOSE)
-    MESSAGE(STATUS "")
-    MESSAGE(STATUS "<GET_DATE>")
-    MESSAGE(STATUS "")
-    MESSAGE(STATUS "GD_PREFIX='${GD_PREFIX}'")
-    IF(NOT "${GD_PREFIX}" STREQUAL "GD_")
-      MESSAGE(STATUS "${GD_PREFIX}PREFIX='${${GD_PREFIX}PREFIX}'")
-    ENDIF(NOT "${GD_PREFIX}" STREQUAL "GD_")
-    MESSAGE(STATUS "${GD_PREFIX}VERBOSE='${${GD_PREFIX}VERBOSE}'")
-    MESSAGE(STATUS "")
-    MESSAGE(STATUS "${GD_PREFIX}CMD='${${GD_PREFIX}CMD}'")
-    MESSAGE(STATUS "${GD_PREFIX}ARGS='${${GD_PREFIX}ARGS}'")
-    MESSAGE(STATUS "${GD_PREFIX}OV='${${GD_PREFIX}OV}'")
-    MESSAGE(STATUS "${GD_PREFIX}RV='${${GD_PREFIX}RV}'")
-    MESSAGE(STATUS "")
-  ENDIF(${GD_PREFIX}VERBOSE)
+  if(${GD_PREFIX}VERBOSE)
+    message(STATUS "")
+    message(STATUS "<GET_DATE>")
+    message(STATUS "")
+    message(STATUS "GD_PREFIX='${GD_PREFIX}'")
+    if(NOT "${GD_PREFIX}" STREQUAL "GD_")
+      message(STATUS "${GD_PREFIX}PREFIX='${${GD_PREFIX}PREFIX}'")
+    endif(NOT "${GD_PREFIX}" STREQUAL "GD_")
+    message(STATUS "${GD_PREFIX}VERBOSE='${${GD_PREFIX}VERBOSE}'")
+    message(STATUS "")
+    message(STATUS "${GD_PREFIX}CMD='${${GD_PREFIX}CMD}'")
+    message(STATUS "${GD_PREFIX}ARGS='${${GD_PREFIX}ARGS}'")
+    message(STATUS "${GD_PREFIX}OV='${${GD_PREFIX}OV}'")
+    message(STATUS "${GD_PREFIX}RV='${${GD_PREFIX}RV}'")
+    message(STATUS "")
+  endif(${GD_PREFIX}VERBOSE)
 
-  IF("${${GD_PREFIX}RV}" STREQUAL "0")
+  if("${${GD_PREFIX}RV}" STREQUAL "0")
     #
     # Extract eight individual components by matching a regex with paren groupings.
     # Use the replace functionality and \\1 thru \\8 to extract components.
     #
-    SET(${GD_PREFIX}REGEX "([^ ]+) +([^/]+)/([^/]+)/([^ ]+) +([^:]+):([^:]+):([^\\.]+)\\.(.*)")
+    set(${GD_PREFIX}REGEX "([^ ]+) +([^/]+)/([^/]+)/([^ ]+) +([^:]+):([^:]+):([^\\.]+)\\.(.*)")
 
-    STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\1" ${GD_PREFIX}DAY_OF_WEEK "${${GD_PREFIX}OV}")
-    STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\2" ${GD_PREFIX}MONTH "${${GD_PREFIX}OV}")
-    STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\3" ${GD_PREFIX}DAY "${${GD_PREFIX}OV}")
-    STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\4" ${GD_PREFIX}YEAR "${${GD_PREFIX}OV}")
-    STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\5" ${GD_PREFIX}HOUR "${${GD_PREFIX}OV}")
-    STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\6" ${GD_PREFIX}MINUTE "${${GD_PREFIX}OV}")
-    STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\7" ${GD_PREFIX}SECOND "${${GD_PREFIX}OV}")
-    STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\8" ${GD_PREFIX}FRACTIONAL_SECOND "${${GD_PREFIX}OV}")
+    string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\1" ${GD_PREFIX}DAY_OF_WEEK "${${GD_PREFIX}OV}")
+    string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\2" ${GD_PREFIX}MONTH "${${GD_PREFIX}OV}")
+    string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\3" ${GD_PREFIX}DAY "${${GD_PREFIX}OV}")
+    string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\4" ${GD_PREFIX}YEAR "${${GD_PREFIX}OV}")
+    string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\5" ${GD_PREFIX}HOUR "${${GD_PREFIX}OV}")
+    string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\6" ${GD_PREFIX}MINUTE "${${GD_PREFIX}OV}")
+    string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\7" ${GD_PREFIX}SECOND "${${GD_PREFIX}OV}")
+    string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\8" ${GD_PREFIX}FRACTIONAL_SECOND "${${GD_PREFIX}OV}")
 
     #
     # Verify that extracted components don't have anything obviously
@@ -117,93 +117,93 @@ MACRO(GET_DATE)
 
     # Expecting a four digit year:
     #
-    IF(NOT "${${GD_PREFIX}YEAR}" MATCHES "^[0-9][0-9][0-9][0-9]$")
-      MESSAGE(STATUS "WARNING: Extracted ${GD_PREFIX}YEAR='${${GD_PREFIX}YEAR}' is not a four digit number...")
-    ENDIF(NOT "${${GD_PREFIX}YEAR}" MATCHES "^[0-9][0-9][0-9][0-9]$")
+    if(NOT "${${GD_PREFIX}YEAR}" MATCHES "^[0-9][0-9][0-9][0-9]$")
+      message(STATUS "WARNING: Extracted ${GD_PREFIX}YEAR='${${GD_PREFIX}YEAR}' is not a four digit number...")
+    endif(NOT "${${GD_PREFIX}YEAR}" MATCHES "^[0-9][0-9][0-9][0-9]$")
 
     # Expecting month to be <= 12:
     #
-    IF(${${GD_PREFIX}MONTH} GREATER 12)
-      MESSAGE(STATUS "WARNING: Extracted ${GD_PREFIX}MONTH='${${GD_PREFIX}MONTH}' is greater than 12!")
-    ENDIF(${${GD_PREFIX}MONTH} GREATER 12)
+    if(${${GD_PREFIX}MONTH} GREATER 12)
+      message(STATUS "WARNING: Extracted ${GD_PREFIX}MONTH='${${GD_PREFIX}MONTH}' is greater than 12!")
+    endif(${${GD_PREFIX}MONTH} GREATER 12)
 
     # Expecting day to be <= 31:
     #
-    IF(${${GD_PREFIX}DAY} GREATER 31)
-      MESSAGE(STATUS "WARNING: Extracted ${GD_PREFIX}DAY='${${GD_PREFIX}DAY}' is greater than 31!")
-    ENDIF(${${GD_PREFIX}DAY} GREATER 31)
+    if(${${GD_PREFIX}DAY} GREATER 31)
+      message(STATUS "WARNING: Extracted ${GD_PREFIX}DAY='${${GD_PREFIX}DAY}' is greater than 31!")
+    endif(${${GD_PREFIX}DAY} GREATER 31)
 
     # Expecting hour to be <= 23:
     #
-    IF(${${GD_PREFIX}HOUR} GREATER 23)
-      MESSAGE(STATUS "WARNING: Extracted ${GD_PREFIX}HOUR='${${GD_PREFIX}HOUR}' is greater than 23!")
-    ENDIF(${${GD_PREFIX}HOUR} GREATER 23)
+    if(${${GD_PREFIX}HOUR} GREATER 23)
+      message(STATUS "WARNING: Extracted ${GD_PREFIX}HOUR='${${GD_PREFIX}HOUR}' is greater than 23!")
+    endif(${${GD_PREFIX}HOUR} GREATER 23)
 
     # Expecting minute to be <= 59:
     #
-    IF(${${GD_PREFIX}MINUTE} GREATER 59)
-      MESSAGE(STATUS "WARNING: Extracted ${GD_PREFIX}MINUTE='${${GD_PREFIX}MINUTE}' is greater than 59!")
-    ENDIF(${${GD_PREFIX}MINUTE} GREATER 59)
+    if(${${GD_PREFIX}MINUTE} GREATER 59)
+      message(STATUS "WARNING: Extracted ${GD_PREFIX}MINUTE='${${GD_PREFIX}MINUTE}' is greater than 59!")
+    endif(${${GD_PREFIX}MINUTE} GREATER 59)
 
     # Expecting second to be <= 59:
     #
-    IF(${${GD_PREFIX}SECOND} GREATER 59)
-      MESSAGE(STATUS "WARNING: Extracted ${GD_PREFIX}SECOND='${${GD_PREFIX}SECOND}' is greater than 59!")
-    ENDIF(${${GD_PREFIX}SECOND} GREATER 59)
+    if(${${GD_PREFIX}SECOND} GREATER 59)
+      message(STATUS "WARNING: Extracted ${GD_PREFIX}SECOND='${${GD_PREFIX}SECOND}' is greater than 59!")
+    endif(${${GD_PREFIX}SECOND} GREATER 59)
 
     # If individual components are single digit,
     # prepend a leading zero:
     #
-    IF("${${GD_PREFIX}YEAR}" MATCHES "^[0-9]$")
-      SET(${GD_PREFIX}YEAR "0${${GD_PREFIX}YEAR}")
-    ENDIF("${${GD_PREFIX}YEAR}" MATCHES "^[0-9]$")
-    IF("${${GD_PREFIX}MONTH}" MATCHES "^[0-9]$")
-      SET(${GD_PREFIX}MONTH "0${${GD_PREFIX}MONTH}")
-    ENDIF("${${GD_PREFIX}MONTH}" MATCHES "^[0-9]$")
-    IF("${${GD_PREFIX}DAY}" MATCHES "^[0-9]$")
-      SET(${GD_PREFIX}DAY "0${${GD_PREFIX}DAY}")
-    ENDIF("${${GD_PREFIX}DAY}" MATCHES "^[0-9]$")
-    IF("${${GD_PREFIX}HOUR}" MATCHES "^[0-9]$")
-      SET(${GD_PREFIX}HOUR "0${${GD_PREFIX}HOUR}")
-    ENDIF("${${GD_PREFIX}HOUR}" MATCHES "^[0-9]$")
-    IF("${${GD_PREFIX}MINUTE}" MATCHES "^[0-9]$")
-      SET(${GD_PREFIX}MINUTE "0${${GD_PREFIX}MINUTE}")
-    ENDIF("${${GD_PREFIX}MINUTE}" MATCHES "^[0-9]$")
-    IF("${${GD_PREFIX}SECOND}" MATCHES "^[0-9]$")
-      SET(${GD_PREFIX}SECOND "0${${GD_PREFIX}SECOND}")
-    ENDIF("${${GD_PREFIX}SECOND}" MATCHES "^[0-9]$")
+    if("${${GD_PREFIX}YEAR}" MATCHES "^[0-9]$")
+      set(${GD_PREFIX}YEAR "0${${GD_PREFIX}YEAR}")
+    endif("${${GD_PREFIX}YEAR}" MATCHES "^[0-9]$")
+    if("${${GD_PREFIX}MONTH}" MATCHES "^[0-9]$")
+      set(${GD_PREFIX}MONTH "0${${GD_PREFIX}MONTH}")
+    endif("${${GD_PREFIX}MONTH}" MATCHES "^[0-9]$")
+    if("${${GD_PREFIX}DAY}" MATCHES "^[0-9]$")
+      set(${GD_PREFIX}DAY "0${${GD_PREFIX}DAY}")
+    endif("${${GD_PREFIX}DAY}" MATCHES "^[0-9]$")
+    if("${${GD_PREFIX}HOUR}" MATCHES "^[0-9]$")
+      set(${GD_PREFIX}HOUR "0${${GD_PREFIX}HOUR}")
+    endif("${${GD_PREFIX}HOUR}" MATCHES "^[0-9]$")
+    if("${${GD_PREFIX}MINUTE}" MATCHES "^[0-9]$")
+      set(${GD_PREFIX}MINUTE "0${${GD_PREFIX}MINUTE}")
+    endif("${${GD_PREFIX}MINUTE}" MATCHES "^[0-9]$")
+    if("${${GD_PREFIX}SECOND}" MATCHES "^[0-9]$")
+      set(${GD_PREFIX}SECOND "0${${GD_PREFIX}SECOND}")
+    endif("${${GD_PREFIX}SECOND}" MATCHES "^[0-9]$")
 
-    IF(${GD_PREFIX}VERBOSE)
-      MESSAGE(STATUS "${GD_PREFIX}REGEX='${${GD_PREFIX}REGEX}'")
-      MESSAGE(STATUS "${GD_PREFIX}YEAR='${${GD_PREFIX}YEAR}'")
-      MESSAGE(STATUS "${GD_PREFIX}MONTH='${${GD_PREFIX}MONTH}'")
-      MESSAGE(STATUS "${GD_PREFIX}DAY='${${GD_PREFIX}DAY}'")
-      MESSAGE(STATUS "${GD_PREFIX}HOUR='${${GD_PREFIX}HOUR}'")
-      MESSAGE(STATUS "${GD_PREFIX}MINUTE='${${GD_PREFIX}MINUTE}'")
-      MESSAGE(STATUS "${GD_PREFIX}SECOND='${${GD_PREFIX}SECOND}'")
-      MESSAGE(STATUS "${GD_PREFIX}FRACTIONAL_SECOND='${${GD_PREFIX}FRACTIONAL_SECOND}'")
-      MESSAGE(STATUS "${GD_PREFIX}DAY_OF_WEEK='${${GD_PREFIX}DAY_OF_WEEK}'")
-      MESSAGE(STATUS "")
-      MESSAGE(STATUS "Counters that change...")
-      MESSAGE(STATUS "")
-      MESSAGE(STATUS "...very very quickly : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}${${GD_PREFIX}DAY}${${GD_PREFIX}HOUR}${${GD_PREFIX}MINUTE}${${GD_PREFIX}SECOND}${${GD_PREFIX}FRACTIONAL_SECOND}")
-      MESSAGE(STATUS "        every second : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}${${GD_PREFIX}DAY}${${GD_PREFIX}HOUR}${${GD_PREFIX}MINUTE}${${GD_PREFIX}SECOND}")
-      MESSAGE(STATUS "               daily : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}${${GD_PREFIX}DAY}")
-      MESSAGE(STATUS "             monthly : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}")
-      MESSAGE(STATUS "            annually : ${${GD_PREFIX}YEAR}")
-      MESSAGE(STATUS "")
-    ENDIF(${GD_PREFIX}VERBOSE)
-  ELSE("${${GD_PREFIX}RV}" STREQUAL "0")
-    MESSAGE(SEND_ERROR "ERROR: MACRO(GET_DATE) failed. ${GD_PREFIX}CMD='${${GD_PREFIX}CMD}' ${GD_PREFIX}ARGS='${${GD_PREFIX}ARGS}' ${GD_PREFIX}OV='${${GD_PREFIX}OV}' ${GD_PREFIX}RV='${${GD_PREFIX}RV}'")
-  ENDIF("${${GD_PREFIX}RV}" STREQUAL "0")
+    if(${GD_PREFIX}VERBOSE)
+      message(STATUS "${GD_PREFIX}REGEX='${${GD_PREFIX}REGEX}'")
+      message(STATUS "${GD_PREFIX}YEAR='${${GD_PREFIX}YEAR}'")
+      message(STATUS "${GD_PREFIX}MONTH='${${GD_PREFIX}MONTH}'")
+      message(STATUS "${GD_PREFIX}DAY='${${GD_PREFIX}DAY}'")
+      message(STATUS "${GD_PREFIX}HOUR='${${GD_PREFIX}HOUR}'")
+      message(STATUS "${GD_PREFIX}MINUTE='${${GD_PREFIX}MINUTE}'")
+      message(STATUS "${GD_PREFIX}SECOND='${${GD_PREFIX}SECOND}'")
+      message(STATUS "${GD_PREFIX}FRACTIONAL_SECOND='${${GD_PREFIX}FRACTIONAL_SECOND}'")
+      message(STATUS "${GD_PREFIX}DAY_OF_WEEK='${${GD_PREFIX}DAY_OF_WEEK}'")
+      message(STATUS "")
+      message(STATUS "Counters that change...")
+      message(STATUS "")
+      message(STATUS "...very very quickly : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}${${GD_PREFIX}DAY}${${GD_PREFIX}HOUR}${${GD_PREFIX}MINUTE}${${GD_PREFIX}SECOND}${${GD_PREFIX}FRACTIONAL_SECOND}")
+      message(STATUS "        every second : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}${${GD_PREFIX}DAY}${${GD_PREFIX}HOUR}${${GD_PREFIX}MINUTE}${${GD_PREFIX}SECOND}")
+      message(STATUS "               daily : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}${${GD_PREFIX}DAY}")
+      message(STATUS "             monthly : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}")
+      message(STATUS "            annually : ${${GD_PREFIX}YEAR}")
+      message(STATUS "")
+    endif(${GD_PREFIX}VERBOSE)
+  else("${${GD_PREFIX}RV}" STREQUAL "0")
+    message(SEND_ERROR "ERROR: macro(GET_DATE) failed. ${GD_PREFIX}CMD='${${GD_PREFIX}CMD}' ${GD_PREFIX}ARGS='${${GD_PREFIX}ARGS}' ${GD_PREFIX}OV='${${GD_PREFIX}OV}' ${GD_PREFIX}RV='${${GD_PREFIX}RV}'")
+  endif("${${GD_PREFIX}RV}" STREQUAL "0")
 
-  IF(${GD_PREFIX}VERBOSE)
-    MESSAGE(STATUS "</GET_DATE>")
-    MESSAGE(STATUS "")
-  ENDIF(${GD_PREFIX}VERBOSE)
-ENDMACRO(GET_DATE)
+  if(${GD_PREFIX}VERBOSE)
+    message(STATUS "</GET_DATE>")
+    message(STATUS "")
+  endif(${GD_PREFIX}VERBOSE)
+endmacro(GET_DATE)
 
-MACRO(ADD_SECONDS sec)
+macro(ADD_SECONDS sec)
   set(new_min ${${GD_PREFIX}MINUTE})
   set(new_hr ${${GD_PREFIX}HOUR})
   math(EXPR new_sec "${sec} + ${${GD_PREFIX}SECOND}")
@@ -230,4 +230,4 @@ MACRO(ADD_SECONDS sec)
   if(${hr_len} EQUAL 1)
     set(new_hr "0${new_hr}")
   endif()
-ENDMACRO(ADD_SECONDS)
+endmacro(ADD_SECONDS)
diff --git a/Tests/CTestTestStopTime/test.cmake.in b/Tests/CTestTestStopTime/test.cmake.in
index 2d03686e6..c3920a414 100644
--- a/Tests/CTestTestStopTime/test.cmake.in
+++ b/Tests/CTestTestStopTime/test.cmake.in
@@ -1,21 +1,21 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
+cmake_minimum_required(VERSION 2.1)
 
 # Settings:
-SET(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
-SET(CTEST_SITE                          "@SITE@")
-SET(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-StopTime")
+set(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
+set(CTEST_SITE                          "@SITE@")
+set(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-StopTime")
 
-SET(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestStopTime")
-SET(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestStopTime")
-SET(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
-SET(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
-SET(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
-SET(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
-SET(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestStopTime")
+set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestStopTime")
+set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
 
 #CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
 
-INCLUDE("${CTEST_BINARY_DIRECTORY}/GetDate.cmake")
+include("${CTEST_BINARY_DIRECTORY}/GetDate.cmake")
 
 CTEST_START(Experimental)
 CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestSubdir/CMakeLists.txt b/Tests/CTestTestSubdir/CMakeLists.txt
index 5400ee8c5..b7cc7e2f1 100644
--- a/Tests/CTestTestSubdir/CMakeLists.txt
+++ b/Tests/CTestTestSubdir/CMakeLists.txt
@@ -1,7 +1,7 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(CTestTestSubdir)
-INCLUDE(CTest)
+project(CTestTestSubdir)
+include(CTest)
 
-ADD_SUBDIRECTORY(subdir)
-SUBDIRS(subdir2)
-SUBDIRS("${CTestTestSubdir_SOURCE_DIR}/subdir3")
+add_subdirectory(subdir)
+subdirs(subdir2)
+subdirs("${CTestTestSubdir_SOURCE_DIR}/subdir3")
diff --git a/Tests/CTestTestSubdir/subdir/CMakeLists.txt b/Tests/CTestTestSubdir/subdir/CMakeLists.txt
index b40d316d6..ee555354e 100644
--- a/Tests/CTestTestSubdir/subdir/CMakeLists.txt
+++ b/Tests/CTestTestSubdir/subdir/CMakeLists.txt
@@ -1,2 +1,2 @@
-ADD_EXECUTABLE (main main.c)
-ADD_TEST (TestMain1 main)
+add_executable (main main.c)
+add_test (TestMain1 main)
diff --git a/Tests/CTestTestSubdir/subdir2/CMakeLists.txt b/Tests/CTestTestSubdir/subdir2/CMakeLists.txt
index 23f8e07c2..a8d0a779b 100644
--- a/Tests/CTestTestSubdir/subdir2/CMakeLists.txt
+++ b/Tests/CTestTestSubdir/subdir2/CMakeLists.txt
@@ -1,2 +1,2 @@
-ADD_EXECUTABLE (main2 main.c)
-ADD_TEST (TestMain2 main2)
+add_executable (main2 main.c)
+add_test (TestMain2 main2)
diff --git a/Tests/CTestTestSubdir/subdir3/CMakeLists.txt b/Tests/CTestTestSubdir/subdir3/CMakeLists.txt
index 9a44b12b8..fbc41d5e6 100644
--- a/Tests/CTestTestSubdir/subdir3/CMakeLists.txt
+++ b/Tests/CTestTestSubdir/subdir3/CMakeLists.txt
@@ -1,2 +1,2 @@
-ADD_EXECUTABLE (main3 main.c)
-ADD_TEST (TestMain3 main3)
+add_executable (main3 main.c)
+add_test (TestMain3 main3)
diff --git a/Tests/CTestTestSubdir/test.cmake.in b/Tests/CTestTestSubdir/test.cmake.in
index f240473ee..d1d87adc4 100644
--- a/Tests/CTestTestSubdir/test.cmake.in
+++ b/Tests/CTestTestSubdir/test.cmake.in
@@ -1,17 +1,17 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
+cmake_minimum_required(VERSION 2.1)
 
 # Settings:
-SET(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
-SET(CTEST_SITE                          "@SITE@")
-SET(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-Subdir")
+set(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
+set(CTEST_SITE                          "@SITE@")
+set(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-Subdir")
 
-SET(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestSubdir")
-SET(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestSubdir")
-SET(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
-SET(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
-SET(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
-SET(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
-SET(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestSubdir")
+set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestSubdir")
+set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
 
 #CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
 
diff --git a/Tests/CTestTestTimeout/CMakeLists.txt b/Tests/CTestTestTimeout/CMakeLists.txt
index 0fd1cebb3..476d0a5e0 100644
--- a/Tests/CTestTestTimeout/CMakeLists.txt
+++ b/Tests/CTestTestTimeout/CMakeLists.txt
@@ -1,28 +1,28 @@
 cmake_minimum_required (VERSION 2.8)
-PROJECT(CTestTestTimeout)
-INCLUDE(CTest)
+project(CTestTestTimeout)
+include(CTest)
 
-IF(NOT TIMEOUT)
-  IF(CYGWIN)
-    SET(TIMEOUT 4) # Cygwin CMake sometimes takes > 1 second to load!
-  ELSE()
-    SET(TIMEOUT 1)
-  ENDIF()
-ENDIF()
+if(NOT TIMEOUT)
+  if(CYGWIN)
+    set(TIMEOUT 4) # Cygwin CMake sometimes takes > 1 second to load!
+  else()
+    set(TIMEOUT 1)
+  endif()
+endif()
 
-ADD_DEFINITIONS(-DTIMEOUT=${TIMEOUT})
-ADD_EXECUTABLE (Timeout timeout.c)
+add_definitions(-DTIMEOUT=${TIMEOUT})
+add_executable (Timeout timeout.c)
 
-ADD_TEST(NAME TestTimeout
+add_test(NAME TestTimeout
   COMMAND ${CMAKE_COMMAND} -D Timeout=$<TARGET_FILE:Timeout>
                            -D Log=${CMAKE_CURRENT_BINARY_DIR}/timeout.log
                            -P ${CMAKE_CURRENT_SOURCE_DIR}/timeout.cmake
   )
-SET_TESTS_PROPERTIES(TestTimeout PROPERTIES TIMEOUT ${TIMEOUT})
+set_tests_properties(TestTimeout PROPERTIES TIMEOUT ${TIMEOUT})
 
-ADD_TEST(NAME CheckChild
+add_test(NAME CheckChild
   COMMAND ${CMAKE_COMMAND} -D Timeout=$<TARGET_FILE:Timeout>
                            -D Log=${CMAKE_CURRENT_BINARY_DIR}/timeout.log
                            -P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake
   )
-SET_TESTS_PROPERTIES(CheckChild PROPERTIES DEPENDS TestTimeout)
+set_tests_properties(CheckChild PROPERTIES DEPENDS TestTimeout)
diff --git a/Tests/CTestTestTimeout/test.cmake.in b/Tests/CTestTestTimeout/test.cmake.in
index 8a8dc24e5..e34dc07b5 100644
--- a/Tests/CTestTestTimeout/test.cmake.in
+++ b/Tests/CTestTestTimeout/test.cmake.in
@@ -1,21 +1,21 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
+cmake_minimum_required(VERSION 2.1)
 
 # Settings:
-SET(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
-SET(CTEST_SITE                          "@SITE@")
-SET(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-Timeout")
+set(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
+set(CTEST_SITE                          "@SITE@")
+set(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-Timeout")
 
-SET(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestTimeout")
-SET(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestTimeout")
-SET(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
-SET(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
-SET(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
-SET(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
-SET(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestTimeout")
+set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestTimeout")
+set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
 
 #CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
 
-FILE(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
+file(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
 TIMEOUT:STRING=@CTestTestTimeout_TIME@
 ")
 
diff --git a/Tests/CTestTestUpload/CMakeLists.txt b/Tests/CTestTestUpload/CMakeLists.txt
index bc164b10c..90d811cd9 100644
--- a/Tests/CTestTestUpload/CMakeLists.txt
+++ b/Tests/CTestTestUpload/CMakeLists.txt
@@ -1,4 +1,4 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(CTestTestUpload)
+project(CTestTestUpload)
 
 add_executable (Sleep sleep.c)
diff --git a/Tests/CTestTestUpload/test.cmake.in b/Tests/CTestTestUpload/test.cmake.in
index acfa233bc..2c0fc3812 100644
--- a/Tests/CTestTestUpload/test.cmake.in
+++ b/Tests/CTestTestUpload/test.cmake.in
@@ -1,14 +1,14 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
+cmake_minimum_required(VERSION 2.1)
 
 # Settings:
-SET(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
-SET(CTEST_SITE                          "@SITE@")
-SET(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-Upload")
+set(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
+set(CTEST_SITE                          "@SITE@")
+set(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-Upload")
 
-SET(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestUpload")
-SET(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestUpload")
-SET(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
-SET(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestUpload")
+set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestUpload")
+set(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
 
 CTEST_START(Experimental)
 CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestZeroTimeout/CMakeLists.txt b/Tests/CTestTestZeroTimeout/CMakeLists.txt
index 8a5246db1..4d2b79dc2 100644
--- a/Tests/CTestTestZeroTimeout/CMakeLists.txt
+++ b/Tests/CTestTestZeroTimeout/CMakeLists.txt
@@ -1,8 +1,8 @@
-CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
-PROJECT (CTestTestZeroTimeout)
-INCLUDE (CTest)
+cmake_minimum_required (VERSION 2.6)
+project (CTestTestZeroTimeout)
+include (CTest)
 
-ADD_EXECUTABLE (Sleep sleep.c)
+add_executable (Sleep sleep.c)
 
-ADD_TEST (TestExplicitZeroTimeout Sleep)
-SET_TESTS_PROPERTIES(TestExplicitZeroTimeout PROPERTIES TIMEOUT 0)
+add_test (TestExplicitZeroTimeout Sleep)
+set_tests_properties(TestExplicitZeroTimeout PROPERTIES TIMEOUT 0)
diff --git a/Tests/CTestTestZeroTimeout/test.cmake.in b/Tests/CTestTestZeroTimeout/test.cmake.in
index 56bae9d17..285a19150 100644
--- a/Tests/CTestTestZeroTimeout/test.cmake.in
+++ b/Tests/CTestTestZeroTimeout/test.cmake.in
@@ -1,18 +1,18 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
+cmake_minimum_required(VERSION 2.1)
 
 # Settings:
-SET(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
-SET(CTEST_SITE                          "@SITE@")
-SET(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-ZeroTimeout")
+set(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
+set(CTEST_SITE                          "@SITE@")
+set(CTEST_BUILD_NAME                    "CTestTest-@BUILDNAME@-ZeroTimeout")
 
-SET(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestZeroTimeout")
-SET(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestZeroTimeout")
-SET(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
-SET(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
-SET(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
-SET(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
-SET(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
-SET(CTEST_TEST_TIMEOUT                  2)
+set(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestZeroTimeout")
+set(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestZeroTimeout")
+set(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+set(CTEST_TEST_TIMEOUT                  2)
 
 CTEST_START(Experimental)
 CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CommandLineTest/CMakeLists.txt b/Tests/CommandLineTest/CMakeLists.txt
index 0493a0c4b..8a4b4f4a8 100644
--- a/Tests/CommandLineTest/CMakeLists.txt
+++ b/Tests/CommandLineTest/CMakeLists.txt
@@ -1,13 +1,13 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(CommandLineTest)
+project(CommandLineTest)
 
-GET_FILENAME_COMPONENT(CMAKE_BIN_DIR ${CMAKE_COMMAND} PATH)
-MACRO(EXEC_CMAKE_COMMAND CMAKE_ARGS)
-  EXEC_PROGRAM("${CMAKE_COMMAND}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET)
-  IF(${RET})
-    MESSAGE(SEND_ERROR "CMake command failed with arguments \"${CMAKE_ARGS}\"")
-  ENDIF(${RET})
-ENDMACRO(EXEC_CMAKE_COMMAND)
+get_filename_component(CMAKE_BIN_DIR ${CMAKE_COMMAND} PATH)
+macro(EXEC_CMAKE_COMMAND CMAKE_ARGS)
+  exec_program("${CMAKE_COMMAND}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET)
+  if(${RET})
+    message(SEND_ERROR "CMake command failed with arguments \"${CMAKE_ARGS}\"")
+  endif(${RET})
+endmacro(EXEC_CMAKE_COMMAND)
 
 EXEC_CMAKE_COMMAND("-E chdir \"${CMAKE_CURRENT_SOURCE_DIR}\" \"${CMAKE_COMMAND}\" -E echo \"Hello World\"")
 EXEC_CMAKE_COMMAND("-E time \"${CMAKE_COMMAND} -N -L ${CommandLineTest_SOURCE_DIR}\"")
@@ -24,22 +24,22 @@ EXEC_CMAKE_COMMAND("--help-html \"${CMAKE_CURRENT_BINARY_DIR}/cmake.html\"")
 EXEC_CMAKE_COMMAND("--copyright \"${CMAKE_CURRENT_BINARY_DIR}/Copyright.txt\"")
 EXEC_CMAKE_COMMAND("--version \"${CMAKE_CURRENT_BINARY_DIR}/version.txt\"")
 
-ADD_EXECUTABLE(CommandLineTest CommandLineTest.cxx)
+add_executable(CommandLineTest CommandLineTest.cxx)
 
-GET_FILENAME_COMPONENT(CMAKE_COMMAND_PATH "${CMAKE_COMMAND}" PATH)
-SET(CTEST_COMMAND "${CMAKE_COMMAND_PATH}/ctest")
-MACRO(EXEC_CTEST_COMMAND CMAKE_ARGS)
-  EXEC_PROGRAM("${CTEST_COMMAND}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET)
-  IF(${RET})
-    MESSAGE(SEND_ERROR "CTest command failed with arguments \"${CMAKE_ARGS}\"")
-  ENDIF(${RET})
-ENDMACRO(EXEC_CTEST_COMMAND)
-MACRO(EXEC_CTEST_COMMAND_WITH_DIR DIR CMAKE_ARGS)
-  EXEC_PROGRAM("${CTEST_COMMAND}" "${DIR}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET)
-  IF(${RET})
-    MESSAGE(SEND_ERROR "CTest command failed with arguments \"${CMAKE_ARGS}\"")
-  ENDIF(${RET})
-ENDMACRO(EXEC_CTEST_COMMAND_WITH_DIR)
+get_filename_component(CMAKE_COMMAND_PATH "${CMAKE_COMMAND}" PATH)
+set(CTEST_COMMAND "${CMAKE_COMMAND_PATH}/ctest")
+macro(EXEC_CTEST_COMMAND CMAKE_ARGS)
+  exec_program("${CTEST_COMMAND}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET)
+  if(${RET})
+    message(SEND_ERROR "CTest command failed with arguments \"${CMAKE_ARGS}\"")
+  endif(${RET})
+endmacro(EXEC_CTEST_COMMAND)
+macro(EXEC_CTEST_COMMAND_WITH_DIR DIR CMAKE_ARGS)
+  exec_program("${CTEST_COMMAND}" "${DIR}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET)
+  if(${RET})
+    message(SEND_ERROR "CTest command failed with arguments \"${CMAKE_ARGS}\"")
+  endif(${RET})
+endmacro(EXEC_CTEST_COMMAND_WITH_DIR)
 
 EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.."  "-N")
 EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.."  "-R complex -N")
@@ -55,25 +55,25 @@ EXEC_CTEST_COMMAND("--help-man \"${CMAKE_CURRENT_BINARY_DIR}/ctest.man\"")
 EXEC_CTEST_COMMAND("--help-html \"${CMAKE_CURRENT_BINARY_DIR}/ctest.html\"")
 EXEC_CTEST_COMMAND("--version")
 
-IF(THIS_SHOULD_BE_SET)
-  MESSAGE(STATUS "***************************")
-  MESSAGE(STATUS "PreLoad.cmake works fine.")
-  MESSAGE(STATUS "***************************")
-ELSE(THIS_SHOULD_BE_SET)
-  MESSAGE("***************************")
-  MESSAGE(FATAL_ERROR "PreLoad.cmake does not work.")
-ENDIF(THIS_SHOULD_BE_SET)
+if(THIS_SHOULD_BE_SET)
+  message(STATUS "***************************")
+  message(STATUS "PreLoad.cmake works fine.")
+  message(STATUS "***************************")
+else(THIS_SHOULD_BE_SET)
+  message("***************************")
+  message(FATAL_ERROR "PreLoad.cmake does not work.")
+endif(THIS_SHOULD_BE_SET)
 
-IF(DEFINED ENV{TEST_ENVIRONMENT_VARIABLE_NOTSET})
-  MESSAGE(SEND_ERROR "Environment variable definition test broken!")
-ENDIF(DEFINED ENV{TEST_ENVIRONMENT_VARIABLE_NOTSET})
+if(DEFINED ENV{TEST_ENVIRONMENT_VARIABLE_NOTSET})
+  message(SEND_ERROR "Environment variable definition test broken!")
+endif(DEFINED ENV{TEST_ENVIRONMENT_VARIABLE_NOTSET})
 
-SET(ENV{TEST_ENVIRONMENT_VARIABLE} "Environment variable set")
-IF("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set")
-  MESSAGE(STATUS "Environment variable set to: $ENV{TEST_ENVIRONMENT_VARIABLE}")
-  IF(NOT DEFINED ENV{TEST_ENVIRONMENT_VARIABLE})
-    MESSAGE(SEND_ERROR "Environment variable definition test failed!")
-  ENDIF(NOT DEFINED ENV{TEST_ENVIRONMENT_VARIABLE})
-ELSE("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set")
-  MESSAGE(SEND_ERROR "Environment variable setting is broken")
-ENDIF("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set")
+set(ENV{TEST_ENVIRONMENT_VARIABLE} "Environment variable set")
+if("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set")
+  message(STATUS "Environment variable set to: $ENV{TEST_ENVIRONMENT_VARIABLE}")
+  if(NOT DEFINED ENV{TEST_ENVIRONMENT_VARIABLE})
+    message(SEND_ERROR "Environment variable definition test failed!")
+  endif(NOT DEFINED ENV{TEST_ENVIRONMENT_VARIABLE})
+else("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set")
+  message(SEND_ERROR "Environment variable setting is broken")
+endif("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set")
diff --git a/Tests/CommandLineTest/PreLoad.cmake b/Tests/CommandLineTest/PreLoad.cmake
index 87284aff0..f059bcea6 100644
--- a/Tests/CommandLineTest/PreLoad.cmake
+++ b/Tests/CommandLineTest/PreLoad.cmake
@@ -1 +1 @@
-SET(THIS_SHOULD_BE_SET ON CACHE BOOL "Some variable")
+set(THIS_SHOULD_BE_SET ON CACHE BOOL "Some variable")
diff --git a/Tests/CompileCommandOutput/CMakeLists.txt b/Tests/CompileCommandOutput/CMakeLists.txt
index bd8e305c2..6f9468dca 100644
--- a/Tests/CompileCommandOutput/CMakeLists.txt
+++ b/Tests/CompileCommandOutput/CMakeLists.txt
@@ -2,15 +2,15 @@
 cmake_minimum_required (VERSION 2.6)
 project (CompileCommandOutput CXX)
 
-SET(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
 set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix")
-IF(MAKE_SUPPORTS_SPACES)
-  SET(test1_srcs "file with spaces.cxx")
-ELSE()
-  SET(test1_srcs "file_with_underscores.cxx")
-ENDIF()
-ADD_LIBRARY(test1 STATIC ${test1_srcs})
-ADD_LIBRARY(test2 SHARED "../CompileCommandOutput/relative.cxx")
-INCLUDE_DIRECTORIES(${CompileCommandOutput_SOURCE_DIR}/../../Source)
-ADD_EXECUTABLE(CompileCommandOutput compile_command_output.cxx)
-TARGET_LINK_LIBRARIES(CompileCommandOutput test1 test2)
+if(MAKE_SUPPORTS_SPACES)
+  set(test1_srcs "file with spaces.cxx")
+else()
+  set(test1_srcs "file_with_underscores.cxx")
+endif()
+add_library(test1 STATIC ${test1_srcs})
+add_library(test2 SHARED "../CompileCommandOutput/relative.cxx")
+include_directories(${CompileCommandOutput_SOURCE_DIR}/../../Source)
+add_executable(CompileCommandOutput compile_command_output.cxx)
+target_link_libraries(CompileCommandOutput test1 test2)
diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt
index 080428d58..45ea9019a 100644
--- a/Tests/Complex/CMakeLists.txt
+++ b/Tests/Complex/CMakeLists.txt
@@ -1,32 +1,32 @@
 #
 # A more complex test case
 #
-SET(CMAKE_BACKWARDS_COMPATIBILITY 1.4)
-PROJECT (Complex)
+set(CMAKE_BACKWARDS_COMPATIBILITY 1.4)
+project (Complex)
 
 # Try setting a new policy.  The IF test is for coverage.
-IF(POLICY CMP0003)
-  CMAKE_POLICY(SET CMP0003 NEW)
+if(POLICY CMP0003)
+  cmake_policy(SET CMP0003 NEW)
 
-  CMAKE_POLICY(GET CMP0003 P3)
-  IF(NOT "${P3}" STREQUAL "NEW")
-    MESSAGE(FATAL_ERROR "CMAKE_POLICY(GET) did not report NEW!")
-  ENDIF(NOT "${P3}" STREQUAL "NEW")
-ENDIF(POLICY CMP0003)
+  cmake_policy(GET CMP0003 P3)
+  if(NOT "${P3}" STREQUAL "NEW")
+    message(FATAL_ERROR "cmake_policy(GET) did not report NEW!")
+  endif(NOT "${P3}" STREQUAL "NEW")
+endif(POLICY CMP0003)
 
 # Test building without per-rule echo lines in Makefiles.
-SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES OFF)
+set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
 
-SET(CPACK_SOURCE_IGNORE_FILES "~$;\\.cvsignore$;^C:/hoffman/My Builds/testcase.*/CVS/;^C:/hoffman/My Builds/testcase.*/\\.svn/;^C:/hoffman/My Builds/testcase.*/sweigart/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/eos2001/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_tables_new/;^C:/hoffman/My Builds/testcase/COPYING$;^C:/hoffman/My Builds/testcase/INSTALL$;^C:/hoffman/My Builds/testcase/Makefile$;^C:/hoffman/My Builds/testcase/Makefile\\.in$;^C:/hoffman/My Builds/testcase/.*\\.lo$;^C:/hoffman/My Builds/testcase/.*\\.la$;^C:/hoffman/My Builds/testcase/mkinstalldirs$;^C:/hoffman/My Builds/testcase/missing$;^C:/hoffman/My Builds/testcase/ltmain\\.sh$;^C:/hoffman/My Builds/testcase/libtool$;^C:/hoffman/My Builds/testcase/install-sh$;^C:/hoffman/My Builds/testcase/configure$;^C:/hoffman/My Builds/testcase/config\\.sub$;^C:/hoffman/My Builds/testcase/config\\.status$;^C:/hoffman/My Builds/testcase/config\\.log$;^C:/hoffman/My Builds/testcase/config\\.guess$;^C:/hoffman/My Builds/testcase/autom4te\\.cache$;^C:/hoffman/My Builds/testcase/aclocal\\.m4$;^C:/hoffman/My Builds/testcase/depcomp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10_corr$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_scvh$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.rgbtip\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.zahb\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.085\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.mem$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.tex\\.bak$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j16\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j26\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j36\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_JNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Jseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_KNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Kseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check34_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check35_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check36_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check43_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check44_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check45_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check46_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check47_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check48_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/Makefile$;^C:/hoffman/My Builds/testcase/www/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/.*\\.flc$;^C:/hoffman/My Builds/testcase/src/Makefile$;^C:/hoffman/My Builds/testcase/src/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/\\.deps$;^C:/hoffman/My Builds/testcase/src/\\.libs$;^C:/hoffman/My Builds/testcase/src/.*\\.la$;^C:/hoffman/My Builds/testcase/src/.*\\.lo$;^C:/hoffman/My Builds/testcase/src/make\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/statef.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_15$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_rel$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/hot_post_agb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgb_tip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/start_shellflash\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/white_dwarf\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/3order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/5order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/8order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check8_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check5_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effoo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/tc\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/include/Makefile\\.in$;^C:/hoffman/My Builds/testcase/include/Makefile$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/0\\.1\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_eos1a-eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_0\\.1\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_eos1a-eos1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/fort\\.91$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/oldversion_grid$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2005Ap&SS\\.298\\.\\.135S\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2007Ap&SS\\.307\\.\\.263C\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/astro-ph\\.9909168_eprint_submitted_to_High_Press\\.Res\\.16,331\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/statef_grid-newversion$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/old$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/make\\.out.*$;^C:/hoffman/My Builds/testcase/utils/.*\\.flc$;^C:/hoffman/My Builds/testcase/utils/Makefile$;^C:/hoffman/My Builds/testcase/utils/Makefile\\.in$;^C:/hoffman/My Builds/testcase/utils/\\.deps$;^C:/hoffman/My Builds/testcase/utils/\\.libs$;^C:/hoffman/My Builds/testcase/utils/.*\\.la$;^C:/hoffman/My Builds/testcase/utils/.*\\.lo$;^C:/hoffman/My Builds/testcase/utils/free_eos_test$;^C:/hoffman/My Builds/testcase/utils/test_rosenbrock$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check5\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check8\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_checknr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effoo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence_20070613$;^C:/hoffman/My Builds/testcase/www/eospaper/text$;^C:/hoffman/My Builds/testcase/www/eospaper/cassisi_book_fig$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.1\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/2\\.0\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.2\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.3\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.4\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.5\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.6\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/figures$;^C:/hoffman/My Builds/testcase/www/eospaper/old$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_JNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Jseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_KNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Kseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check34\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check35\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check36\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check44\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check45\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check46\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_1_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_2_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_linear_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_nr_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_series_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.1\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.3\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_linear\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_nr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.rgbtip\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.zahb\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.rgbtip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_linear$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_noexchange$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_nr$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/delta\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos1gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos2gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb_adjust/coulomb_adjust\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/rtc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/make\\.out.*$")
+set(CPACK_SOURCE_IGNORE_FILES "~$;\\.cvsignore$;^C:/hoffman/My Builds/testcase.*/CVS/;^C:/hoffman/My Builds/testcase.*/\\.svn/;^C:/hoffman/My Builds/testcase.*/sweigart/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/eos2001/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_tables_new/;^C:/hoffman/My Builds/testcase/COPYING$;^C:/hoffman/My Builds/testcase/INSTALL$;^C:/hoffman/My Builds/testcase/Makefile$;^C:/hoffman/My Builds/testcase/Makefile\\.in$;^C:/hoffman/My Builds/testcase/.*\\.lo$;^C:/hoffman/My Builds/testcase/.*\\.la$;^C:/hoffman/My Builds/testcase/mkinstalldirs$;^C:/hoffman/My Builds/testcase/missing$;^C:/hoffman/My Builds/testcase/ltmain\\.sh$;^C:/hoffman/My Builds/testcase/libtool$;^C:/hoffman/My Builds/testcase/install-sh$;^C:/hoffman/My Builds/testcase/configure$;^C:/hoffman/My Builds/testcase/config\\.sub$;^C:/hoffman/My Builds/testcase/config\\.status$;^C:/hoffman/My Builds/testcase/config\\.log$;^C:/hoffman/My Builds/testcase/config\\.guess$;^C:/hoffman/My Builds/testcase/autom4te\\.cache$;^C:/hoffman/My Builds/testcase/aclocal\\.m4$;^C:/hoffman/My Builds/testcase/depcomp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10_corr$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_scvh$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.rgbtip\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.zahb\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.085\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.mem$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.tex\\.bak$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j16\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j26\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j36\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_JNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Jseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_KNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Kseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check34_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check35_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check36_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check43_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check44_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check45_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check46_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check47_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check48_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/Makefile$;^C:/hoffman/My Builds/testcase/www/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/.*\\.flc$;^C:/hoffman/My Builds/testcase/src/Makefile$;^C:/hoffman/My Builds/testcase/src/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/\\.deps$;^C:/hoffman/My Builds/testcase/src/\\.libs$;^C:/hoffman/My Builds/testcase/src/.*\\.la$;^C:/hoffman/My Builds/testcase/src/.*\\.lo$;^C:/hoffman/My Builds/testcase/src/make\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/statef.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_15$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_rel$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/hot_post_agb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgb_tip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/start_shellflash\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/white_dwarf\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/3order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/5order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/8order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check8_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check5_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effoo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/tc\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/include/Makefile\\.in$;^C:/hoffman/My Builds/testcase/include/Makefile$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/0\\.1\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_eos1a-eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_0\\.1\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_eos1a-eos1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/fort\\.91$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/oldversion_grid$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2005Ap&SS\\.298\\.\\.135S\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2007Ap&SS\\.307\\.\\.263C\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/astro-ph\\.9909168_eprint_submitted_to_High_Press\\.Res\\.16,331\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/statef_grid-newversion$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/old$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/make\\.out.*$;^C:/hoffman/My Builds/testcase/utils/.*\\.flc$;^C:/hoffman/My Builds/testcase/utils/Makefile$;^C:/hoffman/My Builds/testcase/utils/Makefile\\.in$;^C:/hoffman/My Builds/testcase/utils/\\.deps$;^C:/hoffman/My Builds/testcase/utils/\\.libs$;^C:/hoffman/My Builds/testcase/utils/.*\\.la$;^C:/hoffman/My Builds/testcase/utils/.*\\.lo$;^C:/hoffman/My Builds/testcase/utils/free_eos_test$;^C:/hoffman/My Builds/testcase/utils/test_rosenbrock$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check5\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check8\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_checknr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effoo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence_20070613$;^C:/hoffman/My Builds/testcase/www/eospaper/text$;^C:/hoffman/My Builds/testcase/www/eospaper/cassisi_book_fig$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.1\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/2\\.0\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.2\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.3\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.4\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.5\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.6\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/figures$;^C:/hoffman/My Builds/testcase/www/eospaper/old$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_JNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Jseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_KNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Kseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check34\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check35\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check36\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check44\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check45\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check46\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_1_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_2_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_linear_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_nr_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_series_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.1\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.3\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_linear\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_nr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.rgbtip\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.zahb\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.rgbtip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_linear$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_noexchange$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_nr$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/delta\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos1gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos2gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb_adjust/coulomb_adjust\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/rtc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/make\\.out.*$")
 
 #
 # Define a macro
 #
-MACRO(ASSERT value msg)
-  IF (NOT ${value})
-    MESSAGE ("Assertion failure:" ${msg} )
-  ENDIF (NOT ${value})
-ENDMACRO(ASSERT)
+macro(ASSERT value msg)
+  if (NOT ${value})
+    message ("Assertion failure:" ${msg} )
+  endif (NOT ${value})
+endmacro(ASSERT)
 
 # invoke the macro
 ASSERT(Complex_BINARY_DIR "The PROJECT command is broken")
@@ -34,79 +34,79 @@ ASSERT(Complex_BINARY_DIR "The PROJECT command is broken")
 #
 # Define a var args macro, it must take two or four args
 #
-MACRO(TEST_ARGC value1 value2)
-  ADD_DEFINITIONS(${value1} ${value2})
-  IF (${ARGC} MATCHES 4)
-    ADD_DEFINITIONS(${ARGV2} ${ARGV3})
-  ENDIF (${ARGC} MATCHES 4)
-ENDMACRO(TEST_ARGC)
+macro(TEST_ARGC value1 value2)
+  add_definitions(${value1} ${value2})
+  if (${ARGC} MATCHES 4)
+    add_definitions(${ARGV2} ${ARGV3})
+  endif (${ARGC} MATCHES 4)
+endmacro(TEST_ARGC)
 
 # invoke the macro
 TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4)
 
-MACRO(TEST_VAR_ARG fa)
-  IF("${ARGV}" MATCHES "^1;2;3$")
-    MESSAGE(STATUS "ARGV works")
-  ELSE("${ARGV}" MATCHES "^1;2;3$")
-    MESSAGE(FATAL_ERROR "ARGV does not work; got \"${ARGV}\" instead of \"1;2;3\"")
-  ENDIF("${ARGV}" MATCHES "^1;2;3$")
-  IF("${ARGN}" MATCHES "^2;3$")
-    MESSAGE(STATUS "ARGN works")
-  ELSE("${ARGN}" MATCHES "^2;3$")
-    MESSAGE(FATAL_ERROR "ARGV does not work; got \"${ARGN}\" instead of \"2;3\"")
-  ENDIF("${ARGN}" MATCHES "^2;3$")
-ENDMACRO(TEST_VAR_ARG)
+macro(TEST_VAR_ARG fa)
+  if("${ARGV}" MATCHES "^1;2;3$")
+    message(STATUS "ARGV works")
+  else("${ARGV}" MATCHES "^1;2;3$")
+    message(FATAL_ERROR "ARGV does not work; got \"${ARGV}\" instead of \"1;2;3\"")
+  endif("${ARGV}" MATCHES "^1;2;3$")
+  if("${ARGN}" MATCHES "^2;3$")
+    message(STATUS "ARGN works")
+  else("${ARGN}" MATCHES "^2;3$")
+    message(FATAL_ERROR "ARGV does not work; got \"${ARGN}\" instead of \"2;3\"")
+  endif("${ARGN}" MATCHES "^2;3$")
+endmacro(TEST_VAR_ARG)
 
 TEST_VAR_ARG(1 2 3)
 
 # Floating-point comparison test.
-IF(2.4 LESS 2.4)
-  MESSAGE(FATAL_ERROR "Failed: 2.4 LESS 2.4")
-ENDIF(2.4 LESS 2.4)
-IF(2.4 GREATER 2.4)
-  MESSAGE(FATAL_ERROR "Failed: 2.4 GREATER 2.4")
-ENDIF(2.4 GREATER 2.4)
-IF(NOT 2.4 EQUAL 2.4)
-  MESSAGE(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4")
-ENDIF(NOT 2.4 EQUAL 2.4)
+if(2.4 LESS 2.4)
+  message(FATAL_ERROR "Failed: 2.4 LESS 2.4")
+endif(2.4 LESS 2.4)
+if(2.4 GREATER 2.4)
+  message(FATAL_ERROR "Failed: 2.4 GREATER 2.4")
+endif(2.4 GREATER 2.4)
+if(NOT 2.4 EQUAL 2.4)
+  message(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4")
+endif(NOT 2.4 EQUAL 2.4)
 
-IF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
-  IF(NOT CMAKE_COMPILER_IS_GNUCXX)
-     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ")
-  ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
-ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
+if(CMAKE_SYSTEM MATCHES "OSF1-V.*")
+  if(NOT CMAKE_COMPILER_IS_GNUCXX)
+     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ")
+  endif(NOT CMAKE_COMPILER_IS_GNUCXX)
+endif(CMAKE_SYSTEM MATCHES "OSF1-V.*")
 
 
-ADD_DEFINITIONS(-DCMAKE_IS_FUN)
-ADD_DEFINITIONS(-DCMAKE_IS_REALLY_FUN)
-SET_PROPERTY(DIRECTORY
+add_definitions(-DCMAKE_IS_FUN)
+add_definitions(-DCMAKE_IS_REALLY_FUN)
+set_property(DIRECTORY
   PROPERTY COMPILE_DEFINITIONS_RELEASE
   CMAKE_IS_FUN_IN_RELEASE_MODE
   )
 
-SET(TEST_SEP "a b c")
-SEPARATE_ARGUMENTS(TEST_SEP)
+set(TEST_SEP "a b c")
+separate_arguments(TEST_SEP)
 
 
 #
 # Include vars from a file and from a cache
 #
-IF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
-  INCLUDE(${Complex_SOURCE_DIR}/VarTests.cmake)
-ENDIF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
-INCLUDE(fileshouldnotbehere OPTIONAL)
-LOAD_CACHE(${Complex_SOURCE_DIR}/Cache
+if (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
+  include(${Complex_SOURCE_DIR}/VarTests.cmake)
+endif (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
+include(fileshouldnotbehere OPTIONAL)
+load_cache(${Complex_SOURCE_DIR}/Cache
            EXCLUDE
              CACHE_TEST_VAR_EXCLUDED
            INCLUDE_INTERNALS
              CACHE_TEST_VAR_INTERNAL)
 
-LOAD_CACHE(${Complex_SOURCE_DIR}/Cache READ_WITH_PREFIX foo CACHE_TEST_VAR2)
-IF(${fooCACHE_TEST_VAR2} MATCHES bar)
-  MESSAGE("Load cache worked: ${fooCACHE_TEST_VAR2}")
-ELSE(${fooCACHE_TEST_VAR2} MATCHES bar)
-  MESSAGE(FATAL_ERROR "Load cache with prefix failed: ${fooCACHE_TEST_VAR2}")
-ENDIF(${fooCACHE_TEST_VAR2} MATCHES bar)
+load_cache(${Complex_SOURCE_DIR}/Cache READ_WITH_PREFIX foo CACHE_TEST_VAR2)
+if(${fooCACHE_TEST_VAR2} MATCHES bar)
+  message("Load cache worked: ${fooCACHE_TEST_VAR2}")
+else(${fooCACHE_TEST_VAR2} MATCHES bar)
+  message(FATAL_ERROR "Load cache with prefix failed: ${fooCACHE_TEST_VAR2}")
+endif(${fooCACHE_TEST_VAR2} MATCHES bar)
 
 
 
@@ -114,106 +114,106 @@ ENDIF(${fooCACHE_TEST_VAR2} MATCHES bar)
 # Specify include and lib dirs
 # (BEFORE is for coverage)
 #
-INCLUDE_DIRECTORIES(
+include_directories(
   Library
 )
 
-INCLUDE_DIRECTORIES(BEFORE
+include_directories(BEFORE
   ${Complex_BINARY_DIR}
 )
-INCLUDE_DIRECTORIES(SYSTEM Library/SystemDir)
+include_directories(SYSTEM Library/SystemDir)
 
-INCLUDE_REGULAR_EXPRESSION("^(cmTest|file|sharedFile|test).*$" "^cmMissing")
+include_regular_expression("^(cmTest|file|sharedFile|test).*$" "^cmMissing")
 
-LINK_DIRECTORIES(
+link_directories(
   ${Complex_BINARY_DIR}/Library
 )
 
 #
 # check for SET CACHE FORCE
 #
-SET(FORCE_TEST 1 CACHE STRING "a test")
-SET(FORCE_TEST 0 CACHE STRING "a test" FORCE)
+set(FORCE_TEST 1 CACHE STRING "a test")
+set(FORCE_TEST 0 CACHE STRING "a test" FORCE)
 
 #
 # Lib and exe path
 #
-SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib/static")
-SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib")
-SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/bin")
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib/static")
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib")
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/bin")
 
-MESSAGE (Test " " escape " " semi-colon " " \; \;)
+message (Test " " escape " " semi-colon " " \; \;)
 #
 # Exec program (TODO: test a result)
 # Increase coverage.
 #
-MESSAGE("\nIgnore this message")
-OPTION(NO_EXEC_PROGRAM "Do not test EXEC_PROGRAM" 0)
-IF (NOT NO_EXEC_PROGRAM)
-  EXEC_PROGRAM(${CMAKE_COMMAND} ARGS -E echo NO_EXEC_PROGRAM "${Complex_BINARY_DIR}")
-ELSE (NOT NO_EXEC_PROGRAM)
-  MESSAGE("Set this option ON")
-ENDIF (NOT NO_EXEC_PROGRAM)
+message("\nIgnore this message")
+option(NO_EXEC_PROGRAM "Do not test EXEC_PROGRAM" 0)
+if (NOT NO_EXEC_PROGRAM)
+  exec_program(${CMAKE_COMMAND} ARGS -E echo NO_EXEC_PROGRAM "${Complex_BINARY_DIR}")
+else (NOT NO_EXEC_PROGRAM)
+  message("Set this option ON")
+endif (NOT NO_EXEC_PROGRAM)
 
-MARK_AS_ADVANCED(NO_EXEC_PROGRAM)
-MARK_AS_ADVANCED(CLEAR NO_EXEC_PROGRAM)
+mark_as_advanced(NO_EXEC_PROGRAM)
+mark_as_advanced(CLEAR NO_EXEC_PROGRAM)
 
 # Execute a process.  Add coverage for this command.
-EXECUTE_PROCESS(
+execute_process(
   COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG"
   OUTPUT_VARIABLE TEST_OUT
   )
-IF("${TEST_OUT}" MATCHES "^ABCDEFG\n$")
-ELSE("${TEST_OUT}" MATCHES "^ABCDEFG\n$")
-  MESSAGE(SEND_ERROR "EXECUTE_PROCESS output test failed: [${TEST_OUT}]")
-ENDIF("${TEST_OUT}" MATCHES "^ABCDEFG\n$")
+if("${TEST_OUT}" MATCHES "^ABCDEFG\n$")
+else("${TEST_OUT}" MATCHES "^ABCDEFG\n$")
+  message(SEND_ERROR "EXECUTE_PROCESS output test failed: [${TEST_OUT}]")
+endif("${TEST_OUT}" MATCHES "^ABCDEFG\n$")
 
 # This test has some problems on UNIX systems.  Disabling for now.
 #
-# EXECUTE_PROCESS(
+# execute_process(
 #   COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG"
 #   COMMAND /process/does/not/exist
 #   OUTPUT_QUIET
 #   ERROR_QUIET
 #   RESULT_VARIABLE RESULT
 #   )
-# IF("${RESULT}" MATCHES "^0$")
-#   MESSAGE(SEND_ERROR
+# if("${RESULT}" MATCHES "^0$")
+#   message(SEND_ERROR
 #     "EXECUTE_PROCESS result test failed with RESULT=[${RESULT}]")
-# ELSE("${RESULT}" MATCHES "^0$")
-#   MESSAGE(STATUS "EXECUTE_PROCESS result test passed with RESULT=[${RESULT}]")
-# ENDIF("${RESULT}" MATCHES "^0$")
+# else("${RESULT}" MATCHES "^0$")
+#   message(STATUS "EXECUTE_PROCESS result test passed with RESULT=[${RESULT}]")
+# endif("${RESULT}" MATCHES "^0$")
 
 #
 # Create directory.
 # The 'complex' executable will then test if this dir exists,
 # sadly it won't be able to remove it.
 #
-MAKE_DIRECTORY("${Complex_BINARY_DIR}/make_dir")
+make_directory("${Complex_BINARY_DIR}/make_dir")
 
 #
 # Test FIND_LIBARY
 # Create a dummy empty lib
 #
-CONFIGURE_FILE(
+configure_file(
   ${Complex_SOURCE_DIR}/Library/dummy
   ${Complex_BINARY_DIR}/Library/dummylib.lib
   COPYONLY IMMEDIATE)
-FOREACH (ext ${CMAKE_SHLIB_SUFFIX};.so;.a;.sl
+foreach (ext ${CMAKE_SHLIB_SUFFIX};.so;.a;.sl
          ${CMAKE_SHARED_LIBRARY_SUFFIX}.2
          ${CMAKE_STATIC_LIBRARY_SUFFIX}.2)
-  CONFIGURE_FILE(
+  configure_file(
     ${Complex_SOURCE_DIR}/Library/dummy
     ${Complex_BINARY_DIR}/Library/libdummylib${ext}
     COPYONLY IMMEDIATE)
-ENDFOREACH (ext)
+endforeach (ext)
 
-FIND_LIBRARY(FIND_DUMMY_LIB
+find_library(FIND_DUMMY_LIB
              dummylib
              PATHS
              ${Complex_BINARY_DIR}/Library DOC "find dummy lib")
 
-FIND_LIBRARY(FIND_DUMMY_LIB
+find_library(FIND_DUMMY_LIB
              NAMES dummylib dummylib2
              PATHS
              ${Complex_BINARY_DIR}/Library DOC "find dummy lib")
@@ -221,104 +221,104 @@ FIND_LIBRARY(FIND_DUMMY_LIB
 # This doesn't work for platforms that have a shared library and an import
 # library, like Windows with .dll and .lib. Limit is to ".so" now because it's
 # known to work there.
-IF(CMAKE_SHARED_LIBRARY_SUFFIX STREQUAL ".so")
-  FIND_LIBRARY(FIND_DUMMY_SHLIB_VERSIONED
+if(CMAKE_SHARED_LIBRARY_SUFFIX STREQUAL ".so")
+  find_library(FIND_DUMMY_SHLIB_VERSIONED
                NAMES libdummylib${CMAKE_SHARED_LIBRARY_SUFFIX}.2
                PATHS ${Complex_BINARY_DIR}/Library
                DOC "find versioned dummy shared lib"
                NO_DEFAULT_PATH)
 
-  IF(NOT FIND_DUMMY_SHLIB_VERSIONED MATCHES "/libdummylib${CMAKE_SHARED_LIBRARY_SUFFIX}.2")
-    MESSAGE(SEND_ERROR "FIND_DUMMY_SHLIB_VERSIONED is not set correctly: "
+  if(NOT FIND_DUMMY_SHLIB_VERSIONED MATCHES "/libdummylib${CMAKE_SHARED_LIBRARY_SUFFIX}.2")
+    message(SEND_ERROR "FIND_DUMMY_SHLIB_VERSIONED is not set correctly: "
             "${FIND_DUMMY_SHLIB_VERSIONED}")
-  ENDIF()
-ENDIF()
+  endif()
+endif()
 
 # Static library, should work everywhere
-FIND_LIBRARY(FIND_DUMMY_STLIB_VERSIONED
+find_library(FIND_DUMMY_STLIB_VERSIONED
              NAMES libdummylib${CMAKE_STATIC_LIBRARY_SUFFIX}.2
              PATHS ${Complex_BINARY_DIR}/Library
              DOC "find versioned dummy static lib"
              NO_DEFAULT_PATH)
 
-IF(NOT FIND_DUMMY_STLIB_VERSIONED MATCHES "/libdummylib${CMAKE_STATIC_LIBRARY_SUFFIX}.2")
-  MESSAGE(SEND_ERROR "FIND_DUMMY_STLIB_VERSIONED is not set correctly: "
+if(NOT FIND_DUMMY_STLIB_VERSIONED MATCHES "/libdummylib${CMAKE_STATIC_LIBRARY_SUFFIX}.2")
+  message(SEND_ERROR "FIND_DUMMY_STLIB_VERSIONED is not set correctly: "
           "${FIND_DUMMY_STLIB_VERSIONED}")
-ENDIF()
+endif()
 
 #
 # Test SET_SOURCE_FILES_PROPERTIES
 #
-SET_SOURCE_FILES_PROPERTIES(nonexisting_file2
+set_source_files_properties(nonexisting_file2
   GENERATED
   ABSTRACT
   WRAP_EXCLUDE
   COMPILE_FLAGS "-foo -bar")
 
-GET_SOURCE_FILE_PROPERTY(FILE_HAS_ABSTRACT nonexisting_file2 ABSTRACT)
-GET_SOURCE_FILE_PROPERTY(FILE_HAS_WRAP_EXCLUDE nonexisting_file2 WRAP_EXCLUDE)
-GET_SOURCE_FILE_PROPERTY(FILE_COMPILE_FLAGS nonexisting_file2 COMPILE_FLAGS)
+get_source_file_property(FILE_HAS_ABSTRACT nonexisting_file2 ABSTRACT)
+get_source_file_property(FILE_HAS_WRAP_EXCLUDE nonexisting_file2 WRAP_EXCLUDE)
+get_source_file_property(FILE_COMPILE_FLAGS nonexisting_file2 COMPILE_FLAGS)
 
-SET_SOURCE_FILES_PROPERTIES(nonexisting_file3 PROPERTIES
+set_source_files_properties(nonexisting_file3 PROPERTIES
   GENERATED 1
   ABSTRACT 1
   WRAP_EXCLUDE 1
   COMPILE_FLAGS "-foo -bar")
-GET_SOURCE_FILE_PROPERTY(FILE_HAS_ABSTRACT nonexisting_file3 ABSTRACT)
-GET_SOURCE_FILE_PROPERTY(FILE_HAS_WRAP_EXCLUDE nonexisting_file3 WRAP_EXCLUDE)
-GET_SOURCE_FILE_PROPERTY(FILE_COMPILE_FLAGS nonexisting_file3 COMPILE_FLAGS)
+get_source_file_property(FILE_HAS_ABSTRACT nonexisting_file3 ABSTRACT)
+get_source_file_property(FILE_HAS_WRAP_EXCLUDE nonexisting_file3 WRAP_EXCLUDE)
+get_source_file_property(FILE_COMPILE_FLAGS nonexisting_file3 COMPILE_FLAGS)
 
 #
 # Test registry (win32)
 # Create a file, put its path in a registry key, try to find the file in that
 # path using that registry key, then remove the file and the key
 #
-IF (WIN32)
-  IF (NOT UNIX)
-    SET(dir "${Complex_BINARY_DIR}/registry_dir")
-    SET(file "registry_test_dummy")
-    SET(hkey "HKEY_CURRENT_USER\\Software\\Kitware\\CMake\\Tests\\Complex;registry_test")
-    CONFIGURE_FILE(
+if (WIN32)
+  if (NOT UNIX)
+    set(dir "${Complex_BINARY_DIR}/registry_dir")
+    set(file "registry_test_dummy")
+    set(hkey "HKEY_CURRENT_USER\\Software\\Kitware\\CMake\\Tests\\Complex;registry_test")
+    configure_file(
       ${Complex_SOURCE_DIR}/Library/dummy
       "${dir}/${file}"
       COPYONLY IMMEDIATE)
-    EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "-E write_regv \"${hkey}\" \"${dir}\"")
-    FIND_PATH(REGISTRY_TEST_PATH
+    exec_program(${CMAKE_COMMAND} ARGS "-E write_regv \"${hkey}\" \"${dir}\"")
+    find_path(REGISTRY_TEST_PATH
       ${file}
       "[${hkey}]" DOC "Registry_Test_Path")
-    EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"")
-    EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "-E remove \"${dir}/${file}\"")
-  ENDIF (NOT UNIX)
-ENDIF (WIN32)
+    exec_program(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"")
+    exec_program(${CMAKE_COMMAND} ARGS "-E remove \"${dir}/${file}\"")
+  endif (NOT UNIX)
+endif (WIN32)
 
 #
 # Test a set and a remove
 #
-SET(REMOVE_STRING a b c d e f)
-SET(removeVar1 c e)
-REMOVE(REMOVE_STRING ${removeVar1} f)
+set(REMOVE_STRING a b c d e f)
+set(removeVar1 c e)
+remove(REMOVE_STRING ${removeVar1} f)
 
 #
 # Test an IF inside a FOREACH.
 #
-FOREACH(x "a")
-  IF(${x} MATCHES "a")
+foreach(x "a")
+  if(${x} MATCHES "a")
     # Should always execute.
-    SET(IF_INSIDE_FOREACH_THEN_EXECUTED 1)
-  ELSE(${x} MATCHES "a")
+    set(IF_INSIDE_FOREACH_THEN_EXECUTED 1)
+  else(${x} MATCHES "a")
     # Should never execute.
-    SET(IF_INSIDE_FOREACH_ELSE_EXECUTED 1)
-  ENDIF(${x} MATCHES "a")
-ENDFOREACH(x)
+    set(IF_INSIDE_FOREACH_ELSE_EXECUTED 1)
+  endif(${x} MATCHES "a")
+endforeach(x)
 
 # test WHILE command
-SET (while_var 1)
-WHILE (while_var LESS 1000)
-  SET(while_var ${while_var}0)
-ENDWHILE(while_var LESS 1000)
+set (while_var 1)
+while (while_var LESS 1000)
+  set(while_var ${while_var}0)
+endwhile(while_var LESS 1000)
 
-SET(SHOULD_BE_ZERO )
-SET(SHOULD_BE_ONE 1)
+set(SHOULD_BE_ZERO )
+set(SHOULD_BE_ONE 1)
 
 # test elseif functionality, the mess below tries to catch problem
 # of clauses being executed early or late etc
@@ -367,40 +367,40 @@ endif()
 # Configure file
 # (plug vars to #define so that they can be tested)
 #
-CONFIGURE_FILE(
+configure_file(
   ${Complex_SOURCE_DIR}/cmTestConfigure.h.in
   ${Complex_BINARY_DIR}/cmTestConfigure.h)
 
-SET(STRING_WITH_QUOTES "\"hello world\"")
+set(STRING_WITH_QUOTES "\"hello world\"")
 # test CONFIGURE_FILE with ESCAPE_QUOTES on
-CONFIGURE_FILE(
+configure_file(
   ${Complex_SOURCE_DIR}/cmTestConfigureEscape.h.in
   ${Complex_BINARY_DIR}/cmTestConfigureEscape.h ESCAPE_QUOTES)
 
 # Test regular expression commands.
-STRING(REGEX MATCH "b" RESULT "abc")
-IF(NOT RESULT)
-  MESSAGE(SEND_ERROR "STRING(REGEX MATCH ... ) test failed.")
-ENDIF(NOT RESULT)
-STRING(REGEX MATCHALL "b" RESULT "abcb")
-IF(NOT RESULT)
-  MESSAGE(SEND_ERROR "STRING(REGEX MATCHALL ... ) test failed.")
-ENDIF(NOT RESULT)
-STRING(REGEX REPLACE ".([bd])." "[\\1]" RESULT "a(b)c(d)e")
-IF("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$")
-  SET(STRING_REGEX_PASSED 1)
-ENDIF("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$")
-IF(NOT STRING_REGEX_PASSED)
-  MESSAGE(SEND_ERROR
-    "STRING(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")")
-ENDIF(NOT STRING_REGEX_PASSED)
+string(REGEX MATCH "b" RESULT "abc")
+if(NOT RESULT)
+  message(SEND_ERROR "string(REGEX MATCH ... ) test failed.")
+endif(NOT RESULT)
+string(REGEX MATCHALL "b" RESULT "abcb")
+if(NOT RESULT)
+  message(SEND_ERROR "string(REGEX MATCHALL ... ) test failed.")
+endif(NOT RESULT)
+string(REGEX REPLACE ".([bd])." "[\\1]" RESULT "a(b)c(d)e")
+if("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$")
+  set(STRING_REGEX_PASSED 1)
+endif("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$")
+if(NOT STRING_REGEX_PASSED)
+  message(SEND_ERROR
+    "string(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")")
+endif(NOT STRING_REGEX_PASSED)
 
 
 #
 # Create the libs and the main exe
 #
-ADD_SUBDIRECTORY(Library)
-ADD_SUBDIRECTORY(Executable)
-SUBDIR_DEPENDS(Executable Library)
-EXPORT_LIBRARY_DEPENDENCIES(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake)
-INCLUDE(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake OPTIONAL)
+add_subdirectory(Library)
+add_subdirectory(Executable)
+subdir_depends(Executable Library)
+export_library_dependencies(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake)
+include(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake OPTIONAL)
diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt
index 6ccdaf026..413883551 100644
--- a/Tests/Complex/Executable/CMakeLists.txt
+++ b/Tests/Complex/Executable/CMakeLists.txt
@@ -1,116 +1,116 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 1.3)
+cmake_minimum_required(VERSION 1.3)
 #
 # Create exe.
 #
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS")
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS")
 
 # Create an imported target for if(TARGET) test below.
-ADD_LIBRARY(ExeImportedTarget UNKNOWN IMPORTED)
+add_library(ExeImportedTarget UNKNOWN IMPORTED)
 
 # Test if(TARGET) command.
-IF(NOT TARGET CMakeTestLibrary)
-  MESSAGE(FATAL_ERROR "IF(NOT TARGET CMakeTestLibrary) returned true!")
-ENDIF(NOT TARGET CMakeTestLibrary)
-IF(NOT TARGET ExeImportedTarget)
-  MESSAGE(FATAL_ERROR "IF(NOT TARGET ExeImportedTarget) returned true!")
-ENDIF(NOT TARGET ExeImportedTarget)
-IF(TARGET LibImportedTarget)
-  MESSAGE(FATAL_ERROR "IF(TARGET LibImportedTarget) returned true!")
-ENDIF(TARGET LibImportedTarget)
-IF(TARGET NotATarget)
-  MESSAGE(FATAL_ERROR "IF(TARGET NotATarget) returned true!")
-ENDIF(TARGET NotATarget)
+if(NOT TARGET CMakeTestLibrary)
+  message(FATAL_ERROR "if(NOT TARGET CMakeTestLibrary) returned true!")
+endif(NOT TARGET CMakeTestLibrary)
+if(NOT TARGET ExeImportedTarget)
+  message(FATAL_ERROR "if(NOT TARGET ExeImportedTarget) returned true!")
+endif(NOT TARGET ExeImportedTarget)
+if(TARGET LibImportedTarget)
+  message(FATAL_ERROR "if(TARGET LibImportedTarget) returned true!")
+endif(TARGET LibImportedTarget)
+if(TARGET NotATarget)
+  message(FATAL_ERROR "if(TARGET NotATarget) returned true!")
+endif(TARGET NotATarget)
 
   # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to
-SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared)
-LINK_LIBRARIES(${COMPLEX_LIBS})
+set(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared)
+link_libraries(${COMPLEX_LIBS})
 
 # Test forcing a .cxx file to not build.
-SET_SOURCE_FILES_PROPERTIES(complex_nobuild.cxx PROPERTIES
+set_source_files_properties(complex_nobuild.cxx PROPERTIES
   HEADER_FILE_ONLY 1)
 
 # Test forcing a .c file to not build.
 # This makes sure a mixed language library is created
 # with header file only sources
-SET_SOURCE_FILES_PROPERTIES(complex_nobuild.c PROPERTIES
+set_source_files_properties(complex_nobuild.c PROPERTIES
   HEADER_FILE_ONLY 1)
 
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
-ADD_EXECUTABLE(A A.cxx A.hh A.h A.txt)
-ADD_CUSTOM_COMMAND(OUTPUT Aout.h COMMAND A > Aout.h VERBATIM)
-ADD_EXECUTABLE(complex complex testcflags.c Aout.h)
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+add_executable(A A.cxx A.hh A.h A.txt)
+add_custom_command(OUTPUT Aout.h COMMAND A > Aout.h VERBATIM)
+add_executable(complex complex testcflags.c Aout.h)
 #  Sub1/NameConflictTest.c Sub2/NameConflictTest.c)
-ADD_EXECUTABLE(complex.file complex.file.cxx complex_nobuild.cxx
+add_executable(complex.file complex.file.cxx complex_nobuild.cxx
   complex_nobuild.c)
 
-IF (UNIX)
-  TARGET_LINK_LIBRARIES(complex ${CMAKE_DL_LIBS})
-ELSE(UNIX)
-  IF (NOT BORLAND)
-    IF(NOT MINGW)
-      TARGET_LINK_LIBRARIES(complex rpcrt4.lib)
-    ENDIF(NOT MINGW)
-  ENDIF(NOT BORLAND)
-ENDIF (UNIX)
+if (UNIX)
+  target_link_libraries(complex ${CMAKE_DL_LIBS})
+else(UNIX)
+  if (NOT BORLAND)
+    if(NOT MINGW)
+      target_link_libraries(complex rpcrt4.lib)
+    endif(NOT MINGW)
+  endif(NOT BORLAND)
+endif (UNIX)
 
 # Test linking to static lib when a shared lib has the same name.
-IF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
-  ADD_DEFINITIONS(-DCOMPLEX_TEST_LINK_STATIC)
-  TARGET_LINK_LIBRARIES(complex CMakeTestLinkStatic)
-ENDIF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
+if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
+  add_definitions(-DCOMPLEX_TEST_LINK_STATIC)
+  target_link_libraries(complex CMakeTestLinkStatic)
+endif(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
 
 # can we get the path to a source file
-GET_SOURCE_FILE_PROPERTY(A_LOCATION A.cxx LOCATION)
-IF ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx")
-  ADD_DEFINITIONS(-DCMAKE_FOUND_ACXX)
-ENDIF ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx")
+get_source_file_property(A_LOCATION A.cxx LOCATION)
+if ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx")
+  add_definitions(-DCMAKE_FOUND_ACXX)
+endif ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx")
 
 # get the directory parent
-GET_DIRECTORY_PROPERTY(P_VALUE PARENT_DIRECTORY)
-IF ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}")
-  ADD_DEFINITIONS(-DCMAKE_FOUND_PARENT)
-ENDIF ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}")
+get_directory_property(P_VALUE PARENT_DIRECTORY)
+if ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}")
+  add_definitions(-DCMAKE_FOUND_PARENT)
+endif ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}")
 
 # get the stack of listfiles
-INCLUDE(Included.cmake)
-IF ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake")
-  ADD_DEFINITIONS(-DCMAKE_FOUND_LISTFILE_STACK)
-ENDIF ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake")
+include(Included.cmake)
+if ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake")
+  add_definitions(-DCMAKE_FOUND_LISTFILE_STACK)
+endif ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake")
 
 # Test add/remove definitions.
-ADD_DEFINITIONS(
+add_definitions(
   -DCOMPLEX_DEFINED_PRE
   -DCOMPLEX_DEFINED
   -DCOMPLEX_DEFINED_POST
   -DCOMPLEX_DEFINED
   )
-REMOVE_DEFINITIONS(-DCOMPLEX_DEFINED)
+remove_definitions(-DCOMPLEX_DEFINED)
 
 # Test pre-build/pre-link/post-build rules for an executable.
-ADD_CUSTOM_COMMAND(TARGET complex PRE_BUILD
+add_custom_command(TARGET complex PRE_BUILD
                    COMMAND ${CREATE_FILE_EXE}
                    ARGS "${Complex_BINARY_DIR}/Executable/prebuild.txt")
-ADD_CUSTOM_COMMAND(TARGET complex PRE_BUILD
+add_custom_command(TARGET complex PRE_BUILD
                    COMMAND ${CREATE_FILE_EXE}
                    ARGS "${Complex_BINARY_DIR}/Executable/prelink.txt")
-ADD_CUSTOM_COMMAND(TARGET complex POST_BUILD
+add_custom_command(TARGET complex POST_BUILD
                    COMMAND ${CREATE_FILE_EXE}
                    ARGS "${Complex_BINARY_DIR}/Executable/postbuild.txt")
-ADD_CUSTOM_COMMAND(TARGET complex POST_BUILD
+add_custom_command(TARGET complex POST_BUILD
                    COMMAND ${CMAKE_COMMAND}
                    ARGS -E copy
                         "${Complex_BINARY_DIR}/Executable/postbuild.txt"
                         "${Complex_BINARY_DIR}/Executable/postbuild2.txt")
 
-SET_SOURCE_FILES_PROPERTIES(complex
+set_source_files_properties(complex
   COMPILE_FLAGS
   "-DFILE_HAS_EXTRA_COMPILE_FLAGS"
   #" -DFILE_DEFINE_STRING=\\\"hello\\\""
   OBJECT_DEPENDS ${Complex_BINARY_DIR}/cmTestGeneratedHeader.h
 )
-SET_TARGET_PROPERTIES(complex PROPERTIES COMPILE_FLAGS "-DCOMPLEX_TARGET_FLAG")
-ADD_CUSTOM_COMMAND(
+set_target_properties(complex PROPERTIES COMPILE_FLAGS "-DCOMPLEX_TARGET_FLAG")
+add_custom_command(
   TARGET complex
   SOURCE ${Complex_SOURCE_DIR}/cmTestGeneratedHeader.h.in
   COMMAND ${CMAKE_COMMAND}
@@ -121,18 +121,18 @@ ADD_CUSTOM_COMMAND(
 )
 
 # Test creating an executable that is not built by default.
-ADD_EXECUTABLE(notInAllExe EXCLUDE_FROM_ALL notInAllExe.cxx)
-TARGET_LINK_LIBRARIES(notInAllExe notInAllLib)
+add_executable(notInAllExe EXCLUDE_FROM_ALL notInAllExe.cxx)
+target_link_libraries(notInAllExe notInAllLib)
 
 # Test user-value flag mapping for the VS IDE.
-IF(MSVC)
-  SET_TARGET_PROPERTIES(notInAllExe PROPERTIES
+if(MSVC)
+  set_target_properties(notInAllExe PROPERTIES
     LINK_FLAGS "/NODEFAULTLIB:LIBC;LIBCMT;MSVCRT")
-ENDIF(MSVC)
+endif(MSVC)
 
 # Test creating a custom target that builds not-in-all targets.
-ADD_CUSTOM_TARGET(notInAllCustom)
-ADD_DEPENDENCIES(notInAllCustom notInAllExe)
+add_custom_target(notInAllCustom)
+add_dependencies(notInAllCustom notInAllExe)
 
 #
 # Output the files required by 'complex' to a file.
@@ -141,30 +141,30 @@ ADD_DEPENDENCIES(notInAllCustom notInAllExe)
 # has no side-effects on the current Makefile (duplicated source file
 # due to source list expansion done twice).
 #
-ADD_SUBDIRECTORY(Temp)
+add_subdirectory(Temp)
 
-IF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
-  ADD_EXECUTABLE(testSystemDir testSystemDir.cxx)
-  SET_TARGET_PROPERTIES(testSystemDir PROPERTIES COMPILE_FLAGS "-Werror")
-ENDIF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
+if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
+  add_executable(testSystemDir testSystemDir.cxx)
+  set_target_properties(testSystemDir PROPERTIES COMPILE_FLAGS "-Werror")
+endif(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
 
 #
 # Extra coverage.Not used.
 #
-INSTALL_TARGETS(/tmp complex)
-INSTALL_PROGRAMS(/tmp complex)
+install_targets(/tmp complex)
+install_programs(/tmp complex)
 
-CONFIGURE_FILE(
+configure_file(
   ${Complex_SOURCE_DIR}/Executable/cmVersion.h.in
   ${Complex_BINARY_DIR}/cmVersion.h)
 
-SOURCE_GROUP(A_GROUP ".cxx")
-SOURCE_GROUP(B_GROUP REGULAR_EXPRESSION "cxx")
-SOURCE_GROUP(C_GROUP FILES complex.cxx)
+source_group(A_GROUP ".cxx")
+source_group(B_GROUP REGULAR_EXPRESSION "cxx")
+source_group(C_GROUP FILES complex.cxx)
 
-FILE(WRITE ${Complex_BINARY_DIR}/A/libA.a "test")
-FILE(WRITE ${Complex_BINARY_DIR}/A/libC.a "test")
-FILE(WRITE ${Complex_BINARY_DIR}/B/libB.a "test")
-FILE(WRITE ${Complex_BINARY_DIR}/B/libA.a "test")
-FILE(WRITE ${Complex_BINARY_DIR}/C/libC.a "test")
-FILE(WRITE ${Complex_BINARY_DIR}/C/libB.a "test")
+file(WRITE ${Complex_BINARY_DIR}/A/libA.a "test")
+file(WRITE ${Complex_BINARY_DIR}/A/libC.a "test")
+file(WRITE ${Complex_BINARY_DIR}/B/libB.a "test")
+file(WRITE ${Complex_BINARY_DIR}/B/libA.a "test")
+file(WRITE ${Complex_BINARY_DIR}/C/libC.a "test")
+file(WRITE ${Complex_BINARY_DIR}/C/libB.a "test")
diff --git a/Tests/Complex/Executable/Included.cmake b/Tests/Complex/Executable/Included.cmake
index 2d1ea3e8c..520a68be1 100644
--- a/Tests/Complex/Executable/Included.cmake
+++ b/Tests/Complex/Executable/Included.cmake
@@ -1,2 +1,2 @@
-GET_DIRECTORY_PROPERTY(LF_VALUE LISTFILE_STACK)
+get_directory_property(LF_VALUE LISTFILE_STACK)
 
diff --git a/Tests/Complex/Executable/Temp/CMakeLists.txt b/Tests/Complex/Executable/Temp/CMakeLists.txt
index 989765e3a..041fcff20 100644
--- a/Tests/Complex/Executable/Temp/CMakeLists.txt
+++ b/Tests/Complex/Executable/Temp/CMakeLists.txt
@@ -3,6 +3,6 @@
 # The 'complex' executable will then test if this file exists and remove it.
 # The contents of this file is not tested (absolute paths).
 #
-OUTPUT_REQUIRED_FILES(
+output_required_files(
    ${Complex_SOURCE_DIR}/Executable/complex.cxx
    ${Complex_BINARY_DIR}/Executable/Temp/complex-required.txt)
diff --git a/Tests/Complex/Library/CMakeLists.txt b/Tests/Complex/Library/CMakeLists.txt
index becf67207..41faeba4d 100644
--- a/Tests/Complex/Library/CMakeLists.txt
+++ b/Tests/Complex/Library/CMakeLists.txt
@@ -1,90 +1,90 @@
-REMOVE_DEFINITIONS(-DCMAKE_IS_REALLY_FUN)
+remove_definitions(-DCMAKE_IS_REALLY_FUN)
 
 #
 # Small utility used to create file
 # UTILITY_SOURCE is used for coverage and for getting the exact name
 # of the executable.
 #
-UTILITY_SOURCE(CREATE_FILE_EXE create_file "." create_file.cxx)
-ADD_EXECUTABLE(create_file create_file.cxx)
-SET_TARGET_PROPERTIES(create_file PROPERTIES RUNTIME_OUTPUT_DIRECTORY ".")
+utility_source(CREATE_FILE_EXE create_file "." create_file.cxx)
+add_executable(create_file create_file.cxx)
+set_target_properties(create_file PROPERTIES RUNTIME_OUTPUT_DIRECTORY ".")
 
 #
 # Create static library
 # SOURCE_FILES_REMOVE is used for Coverage. empty.h is included for coverage
 #
-AUX_SOURCE_DIRECTORY(ExtraSources LibrarySources)
-SET(LibrarySources ${LibrarySources}
+aux_source_directory(ExtraSources LibrarySources)
+set(LibrarySources ${LibrarySources}
   file2
   empty
   create_file.cxx
   GENERATED
   nonexisting_file)
-REMOVE(LibrarySources create_file.cxx GENERATED nonexisting_file)
-ADD_LIBRARY(CMakeTestLibrary ${LibrarySources})
+remove(LibrarySources create_file.cxx GENERATED nonexisting_file)
+add_library(CMakeTestLibrary ${LibrarySources})
 
-IF(WIN32)
-  IF(NOT CYGWIN)
-    IF(NOT BORLAND)
-      IF(NOT MINGW)
-        TARGET_LINK_LIBRARIES(CMakeTestLibrary
+if(WIN32)
+  if(NOT CYGWIN)
+    if(NOT BORLAND)
+      if(NOT MINGW)
+        target_link_libraries(CMakeTestLibrary
           debug
           user32.lib)
-        TARGET_LINK_LIBRARIES(CMakeTestLibrary
+        target_link_libraries(CMakeTestLibrary
           optimized
           kernel32.lib)
-      ENDIF(NOT MINGW)
-    ENDIF(NOT BORLAND)
-  ENDIF(NOT CYGWIN)
-ENDIF(WIN32)
+      endif(NOT MINGW)
+    endif(NOT BORLAND)
+  endif(NOT CYGWIN)
+endif(WIN32)
 
 #
 # Create shared library
 #
-SET(SharedLibrarySources sharedFile)
-ADD_LIBRARY(CMakeTestLibraryShared SHARED ${SharedLibrarySources})
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS")
-ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c)
-DEFINE_PROPERTY(
+set(SharedLibrarySources sharedFile)
+add_library(CMakeTestLibraryShared SHARED ${SharedLibrarySources})
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS")
+add_library(CMakeTestCLibraryShared SHARED testConly.c)
+define_property(
   TARGET PROPERTY FOO
   BRIEF_DOCS "a test property"
   FULL_DOCS "A simple etst proerty that means nothign and is used for nothing"
   )
-SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES FOO BAR)
-IF(NOT BEOS AND NOT WIN32)  # No libm on BeOS.
-  SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm")
-ENDIF(NOT BEOS AND NOT WIN32)
-GET_TARGET_PROPERTY(FOO_BAR_VAR CMakeTestCLibraryShared FOO)
-IF(${FOO_BAR_VAR} MATCHES "BAR")
-ELSE(${FOO_BAR_VAR} MATCHES "BAR")
-  MESSAGE(SEND_ERROR "SET_TARGET_PROPERTIES or GET_TARGET_PROPERTY failed, FOO_BAR_VAR should be BAR, but is ${FOO_BAR_VAR}")
-ENDIF(${FOO_BAR_VAR} MATCHES "BAR")
+set_target_properties(CMakeTestCLibraryShared PROPERTIES FOO BAR)
+if(NOT BEOS AND NOT WIN32)  # No libm on BeOS.
+  set_target_properties(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm")
+endif(NOT BEOS AND NOT WIN32)
+get_target_property(FOO_BAR_VAR CMakeTestCLibraryShared FOO)
+if(${FOO_BAR_VAR} MATCHES "BAR")
+else(${FOO_BAR_VAR} MATCHES "BAR")
+  message(SEND_ERROR "SET_TARGET_PROPERTIES or GET_TARGET_PROPERTY failed, FOO_BAR_VAR should be BAR, but is ${FOO_BAR_VAR}")
+endif(${FOO_BAR_VAR} MATCHES "BAR")
 
 # Create static and shared lib of same name.
-IF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
-  ADD_LIBRARY(CMakeTestLinkStatic STATIC TestLink.c)
-  ADD_LIBRARY(CMakeTestLinkShared SHARED TestLink.c)
-  SET_TARGET_PROPERTIES(CMakeTestLinkStatic CMakeTestLinkShared
+if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
+  add_library(CMakeTestLinkStatic STATIC TestLink.c)
+  add_library(CMakeTestLinkShared SHARED TestLink.c)
+  set_target_properties(CMakeTestLinkStatic CMakeTestLinkShared
     PROPERTIES OUTPUT_NAME CMakeTestLink)
-ENDIF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
+endif(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
 
 #
 # Attach pre-build/pre-link/post-build custom-commands to the lib.
 # Each runs ${CREATE_FILE_EXE} which will create a file.
 # The 'complex' executable will then test if this file exists and remove it.
 #
-ADD_DEPENDENCIES(CMakeTestLibraryShared create_file)
-MESSAGE("complex bin dir is ${Complex_BINARY_DIR}")
-ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared PRE_BUILD
+add_dependencies(CMakeTestLibraryShared create_file)
+message("complex bin dir is ${Complex_BINARY_DIR}")
+add_custom_command(TARGET CMakeTestLibraryShared PRE_BUILD
                    COMMAND ${CREATE_FILE_EXE}
                    ARGS "${Complex_BINARY_DIR}/Library/prebuild.txt")
-ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared PRE_BUILD
+add_custom_command(TARGET CMakeTestLibraryShared PRE_BUILD
                    COMMAND ${CREATE_FILE_EXE}
                    ARGS "${Complex_BINARY_DIR}/Library/prelink.txt")
-ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared POST_BUILD
+add_custom_command(TARGET CMakeTestLibraryShared POST_BUILD
                    COMMAND ${CREATE_FILE_EXE}
                    ARGS "${Complex_BINARY_DIR}/Library/postbuild.txt")
-ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared POST_BUILD
+add_custom_command(TARGET CMakeTestLibraryShared POST_BUILD
                    COMMAND ${CMAKE_COMMAND}
                    ARGS -E copy
                         "${Complex_BINARY_DIR}/Library/postbuild.txt"
@@ -95,46 +95,46 @@ ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared POST_BUILD
 # It runs ${CREATE_FILE_EXE} which will create a file.
 # The 'complex' executable will then test if this file exists and remove it.
 #
-ADD_CUSTOM_TARGET(custom_target1
+add_custom_target(custom_target1
                   ALL
                   ${CREATE_FILE_EXE}
                   "${Complex_BINARY_DIR}/Library/custom_target1.txt")
 
-ADD_DEPENDENCIES(custom_target1 create_file)
+add_dependencies(custom_target1 create_file)
 
 #
 # Extra coverage
 #
-SET_SOURCE_FILES_PROPERTIES(file2 PROPERTIES ABSTRACT 1)
+set_source_files_properties(file2 PROPERTIES ABSTRACT 1)
 
-INSTALL_FILES(/tmp .h ${Complex_BINARY_DIR}/cmTestConfigure.h)
-INSTALL_FILES(/tmp .cxx ${Complex_BINARY_DIR}/cmTestConfigure.h)
+install_files(/tmp .h ${Complex_BINARY_DIR}/cmTestConfigure.h)
+install_files(/tmp .cxx ${Complex_BINARY_DIR}/cmTestConfigure.h)
 
 # Test creating a library that is not built by default.
-ADD_LIBRARY(notInAllLib EXCLUDE_FROM_ALL notInAllLib.cxx)
+add_library(notInAllLib EXCLUDE_FROM_ALL notInAllLib.cxx)
 
 # Create an imported target for if(TARGET) test in Executable dir.
 # That test should not see this target.
-ADD_LIBRARY(LibImportedTarget UNKNOWN IMPORTED)
+add_library(LibImportedTarget UNKNOWN IMPORTED)
 
 # Test generation of preprocessed sources.
-IF("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM)
-  IF(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE)
+if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM)
+  if(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE)
     # Skip running this part of the test on certain platforms
     # until they are fixed.
-    SET(MAYBE_ALL ALL)
-    LIST(LENGTH CMAKE_OSX_ARCHITECTURES ARCH_COUNT)
-    IF(ARCH_COUNT GREATER 1)
+    set(MAYBE_ALL ALL)
+    list(LENGTH CMAKE_OSX_ARCHITECTURES ARCH_COUNT)
+    if(ARCH_COUNT GREATER 1)
       # OSX does not support preprocessing more than one architecture.
-      SET(MAYBE_ALL)
-    ENDIF(ARCH_COUNT GREATER 1)
+      set(MAYBE_ALL)
+    endif(ARCH_COUNT GREATER 1)
 
     # Custom target to try preprocessing invocation.
-    ADD_CUSTOM_TARGET(test_preprocess ${MAYBE_ALL}
+    add_custom_target(test_preprocess ${MAYBE_ALL}
       COMMAND ${CMAKE_COMMAND} -E remove CMakeFiles/create_file.dir/create_file.i
       COMMAND ${CMAKE_MAKE_PROGRAM} create_file.i
       COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/test_preprocess.cmake
       WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
       )
-  ENDIF(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE)
-ENDIF("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM)
+  endif(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE)
+endif("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM)
diff --git a/Tests/Complex/Library/test_preprocess.cmake b/Tests/Complex/Library/test_preprocess.cmake
index d2d9fc652..885c61330 100644
--- a/Tests/Complex/Library/test_preprocess.cmake
+++ b/Tests/Complex/Library/test_preprocess.cmake
@@ -1,7 +1,7 @@
-SET(TEST_FILE CMakeFiles/create_file.dir/create_file.i)
-FILE(READ ${TEST_FILE} CONTENTS)
-IF("${CONTENTS}" MATCHES "Unable to close")
-  MESSAGE(STATUS "${TEST_FILE} created successfully!")
-ELSE("${CONTENTS}" MATCHES "Unable to close")
-  MESSAGE(FATAL_ERROR "${TEST_FILE} creation failed!")
-ENDIF("${CONTENTS}" MATCHES "Unable to close")
+set(TEST_FILE CMakeFiles/create_file.dir/create_file.i)
+file(READ ${TEST_FILE} CONTENTS)
+if("${CONTENTS}" MATCHES "Unable to close")
+  message(STATUS "${TEST_FILE} created successfully!")
+else("${CONTENTS}" MATCHES "Unable to close")
+  message(FATAL_ERROR "${TEST_FILE} creation failed!")
+endif("${CONTENTS}" MATCHES "Unable to close")
diff --git a/Tests/Complex/VarTests.cmake b/Tests/Complex/VarTests.cmake
index c146d1be0..7e968fd62 100644
--- a/Tests/Complex/VarTests.cmake
+++ b/Tests/Complex/VarTests.cmake
@@ -1,198 +1,198 @@
 #
 # Test SET
 #
-SET (ZERO_VAR 0)
-SET (ZERO_VAR2 0)
+set (ZERO_VAR 0)
+set (ZERO_VAR2 0)
 
-IF(ZERO_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED)
-ELSE(ZERO_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED)
-ENDIF(ZERO_VAR)
+if(ZERO_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED)
+else(ZERO_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED)
+endif(ZERO_VAR)
 
-SET(ONE_VAR 1)
-SET(ONE_VAR2 1)
-SET(STRING_VAR "CMake is great" CACHE STRING "test a cache variable")
+set(ONE_VAR 1)
+set(ONE_VAR2 1)
+set(STRING_VAR "CMake is great" CACHE STRING "test a cache variable")
 
 #
 # Test VARIABLE_REQUIRES
 #
-VARIABLE_REQUIRES(ONE_VAR
+variable_requires(ONE_VAR
                   ONE_VAR_IS_DEFINED ONE_VAR)
 
 #
 # Test various IF/ELSE combinations
 #
-IF(NOT ZERO_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_NOT)
-ELSE(NOT ZERO_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_NOT)
-ENDIF(NOT ZERO_VAR)
+if(NOT ZERO_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED_NOT)
+else(NOT ZERO_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_NOT)
+endif(NOT ZERO_VAR)
 
-IF(NOT ONE_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_NOT2)
-ELSE(NOT ONE_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_NOT2)
-ENDIF(NOT ONE_VAR)
+if(NOT ONE_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_NOT2)
+else(NOT ONE_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED_NOT2)
+endif(NOT ONE_VAR)
 
-IF(ONE_VAR AND ONE_VAR2)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_AND)
-ELSE(ONE_VAR AND ONE_VAR2)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_AND)
-ENDIF(ONE_VAR AND ONE_VAR2)
+if(ONE_VAR AND ONE_VAR2)
+  add_definitions(-DSHOULD_BE_DEFINED_AND)
+else(ONE_VAR AND ONE_VAR2)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_AND)
+endif(ONE_VAR AND ONE_VAR2)
 
-IF(ONE_VAR AND ZERO_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_AND2)
-ELSE(ONE_VAR AND ZERO_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_AND2)
-ENDIF(ONE_VAR AND ZERO_VAR)
+if(ONE_VAR AND ZERO_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_AND2)
+else(ONE_VAR AND ZERO_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED_AND2)
+endif(ONE_VAR AND ZERO_VAR)
 
-IF(ZERO_VAR OR ONE_VAR2)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_OR)
-ELSE(ZERO_VAR OR ONE_VAR2)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_OR)
-ENDIF(ZERO_VAR OR ONE_VAR2)
+if(ZERO_VAR OR ONE_VAR2)
+  add_definitions(-DSHOULD_BE_DEFINED_OR)
+else(ZERO_VAR OR ONE_VAR2)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_OR)
+endif(ZERO_VAR OR ONE_VAR2)
 
-IF(ZERO_VAR OR ZERO_VAR2)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_OR2)
-ELSE(ZERO_VAR OR ZERO_VAR2)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_OR2)
-ENDIF(ZERO_VAR OR ZERO_VAR2)
+if(ZERO_VAR OR ZERO_VAR2)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_OR2)
+else(ZERO_VAR OR ZERO_VAR2)
+  add_definitions(-DSHOULD_BE_DEFINED_OR2)
+endif(ZERO_VAR OR ZERO_VAR2)
 
-IF(STRING_VAR MATCHES "^CMake")
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_MATCHES)
-ELSE(STRING_VAR MATCHES "^CMake")
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_MATCHES)
-ENDIF(STRING_VAR MATCHES "^CMake")
+if(STRING_VAR MATCHES "^CMake")
+  add_definitions(-DSHOULD_BE_DEFINED_MATCHES)
+else(STRING_VAR MATCHES "^CMake")
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_MATCHES)
+endif(STRING_VAR MATCHES "^CMake")
 
-IF(STRING_VAR MATCHES "^foo")
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_MATCHES2)
-ELSE(STRING_VAR MATCHES "^foo")
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_MATCHES2)
-ENDIF(STRING_VAR MATCHES "^foo")
+if(STRING_VAR MATCHES "^foo")
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_MATCHES2)
+else(STRING_VAR MATCHES "^foo")
+  add_definitions(-DSHOULD_BE_DEFINED_MATCHES2)
+endif(STRING_VAR MATCHES "^foo")
 
-IF(COMMAND "IF")
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_COMMAND)
-ELSE(COMMAND "IF")
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_COMMAND)
-ENDIF(COMMAND "IF")
+if(COMMAND "IF")
+  add_definitions(-DSHOULD_BE_DEFINED_COMMAND)
+else(COMMAND "IF")
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_COMMAND)
+endif(COMMAND "IF")
 
-IF(COMMAND "ROQUEFORT")
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_COMMAND2)
-ELSE(COMMAND "ROQUEFORT")
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_COMMAND2)
-ENDIF(COMMAND "ROQUEFORT")
+if(COMMAND "ROQUEFORT")
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_COMMAND2)
+else(COMMAND "ROQUEFORT")
+  add_definitions(-DSHOULD_BE_DEFINED_COMMAND2)
+endif(COMMAND "ROQUEFORT")
 
-IF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EXISTS)
-ELSE(EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EXISTS)
-ENDIF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
+if (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
+  add_definitions(-DSHOULD_BE_DEFINED_EXISTS)
+else(EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_EXISTS)
+endif (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
 
-IF (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EXISTS2)
-ELSE(EXISTS ${Complex_SOURCE_DIR}/roquefort.txt)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EXISTS2)
-ENDIF (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt)
+if (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_EXISTS2)
+else(EXISTS ${Complex_SOURCE_DIR}/roquefort.txt)
+  add_definitions(-DSHOULD_BE_DEFINED_EXISTS2)
+endif (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt)
 
-IF (IS_DIRECTORY ${Complex_SOURCE_DIR})
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_IS_DIRECTORY)
-ENDIF (IS_DIRECTORY ${Complex_SOURCE_DIR})
+if (IS_DIRECTORY ${Complex_SOURCE_DIR})
+  add_definitions(-DSHOULD_BE_DEFINED_IS_DIRECTORY)
+endif (IS_DIRECTORY ${Complex_SOURCE_DIR})
 
-IF (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_IS_DIRECTORY2)
-ENDIF (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake)
+if (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake)
+  add_definitions(-DSHOULD_BE_DEFINED_IS_DIRECTORY2)
+endif (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake)
 
-SET (SNUM1_VAR "1")
-SET (SNUM2_VAR "2")
-SET (SNUM3_VAR "1")
+set (SNUM1_VAR "1")
+set (SNUM2_VAR "2")
+set (SNUM3_VAR "1")
 
 
-IF (SNUM1_VAR LESS SNUM2_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_LESS)
-ELSE (SNUM1_VAR LESS SNUM2_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_LESS)
-ENDIF (SNUM1_VAR LESS SNUM2_VAR)
+if (SNUM1_VAR LESS SNUM2_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED_LESS)
+else (SNUM1_VAR LESS SNUM2_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_LESS)
+endif (SNUM1_VAR LESS SNUM2_VAR)
 
-IF (SNUM2_VAR LESS SNUM1_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_LESS2)
-ELSE (SNUM2_VAR LESS SNUM1_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_LESS2)
-ENDIF (SNUM2_VAR LESS SNUM1_VAR)
+if (SNUM2_VAR LESS SNUM1_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_LESS2)
+else (SNUM2_VAR LESS SNUM1_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED_LESS2)
+endif (SNUM2_VAR LESS SNUM1_VAR)
 
-IF (SNUM2_VAR GREATER SNUM1_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_GREATER)
-ELSE (SNUM2_VAR GREATER SNUM1_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER)
-ENDIF (SNUM2_VAR GREATER SNUM1_VAR)
+if (SNUM2_VAR GREATER SNUM1_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED_GREATER)
+else (SNUM2_VAR GREATER SNUM1_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_GREATER)
+endif (SNUM2_VAR GREATER SNUM1_VAR)
 
-IF (SNUM2_VAR EQUAL SNUM1_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EQUAL)
-ELSE (SNUM2_VAR EQUAL SNUM1_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EQUAL)
-ENDIF (SNUM2_VAR EQUAL SNUM1_VAR)
+if (SNUM2_VAR EQUAL SNUM1_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_EQUAL)
+else (SNUM2_VAR EQUAL SNUM1_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED_EQUAL)
+endif (SNUM2_VAR EQUAL SNUM1_VAR)
 
-IF (SNUM3_VAR EQUAL SNUM1_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EQUAL)
-ELSE (SNUM3_VAR EQUAL SNUM1_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EQUAL)
-ENDIF (SNUM3_VAR EQUAL SNUM1_VAR)
+if (SNUM3_VAR EQUAL SNUM1_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED_EQUAL)
+else (SNUM3_VAR EQUAL SNUM1_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_EQUAL)
+endif (SNUM3_VAR EQUAL SNUM1_VAR)
 
-IF (SNUM1_VAR GREATER SNUM2_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER2)
-ELSE (SNUM1_VAR GREATER SNUM2_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_GREATER2)
-ENDIF (SNUM1_VAR GREATER SNUM2_VAR)
+if (SNUM1_VAR GREATER SNUM2_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_GREATER2)
+else (SNUM1_VAR GREATER SNUM2_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED_GREATER2)
+endif (SNUM1_VAR GREATER SNUM2_VAR)
 
-SET (SSTR1_VAR "abc")
-SET (SSTR2_VAR "bcd")
+set (SSTR1_VAR "abc")
+set (SSTR2_VAR "bcd")
 
-IF (SSTR1_VAR STRLESS SSTR2_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRLESS)
-ELSE (SSTR1_VAR STRLESS SSTR2_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRLESS)
-ENDIF (SSTR1_VAR STRLESS SSTR2_VAR)
+if (SSTR1_VAR STRLESS SSTR2_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED_STRLESS)
+else (SSTR1_VAR STRLESS SSTR2_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_STRLESS)
+endif (SSTR1_VAR STRLESS SSTR2_VAR)
 
-IF (SSTR2_VAR STRLESS SSTR1_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRLESS2)
-ELSE (SSTR2_VAR STRLESS SSTR1_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRLESS2)
-ENDIF (SSTR2_VAR STRLESS SSTR1_VAR)
+if (SSTR2_VAR STRLESS SSTR1_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_STRLESS2)
+else (SSTR2_VAR STRLESS SSTR1_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED_STRLESS2)
+endif (SSTR2_VAR STRLESS SSTR1_VAR)
 
-IF (SSTR2_VAR STRGREATER SSTR1_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRGREATER)
-ELSE (SSTR2_VAR STRGREATER SSTR1_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRGREATER)
-ENDIF (SSTR2_VAR STRGREATER SSTR1_VAR)
+if (SSTR2_VAR STRGREATER SSTR1_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED_STRGREATER)
+else (SSTR2_VAR STRGREATER SSTR1_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_STRGREATER)
+endif (SSTR2_VAR STRGREATER SSTR1_VAR)
 
-IF (SSTR1_VAR STRGREATER SSTR2_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRGREATER2)
-ELSE (SSTR1_VAR STRGREATER SSTR2_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRGREATER2)
-ENDIF (SSTR1_VAR STRGREATER SSTR2_VAR)
+if (SSTR1_VAR STRGREATER SSTR2_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_STRGREATER2)
+else (SSTR1_VAR STRGREATER SSTR2_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED_STRGREATER2)
+endif (SSTR1_VAR STRGREATER SSTR2_VAR)
 
 #
 # Test FOREACH
 #
-FOREACH (INDEX 1 2)
-  SET(FOREACH_VAR${INDEX} "VALUE${INDEX}")
-ENDFOREACH(INDEX)
+foreach (INDEX 1 2)
+  set(FOREACH_VAR${INDEX} "VALUE${INDEX}")
+endforeach(INDEX)
 
-SET(FOREACH_CONCAT "")
-FOREACH (INDEX a;b;c;d;e;f;g)
-  SET(FOREACH_CONCAT "${FOREACH_CONCAT}${INDEX}")
-ENDFOREACH(INDEX)
+set(FOREACH_CONCAT "")
+foreach (INDEX a;b;c;d;e;f;g)
+  set(FOREACH_CONCAT "${FOREACH_CONCAT}${INDEX}")
+endforeach(INDEX)
 
 #
 # Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations
 #
-FIND_FILE(FILENAME_VAR "VarTests.cmake" ${Complex_SOURCE_DIR})
+find_file(FILENAME_VAR "VarTests.cmake" ${Complex_SOURCE_DIR})
 
-GET_FILENAME_COMPONENT(FILENAME_VAR_PATH ${FILENAME_VAR} PATH)
-GET_FILENAME_COMPONENT(FILENAME_VAR_PATH_NAME ${FILENAME_VAR_PATH} NAME)
-GET_FILENAME_COMPONENT(FILENAME_VAR_NAME ${FILENAME_VAR} NAME)
-GET_FILENAME_COMPONENT(FILENAME_VAR_EXT ${FILENAME_VAR} EXT)
-GET_FILENAME_COMPONENT(FILENAME_VAR_NAME_WE ${FILENAME_VAR} NAME_WE CACHE)
+get_filename_component(FILENAME_VAR_PATH ${FILENAME_VAR} PATH)
+get_filename_component(FILENAME_VAR_PATH_NAME ${FILENAME_VAR_PATH} NAME)
+get_filename_component(FILENAME_VAR_NAME ${FILENAME_VAR} NAME)
+get_filename_component(FILENAME_VAR_EXT ${FILENAME_VAR} EXT)
+get_filename_component(FILENAME_VAR_NAME_WE ${FILENAME_VAR} NAME_WE CACHE)
 
-FIND_PATH(PATH_VAR "cmTestConfigure.h.in" ${Complex_SOURCE_DIR})
-GET_FILENAME_COMPONENT(PATH_VAR_NAME ${PATH_VAR} NAME)
+find_path(PATH_VAR "cmTestConfigure.h.in" ${Complex_SOURCE_DIR})
+get_filename_component(PATH_VAR_NAME ${PATH_VAR} NAME)
diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt
index 500431cf2..108093384 100644
--- a/Tests/ComplexOneConfig/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/CMakeLists.txt
@@ -1,32 +1,32 @@
 #
 # A more complex test case
 #
-SET(CMAKE_BACKWARDS_COMPATIBILITY 1.4)
-PROJECT (Complex)
+set(CMAKE_BACKWARDS_COMPATIBILITY 1.4)
+project (Complex)
 
 # Try setting a new policy.  The IF test is for coverage.
-IF(POLICY CMP0003)
-  CMAKE_POLICY(SET CMP0003 NEW)
+if(POLICY CMP0003)
+  cmake_policy(SET CMP0003 NEW)
 
-  CMAKE_POLICY(GET CMP0003 P3)
-  IF(NOT "${P3}" STREQUAL "NEW")
-    MESSAGE(FATAL_ERROR "CMAKE_POLICY(GET) did not report NEW!")
-  ENDIF(NOT "${P3}" STREQUAL "NEW")
-ENDIF(POLICY CMP0003)
+  cmake_policy(GET CMP0003 P3)
+  if(NOT "${P3}" STREQUAL "NEW")
+    message(FATAL_ERROR "cmake_policy(GET) did not report NEW!")
+  endif(NOT "${P3}" STREQUAL "NEW")
+endif(POLICY CMP0003)
 
 # Test building without per-rule echo lines in Makefiles.
-SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES OFF)
+set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
 
-SET(CPACK_SOURCE_IGNORE_FILES "~$;\\.cvsignore$;^C:/hoffman/My Builds/testcase.*/CVS/;^C:/hoffman/My Builds/testcase.*/\\.svn/;^C:/hoffman/My Builds/testcase.*/sweigart/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/eos2001/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_tables_new/;^C:/hoffman/My Builds/testcase/COPYING$;^C:/hoffman/My Builds/testcase/INSTALL$;^C:/hoffman/My Builds/testcase/Makefile$;^C:/hoffman/My Builds/testcase/Makefile\\.in$;^C:/hoffman/My Builds/testcase/.*\\.lo$;^C:/hoffman/My Builds/testcase/.*\\.la$;^C:/hoffman/My Builds/testcase/mkinstalldirs$;^C:/hoffman/My Builds/testcase/missing$;^C:/hoffman/My Builds/testcase/ltmain\\.sh$;^C:/hoffman/My Builds/testcase/libtool$;^C:/hoffman/My Builds/testcase/install-sh$;^C:/hoffman/My Builds/testcase/configure$;^C:/hoffman/My Builds/testcase/config\\.sub$;^C:/hoffman/My Builds/testcase/config\\.status$;^C:/hoffman/My Builds/testcase/config\\.log$;^C:/hoffman/My Builds/testcase/config\\.guess$;^C:/hoffman/My Builds/testcase/autom4te\\.cache$;^C:/hoffman/My Builds/testcase/aclocal\\.m4$;^C:/hoffman/My Builds/testcase/depcomp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10_corr$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_scvh$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.rgbtip\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.zahb\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.085\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.mem$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.tex\\.bak$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j16\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j26\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j36\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_JNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Jseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_KNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Kseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check34_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check35_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check36_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check43_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check44_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check45_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check46_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check47_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check48_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/Makefile$;^C:/hoffman/My Builds/testcase/www/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/.*\\.flc$;^C:/hoffman/My Builds/testcase/src/Makefile$;^C:/hoffman/My Builds/testcase/src/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/\\.deps$;^C:/hoffman/My Builds/testcase/src/\\.libs$;^C:/hoffman/My Builds/testcase/src/.*\\.la$;^C:/hoffman/My Builds/testcase/src/.*\\.lo$;^C:/hoffman/My Builds/testcase/src/make\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/statef.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_15$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_rel$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/hot_post_agb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgb_tip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/start_shellflash\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/white_dwarf\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/3order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/5order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/8order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check8_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check5_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effoo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/tc\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/include/Makefile\\.in$;^C:/hoffman/My Builds/testcase/include/Makefile$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/0\\.1\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_eos1a-eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_0\\.1\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_eos1a-eos1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/fort\\.91$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/oldversion_grid$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2005Ap&SS\\.298\\.\\.135S\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2007Ap&SS\\.307\\.\\.263C\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/astro-ph\\.9909168_eprint_submitted_to_High_Press\\.Res\\.16,331\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/statef_grid-newversion$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/old$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/make\\.out.*$;^C:/hoffman/My Builds/testcase/utils/.*\\.flc$;^C:/hoffman/My Builds/testcase/utils/Makefile$;^C:/hoffman/My Builds/testcase/utils/Makefile\\.in$;^C:/hoffman/My Builds/testcase/utils/\\.deps$;^C:/hoffman/My Builds/testcase/utils/\\.libs$;^C:/hoffman/My Builds/testcase/utils/.*\\.la$;^C:/hoffman/My Builds/testcase/utils/.*\\.lo$;^C:/hoffman/My Builds/testcase/utils/free_eos_test$;^C:/hoffman/My Builds/testcase/utils/test_rosenbrock$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check5\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check8\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_checknr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effoo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence_20070613$;^C:/hoffman/My Builds/testcase/www/eospaper/text$;^C:/hoffman/My Builds/testcase/www/eospaper/cassisi_book_fig$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.1\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/2\\.0\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.2\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.3\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.4\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.5\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.6\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/figures$;^C:/hoffman/My Builds/testcase/www/eospaper/old$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_JNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Jseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_KNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Kseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check34\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check35\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check36\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check44\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check45\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check46\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_1_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_2_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_linear_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_nr_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_series_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.1\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.3\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_linear\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_nr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.rgbtip\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.zahb\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.rgbtip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_linear$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_noexchange$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_nr$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/delta\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos1gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos2gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb_adjust/coulomb_adjust\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/rtc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/make\\.out.*$")
+set(CPACK_SOURCE_IGNORE_FILES "~$;\\.cvsignore$;^C:/hoffman/My Builds/testcase.*/CVS/;^C:/hoffman/My Builds/testcase.*/\\.svn/;^C:/hoffman/My Builds/testcase.*/sweigart/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/eos2001/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_tables_new/;^C:/hoffman/My Builds/testcase/COPYING$;^C:/hoffman/My Builds/testcase/INSTALL$;^C:/hoffman/My Builds/testcase/Makefile$;^C:/hoffman/My Builds/testcase/Makefile\\.in$;^C:/hoffman/My Builds/testcase/.*\\.lo$;^C:/hoffman/My Builds/testcase/.*\\.la$;^C:/hoffman/My Builds/testcase/mkinstalldirs$;^C:/hoffman/My Builds/testcase/missing$;^C:/hoffman/My Builds/testcase/ltmain\\.sh$;^C:/hoffman/My Builds/testcase/libtool$;^C:/hoffman/My Builds/testcase/install-sh$;^C:/hoffman/My Builds/testcase/configure$;^C:/hoffman/My Builds/testcase/config\\.sub$;^C:/hoffman/My Builds/testcase/config\\.status$;^C:/hoffman/My Builds/testcase/config\\.log$;^C:/hoffman/My Builds/testcase/config\\.guess$;^C:/hoffman/My Builds/testcase/autom4te\\.cache$;^C:/hoffman/My Builds/testcase/aclocal\\.m4$;^C:/hoffman/My Builds/testcase/depcomp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10_corr$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_scvh$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.rgbtip\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.zahb\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.085\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.mem$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.tex\\.bak$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j16\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j26\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j36\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_JNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Jseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_KNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Kseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check34_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check35_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check36_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check43_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check44_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check45_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check46_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check47_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check48_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/Makefile$;^C:/hoffman/My Builds/testcase/www/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/.*\\.flc$;^C:/hoffman/My Builds/testcase/src/Makefile$;^C:/hoffman/My Builds/testcase/src/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/\\.deps$;^C:/hoffman/My Builds/testcase/src/\\.libs$;^C:/hoffman/My Builds/testcase/src/.*\\.la$;^C:/hoffman/My Builds/testcase/src/.*\\.lo$;^C:/hoffman/My Builds/testcase/src/make\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/statef.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_15$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_rel$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/hot_post_agb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgb_tip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/start_shellflash\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/white_dwarf\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/3order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/5order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/8order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check8_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check5_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effoo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/tc\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/include/Makefile\\.in$;^C:/hoffman/My Builds/testcase/include/Makefile$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/0\\.1\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_eos1a-eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_0\\.1\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_eos1a-eos1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/fort\\.91$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/oldversion_grid$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2005Ap&SS\\.298\\.\\.135S\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2007Ap&SS\\.307\\.\\.263C\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/astro-ph\\.9909168_eprint_submitted_to_High_Press\\.Res\\.16,331\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/statef_grid-newversion$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/old$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/make\\.out.*$;^C:/hoffman/My Builds/testcase/utils/.*\\.flc$;^C:/hoffman/My Builds/testcase/utils/Makefile$;^C:/hoffman/My Builds/testcase/utils/Makefile\\.in$;^C:/hoffman/My Builds/testcase/utils/\\.deps$;^C:/hoffman/My Builds/testcase/utils/\\.libs$;^C:/hoffman/My Builds/testcase/utils/.*\\.la$;^C:/hoffman/My Builds/testcase/utils/.*\\.lo$;^C:/hoffman/My Builds/testcase/utils/free_eos_test$;^C:/hoffman/My Builds/testcase/utils/test_rosenbrock$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check5\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check8\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_checknr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effoo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence_20070613$;^C:/hoffman/My Builds/testcase/www/eospaper/text$;^C:/hoffman/My Builds/testcase/www/eospaper/cassisi_book_fig$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.1\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/2\\.0\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.2\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.3\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.4\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.5\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.6\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/figures$;^C:/hoffman/My Builds/testcase/www/eospaper/old$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_JNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Jseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_KNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Kseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check34\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check35\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check36\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check44\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check45\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check46\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_1_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_2_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_linear_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_nr_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_series_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.1\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.3\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_linear\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_nr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.rgbtip\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.zahb\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.rgbtip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_linear$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_noexchange$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_nr$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/delta\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos1gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos2gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb_adjust/coulomb_adjust\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/rtc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/make\\.out.*$")
 
 #
 # Define a macro
 #
-MACRO(ASSERT value msg)
-  IF (NOT ${value})
-    MESSAGE ("Assertion failure:" ${msg} )
-  ENDIF (NOT ${value})
-ENDMACRO(ASSERT)
+macro(ASSERT value msg)
+  if (NOT ${value})
+    message ("Assertion failure:" ${msg} )
+  endif (NOT ${value})
+endmacro(ASSERT)
 
 # invoke the macro
 ASSERT(Complex_BINARY_DIR "The PROJECT command is broken")
@@ -34,79 +34,79 @@ ASSERT(Complex_BINARY_DIR "The PROJECT command is broken")
 #
 # Define a var args macro, it must take two or four args
 #
-MACRO(TEST_ARGC value1 value2)
-  ADD_DEFINITIONS(${value1} ${value2})
-  IF (${ARGC} MATCHES 4)
-    ADD_DEFINITIONS(${ARGV2} ${ARGV3})
-  ENDIF (${ARGC} MATCHES 4)
-ENDMACRO(TEST_ARGC)
+macro(TEST_ARGC value1 value2)
+  add_definitions(${value1} ${value2})
+  if (${ARGC} MATCHES 4)
+    add_definitions(${ARGV2} ${ARGV3})
+  endif (${ARGC} MATCHES 4)
+endmacro(TEST_ARGC)
 
 # invoke the macro
 TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4)
 
-MACRO(TEST_VAR_ARG fa)
-  IF("${ARGV}" MATCHES "^1;2;3$")
-    MESSAGE(STATUS "ARGV works")
-  ELSE("${ARGV}" MATCHES "^1;2;3$")
-    MESSAGE(FATAL_ERROR "ARGV does not work; got \"${ARGV}\" instead of \"1;2;3\"")
-  ENDIF("${ARGV}" MATCHES "^1;2;3$")
-  IF("${ARGN}" MATCHES "^2;3$")
-    MESSAGE(STATUS "ARGN works")
-  ELSE("${ARGN}" MATCHES "^2;3$")
-    MESSAGE(FATAL_ERROR "ARGV does not work; got \"${ARGN}\" instead of \"2;3\"")
-  ENDIF("${ARGN}" MATCHES "^2;3$")
-ENDMACRO(TEST_VAR_ARG)
+macro(TEST_VAR_ARG fa)
+  if("${ARGV}" MATCHES "^1;2;3$")
+    message(STATUS "ARGV works")
+  else("${ARGV}" MATCHES "^1;2;3$")
+    message(FATAL_ERROR "ARGV does not work; got \"${ARGV}\" instead of \"1;2;3\"")
+  endif("${ARGV}" MATCHES "^1;2;3$")
+  if("${ARGN}" MATCHES "^2;3$")
+    message(STATUS "ARGN works")
+  else("${ARGN}" MATCHES "^2;3$")
+    message(FATAL_ERROR "ARGV does not work; got \"${ARGN}\" instead of \"2;3\"")
+  endif("${ARGN}" MATCHES "^2;3$")
+endmacro(TEST_VAR_ARG)
 
 TEST_VAR_ARG(1 2 3)
 
 # Floating-point comparison test.
-IF(2.4 LESS 2.4)
-  MESSAGE(FATAL_ERROR "Failed: 2.4 LESS 2.4")
-ENDIF(2.4 LESS 2.4)
-IF(2.4 GREATER 2.4)
-  MESSAGE(FATAL_ERROR "Failed: 2.4 GREATER 2.4")
-ENDIF(2.4 GREATER 2.4)
-IF(NOT 2.4 EQUAL 2.4)
-  MESSAGE(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4")
-ENDIF(NOT 2.4 EQUAL 2.4)
+if(2.4 LESS 2.4)
+  message(FATAL_ERROR "Failed: 2.4 LESS 2.4")
+endif(2.4 LESS 2.4)
+if(2.4 GREATER 2.4)
+  message(FATAL_ERROR "Failed: 2.4 GREATER 2.4")
+endif(2.4 GREATER 2.4)
+if(NOT 2.4 EQUAL 2.4)
+  message(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4")
+endif(NOT 2.4 EQUAL 2.4)
 
-IF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
-  IF(NOT CMAKE_COMPILER_IS_GNUCXX)
-     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ")
-  ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
-ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
+if(CMAKE_SYSTEM MATCHES "OSF1-V.*")
+  if(NOT CMAKE_COMPILER_IS_GNUCXX)
+     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ")
+  endif(NOT CMAKE_COMPILER_IS_GNUCXX)
+endif(CMAKE_SYSTEM MATCHES "OSF1-V.*")
 
 
-ADD_DEFINITIONS(-DCMAKE_IS_FUN)
-ADD_DEFINITIONS(-DCMAKE_IS_REALLY_FUN)
-SET_PROPERTY(DIRECTORY
+add_definitions(-DCMAKE_IS_FUN)
+add_definitions(-DCMAKE_IS_REALLY_FUN)
+set_property(DIRECTORY
   PROPERTY COMPILE_DEFINITIONS_RELEASE
   CMAKE_IS_FUN_IN_RELEASE_MODE
   )
 
-SET(TEST_SEP "a b c")
-SEPARATE_ARGUMENTS(TEST_SEP)
+set(TEST_SEP "a b c")
+separate_arguments(TEST_SEP)
 
 
 #
 # Include vars from a file and from a cache
 #
-IF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
-  INCLUDE(${Complex_SOURCE_DIR}/VarTests.cmake)
-ENDIF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
-INCLUDE(fileshouldnotbehere OPTIONAL)
-LOAD_CACHE(${Complex_SOURCE_DIR}/Cache
+if (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
+  include(${Complex_SOURCE_DIR}/VarTests.cmake)
+endif (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
+include(fileshouldnotbehere OPTIONAL)
+load_cache(${Complex_SOURCE_DIR}/Cache
            EXCLUDE
              CACHE_TEST_VAR_EXCLUDED
            INCLUDE_INTERNALS
              CACHE_TEST_VAR_INTERNAL)
 
-LOAD_CACHE(${Complex_SOURCE_DIR}/Cache READ_WITH_PREFIX foo CACHE_TEST_VAR2)
-IF(${fooCACHE_TEST_VAR2} MATCHES bar)
-  MESSAGE("Load cache worked: ${fooCACHE_TEST_VAR2}")
-ELSE(${fooCACHE_TEST_VAR2} MATCHES bar)
-  MESSAGE(FATAL_ERROR "Load cache with prefix failed: ${fooCACHE_TEST_VAR2}")
-ENDIF(${fooCACHE_TEST_VAR2} MATCHES bar)
+load_cache(${Complex_SOURCE_DIR}/Cache READ_WITH_PREFIX foo CACHE_TEST_VAR2)
+if(${fooCACHE_TEST_VAR2} MATCHES bar)
+  message("Load cache worked: ${fooCACHE_TEST_VAR2}")
+else(${fooCACHE_TEST_VAR2} MATCHES bar)
+  message(FATAL_ERROR "Load cache with prefix failed: ${fooCACHE_TEST_VAR2}")
+endif(${fooCACHE_TEST_VAR2} MATCHES bar)
 
 
 
@@ -114,104 +114,104 @@ ENDIF(${fooCACHE_TEST_VAR2} MATCHES bar)
 # Specify include and lib dirs
 # (BEFORE is for coverage)
 #
-INCLUDE_DIRECTORIES(
+include_directories(
   Library
 )
 
-INCLUDE_DIRECTORIES(BEFORE
+include_directories(BEFORE
   ${Complex_BINARY_DIR}
 )
-INCLUDE_DIRECTORIES(SYSTEM Library/SystemDir)
+include_directories(SYSTEM Library/SystemDir)
 
-INCLUDE_REGULAR_EXPRESSION("^(cmTest|file|sharedFile|test).*$" "^cmMissing")
+include_regular_expression("^(cmTest|file|sharedFile|test).*$" "^cmMissing")
 
-LINK_DIRECTORIES(
+link_directories(
   ${Complex_BINARY_DIR}/Library
 )
 
 #
 # check for SET CACHE FORCE
 #
-SET(FORCE_TEST 1 CACHE STRING "a test")
-SET(FORCE_TEST 0 CACHE STRING "a test" FORCE)
+set(FORCE_TEST 1 CACHE STRING "a test")
+set(FORCE_TEST 0 CACHE STRING "a test" FORCE)
 
 #
 # Lib and exe path
 #
-SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib/static")
-SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib")
-SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/bin")
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib/static")
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib")
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/bin")
 
-MESSAGE (Test " " escape " " semi-colon " " \; \;)
+message (Test " " escape " " semi-colon " " \; \;)
 #
 # Exec program (TODO: test a result)
 # Increase coverage.
 #
-MESSAGE("\nIgnore this message")
-OPTION(NO_EXEC_PROGRAM "Do not test EXEC_PROGRAM" 0)
-IF (NOT NO_EXEC_PROGRAM)
-  EXEC_PROGRAM(${CMAKE_COMMAND} ARGS -E echo NO_EXEC_PROGRAM "${Complex_BINARY_DIR}")
-ELSE (NOT NO_EXEC_PROGRAM)
-  MESSAGE("Set this option ON")
-ENDIF (NOT NO_EXEC_PROGRAM)
+message("\nIgnore this message")
+option(NO_EXEC_PROGRAM "Do not test EXEC_PROGRAM" 0)
+if (NOT NO_EXEC_PROGRAM)
+  exec_program(${CMAKE_COMMAND} ARGS -E echo NO_EXEC_PROGRAM "${Complex_BINARY_DIR}")
+else (NOT NO_EXEC_PROGRAM)
+  message("Set this option ON")
+endif (NOT NO_EXEC_PROGRAM)
 
-MARK_AS_ADVANCED(NO_EXEC_PROGRAM)
-MARK_AS_ADVANCED(CLEAR NO_EXEC_PROGRAM)
+mark_as_advanced(NO_EXEC_PROGRAM)
+mark_as_advanced(CLEAR NO_EXEC_PROGRAM)
 
 # Execute a process.  Add coverage for this command.
-EXECUTE_PROCESS(
+execute_process(
   COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG"
   OUTPUT_VARIABLE TEST_OUT
   )
-IF("${TEST_OUT}" MATCHES "^ABCDEFG\n$")
-ELSE("${TEST_OUT}" MATCHES "^ABCDEFG\n$")
-  MESSAGE(SEND_ERROR "EXECUTE_PROCESS output test failed: [${TEST_OUT}]")
-ENDIF("${TEST_OUT}" MATCHES "^ABCDEFG\n$")
+if("${TEST_OUT}" MATCHES "^ABCDEFG\n$")
+else("${TEST_OUT}" MATCHES "^ABCDEFG\n$")
+  message(SEND_ERROR "EXECUTE_PROCESS output test failed: [${TEST_OUT}]")
+endif("${TEST_OUT}" MATCHES "^ABCDEFG\n$")
 
 # This test has some problems on UNIX systems.  Disabling for now.
 #
-# EXECUTE_PROCESS(
+# execute_process(
 #   COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG"
 #   COMMAND /process/does/not/exist
 #   OUTPUT_QUIET
 #   ERROR_QUIET
 #   RESULT_VARIABLE RESULT
 #   )
-# IF("${RESULT}" MATCHES "^0$")
-#   MESSAGE(SEND_ERROR
+# if("${RESULT}" MATCHES "^0$")
+#   message(SEND_ERROR
 #     "EXECUTE_PROCESS result test failed with RESULT=[${RESULT}]")
-# ELSE("${RESULT}" MATCHES "^0$")
-#   MESSAGE(STATUS "EXECUTE_PROCESS result test passed with RESULT=[${RESULT}]")
-# ENDIF("${RESULT}" MATCHES "^0$")
+# else("${RESULT}" MATCHES "^0$")
+#   message(STATUS "EXECUTE_PROCESS result test passed with RESULT=[${RESULT}]")
+# endif("${RESULT}" MATCHES "^0$")
 
 #
 # Create directory.
 # The 'complex' executable will then test if this dir exists,
 # sadly it won't be able to remove it.
 #
-MAKE_DIRECTORY("${Complex_BINARY_DIR}/make_dir")
+make_directory("${Complex_BINARY_DIR}/make_dir")
 
 #
 # Test FIND_LIBARY
 # Create a dummy empty lib
 #
-CONFIGURE_FILE(
+configure_file(
   ${Complex_SOURCE_DIR}/Library/dummy
   ${Complex_BINARY_DIR}/Library/dummylib.lib
   COPYONLY IMMEDIATE)
-FOREACH (ext ${CMAKE_SHLIB_SUFFIX};.so;.a;.sl)
-  CONFIGURE_FILE(
+foreach (ext ${CMAKE_SHLIB_SUFFIX};.so;.a;.sl)
+  configure_file(
     ${Complex_SOURCE_DIR}/Library/dummy
     ${Complex_BINARY_DIR}/Library/libdummylib${ext}
     COPYONLY IMMEDIATE)
-ENDFOREACH (ext)
+endforeach (ext)
 
-FIND_LIBRARY(FIND_DUMMY_LIB
+find_library(FIND_DUMMY_LIB
              dummylib
              PATHS
              ${Complex_BINARY_DIR}/Library DOC "find dummy lib")
 
-FIND_LIBRARY(FIND_DUMMY_LIB
+find_library(FIND_DUMMY_LIB
              NAMES dummylib dummylib2
              PATHS
              ${Complex_BINARY_DIR}/Library DOC "find dummy lib")
@@ -219,76 +219,76 @@ FIND_LIBRARY(FIND_DUMMY_LIB
 #
 # Test SET_SOURCE_FILES_PROPERTIES
 #
-SET_SOURCE_FILES_PROPERTIES(nonexisting_file2
+set_source_files_properties(nonexisting_file2
   GENERATED
   ABSTRACT
   WRAP_EXCLUDE
   COMPILE_FLAGS "-foo -bar")
 
-GET_SOURCE_FILE_PROPERTY(FILE_HAS_ABSTRACT nonexisting_file2 ABSTRACT)
-GET_SOURCE_FILE_PROPERTY(FILE_HAS_WRAP_EXCLUDE nonexisting_file2 WRAP_EXCLUDE)
-GET_SOURCE_FILE_PROPERTY(FILE_COMPILE_FLAGS nonexisting_file2 COMPILE_FLAGS)
+get_source_file_property(FILE_HAS_ABSTRACT nonexisting_file2 ABSTRACT)
+get_source_file_property(FILE_HAS_WRAP_EXCLUDE nonexisting_file2 WRAP_EXCLUDE)
+get_source_file_property(FILE_COMPILE_FLAGS nonexisting_file2 COMPILE_FLAGS)
 
-SET_SOURCE_FILES_PROPERTIES(nonexisting_file3 PROPERTIES
+set_source_files_properties(nonexisting_file3 PROPERTIES
   GENERATED 1
   ABSTRACT 1
   WRAP_EXCLUDE 1
   COMPILE_FLAGS "-foo -bar")
-GET_SOURCE_FILE_PROPERTY(FILE_HAS_ABSTRACT nonexisting_file3 ABSTRACT)
-GET_SOURCE_FILE_PROPERTY(FILE_HAS_WRAP_EXCLUDE nonexisting_file3 WRAP_EXCLUDE)
-GET_SOURCE_FILE_PROPERTY(FILE_COMPILE_FLAGS nonexisting_file3 COMPILE_FLAGS)
+get_source_file_property(FILE_HAS_ABSTRACT nonexisting_file3 ABSTRACT)
+get_source_file_property(FILE_HAS_WRAP_EXCLUDE nonexisting_file3 WRAP_EXCLUDE)
+get_source_file_property(FILE_COMPILE_FLAGS nonexisting_file3 COMPILE_FLAGS)
 
 #
 # Test registry (win32)
 # Create a file, put its path in a registry key, try to find the file in that
 # path using that registry key, then remove the file and the key
 #
-IF (WIN32)
-  IF (NOT UNIX)
-    SET(dir "${Complex_BINARY_DIR}/registry_dir")
-    SET(file "registry_test_dummy")
-    SET(hkey "HKEY_CURRENT_USER\\Software\\Kitware\\CMake\\Tests\\Complex;registry_test")
-    CONFIGURE_FILE(
+if (WIN32)
+  if (NOT UNIX)
+    set(dir "${Complex_BINARY_DIR}/registry_dir")
+    set(file "registry_test_dummy")
+    set(hkey "HKEY_CURRENT_USER\\Software\\Kitware\\CMake\\Tests\\Complex;registry_test")
+    configure_file(
       ${Complex_SOURCE_DIR}/Library/dummy
       "${dir}/${file}"
       COPYONLY IMMEDIATE)
-    EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "-E write_regv \"${hkey}\" \"${dir}\"")
-    FIND_PATH(REGISTRY_TEST_PATH
+    exec_program(${CMAKE_COMMAND} ARGS "-E write_regv \"${hkey}\" \"${dir}\"")
+    find_path(REGISTRY_TEST_PATH
       ${file}
       "[${hkey}]" DOC "Registry_Test_Path")
-    EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"")
-    EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "-E remove \"${dir}/${file}\"")
-  ENDIF (NOT UNIX)
-ENDIF (WIN32)
+    exec_program(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"")
+    exec_program(${CMAKE_COMMAND} ARGS "-E remove \"${dir}/${file}\"")
+  endif (NOT UNIX)
+endif (WIN32)
 
 #
 # Test a set and a remove
 #
-SET(REMOVE_STRING a b c d e f)
-SET(removeVar1 c e)
-REMOVE(REMOVE_STRING ${removeVar1} f)
+set(REMOVE_STRING a b c d e f)
+set(removeVar1 c e)
+remove(REMOVE_STRING ${removeVar1} f)
 
 #
 # Test an IF inside a FOREACH.
 #
-FOREACH(x "a")
-  IF(${x} MATCHES "a")
+foreach(x "a")
+  if(${x} MATCHES "a")
     # Should always execute.
-    SET(IF_INSIDE_FOREACH_THEN_EXECUTED 1)
-  ELSE(${x} MATCHES "a")
+    set(IF_INSIDE_FOREACH_THEN_EXECUTED 1)
+  else(${x} MATCHES "a")
     # Should never execute.
-    SET(IF_INSIDE_FOREACH_ELSE_EXECUTED 1)
-  ENDIF(${x} MATCHES "a")
-ENDFOREACH(x)
+    set(IF_INSIDE_FOREACH_ELSE_EXECUTED 1)
+  endif(${x} MATCHES "a")
+endforeach(x)
 
 # test WHILE command
-SET (while_var 1)
-WHILE (while_var LESS 1000)
-  SET(while_var ${while_var}0)
-ENDWHILE(while_var LESS 1000)
+set (while_var 1)
+while (while_var LESS 1000)
+  set(while_var ${while_var}0)
+endwhile(while_var LESS 1000)
 
-SET(SHOULD_BE_ZERO )
-SET(SHOULD_BE_ONE 1)
+set(SHOULD_BE_ZERO )
+set(SHOULD_BE_ONE 1)
 
 # test elseif functionality, the mess below tries to catch problem
 # of clauses being executed early or late etc
@@ -337,40 +337,40 @@ endif()
 # Configure file
 # (plug vars to #define so that they can be tested)
 #
-CONFIGURE_FILE(
+configure_file(
   ${Complex_SOURCE_DIR}/cmTestConfigure.h.in
   ${Complex_BINARY_DIR}/cmTestConfigure.h)
 
-SET(STRING_WITH_QUOTES "\"hello world\"")
+set(STRING_WITH_QUOTES "\"hello world\"")
 # test CONFIGURE_FILE with ESCAPE_QUOTES on
-CONFIGURE_FILE(
+configure_file(
   ${Complex_SOURCE_DIR}/cmTestConfigureEscape.h.in
   ${Complex_BINARY_DIR}/cmTestConfigureEscape.h ESCAPE_QUOTES)
 
 # Test regular expression commands.
-STRING(REGEX MATCH "b" RESULT "abc")
-IF(NOT RESULT)
-  MESSAGE(SEND_ERROR "STRING(REGEX MATCH ... ) test failed.")
-ENDIF(NOT RESULT)
-STRING(REGEX MATCHALL "b" RESULT "abcb")
-IF(NOT RESULT)
-  MESSAGE(SEND_ERROR "STRING(REGEX MATCHALL ... ) test failed.")
-ENDIF(NOT RESULT)
-STRING(REGEX REPLACE ".([bd])." "[\\1]" RESULT "a(b)c(d)e")
-IF("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$")
-  SET(STRING_REGEX_PASSED 1)
-ENDIF("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$")
-IF(NOT STRING_REGEX_PASSED)
-  MESSAGE(SEND_ERROR
-    "STRING(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")")
-ENDIF(NOT STRING_REGEX_PASSED)
+string(REGEX MATCH "b" RESULT "abc")
+if(NOT RESULT)
+  message(SEND_ERROR "string(REGEX MATCH ... ) test failed.")
+endif(NOT RESULT)
+string(REGEX MATCHALL "b" RESULT "abcb")
+if(NOT RESULT)
+  message(SEND_ERROR "string(REGEX MATCHALL ... ) test failed.")
+endif(NOT RESULT)
+string(REGEX REPLACE ".([bd])." "[\\1]" RESULT "a(b)c(d)e")
+if("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$")
+  set(STRING_REGEX_PASSED 1)
+endif("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$")
+if(NOT STRING_REGEX_PASSED)
+  message(SEND_ERROR
+    "string(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")")
+endif(NOT STRING_REGEX_PASSED)
 
 
 #
 # Create the libs and the main exe
 #
-ADD_SUBDIRECTORY(Library)
-ADD_SUBDIRECTORY(Executable)
-SUBDIR_DEPENDS(Executable Library)
-EXPORT_LIBRARY_DEPENDENCIES(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake)
-INCLUDE(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake OPTIONAL)
+add_subdirectory(Library)
+add_subdirectory(Executable)
+subdir_depends(Executable Library)
+export_library_dependencies(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake)
+include(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake OPTIONAL)
diff --git a/Tests/ComplexOneConfig/Executable/CMakeLists.txt b/Tests/ComplexOneConfig/Executable/CMakeLists.txt
index 6ccdaf026..413883551 100644
--- a/Tests/ComplexOneConfig/Executable/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/Executable/CMakeLists.txt
@@ -1,116 +1,116 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 1.3)
+cmake_minimum_required(VERSION 1.3)
 #
 # Create exe.
 #
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS")
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS")
 
 # Create an imported target for if(TARGET) test below.
-ADD_LIBRARY(ExeImportedTarget UNKNOWN IMPORTED)
+add_library(ExeImportedTarget UNKNOWN IMPORTED)
 
 # Test if(TARGET) command.
-IF(NOT TARGET CMakeTestLibrary)
-  MESSAGE(FATAL_ERROR "IF(NOT TARGET CMakeTestLibrary) returned true!")
-ENDIF(NOT TARGET CMakeTestLibrary)
-IF(NOT TARGET ExeImportedTarget)
-  MESSAGE(FATAL_ERROR "IF(NOT TARGET ExeImportedTarget) returned true!")
-ENDIF(NOT TARGET ExeImportedTarget)
-IF(TARGET LibImportedTarget)
-  MESSAGE(FATAL_ERROR "IF(TARGET LibImportedTarget) returned true!")
-ENDIF(TARGET LibImportedTarget)
-IF(TARGET NotATarget)
-  MESSAGE(FATAL_ERROR "IF(TARGET NotATarget) returned true!")
-ENDIF(TARGET NotATarget)
+if(NOT TARGET CMakeTestLibrary)
+  message(FATAL_ERROR "if(NOT TARGET CMakeTestLibrary) returned true!")
+endif(NOT TARGET CMakeTestLibrary)
+if(NOT TARGET ExeImportedTarget)
+  message(FATAL_ERROR "if(NOT TARGET ExeImportedTarget) returned true!")
+endif(NOT TARGET ExeImportedTarget)
+if(TARGET LibImportedTarget)
+  message(FATAL_ERROR "if(TARGET LibImportedTarget) returned true!")
+endif(TARGET LibImportedTarget)
+if(TARGET NotATarget)
+  message(FATAL_ERROR "if(TARGET NotATarget) returned true!")
+endif(TARGET NotATarget)
 
   # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to
-SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared)
-LINK_LIBRARIES(${COMPLEX_LIBS})
+set(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared)
+link_libraries(${COMPLEX_LIBS})
 
 # Test forcing a .cxx file to not build.
-SET_SOURCE_FILES_PROPERTIES(complex_nobuild.cxx PROPERTIES
+set_source_files_properties(complex_nobuild.cxx PROPERTIES
   HEADER_FILE_ONLY 1)
 
 # Test forcing a .c file to not build.
 # This makes sure a mixed language library is created
 # with header file only sources
-SET_SOURCE_FILES_PROPERTIES(complex_nobuild.c PROPERTIES
+set_source_files_properties(complex_nobuild.c PROPERTIES
   HEADER_FILE_ONLY 1)
 
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
-ADD_EXECUTABLE(A A.cxx A.hh A.h A.txt)
-ADD_CUSTOM_COMMAND(OUTPUT Aout.h COMMAND A > Aout.h VERBATIM)
-ADD_EXECUTABLE(complex complex testcflags.c Aout.h)
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+add_executable(A A.cxx A.hh A.h A.txt)
+add_custom_command(OUTPUT Aout.h COMMAND A > Aout.h VERBATIM)
+add_executable(complex complex testcflags.c Aout.h)
 #  Sub1/NameConflictTest.c Sub2/NameConflictTest.c)
-ADD_EXECUTABLE(complex.file complex.file.cxx complex_nobuild.cxx
+add_executable(complex.file complex.file.cxx complex_nobuild.cxx
   complex_nobuild.c)
 
-IF (UNIX)
-  TARGET_LINK_LIBRARIES(complex ${CMAKE_DL_LIBS})
-ELSE(UNIX)
-  IF (NOT BORLAND)
-    IF(NOT MINGW)
-      TARGET_LINK_LIBRARIES(complex rpcrt4.lib)
-    ENDIF(NOT MINGW)
-  ENDIF(NOT BORLAND)
-ENDIF (UNIX)
+if (UNIX)
+  target_link_libraries(complex ${CMAKE_DL_LIBS})
+else(UNIX)
+  if (NOT BORLAND)
+    if(NOT MINGW)
+      target_link_libraries(complex rpcrt4.lib)
+    endif(NOT MINGW)
+  endif(NOT BORLAND)
+endif (UNIX)
 
 # Test linking to static lib when a shared lib has the same name.
-IF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
-  ADD_DEFINITIONS(-DCOMPLEX_TEST_LINK_STATIC)
-  TARGET_LINK_LIBRARIES(complex CMakeTestLinkStatic)
-ENDIF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
+if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
+  add_definitions(-DCOMPLEX_TEST_LINK_STATIC)
+  target_link_libraries(complex CMakeTestLinkStatic)
+endif(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
 
 # can we get the path to a source file
-GET_SOURCE_FILE_PROPERTY(A_LOCATION A.cxx LOCATION)
-IF ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx")
-  ADD_DEFINITIONS(-DCMAKE_FOUND_ACXX)
-ENDIF ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx")
+get_source_file_property(A_LOCATION A.cxx LOCATION)
+if ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx")
+  add_definitions(-DCMAKE_FOUND_ACXX)
+endif ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx")
 
 # get the directory parent
-GET_DIRECTORY_PROPERTY(P_VALUE PARENT_DIRECTORY)
-IF ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}")
-  ADD_DEFINITIONS(-DCMAKE_FOUND_PARENT)
-ENDIF ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}")
+get_directory_property(P_VALUE PARENT_DIRECTORY)
+if ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}")
+  add_definitions(-DCMAKE_FOUND_PARENT)
+endif ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}")
 
 # get the stack of listfiles
-INCLUDE(Included.cmake)
-IF ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake")
-  ADD_DEFINITIONS(-DCMAKE_FOUND_LISTFILE_STACK)
-ENDIF ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake")
+include(Included.cmake)
+if ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake")
+  add_definitions(-DCMAKE_FOUND_LISTFILE_STACK)
+endif ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake")
 
 # Test add/remove definitions.
-ADD_DEFINITIONS(
+add_definitions(
   -DCOMPLEX_DEFINED_PRE
   -DCOMPLEX_DEFINED
   -DCOMPLEX_DEFINED_POST
   -DCOMPLEX_DEFINED
   )
-REMOVE_DEFINITIONS(-DCOMPLEX_DEFINED)
+remove_definitions(-DCOMPLEX_DEFINED)
 
 # Test pre-build/pre-link/post-build rules for an executable.
-ADD_CUSTOM_COMMAND(TARGET complex PRE_BUILD
+add_custom_command(TARGET complex PRE_BUILD
                    COMMAND ${CREATE_FILE_EXE}
                    ARGS "${Complex_BINARY_DIR}/Executable/prebuild.txt")
-ADD_CUSTOM_COMMAND(TARGET complex PRE_BUILD
+add_custom_command(TARGET complex PRE_BUILD
                    COMMAND ${CREATE_FILE_EXE}
                    ARGS "${Complex_BINARY_DIR}/Executable/prelink.txt")
-ADD_CUSTOM_COMMAND(TARGET complex POST_BUILD
+add_custom_command(TARGET complex POST_BUILD
                    COMMAND ${CREATE_FILE_EXE}
                    ARGS "${Complex_BINARY_DIR}/Executable/postbuild.txt")
-ADD_CUSTOM_COMMAND(TARGET complex POST_BUILD
+add_custom_command(TARGET complex POST_BUILD
                    COMMAND ${CMAKE_COMMAND}
                    ARGS -E copy
                         "${Complex_BINARY_DIR}/Executable/postbuild.txt"
                         "${Complex_BINARY_DIR}/Executable/postbuild2.txt")
 
-SET_SOURCE_FILES_PROPERTIES(complex
+set_source_files_properties(complex
   COMPILE_FLAGS
   "-DFILE_HAS_EXTRA_COMPILE_FLAGS"
   #" -DFILE_DEFINE_STRING=\\\"hello\\\""
   OBJECT_DEPENDS ${Complex_BINARY_DIR}/cmTestGeneratedHeader.h
 )
-SET_TARGET_PROPERTIES(complex PROPERTIES COMPILE_FLAGS "-DCOMPLEX_TARGET_FLAG")
-ADD_CUSTOM_COMMAND(
+set_target_properties(complex PROPERTIES COMPILE_FLAGS "-DCOMPLEX_TARGET_FLAG")
+add_custom_command(
   TARGET complex
   SOURCE ${Complex_SOURCE_DIR}/cmTestGeneratedHeader.h.in
   COMMAND ${CMAKE_COMMAND}
@@ -121,18 +121,18 @@ ADD_CUSTOM_COMMAND(
 )
 
 # Test creating an executable that is not built by default.
-ADD_EXECUTABLE(notInAllExe EXCLUDE_FROM_ALL notInAllExe.cxx)
-TARGET_LINK_LIBRARIES(notInAllExe notInAllLib)
+add_executable(notInAllExe EXCLUDE_FROM_ALL notInAllExe.cxx)
+target_link_libraries(notInAllExe notInAllLib)
 
 # Test user-value flag mapping for the VS IDE.
-IF(MSVC)
-  SET_TARGET_PROPERTIES(notInAllExe PROPERTIES
+if(MSVC)
+  set_target_properties(notInAllExe PROPERTIES
     LINK_FLAGS "/NODEFAULTLIB:LIBC;LIBCMT;MSVCRT")
-ENDIF(MSVC)
+endif(MSVC)
 
 # Test creating a custom target that builds not-in-all targets.
-ADD_CUSTOM_TARGET(notInAllCustom)
-ADD_DEPENDENCIES(notInAllCustom notInAllExe)
+add_custom_target(notInAllCustom)
+add_dependencies(notInAllCustom notInAllExe)
 
 #
 # Output the files required by 'complex' to a file.
@@ -141,30 +141,30 @@ ADD_DEPENDENCIES(notInAllCustom notInAllExe)
 # has no side-effects on the current Makefile (duplicated source file
 # due to source list expansion done twice).
 #
-ADD_SUBDIRECTORY(Temp)
+add_subdirectory(Temp)
 
-IF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
-  ADD_EXECUTABLE(testSystemDir testSystemDir.cxx)
-  SET_TARGET_PROPERTIES(testSystemDir PROPERTIES COMPILE_FLAGS "-Werror")
-ENDIF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
+if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
+  add_executable(testSystemDir testSystemDir.cxx)
+  set_target_properties(testSystemDir PROPERTIES COMPILE_FLAGS "-Werror")
+endif(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
 
 #
 # Extra coverage.Not used.
 #
-INSTALL_TARGETS(/tmp complex)
-INSTALL_PROGRAMS(/tmp complex)
+install_targets(/tmp complex)
+install_programs(/tmp complex)
 
-CONFIGURE_FILE(
+configure_file(
   ${Complex_SOURCE_DIR}/Executable/cmVersion.h.in
   ${Complex_BINARY_DIR}/cmVersion.h)
 
-SOURCE_GROUP(A_GROUP ".cxx")
-SOURCE_GROUP(B_GROUP REGULAR_EXPRESSION "cxx")
-SOURCE_GROUP(C_GROUP FILES complex.cxx)
+source_group(A_GROUP ".cxx")
+source_group(B_GROUP REGULAR_EXPRESSION "cxx")
+source_group(C_GROUP FILES complex.cxx)
 
-FILE(WRITE ${Complex_BINARY_DIR}/A/libA.a "test")
-FILE(WRITE ${Complex_BINARY_DIR}/A/libC.a "test")
-FILE(WRITE ${Complex_BINARY_DIR}/B/libB.a "test")
-FILE(WRITE ${Complex_BINARY_DIR}/B/libA.a "test")
-FILE(WRITE ${Complex_BINARY_DIR}/C/libC.a "test")
-FILE(WRITE ${Complex_BINARY_DIR}/C/libB.a "test")
+file(WRITE ${Complex_BINARY_DIR}/A/libA.a "test")
+file(WRITE ${Complex_BINARY_DIR}/A/libC.a "test")
+file(WRITE ${Complex_BINARY_DIR}/B/libB.a "test")
+file(WRITE ${Complex_BINARY_DIR}/B/libA.a "test")
+file(WRITE ${Complex_BINARY_DIR}/C/libC.a "test")
+file(WRITE ${Complex_BINARY_DIR}/C/libB.a "test")
diff --git a/Tests/ComplexOneConfig/Executable/Included.cmake b/Tests/ComplexOneConfig/Executable/Included.cmake
index 2d1ea3e8c..520a68be1 100644
--- a/Tests/ComplexOneConfig/Executable/Included.cmake
+++ b/Tests/ComplexOneConfig/Executable/Included.cmake
@@ -1,2 +1,2 @@
-GET_DIRECTORY_PROPERTY(LF_VALUE LISTFILE_STACK)
+get_directory_property(LF_VALUE LISTFILE_STACK)
 
diff --git a/Tests/ComplexOneConfig/Executable/Temp/CMakeLists.txt b/Tests/ComplexOneConfig/Executable/Temp/CMakeLists.txt
index 989765e3a..041fcff20 100644
--- a/Tests/ComplexOneConfig/Executable/Temp/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/Executable/Temp/CMakeLists.txt
@@ -3,6 +3,6 @@
 # The 'complex' executable will then test if this file exists and remove it.
 # The contents of this file is not tested (absolute paths).
 #
-OUTPUT_REQUIRED_FILES(
+output_required_files(
    ${Complex_SOURCE_DIR}/Executable/complex.cxx
    ${Complex_BINARY_DIR}/Executable/Temp/complex-required.txt)
diff --git a/Tests/ComplexOneConfig/Library/CMakeLists.txt b/Tests/ComplexOneConfig/Library/CMakeLists.txt
index becf67207..41faeba4d 100644
--- a/Tests/ComplexOneConfig/Library/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/Library/CMakeLists.txt
@@ -1,90 +1,90 @@
-REMOVE_DEFINITIONS(-DCMAKE_IS_REALLY_FUN)
+remove_definitions(-DCMAKE_IS_REALLY_FUN)
 
 #
 # Small utility used to create file
 # UTILITY_SOURCE is used for coverage and for getting the exact name
 # of the executable.
 #
-UTILITY_SOURCE(CREATE_FILE_EXE create_file "." create_file.cxx)
-ADD_EXECUTABLE(create_file create_file.cxx)
-SET_TARGET_PROPERTIES(create_file PROPERTIES RUNTIME_OUTPUT_DIRECTORY ".")
+utility_source(CREATE_FILE_EXE create_file "." create_file.cxx)
+add_executable(create_file create_file.cxx)
+set_target_properties(create_file PROPERTIES RUNTIME_OUTPUT_DIRECTORY ".")
 
 #
 # Create static library
 # SOURCE_FILES_REMOVE is used for Coverage. empty.h is included for coverage
 #
-AUX_SOURCE_DIRECTORY(ExtraSources LibrarySources)
-SET(LibrarySources ${LibrarySources}
+aux_source_directory(ExtraSources LibrarySources)
+set(LibrarySources ${LibrarySources}
   file2
   empty
   create_file.cxx
   GENERATED
   nonexisting_file)
-REMOVE(LibrarySources create_file.cxx GENERATED nonexisting_file)
-ADD_LIBRARY(CMakeTestLibrary ${LibrarySources})
+remove(LibrarySources create_file.cxx GENERATED nonexisting_file)
+add_library(CMakeTestLibrary ${LibrarySources})
 
-IF(WIN32)
-  IF(NOT CYGWIN)
-    IF(NOT BORLAND)
-      IF(NOT MINGW)
-        TARGET_LINK_LIBRARIES(CMakeTestLibrary
+if(WIN32)
+  if(NOT CYGWIN)
+    if(NOT BORLAND)
+      if(NOT MINGW)
+        target_link_libraries(CMakeTestLibrary
           debug
           user32.lib)
-        TARGET_LINK_LIBRARIES(CMakeTestLibrary
+        target_link_libraries(CMakeTestLibrary
           optimized
           kernel32.lib)
-      ENDIF(NOT MINGW)
-    ENDIF(NOT BORLAND)
-  ENDIF(NOT CYGWIN)
-ENDIF(WIN32)
+      endif(NOT MINGW)
+    endif(NOT BORLAND)
+  endif(NOT CYGWIN)
+endif(WIN32)
 
 #
 # Create shared library
 #
-SET(SharedLibrarySources sharedFile)
-ADD_LIBRARY(CMakeTestLibraryShared SHARED ${SharedLibrarySources})
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS")
-ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c)
-DEFINE_PROPERTY(
+set(SharedLibrarySources sharedFile)
+add_library(CMakeTestLibraryShared SHARED ${SharedLibrarySources})
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS")
+add_library(CMakeTestCLibraryShared SHARED testConly.c)
+define_property(
   TARGET PROPERTY FOO
   BRIEF_DOCS "a test property"
   FULL_DOCS "A simple etst proerty that means nothign and is used for nothing"
   )
-SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES FOO BAR)
-IF(NOT BEOS AND NOT WIN32)  # No libm on BeOS.
-  SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm")
-ENDIF(NOT BEOS AND NOT WIN32)
-GET_TARGET_PROPERTY(FOO_BAR_VAR CMakeTestCLibraryShared FOO)
-IF(${FOO_BAR_VAR} MATCHES "BAR")
-ELSE(${FOO_BAR_VAR} MATCHES "BAR")
-  MESSAGE(SEND_ERROR "SET_TARGET_PROPERTIES or GET_TARGET_PROPERTY failed, FOO_BAR_VAR should be BAR, but is ${FOO_BAR_VAR}")
-ENDIF(${FOO_BAR_VAR} MATCHES "BAR")
+set_target_properties(CMakeTestCLibraryShared PROPERTIES FOO BAR)
+if(NOT BEOS AND NOT WIN32)  # No libm on BeOS.
+  set_target_properties(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm")
+endif(NOT BEOS AND NOT WIN32)
+get_target_property(FOO_BAR_VAR CMakeTestCLibraryShared FOO)
+if(${FOO_BAR_VAR} MATCHES "BAR")
+else(${FOO_BAR_VAR} MATCHES "BAR")
+  message(SEND_ERROR "SET_TARGET_PROPERTIES or GET_TARGET_PROPERTY failed, FOO_BAR_VAR should be BAR, but is ${FOO_BAR_VAR}")
+endif(${FOO_BAR_VAR} MATCHES "BAR")
 
 # Create static and shared lib of same name.
-IF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
-  ADD_LIBRARY(CMakeTestLinkStatic STATIC TestLink.c)
-  ADD_LIBRARY(CMakeTestLinkShared SHARED TestLink.c)
-  SET_TARGET_PROPERTIES(CMakeTestLinkStatic CMakeTestLinkShared
+if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
+  add_library(CMakeTestLinkStatic STATIC TestLink.c)
+  add_library(CMakeTestLinkShared SHARED TestLink.c)
+  set_target_properties(CMakeTestLinkStatic CMakeTestLinkShared
     PROPERTIES OUTPUT_NAME CMakeTestLink)
-ENDIF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
+endif(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
 
 #
 # Attach pre-build/pre-link/post-build custom-commands to the lib.
 # Each runs ${CREATE_FILE_EXE} which will create a file.
 # The 'complex' executable will then test if this file exists and remove it.
 #
-ADD_DEPENDENCIES(CMakeTestLibraryShared create_file)
-MESSAGE("complex bin dir is ${Complex_BINARY_DIR}")
-ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared PRE_BUILD
+add_dependencies(CMakeTestLibraryShared create_file)
+message("complex bin dir is ${Complex_BINARY_DIR}")
+add_custom_command(TARGET CMakeTestLibraryShared PRE_BUILD
                    COMMAND ${CREATE_FILE_EXE}
                    ARGS "${Complex_BINARY_DIR}/Library/prebuild.txt")
-ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared PRE_BUILD
+add_custom_command(TARGET CMakeTestLibraryShared PRE_BUILD
                    COMMAND ${CREATE_FILE_EXE}
                    ARGS "${Complex_BINARY_DIR}/Library/prelink.txt")
-ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared POST_BUILD
+add_custom_command(TARGET CMakeTestLibraryShared POST_BUILD
                    COMMAND ${CREATE_FILE_EXE}
                    ARGS "${Complex_BINARY_DIR}/Library/postbuild.txt")
-ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared POST_BUILD
+add_custom_command(TARGET CMakeTestLibraryShared POST_BUILD
                    COMMAND ${CMAKE_COMMAND}
                    ARGS -E copy
                         "${Complex_BINARY_DIR}/Library/postbuild.txt"
@@ -95,46 +95,46 @@ ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared POST_BUILD
 # It runs ${CREATE_FILE_EXE} which will create a file.
 # The 'complex' executable will then test if this file exists and remove it.
 #
-ADD_CUSTOM_TARGET(custom_target1
+add_custom_target(custom_target1
                   ALL
                   ${CREATE_FILE_EXE}
                   "${Complex_BINARY_DIR}/Library/custom_target1.txt")
 
-ADD_DEPENDENCIES(custom_target1 create_file)
+add_dependencies(custom_target1 create_file)
 
 #
 # Extra coverage
 #
-SET_SOURCE_FILES_PROPERTIES(file2 PROPERTIES ABSTRACT 1)
+set_source_files_properties(file2 PROPERTIES ABSTRACT 1)
 
-INSTALL_FILES(/tmp .h ${Complex_BINARY_DIR}/cmTestConfigure.h)
-INSTALL_FILES(/tmp .cxx ${Complex_BINARY_DIR}/cmTestConfigure.h)
+install_files(/tmp .h ${Complex_BINARY_DIR}/cmTestConfigure.h)
+install_files(/tmp .cxx ${Complex_BINARY_DIR}/cmTestConfigure.h)
 
 # Test creating a library that is not built by default.
-ADD_LIBRARY(notInAllLib EXCLUDE_FROM_ALL notInAllLib.cxx)
+add_library(notInAllLib EXCLUDE_FROM_ALL notInAllLib.cxx)
 
 # Create an imported target for if(TARGET) test in Executable dir.
 # That test should not see this target.
-ADD_LIBRARY(LibImportedTarget UNKNOWN IMPORTED)
+add_library(LibImportedTarget UNKNOWN IMPORTED)
 
 # Test generation of preprocessed sources.
-IF("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM)
-  IF(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE)
+if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM)
+  if(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE)
     # Skip running this part of the test on certain platforms
     # until they are fixed.
-    SET(MAYBE_ALL ALL)
-    LIST(LENGTH CMAKE_OSX_ARCHITECTURES ARCH_COUNT)
-    IF(ARCH_COUNT GREATER 1)
+    set(MAYBE_ALL ALL)
+    list(LENGTH CMAKE_OSX_ARCHITECTURES ARCH_COUNT)
+    if(ARCH_COUNT GREATER 1)
       # OSX does not support preprocessing more than one architecture.
-      SET(MAYBE_ALL)
-    ENDIF(ARCH_COUNT GREATER 1)
+      set(MAYBE_ALL)
+    endif(ARCH_COUNT GREATER 1)
 
     # Custom target to try preprocessing invocation.
-    ADD_CUSTOM_TARGET(test_preprocess ${MAYBE_ALL}
+    add_custom_target(test_preprocess ${MAYBE_ALL}
       COMMAND ${CMAKE_COMMAND} -E remove CMakeFiles/create_file.dir/create_file.i
       COMMAND ${CMAKE_MAKE_PROGRAM} create_file.i
       COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/test_preprocess.cmake
       WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
       )
-  ENDIF(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE)
-ENDIF("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM)
+  endif(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE)
+endif("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM)
diff --git a/Tests/ComplexOneConfig/Library/test_preprocess.cmake b/Tests/ComplexOneConfig/Library/test_preprocess.cmake
index d2d9fc652..885c61330 100644
--- a/Tests/ComplexOneConfig/Library/test_preprocess.cmake
+++ b/Tests/ComplexOneConfig/Library/test_preprocess.cmake
@@ -1,7 +1,7 @@
-SET(TEST_FILE CMakeFiles/create_file.dir/create_file.i)
-FILE(READ ${TEST_FILE} CONTENTS)
-IF("${CONTENTS}" MATCHES "Unable to close")
-  MESSAGE(STATUS "${TEST_FILE} created successfully!")
-ELSE("${CONTENTS}" MATCHES "Unable to close")
-  MESSAGE(FATAL_ERROR "${TEST_FILE} creation failed!")
-ENDIF("${CONTENTS}" MATCHES "Unable to close")
+set(TEST_FILE CMakeFiles/create_file.dir/create_file.i)
+file(READ ${TEST_FILE} CONTENTS)
+if("${CONTENTS}" MATCHES "Unable to close")
+  message(STATUS "${TEST_FILE} created successfully!")
+else("${CONTENTS}" MATCHES "Unable to close")
+  message(FATAL_ERROR "${TEST_FILE} creation failed!")
+endif("${CONTENTS}" MATCHES "Unable to close")
diff --git a/Tests/ComplexOneConfig/VarTests.cmake b/Tests/ComplexOneConfig/VarTests.cmake
index c146d1be0..7e968fd62 100644
--- a/Tests/ComplexOneConfig/VarTests.cmake
+++ b/Tests/ComplexOneConfig/VarTests.cmake
@@ -1,198 +1,198 @@
 #
 # Test SET
 #
-SET (ZERO_VAR 0)
-SET (ZERO_VAR2 0)
+set (ZERO_VAR 0)
+set (ZERO_VAR2 0)
 
-IF(ZERO_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED)
-ELSE(ZERO_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED)
-ENDIF(ZERO_VAR)
+if(ZERO_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED)
+else(ZERO_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED)
+endif(ZERO_VAR)
 
-SET(ONE_VAR 1)
-SET(ONE_VAR2 1)
-SET(STRING_VAR "CMake is great" CACHE STRING "test a cache variable")
+set(ONE_VAR 1)
+set(ONE_VAR2 1)
+set(STRING_VAR "CMake is great" CACHE STRING "test a cache variable")
 
 #
 # Test VARIABLE_REQUIRES
 #
-VARIABLE_REQUIRES(ONE_VAR
+variable_requires(ONE_VAR
                   ONE_VAR_IS_DEFINED ONE_VAR)
 
 #
 # Test various IF/ELSE combinations
 #
-IF(NOT ZERO_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_NOT)
-ELSE(NOT ZERO_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_NOT)
-ENDIF(NOT ZERO_VAR)
+if(NOT ZERO_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED_NOT)
+else(NOT ZERO_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_NOT)
+endif(NOT ZERO_VAR)
 
-IF(NOT ONE_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_NOT2)
-ELSE(NOT ONE_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_NOT2)
-ENDIF(NOT ONE_VAR)
+if(NOT ONE_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_NOT2)
+else(NOT ONE_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED_NOT2)
+endif(NOT ONE_VAR)
 
-IF(ONE_VAR AND ONE_VAR2)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_AND)
-ELSE(ONE_VAR AND ONE_VAR2)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_AND)
-ENDIF(ONE_VAR AND ONE_VAR2)
+if(ONE_VAR AND ONE_VAR2)
+  add_definitions(-DSHOULD_BE_DEFINED_AND)
+else(ONE_VAR AND ONE_VAR2)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_AND)
+endif(ONE_VAR AND ONE_VAR2)
 
-IF(ONE_VAR AND ZERO_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_AND2)
-ELSE(ONE_VAR AND ZERO_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_AND2)
-ENDIF(ONE_VAR AND ZERO_VAR)
+if(ONE_VAR AND ZERO_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_AND2)
+else(ONE_VAR AND ZERO_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED_AND2)
+endif(ONE_VAR AND ZERO_VAR)
 
-IF(ZERO_VAR OR ONE_VAR2)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_OR)
-ELSE(ZERO_VAR OR ONE_VAR2)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_OR)
-ENDIF(ZERO_VAR OR ONE_VAR2)
+if(ZERO_VAR OR ONE_VAR2)
+  add_definitions(-DSHOULD_BE_DEFINED_OR)
+else(ZERO_VAR OR ONE_VAR2)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_OR)
+endif(ZERO_VAR OR ONE_VAR2)
 
-IF(ZERO_VAR OR ZERO_VAR2)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_OR2)
-ELSE(ZERO_VAR OR ZERO_VAR2)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_OR2)
-ENDIF(ZERO_VAR OR ZERO_VAR2)
+if(ZERO_VAR OR ZERO_VAR2)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_OR2)
+else(ZERO_VAR OR ZERO_VAR2)
+  add_definitions(-DSHOULD_BE_DEFINED_OR2)
+endif(ZERO_VAR OR ZERO_VAR2)
 
-IF(STRING_VAR MATCHES "^CMake")
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_MATCHES)
-ELSE(STRING_VAR MATCHES "^CMake")
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_MATCHES)
-ENDIF(STRING_VAR MATCHES "^CMake")
+if(STRING_VAR MATCHES "^CMake")
+  add_definitions(-DSHOULD_BE_DEFINED_MATCHES)
+else(STRING_VAR MATCHES "^CMake")
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_MATCHES)
+endif(STRING_VAR MATCHES "^CMake")
 
-IF(STRING_VAR MATCHES "^foo")
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_MATCHES2)
-ELSE(STRING_VAR MATCHES "^foo")
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_MATCHES2)
-ENDIF(STRING_VAR MATCHES "^foo")
+if(STRING_VAR MATCHES "^foo")
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_MATCHES2)
+else(STRING_VAR MATCHES "^foo")
+  add_definitions(-DSHOULD_BE_DEFINED_MATCHES2)
+endif(STRING_VAR MATCHES "^foo")
 
-IF(COMMAND "IF")
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_COMMAND)
-ELSE(COMMAND "IF")
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_COMMAND)
-ENDIF(COMMAND "IF")
+if(COMMAND "IF")
+  add_definitions(-DSHOULD_BE_DEFINED_COMMAND)
+else(COMMAND "IF")
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_COMMAND)
+endif(COMMAND "IF")
 
-IF(COMMAND "ROQUEFORT")
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_COMMAND2)
-ELSE(COMMAND "ROQUEFORT")
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_COMMAND2)
-ENDIF(COMMAND "ROQUEFORT")
+if(COMMAND "ROQUEFORT")
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_COMMAND2)
+else(COMMAND "ROQUEFORT")
+  add_definitions(-DSHOULD_BE_DEFINED_COMMAND2)
+endif(COMMAND "ROQUEFORT")
 
-IF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EXISTS)
-ELSE(EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EXISTS)
-ENDIF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
+if (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
+  add_definitions(-DSHOULD_BE_DEFINED_EXISTS)
+else(EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_EXISTS)
+endif (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
 
-IF (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EXISTS2)
-ELSE(EXISTS ${Complex_SOURCE_DIR}/roquefort.txt)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EXISTS2)
-ENDIF (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt)
+if (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_EXISTS2)
+else(EXISTS ${Complex_SOURCE_DIR}/roquefort.txt)
+  add_definitions(-DSHOULD_BE_DEFINED_EXISTS2)
+endif (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt)
 
-IF (IS_DIRECTORY ${Complex_SOURCE_DIR})
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_IS_DIRECTORY)
-ENDIF (IS_DIRECTORY ${Complex_SOURCE_DIR})
+if (IS_DIRECTORY ${Complex_SOURCE_DIR})
+  add_definitions(-DSHOULD_BE_DEFINED_IS_DIRECTORY)
+endif (IS_DIRECTORY ${Complex_SOURCE_DIR})
 
-IF (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_IS_DIRECTORY2)
-ENDIF (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake)
+if (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake)
+  add_definitions(-DSHOULD_BE_DEFINED_IS_DIRECTORY2)
+endif (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake)
 
-SET (SNUM1_VAR "1")
-SET (SNUM2_VAR "2")
-SET (SNUM3_VAR "1")
+set (SNUM1_VAR "1")
+set (SNUM2_VAR "2")
+set (SNUM3_VAR "1")
 
 
-IF (SNUM1_VAR LESS SNUM2_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_LESS)
-ELSE (SNUM1_VAR LESS SNUM2_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_LESS)
-ENDIF (SNUM1_VAR LESS SNUM2_VAR)
+if (SNUM1_VAR LESS SNUM2_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED_LESS)
+else (SNUM1_VAR LESS SNUM2_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_LESS)
+endif (SNUM1_VAR LESS SNUM2_VAR)
 
-IF (SNUM2_VAR LESS SNUM1_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_LESS2)
-ELSE (SNUM2_VAR LESS SNUM1_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_LESS2)
-ENDIF (SNUM2_VAR LESS SNUM1_VAR)
+if (SNUM2_VAR LESS SNUM1_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_LESS2)
+else (SNUM2_VAR LESS SNUM1_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED_LESS2)
+endif (SNUM2_VAR LESS SNUM1_VAR)
 
-IF (SNUM2_VAR GREATER SNUM1_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_GREATER)
-ELSE (SNUM2_VAR GREATER SNUM1_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER)
-ENDIF (SNUM2_VAR GREATER SNUM1_VAR)
+if (SNUM2_VAR GREATER SNUM1_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED_GREATER)
+else (SNUM2_VAR GREATER SNUM1_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_GREATER)
+endif (SNUM2_VAR GREATER SNUM1_VAR)
 
-IF (SNUM2_VAR EQUAL SNUM1_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EQUAL)
-ELSE (SNUM2_VAR EQUAL SNUM1_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EQUAL)
-ENDIF (SNUM2_VAR EQUAL SNUM1_VAR)
+if (SNUM2_VAR EQUAL SNUM1_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_EQUAL)
+else (SNUM2_VAR EQUAL SNUM1_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED_EQUAL)
+endif (SNUM2_VAR EQUAL SNUM1_VAR)
 
-IF (SNUM3_VAR EQUAL SNUM1_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EQUAL)
-ELSE (SNUM3_VAR EQUAL SNUM1_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EQUAL)
-ENDIF (SNUM3_VAR EQUAL SNUM1_VAR)
+if (SNUM3_VAR EQUAL SNUM1_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED_EQUAL)
+else (SNUM3_VAR EQUAL SNUM1_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_EQUAL)
+endif (SNUM3_VAR EQUAL SNUM1_VAR)
 
-IF (SNUM1_VAR GREATER SNUM2_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER2)
-ELSE (SNUM1_VAR GREATER SNUM2_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_GREATER2)
-ENDIF (SNUM1_VAR GREATER SNUM2_VAR)
+if (SNUM1_VAR GREATER SNUM2_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_GREATER2)
+else (SNUM1_VAR GREATER SNUM2_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED_GREATER2)
+endif (SNUM1_VAR GREATER SNUM2_VAR)
 
-SET (SSTR1_VAR "abc")
-SET (SSTR2_VAR "bcd")
+set (SSTR1_VAR "abc")
+set (SSTR2_VAR "bcd")
 
-IF (SSTR1_VAR STRLESS SSTR2_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRLESS)
-ELSE (SSTR1_VAR STRLESS SSTR2_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRLESS)
-ENDIF (SSTR1_VAR STRLESS SSTR2_VAR)
+if (SSTR1_VAR STRLESS SSTR2_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED_STRLESS)
+else (SSTR1_VAR STRLESS SSTR2_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_STRLESS)
+endif (SSTR1_VAR STRLESS SSTR2_VAR)
 
-IF (SSTR2_VAR STRLESS SSTR1_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRLESS2)
-ELSE (SSTR2_VAR STRLESS SSTR1_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRLESS2)
-ENDIF (SSTR2_VAR STRLESS SSTR1_VAR)
+if (SSTR2_VAR STRLESS SSTR1_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_STRLESS2)
+else (SSTR2_VAR STRLESS SSTR1_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED_STRLESS2)
+endif (SSTR2_VAR STRLESS SSTR1_VAR)
 
-IF (SSTR2_VAR STRGREATER SSTR1_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRGREATER)
-ELSE (SSTR2_VAR STRGREATER SSTR1_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRGREATER)
-ENDIF (SSTR2_VAR STRGREATER SSTR1_VAR)
+if (SSTR2_VAR STRGREATER SSTR1_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED_STRGREATER)
+else (SSTR2_VAR STRGREATER SSTR1_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_STRGREATER)
+endif (SSTR2_VAR STRGREATER SSTR1_VAR)
 
-IF (SSTR1_VAR STRGREATER SSTR2_VAR)
-  ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRGREATER2)
-ELSE (SSTR1_VAR STRGREATER SSTR2_VAR)
-  ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRGREATER2)
-ENDIF (SSTR1_VAR STRGREATER SSTR2_VAR)
+if (SSTR1_VAR STRGREATER SSTR2_VAR)
+  add_definitions(-DSHOULD_NOT_BE_DEFINED_STRGREATER2)
+else (SSTR1_VAR STRGREATER SSTR2_VAR)
+  add_definitions(-DSHOULD_BE_DEFINED_STRGREATER2)
+endif (SSTR1_VAR STRGREATER SSTR2_VAR)
 
 #
 # Test FOREACH
 #
-FOREACH (INDEX 1 2)
-  SET(FOREACH_VAR${INDEX} "VALUE${INDEX}")
-ENDFOREACH(INDEX)
+foreach (INDEX 1 2)
+  set(FOREACH_VAR${INDEX} "VALUE${INDEX}")
+endforeach(INDEX)
 
-SET(FOREACH_CONCAT "")
-FOREACH (INDEX a;b;c;d;e;f;g)
-  SET(FOREACH_CONCAT "${FOREACH_CONCAT}${INDEX}")
-ENDFOREACH(INDEX)
+set(FOREACH_CONCAT "")
+foreach (INDEX a;b;c;d;e;f;g)
+  set(FOREACH_CONCAT "${FOREACH_CONCAT}${INDEX}")
+endforeach(INDEX)
 
 #
 # Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations
 #
-FIND_FILE(FILENAME_VAR "VarTests.cmake" ${Complex_SOURCE_DIR})
+find_file(FILENAME_VAR "VarTests.cmake" ${Complex_SOURCE_DIR})
 
-GET_FILENAME_COMPONENT(FILENAME_VAR_PATH ${FILENAME_VAR} PATH)
-GET_FILENAME_COMPONENT(FILENAME_VAR_PATH_NAME ${FILENAME_VAR_PATH} NAME)
-GET_FILENAME_COMPONENT(FILENAME_VAR_NAME ${FILENAME_VAR} NAME)
-GET_FILENAME_COMPONENT(FILENAME_VAR_EXT ${FILENAME_VAR} EXT)
-GET_FILENAME_COMPONENT(FILENAME_VAR_NAME_WE ${FILENAME_VAR} NAME_WE CACHE)
+get_filename_component(FILENAME_VAR_PATH ${FILENAME_VAR} PATH)
+get_filename_component(FILENAME_VAR_PATH_NAME ${FILENAME_VAR_PATH} NAME)
+get_filename_component(FILENAME_VAR_NAME ${FILENAME_VAR} NAME)
+get_filename_component(FILENAME_VAR_EXT ${FILENAME_VAR} EXT)
+get_filename_component(FILENAME_VAR_NAME_WE ${FILENAME_VAR} NAME_WE CACHE)
 
-FIND_PATH(PATH_VAR "cmTestConfigure.h.in" ${Complex_SOURCE_DIR})
-GET_FILENAME_COMPONENT(PATH_VAR_NAME ${PATH_VAR} NAME)
+find_path(PATH_VAR "cmTestConfigure.h.in" ${Complex_SOURCE_DIR})
+get_filename_component(PATH_VAR_NAME ${PATH_VAR} NAME)
diff --git a/Tests/Contracts/Trilinos-10-6/Patch.cmake b/Tests/Contracts/Trilinos-10-6/Patch.cmake
index 76051eb98..6c619ac4f 100644
--- a/Tests/Contracts/Trilinos-10-6/Patch.cmake
+++ b/Tests/Contracts/Trilinos-10-6/Patch.cmake
@@ -14,8 +14,8 @@ set(text "
 # options to avoid CMake warnings about unused variables
 #
 
-MESSAGE(\"Trilinos_ALLOW_NO_PACKAGES='\${Trilinos_ALLOW_NO_PACKAGES}'\")
-MESSAGE(\"Trilinos_WARNINGS_AS_ERRORS_FLAGS='\${Trilinos_WARNINGS_AS_ERRORS_FLAGS}'\")
+message(\"Trilinos_ALLOW_NO_PACKAGES='\${Trilinos_ALLOW_NO_PACKAGES}'\")
+message(\"Trilinos_WARNINGS_AS_ERRORS_FLAGS='\${Trilinos_WARNINGS_AS_ERRORS_FLAGS}'\")
 ")
 
 file(APPEND "${source_dir}/CMakeLists.txt" "${text}")
@@ -31,8 +31,8 @@ set(text "
 # Use newer than 10.6.1 CTestConfig settings from the Trilinos project.
 # Send the Trilinos dashboards to the new Trilinos CDash server instance.
 #
-SET(CTEST_NIGHTLY_START_TIME \"04:00:00 UTC\") # 10 PM MDT or 9 PM MST
-SET(CTEST_DROP_SITE \"testing.sandia.gov\")
+set(CTEST_NIGHTLY_START_TIME \"04:00:00 UTC\") # 10 PM MDT or 9 PM MST
+set(CTEST_DROP_SITE \"testing.sandia.gov\")
 ")
 
 file(APPEND "${source_dir}/CTestConfig.cmake" "${text}")
diff --git a/Tests/Contracts/vtk542/RunTest.cmake b/Tests/Contracts/vtk542/RunTest.cmake
index 4f48e5cd2..b4bd5b087 100644
--- a/Tests/Contracts/vtk542/RunTest.cmake
+++ b/Tests/Contracts/vtk542/RunTest.cmake
@@ -1 +1 @@
-SET(vtk542_RUN_TEST VTK-build/bin/CommonCxxTests otherArrays)
+set(vtk542_RUN_TEST VTK-build/bin/CommonCxxTests otherArrays)
diff --git a/Tests/CrossCompile/CMakeLists.txt b/Tests/CrossCompile/CMakeLists.txt
index fb9a0d732..121cb815e 100644
--- a/Tests/CrossCompile/CMakeLists.txt
+++ b/Tests/CrossCompile/CMakeLists.txt
@@ -1,13 +1,13 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(CrossCompile)
+project(CrossCompile)
 
-UNSET(run_result CACHE)
+unset(run_result CACHE)
 
 #Simulate the cross compile condition
-SET(CMAKE_CROSSCOMPILING ON)
+set(CMAKE_CROSSCOMPILING ON)
 
-ADD_EXECUTABLE(CrossCompile main.c)
+add_executable(CrossCompile main.c)
 
-TRY_RUN(run_result compile_result
+try_run(run_result compile_result
     ${CrossCompile_BINARY_DIR}
     ${CrossCompile_SOURCE_DIR}/main.c)
diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt
index c1d2ae09d..58408d7fe 100644
--- a/Tests/CustomCommand/CMakeLists.txt
+++ b/Tests/CustomCommand/CMakeLists.txt
@@ -2,22 +2,22 @@
 # Wrapping
 #
 cmake_minimum_required (VERSION 2.6)
-PROJECT (CustomCommand)
+project (CustomCommand)
 
-ADD_SUBDIRECTORY(GeneratedHeader)
+add_subdirectory(GeneratedHeader)
 
 #
 # Lib and exe path
 #
-IF(NOT DEFINED bin_dir)
-  SET(bin_dir "bin")
-ENDIF()
+if(NOT DEFINED bin_dir)
+  set(bin_dir "bin")
+endif()
 
-SET (LIBRARY_OUTPUT_PATH
+set (LIBRARY_OUTPUT_PATH
   ${PROJECT_BINARY_DIR}/${bin_dir} CACHE INTERNAL
   "Single output directory for building all libraries.")
 
-SET (EXECUTABLE_OUTPUT_PATH
+set (EXECUTABLE_OUTPUT_PATH
   ${PROJECT_BINARY_DIR}/${bin_dir} CACHE INTERNAL
   "Single output directory for building all executables.")
 
@@ -27,10 +27,10 @@ SET (EXECUTABLE_OUTPUT_PATH
 #
 ################################################################
 # add the executable that will generate the file
-ADD_EXECUTABLE(generator generator.cxx)
+add_executable(generator generator.cxx)
 
-GET_TARGET_PROPERTY(generator_PATH generator LOCATION)
-MESSAGE("Location ${generator_PATH}")
+get_target_property(generator_PATH generator LOCATION)
+message("Location ${generator_PATH}")
 
 ################################################################
 #
@@ -38,9 +38,9 @@ MESSAGE("Location ${generator_PATH}")
 #
 ################################################################
 # add the executable that will generate the file
-ADD_EXECUTABLE(wrapper wrapper.cxx)
+add_executable(wrapper wrapper.cxx)
 
-ADD_CUSTOM_COMMAND(
+add_custom_command(
   OUTPUT ${PROJECT_BINARY_DIR}/wrapped.c ${PROJECT_BINARY_DIR}/wrapped_help.c
   DEPENDS wrapper
   MAIN_DEPENDENCY ${PROJECT_SOURCE_DIR}/wrapped.h
@@ -55,19 +55,19 @@ ADD_CUSTOM_COMMAND(
 #  Test creating files from a custom target
 #
 ################################################################
-ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}//doc1.dvi # test 2 slashes
+add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}//doc1.dvi # test 2 slashes
   DEPENDS ${PROJECT_SOURCE_DIR}/doc1.tex
   COMMAND   ${CMAKE_COMMAND}
   ARGS      -E copy ${PROJECT_SOURCE_DIR}/doc1.tex
   ${PROJECT_BINARY_DIR}/doc1.dvi
   )
 
-ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/doc1.h
+add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/doc1.h
   COMMAND ${CMAKE_COMMAND} -E echo " Copying doc1.dvi to doc1temp.h."
   COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/doc1.dvi
                                    ${PROJECT_BINARY_DIR}/doc1temp.h
   )
-ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/doc1.h APPEND
+add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/doc1.h APPEND
   DEPENDS ${PROJECT_BINARY_DIR}/doc1.dvi
   COMMAND ${CMAKE_COMMAND} -E echo " Copying doc1temp.h to doc1.h."
   COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/doc1temp.h
@@ -77,7 +77,7 @@ ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/doc1.h APPEND
   )
 
 # Add custom command to generate foo.h.
-ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/foo.h
+add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/foo.h
   DEPENDS ${PROJECT_SOURCE_DIR}/foo.h.in
   COMMAND ${CMAKE_COMMAND} -E echo " Copying foo.h.in to foo.h."
   COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/foo.h.in
@@ -85,12 +85,12 @@ ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/foo.h
   )
 
 # Add the location of foo.h to the include path.
-INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR})
+include_directories(${PROJECT_BINARY_DIR})
 
 # Test generation of a file to the build tree without full path.  As
 # of CMake 2.6 custom command outputs specified by relative path go in
 # the build tree.
-ADD_CUSTOM_COMMAND(
+add_custom_command(
   OUTPUT doc1.txt
   COMMAND ${CMAKE_COMMAND} -E echo "Example Document Target" > doc1.txt
   DEPENDS doc1.tex
@@ -98,7 +98,7 @@ ADD_CUSTOM_COMMAND(
   )
 
 # Add a custom target to drive generation of doc1.h.
-ADD_CUSTOM_TARGET(TDocument ALL
+add_custom_target(TDocument ALL
   COMMAND ${CMAKE_COMMAND} -E echo " Copying doc1.h to doc2.h."
   COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/doc1.h
                                    ${PROJECT_BINARY_DIR}/doc2.h
@@ -109,13 +109,13 @@ ADD_CUSTOM_TARGET(TDocument ALL
 
 # Setup a pre- and post-build pair that will fail if not run in the
 # proper order.
-ADD_CUSTOM_COMMAND(
+add_custom_command(
   TARGET TDocument PRE_BUILD
   COMMAND ${CMAKE_COMMAND} -E echo " Writing doc1pre.txt."
   COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/doc1.tex ${PROJECT_BINARY_DIR}/doc1pre.txt
   COMMENT "Running TDocument pre-build commands"
   )
-ADD_CUSTOM_COMMAND(
+add_custom_command(
   TARGET TDocument POST_BUILD
   COMMAND ${CMAKE_COMMAND} -E echo " Copying doc1pre.txt to doc2post.txt."
   COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/doc1pre.txt
@@ -128,7 +128,7 @@ ADD_CUSTOM_COMMAND(
 #  Test using a multistep generated file
 #
 ################################################################
-ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/foo.pre
+add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/foo.pre
   DEPENDS ${PROJECT_SOURCE_DIR}/foo.in
           TDocument # Ensure doc1.h generates before this target
   COMMAND   ${CMAKE_COMMAND}
@@ -136,7 +136,7 @@ ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/foo.pre
   ${PROJECT_BINARY_DIR}/foo.pre
   )
 
-ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/foo.c
+add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/foo.c
   DEPENDS   ${PROJECT_BINARY_DIR}/foo.pre
   COMMAND   ${CMAKE_COMMAND}
   ARGS      -E copy ${PROJECT_BINARY_DIR}/foo.pre
@@ -147,21 +147,21 @@ ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/foo.c
 # file that is not included by any source in this project.  This will
 # test whether all custom command outputs explicitly listed as sources
 # get generated even if they are not needed by an object file.
-ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/not_included.h
+add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/not_included.h
   DEPENDS ${PROJECT_SOURCE_DIR}/foo.h.in
   COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/foo.h.in
                                    ${PROJECT_BINARY_DIR}/not_included.h
   )
 
 # Tell the executable where to find not_included.h.
-CONFIGURE_FILE(
+configure_file(
   ${PROJECT_SOURCE_DIR}/config.h.in
   ${PROJECT_BINARY_DIR}/config.h
   @ONLY IMMEDIATE
   )
 
 # add the executable
-ADD_EXECUTABLE(CustomCommand
+add_executable(CustomCommand
   ${PROJECT_BINARY_DIR}/foo.h
   ${PROJECT_BINARY_DIR}/foo.c
   ${PROJECT_BINARY_DIR}/wrapped.c
@@ -174,44 +174,44 @@ ADD_EXECUTABLE(CustomCommand
 # Add the rule to create generated.c at build time.  This is placed
 # here to test adding the generation rule after referencing the
 # generated source in a target.
-ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/generated.c
+add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/generated.c
   DEPENDS generator
   COMMAND ${generator_PATH}
   ARGS ${PROJECT_BINARY_DIR}/generated.c
   )
 
-TARGET_LINK_LIBRARIES(CustomCommand GeneratedHeader)
+target_link_libraries(CustomCommand GeneratedHeader)
 
 ##############################################################################
 # Test for using just the target name as executable in the COMMAND
 # section. Has to be recognized and replaced by CMake with the output
 # actual location of the executable.
 # Additionally the generator is created in an extra subdir after the
-# ADD_CUSTOM_COMMAND() is used.
+# add_custom_command() is used.
 #
-# Test the same for ADD_CUSTOM_TARGET()
+# Test the same for add_custom_target()
 
-ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated_extern.cxx
+add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated_extern.cxx
   COMMAND generator_extern ${CMAKE_CURRENT_BINARY_DIR}/generated_extern.cxx
   )
 
-ADD_EXECUTABLE(CustomCommandUsingTargetTest main.cxx ${CMAKE_CURRENT_BINARY_DIR}/generated_extern.cxx )
+add_executable(CustomCommandUsingTargetTest main.cxx ${CMAKE_CURRENT_BINARY_DIR}/generated_extern.cxx )
 
-ADD_CUSTOM_TARGET(RunTarget
+add_custom_target(RunTarget
   COMMAND generator_extern ${CMAKE_CURRENT_BINARY_DIR}/run_target.cxx
   )
 
-ADD_CUSTOM_COMMAND(TARGET CustomCommandUsingTargetTest POST_BUILD
+add_custom_command(TARGET CustomCommandUsingTargetTest POST_BUILD
                    COMMAND dummy_generator ${CMAKE_CURRENT_BINARY_DIR}/generated_dummy.cxx)
 
-ADD_SUBDIRECTORY(GeneratorInExtraDir)
+add_subdirectory(GeneratorInExtraDir)
 
 ##############################################################################
 # Test shell operators in custom commands.
 
-ADD_EXECUTABLE(tcat tcat.cxx)
+add_executable(tcat tcat.cxx)
 
-ADD_CUSTOM_COMMAND(OUTPUT gen_redirect.c
+add_custom_command(OUTPUT gen_redirect.c
   DEPENDS tcat gen_redirect_in.c
   COMMAND tcat < ${CMAKE_CURRENT_SOURCE_DIR}/gen_redirect_in.c > gen_redirect.c
   COMMAND ${CMAKE_COMMAND} -E echo "#endif" >> gen_redirect.c
@@ -220,12 +220,12 @@ ADD_CUSTOM_COMMAND(OUTPUT gen_redirect.c
 
 ##############################################################################
 # Test non-trivial command line arguments in custom commands.
-SET(EXPECTED_ARGUMENTS)
-SET(CHECK_ARGS)
-IF(NOT MSVC71)
-  SET(CHECK_ARGS -DPATH=c:/posix/path)
-ENDIF()
-SET(CHECK_ARGS
+set(EXPECTED_ARGUMENTS)
+set(CHECK_ARGS)
+if(NOT MSVC71)
+  set(CHECK_ARGS -DPATH=c:/posix/path)
+endif()
+set(CHECK_ARGS
   ${CHECK_ARGS}
   c:/posix/path
   c:\\windows\\path
@@ -333,11 +333,11 @@ SET(CHECK_ARGS
   "one#pound w s"
   ~ ` ! @ \# $ % ^ & _ - + = : "\;" \" ' , . ? "(" ")" { } []
   )
-IF(NOT MINGW)
+if(NOT MINGW)
   # *  # MinGW programs on windows always expands the wildcard!
   # /  # MSys make converts a leading slash to the mingw home directory
-  LIST(APPEND CHECK_ARGS * /)
-ENDIF(NOT MINGW)
+  list(APPEND CHECK_ARGS * /)
+endif(NOT MINGW)
 
 # The windows command shell does not support a double quote by itself:
 #   double\"quote
@@ -352,25 +352,25 @@ ENDIF(NOT MINGW)
 #   | < > << >> &> 2>&1 1>&2
 # to allow custom commands to perform redirection.
 
-FOREACH(arg ${CHECK_ARGS} "")
-  SET(ARG "${arg}")
-  STRING(REGEX REPLACE "\\\\" "\\\\\\\\" ARG "${ARG}")
-  STRING(REGEX REPLACE "\"" "\\\\\"" ARG "${ARG}")
-  SET(EXPECTED_ARGUMENTS
+foreach(arg ${CHECK_ARGS} "")
+  set(ARG "${arg}")
+  string(REGEX REPLACE "\\\\" "\\\\\\\\" ARG "${ARG}")
+  string(REGEX REPLACE "\"" "\\\\\"" ARG "${ARG}")
+  set(EXPECTED_ARGUMENTS
     "${EXPECTED_ARGUMENTS}  \"${ARG}\",
 ")
-ENDFOREACH(arg)
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/check_command_line.c.in
+endforeach(arg)
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/check_command_line.c.in
                ${CMAKE_CURRENT_BINARY_DIR}/check_command_line.c
                @ONLY IMMEDIATE)
-ADD_EXECUTABLE(check_command_line
+add_executable(check_command_line
   ${CMAKE_CURRENT_BINARY_DIR}/check_command_line.c)
-SET(output_name "check_command_line")
-SET_PROPERTY(TARGET check_command_line
+set(output_name "check_command_line")
+set_property(TARGET check_command_line
   PROPERTY OUTPUT_NAME ${output_name})
-# SET_TARGET_PROPERTIES(check_command_line PROPERTIES
+# set_target_properties(check_command_line PROPERTIES
 #   COMPILE_FLAGS -DCHECK_COMMAND_LINE_VERBOSE)
-ADD_CUSTOM_COMMAND(
+add_custom_command(
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/command_line_check
   COMMAND ${CMAKE_COMMAND} -DMARK_FILE=${CMAKE_CURRENT_BINARY_DIR}/check_mark.txt
   -P ${CMAKE_CURRENT_SOURCE_DIR}/check_mark.cmake
@@ -379,9 +379,9 @@ ADD_CUSTOM_COMMAND(
   VERBATIM
   COMMENT "Checking custom command line escapes (single'quote)"
   )
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/command_line_check
+set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/command_line_check
   PROPERTIES SYMBOLIC 1)
-ADD_CUSTOM_TARGET(do_check_command_line ALL
+add_custom_target(do_check_command_line ALL
   DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/command_line_check
   COMMAND ${CMAKE_COMMAND} -E echo "Checking custom target command escapes"
   COMMAND ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/${output_name}
@@ -389,12 +389,12 @@ ADD_CUSTOM_TARGET(do_check_command_line ALL
   VERBATIM
   COMMENT "Checking custom target command line escapes ($dollar-signs$)"
   )
-ADD_DEPENDENCIES(do_check_command_line check_command_line)
+add_dependencies(do_check_command_line check_command_line)
 
-ADD_CUSTOM_TARGET(pre_check_command_line
+add_custom_target(pre_check_command_line
   COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BINARY_DIR}/check_mark.txt
   )
-ADD_DEPENDENCIES(do_check_command_line pre_check_command_line)
+add_dependencies(do_check_command_line pre_check_command_line)
 
 # <SameNameTest>
 #
@@ -405,34 +405,34 @@ ADD_DEPENDENCIES(do_check_command_line pre_check_command_line)
 # At first, this reproduces a bug reported by a customer. After fixing it,
 # having this test here makes sure it stays fixed moving forward.
 #
-ADD_CUSTOM_COMMAND(
+add_custom_command(
   OUTPUT SameName1.txt
   COMMAND ${CMAKE_COMMAND} -E touch SameName1.txt
   )
-ADD_CUSTOM_TARGET(SameName ALL
+add_custom_target(SameName ALL
   DEPENDS SameName1.txt
   )
 
-ADD_CUSTOM_COMMAND(
+add_custom_command(
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/subdir/SameName
   COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/subdir
   COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/subdir/SameName
   )
-ADD_CUSTOM_TARGET(DifferentName ALL
+add_custom_target(DifferentName ALL
   DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/subdir/SameName
   )
 #
 # </SameNameTest>
 
 # Per-config target name and generator expressions.
-ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../PerConfig PerConfig)
-ADD_CUSTOM_COMMAND(
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../PerConfig PerConfig)
+add_custom_command(
   OUTPUT perconfig.out
   COMMAND ${PerConfig_COMMAND}
   DEPENDS ${PerConfig_DEPENDS}
   VERBATIM
   )
-SET_PROPERTY(SOURCE perconfig.out PROPERTY SYMBOLIC 1)
-ADD_CUSTOM_TARGET(perconfig_target ALL
+set_property(SOURCE perconfig.out PROPERTY SYMBOLIC 1)
+add_custom_target(perconfig_target ALL
   COMMAND ${CMAKE_COMMAND} -E echo "perconfig=$<TARGET_FILE:perconfig>" "config=$<CONFIGURATION>"
   DEPENDS perconfig.out)
diff --git a/Tests/CustomCommand/GeneratedHeader/CMakeLists.txt b/Tests/CustomCommand/GeneratedHeader/CMakeLists.txt
index 2ba8e68c1..f7308e890 100644
--- a/Tests/CustomCommand/GeneratedHeader/CMakeLists.txt
+++ b/Tests/CustomCommand/GeneratedHeader/CMakeLists.txt
@@ -1,13 +1,13 @@
 # Simulate in-source build include-file behavior for out-of-source
 # builds.
-SET(CMAKE_INCLUDE_CURRENT_DIR 1)
+set(CMAKE_INCLUDE_CURRENT_DIR 1)
 
-ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated.h
+add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated.h
   COMMAND
   ${CMAKE_COMMAND} ARGS -E
   copy ${CMAKE_CURRENT_SOURCE_DIR}/generated.h.in
   ${CMAKE_CURRENT_BINARY_DIR}/generated.h
 )
 
-ADD_LIBRARY(GeneratedHeader main.cpp ${CMAKE_CURRENT_BINARY_DIR}/generated.h)
+add_library(GeneratedHeader main.cpp ${CMAKE_CURRENT_BINARY_DIR}/generated.h)
 
diff --git a/Tests/CustomCommand/GeneratorInExtraDir/CMakeLists.txt b/Tests/CustomCommand/GeneratorInExtraDir/CMakeLists.txt
index 195a47792..04506db3b 100644
--- a/Tests/CustomCommand/GeneratorInExtraDir/CMakeLists.txt
+++ b/Tests/CustomCommand/GeneratorInExtraDir/CMakeLists.txt
@@ -1,8 +1,8 @@
-ADD_DEFINITIONS(-DGENERATOR_EXTERN)
+add_definitions(-DGENERATOR_EXTERN)
 
 # add the executable which will be used for generating files
-ADD_EXECUTABLE(generator_extern ../generator.cxx)
-SET_TARGET_PROPERTIES(generator_extern PROPERTIES OUTPUT_NAME the_external_generator)
+add_executable(generator_extern ../generator.cxx)
+set_target_properties(generator_extern PROPERTIES OUTPUT_NAME the_external_generator)
 
-# add an executable which will be called from ADD_CUSTOM_COMMAND( ... POST_BUILD)
-ADD_EXECUTABLE(dummy_generator ../generator.cxx)
+# add an executable which will be called from add_custom_command( ... POST_BUILD)
+add_executable(dummy_generator ../generator.cxx)
diff --git a/Tests/CustomCommand/check_mark.cmake b/Tests/CustomCommand/check_mark.cmake
index 8b0551f83..f8638d4ac 100644
--- a/Tests/CustomCommand/check_mark.cmake
+++ b/Tests/CustomCommand/check_mark.cmake
@@ -1,5 +1,5 @@
-IF(EXISTS "${MARK_FILE}")
-  MESSAGE(FATAL_ERROR "Custom command run more than once!")
-ELSE(EXISTS "${MARK_FILE}")
-  FILE(WRITE "${MARK_FILE}" "check for running custom command twice\n")
-ENDIF(EXISTS "${MARK_FILE}")
+if(EXISTS "${MARK_FILE}")
+  message(FATAL_ERROR "Custom command run more than once!")
+else(EXISTS "${MARK_FILE}")
+  file(WRITE "${MARK_FILE}" "check for running custom command twice\n")
+endif(EXISTS "${MARK_FILE}")
diff --git a/Tests/CustomCommandWorkingDirectory/CMakeLists.txt b/Tests/CustomCommandWorkingDirectory/CMakeLists.txt
index f64706485..f917cd7f3 100644
--- a/Tests/CustomCommandWorkingDirectory/CMakeLists.txt
+++ b/Tests/CustomCommandWorkingDirectory/CMakeLists.txt
@@ -1,28 +1,28 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(TestWorkingDir)
+project(TestWorkingDir)
 
-ADD_CUSTOM_COMMAND(
+add_custom_command(
   OUTPUT "${TestWorkingDir_BINARY_DIR}/working.c"
   COMMAND "${CMAKE_COMMAND}" -E copy ./working.c.in "${TestWorkingDir_BINARY_DIR}/working.c"
   WORKING_DIRECTORY "${TestWorkingDir_SOURCE_DIR}"
   COMMENT "custom command"
 )
 
-SET_SOURCE_FILES_PROPERTIES(
+set_source_files_properties(
   "${TestWorkingDir_BINARY_DIR}/customTarget.c"
   "${TestWorkingDir_BINARY_DIR}/customTarget2.c"
   PROPERTIES GENERATED 1)
 
-ADD_EXECUTABLE(working "${TestWorkingDir_BINARY_DIR}/working.c"
+add_executable(working "${TestWorkingDir_BINARY_DIR}/working.c"
   "${TestWorkingDir_BINARY_DIR}/customTarget.c")
 
-ADD_CUSTOM_TARGET(
+add_custom_target(
   Custom ALL
   COMMAND "${CMAKE_COMMAND}" -E copy_if_different ./customTarget.c "${TestWorkingDir_BINARY_DIR}/customTarget.c"
   WORKING_DIRECTORY  "${TestWorkingDir_SOURCE_DIR}"
 )
 
-ADD_DEPENDENCIES(working Custom)
+add_dependencies(working Custom)
 
 file(MAKE_DIRECTORY ${TestWorkingDir_BINARY_DIR}/work)
 add_custom_command(
diff --git a/Tests/Dependency/1/CMakeLists.txt b/Tests/Dependency/1/CMakeLists.txt
index b50b2e9c5..a8e74e40b 100644
--- a/Tests/Dependency/1/CMakeLists.txt
+++ b/Tests/Dependency/1/CMakeLists.txt
@@ -1,3 +1,3 @@
-ADD_LIBRARY( One OneSrc.c )
+add_library( One OneSrc.c )
 # This library has no dependencies
-TARGET_LINK_LIBRARIES( One "" )
+target_link_libraries( One "" )
diff --git a/Tests/Dependency/CMakeLists.txt b/Tests/Dependency/CMakeLists.txt
index 86e128f58..ef4204803 100644
--- a/Tests/Dependency/CMakeLists.txt
+++ b/Tests/Dependency/CMakeLists.txt
@@ -1,5 +1,5 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT( Dependency )
+project( Dependency )
 
 # to test directories with only one character One was changed to 1
 # There is one executable that depends on eight libraries. The
@@ -29,25 +29,25 @@ PROJECT( Dependency )
 # Although SixB does not depend on Two, there is a dependency listed
 # in the corresponding CMakeLists.txt just because of commands used.
 
-ADD_SUBDIRECTORY(NoDepA)
-ADD_SUBDIRECTORY(NoDepB)
-ADD_SUBDIRECTORY(NoDepC)
-ADD_SUBDIRECTORY(1)
-ADD_SUBDIRECTORY(Two)
-ADD_SUBDIRECTORY(Three)
-ADD_SUBDIRECTORY(Four)
-ADD_SUBDIRECTORY(Five)
-ADD_SUBDIRECTORY(Six)
-ADD_SUBDIRECTORY(Seven)
-ADD_SUBDIRECTORY(Eight)
-ADD_SUBDIRECTORY(Exec)
-ADD_SUBDIRECTORY(Exec2)
-ADD_SUBDIRECTORY(Exec3)
-ADD_SUBDIRECTORY(Exec4)
+add_subdirectory(NoDepA)
+add_subdirectory(NoDepB)
+add_subdirectory(NoDepC)
+add_subdirectory(1)
+add_subdirectory(Two)
+add_subdirectory(Three)
+add_subdirectory(Four)
+add_subdirectory(Five)
+add_subdirectory(Six)
+add_subdirectory(Seven)
+add_subdirectory(Eight)
+add_subdirectory(Exec)
+add_subdirectory(Exec2)
+add_subdirectory(Exec3)
+add_subdirectory(Exec4)
 
 # Specific cases added to test fixes to problems found in real
 # projects.
-ADD_SUBDIRECTORY(Case1)
-ADD_SUBDIRECTORY(Case2)
-ADD_SUBDIRECTORY(Case3)
-ADD_SUBDIRECTORY(Case4)
+add_subdirectory(Case1)
+add_subdirectory(Case2)
+add_subdirectory(Case3)
+add_subdirectory(Case4)
diff --git a/Tests/Dependency/Eight/CMakeLists.txt b/Tests/Dependency/Eight/CMakeLists.txt
index 5d8e7564e..db5e2dfb5 100644
--- a/Tests/Dependency/Eight/CMakeLists.txt
+++ b/Tests/Dependency/Eight/CMakeLists.txt
@@ -1,3 +1,3 @@
-ADD_LIBRARY( Eight EightSrc.c )
-TARGET_LINK_LIBRARIES( Eight Seven )
+add_library( Eight EightSrc.c )
+target_link_libraries( Eight Seven )
 
diff --git a/Tests/Dependency/Exec/CMakeLists.txt b/Tests/Dependency/Exec/CMakeLists.txt
index 97fffe706..a9206857f 100644
--- a/Tests/Dependency/Exec/CMakeLists.txt
+++ b/Tests/Dependency/Exec/CMakeLists.txt
@@ -1,7 +1,7 @@
 # This executable directly depends on NoDepB, NoDepC, SixA and SixB. However,
 # since NoDepB and NoDepC do not have explicit dependency information,
 # and they depend on NoDepA, we have to manually specify that dependency.
-LINK_LIBRARIES( NoDepB NoDepC NoDepA SixB SixA )
+link_libraries( NoDepB NoDepC NoDepA SixB SixA )
 
-ADD_EXECUTABLE( exec ExecMain.c )
+add_executable( exec ExecMain.c )
 
diff --git a/Tests/Dependency/Exec2/CMakeLists.txt b/Tests/Dependency/Exec2/CMakeLists.txt
index 84d630ae1..04d6fe810 100644
--- a/Tests/Dependency/Exec2/CMakeLists.txt
+++ b/Tests/Dependency/Exec2/CMakeLists.txt
@@ -6,7 +6,7 @@
 # Now, we must make sure that Seven gets inserted between Five and Two, and
 # not at the end. Unfortunately, if we get it wrong, the test will only
 # fail on a platform where the link order makes a difference.
-LINK_LIBRARIES( Eight Five )
+link_libraries( Eight Five )
 
-ADD_EXECUTABLE( exec2 ExecMain.c )
+add_executable( exec2 ExecMain.c )
 
diff --git a/Tests/Dependency/Exec3/CMakeLists.txt b/Tests/Dependency/Exec3/CMakeLists.txt
index b33e732a2..605fbc9f1 100644
--- a/Tests/Dependency/Exec3/CMakeLists.txt
+++ b/Tests/Dependency/Exec3/CMakeLists.txt
@@ -1,6 +1,6 @@
 # Here, Five already has it's immediate dependency, Two satisfied. We must
 # make sure Two gets output anyway, because Eight indirectly depends on it.
-LINK_LIBRARIES( Five Two Eight Five )
+link_libraries( Five Two Eight Five )
 
-ADD_EXECUTABLE( exec3 ExecMain.c )
+add_executable( exec3 ExecMain.c )
 
diff --git a/Tests/Dependency/Exec4/CMakeLists.txt b/Tests/Dependency/Exec4/CMakeLists.txt
index 6fcb15383..94c6bf588 100644
--- a/Tests/Dependency/Exec4/CMakeLists.txt
+++ b/Tests/Dependency/Exec4/CMakeLists.txt
@@ -1,6 +1,6 @@
 # Even though Five's dependency on Two is explicitly satisfied, Two
 # must be emitted again in order to satisfy a cyclic dependency on Three.
-LINK_LIBRARIES( Five Two Five )
+link_libraries( Five Two Five )
 
-ADD_EXECUTABLE( exec4 ExecMain.c )
+add_executable( exec4 ExecMain.c )
 
diff --git a/Tests/Dependency/Five/CMakeLists.txt b/Tests/Dependency/Five/CMakeLists.txt
index 27f6a1f5b..19c1c77d3 100644
--- a/Tests/Dependency/Five/CMakeLists.txt
+++ b/Tests/Dependency/Five/CMakeLists.txt
@@ -1,3 +1,3 @@
-ADD_LIBRARY( Five FiveSrc.c )
-TARGET_LINK_LIBRARIES( Five Two )
+add_library( Five FiveSrc.c )
+target_link_libraries( Five Two )
 
diff --git a/Tests/Dependency/Four/CMakeLists.txt b/Tests/Dependency/Four/CMakeLists.txt
index df0f1624e..71c531fe9 100644
--- a/Tests/Dependency/Four/CMakeLists.txt
+++ b/Tests/Dependency/Four/CMakeLists.txt
@@ -1,6 +1,6 @@
-INCLUDE_DIRECTORIES(${Dependency_BINARY_DIR}/Two)
-ADD_LIBRARY( Four FourSrc.c )
-TARGET_LINK_LIBRARIES( Four One Two NoDepA )
+include_directories(${Dependency_BINARY_DIR}/Two)
+add_library( Four FourSrc.c )
+target_link_libraries( Four One Two NoDepA )
 
 # TwoCustom must build before Four.
-ADD_DEPENDENCIES(Four TwoCustom)
+add_dependencies(Four TwoCustom)
diff --git a/Tests/Dependency/NoDepA/CMakeLists.txt b/Tests/Dependency/NoDepA/CMakeLists.txt
index cedf185fa..543402d9d 100644
--- a/Tests/Dependency/NoDepA/CMakeLists.txt
+++ b/Tests/Dependency/NoDepA/CMakeLists.txt
@@ -1 +1 @@
-ADD_LIBRARY( NoDepA NoDepASrc.c )
+add_library( NoDepA NoDepASrc.c )
diff --git a/Tests/Dependency/NoDepB/CMakeLists.txt b/Tests/Dependency/NoDepB/CMakeLists.txt
index 0d69f6841..1c70f375c 100644
--- a/Tests/Dependency/NoDepB/CMakeLists.txt
+++ b/Tests/Dependency/NoDepB/CMakeLists.txt
@@ -1,3 +1,3 @@
-ADD_LIBRARY( NoDepB NoDepBSrc.c )
+add_library( NoDepB NoDepBSrc.c )
 # This library depends on NoDepA, but the
 # dependency is not explicitly specified.
diff --git a/Tests/Dependency/NoDepC/CMakeLists.txt b/Tests/Dependency/NoDepC/CMakeLists.txt
index 88b29ba6f..dd41cebb6 100644
--- a/Tests/Dependency/NoDepC/CMakeLists.txt
+++ b/Tests/Dependency/NoDepC/CMakeLists.txt
@@ -1,3 +1,3 @@
-ADD_LIBRARY( NoDepC NoDepCSrc.c )
+add_library( NoDepC NoDepCSrc.c )
 # This library depends on NoDepA, but the
 # dependency is not explicitly specified.
diff --git a/Tests/Dependency/Seven/CMakeLists.txt b/Tests/Dependency/Seven/CMakeLists.txt
index 51a38d8ed..7fba55cb9 100644
--- a/Tests/Dependency/Seven/CMakeLists.txt
+++ b/Tests/Dependency/Seven/CMakeLists.txt
@@ -1,3 +1,3 @@
-ADD_LIBRARY( Seven SevenSrc.c )
-TARGET_LINK_LIBRARIES( Seven Two )
+add_library( Seven SevenSrc.c )
+target_link_libraries( Seven Two )
 
diff --git a/Tests/Dependency/Six/CMakeLists.txt b/Tests/Dependency/Six/CMakeLists.txt
index d0abdd695..db12051e2 100644
--- a/Tests/Dependency/Six/CMakeLists.txt
+++ b/Tests/Dependency/Six/CMakeLists.txt
@@ -2,11 +2,11 @@
 # use an all-encompassing LINK_LIBRARIES. And sometimes they don't
 # specify them in the correct order.
 
-LINK_LIBRARIES( Two )
-LINK_LIBRARIES( Five )
+link_libraries( Two )
+link_libraries( Five )
 
-ADD_LIBRARY( SixA SixASrc.c )
+add_library( SixA SixASrc.c )
 
-ADD_LIBRARY( SixB SixBSrc.c )
-TARGET_LINK_LIBRARIES( SixB Four )
+add_library( SixB SixBSrc.c )
+target_link_libraries( SixB Four )
 
diff --git a/Tests/Dependency/Three/CMakeLists.txt b/Tests/Dependency/Three/CMakeLists.txt
index 6b20dcb81..3897f0cdd 100644
--- a/Tests/Dependency/Three/CMakeLists.txt
+++ b/Tests/Dependency/Three/CMakeLists.txt
@@ -1,3 +1,3 @@
-ADD_LIBRARY( Three ThreeSrc.c )
-TARGET_LINK_LIBRARIES( Three One Four )
+add_library( Three ThreeSrc.c )
+target_link_libraries( Three One Four )
 
diff --git a/Tests/Dependency/Two/CMakeLists.txt b/Tests/Dependency/Two/CMakeLists.txt
index 587c848f7..19a070328 100644
--- a/Tests/Dependency/Two/CMakeLists.txt
+++ b/Tests/Dependency/Two/CMakeLists.txt
@@ -1,20 +1,20 @@
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
-ADD_LIBRARY( Two TwoSrc.c )
-TARGET_LINK_LIBRARIES( Two Three )
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+add_library( Two TwoSrc.c )
+target_link_libraries( Two Three )
 
 # Setup a target to cause failure if Two does not depend on it or if
 # Two actually links to it.  This will test that a utility dependency
 # on a library target works properly.
-ADD_CUSTOM_COMMAND(
+add_custom_command(
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/two-test.h
   COMMAND ${CMAKE_COMMAND} -E copy_if_different
   ${CMAKE_CURRENT_SOURCE_DIR}/two-test.h.in
   ${CMAKE_CURRENT_BINARY_DIR}/two-test.h
   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/two-test.h.in
   )
-ADD_LIBRARY( TwoCustom TwoCustomSrc.c ${CMAKE_CURRENT_BINARY_DIR}/two-test.h)
-SET_TARGET_PROPERTIES(TwoCustom PROPERTIES EXCLUDE_FROM_ALL 1)
-TARGET_LINK_LIBRARIES(TwoCustom Three)
+add_library( TwoCustom TwoCustomSrc.c ${CMAKE_CURRENT_BINARY_DIR}/two-test.h)
+set_target_properties(TwoCustom PROPERTIES EXCLUDE_FROM_ALL 1)
+target_link_libraries(TwoCustom Three)
 
 # Add a utility dependency to make sure it works without linking.
-ADD_DEPENDENCIES(Two TwoCustom)
+add_dependencies(Two TwoCustom)
diff --git a/Tests/EnforceConfig.cmake.in b/Tests/EnforceConfig.cmake.in
index c9028a391..27ee1fdd9 100644
--- a/Tests/EnforceConfig.cmake.in
+++ b/Tests/EnforceConfig.cmake.in
@@ -1,26 +1,26 @@
 # Choose a configuration with which to drive CTest tests.
-IF(CTEST_CONFIGURATION_TYPE)
-  SET(CTestTest_CONFIG "${CTEST_CONFIGURATION_TYPE}")
-ELSE(CTEST_CONFIGURATION_TYPE)
-  SET(CTestTest_CONFIG "@CTestTest_CONFIG@")
-ENDIF(CTEST_CONFIGURATION_TYPE)
+if(CTEST_CONFIGURATION_TYPE)
+  set(CTestTest_CONFIG "${CTEST_CONFIGURATION_TYPE}")
+else(CTEST_CONFIGURATION_TYPE)
+  set(CTestTest_CONFIG "@CTestTest_CONFIG@")
+endif(CTEST_CONFIGURATION_TYPE)
 
 # Choose a configuration that was built if none is given.
-IF(NOT CTEST_CONFIGURATION_TYPE)
-  SET(CTEST_CMD "@CMAKE_CTEST_COMMAND@@CMAKE_EXECUTABLE_SUFFIX@")
-  GET_FILENAME_COMPONENT(CTEST_DIR "${CTEST_CMD}" PATH)
-  GET_FILENAME_COMPONENT(CTEST_EXE "${CTEST_CMD}" NAME)
-  FOREACH(cfg Release Debug MinSizeRel RelWithDebInfo)
-    IF(NOT CTEST_CONFIGURATION_TYPE)
-      IF(EXISTS "${CTEST_DIR}/${cfg}/${CTEST_EXE}")
-        SET(CTEST_CONFIGURATION_TYPE ${cfg})
-      ENDIF(EXISTS "${CTEST_DIR}/${cfg}/${CTEST_EXE}")
-    ENDIF(NOT CTEST_CONFIGURATION_TYPE)
-  ENDFOREACH(cfg)
-  IF(NOT CTEST_CONFIGURATION_TYPE)
-    SET(CTEST_CONFIGURATION_TYPE NoConfig)
-  ENDIF(NOT CTEST_CONFIGURATION_TYPE)
-  MESSAGE("Guessing configuration ${CTEST_CONFIGURATION_TYPE}")
-ENDIF(NOT CTEST_CONFIGURATION_TYPE)
+if(NOT CTEST_CONFIGURATION_TYPE)
+  set(CTEST_CMD "@CMAKE_CTEST_COMMAND@@CMAKE_EXECUTABLE_SUFFIX@")
+  get_filename_component(CTEST_DIR "${CTEST_CMD}" PATH)
+  get_filename_component(CTEST_EXE "${CTEST_CMD}" NAME)
+  foreach(cfg Release Debug MinSizeRel RelWithDebInfo)
+    if(NOT CTEST_CONFIGURATION_TYPE)
+      if(EXISTS "${CTEST_DIR}/${cfg}/${CTEST_EXE}")
+        set(CTEST_CONFIGURATION_TYPE ${cfg})
+      endif(EXISTS "${CTEST_DIR}/${cfg}/${CTEST_EXE}")
+    endif(NOT CTEST_CONFIGURATION_TYPE)
+  endforeach(cfg)
+  if(NOT CTEST_CONFIGURATION_TYPE)
+    set(CTEST_CONFIGURATION_TYPE NoConfig)
+  endif(NOT CTEST_CONFIGURATION_TYPE)
+  message("Guessing configuration ${CTEST_CONFIGURATION_TYPE}")
+endif(NOT CTEST_CONFIGURATION_TYPE)
 
 @TEST_HOME_ENV_CODE@
diff --git a/Tests/ExportImport/InitialCache.cmake.in b/Tests/ExportImport/InitialCache.cmake.in
index 4893f7020..98d355f8f 100644
--- a/Tests/ExportImport/InitialCache.cmake.in
+++ b/Tests/ExportImport/InitialCache.cmake.in
@@ -1,15 +1,15 @@
-SET(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@" CACHE STRING "C Compiler")
-SET(CMAKE_C_FLAGS "@CMAKE_C_FLAGS@" CACHE STRING "C Flags")
-SET(CMAKE_C_FLAGS_DEBUG "@CMAKE_C_FLAGS_DEBUG@" CACHE STRING "C Flags")
-SET(CMAKE_C_FLAGS_RELEASE "@CMAKE_C_FLAGS_RELEASE@" CACHE STRING "C Flags")
-SET(CMAKE_C_FLAGS_MINSIZEREL "@CMAKE_C_FLAGS_MINSIZEREL@" CACHE STRING "C Flags")
-SET(CMAKE_C_FLAGS_RELWITHDEBINFO "@CMAKE_C_FLAGS_RELWITHDEBINFO@" CACHE STRING "C Flags")
-SET(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@" CACHE STRING "C++ Compiler")
-SET(CMAKE_CXX_FLAGS "@CMAKE_CXX_FLAGS@" CACHE STRING "C++ Flags")
-SET(CMAKE_CXX_FLAGS_DEBUG "@CMAKE_CXX_FLAGS_DEBUG@" CACHE STRING "C++ Flags")
-SET(CMAKE_CXX_FLAGS_RELEASE "@CMAKE_CXX_FLAGS_RELEASE@" CACHE STRING "C++ Flags")
-SET(CMAKE_CXX_FLAGS_MINSIZEREL "@CMAKE_CXX_FLAGS_MINSIZEREL@" CACHE STRING "C++ Flags")
-SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@" CACHE STRING "C++ Flags")
-SET(CMAKE_INSTALL_PREFIX "@ExportImport_BINARY_DIR@/Root" CACHE STRING "Installation Prefix")
-SET(CMAKE_SKIP_RPATH ON CACHE BOOL "No RPATH")
-SET(CMAKE_GNUtoMS "@ExportImport_GNUtoMS@" CACHE BOOL "CMAKE_GNUtoMS")
+set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@" CACHE STRING "C Compiler")
+set(CMAKE_C_FLAGS "@CMAKE_C_FLAGS@" CACHE STRING "C Flags")
+set(CMAKE_C_FLAGS_DEBUG "@CMAKE_C_FLAGS_DEBUG@" CACHE STRING "C Flags")
+set(CMAKE_C_FLAGS_RELEASE "@CMAKE_C_FLAGS_RELEASE@" CACHE STRING "C Flags")
+set(CMAKE_C_FLAGS_MINSIZEREL "@CMAKE_C_FLAGS_MINSIZEREL@" CACHE STRING "C Flags")
+set(CMAKE_C_FLAGS_RELWITHDEBINFO "@CMAKE_C_FLAGS_RELWITHDEBINFO@" CACHE STRING "C Flags")
+set(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@" CACHE STRING "C++ Compiler")
+set(CMAKE_CXX_FLAGS "@CMAKE_CXX_FLAGS@" CACHE STRING "C++ Flags")
+set(CMAKE_CXX_FLAGS_DEBUG "@CMAKE_CXX_FLAGS_DEBUG@" CACHE STRING "C++ Flags")
+set(CMAKE_CXX_FLAGS_RELEASE "@CMAKE_CXX_FLAGS_RELEASE@" CACHE STRING "C++ Flags")
+set(CMAKE_CXX_FLAGS_MINSIZEREL "@CMAKE_CXX_FLAGS_MINSIZEREL@" CACHE STRING "C++ Flags")
+set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@" CACHE STRING "C++ Flags")
+set(CMAKE_INSTALL_PREFIX "@ExportImport_BINARY_DIR@/Root" CACHE STRING "Installation Prefix")
+set(CMAKE_SKIP_RPATH ON CACHE BOOL "No RPATH")
+set(CMAKE_GNUtoMS "@ExportImport_GNUtoMS@" CACHE BOOL "CMAKE_GNUtoMS")
diff --git a/Tests/ExternalOBJ/CMakeLists.txt b/Tests/ExternalOBJ/CMakeLists.txt
index 683e7997c..542bfab94 100644
--- a/Tests/ExternalOBJ/CMakeLists.txt
+++ b/Tests/ExternalOBJ/CMakeLists.txt
@@ -1,51 +1,51 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT (ExternalOBJ)
+project (ExternalOBJ)
 
-IF(APPLE)
+if(APPLE)
   # set _CMAKE_OSX_MACHINE to umame -m
-  EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE _CMAKE_OSX_MACHINE)
+  exec_program(uname ARGS -m OUTPUT_VARIABLE _CMAKE_OSX_MACHINE)
   # check for Power PC and change to ppc
-  IF("${_CMAKE_OSX_MACHINE}" MATCHES "Power")
-    SET(_CMAKE_OSX_MACHINE ppc)
-  ENDIF("${_CMAKE_OSX_MACHINE}" MATCHES "Power")
-  SET(CMAKE_OSX_ARCHITECTURES ${_CMAKE_OSX_MACHINE})
-ENDIF(APPLE)
+  if("${_CMAKE_OSX_MACHINE}" MATCHES "Power")
+    set(_CMAKE_OSX_MACHINE ppc)
+  endif("${_CMAKE_OSX_MACHINE}" MATCHES "Power")
+  set(CMAKE_OSX_ARCHITECTURES ${_CMAKE_OSX_MACHINE})
+endif(APPLE)
 
 # Build the external object file.
-TRY_COMPILE(EXTERNAL_OBJECT_BUILT
+try_compile(EXTERNAL_OBJECT_BUILT
   ${ExternalOBJ_BINARY_DIR}/Object
   ${ExternalOBJ_SOURCE_DIR}/Object
   Object
   external
   OUTPUT_VARIABLE OUTPUT
   )
-IF(EXTERNAL_OBJECT_BUILT)
-  MESSAGE(
+if(EXTERNAL_OBJECT_BUILT)
+  message(
     "Building external_object.cxx succeeded with the following output:\n"
     "[${OUTPUT}]"
     )
-ELSE(EXTERNAL_OBJECT_BUILT)
-  MESSAGE(FATAL_ERROR
+else(EXTERNAL_OBJECT_BUILT)
+  message(FATAL_ERROR
     "Building external_object.cxx failed with the following output:\n"
     "[${OUTPUT}]"
     )
-ENDIF(EXTERNAL_OBJECT_BUILT)
+endif(EXTERNAL_OBJECT_BUILT)
 
 # Find the external object file.
-SET(DIR ${ExternalOBJ_BINARY_DIR}/Object)
-FILE(GLOB_RECURSE EXTERNAL_OBJECT
+set(DIR ${ExternalOBJ_BINARY_DIR}/Object)
+file(GLOB_RECURSE EXTERNAL_OBJECT
   "${DIR}/external_object*${CMAKE_CXX_OUTPUT_EXTENSION}")
-IF(EXTERNAL_OBJECT)
-  LIST (GET EXTERNAL_OBJECT 0 EXTERNAL_OBJECT)
-  MESSAGE("Found \"${EXTERNAL_OBJECT}\".")
-ELSE(EXTERNAL_OBJECT)
-  MESSAGE(FATAL_ERROR "Could not find external object.")
-ENDIF(EXTERNAL_OBJECT)
+if(EXTERNAL_OBJECT)
+  list (GET EXTERNAL_OBJECT 0 EXTERNAL_OBJECT)
+  message("Found \"${EXTERNAL_OBJECT}\".")
+else(EXTERNAL_OBJECT)
+  message(FATAL_ERROR "Could not find external object.")
+endif(EXTERNAL_OBJECT)
 
 # Test creation of external objects by custom commands.
-SET(CUSTOM_OBJECT
+set(CUSTOM_OBJECT
   ${CMAKE_CURRENT_BINARY_DIR}/custom_object${CMAKE_C_OUTPUT_EXTENSION})
-ADD_CUSTOM_COMMAND(
+add_custom_command(
   OUTPUT ${CUSTOM_OBJECT}
   COMMAND ${CMAKE_COMMAND} -E copy ${EXTERNAL_OBJECT} ${CUSTOM_OBJECT}
   DEPENDS ${EXTERNAL_OBJECT}
@@ -53,11 +53,11 @@ ADD_CUSTOM_COMMAND(
 
 message("${EXTERNAL_OBJECT}")
 # Build an executable using the external object file.
-ADD_EXECUTABLE(ExternalOBJ executable.cxx ${CUSTOM_OBJECT})
+add_executable(ExternalOBJ executable.cxx ${CUSTOM_OBJECT})
 # A bug showed up in VS2010 where an object file that was
 # part of a custom commad output worked, but ones that were
 # not didn't work.  So, repeat the executable using the object
 # directly and not from the output of the copy.
-ADD_EXECUTABLE(ExternalOBJ2 executable.cxx ${EXTERNAL_OBJECT})
+add_executable(ExternalOBJ2 executable.cxx ${EXTERNAL_OBJECT})
 
-ADD_SUBDIRECTORY(Sub)
+add_subdirectory(Sub)
diff --git a/Tests/ExternalOBJ/Object/CMakeLists.txt b/Tests/ExternalOBJ/Object/CMakeLists.txt
index 6f1d7e3fb..b24e91b9a 100644
--- a/Tests/ExternalOBJ/Object/CMakeLists.txt
+++ b/Tests/ExternalOBJ/Object/CMakeLists.txt
@@ -1,13 +1,13 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(Object)
-IF(APPLE)
+project(Object)
+if(APPLE)
   # set _CMAKE_OSX_MACHINE to umame -m
-  EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE _CMAKE_OSX_MACHINE)
+  exec_program(uname ARGS -m OUTPUT_VARIABLE _CMAKE_OSX_MACHINE)
   # check for Power PC and change to ppc
-  IF("${_CMAKE_OSX_MACHINE}" MATCHES "Power")
-    SET(_CMAKE_OSX_MACHINE ppc)
-  ENDIF("${_CMAKE_OSX_MACHINE}" MATCHES "Power")
-  SET(CMAKE_OSX_ARCHITECTURES ${_CMAKE_OSX_MACHINE})
-ENDIF(APPLE)
+  if("${_CMAKE_OSX_MACHINE}" MATCHES "Power")
+    set(_CMAKE_OSX_MACHINE ppc)
+  endif("${_CMAKE_OSX_MACHINE}" MATCHES "Power")
+  set(CMAKE_OSX_ARCHITECTURES ${_CMAKE_OSX_MACHINE})
+endif(APPLE)
 
-ADD_EXECUTABLE(external external_object.cxx external_main.cxx)
+add_executable(external external_object.cxx external_main.cxx)
diff --git a/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake b/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake
index 321fa118e..61db4166d 100644
--- a/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake	
+++ b/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake	
@@ -1,8 +1,8 @@
-SET(PACKAGE_VERSION 1.1)
-IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1)
-  SET(PACKAGE_VERSION_COMPATIBLE 1)
-  IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1)
-    SET(PACKAGE_VERSION_EXACT 1)
-  ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1)
-ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1)
+set(PACKAGE_VERSION 1.1)
+if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1)
+  set(PACKAGE_VERSION_COMPATIBLE 1)
+  if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1)
+    set(PACKAGE_VERSION_EXACT 1)
+  endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1)
+endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1)
 
diff --git a/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake b/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake
index 4576809f5..e0042d5e6 100644
--- a/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake	
+++ b/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake	
@@ -1,8 +1,8 @@
-SET(PACKAGE_VERSION 1.2)
-IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1)
-  SET(PACKAGE_VERSION_COMPATIBLE 1)
-  IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2)
-    SET(PACKAGE_VERSION_EXACT 1)
-  ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2)
-ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1)
+set(PACKAGE_VERSION 1.2)
+if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1)
+  set(PACKAGE_VERSION_COMPATIBLE 1)
+  if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2)
+    set(PACKAGE_VERSION_EXACT 1)
+  endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2)
+endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1)
 
diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt
index e85fb4dd2..d3446497d 100644
--- a/Tests/FindPackageTest/CMakeLists.txt
+++ b/Tests/FindPackageTest/CMakeLists.txt
@@ -1,86 +1,86 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(FindPackageTest)
+project(FindPackageTest)
 
-LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
+list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
 
 # Look for a package which uses FindPackageHandleStandardArgs.cmake with the
 # new (as of cmake 2.8.3) syntax. This works only if CMP0017 is set to NEW,
 # because otherwise FindPackageHandleStandardArgs.cmake from the current
 # directory is included (via CMAKE_MODULE_PATH).
-CMAKE_POLICY(SET CMP0017 NEW)
-FIND_PACKAGE(ZLIB QUIET)
+cmake_policy(SET CMP0017 NEW)
+find_package(ZLIB QUIET)
 
 # Look for a package that has a find module and may be found.
-FIND_PACKAGE(OpenGL QUIET)
+find_package(OpenGL QUIET)
 
 # Look for a package that has no find module and will not be found.
-FIND_PACKAGE(NotAPackage QUIET)
+find_package(NotAPackage QUIET)
 
 # Look for a package that has an advanced find module.
-FIND_PACKAGE(VTK QUIET)
+find_package(VTK QUIET)
 
-ADD_EXECUTABLE(FindPackageTest FindPackageTest.cxx)
+add_executable(FindPackageTest FindPackageTest.cxx)
 
 # test behaviour of cmFindBase wrt. the CMAKE_PREFIX_PATH variable
 # foo.h should be found in ${CMAKE_CURRENT_SOURCE_DIR}/include:
 
-SET(CMAKE_PREFIX_PATH /blub /blah "${CMAKE_CURRENT_SOURCE_DIR}")
-FIND_PATH(FOO_DIR foo.h)
+set(CMAKE_PREFIX_PATH /blub /blah "${CMAKE_CURRENT_SOURCE_DIR}")
+find_path(FOO_DIR foo.h)
 
-IF(NOT FOO_DIR)
-  MESSAGE(FATAL_ERROR "Did not find foo.h which is in ${CMAKE_CURRENT_SOURCE_DIR}/include
+if(NOT FOO_DIR)
+  message(FATAL_ERROR "Did not find foo.h which is in ${CMAKE_CURRENT_SOURCE_DIR}/include
   CMAKE_PREFIX_PATH = ${CMAKE_PREFIX_PATH}")
-ENDIF(NOT FOO_DIR)
+endif(NOT FOO_DIR)
 
-FIND_PACKAGE(VersionTestA 1)
-FIND_PACKAGE(VersionTestB 1.2)
-FIND_PACKAGE(VersionTestC 1.2.3)
-FIND_PACKAGE(VersionTestD 1.2.3.4)
+find_package(VersionTestA 1)
+find_package(VersionTestB 1.2)
+find_package(VersionTestC 1.2.3)
+find_package(VersionTestD 1.2.3.4)
 
 
-FIND_PACKAGE(LotsOfComponents COMPONENTS AComp OPTIONAL_COMPONENTS BComp CComp)
-IF(NOT LOTSOFCOMPONENTS_FOUND)
-  MESSAGE(SEND_ERROR "LotsOfComponents not found !")
-ENDIF()
+find_package(LotsOfComponents COMPONENTS AComp OPTIONAL_COMPONENTS BComp CComp)
+if(NOT LOTSOFCOMPONENTS_FOUND)
+  message(SEND_ERROR "LotsOfComponents not found !")
+endif()
 
 #-----------------------------------------------------------------------------
 # Test system package registry if possible.
-SET(CMakeTestSystemPackage "")
-IF(WIN32 AND NOT CYGWIN)
+set(CMakeTestSystemPackage "")
+if(WIN32 AND NOT CYGWIN)
   # Try writing a value to the system package registry.
-  SET(_data "${FindPackageTest_SOURCE_DIR}/SystemPackage")
-  SET(_key "HKLM\\Software\\Kitware\\CMake\\Packages\\CMakeTestSystemPackage")
-  SET(_file "${FindPackageTest_BINARY_DIR}/CMakeTestSystemPackage.data")
-  FILE(WRITE ${_file} "${_data}\n")
-  EXECUTE_PROCESS(
+  set(_data "${FindPackageTest_SOURCE_DIR}/SystemPackage")
+  set(_key "HKLM\\Software\\Kitware\\CMake\\Packages\\CMakeTestSystemPackage")
+  set(_file "${FindPackageTest_BINARY_DIR}/CMakeTestSystemPackage.data")
+  file(WRITE ${_file} "${_data}\n")
+  execute_process(
     COMMAND ${CMAKE_COMMAND} -E md5sum ${_file}
     OUTPUT_VARIABLE _output ERROR_VARIABLE _error RESULT_VARIABLE _failed
     OUTPUT_STRIP_TRAILING_WHITESPACE
     )
-  STRING(REGEX REPLACE " .*" "" _value "${_output}")
-  IF(NOT _failed AND _value)
-    EXECUTE_PROCESS(
+  string(REGEX REPLACE " .*" "" _value "${_output}")
+  if(NOT _failed AND _value)
+    execute_process(
       COMMAND reg add "${_key}" /v "${_value}" /t REG_SZ /d "${_data}" /f
       OUTPUT_VARIABLE _output ERROR_VARIABLE _output RESULT_VARIABLE _failed
       )
-  ENDIF()
+  endif()
   # If the above worked, add the rest of the test and a rule to
   # cleanup the value.
-  IF(NOT _failed)
-    MESSAGE(STATUS "HKLM is writable: enabling CMakeTestSystemPackage")
-    SET(CMakeTestSystemPackage_CLEANUP reg delete "${_key}" /v "${_value}" /f)
-    SET(CMakeTestSystemPackage CMakeTestSystemPackage)
-  ELSE()
-    MESSAGE(STATUS "HKLM is readonly: disabling CMakeTestSystemPackage")
-  ENDIF()
-ENDIF()
+  if(NOT _failed)
+    message(STATUS "HKLM is writable: enabling CMakeTestSystemPackage")
+    set(CMakeTestSystemPackage_CLEANUP reg delete "${_key}" /v "${_value}" /f)
+    set(CMakeTestSystemPackage CMakeTestSystemPackage)
+  else()
+    message(STATUS "HKLM is readonly: disabling CMakeTestSystemPackage")
+  endif()
+endif()
 
 #-----------------------------------------------------------------------------
 
-#SET(CMAKE_FIND_DEBUG_MODE 1)
+#set(CMAKE_FIND_DEBUG_MODE 1)
 
 # For purposes of the test wipe out previous find results.
-SET(PACKAGES
+set(PACKAGES
   foo Foo Bar Blub TFramework Tframework TApp Tapp Special
   VersionedA VersionedB VersionedC VersionedD VersionedE
   WrongA WrongB WrongC WrongD
@@ -91,14 +91,14 @@ SET(PACKAGES
   SetFoundTRUE SetFoundFALSE
   ${CMakeTestSystemPackage}
   )
-FOREACH(p ${PACKAGES})
-  SET(${p}_DIR "" CACHE FILEPATH "Wipe out find results for testing." FORCE)
-ENDFOREACH(p)
+foreach(p ${PACKAGES})
+  set(${p}_DIR "" CACHE FILEPATH "Wipe out find results for testing." FORCE)
+endforeach(p)
 
 # Enable framework and bundle searching.  Make sure bundles are found
 # before unix-syle packages.
-SET(CMAKE_FIND_FRAMEWORK LAST)
-SET(CMAKE_FIND_APPBUNDLE FIRST)
+set(CMAKE_FIND_FRAMEWORK LAST)
+set(CMAKE_FIND_APPBUNDLE FIRST)
 
 # Set the wrong answer for a find to make sure it re-finds.
 set(VersionedA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/cmake/zot-4.0)
@@ -108,219 +108,219 @@ set(VersionedA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/cmake/zot-4.0)
 set(CMAKE_IGNORE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib/cmake/zot-3.1)
 
 # Look for packages with new-style signatures.
-FIND_PACKAGE(foo NO_MODULE)
-FIND_PACKAGE(Foo CONFIGS FooConfig.cmake)
-FIND_PACKAGE(Bar)
-SET(CMAKE_DISABLE_FIND_PACKAGE_Blub TRUE)
-FIND_PACKAGE(Blub NO_MODULE)
-FIND_PACKAGE(TFramework CONFIGS TFrameworkConfig.cmake)
-FIND_PACKAGE(Tframework)
-FIND_PACKAGE(TApp)
-FIND_PACKAGE(Tapp CONFIGS tapp-config.cmake)
-FIND_PACKAGE(Special NAMES Suffix SuffixTest PATH_SUFFIXES test)
-FIND_PACKAGE(VersionedA 2 NAMES zot)
-FIND_PACKAGE(VersionedB 3.1 EXACT NAMES zot)
-FIND_PACKAGE(VersionedC 4.0 EXACT NAMES zot)
-FIND_PACKAGE(VersionedD 1.1 EXACT NAMES Baz)
-FIND_PACKAGE(VersionedE 1.2 EXACT NAMES Baz)
+find_package(foo NO_MODULE)
+find_package(Foo CONFIGS FooConfig.cmake)
+find_package(Bar)
+set(CMAKE_DISABLE_FIND_PACKAGE_Blub TRUE)
+find_package(Blub NO_MODULE)
+find_package(TFramework CONFIGS TFrameworkConfig.cmake)
+find_package(Tframework)
+find_package(TApp)
+find_package(Tapp CONFIGS tapp-config.cmake)
+find_package(Special NAMES Suffix SuffixTest PATH_SUFFIXES test)
+find_package(VersionedA 2 NAMES zot)
+find_package(VersionedB 3.1 EXACT NAMES zot)
+find_package(VersionedC 4.0 EXACT NAMES zot)
+find_package(VersionedD 1.1 EXACT NAMES Baz)
+find_package(VersionedE 1.2 EXACT NAMES Baz)
 
 # Test Config files which set Xyz_FOUND themselves:
-FIND_PACKAGE(SetFoundTRUE NO_MODULE)
-FIND_PACKAGE(SetFoundFALSE NO_MODULE)
+find_package(SetFoundTRUE NO_MODULE)
+find_package(SetFoundFALSE NO_MODULE)
 
 # Test wrong initial path when result is present.
-SET(WrongA_DIR "${VersionedD_DIR}")
-FIND_PACKAGE(WrongA 1.2 EXACT NAMES Baz)
+set(WrongA_DIR "${VersionedD_DIR}")
+find_package(WrongA 1.2 EXACT NAMES Baz)
 
 # Test wrong initial cache entry of UNINITIALIZED type when result is present.
-SET(WrongB_DIR "${VersionedD_DIR}" CACHE UNINITIALIZED "Wrong Value" FORCE)
-GET_PROPERTY(type CACHE WrongB_DIR PROPERTY TYPE)
-FIND_PACKAGE(WrongB 1.2 EXACT NAMES Baz)
+set(WrongB_DIR "${VersionedD_DIR}" CACHE UNINITIALIZED "Wrong Value" FORCE)
+get_property(type CACHE WrongB_DIR PROPERTY TYPE)
+find_package(WrongB 1.2 EXACT NAMES Baz)
 
 # Test wrong initial path when result is missing.
-SET(WrongC_DIR "${VersionedD_DIR}")
-FIND_PACKAGE(WrongC 1.3 EXACT QUIET NAMES Baz)
+set(WrongC_DIR "${VersionedD_DIR}")
+find_package(WrongC 1.3 EXACT QUIET NAMES Baz)
 
 # Test wrong initial cache entry of UNINITIALIZED type when result is missing.
-SET(WrongD_DIR "${VersionedD_DIR}" CACHE UNINITIALIZED "Wrong Value" FORCE)
-GET_PROPERTY(type CACHE WrongD_DIR PROPERTY TYPE)
-FIND_PACKAGE(WrongD 1.3 EXACT QUIET NAMES Baz)
+set(WrongD_DIR "${VersionedD_DIR}" CACHE UNINITIALIZED "Wrong Value" FORCE)
+get_property(type CACHE WrongD_DIR PROPERTY TYPE)
+find_package(WrongD 1.3 EXACT QUIET NAMES Baz)
 
 # HINTS should override the system but PATHS should not
-LIST(INSERT CMAKE_SYSTEM_PREFIX_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/A")
-FIND_PACKAGE(wibbleA NAMES wibble PATHS B)
-FIND_PACKAGE(wibbleB NAMES wibble HINTS B)
+list(INSERT CMAKE_SYSTEM_PREFIX_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/A")
+find_package(wibbleA NAMES wibble PATHS B)
+find_package(wibbleB NAMES wibble HINTS B)
 
 # Look for package with recursive find-modules.
-FIND_PACKAGE(RecursiveA COMPONENTS A)
-FIND_PACKAGE(RecursiveB 2)
-FIND_PACKAGE(RecursiveC 3.1 EXACT)
+find_package(RecursiveA COMPONENTS A)
+find_package(RecursiveB 2)
+find_package(RecursiveC 3.1 EXACT)
 
 # Test architecture-specific search directories.
-SET(CMAKE_LIBRARY_ARCHITECTURE arch)
-FIND_PACKAGE(ArchA NAMES Bar)
-FIND_PACKAGE(ArchB NAMES Foo CONFIGS FooConfig.cmake)
-FIND_PACKAGE(ArchC 3.1 EXACT NAMES zot)
-FIND_PACKAGE(ArchD 4.0 EXACT NAMES zot)
-UNSET(CMAKE_LIBRARY_ARCHITECTURE)
+set(CMAKE_LIBRARY_ARCHITECTURE arch)
+find_package(ArchA NAMES Bar)
+find_package(ArchB NAMES Foo CONFIGS FooConfig.cmake)
+find_package(ArchC 3.1 EXACT NAMES zot)
+find_package(ArchD 4.0 EXACT NAMES zot)
+unset(CMAKE_LIBRARY_ARCHITECTURE)
 
 # Test <Package>_DIR environment variable.
 # We erase the main prefix path to ensure the env var is used.
-SET(CMAKE_PREFIX_PATH)
-SET(ENV{EnvA_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/lib/zot-3.1")
-FIND_PACKAGE(EnvA 3.1 EXACT QUIET NAMES zot) # Should Work
-FIND_PACKAGE(EnvB 3.1 EXACT QUIET NAMES zot) # Should Fail
+set(CMAKE_PREFIX_PATH)
+set(ENV{EnvA_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/lib/zot-3.1")
+find_package(EnvA 3.1 EXACT QUIET NAMES zot) # Should Work
+find_package(EnvB 3.1 EXACT QUIET NAMES zot) # Should Fail
 
 # Test system package registry if available.
-IF(CMakeTestSystemPackage)
-  FIND_PACKAGE(CMakeTestSystemPackage)
-  EXECUTE_PROCESS(COMMAND ${CMakeTestSystemPackage_CLEANUP}
+if(CMakeTestSystemPackage)
+  find_package(CMakeTestSystemPackage)
+  execute_process(COMMAND ${CMakeTestSystemPackage_CLEANUP}
     OUTPUT_VARIABLE _output ERROR_VARIABLE _error)
-ENDIF()
+endif()
 
 # Expected locations at which packages should be found.
-SET(foo_EXPECTED "lib/foo-1.2/foo-config.cmake")
-SET(Foo_EXPECTED "lib/foo-1.2/CMake/FooConfig.cmake")
-SET(Bar_EXPECTED "lib/Bar/BarConfig.cmake")
-SET(Blub_MISSING "")
-SET(Special_EXPECTED "lib/suffix/test/SuffixTestConfig.cmake")
-SET(TFramework_EXPECTED
+set(foo_EXPECTED "lib/foo-1.2/foo-config.cmake")
+set(Foo_EXPECTED "lib/foo-1.2/CMake/FooConfig.cmake")
+set(Bar_EXPECTED "lib/Bar/BarConfig.cmake")
+set(Blub_MISSING "")
+set(Special_EXPECTED "lib/suffix/test/SuffixTestConfig.cmake")
+set(TFramework_EXPECTED
   "TFramework.framework/Versions/A/Resources/CMake/TFrameworkConfig.cmake")
-SET(Tframework_EXPECTED
+set(Tframework_EXPECTED
   "TFramework.framework/Versions/A/Resources/tframework-config.cmake")
-SET(TApp_EXPECTED
+set(TApp_EXPECTED
   "TApp.app/Contents/Resources/TAppConfig.cmake")
-SET(Tapp_EXPECTED
+set(Tapp_EXPECTED
   "TApp.app/Contents/Resources/cmake/tapp-config.cmake")
-SET(VersionedA_EXPECTED "lib/zot-2.0/zot-config.cmake")
-SET(VersionedB_EXPECTED "lib/zot-3.1/zot-config.cmake")
-SET(VersionedC_EXPECTED "lib/cmake/zot-4.0/zot-config.cmake")
-SET(VersionedD_EXPECTED "Baz 1.1/BazConfig.cmake")
-SET(VersionedE_EXPECTED "Baz 1.2/CMake/BazConfig.cmake")
-SET(WrongA_EXPECTED "${VersionedE_EXPECTED}")
-SET(WrongB_EXPECTED "${VersionedE_EXPECTED}")
-SET(WrongC_MISSING "WrongC_DIR-NOTFOUND")
-SET(WrongD_MISSING "WrongD_DIR-NOTFOUND")
-SET(wibbleA_EXPECTED "A/wibble-config.cmake")
-SET(wibbleB_EXPECTED "B/wibble-config.cmake")
-SET(RecursiveA_EXPECTED "lib/RecursiveA/recursivea-config.cmake")
-SET(RecursiveB_EXPECTED "lib/zot-2.0/zot-config.cmake")
-SET(RecursiveC_EXPECTED "lib/zot-3.1/zot-config.cmake")
-SET(ArchA_EXPECTED "lib/arch/Bar/BarConfig.cmake")
-SET(ArchB_EXPECTED "lib/arch/foo-1.2/CMake/FooConfig.cmake")
-SET(ArchC_EXPECTED "lib/arch/zot-3.1/zot-config.cmake")
-SET(ArchD_EXPECTED "lib/arch/cmake/zot-4.0/zot-config.cmake")
-SET(EnvA_EXPECTED "lib/zot-3.1/zot-config.cmake")
-SET(EnvB_MISSING "EnvB_DIR-NOTFOUND")
-SET(SetFoundTRUE_EXPECTED "cmake/SetFoundTRUEConfig.cmake")
-SET(SetFoundFALSE_MISSING "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
-SET(CMakeTestSystemPackage_EXPECTED "SystemPackage/CMakeTestSystemPackageConfig.cmake")
+set(VersionedA_EXPECTED "lib/zot-2.0/zot-config.cmake")
+set(VersionedB_EXPECTED "lib/zot-3.1/zot-config.cmake")
+set(VersionedC_EXPECTED "lib/cmake/zot-4.0/zot-config.cmake")
+set(VersionedD_EXPECTED "Baz 1.1/BazConfig.cmake")
+set(VersionedE_EXPECTED "Baz 1.2/CMake/BazConfig.cmake")
+set(WrongA_EXPECTED "${VersionedE_EXPECTED}")
+set(WrongB_EXPECTED "${VersionedE_EXPECTED}")
+set(WrongC_MISSING "WrongC_DIR-NOTFOUND")
+set(WrongD_MISSING "WrongD_DIR-NOTFOUND")
+set(wibbleA_EXPECTED "A/wibble-config.cmake")
+set(wibbleB_EXPECTED "B/wibble-config.cmake")
+set(RecursiveA_EXPECTED "lib/RecursiveA/recursivea-config.cmake")
+set(RecursiveB_EXPECTED "lib/zot-2.0/zot-config.cmake")
+set(RecursiveC_EXPECTED "lib/zot-3.1/zot-config.cmake")
+set(ArchA_EXPECTED "lib/arch/Bar/BarConfig.cmake")
+set(ArchB_EXPECTED "lib/arch/foo-1.2/CMake/FooConfig.cmake")
+set(ArchC_EXPECTED "lib/arch/zot-3.1/zot-config.cmake")
+set(ArchD_EXPECTED "lib/arch/cmake/zot-4.0/zot-config.cmake")
+set(EnvA_EXPECTED "lib/zot-3.1/zot-config.cmake")
+set(EnvB_MISSING "EnvB_DIR-NOTFOUND")
+set(SetFoundTRUE_EXPECTED "cmake/SetFoundTRUEConfig.cmake")
+set(SetFoundFALSE_MISSING "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+set(CMakeTestSystemPackage_EXPECTED "SystemPackage/CMakeTestSystemPackageConfig.cmake")
 
 # Check the results.
-FOREACH(p ${PACKAGES})
-  IF(DEFINED ${p}_MISSING)
+foreach(p ${PACKAGES})
+  if(DEFINED ${p}_MISSING)
     # Check and report failure.
-    IF(NOT "${${p}_DIR}" STREQUAL "${${p}_MISSING}")
-      MESSAGE(SEND_ERROR
+    if(NOT "${${p}_DIR}" STREQUAL "${${p}_MISSING}")
+      message(SEND_ERROR
         "Package ${p} should have been [${${p}_MISSING}] but "
         "was [${${p}_DIR}]")
-    ENDIF()
-    IF(${p}_FOUND)
-      MESSAGE(SEND_ERROR
+    endif()
+    if(${p}_FOUND)
+      message(SEND_ERROR
         "Package ${p} should not have been found, but ${p}_FOUND is set to "
         "\"${${p}_FOUND}\"")
-    ENDIF()
-  ELSEIF(${p}_FOUND)
+    endif()
+  elseif(${p}_FOUND)
     # Convert to relative path for comparison to expected location.
-    FILE(RELATIVE_PATH REL_${p}_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}"
+    file(RELATIVE_PATH REL_${p}_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}"
       "${${p}_CONFIG}")
 
     # Debugging output.
-    IF(CMAKE_FIND_DEBUG_MODE)
-      MESSAGE("Package ${p} found [${REL_${p}_CONFIG}]")
-    ENDIF(CMAKE_FIND_DEBUG_MODE)
+    if(CMAKE_FIND_DEBUG_MODE)
+      message("Package ${p} found [${REL_${p}_CONFIG}]")
+    endif(CMAKE_FIND_DEBUG_MODE)
 
     # Check and report failure.
-    IF(NOT "${REL_${p}_CONFIG}" STREQUAL "${${p}_EXPECTED}")
-      MESSAGE(SEND_ERROR
+    if(NOT "${REL_${p}_CONFIG}" STREQUAL "${${p}_EXPECTED}")
+      message(SEND_ERROR
         "Package ${p} should have been [${${p}_EXPECTED}] but "
         "was [${REL_${p}_CONFIG}]")
-    ENDIF(NOT "${REL_${p}_CONFIG}" STREQUAL "${${p}_EXPECTED}")
-  ELSE()
-    MESSAGE(SEND_ERROR "Package ${p} not found!")
-  ENDIF()
-ENDFOREACH(p)
+    endif(NOT "${REL_${p}_CONFIG}" STREQUAL "${${p}_EXPECTED}")
+  else()
+    message(SEND_ERROR "Package ${p} not found!")
+  endif()
+endforeach(p)
 
 # Check that version information was extracted.
-IF(NOT "${VersionedA_VERSION}" STREQUAL "2.0")
-  MESSAGE(SEND_ERROR
+if(NOT "${VersionedA_VERSION}" STREQUAL "2.0")
+  message(SEND_ERROR
     "Package VersionedA is version [${VersionedA_VERSION}], not [2.0]")
-ENDIF(NOT "${VersionedA_VERSION}" STREQUAL "2.0")
-IF(NOT "${VersionedA_VERSION_MAJOR}" STREQUAL "2")
-  MESSAGE(SEND_ERROR
+endif(NOT "${VersionedA_VERSION}" STREQUAL "2.0")
+if(NOT "${VersionedA_VERSION_MAJOR}" STREQUAL "2")
+  message(SEND_ERROR
     "Package VersionedA is major version [${VersionedA_VERSION_MAJOR}], not [2]")
-ENDIF(NOT "${VersionedA_VERSION_MAJOR}" STREQUAL "2")
-IF(NOT "${VersionedA_VERSION_MINOR}" STREQUAL "0")
-  MESSAGE(SEND_ERROR
+endif(NOT "${VersionedA_VERSION_MAJOR}" STREQUAL "2")
+if(NOT "${VersionedA_VERSION_MINOR}" STREQUAL "0")
+  message(SEND_ERROR
     "Package VersionedA is minor version [${VersionedA_VERSION_MINOR}], not [0]")
-ENDIF(NOT "${VersionedA_VERSION_MINOR}" STREQUAL "0")
+endif(NOT "${VersionedA_VERSION_MINOR}" STREQUAL "0")
 
-IF(NOT "${VersionedB_VERSION}" STREQUAL "3.1")
-  MESSAGE(SEND_ERROR
+if(NOT "${VersionedB_VERSION}" STREQUAL "3.1")
+  message(SEND_ERROR
     "Package VersionedB is version [${VersionedB_VERSION}], not [3.1]")
-ENDIF(NOT "${VersionedB_VERSION}" STREQUAL "3.1")
-IF(NOT "${VersionedB_VERSION_MAJOR}" STREQUAL "3")
-  MESSAGE(SEND_ERROR
+endif(NOT "${VersionedB_VERSION}" STREQUAL "3.1")
+if(NOT "${VersionedB_VERSION_MAJOR}" STREQUAL "3")
+  message(SEND_ERROR
     "Package VersionedB is major version [${VersionedB_VERSION_MAJOR}], not [3]")
-ENDIF(NOT "${VersionedB_VERSION_MAJOR}" STREQUAL "3")
-IF(NOT "${VersionedB_VERSION_MINOR}" STREQUAL "1")
-  MESSAGE(SEND_ERROR
+endif(NOT "${VersionedB_VERSION_MAJOR}" STREQUAL "3")
+if(NOT "${VersionedB_VERSION_MINOR}" STREQUAL "1")
+  message(SEND_ERROR
     "Package VersionedB is minor version [${VersionedB_VERSION_MINOR}], not [1]")
-ENDIF(NOT "${VersionedB_VERSION_MINOR}" STREQUAL "1")
+endif(NOT "${VersionedB_VERSION_MINOR}" STREQUAL "1")
 
-IF(NOT "${Special_VERSION}" STREQUAL "1.2")
-  MESSAGE(SEND_ERROR
+if(NOT "${Special_VERSION}" STREQUAL "1.2")
+  message(SEND_ERROR
     "Package Special is version [${Special_VERSION}], not [1.2]")
-ENDIF(NOT "${Special_VERSION}" STREQUAL "1.2")
-IF(NOT "${Special_VERSION_MAJOR}" STREQUAL "1")
-  MESSAGE(SEND_ERROR
+endif(NOT "${Special_VERSION}" STREQUAL "1.2")
+if(NOT "${Special_VERSION_MAJOR}" STREQUAL "1")
+  message(SEND_ERROR
     "Package Special is major version [${Special_VERSION_MAJOR}], not [1]")
-ENDIF(NOT "${Special_VERSION_MAJOR}" STREQUAL "1")
-IF(NOT "${Special_VERSION_MINOR}" STREQUAL "2")
-  MESSAGE(SEND_ERROR
+endif(NOT "${Special_VERSION_MAJOR}" STREQUAL "1")
+if(NOT "${Special_VERSION_MINOR}" STREQUAL "2")
+  message(SEND_ERROR
     "Package Special is minor version [${Special_VERSION_MINOR}], not [2]")
-ENDIF(NOT "${Special_VERSION_MINOR}" STREQUAL "2")
+endif(NOT "${Special_VERSION_MINOR}" STREQUAL "2")
 
 # Test version number comparison.
-IF(NOT "1.2.3.4" VERSION_LESS "1.2.3.5")
-  MESSAGE(SEND_ERROR "1.2.3.4 VERSION_LESS 1.2.3.5 is not true!")
-ENDIF()
-IF(NOT "1.2" VERSION_LESS "1.10")
-  MESSAGE(SEND_ERROR "1.2 VERSION_LESS 1.10 is not true!")
-ENDIF()
-IF(NOT "1.02" VERSION_GREATER "1.1")
-  MESSAGE(SEND_ERROR "1.02 VERSION_GREATER 1.1 is not true!")
-ENDIF()
-IF("1.2.3" VERSION_GREATER "1.2.3.4")
-  MESSAGE(SEND_ERROR "1.2.3 VERSION_GREATER 1.2.3.4 is not false!")
-ENDIF()
-IF(NOT "1.2" VERSION_EQUAL "1.2.0.0")
-  MESSAGE(SEND_ERROR "1.2 VERSION_EQUAL 1.2.0.0 is not true!")
-ENDIF()
+if(NOT "1.2.3.4" VERSION_LESS "1.2.3.5")
+  message(SEND_ERROR "1.2.3.4 VERSION_LESS 1.2.3.5 is not true!")
+endif()
+if(NOT "1.2" VERSION_LESS "1.10")
+  message(SEND_ERROR "1.2 VERSION_LESS 1.10 is not true!")
+endif()
+if(NOT "1.02" VERSION_GREATER "1.1")
+  message(SEND_ERROR "1.02 VERSION_GREATER 1.1 is not true!")
+endif()
+if("1.2.3" VERSION_GREATER "1.2.3.4")
+  message(SEND_ERROR "1.2.3 VERSION_GREATER 1.2.3.4 is not false!")
+endif()
+if(NOT "1.2" VERSION_EQUAL "1.2.0.0")
+  message(SEND_ERROR "1.2 VERSION_EQUAL 1.2.0.0 is not true!")
+endif()
 
 #-----------------------------------------------------------------------------
 # Test export(PACKAGE) with find_package.
-MESSAGE(STATUS "Preparing export(PACKAGE) test project")
-TRY_COMPILE(EXPORTER_COMPILED
+message(STATUS "Preparing export(PACKAGE) test project")
+try_compile(EXPORTER_COMPILED
   ${FindPackageTest_BINARY_DIR}/Exporter
   ${FindPackageTest_SOURCE_DIR}/Exporter
   CMakeTestExportPackage dummy
   OUTPUT_VARIABLE output)
-MESSAGE(STATUS "Searching for export(PACKAGE) test project")
-SET(CMakeTestExportPackage_DIR "" CACHE FILEPATH
+message(STATUS "Searching for export(PACKAGE) test project")
+set(CMakeTestExportPackage_DIR "" CACHE FILEPATH
   "Wipe out find results for testing." FORCE)
-STRING(REGEX REPLACE "-.*$" "" version ${CMAKE_VERSION})
-FIND_PACKAGE(CMakeTestExportPackage 1.${version} EXACT REQUIRED)
+string(REGEX REPLACE "-.*$" "" version ${CMAKE_VERSION})
+find_package(CMakeTestExportPackage 1.${version} EXACT REQUIRED)
 
 #-----------------------------------------------------------------------------
 # Test configure_package_config_file().
diff --git a/Tests/FindPackageTest/Exporter/CMakeTestExportPackageConfigVersion.cmake.in b/Tests/FindPackageTest/Exporter/CMakeTestExportPackageConfigVersion.cmake.in
index ff450a145..42bd84ea8 100644
--- a/Tests/FindPackageTest/Exporter/CMakeTestExportPackageConfigVersion.cmake.in
+++ b/Tests/FindPackageTest/Exporter/CMakeTestExportPackageConfigVersion.cmake.in
@@ -1,6 +1,6 @@
 # Test config file.
-SET(PACKAGE_VERSION "1.@CMAKE_VERSION@")
-IF("${PACKAGE_FIND_VERSION}" VERSION_EQUAL "${PACKAGE_VERSION}")
-  SET(PACKAGE_VERSION_COMPATIBLE 1)
-  SET(PACKAGE_VERSION_EXACT 1)
-ENDIF()
+set(PACKAGE_VERSION "1.@CMAKE_VERSION@")
+if("${PACKAGE_FIND_VERSION}" VERSION_EQUAL "${PACKAGE_VERSION}")
+  set(PACKAGE_VERSION_COMPATIBLE 1)
+  set(PACKAGE_VERSION_EXACT 1)
+endif()
diff --git a/Tests/FindPackageTest/FindRecursiveA.cmake b/Tests/FindPackageTest/FindRecursiveA.cmake
index 3af7e99a3..a6d25dc4b 100644
--- a/Tests/FindPackageTest/FindRecursiveA.cmake
+++ b/Tests/FindPackageTest/FindRecursiveA.cmake
@@ -1 +1 @@
-FIND_PACKAGE(RecursiveA NO_MODULE)
+find_package(RecursiveA NO_MODULE)
diff --git a/Tests/FindPackageTest/FindRecursiveB.cmake b/Tests/FindPackageTest/FindRecursiveB.cmake
index c609ab127..9e28f2ce9 100644
--- a/Tests/FindPackageTest/FindRecursiveB.cmake
+++ b/Tests/FindPackageTest/FindRecursiveB.cmake
@@ -1 +1 @@
-FIND_PACKAGE(RecursiveB NAMES zot)
+find_package(RecursiveB NAMES zot)
diff --git a/Tests/FindPackageTest/FindRecursiveC.cmake b/Tests/FindPackageTest/FindRecursiveC.cmake
index 018cc7302..cd4400ca0 100644
--- a/Tests/FindPackageTest/FindRecursiveC.cmake
+++ b/Tests/FindPackageTest/FindRecursiveC.cmake
@@ -1 +1 @@
-FIND_PACKAGE(RecursiveC NAMES zot)
+find_package(RecursiveC NAMES zot)
diff --git a/Tests/FindPackageTest/FindVersionTestA.cmake b/Tests/FindPackageTest/FindVersionTestA.cmake
index 55c67e257..c6031d9dc 100644
--- a/Tests/FindPackageTest/FindVersionTestA.cmake
+++ b/Tests/FindPackageTest/FindVersionTestA.cmake
@@ -1,18 +1,18 @@
-IF(NOT "${VersionTestA_FIND_VERSION}" STREQUAL "1")
-  MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION=${VersionTestA_FIND_VERSION} is not 1")
-ENDIF(NOT "${VersionTestA_FIND_VERSION}" STREQUAL "1")
-IF(NOT "${VersionTestA_FIND_VERSION_MAJOR}" STREQUAL "1")
-  MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_MAJOR=${VersionTestA_FIND_VERSION_MAJOR} is not 1")
-ENDIF(NOT "${VersionTestA_FIND_VERSION_MAJOR}" STREQUAL "1")
-IF(NOT "${VersionTestA_FIND_VERSION_MINOR}" STREQUAL "0")
-  MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_MINOR=${VersionTestA_FIND_VERSION_MINOR} is not 0")
-ENDIF(NOT "${VersionTestA_FIND_VERSION_MINOR}" STREQUAL "0")
-IF(NOT "${VersionTestA_FIND_VERSION_PATCH}" STREQUAL "0")
-  MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_PATCH=${VersionTestA_FIND_VERSION_PATCH} is not 0")
-ENDIF(NOT "${VersionTestA_FIND_VERSION_PATCH}" STREQUAL "0")
-IF(NOT "${VersionTestA_FIND_VERSION_TWEAK}" STREQUAL "0")
-  MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_TWEAK=${VersionTestA_FIND_VERSION_TWEAK} is not 0")
-ENDIF(NOT "${VersionTestA_FIND_VERSION_TWEAK}" STREQUAL "0")
-IF(NOT "${VersionTestA_FIND_VERSION_COUNT}" STREQUAL "1")
-  MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_COUNT=${VersionTestA_FIND_VERSION_COUNT} is not 1")
-ENDIF(NOT "${VersionTestA_FIND_VERSION_COUNT}" STREQUAL "1")
+if(NOT "${VersionTestA_FIND_VERSION}" STREQUAL "1")
+  message(SEND_ERROR "VersionTestA_FIND_VERSION=${VersionTestA_FIND_VERSION} is not 1")
+endif(NOT "${VersionTestA_FIND_VERSION}" STREQUAL "1")
+if(NOT "${VersionTestA_FIND_VERSION_MAJOR}" STREQUAL "1")
+  message(SEND_ERROR "VersionTestA_FIND_VERSION_MAJOR=${VersionTestA_FIND_VERSION_MAJOR} is not 1")
+endif(NOT "${VersionTestA_FIND_VERSION_MAJOR}" STREQUAL "1")
+if(NOT "${VersionTestA_FIND_VERSION_MINOR}" STREQUAL "0")
+  message(SEND_ERROR "VersionTestA_FIND_VERSION_MINOR=${VersionTestA_FIND_VERSION_MINOR} is not 0")
+endif(NOT "${VersionTestA_FIND_VERSION_MINOR}" STREQUAL "0")
+if(NOT "${VersionTestA_FIND_VERSION_PATCH}" STREQUAL "0")
+  message(SEND_ERROR "VersionTestA_FIND_VERSION_PATCH=${VersionTestA_FIND_VERSION_PATCH} is not 0")
+endif(NOT "${VersionTestA_FIND_VERSION_PATCH}" STREQUAL "0")
+if(NOT "${VersionTestA_FIND_VERSION_TWEAK}" STREQUAL "0")
+  message(SEND_ERROR "VersionTestA_FIND_VERSION_TWEAK=${VersionTestA_FIND_VERSION_TWEAK} is not 0")
+endif(NOT "${VersionTestA_FIND_VERSION_TWEAK}" STREQUAL "0")
+if(NOT "${VersionTestA_FIND_VERSION_COUNT}" STREQUAL "1")
+  message(SEND_ERROR "VersionTestA_FIND_VERSION_COUNT=${VersionTestA_FIND_VERSION_COUNT} is not 1")
+endif(NOT "${VersionTestA_FIND_VERSION_COUNT}" STREQUAL "1")
diff --git a/Tests/FindPackageTest/FindVersionTestB.cmake b/Tests/FindPackageTest/FindVersionTestB.cmake
index 03173c65a..914d5a732 100644
--- a/Tests/FindPackageTest/FindVersionTestB.cmake
+++ b/Tests/FindPackageTest/FindVersionTestB.cmake
@@ -1,18 +1,18 @@
-IF(NOT "${VersionTestB_FIND_VERSION}" STREQUAL "1.2")
-  MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION=${VersionTestB_FIND_VERSION} is not 1.2")
-ENDIF(NOT "${VersionTestB_FIND_VERSION}" STREQUAL "1.2")
-IF(NOT "${VersionTestB_FIND_VERSION_MAJOR}" STREQUAL "1")
-  MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION_MAJOR=${VersionTestB_FIND_VERSION_MAJOR} is not 1")
-ENDIF(NOT "${VersionTestB_FIND_VERSION_MAJOR}" STREQUAL "1")
-IF(NOT "${VersionTestB_FIND_VERSION_MINOR}" STREQUAL "2")
-  MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION_MINOR=${VersionTestB_FIND_VERSION_MINOR} is not 2")
-ENDIF(NOT "${VersionTestB_FIND_VERSION_MINOR}" STREQUAL "2")
-IF(NOT "${VersionTestB_FIND_VERSION_PATCH}" STREQUAL "0")
-  MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION_PATCH=${VersionTestB_FIND_VERSION_PATCH} is not 0")
-ENDIF(NOT "${VersionTestB_FIND_VERSION_PATCH}" STREQUAL "0")
-IF(NOT "${VersionTestB_FIND_VERSION_TWEAK}" STREQUAL "0")
-  MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION_TWEAK=${VersionTestB_FIND_VERSION_TWEAK} is not 0")
-ENDIF(NOT "${VersionTestB_FIND_VERSION_TWEAK}" STREQUAL "0")
-IF(NOT "${VersionTestB_FIND_VERSION_COUNT}" STREQUAL "2")
-  MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION_COUNT=${VersionTestB_FIND_VERSION_COUNT} is not 2")
-ENDIF(NOT "${VersionTestB_FIND_VERSION_COUNT}" STREQUAL "2")
+if(NOT "${VersionTestB_FIND_VERSION}" STREQUAL "1.2")
+  message(SEND_ERROR "VersionTestB_FIND_VERSION=${VersionTestB_FIND_VERSION} is not 1.2")
+endif(NOT "${VersionTestB_FIND_VERSION}" STREQUAL "1.2")
+if(NOT "${VersionTestB_FIND_VERSION_MAJOR}" STREQUAL "1")
+  message(SEND_ERROR "VersionTestB_FIND_VERSION_MAJOR=${VersionTestB_FIND_VERSION_MAJOR} is not 1")
+endif(NOT "${VersionTestB_FIND_VERSION_MAJOR}" STREQUAL "1")
+if(NOT "${VersionTestB_FIND_VERSION_MINOR}" STREQUAL "2")
+  message(SEND_ERROR "VersionTestB_FIND_VERSION_MINOR=${VersionTestB_FIND_VERSION_MINOR} is not 2")
+endif(NOT "${VersionTestB_FIND_VERSION_MINOR}" STREQUAL "2")
+if(NOT "${VersionTestB_FIND_VERSION_PATCH}" STREQUAL "0")
+  message(SEND_ERROR "VersionTestB_FIND_VERSION_PATCH=${VersionTestB_FIND_VERSION_PATCH} is not 0")
+endif(NOT "${VersionTestB_FIND_VERSION_PATCH}" STREQUAL "0")
+if(NOT "${VersionTestB_FIND_VERSION_TWEAK}" STREQUAL "0")
+  message(SEND_ERROR "VersionTestB_FIND_VERSION_TWEAK=${VersionTestB_FIND_VERSION_TWEAK} is not 0")
+endif(NOT "${VersionTestB_FIND_VERSION_TWEAK}" STREQUAL "0")
+if(NOT "${VersionTestB_FIND_VERSION_COUNT}" STREQUAL "2")
+  message(SEND_ERROR "VersionTestB_FIND_VERSION_COUNT=${VersionTestB_FIND_VERSION_COUNT} is not 2")
+endif(NOT "${VersionTestB_FIND_VERSION_COUNT}" STREQUAL "2")
diff --git a/Tests/FindPackageTest/FindVersionTestC.cmake b/Tests/FindPackageTest/FindVersionTestC.cmake
index 1344cbc22..66e07ea95 100644
--- a/Tests/FindPackageTest/FindVersionTestC.cmake
+++ b/Tests/FindPackageTest/FindVersionTestC.cmake
@@ -1,18 +1,18 @@
-IF(NOT "${VersionTestC_FIND_VERSION}" STREQUAL "1.2.3")
-  MESSAGE(SEND_ERROR "VersionTestC_FIND_VERSION=${VersionTestC_FIND_VERSION} is not 1.2.3")
-ENDIF(NOT "${VersionTestC_FIND_VERSION}" STREQUAL "1.2.3")
-IF(NOT "${VersionTestC_FIND_VERSION_MAJOR}" STREQUAL "1")
-  MESSAGE(SEND_ERROR "VersionTestC_FIND_VERSION_MAJOR=${VersionTestC_FIND_VERSION_MAJOR} is not 1")
-ENDIF(NOT "${VersionTestC_FIND_VERSION_MAJOR}" STREQUAL "1")
-IF(NOT "${VersionTestC_FIND_VERSION_MINOR}" STREQUAL "2")
-  MESSAGE(SEND_ERROR "VersionTestC_FIND_VERSION_MINOR=${VersionTestC_FIND_VERSION_MINOR} is not 2")
-ENDIF(NOT "${VersionTestC_FIND_VERSION_MINOR}" STREQUAL "2")
-IF(NOT "${VersionTestC_FIND_VERSION_PATCH}" STREQUAL "3")
-  MESSAGE(SEND_ERROR "VersionTestC_FIND_VERSION_PATCH=${VersionTestC_FIND_VERSION_PATCH} is not 3")
-ENDIF(NOT "${VersionTestC_FIND_VERSION_PATCH}" STREQUAL "3")
-IF(NOT "${VersionTestC_FIND_VERSION_TWEAK}" STREQUAL "0")
-  MESSAGE(SEND_ERROR "VersionTestC_FIND_VERSION_TWEAK=${VersionTestC_FIND_VERSION_TWEAK} is not 0")
-ENDIF(NOT "${VersionTestC_FIND_VERSION_TWEAK}" STREQUAL "0")
-IF(NOT "${VersionTestC_FIND_VERSION_COUNT}" STREQUAL "3")
-  MESSAGE(SEND_ERROR "VersionTestC_FIND_VERSION_COUNT=${VersionTestC_FIND_VERSION_COUNT} is not 3")
-ENDIF(NOT "${VersionTestC_FIND_VERSION_COUNT}" STREQUAL "3")
+if(NOT "${VersionTestC_FIND_VERSION}" STREQUAL "1.2.3")
+  message(SEND_ERROR "VersionTestC_FIND_VERSION=${VersionTestC_FIND_VERSION} is not 1.2.3")
+endif(NOT "${VersionTestC_FIND_VERSION}" STREQUAL "1.2.3")
+if(NOT "${VersionTestC_FIND_VERSION_MAJOR}" STREQUAL "1")
+  message(SEND_ERROR "VersionTestC_FIND_VERSION_MAJOR=${VersionTestC_FIND_VERSION_MAJOR} is not 1")
+endif(NOT "${VersionTestC_FIND_VERSION_MAJOR}" STREQUAL "1")
+if(NOT "${VersionTestC_FIND_VERSION_MINOR}" STREQUAL "2")
+  message(SEND_ERROR "VersionTestC_FIND_VERSION_MINOR=${VersionTestC_FIND_VERSION_MINOR} is not 2")
+endif(NOT "${VersionTestC_FIND_VERSION_MINOR}" STREQUAL "2")
+if(NOT "${VersionTestC_FIND_VERSION_PATCH}" STREQUAL "3")
+  message(SEND_ERROR "VersionTestC_FIND_VERSION_PATCH=${VersionTestC_FIND_VERSION_PATCH} is not 3")
+endif(NOT "${VersionTestC_FIND_VERSION_PATCH}" STREQUAL "3")
+if(NOT "${VersionTestC_FIND_VERSION_TWEAK}" STREQUAL "0")
+  message(SEND_ERROR "VersionTestC_FIND_VERSION_TWEAK=${VersionTestC_FIND_VERSION_TWEAK} is not 0")
+endif(NOT "${VersionTestC_FIND_VERSION_TWEAK}" STREQUAL "0")
+if(NOT "${VersionTestC_FIND_VERSION_COUNT}" STREQUAL "3")
+  message(SEND_ERROR "VersionTestC_FIND_VERSION_COUNT=${VersionTestC_FIND_VERSION_COUNT} is not 3")
+endif(NOT "${VersionTestC_FIND_VERSION_COUNT}" STREQUAL "3")
diff --git a/Tests/FindPackageTest/FindVersionTestD.cmake b/Tests/FindPackageTest/FindVersionTestD.cmake
index d3e3f509e..88d92999c 100644
--- a/Tests/FindPackageTest/FindVersionTestD.cmake
+++ b/Tests/FindPackageTest/FindVersionTestD.cmake
@@ -1,18 +1,18 @@
-IF(NOT "${VersionTestD_FIND_VERSION}" STREQUAL "1.2.3.4")
-  MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION=${VersionTestD_FIND_VERSION} is not 1.2.3.4")
-ENDIF(NOT "${VersionTestD_FIND_VERSION}" STREQUAL "1.2.3.4")
-IF(NOT "${VersionTestD_FIND_VERSION_MAJOR}" STREQUAL "1")
-  MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION_MAJOR=${VersionTestD_FIND_VERSION_MAJOR} is not 1")
-ENDIF(NOT "${VersionTestD_FIND_VERSION_MAJOR}" STREQUAL "1")
-IF(NOT "${VersionTestD_FIND_VERSION_MINOR}" STREQUAL "2")
-  MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION_MINOR=${VersionTestD_FIND_VERSION_MINOR} is not 2")
-ENDIF(NOT "${VersionTestD_FIND_VERSION_MINOR}" STREQUAL "2")
-IF(NOT "${VersionTestD_FIND_VERSION_PATCH}" STREQUAL "3")
-  MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION_PATCH=${VersionTestD_FIND_VERSION_PATCH} is not 3")
-ENDIF(NOT "${VersionTestD_FIND_VERSION_PATCH}" STREQUAL "3")
-IF(NOT "${VersionTestD_FIND_VERSION_TWEAK}" STREQUAL "4")
-  MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION_TWEAK=${VersionTestD_FIND_VERSION_TWEAK} is not 4")
-ENDIF(NOT "${VersionTestD_FIND_VERSION_TWEAK}" STREQUAL "4")
-IF(NOT "${VersionTestD_FIND_VERSION_COUNT}" STREQUAL "4")
-  MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION_COUNT=${VersionTestD_FIND_VERSION_COUNT} is not 4")
-ENDIF(NOT "${VersionTestD_FIND_VERSION_COUNT}" STREQUAL "4")
+if(NOT "${VersionTestD_FIND_VERSION}" STREQUAL "1.2.3.4")
+  message(SEND_ERROR "VersionTestD_FIND_VERSION=${VersionTestD_FIND_VERSION} is not 1.2.3.4")
+endif(NOT "${VersionTestD_FIND_VERSION}" STREQUAL "1.2.3.4")
+if(NOT "${VersionTestD_FIND_VERSION_MAJOR}" STREQUAL "1")
+  message(SEND_ERROR "VersionTestD_FIND_VERSION_MAJOR=${VersionTestD_FIND_VERSION_MAJOR} is not 1")
+endif(NOT "${VersionTestD_FIND_VERSION_MAJOR}" STREQUAL "1")
+if(NOT "${VersionTestD_FIND_VERSION_MINOR}" STREQUAL "2")
+  message(SEND_ERROR "VersionTestD_FIND_VERSION_MINOR=${VersionTestD_FIND_VERSION_MINOR} is not 2")
+endif(NOT "${VersionTestD_FIND_VERSION_MINOR}" STREQUAL "2")
+if(NOT "${VersionTestD_FIND_VERSION_PATCH}" STREQUAL "3")
+  message(SEND_ERROR "VersionTestD_FIND_VERSION_PATCH=${VersionTestD_FIND_VERSION_PATCH} is not 3")
+endif(NOT "${VersionTestD_FIND_VERSION_PATCH}" STREQUAL "3")
+if(NOT "${VersionTestD_FIND_VERSION_TWEAK}" STREQUAL "4")
+  message(SEND_ERROR "VersionTestD_FIND_VERSION_TWEAK=${VersionTestD_FIND_VERSION_TWEAK} is not 4")
+endif(NOT "${VersionTestD_FIND_VERSION_TWEAK}" STREQUAL "4")
+if(NOT "${VersionTestD_FIND_VERSION_COUNT}" STREQUAL "4")
+  message(SEND_ERROR "VersionTestD_FIND_VERSION_COUNT=${VersionTestD_FIND_VERSION_COUNT} is not 4")
+endif(NOT "${VersionTestD_FIND_VERSION_COUNT}" STREQUAL "4")
diff --git a/Tests/FindPackageTest/lib/TApp/TAppConfig.cmake b/Tests/FindPackageTest/lib/TApp/TAppConfig.cmake
index cbf06036e..5ba8d5585 100644
--- a/Tests/FindPackageTest/lib/TApp/TAppConfig.cmake
+++ b/Tests/FindPackageTest/lib/TApp/TAppConfig.cmake
@@ -1,2 +1,2 @@
 # Test config file that should not be found.
-MESSAGE("Package TApp found non-bundle first!")
+message("Package TApp found non-bundle first!")
diff --git a/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake
index 2f768e8f5..514e830f3 100644
--- a/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake
+++ b/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake
@@ -1,7 +1,7 @@
-SET(PACKAGE_VERSION 4.0)
-IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4)
-  SET(PACKAGE_VERSION_COMPATIBLE 1)
-  IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0)
-    SET(PACKAGE_VERSION_EXACT 1)
-  ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0)
-ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4)
+set(PACKAGE_VERSION 4.0)
+if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4)
+  set(PACKAGE_VERSION_COMPATIBLE 1)
+  if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0)
+    set(PACKAGE_VERSION_EXACT 1)
+  endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0)
+endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4)
diff --git a/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake b/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake
index 13763adf1..59fe59d3f 100644
--- a/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake
+++ b/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake
@@ -1,7 +1,7 @@
-SET(PACKAGE_VERSION 3.1)
-IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3)
-  SET(PACKAGE_VERSION_COMPATIBLE 1)
-  IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1)
-    SET(PACKAGE_VERSION_EXACT 1)
-  ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1)
-ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3)
+set(PACKAGE_VERSION 3.1)
+if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3)
+  set(PACKAGE_VERSION_COMPATIBLE 1)
+  if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1)
+    set(PACKAGE_VERSION_EXACT 1)
+  endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1)
+endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3)
diff --git a/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config-version.cmake b/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config-version.cmake
index bee2f0eea..e3e17de7c 100644
--- a/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config-version.cmake
+++ b/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config-version.cmake
@@ -1,4 +1,4 @@
 # Claim to be any version to test that CMAKE_IGNORE_PATH hides us.
-SET(PACKAGE_VERSION 3.1)
-SET(PACKAGE_VERSION_COMPATIBLE 1)
-SET(PACKAGE_VERSION_EXACT 1)
+set(PACKAGE_VERSION 3.1)
+set(PACKAGE_VERSION_COMPATIBLE 1)
+set(PACKAGE_VERSION_EXACT 1)
diff --git a/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake
index 606945f2d..7afcc9b8c 100644
--- a/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake
+++ b/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake
@@ -1,8 +1,8 @@
-SET(PACKAGE_VERSION 4.0)
-IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4)
-  SET(PACKAGE_VERSION_COMPATIBLE 1)
-  IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0)
-    SET(PACKAGE_VERSION_EXACT 1)
-  ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0)
-ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4)
+set(PACKAGE_VERSION 4.0)
+if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4)
+  set(PACKAGE_VERSION_COMPATIBLE 1)
+  if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0)
+    set(PACKAGE_VERSION_EXACT 1)
+  endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0)
+endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4)
 
diff --git a/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake b/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake
index 5c3bddece..4e8ee8284 100644
--- a/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake
+++ b/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake
@@ -1,7 +1,7 @@
-SET(PACKAGE_VERSION 1.2)
-IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1)
-  SET(PACKAGE_VERSION_COMPATIBLE 1)
-  IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2)
-    SET(PACKAGE_VERSION_EXACT 1)
-  ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2)
-ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1)
+set(PACKAGE_VERSION 1.2)
+if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1)
+  set(PACKAGE_VERSION_COMPATIBLE 1)
+  if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2)
+    set(PACKAGE_VERSION_EXACT 1)
+  endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2)
+endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1)
diff --git a/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake
index 10ac53d19..78e41a5fa 100644
--- a/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake
+++ b/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake
@@ -1,5 +1,5 @@
-SET(PACKAGE_VERSION 2.0)
-IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 2)
-  SET(PACKAGE_VERSION_COMPATIBLE 1)
-ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 2)
+set(PACKAGE_VERSION 2.0)
+if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 2)
+  set(PACKAGE_VERSION_COMPATIBLE 1)
+endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 2)
 
diff --git a/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake
index af57cfa5c..8e3daff25 100644
--- a/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake
+++ b/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake
@@ -1,5 +1,5 @@
-SET(PACKAGE_VERSION 3.0)
-IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3)
-  SET(PACKAGE_VERSION_COMPATIBLE 1)
-ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3)
+set(PACKAGE_VERSION 3.0)
+if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3)
+  set(PACKAGE_VERSION_COMPATIBLE 1)
+endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3)
 
diff --git a/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake
index b54d94ce6..b09c00883 100644
--- a/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake
+++ b/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake
@@ -1,8 +1,8 @@
-SET(PACKAGE_VERSION 3.1)
-IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3)
-  SET(PACKAGE_VERSION_COMPATIBLE 1)
-  IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1)
-    SET(PACKAGE_VERSION_EXACT 1)
-  ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1)
-ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3)
+set(PACKAGE_VERSION 3.1)
+if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3)
+  set(PACKAGE_VERSION_COMPATIBLE 1)
+  if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1)
+    set(PACKAGE_VERSION_EXACT 1)
+  endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1)
+endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3)
 
diff --git a/Tests/FindPackageTest/lib/zot/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot/zot-config-version.cmake
index 2a6be8640..5674f70d7 100644
--- a/Tests/FindPackageTest/lib/zot/zot-config-version.cmake
+++ b/Tests/FindPackageTest/lib/zot/zot-config-version.cmake
@@ -1,10 +1,10 @@
 # This version should never, ever be used.
-SET(PACKAGE_VERSION_UNSUITABLE 1)
-SET(PACKAGE_VERSION 3.1)
-IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3)
-  SET(PACKAGE_VERSION_COMPATIBLE 1)
-  IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1)
-    SET(PACKAGE_VERSION_EXACT 1)
-  ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1)
-ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3)
+set(PACKAGE_VERSION_UNSUITABLE 1)
+set(PACKAGE_VERSION 3.1)
+if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3)
+  set(PACKAGE_VERSION_COMPATIBLE 1)
+  if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1)
+    set(PACKAGE_VERSION_EXACT 1)
+  endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1)
+endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3)
 
diff --git a/Tests/FindPackageTest/lib/zot/zot-config.cmake b/Tests/FindPackageTest/lib/zot/zot-config.cmake
index 442b8a4ec..916818360 100644
--- a/Tests/FindPackageTest/lib/zot/zot-config.cmake
+++ b/Tests/FindPackageTest/lib/zot/zot-config.cmake
@@ -1,2 +1,2 @@
 # Test config file that is unsuitable.
-MESSAGE(FATAL_ERROR "Unsuitable version of zot was found")
+message(FATAL_ERROR "Unsuitable version of zot was found")
diff --git a/Tests/Fortran/Library/CMakeLists.txt b/Tests/Fortran/Library/CMakeLists.txt
index fe1368a07..6e39cda1f 100644
--- a/Tests/Fortran/Library/CMakeLists.txt
+++ b/Tests/Fortran/Library/CMakeLists.txt
@@ -1,11 +1,11 @@
-INCLUDE_DIRECTORIES(${Library_MODDIR})
-ADD_LIBRARY(subdir_mods a.f90 b.f90)
-ADD_EXECUTABLE(subdir_exe main.f90)
-TARGET_LINK_LIBRARIES(subdir_exe subdir_mods)
+include_directories(${Library_MODDIR})
+add_library(subdir_mods a.f90 b.f90)
+add_executable(subdir_exe main.f90)
+target_link_libraries(subdir_exe subdir_mods)
 
 # Test module output directory if available.
-IF(CMAKE_Fortran_MODDIR_FLAG)
-  SET_TARGET_PROPERTIES(subdir_mods PROPERTIES
+if(CMAKE_Fortran_MODDIR_FLAG)
+  set_target_properties(subdir_mods PROPERTIES
     Fortran_MODULE_DIRECTORY modules
     )
-ENDIF(CMAKE_Fortran_MODDIR_FLAG)
+endif(CMAKE_Fortran_MODDIR_FLAG)
diff --git a/Tests/FunctionTest/CMakeLists.txt b/Tests/FunctionTest/CMakeLists.txt
index 5d4f42d4a..204a8243c 100644
--- a/Tests/FunctionTest/CMakeLists.txt
+++ b/Tests/FunctionTest/CMakeLists.txt
@@ -1,46 +1,46 @@
 # a simple C only test case
 cmake_minimum_required (VERSION 2.6)
-PROJECT (FunctionTest)
+project (FunctionTest)
 
-FUNCTION(FAILED testname)
-  MESSAGE(SEND_ERROR "${testname} failed ${ARGN}")
-ENDFUNCTION(FAILED)
+function(FAILED testname)
+  message(SEND_ERROR "${testname} failed ${ARGN}")
+endfunction(FAILED)
 
-FUNCTION(PASS testname)
-  MESSAGE("${testname} passed ${ARGN}")
-ENDFUNCTION(PASS)
+function(PASS testname)
+  message("${testname} passed ${ARGN}")
+endfunction(PASS)
 
 
 # test scope
-SET(COUNT 3)
-FUNCTION(scope_test)
-  SET(COUNT 4)
-ENDFUNCTION(scope_test)
+set(COUNT 3)
+function(scope_test)
+  set(COUNT 4)
+endfunction(scope_test)
 scope_test()
-IF(COUNT EQUAL "3")
+if(COUNT EQUAL "3")
   PASS("scope")
-ELSE(COUNT EQUAL "3")
+else(COUNT EQUAL "3")
   FAILED("COUNT Got: ${COUNT}")
-ENDIF(COUNT EQUAL "3")
+endif(COUNT EQUAL "3")
 
 # test ARGC
-FUNCTION(weird_name)
-  IF("${ARGC}" EQUAL "3")
+function(weird_name)
+  if("${ARGC}" EQUAL "3")
     PASS("ARGC")
-  ELSE("${ARGC}" EQUAL "3")
+  else("${ARGC}" EQUAL "3")
     FAILED("ARGC" "Got: ${ARGC}")
-  ENDIF("${ARGC}" EQUAL "3")
-ENDFUNCTION(weird_name)
+  endif("${ARGC}" EQUAL "3")
+endfunction(weird_name)
 WeIrD_nAmE(a1 a2 a3)
 
 # test ARGN
-FUNCTION(test_argn_function argument)
-  IF("${ARGN}" EQUAL "3")
+function(test_argn_function argument)
+  if("${ARGN}" EQUAL "3")
     PASS("ARGN")
-  ELSE("${ARGN}" EQUAL "3")
+  else("${ARGN}" EQUAL "3")
     FAILED("ARGN" "Got: ${ARGN}")
-  ENDIF("${ARGN}" EQUAL "3")
-ENDFUNCTION(test_argn_function)
+  endif("${ARGN}" EQUAL "3")
+endfunction(test_argn_function)
 Test_Argn_Function(ignored 3)
 
 # test argument naming and raise scope
@@ -86,91 +86,91 @@ endif (fresult EQUAL 120)
 
 
 # case test
-FUNCTION(strange_function m)
-  SET("${m}" strange_function PARENT_SCOPE)
-ENDFUNCTION(strange_function m)
+function(strange_function m)
+  set("${m}" strange_function PARENT_SCOPE)
+endfunction(strange_function m)
 
 STRANGE_FUNCTION(var)
 set(second_var "second_var")
-IF("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var")
+if("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var")
   PASS("Case Test" "(${var} ${second_var})")
-ELSE("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var")
+else("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var")
   FAILED("Case test" "(${var} ${second_var})")
-ENDIF("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var")
+endif("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var")
 
 # test backing up command
-FUNCTION(ADD_EXECUTABLE exec)
+function(ADD_EXECUTABLE exec)
   _ADD_EXECUTABLE(mini${exec} ${ARGN})
-ENDFUNCTION(ADD_EXECUTABLE)
+endfunction(ADD_EXECUTABLE)
 
 # var undef case
-FUNCTION(undef_var m)
-  SET("${m}" PARENT_SCOPE)
-ENDFUNCTION(undef_var)
+function(undef_var m)
+  set("${m}" PARENT_SCOPE)
+endfunction(undef_var)
 
-SET(FUNCTION_UNDEFINED 1)
+set(FUNCTION_UNDEFINED 1)
 undef_var(FUNCTION_UNDEFINED)
-IF(DEFINED FUNCTION_UNDEFINED)
+if(DEFINED FUNCTION_UNDEFINED)
   FAILED("Function Undefine Test" "(${FUNCTION_UNDEFINED})")
-ELSE(DEFINED FUNCTION_UNDEFINED)
+else(DEFINED FUNCTION_UNDEFINED)
   PASS("Function Undefine Test" "(${FUNCTION_UNDEFINED})")
-ENDIF(DEFINED FUNCTION_UNDEFINED)
+endif(DEFINED FUNCTION_UNDEFINED)
 
 # Subdirectory scope raise.
-SET(SUBDIR_UNDEFINED 1)
-ADD_SUBDIRECTORY(SubDirScope)
-IF(DEFINED SUBDIR_UNDEFINED)
+set(SUBDIR_UNDEFINED 1)
+add_subdirectory(SubDirScope)
+if(DEFINED SUBDIR_UNDEFINED)
   FAILED("Subdir Undefine Test" "(${SUBDIR_UNDEFINED})")
-ELSE(DEFINED SUBDIR_UNDEFINED)
+else(DEFINED SUBDIR_UNDEFINED)
   PASS("Subdir Undefine Test" "(${SUBDIR_UNDEFINED})")
-ENDIF(DEFINED SUBDIR_UNDEFINED)
-IF(DEFINED SUBDIR_DEFINED)
+endif(DEFINED SUBDIR_UNDEFINED)
+if(DEFINED SUBDIR_DEFINED)
   PASS("Subdir Define Test" "(${SUBDIR_DEFINED})")
-ELSE(DEFINED SUBDIR_DEFINED)
+else(DEFINED SUBDIR_DEFINED)
   FAILED("Subdir Define Test" "(${SUBDIR_DEFINED})")
-ENDIF(DEFINED SUBDIR_DEFINED)
+endif(DEFINED SUBDIR_DEFINED)
 
 # Test function-scoped directory.
-FUNCTION(ADD_SUBDIR2 dir)
-  ADD_SUBDIRECTORY("${dir}" "${dir}2")
+function(ADD_SUBDIR2 dir)
+  add_subdirectory("${dir}" "${dir}2")
   # The parent scope sets in the subdir should be visible here.
-  IF(DEFINED SUBDIR_UNDEFINED)
+  if(DEFINED SUBDIR_UNDEFINED)
     FAILED("Subdir Function Undefine Test 1" "(${SUBDIR_UNDEFINED})")
-  ELSE(DEFINED SUBDIR_UNDEFINED)
+  else(DEFINED SUBDIR_UNDEFINED)
     PASS("Subdir Function Undefine Test 1" "(${SUBDIR_UNDEFINED})")
-  ENDIF(DEFINED SUBDIR_UNDEFINED)
-  IF(DEFINED SUBDIR_DEFINED)
+  endif(DEFINED SUBDIR_UNDEFINED)
+  if(DEFINED SUBDIR_DEFINED)
     PASS("Subdir Function Define Test 1" "(${SUBDIR_DEFINED})")
-  ELSE(DEFINED SUBDIR_DEFINED)
+  else(DEFINED SUBDIR_DEFINED)
     FAILED("Subdir Function Define Test 1" "(${SUBDIR_DEFINED})")
-  ENDIF(DEFINED SUBDIR_DEFINED)
-ENDFUNCTION(ADD_SUBDIR2)
+  endif(DEFINED SUBDIR_DEFINED)
+endfunction(ADD_SUBDIR2)
 
 # Reset test variables.
-SET(SUBDIR_UNDEFINED 1)
-SET(SUBDIR_DEFINED)
+set(SUBDIR_UNDEFINED 1)
+set(SUBDIR_DEFINED)
 
 # Run test function.
 ADD_SUBDIR2(SubDirScope)
 
 # The parent scope sets in the subdir should not be visible here.
-IF(DEFINED SUBDIR_UNDEFINED)
+if(DEFINED SUBDIR_UNDEFINED)
   PASS("Subdir Function Undefine Test 2" "(${SUBDIR_UNDEFINED})")
-ELSE(DEFINED SUBDIR_UNDEFINED)
+else(DEFINED SUBDIR_UNDEFINED)
   FAILED("Subdir Function Undefine Test 2" "(${SUBDIR_UNDEFINED})")
-ENDIF(DEFINED SUBDIR_UNDEFINED)
-IF(DEFINED SUBDIR_DEFINED)
+endif(DEFINED SUBDIR_UNDEFINED)
+if(DEFINED SUBDIR_DEFINED)
   FAILED("Subdir Function Define Test 2" "(${SUBDIR_DEFINED})")
-ELSE(DEFINED SUBDIR_DEFINED)
+else(DEFINED SUBDIR_DEFINED)
   PASS("Subdir Function Define Test 2" "(${SUBDIR_DEFINED})")
-ENDIF(DEFINED SUBDIR_DEFINED)
+endif(DEFINED SUBDIR_DEFINED)
 
-ADD_EXECUTABLE(FunctionTest functionTest.c)
+add_executable(FunctionTest functionTest.c)
 
 # Use the PROJECT_LABEL property: in IDEs, the project label should appear
 # in the UI rather than the target name. If this were a good test of the
 # property rather than just a smoke test, it would verify that the label
 # actually appears in the UI of the IDE... Or at least that the text appears
 # somewhere in the generated project files.
-SET_PROPERTY(TARGET miniFunctionTest
+set_property(TARGET miniFunctionTest
   PROPERTY PROJECT_LABEL "Test de Fonctionnement")
diff --git a/Tests/FunctionTest/SubDirScope/CMakeLists.txt b/Tests/FunctionTest/SubDirScope/CMakeLists.txt
index 4a53d2c0a..c40fadb72 100644
--- a/Tests/FunctionTest/SubDirScope/CMakeLists.txt
+++ b/Tests/FunctionTest/SubDirScope/CMakeLists.txt
@@ -1,14 +1,14 @@
-SET(SUBDIR_DEFINED 1 PARENT_SCOPE)
-SET(SUBDIR_UNDEFINED PARENT_SCOPE)
+set(SUBDIR_DEFINED 1 PARENT_SCOPE)
+set(SUBDIR_UNDEFINED PARENT_SCOPE)
 
 # The above sets should not affect the current scope.
-IF(DEFINED SUBDIR_UNDEFINED)
+if(DEFINED SUBDIR_UNDEFINED)
   PASS("SubdirScope Undefine Test" "(${SUBDIR_UNDEFINED})")
-ELSE(DEFINED SUBDIR_UNDEFINED)
+else(DEFINED SUBDIR_UNDEFINED)
   FAILED("SubdirScope Undefine Test" "(${SUBDIR_UNDEFINED})")
-ENDIF(DEFINED SUBDIR_UNDEFINED)
-IF(DEFINED SUBDIR_DEFINED)
+endif(DEFINED SUBDIR_UNDEFINED)
+if(DEFINED SUBDIR_DEFINED)
   FAILED("SubdirScope Define Test" "(${SUBDIR_DEFINED})")
-ELSE(DEFINED SUBDIR_DEFINED)
+else(DEFINED SUBDIR_DEFINED)
   PASS("SubdirScope Define Test" "(${SUBDIR_DEFINED})")
-ENDIF(DEFINED SUBDIR_DEFINED)
+endif(DEFINED SUBDIR_DEFINED)
diff --git a/Tests/IPO/CMakeLists.txt b/Tests/IPO/CMakeLists.txt
index 595e4f50d..6dabf86bb 100644
--- a/Tests/IPO/CMakeLists.txt
+++ b/Tests/IPO/CMakeLists.txt
@@ -1,7 +1,7 @@
 cmake_minimum_required (VERSION 2.8)
 project(IPO NONE)
 
-SET_PROPERTY(DIRECTORY PROPERTY INTERPROCEDURAL_OPTIMIZATION 1)
+set_property(DIRECTORY PROPERTY INTERPROCEDURAL_OPTIMIZATION 1)
 
 add_subdirectory(../COnly COnly)
 add_subdirectory(../CxxOnly CxxOnly)
diff --git a/Tests/Jump/CMakeLists.txt b/Tests/Jump/CMakeLists.txt
index 4bdafd09b..4c5ad303f 100644
--- a/Tests/Jump/CMakeLists.txt
+++ b/Tests/Jump/CMakeLists.txt
@@ -1,6 +1,6 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(Jump)
+project(Jump)
 
-SET(CMAKE_IGNORE_DEPENDENCIES_ORDERING 1)
-ADD_SUBDIRECTORY(Executable)
-ADD_SUBDIRECTORY(Library)
+set(CMAKE_IGNORE_DEPENDENCIES_ORDERING 1)
+add_subdirectory(Executable)
+add_subdirectory(Library)
diff --git a/Tests/Jump/Executable/CMakeLists.txt b/Tests/Jump/Executable/CMakeLists.txt
index 7658b7e31..a09bac739 100644
--- a/Tests/Jump/Executable/CMakeLists.txt
+++ b/Tests/Jump/Executable/CMakeLists.txt
@@ -1,6 +1,6 @@
-IF(NOT LIBRARY_OUTPUT_PATH)
-  LINK_DIRECTORIES(${Jump_BINARY_DIR}/Library/Static
+if(NOT LIBRARY_OUTPUT_PATH)
+  link_directories(${Jump_BINARY_DIR}/Library/Static
                    ${Jump_BINARY_DIR}/Library/Shared)
-ENDIF(NOT LIBRARY_OUTPUT_PATH)
-ADD_EXECUTABLE(jumpExecutable jumpExecutable.cxx)
-TARGET_LINK_LIBRARIES(jumpExecutable jumpStatic jumpShared)
+endif(NOT LIBRARY_OUTPUT_PATH)
+add_executable(jumpExecutable jumpExecutable.cxx)
+target_link_libraries(jumpExecutable jumpStatic jumpShared)
diff --git a/Tests/Jump/Library/CMakeLists.txt b/Tests/Jump/Library/CMakeLists.txt
index 2f78c501c..1d9fed934 100644
--- a/Tests/Jump/Library/CMakeLists.txt
+++ b/Tests/Jump/Library/CMakeLists.txt
@@ -1,2 +1,2 @@
-ADD_SUBDIRECTORY(Static)
-ADD_SUBDIRECTORY(Shared)
+add_subdirectory(Static)
+add_subdirectory(Shared)
diff --git a/Tests/Jump/Library/Shared/CMakeLists.txt b/Tests/Jump/Library/Shared/CMakeLists.txt
index 44405770f..87d40e54d 100644
--- a/Tests/Jump/Library/Shared/CMakeLists.txt
+++ b/Tests/Jump/Library/Shared/CMakeLists.txt
@@ -1,26 +1,26 @@
-ADD_LIBRARY(jumpShared SHARED jumpShared.cxx)
+add_library(jumpShared SHARED jumpShared.cxx)
 
-IF(WIN32 OR CYGWIN)
-  SET(SHARED_MUST_BE_IN_EXE_DIR 1)
-ENDIF()
+if(WIN32 OR CYGWIN)
+  set(SHARED_MUST_BE_IN_EXE_DIR 1)
+endif()
 
-IF(APPLE)
-  SET(SHARED_MUST_BE_IN_EXE_DIR 1)
-ENDIF(APPLE)
+if(APPLE)
+  set(SHARED_MUST_BE_IN_EXE_DIR 1)
+endif(APPLE)
 
-IF(SHARED_MUST_BE_IN_EXE_DIR)
-  SET(LIB_NAME
+if(SHARED_MUST_BE_IN_EXE_DIR)
+  set(LIB_NAME
     ${CMAKE_SHARED_LIBRARY_PREFIX}jumpShared${CMAKE_SHARED_LIBRARY_SUFFIX})
-  SET(EXE_DIR ${Jump_BINARY_DIR}/Executable)
-  IF(EXECUTABLE_OUTPUT_PATH)
-    SET(EXE_DIR ${EXECUTABLE_OUTPUT_PATH})
-  ENDIF(EXECUTABLE_OUTPUT_PATH)
-  SET(LIB_DIR ${Jump_BINARY_DIR}/Library/Shared)
-  IF(LIBRARY_OUTPUT_PATH)
-    SET(LIB_DIR ${LIBRARY_OUTPUT_PATH})
-  ENDIF(LIBRARY_OUTPUT_PATH)
-  ADD_CUSTOM_COMMAND(TARGET jumpShared
+  set(EXE_DIR ${Jump_BINARY_DIR}/Executable)
+  if(EXECUTABLE_OUTPUT_PATH)
+    set(EXE_DIR ${EXECUTABLE_OUTPUT_PATH})
+  endif(EXECUTABLE_OUTPUT_PATH)
+  set(LIB_DIR ${Jump_BINARY_DIR}/Library/Shared)
+  if(LIBRARY_OUTPUT_PATH)
+    set(LIB_DIR ${LIBRARY_OUTPUT_PATH})
+  endif(LIBRARY_OUTPUT_PATH)
+  add_custom_command(TARGET jumpShared
     POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy
     ${LIB_DIR}/${CMAKE_CFG_INTDIR}/${LIB_NAME}
     ${EXE_DIR}/${CMAKE_CFG_INTDIR}/${LIB_NAME})
-ENDIF(SHARED_MUST_BE_IN_EXE_DIR)
+endif(SHARED_MUST_BE_IN_EXE_DIR)
diff --git a/Tests/Jump/Library/Static/CMakeLists.txt b/Tests/Jump/Library/Static/CMakeLists.txt
index 23e70c0b1..4ee39545a 100644
--- a/Tests/Jump/Library/Static/CMakeLists.txt
+++ b/Tests/Jump/Library/Static/CMakeLists.txt
@@ -1 +1 @@
-ADD_LIBRARY(jumpStatic STATIC jumpStatic.cxx)
+add_library(jumpStatic STATIC jumpStatic.cxx)
diff --git a/Tests/LibName/CMakeLists.txt b/Tests/LibName/CMakeLists.txt
index 75dec4eb3..b3ad31114 100644
--- a/Tests/LibName/CMakeLists.txt
+++ b/Tests/LibName/CMakeLists.txt
@@ -11,9 +11,9 @@ target_link_libraries(foo bar)
 
 add_executable(foobar foobar.c)
 target_link_libraries(foobar foo)
-IF(UNIX)
+if(UNIX)
   target_link_libraries(foobar -L/usr/local/lib)
-ENDIF(UNIX)
+endif(UNIX)
 
 
 # check with lib version
diff --git a/Tests/LinkLine/CMakeLists.txt b/Tests/LinkLine/CMakeLists.txt
index c8f0ecf63..6154dd469 100644
--- a/Tests/LinkLine/CMakeLists.txt
+++ b/Tests/LinkLine/CMakeLists.txt
@@ -1,12 +1,12 @@
-PROJECT( LinkLine )
+project( LinkLine )
 
 # Makes sure that the library order as specified by the user are
 # unchanged by dependency analysis, etc.  libOne and libTwo are
 # dependent on each other. The link line should be -lOne -lTwo -lOne.
 
-ADD_LIBRARY( One One.c )
-ADD_LIBRARY( Two Two.c )
+add_library( One One.c )
+add_library( Two Two.c )
 
-LINK_LIBRARIES( One Two )
-ADD_EXECUTABLE( LinkLine Exec.c )
-LINK_LIBRARIES( One )
+link_libraries( One Two )
+add_executable( LinkLine Exec.c )
+link_libraries( One )
diff --git a/Tests/LinkLineOrder/CMakeLists.txt b/Tests/LinkLineOrder/CMakeLists.txt
index 21a502217..78455e971 100644
--- a/Tests/LinkLineOrder/CMakeLists.txt
+++ b/Tests/LinkLineOrder/CMakeLists.txt
@@ -1,4 +1,4 @@
-PROJECT( LinkLineOrder )
+project( LinkLineOrder )
 
 # This tests ensures that the order of libraries are preserved when
 # they don't have dependency information, even if they are deep in the
@@ -9,28 +9,28 @@ PROJECT( LinkLineOrder )
 # has no information about these libraries except for the order they
 # are specified in One. We must make sure we don't lose that.
 
-ADD_LIBRARY( NoDepA NoDepA.c )
-ADD_LIBRARY( NoDepB NoDepB.c )
-ADD_LIBRARY( NoDepC NoDepC.c )
-ADD_LIBRARY( NoDepE NoDepE.c )
-ADD_LIBRARY( NoDepF NoDepF.c )
+add_library( NoDepA NoDepA.c )
+add_library( NoDepB NoDepB.c )
+add_library( NoDepC NoDepC.c )
+add_library( NoDepE NoDepE.c )
+add_library( NoDepF NoDepF.c )
 
-ADD_LIBRARY( One One.c )
-TARGET_LINK_LIBRARIES( One NoDepC NoDepA NoDepB NoDepE NoDepF NoDepE )
+add_library( One One.c )
+target_link_libraries( One NoDepC NoDepA NoDepB NoDepE NoDepF NoDepE )
 
-ADD_EXECUTABLE( Exec1 Exec1.c )
-TARGET_LINK_LIBRARIES( Exec1 One )
+add_executable( Exec1 Exec1.c )
+target_link_libraries( Exec1 One )
 
 
 # Similar situation as One, except at a different level of the
 # dependency tree. This makes sure that the order is presevered
 # everywhere in the graph.
-ADD_LIBRARY( NoDepX NoDepX.c )
-ADD_LIBRARY( NoDepY NoDepY.c )
-ADD_LIBRARY( NoDepZ NoDepZ.c )
+add_library( NoDepX NoDepX.c )
+add_library( NoDepY NoDepY.c )
+add_library( NoDepZ NoDepZ.c )
 
-ADD_LIBRARY( Two Two.c )
-TARGET_LINK_LIBRARIES( Two One NoDepZ NoDepX NoDepY )
+add_library( Two Two.c )
+target_link_libraries( Two One NoDepZ NoDepX NoDepY )
 
-ADD_EXECUTABLE( Exec2 Exec2.c )
-TARGET_LINK_LIBRARIES( Exec2 Two )
+add_executable( Exec2 Exec2.c )
+target_link_libraries( Exec2 Two )
diff --git a/Tests/LoadCommand/CMakeCommands/CMakeLists.txt b/Tests/LoadCommand/CMakeCommands/CMakeLists.txt
index 5cdbc59bf..276fdb681 100644
--- a/Tests/LoadCommand/CMakeCommands/CMakeLists.txt
+++ b/Tests/LoadCommand/CMakeCommands/CMakeLists.txt
@@ -1,14 +1,14 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(CMAKE_LOADED_COMMANDS)
+project(CMAKE_LOADED_COMMANDS)
 
-IF (MUDSLIDE_TYPE MATCHES MUCHO)
-  ADD_DEFINITIONS(-DMUCHO_MUDSLIDE)
-ENDIF (MUDSLIDE_TYPE MATCHES MUCHO)
+if (MUDSLIDE_TYPE MATCHES MUCHO)
+  add_definitions(-DMUCHO_MUDSLIDE)
+endif (MUDSLIDE_TYPE MATCHES MUCHO)
 
-INCLUDE_DIRECTORIES(${CMAKE_ROOT}/include ${CMAKE_ROOT}/Source)
+include_directories(${CMAKE_ROOT}/include ${CMAKE_ROOT}/Source)
 
-ADD_LIBRARY(cmCMAKE_TEST_COMMAND MODULE cmTestCommand.c)
+add_library(cmCMAKE_TEST_COMMAND MODULE cmTestCommand.c)
 
-IF(WATCOM)
-  TARGET_LINK_LIBRARIES(cmCMAKE_TEST_COMMAND clbsdll.lib)
-ENDIF(WATCOM)
+if(WATCOM)
+  target_link_libraries(cmCMAKE_TEST_COMMAND clbsdll.lib)
+endif(WATCOM)
diff --git a/Tests/LoadCommand/CMakeLists.txt b/Tests/LoadCommand/CMakeLists.txt
index 32e73f00c..9787f83ad 100644
--- a/Tests/LoadCommand/CMakeLists.txt
+++ b/Tests/LoadCommand/CMakeLists.txt
@@ -1,63 +1,63 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(LoadCommand)
+project(LoadCommand)
 
 # set a definition
-SET (TEST_COMMAND_TEST1 1)
+set (TEST_COMMAND_TEST1 1)
 
-INCLUDE (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake)
+include (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake)
 CHECK_TYPE_SIZE(char  SIZEOF_CHAR)
 CHECK_TYPE_SIZE(short  SIZEOF_SHORT)
 
-INCLUDE (CheckFunctionExists)
+include (CheckFunctionExists)
 CHECK_FUNCTION_EXISTS(printf        HAVE_PRINTF)
 CHECK_FUNCTION_EXISTS(vsblabla      HAVE_VSBLABLA)
 
-CONFIGURE_FILE(${LoadCommand_SOURCE_DIR}/LoadedCommand.h.in
+configure_file(${LoadCommand_SOURCE_DIR}/LoadedCommand.h.in
                ${LoadCommand_BINARY_DIR}/LoadedCommand.h)
 
-INCLUDE_DIRECTORIES(${LoadCommand_BINARY_DIR})
+include_directories(${LoadCommand_BINARY_DIR})
 
 # try to compile the command
 # make sure it is not already loaded
-IF(COMMAND CMAKE_TEST_COMMAND)
-ELSE(COMMAND CMAKE_TEST_COMMAND)
-  TRY_COMPILE(COMPILE_OK
+if(COMMAND CMAKE_TEST_COMMAND)
+else(COMMAND CMAKE_TEST_COMMAND)
+  try_compile(COMPILE_OK
     ${LoadCommand_BINARY_DIR}/CMakeCommands
     ${LoadCommand_SOURCE_DIR}/CMakeCommands
     CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO
     OUTPUT_VARIABLE OUTPUT )
 # do another TRY_COMPILE to get around make
 # problem on hp
-  TRY_COMPILE(COMPILE_OK
+  try_compile(COMPILE_OK
     ${LoadCommand_BINARY_DIR}/CMakeCommands
     ${LoadCommand_SOURCE_DIR}/CMakeCommands
     CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO
     OUTPUT_VARIABLE OUTPUT )
-ENDIF(COMMAND CMAKE_TEST_COMMAND)
+endif(COMMAND CMAKE_TEST_COMMAND)
 
-MESSAGE("Output from try compile: ${OUTPUT}")
+message("Output from try compile: ${OUTPUT}")
 
 # if the compile was OK, try loading the command
-IF (COMPILE_OK)
-  LOAD_COMMAND(CMAKE_TEST_COMMAND
+if (COMPILE_OK)
+  load_command(CMAKE_TEST_COMMAND
     ${LoadCommand_BINARY_DIR}/CMakeCommands
     ${LoadCommand_BINARY_DIR}/CMakeCommands/Debug
     ${LoadCommand_BINARY_DIR}/CMakeCommands/Development
     )
   # if the command loaded, execute the command
-  IF (COMMAND CMAKE_TEST_COMMAND)
+  if (COMMAND CMAKE_TEST_COMMAND)
     CMAKE_TEST_COMMAND(
       "${LoadCommand_SOURCE_DIR}/LoadedCommand.cxx.in"
       "${LoadCommand_BINARY_DIR}/LoadedCommand2.cxx.in"
       "${LoadCommand_BINARY_DIR}/LoadedCommand3.cxx"
       )
-  ENDIF (COMMAND CMAKE_TEST_COMMAND)
-ELSE (COMPILE_OK)
-  MESSAGE("failed to compile CMAKE_LOADED_COMMANDS")
-ENDIF (COMPILE_OK)
+  endif (COMMAND CMAKE_TEST_COMMAND)
+else (COMPILE_OK)
+  message("failed to compile CMAKE_LOADED_COMMANDS")
+endif (COMPILE_OK)
 
 # TEST_DEF is set by the loaded command cmTestCommand.c
-IF (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC)
-  ADD_DEFINITIONS(-DCMAKE_IS_FUN)
-ENDIF (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC)
+if (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC)
+  add_definitions(-DCMAKE_IS_FUN)
+endif (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC)
 
diff --git a/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt b/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt
index 953d05c99..2d96b0413 100644
--- a/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt
+++ b/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt
@@ -1,17 +1,17 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(CMAKE_LOADED_COMMANDS)
+project(CMAKE_LOADED_COMMANDS)
 
-IF (MUDSLIDE_TYPE MATCHES MUCHO)
-  ADD_DEFINITIONS(-DMUCHO_MUDSLIDE)
-ENDIF (MUDSLIDE_TYPE MATCHES MUCHO)
+if (MUDSLIDE_TYPE MATCHES MUCHO)
+  add_definitions(-DMUCHO_MUDSLIDE)
+endif (MUDSLIDE_TYPE MATCHES MUCHO)
 
-IF(WATCOM)
-  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
-ENDIF(WATCOM)
-INCLUDE_DIRECTORIES(${CMAKE_ROOT}/include ${CMAKE_ROOT}/Source)
+if(WATCOM)
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
+endif(WATCOM)
+include_directories(${CMAKE_ROOT}/include ${CMAKE_ROOT}/Source)
 
-ADD_LIBRARY(cmCMAKE_TEST_COMMAND MODULE cmTestCommand.c)
+add_library(cmCMAKE_TEST_COMMAND MODULE cmTestCommand.c)
 
-IF(WATCOM)
-  TARGET_LINK_LIBRARIES(cmCMAKE_TEST_COMMAND clbsdll.lib)
-ENDIF(WATCOM)
+if(WATCOM)
+  target_link_libraries(cmCMAKE_TEST_COMMAND clbsdll.lib)
+endif(WATCOM)
diff --git a/Tests/LoadCommandOneConfig/CMakeLists.txt b/Tests/LoadCommandOneConfig/CMakeLists.txt
index 4bfa59964..a443605f2 100644
--- a/Tests/LoadCommandOneConfig/CMakeLists.txt
+++ b/Tests/LoadCommandOneConfig/CMakeLists.txt
@@ -1,69 +1,69 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(LoadCommand)
+project(LoadCommand)
 
 # set a definition
-SET (TEST_COMMAND_TEST1 1)
+set (TEST_COMMAND_TEST1 1)
 
-INCLUDE (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake)
+include (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake)
 CHECK_TYPE_SIZE(char  SIZEOF_CHAR)
 CHECK_TYPE_SIZE(short  SIZEOF_SHORT)
 
-INCLUDE (CheckFunctionExists)
+include (CheckFunctionExists)
 CHECK_FUNCTION_EXISTS(printf        HAVE_PRINTF)
 CHECK_FUNCTION_EXISTS(vsblabla      HAVE_VSBLABLA)
 
-INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
+include (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
 CHECK_INCLUDE_FILE("sys/prctl.h"    HAVE_SYS_PRCTL_H)
 
-INCLUDE (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake)
+include (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake)
 CHECK_LIBRARY_EXISTS(m ceil "" HAVE_LIBM)
 
-CONFIGURE_FILE(${LoadCommand_SOURCE_DIR}/LoadedCommand.h.in
+configure_file(${LoadCommand_SOURCE_DIR}/LoadedCommand.h.in
                ${LoadCommand_BINARY_DIR}/LoadedCommand.h)
 
-INCLUDE_DIRECTORIES(${LoadCommand_BINARY_DIR})
+include_directories(${LoadCommand_BINARY_DIR})
 
 # try to compile the command
 # make sure it is not already loaded
-IF(COMMAND CMAKE_TEST_COMMAND)
-ELSE(COMMAND CMAKE_TEST_COMMAND)
-  TRY_COMPILE(COMPILE_OK
+if(COMMAND CMAKE_TEST_COMMAND)
+else(COMMAND CMAKE_TEST_COMMAND)
+  try_compile(COMPILE_OK
     ${LoadCommand_BINARY_DIR}/CMakeCommands
     ${LoadCommand_SOURCE_DIR}/CMakeCommands
     CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO
     OUTPUT_VARIABLE OUTPUT )
 # do another TRY_COMPILE to get around make
 # problem on hp
-  TRY_COMPILE(COMPILE_OK
+  try_compile(COMPILE_OK
     ${LoadCommand_BINARY_DIR}/CMakeCommands
     ${LoadCommand_SOURCE_DIR}/CMakeCommands
     CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO
     OUTPUT_VARIABLE OUTPUT )
-ENDIF(COMMAND CMAKE_TEST_COMMAND)
+endif(COMMAND CMAKE_TEST_COMMAND)
 
-MESSAGE("Output from try compile: ${OUTPUT}")
+message("Output from try compile: ${OUTPUT}")
 
 # if the compile was OK, try loading the command
-IF (COMPILE_OK)
-  LOAD_COMMAND(CMAKE_TEST_COMMAND
+if (COMPILE_OK)
+  load_command(CMAKE_TEST_COMMAND
     ${LoadCommand_BINARY_DIR}/CMakeCommands
     ${LoadCommand_BINARY_DIR}/CMakeCommands/Debug
     ${LoadCommand_BINARY_DIR}/CMakeCommands/Development
     )
   # if the command loaded, execute the command
-  IF (COMMAND CMAKE_TEST_COMMAND)
+  if (COMMAND CMAKE_TEST_COMMAND)
     CMAKE_TEST_COMMAND(
       "${LoadCommand_SOURCE_DIR}/LoadedCommand.cxx.in"
       "${LoadCommand_BINARY_DIR}/LoadedCommand2.cxx.in"
       "${LoadCommand_BINARY_DIR}/LoadedCommand3.cxx"
       )
-  ENDIF (COMMAND CMAKE_TEST_COMMAND)
-ELSE (COMPILE_OK)
-  MESSAGE("failed to compile CMAKE_LOADED_COMMANDS")
-ENDIF (COMPILE_OK)
+  endif (COMMAND CMAKE_TEST_COMMAND)
+else (COMPILE_OK)
+  message("failed to compile CMAKE_LOADED_COMMANDS")
+endif (COMPILE_OK)
 
 # TEST_DEF is set by the loaded command cmTestCommand.c
-IF (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC)
-  ADD_DEFINITIONS(-DCMAKE_IS_FUN)
-ENDIF (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC)
+if (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC)
+  add_definitions(-DCMAKE_IS_FUN)
+endif (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC)
 
diff --git a/Tests/MacroTest/CMakeLists.txt b/Tests/MacroTest/CMakeLists.txt
index ef673fd85..9d189b92a 100644
--- a/Tests/MacroTest/CMakeLists.txt
+++ b/Tests/MacroTest/CMakeLists.txt
@@ -1,53 +1,53 @@
 # a simple C only test case
 cmake_minimum_required (VERSION 2.6)
-PROJECT (MacroTest)
+project (MacroTest)
 
-MACRO(FAILED testname)
-  MESSAGE(SEND_ERROR "${testname} failed ${ARGN}")
-ENDMACRO(FAILED)
+macro(FAILED testname)
+  message(SEND_ERROR "${testname} failed ${ARGN}")
+endmacro(FAILED)
 
-MACRO(PASS testname)
-  MESSAGE("${testname} passed ${ARGN}")
-ENDMACRO(PASS)
+macro(PASS testname)
+  message("${testname} passed ${ARGN}")
+endmacro(PASS)
 
 # test ARGC
-MACRO(weird_name)
-  IF("${ARGC}" EQUAL "3")
+macro(weird_name)
+  if("${ARGC}" EQUAL "3")
     PASS("ARGC")
-  ELSE("${ARGC}" EQUAL "3")
+  else("${ARGC}" EQUAL "3")
     FAILED("ARGC" "Got: ${ARGC}")
-  ENDIF("${ARGC}" EQUAL "3")
-ENDMACRO(weird_name)
+  endif("${ARGC}" EQUAL "3")
+endmacro(weird_name)
 WeIrD_nAmE(a1 a2 a3)
 
 # test ARGN
-MACRO(test_argn_macro argument)
-  IF("${ARGN}" EQUAL "3")
+macro(test_argn_macro argument)
+  if("${ARGN}" EQUAL "3")
     PASS("ARGN")
-  ELSE("${ARGN}" EQUAL "3")
+  else("${ARGN}" EQUAL "3")
     FAILED("ARGN" "Got: ${ARGN}")
-  ENDIF("${ARGN}" EQUAL "3")
-ENDMACRO(test_argn_macro)
+  endif("${ARGN}" EQUAL "3")
+endmacro(test_argn_macro)
 Test_Argn_Macro(ignored 3)
 
 # case test
-MACRO(strange_macro m)
-  SET("${m}" strange_macro)
-ENDMACRO(strange_macro m)
+macro(strange_macro m)
+  set("${m}" strange_macro)
+endmacro(strange_macro m)
 STRANGE_MACRO(var)
 set(second_var "second_var")
-IF("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var")
+if("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var")
   PASS("Case Test" "(${var} ${second_var})")
-ELSE("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var")
+else("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var")
   FAILED("Case test" "(${var} ${second_var})")
-ENDIF("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var")
+endif("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var")
 
 # test backing up command
-MACRO(ADD_EXECUTABLE exec)
+macro(ADD_EXECUTABLE exec)
   _ADD_EXECUTABLE("mini${exec}" ${ARGN})
-ENDMACRO(ADD_EXECUTABLE)
+endmacro(ADD_EXECUTABLE)
 
-INCLUDE(CheckCSourceCompiles)
+include(CheckCSourceCompiles)
 Check_C_Source_Compiles(
 "
 #include <stdio.h>
@@ -62,13 +62,13 @@ int main(int ac, char*av[]){
   return 0;
 }"
 SOME_CHECK)
-IF(SOME_CHECK)
-  MESSAGE("CheckCSourceCompiles works")
-ELSE(SOME_CHECK)
-  MESSAGE(FATAL_ERROR "CheckCSourceCompiles does not work")
-ENDIF(SOME_CHECK)
+if(SOME_CHECK)
+  message("CheckCSourceCompiles works")
+else(SOME_CHECK)
+  message(FATAL_ERROR "CheckCSourceCompiles does not work")
+endif(SOME_CHECK)
 
-INCLUDE(CheckCXXSourceCompiles)
+include(CheckCXXSourceCompiles)
 Check_CXX_Source_Compiles(
 "
 #include <stdio.h>
@@ -77,15 +77,15 @@ int main(int ac, char*av[]){
   return 0;
 }"
 SOME_CHECK)
-IF(SOME_CHECK)
-  MESSAGE("CheckCXXSourceCompiles works")
-ELSE(SOME_CHECK)
-  MESSAGE(FATAL_ERROR "CheckCXXSourceCompiles does not work")
-ENDIF(SOME_CHECK)
+if(SOME_CHECK)
+  message("CheckCXXSourceCompiles works")
+else(SOME_CHECK)
+  message(FATAL_ERROR "CheckCXXSourceCompiles does not work")
+endif(SOME_CHECK)
 
-ADD_EXECUTABLE(MacroTest macroTest.c)
+add_executable(MacroTest macroTest.c)
 
-MACRO(GET_CURRENT_FILE var)
-  SET(${var} ${CMAKE_CURRENT_LIST_FILE})
-ENDMACRO(GET_CURRENT_FILE)
-INCLUDE(context.cmake)
+macro(GET_CURRENT_FILE var)
+  set(${var} ${CMAKE_CURRENT_LIST_FILE})
+endmacro(GET_CURRENT_FILE)
+include(context.cmake)
diff --git a/Tests/MacroTest/context.cmake b/Tests/MacroTest/context.cmake
index f4d7035fb..82eb4856b 100644
--- a/Tests/MacroTest/context.cmake
+++ b/Tests/MacroTest/context.cmake
@@ -1,10 +1,10 @@
 GET_CURRENT_FILE(current_file)
-IF(NOT "${current_file}" STREQUAL "${CMAKE_CURRENT_LIST_FILE}")
-  MESSAGE(FATAL_ERROR
+if(NOT "${current_file}" STREQUAL "${CMAKE_CURRENT_LIST_FILE}")
+  message(FATAL_ERROR
     "Macro file context is broken.  Expected:\n"
     "  ${CMAKE_CURRENT_LIST_FILE}\n"
     "but got:\n"
     "  ${current_file}\n"
     "from the macro."
     )
-ENDIF(NOT "${current_file}" STREQUAL "${CMAKE_CURRENT_LIST_FILE}")
+endif(NOT "${current_file}" STREQUAL "${CMAKE_CURRENT_LIST_FILE}")
diff --git a/Tests/MakeClean/CMakeLists.txt b/Tests/MakeClean/CMakeLists.txt
index 97d3554bd..74007542c 100644
--- a/Tests/MakeClean/CMakeLists.txt
+++ b/Tests/MakeClean/CMakeLists.txt
@@ -1,47 +1,47 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(MakeClean)
+project(MakeClean)
 
 # Build the to-clean project.
-TRY_COMPILE(TOCLEAN_BUILT
+try_compile(TOCLEAN_BUILT
   ${MakeClean_BINARY_DIR}/ToClean
   ${MakeClean_SOURCE_DIR}/ToClean
   ToClean
   OUTPUT_VARIABLE OUTPUT
   )
-IF(TOCLEAN_BUILT)
-  MESSAGE(
+if(TOCLEAN_BUILT)
+  message(
     "Building ToClean succeeded with the following output:\n"
     "[${OUTPUT}]"
     )
-ELSE(TOCLEAN_BUILT)
-  MESSAGE(FATAL_ERROR
+else(TOCLEAN_BUILT)
+  message(FATAL_ERROR
     "Building ToClean failed with the following output:\n"
     "[${OUTPUT}]"
     )
-ENDIF(TOCLEAN_BUILT)
+endif(TOCLEAN_BUILT)
 
 # Get the set of files to check from the ToClean project.
-INCLUDE(${MakeClean_BINARY_DIR}/ToClean/ToCleanFiles.cmake)
+include(${MakeClean_BINARY_DIR}/ToClean/ToCleanFiles.cmake)
 
 # Check for the existence of the files.
-FOREACH(f ${TOCLEAN_FILES})
-  IF(EXISTS "${f}")
-  ELSE(EXISTS "${f}")
-    MESSAGE(FATAL_ERROR "File \"${f}\" does not exist!")
-  ENDIF(EXISTS "${f}")
-ENDFOREACH(f)
+foreach(f ${TOCLEAN_FILES})
+  if(EXISTS "${f}")
+  else(EXISTS "${f}")
+    message(FATAL_ERROR "File \"${f}\" does not exist!")
+  endif(EXISTS "${f}")
+endforeach(f)
 
 # Configure an executable to check that all the files are missing.
-SET(CHECK_FILES)
-FOREACH(f ${TOCLEAN_FILES})
-  SET(CHECK_FILES "${CHECK_FILES}      \"${f}\",\n")
-ENDFOREACH(f)
-CONFIGURE_FILE(${MakeClean_SOURCE_DIR}/check_clean.c.in
+set(CHECK_FILES)
+foreach(f ${TOCLEAN_FILES})
+  set(CHECK_FILES "${CHECK_FILES}      \"${f}\",\n")
+endforeach(f)
+configure_file(${MakeClean_SOURCE_DIR}/check_clean.c.in
                ${MakeClean_BINARY_DIR}/check_clean.c @ONLY IMMEDIATE)
-ADD_EXECUTABLE(check_clean ${MakeClean_BINARY_DIR}/check_clean.c)
+add_executable(check_clean ${MakeClean_BINARY_DIR}/check_clean.c)
 
 # After the executable builds, clean the files.
-ADD_CUSTOM_COMMAND(
+add_custom_command(
   TARGET check_clean
   POST_BUILD
   COMMAND ${CMAKE_CTEST_COMMAND}
diff --git a/Tests/MakeClean/ToClean/CMakeLists.txt b/Tests/MakeClean/ToClean/CMakeLists.txt
index 50facadb7..28569dd1d 100644
--- a/Tests/MakeClean/ToClean/CMakeLists.txt
+++ b/Tests/MakeClean/ToClean/CMakeLists.txt
@@ -1,31 +1,31 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(ToClean)
+cmake_minimum_required(VERSION 2.6)
+project(ToClean)
 
 # Build a simple project.
-ADD_EXECUTABLE(toclean toclean.cxx)
+add_executable(toclean toclean.cxx)
 
 # List some build-time-generated files.
-GET_TARGET_PROPERTY(TOCLEAN_FILES toclean LOCATION)
-SET(TOCLEAN_FILES ${TOCLEAN_FILES}
+get_target_property(TOCLEAN_FILES toclean LOCATION)
+set(TOCLEAN_FILES ${TOCLEAN_FILES}
   "${ToClean_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/toclean.dir/toclean.cxx${CMAKE_CXX_OUTPUT_EXTENSION}")
 
 # Create a file that must be registered for cleaning.
-FILE(WRITE "${ToClean_BINARY_DIR}/Registered.txt"
+file(WRITE "${ToClean_BINARY_DIR}/Registered.txt"
   "File registered for cleaning.\n")
-SET_DIRECTORY_PROPERTIES(PROPERTIES
+set_directory_properties(PROPERTIES
   ADDITIONAL_MAKE_CLEAN_FILES "${ToClean_BINARY_DIR}/Registered.txt")
-SET(TOCLEAN_FILES ${TOCLEAN_FILES} "${ToClean_BINARY_DIR}/Registered.txt")
+set(TOCLEAN_FILES ${TOCLEAN_FILES} "${ToClean_BINARY_DIR}/Registered.txt")
 
 # Create a custom command whose output should be cleaned.
-ADD_CUSTOM_COMMAND(OUTPUT ${ToClean_BINARY_DIR}/generated.txt
+add_custom_command(OUTPUT ${ToClean_BINARY_DIR}/generated.txt
   DEPENDS ${ToClean_SOURCE_DIR}/toclean.cxx
   COMMAND ${CMAKE_COMMAND}
   ARGS -E copy ${ToClean_SOURCE_DIR}/toclean.cxx
                ${ToClean_BINARY_DIR}/generated.txt
   )
-ADD_CUSTOM_TARGET(generate ALL DEPENDS ${ToClean_BINARY_DIR}/generated.txt)
-SET(TOCLEAN_FILES ${TOCLEAN_FILES} "${ToClean_BINARY_DIR}/generated.txt")
+add_custom_target(generate ALL DEPENDS ${ToClean_BINARY_DIR}/generated.txt)
+set(TOCLEAN_FILES ${TOCLEAN_FILES} "${ToClean_BINARY_DIR}/generated.txt")
 
 # Configure a file listing these build-time-generated files.
-CONFIGURE_FILE(${ToClean_SOURCE_DIR}/ToCleanFiles.cmake.in
+configure_file(${ToClean_SOURCE_DIR}/ToCleanFiles.cmake.in
                ${ToClean_BINARY_DIR}/ToCleanFiles.cmake @ONLY IMMEDIATE)
diff --git a/Tests/MakeClean/ToClean/ToCleanFiles.cmake.in b/Tests/MakeClean/ToClean/ToCleanFiles.cmake.in
index 10d11c37a..e7d99470c 100644
--- a/Tests/MakeClean/ToClean/ToCleanFiles.cmake.in
+++ b/Tests/MakeClean/ToClean/ToCleanFiles.cmake.in
@@ -1 +1 @@
-SET(TOCLEAN_FILES "@TOCLEAN_FILES@")
+set(TOCLEAN_FILES "@TOCLEAN_FILES@")
diff --git a/Tests/MathTest/CMakeLists.txt b/Tests/MathTest/CMakeLists.txt
index d1e5b1acd..44d4aae15 100644
--- a/Tests/MathTest/CMakeLists.txt
+++ b/Tests/MathTest/CMakeLists.txt
@@ -1,10 +1,10 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(MathTest)
+project(MathTest)
 
 
 # Expression test
 
-SET(expressions
+set(expressions
   "5 * ( 3 + 4)"
   "(1 | 2 | 4 | 8) & 16"
   "1 +(3*4) + 10 >> 2"
@@ -12,18 +12,18 @@ SET(expressions
   "10000 / (20 / 4)"
   )
 
-SET(FILE_EXPRESSIONS "")
-FOREACH(expression
+set(FILE_EXPRESSIONS "")
+foreach(expression
     ${expressions})
-  MATH(EXPR expr "${expression}")
-  SET(FILE_EXPRESSIONS "${FILE_EXPRESSIONS}TEST_EXPRESSION(${expression}, ${expr})\n")
-ENDFOREACH(expression)
+  math(EXPR expr "${expression}")
+  set(FILE_EXPRESSIONS "${FILE_EXPRESSIONS}TEST_EXPRESSION(${expression}, ${expr})\n")
+endforeach(expression)
 
-CONFIGURE_FILE(
+configure_file(
   "${CMAKE_CURRENT_SOURCE_DIR}/MathTestTests.h.in"
   "${CMAKE_CURRENT_BINARY_DIR}/MathTestTests.h"
   @ONLY)
 
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}")
-ADD_EXECUTABLE(MathTest MathTestExec.cxx)
+include_directories("${CMAKE_CURRENT_BINARY_DIR}")
+add_executable(MathTest MathTestExec.cxx)
 
diff --git a/Tests/ObjC++/CMakeLists.txt b/Tests/ObjC++/CMakeLists.txt
index c892bd0a1..8b1563ed8 100644
--- a/Tests/ObjC++/CMakeLists.txt
+++ b/Tests/ObjC++/CMakeLists.txt
@@ -1,6 +1,6 @@
 # a simple objc++ test case that uses Cocoa framework
-PROJECT (ObjC++)
+project (ObjC++)
 
-ADD_EXECUTABLE (ObjC++ objc++.mm)
-TARGET_LINK_LIBRARIES(ObjC++ "-framework Cocoa")
+add_executable (ObjC++ objc++.mm)
+target_link_libraries(ObjC++ "-framework Cocoa")
 
diff --git a/Tests/OutOfBinary/CMakeLists.txt b/Tests/OutOfBinary/CMakeLists.txt
index fcf90bd0d..e32754143 100644
--- a/Tests/OutOfBinary/CMakeLists.txt
+++ b/Tests/OutOfBinary/CMakeLists.txt
@@ -1,2 +1,2 @@
-ADD_LIBRARY(outlib outlib.c)
+add_library(outlib outlib.c)
 
diff --git a/Tests/OutOfSource/CMakeLists.txt b/Tests/OutOfSource/CMakeLists.txt
index e250f4177..420310f5f 100644
--- a/Tests/OutOfSource/CMakeLists.txt
+++ b/Tests/OutOfSource/CMakeLists.txt
@@ -6,9 +6,9 @@ add_subdirectory(SubDir)
 
 get_directory_property(ANIMAL DIRECTORY OutOfSourceSubdir DEFINITION WEASELS)
 get_directory_property(ANIMALREL DIRECTORY SubDir/../OutOfSourceSubdir DEFINITION WEASELS)
-IF(NOT "${ANIMAL}" STREQUAL "${ANIMALREL}")
-  MESSAGE(FATAL_ERROR "GET_DIRECTORY_PROPERTY does not seem to collapse paths.")
-ENDIF(NOT "${ANIMAL}" STREQUAL "${ANIMALREL}")
+if(NOT "${ANIMAL}" STREQUAL "${ANIMALREL}")
+  message(FATAL_ERROR "GET_DIRECTORY_PROPERTY does not seem to collapse paths.")
+endif(NOT "${ANIMAL}" STREQUAL "${ANIMALREL}")
 
 configure_file(
   ${OutOfSource_SOURCE_DIR}/testdp.h.in
diff --git a/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt b/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt
index c362e79ba..d4188098f 100644
--- a/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt
+++ b/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt
@@ -1,62 +1,62 @@
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
-IF ("${PROJECT_SOURCE_DIR}" STREQUAL "${ANOTHER_PROJ_SOURCE_DIR}")
-  SET(BUILD_SHARED_LIBS 1)
+if ("${PROJECT_SOURCE_DIR}" STREQUAL "${ANOTHER_PROJ_SOURCE_DIR}")
+  set(BUILD_SHARED_LIBS 1)
 
   # Construct a source file outside the tree whose full path is close to
   # the path length limit.  This will cause the full path to the object
   # file in the build tree to exceed the maximum path length which will
   # test cmLocalGenerator::CreateSafeUniqueObjectFileName.
-  GET_FILENAME_COMPONENT(DEEPDIR
+  get_filename_component(DEEPDIR
     ${OutOfSource_BINARY_DIR}/../OutOfSourceDeep/deeper ABSOLUTE)
 
   # Test giving the generator a custom limit.
-  SET(CMAKE_OBJECT_PATH_MAX 220)
+  set(CMAKE_OBJECT_PATH_MAX 220)
 
   # Use a separate variable for computation.
-  SET(MAXPATH "${CMAKE_OBJECT_PATH_MAX}")
+  set(MAXPATH "${CMAKE_OBJECT_PATH_MAX}")
 
   # VS8 adds "OutOfSource/SubDir/OutOfSourceSubdir/../../../" to the
   # path of the source file for no good reason.  Reduce the length
   # limit by 46 characters to account for it.  It should still be long
   # enough to require special object file name conversion.
-  IF(${CMAKE_GENERATOR} MATCHES "Visual Studio (8|10)")
-    MATH(EXPR MAXPATH "${MAXPATH} - 46")
-  ENDIF()
+  if(${CMAKE_GENERATOR} MATCHES "Visual Studio (8|10)")
+    math(EXPR MAXPATH "${MAXPATH} - 46")
+  endif()
 
   # Ninja imposes a maximum path component count of 30.  Permit more
   # path components in the source path.
-  IF(${CMAKE_GENERATOR} MATCHES "Ninja")
-    MATH(EXPR MAXPATH "${MAXPATH} - 44")
-  ENDIF()
+  if(${CMAKE_GENERATOR} MATCHES "Ninja")
+    math(EXPR MAXPATH "${MAXPATH} - 44")
+  endif()
 
   # MAXPATH less 25 for last /and/deeper/simple.cxx part and small safety
-  MATH(EXPR MAXPATH "${MAXPATH} - 25")
-  STRING(LENGTH "${DEEPDIR}" DEEPDIR_LEN)
-  WHILE("${DEEPDIR_LEN}" LESS "${MAXPATH}")
-    SET(DEEPDIR ${DEEPDIR}/and/deeper)
-    STRING(LENGTH "${DEEPDIR}" DEEPDIR_LEN)
-  ENDWHILE("${DEEPDIR_LEN}" LESS "${MAXPATH}")
-  SET(DEEPSRC ${DEEPDIR}/simple.cxx)
-  STRING(LENGTH "${DEEPSRC}" DEEPSRC_LEN)
-  CONFIGURE_FILE(simple.cxx.in ${DEEPSRC} COPYONLY)
+  math(EXPR MAXPATH "${MAXPATH} - 25")
+  string(LENGTH "${DEEPDIR}" DEEPDIR_LEN)
+  while("${DEEPDIR_LEN}" LESS "${MAXPATH}")
+    set(DEEPDIR ${DEEPDIR}/and/deeper)
+    string(LENGTH "${DEEPDIR}" DEEPDIR_LEN)
+  endwhile("${DEEPDIR_LEN}" LESS "${MAXPATH}")
+  set(DEEPSRC ${DEEPDIR}/simple.cxx)
+  string(LENGTH "${DEEPSRC}" DEEPSRC_LEN)
+  configure_file(simple.cxx.in ${DEEPSRC} COPYONLY)
 
   # Watcom WMake seems to have problems with long command lines.  Just
   # disable this part of the test until it is resolved.
-  IF(${CMAKE_GENERATOR} MATCHES "Watcom WMake")
-    SET(DEEPSRC "")
-    ADD_DEFINITIONS(-DNO_DEEPSRC)
-  ENDIF(${CMAKE_GENERATOR} MATCHES "Watcom WMake")
+  if(${CMAKE_GENERATOR} MATCHES "Watcom WMake")
+    set(DEEPSRC "")
+    add_definitions(-DNO_DEEPSRC)
+  endif(${CMAKE_GENERATOR} MATCHES "Watcom WMake")
 
-  ADD_LIBRARY(testlib testlib.cxx)
-  ADD_EXECUTABLE (simple simple.cxx ../simple.cxx ${DEEPSRC})
-  TARGET_LINK_LIBRARIES(simple testlib outlib)
-ENDIF ("${PROJECT_SOURCE_DIR}" STREQUAL "${ANOTHER_PROJ_SOURCE_DIR}")
+  add_library(testlib testlib.cxx)
+  add_executable (simple simple.cxx ../simple.cxx ${DEEPSRC})
+  target_link_libraries(simple testlib outlib)
+endif ("${PROJECT_SOURCE_DIR}" STREQUAL "${ANOTHER_PROJ_SOURCE_DIR}")
 
 # test getting a definition from a subdir
-SET (WEASELS SIZZLING)
+set (WEASELS SIZZLING)
 
-GET_DIRECTORY_PROPERTY(incDirs INCLUDE_DIRECTORIES)
-IF(NOT incDirs)
-   MESSAGE(FATAL_ERROR "GET_DIRECTORY_PROPERTY(INCLUDE_DIRECTORIES) returned empty list")
-ENDIF(NOT incDirs)
+get_directory_property(incDirs INCLUDE_DIRECTORIES)
+if(NOT incDirs)
+   message(FATAL_ERROR "get_directory_property(INCLUDE_DIRECTORIES) returned empty list")
+endif(NOT incDirs)
diff --git a/Tests/OutOfSource/SubDir/CMakeLists.txt b/Tests/OutOfSource/SubDir/CMakeLists.txt
index 4fc48e13d..c5df36e1b 100644
--- a/Tests/OutOfSource/SubDir/CMakeLists.txt
+++ b/Tests/OutOfSource/SubDir/CMakeLists.txt
@@ -1,8 +1,8 @@
-PROJECT(ANOTHER_PROJ)
+project(ANOTHER_PROJ)
 
 # subdir to an out of source and out of binary directory
-ADD_SUBDIRECTORY(${OutOfSource_SOURCE_DIR}/../OutOfBinary
+add_subdirectory(${OutOfSource_SOURCE_DIR}/../OutOfBinary
                  ${OutOfSource_BINARY_DIR}/../OutOfBinary)
 
 # subdir to a sibling dir
-ADD_SUBDIRECTORY(${OutOfSource_SOURCE_DIR}/${KEN}OutOfSourceSubdir OutOfSourceSubdir )
+add_subdirectory(${OutOfSource_SOURCE_DIR}/${KEN}OutOfSourceSubdir OutOfSourceSubdir )
diff --git a/Tests/PerConfig/CMakeLists.txt b/Tests/PerConfig/CMakeLists.txt
index 3a473b883..7f461b0ec 100644
--- a/Tests/PerConfig/CMakeLists.txt
+++ b/Tests/PerConfig/CMakeLists.txt
@@ -1,23 +1,23 @@
 project(PerConfig C)
 
 # Targets with per-configuration names.
-ADD_LIBRARY(pcStatic STATIC pcStatic.c)
-SET_PROPERTY(TARGET pcStatic PROPERTY RELEASE_POSTFIX -opt)
-SET_PROPERTY(TARGET pcStatic PROPERTY DEBUG_POSTFIX -dbg)
-ADD_LIBRARY(pcShared SHARED pcShared.c)
-SET_PROPERTY(TARGET pcShared PROPERTY RELEASE_POSTFIX -opt)
-SET_PROPERTY(TARGET pcShared PROPERTY DEBUG_POSTFIX -dbg)
-SET_PROPERTY(TARGET pcShared PROPERTY VERSION 1.2)
-SET_PROPERTY(TARGET pcShared PROPERTY SOVERSION 3)
-IF(UNIX AND NOT CYGWIN)
-  SET(soname_file -DpcShared_soname_file=$<TARGET_SONAME_FILE:pcShared>)
-ENDIF()
-ADD_EXECUTABLE(perconfig perconfig.c)
-TARGET_LINK_LIBRARIES(perconfig pcStatic pcShared)
-SET_PROPERTY(TARGET perconfig PROPERTY RELEASE_POSTFIX -opt)
-SET_PROPERTY(TARGET perconfig PROPERTY DEBUG_POSTFIX -dbg)
+add_library(pcStatic STATIC pcStatic.c)
+set_property(TARGET pcStatic PROPERTY RELEASE_POSTFIX -opt)
+set_property(TARGET pcStatic PROPERTY DEBUG_POSTFIX -dbg)
+add_library(pcShared SHARED pcShared.c)
+set_property(TARGET pcShared PROPERTY RELEASE_POSTFIX -opt)
+set_property(TARGET pcShared PROPERTY DEBUG_POSTFIX -dbg)
+set_property(TARGET pcShared PROPERTY VERSION 1.2)
+set_property(TARGET pcShared PROPERTY SOVERSION 3)
+if(UNIX AND NOT CYGWIN)
+  set(soname_file -DpcShared_soname_file=$<TARGET_SONAME_FILE:pcShared>)
+endif()
+add_executable(perconfig perconfig.c)
+target_link_libraries(perconfig pcStatic pcShared)
+set_property(TARGET perconfig PROPERTY RELEASE_POSTFIX -opt)
+set_property(TARGET perconfig PROPERTY DEBUG_POSTFIX -dbg)
 
-SET(PerConfig_COMMAND
+set(PerConfig_COMMAND
   ${CMAKE_COMMAND}
     -Dconfiguration=$<CONFIGURATION>
     -Dperconfig_file_dir=$<TARGET_FILE_DIR:perconfig>
@@ -30,5 +30,5 @@ SET(PerConfig_COMMAND
     ${soname_file}
     -P ${PerConfig_SOURCE_DIR}/perconfig.cmake
     )
-SET(PerConfig_COMMAND "${PerConfig_COMMAND}" PARENT_SCOPE)
-SET(PerConfig_DEPENDS ${PerConfig_SOURCE_DIR}/perconfig.cmake perconfig pcStatic pcShared)
+set(PerConfig_COMMAND "${PerConfig_COMMAND}" PARENT_SCOPE)
+set(PerConfig_DEPENDS ${PerConfig_SOURCE_DIR}/perconfig.cmake perconfig pcStatic pcShared)
diff --git a/Tests/Plugin/CMakeLists.txt b/Tests/Plugin/CMakeLists.txt
index 31ca59c13..d1b8334a9 100644
--- a/Tests/Plugin/CMakeLists.txt
+++ b/Tests/Plugin/CMakeLists.txt
@@ -1,87 +1,87 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(Plugin)
+project(Plugin)
 
 # Test per-target output directory properties.
-SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/bin)
-SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/lib/plugin)
-SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/lib/static)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/bin)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/lib/plugin)
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/lib/static)
 
 # We need the dynamic loader support from KWSys to load the plugin in
 # the executable.
-SET(KWSYS_NAMESPACE kwsys)
-SET(KWSYS_HEADER_ROOT ${Plugin_BINARY_DIR}/include)
-SET(KWSYS_USE_DynamicLoader 1)
-ADD_SUBDIRECTORY(${Plugin_SOURCE_DIR}/../../Source/kwsys src/kwsys)
+set(KWSYS_NAMESPACE kwsys)
+set(KWSYS_HEADER_ROOT ${Plugin_BINARY_DIR}/include)
+set(KWSYS_USE_DynamicLoader 1)
+add_subdirectory(${Plugin_SOURCE_DIR}/../../Source/kwsys src/kwsys)
 
 # Configure the location of plugins.
-CONFIGURE_FILE(${Plugin_SOURCE_DIR}/src/example_exe.h.in
+configure_file(${Plugin_SOURCE_DIR}/src/example_exe.h.in
                ${Plugin_BINARY_DIR}/include/example_exe.h @ONLY)
 
 # We need to include headers from the source tree and configured
 # headers in the build tree.
-INCLUDE_DIRECTORIES(
+include_directories(
   ${Plugin_BINARY_DIR}/include
   ${Plugin_SOURCE_DIR}/include
   )
 
 # Create an executable that exports an API for use by plugins.
-ADD_EXECUTABLE(example_exe src/example_exe.cxx)
-SET_TARGET_PROPERTIES(example_exe PROPERTIES
+add_executable(example_exe src/example_exe.cxx)
+set_target_properties(example_exe PROPERTIES
   ENABLE_EXPORTS 1
   OUTPUT_NAME example
   # Test placing exe import library in unique directory.
   ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/exe
   )
-TARGET_LINK_LIBRARIES(example_exe kwsys)
+target_link_libraries(example_exe kwsys)
 
 # Create a plugin that uses the API provided by the executable.
 # This module "links" to the executable to use the symbols.
-ADD_LIBRARY(example_mod_1 MODULE src/example_mod_1.c)
-TARGET_LINK_LIBRARIES(example_mod_1 example_exe)
+add_library(example_mod_1 MODULE src/example_mod_1.c)
+target_link_libraries(example_mod_1 example_exe)
 
 
-IF(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG AND
+if(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG AND
     "${CMAKE_C_CREATE_SHARED_MODULE}" MATCHES "SONAME_FLAG")
   # Add a second plugin that should not have any soname.
-  ADD_LIBRARY(example_mod_2 MODULE src/example_mod_1.c)
-  TARGET_LINK_LIBRARIES(example_mod_2 example_exe)
-  SET_PROPERTY(TARGET example_mod_2 PROPERTY NO_SONAME 1)
+  add_library(example_mod_2 MODULE src/example_mod_1.c)
+  target_link_libraries(example_mod_2 example_exe)
+  set_property(TARGET example_mod_2 PROPERTY NO_SONAME 1)
 
   # Verify that targets export with proper IMPORTED SONAME properties.
-  EXPORT(TARGETS example_mod_1 example_mod_2 NAMESPACE exp_
+  export(TARGETS example_mod_1 example_mod_2 NAMESPACE exp_
     FILE ${CMAKE_CURRENT_BINARY_DIR}/mods.cmake)
-  INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/mods.cmake)
-  GET_PROPERTY(configs TARGET exp_example_mod_1 PROPERTY IMPORTED_CONFIGURATIONS)
-  FOREACH(c ${configs})
-    STRING(TOUPPER "${c}" CONFIG)
-    GET_PROPERTY(soname1 TARGET exp_example_mod_1 PROPERTY IMPORTED_SONAME_${CONFIG})
-    GET_PROPERTY(soname2 TARGET exp_example_mod_2 PROPERTY IMPORTED_NO_SONAME_${CONFIG})
-    IF(soname1)
-      MESSAGE(STATUS "exp_example_mod_1 has IMPORTED_SONAME_${CONFIG} as expected: ${soname1}")
-    ELSE()
-      MESSAGE(SEND_ERROR "exp_example_mod_1 does not have IMPORTED_SONAME_${CONFIG} but should")
-    ENDIF()
-    IF(soname2)
-      MESSAGE(STATUS "exp_example_mod_2 has IMPORTED_NO_SONAME_${CONFIG} as expected: ${soname2}")
-    ELSE()
-      MESSAGE(SEND_ERROR "exp_example_mod_2 does not have IMPORTED_NO_SONAME_${CONFIG} but should")
-    ENDIF()
-  ENDFOREACH()
+  include(${CMAKE_CURRENT_BINARY_DIR}/mods.cmake)
+  get_property(configs TARGET exp_example_mod_1 PROPERTY IMPORTED_CONFIGURATIONS)
+  foreach(c ${configs})
+    string(TOUPPER "${c}" CONFIG)
+    get_property(soname1 TARGET exp_example_mod_1 PROPERTY IMPORTED_SONAME_${CONFIG})
+    get_property(soname2 TARGET exp_example_mod_2 PROPERTY IMPORTED_NO_SONAME_${CONFIG})
+    if(soname1)
+      message(STATUS "exp_example_mod_1 has IMPORTED_SONAME_${CONFIG} as expected: ${soname1}")
+    else()
+      message(SEND_ERROR "exp_example_mod_1 does not have IMPORTED_SONAME_${CONFIG} but should")
+    endif()
+    if(soname2)
+      message(STATUS "exp_example_mod_2 has IMPORTED_NO_SONAME_${CONFIG} as expected: ${soname2}")
+    else()
+      message(SEND_ERROR "exp_example_mod_2 does not have IMPORTED_NO_SONAME_${CONFIG} but should")
+    endif()
+  endforeach()
 
   # Parse the binary to check for SONAME if possible.
-  IF("${CMAKE_EXECUTABLE_FORMAT}" MATCHES "ELF")
-    FIND_PROGRAM(READELF_EXE readelf)
-    IF(READELF_EXE)
-      ADD_CUSTOM_TARGET(check_mod_soname ALL COMMAND
+  if("${CMAKE_EXECUTABLE_FORMAT}" MATCHES "ELF")
+    find_program(READELF_EXE readelf)
+    if(READELF_EXE)
+      add_custom_target(check_mod_soname ALL COMMAND
         ${CMAKE_COMMAND} -Dreadelf=${READELF_EXE}
                          -Dmod1=$<TARGET_FILE:example_mod_1>
                          -Dmod2=$<TARGET_FILE:example_mod_2>
         -P ${CMAKE_CURRENT_SOURCE_DIR}/check_mod_soname.cmake
         )
-      ADD_DEPENDENCIES(check_mod_soname example_mod_1 example_mod_2)
-    ENDIF()
-  ENDIF()
-ENDIF()
+      add_dependencies(check_mod_soname example_mod_1 example_mod_2)
+    endif()
+  endif()
+endif()
 
 # TODO:
 #  - create a plugin that links to a static lib
diff --git a/Tests/PreOrder/CMakeLists.txt b/Tests/PreOrder/CMakeLists.txt
index 29720e4c1..8b4c43954 100644
--- a/Tests/PreOrder/CMakeLists.txt
+++ b/Tests/PreOrder/CMakeLists.txt
@@ -1,6 +1,6 @@
 # a simple test case
-PROJECT (PreOrder)
-SET(CMAKE_IGNORE_DEPENDENCIES_ORDERING 1)
-ADD_SUBDIRECTORY(Library)
-ADD_EXECUTABLE (PreOrder simple.cxx)
-TARGET_LINK_LIBRARIES(PreOrder simpleLib)
+project (PreOrder)
+set(CMAKE_IGNORE_DEPENDENCIES_ORDERING 1)
+add_subdirectory(Library)
+add_executable (PreOrder simple.cxx)
+target_link_libraries(PreOrder simpleLib)
diff --git a/Tests/PreOrder/Library/CMakeLists.txt b/Tests/PreOrder/Library/CMakeLists.txt
index 6c011eca9..018ffa5e2 100644
--- a/Tests/PreOrder/Library/CMakeLists.txt
+++ b/Tests/PreOrder/Library/CMakeLists.txt
@@ -1,2 +1,2 @@
-ADD_LIBRARY(simpleLib simpleLib.cxx )
+add_library(simpleLib simpleLib.cxx )
 
diff --git a/Tests/PrecompiledHeader/CMakeLists.txt b/Tests/PrecompiledHeader/CMakeLists.txt
index 3374e325f..e5ac6d347 100644
--- a/Tests/PrecompiledHeader/CMakeLists.txt
+++ b/Tests/PrecompiledHeader/CMakeLists.txt
@@ -1,59 +1,59 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(PrecompiledHeader C)
+project(PrecompiledHeader C)
 
 # Make sure the proper compiler is in use.
-IF(NOT MSVC AND NOT "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$")
-  MESSAGE(FATAL_ERROR "The PrecompiledHeader test works only with MSVC or Intel")
-ENDIF()
+if(NOT MSVC AND NOT "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$")
+  message(FATAL_ERROR "The PrecompiledHeader test works only with MSVC or Intel")
+endif()
 
 # Compute a custom name for the precompiled header.
-IF(CMAKE_CONFIGURATION_TYPES)
-  SET(PCH_DIR "${CMAKE_CURRENT_BINARY_DIR}/PCH/${CMAKE_CFG_INTDIR}")
-  FOREACH(cfg ${CMAKE_CONFIGURATION_TYPES})
-    FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/PCH/${cfg})
-  ENDFOREACH()
-ELSE(CMAKE_CONFIGURATION_TYPES)
-  SET(PCH_DIR "${CMAKE_CURRENT_BINARY_DIR}/PCH")
-  FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/PCH)
-ENDIF(CMAKE_CONFIGURATION_TYPES)
+if(CMAKE_CONFIGURATION_TYPES)
+  set(PCH_DIR "${CMAKE_CURRENT_BINARY_DIR}/PCH/${CMAKE_CFG_INTDIR}")
+  foreach(cfg ${CMAKE_CONFIGURATION_TYPES})
+    file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/PCH/${cfg})
+  endforeach()
+else(CMAKE_CONFIGURATION_TYPES)
+  set(PCH_DIR "${CMAKE_CURRENT_BINARY_DIR}/PCH")
+  file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/PCH)
+endif(CMAKE_CONFIGURATION_TYPES)
 
 # The VS6 IDE does not support renaming .pch files with /Fp.
-IF("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
-  SET(PCH_USE_INCLUDE_DIR 1)
-  SET(PCH_FILE)
-ELSE("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
-  SET(PCH_USE_INCLUDE_DIR 0)
-  SET(PCH_FILE "\"/Fp${PCH_DIR}/foo_precompiled.pch\"")
-ENDIF("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
+if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
+  set(PCH_USE_INCLUDE_DIR 1)
+  set(PCH_FILE)
+else("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
+  set(PCH_USE_INCLUDE_DIR 0)
+  set(PCH_FILE "\"/Fp${PCH_DIR}/foo_precompiled.pch\"")
+endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
 
 # Choose between an explicit include path and using /I during
 # precompilation.  The /I form is used to test that the PCH is
 # actually used.  In practice the include path form would be used.
-IF(PCH_USE_INCLUDE_DIR)
-  INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
-ELSE(PCH_USE_INCLUDE_DIR)
-  SET(PCH_INCLUDE_DIR "\"/I${CMAKE_CURRENT_SOURCE_DIR}/include\"")
-ENDIF(PCH_USE_INCLUDE_DIR)
+if(PCH_USE_INCLUDE_DIR)
+  include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
+else(PCH_USE_INCLUDE_DIR)
+  set(PCH_INCLUDE_DIR "\"/I${CMAKE_CURRENT_SOURCE_DIR}/include\"")
+endif(PCH_USE_INCLUDE_DIR)
 
 # Create a target that will use a precompiled header.
-SET(foo_SRCS foo1.c foo2.c)
-ADD_EXECUTABLE(foo foo_precompile.c ${foo_SRCS})
+set(foo_SRCS foo1.c foo2.c)
+add_executable(foo foo_precompile.c ${foo_SRCS})
 
 # Setup flags on the target to create and use the precompiled header.
-SET_TARGET_PROPERTIES(foo PROPERTIES
+set_target_properties(foo PROPERTIES
   COMPILE_FLAGS "/Yufoo_precompiled.h /FIfoo_precompiled.h ${PCH_FILE}")
-SET_SOURCE_FILES_PROPERTIES(foo_precompile.c PROPERTIES
+set_source_files_properties(foo_precompile.c PROPERTIES
   COMPILE_FLAGS "/Ycfoo_precompiled.h ${PCH_INCLUDE_DIR}")
 
 # Setup dependencies for precompiled header creation and use.  The VS
 # IDE takes care of this automatically.
-IF("${CMAKE_GENERATOR}" MATCHES "Makefile" OR
+if("${CMAKE_GENERATOR}" MATCHES "Makefile" OR
    "${CMAKE_GENERATOR}" MATCHES "Ninja")
   # This source file creates the precompiled header as a side-effect.
-  SET_SOURCE_FILES_PROPERTIES(foo_precompile.c PROPERTIES
+  set_source_files_properties(foo_precompile.c PROPERTIES
     OBJECT_OUTPUTS "${PCH_DIR}/foo_precompiled.pch")
 
   # These source files use the precompiled header.
-  SET_SOURCE_FILES_PROPERTIES(${foo_SRCS} PROPERTIES
+  set_source_files_properties(${foo_SRCS} PROPERTIES
     OBJECT_DEPENDS "${PCH_DIR}/foo_precompiled.pch")
-ENDIF("${CMAKE_GENERATOR}" MATCHES "Makefile")
+endif("${CMAKE_GENERATOR}" MATCHES "Makefile")
diff --git a/Tests/SameName/CMakeLists.txt b/Tests/SameName/CMakeLists.txt
index a4b993cfd..d78879dd9 100644
--- a/Tests/SameName/CMakeLists.txt
+++ b/Tests/SameName/CMakeLists.txt
@@ -1,7 +1,7 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(SameName C)
+project(SameName C)
 
-ADD_SUBDIRECTORY(Lib1)
+add_subdirectory(Lib1)
 
-INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/Lib1)
-ADD_SUBDIRECTORY(Exe1)
+include_directories(${PROJECT_SOURCE_DIR}/Lib1)
+add_subdirectory(Exe1)
diff --git a/Tests/SameName/Exe1/CMakeLists.txt b/Tests/SameName/Exe1/CMakeLists.txt
index 3917a2f6b..b9182f209 100644
--- a/Tests/SameName/Exe1/CMakeLists.txt
+++ b/Tests/SameName/Exe1/CMakeLists.txt
@@ -1,11 +1,11 @@
 # a target with the same name as a target in a different dir
-ADD_EXECUTABLE(mytest_exe conly.c)
-SET_TARGET_PROPERTIES(mytest_exe PROPERTIES OUTPUT_NAME mytest)
-TARGET_LINK_LIBRARIES(mytest_exe mytest)
+add_executable(mytest_exe conly.c)
+set_target_properties(mytest_exe PROPERTIES OUTPUT_NAME mytest)
+target_link_libraries(mytest_exe mytest)
 
 # and two targets in the same dir with the same name
-ADD_LIBRARY(mytest2 ../Lib1/libc1.c)
+add_library(mytest2 ../Lib1/libc1.c)
 
-ADD_EXECUTABLE(mytest2_exe conly.c)
-SET_TARGET_PROPERTIES(mytest2_exe PROPERTIES OUTPUT_NAME mytest2)
-TARGET_LINK_LIBRARIES(mytest2_exe mytest2)
+add_executable(mytest2_exe conly.c)
+set_target_properties(mytest2_exe PROPERTIES OUTPUT_NAME mytest2)
+target_link_libraries(mytest2_exe mytest2)
diff --git a/Tests/SameName/Lib1/CMakeLists.txt b/Tests/SameName/Lib1/CMakeLists.txt
index 67e7f6843..40fa15422 100644
--- a/Tests/SameName/Lib1/CMakeLists.txt
+++ b/Tests/SameName/Lib1/CMakeLists.txt
@@ -1 +1 @@
-ADD_LIBRARY(mytest libc1.c)
+add_library(mytest libc1.c)
diff --git a/Tests/SetLang/CMakeLists.txt b/Tests/SetLang/CMakeLists.txt
index ab6570c33..f24e5cb5d 100644
--- a/Tests/SetLang/CMakeLists.txt
+++ b/Tests/SetLang/CMakeLists.txt
@@ -2,7 +2,7 @@
 cmake_minimum_required (VERSION 2.6)
 project(SetLang)
 # force this to be verbose so I can debug a dashboard entry
-SET(CMAKE_VERBOSE_MAKEFILE 1)
+set(CMAKE_VERBOSE_MAKEFILE 1)
 add_library(foo foo.c)
 add_executable(SetLang bar.c)
 set_source_files_properties(foo.c bar.c PROPERTIES LANGUAGE CXX)
diff --git a/Tests/SimpleInstall/CMakeLists.txt b/Tests/SimpleInstall/CMakeLists.txt
index a47c546e7..f05587eb2 100644
--- a/Tests/SimpleInstall/CMakeLists.txt
+++ b/Tests/SimpleInstall/CMakeLists.txt
@@ -1,216 +1,216 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT (TestSimpleInstall)
-SET(CMAKE_VERBOSE_MAKEFILE 1)
-SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY
+project (TestSimpleInstall)
+set(CMAKE_VERBOSE_MAKEFILE 1)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY
   "${TestSimpleInstall_BINARY_DIR}/bin")
-SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY
   "${TestSimpleInstall_BINARY_DIR}/lib/static")
-SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY
   "${TestSimpleInstall_BINARY_DIR}/lib")
 
 # Skip generating the rpath pointing at the build tree to make sure
 # the executable is installed with the proper rpath in the install
 # tree.
-SET(CMAKE_SKIP_BUILD_RPATH 1)
+set(CMAKE_SKIP_BUILD_RPATH 1)
 
 # Make sure the executable can run from the install tree.
-SET(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/MyTest/lib)
+set(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/MyTest/lib)
 
 # Skip the dependency that causes a build when installing.  This
 # avoids infinite loops when the post-build rule below installs.
-SET(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY 1)
-SET(CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY 1)
+set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY 1)
+set(CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY 1)
 
-SET(CMAKE_DEBUG_POSTFIX "_test_debug_postfix")
+set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix")
 
-SET(EXTRA_INSTALL_FLAGS)
-MESSAGE("Extra install: ${EXTRA_INSTALL_FLAGS}")
+set(EXTRA_INSTALL_FLAGS)
+message("Extra install: ${EXTRA_INSTALL_FLAGS}")
 
-IF(STAGE2)
-  SET(LIBPATHS
+if(STAGE2)
+  set(LIBPATHS
     ${CMAKE_INSTALL_PREFIX}/MyTest/lib/static
     ${CMAKE_INSTALL_PREFIX}/MyTest/lib
     )
-  SET(t1NAMES test1 test1${CMAKE_DEBUG_POSTFIX} test1rel)
-  SET(t2NAMES test2 test2${CMAKE_DEBUG_POSTFIX})
-  SET(t4NAMES test4out test4out${CMAKE_DEBUG_POSTFIX})
+  set(t1NAMES test1 test1${CMAKE_DEBUG_POSTFIX} test1rel)
+  set(t2NAMES test2 test2${CMAKE_DEBUG_POSTFIX})
+  set(t4NAMES test4out test4out${CMAKE_DEBUG_POSTFIX})
 
   # Make sure the install script ran.
-  SET(CMAKE_INSTALL_SCRIPT_DID_RUN 0)
-  INCLUDE(${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake OPTIONAL)
-  IF(CMAKE_INSTALL_SCRIPT_DID_RUN)
-    MESSAGE(STATUS "Stage 1 did run install script 2.")
-  ELSE(CMAKE_INSTALL_SCRIPT_DID_RUN)
-    MESSAGE(SEND_ERROR "Stage 1 did not run install script 2.")
-  ENDIF(CMAKE_INSTALL_SCRIPT_DID_RUN)
+  set(CMAKE_INSTALL_SCRIPT_DID_RUN 0)
+  include(${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake OPTIONAL)
+  if(CMAKE_INSTALL_SCRIPT_DID_RUN)
+    message(STATUS "Stage 1 did run install script 2.")
+  else(CMAKE_INSTALL_SCRIPT_DID_RUN)
+    message(SEND_ERROR "Stage 1 did not run install script 2.")
+  endif(CMAKE_INSTALL_SCRIPT_DID_RUN)
 
-  IF(CYGWIN OR MINGW)
-    SET(LIBPATHS ${LIBPATHS} "${CMAKE_INSTALL_PREFIX}/MyTest/bin")
-  ENDIF(CYGWIN OR MINGW)
-  MESSAGE("Search for library in: ${LIBPATHS}")
+  if(CYGWIN OR MINGW)
+    set(LIBPATHS ${LIBPATHS} "${CMAKE_INSTALL_PREFIX}/MyTest/bin")
+  endif(CYGWIN OR MINGW)
+  message("Search for library in: ${LIBPATHS}")
 
-  SET(TEST1_LIBRARY "TEST1_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE)
-  SET(TEST2_LIBRARY "TEST2_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE)
-  SET(TEST4_LIBRARY "TEST4_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE)
+  set(TEST1_LIBRARY "TEST1_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE)
+  set(TEST2_LIBRARY "TEST2_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE)
+  set(TEST4_LIBRARY "TEST4_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE)
 
-  FIND_LIBRARY(TEST1_LIBRARY
+  find_library(TEST1_LIBRARY
     NAMES ${t1NAMES}
     PATHS ${LIBPATHS}
     DOC "First library")
-  FIND_LIBRARY(TEST2_LIBRARY
+  find_library(TEST2_LIBRARY
     NAMES ${t2NAMES}
     PATHS ${LIBPATHS}
     DOC "Second library")
-  FIND_LIBRARY(TEST4_LIBRARY
+  find_library(TEST4_LIBRARY
     NAMES ${t4NAMES}
     PATHS ${LIBPATHS}
     DOC "Fourth library")
 
   # Test importing a library found on disk.
-  ADD_LIBRARY(lib_test4 UNKNOWN IMPORTED)
-  SET_PROPERTY(TARGET lib_test4 PROPERTY IMPORTED_LOCATION ${TEST4_LIBRARY})
+  add_library(lib_test4 UNKNOWN IMPORTED)
+  set_property(TARGET lib_test4 PROPERTY IMPORTED_LOCATION ${TEST4_LIBRARY})
 
-  INCLUDE_DIRECTORIES(${CMAKE_INSTALL_PREFIX}/MyTest/include)
-  ADD_EXECUTABLE (SimpleInstExeS2 inst2.cxx foo.c foo.h)
-  TARGET_LINK_LIBRARIES(SimpleInstExeS2 ${TEST1_LIBRARY} ${TEST2_LIBRARY} lib_test4)
-  SET(install_target SimpleInstExeS2)
+  include_directories(${CMAKE_INSTALL_PREFIX}/MyTest/include)
+  add_executable (SimpleInstExeS2 inst2.cxx foo.c foo.h)
+  target_link_libraries(SimpleInstExeS2 ${TEST1_LIBRARY} ${TEST2_LIBRARY} lib_test4)
+  set(install_target SimpleInstExeS2)
 
-  IF("${TEST1_LIBRARY}" MATCHES "static")
-    MESSAGE(STATUS "test1 correctly found in lib/static")
-  ELSE("${TEST1_LIBRARY}" MATCHES "static")
-    MESSAGE(SEND_ERROR "test1 not found in lib/static!")
-  ENDIF("${TEST1_LIBRARY}" MATCHES "static")
+  if("${TEST1_LIBRARY}" MATCHES "static")
+    message(STATUS "test1 correctly found in lib/static")
+  else("${TEST1_LIBRARY}" MATCHES "static")
+    message(SEND_ERROR "test1 not found in lib/static!")
+  endif("${TEST1_LIBRARY}" MATCHES "static")
 
   # Check for failure of configuration-specific installation.
-  IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h")
-    MESSAGE(FATAL_ERROR "Debug-configuration file installed for Release!")
-  ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h")
-  IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h")
-    MESSAGE(FATAL_ERROR "Release-configuration file installed for Debug!")
-  ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h")
+  if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h")
+    message(FATAL_ERROR "Debug-configuration file installed for Release!")
+  endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h")
+  if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h")
+    message(FATAL_ERROR "Release-configuration file installed for Debug!")
+  endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h")
 
   # Check for failure of directory installation.
-  IF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h")
-    MESSAGE(FATAL_ERROR "Directory installation did not install TSD.h")
-  ENDIF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h")
-  IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS")
-    MESSAGE(FATAL_ERROR "Directory installation installed CVS directory.")
-  ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS")
-  IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS")
-    MESSAGE(FATAL_ERROR "Directory installation installed CVS directory.")
-  ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS")
-  IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt")
-    MESSAGE(FATAL_ERROR "Directory installation installed CMakeLists.txt.")
-  ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt")
-  IF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h")
-    MESSAGE(FATAL_ERROR "Directory installation did not install alternate TSD.h")
-  ENDIF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h")
-  IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx")
-    MESSAGE(FATAL_ERROR "Directory installation installed alternate TSD.cxx")
-  ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx")
+  if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h")
+    message(FATAL_ERROR "Directory installation did not install TSD.h")
+  endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h")
+  if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS")
+    message(FATAL_ERROR "Directory installation installed CVS directory.")
+  endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS")
+  if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS")
+    message(FATAL_ERROR "Directory installation installed CVS directory.")
+  endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS")
+  if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt")
+    message(FATAL_ERROR "Directory installation installed CMakeLists.txt.")
+  endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt")
+  if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h")
+    message(FATAL_ERROR "Directory installation did not install alternate TSD.h")
+  endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h")
+  if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx")
+    message(FATAL_ERROR "Directory installation installed alternate TSD.cxx")
+  endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx")
 
   # Check that scripts properly installed.
-  IF(WIN32 AND NOT CYGWIN)
-    SET(BAT .bat)
-  ELSE(WIN32 AND NOT CYGWIN)
-    SET(BAT)
-  ENDIF(WIN32 AND NOT CYGWIN)
-  FOREACH(loc share share/old1 share/old2 share/old3 share/alt)
-    SET(CUR_SCRIPT "${CMAKE_INSTALL_PREFIX}/MyTest/${loc}/sample_script${BAT}")
-    EXECUTE_PROCESS(
+  if(WIN32 AND NOT CYGWIN)
+    set(BAT .bat)
+  else(WIN32 AND NOT CYGWIN)
+    set(BAT)
+  endif(WIN32 AND NOT CYGWIN)
+  foreach(loc share share/old1 share/old2 share/old3 share/alt)
+    set(CUR_SCRIPT "${CMAKE_INSTALL_PREFIX}/MyTest/${loc}/sample_script${BAT}")
+    execute_process(
       COMMAND ${CUR_SCRIPT}
       RESULT_VARIABLE SAMPLE_SCRIPT_RESULT
       OUTPUT_VARIABLE SAMPLE_SCRIPT_OUTPUT
       )
-    IF(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$")
-      MESSAGE(FATAL_ERROR
+    if(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$")
+      message(FATAL_ERROR
         "Sample script [${CUR_SCRIPT}] failed: [${SAMPLE_SCRIPT_RESULT}]")
-    ENDIF(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$")
-    IF(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output")
-      MESSAGE(FATAL_ERROR
+    endif(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$")
+    if(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output")
+      message(FATAL_ERROR
         "Bad sample script [${CUR_SCRIPT}] output: [${SAMPLE_SCRIPT_OUTPUT}]")
-    ENDIF(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output")
-  ENDFOREACH(loc)
+    endif(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output")
+  endforeach(loc)
 
   # Check for failure of empty directory installation.
-  IF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty")
-    MESSAGE(FATAL_ERROR "Empty directory installation did not install.")
-  ENDIF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty")
-  FILE(GLOB EMPTY_FILES "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty/*")
-  IF(EMPTY_FILES)
-    MESSAGE(FATAL_ERROR "Empty directory installed [${EMPTY_FILES}].")
-  ENDIF(EMPTY_FILES)
+  if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty")
+    message(FATAL_ERROR "Empty directory installation did not install.")
+  endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty")
+  file(GLOB EMPTY_FILES "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty/*")
+  if(EMPTY_FILES)
+    message(FATAL_ERROR "Empty directory installed [${EMPTY_FILES}].")
+  endif(EMPTY_FILES)
 
   # Make sure the test executable can run from the install tree.
-  SET_TARGET_PROPERTIES(SimpleInstExeS2 PROPERTIES
+  set_target_properties(SimpleInstExeS2 PROPERTIES
     INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/MyTest/lib)
 
-  INSTALL_TARGETS(/MyTest/bin SimpleInstExeS2)
+  install_targets(/MyTest/bin SimpleInstExeS2)
 
 # try to import the exported targets again
-  SET(SimpleInstallS1_DIR ${CMAKE_INSTALL_PREFIX}/MyTest/lib)
-  FIND_PACKAGE(SimpleInstallS1 REQUIRED)
-  GET_TARGET_PROPERTY(simpleInstallImported S1_SimpleInstall IMPORTED)
-  IF(NOT simpleInstallImported)
-    MESSAGE(FATAL_ERROR "Target S1_SimpleInstall could not be imported")
-  ENDIF(NOT simpleInstallImported)
+  set(SimpleInstallS1_DIR ${CMAKE_INSTALL_PREFIX}/MyTest/lib)
+  find_package(SimpleInstallS1 REQUIRED)
+  get_target_property(simpleInstallImported S1_SimpleInstall IMPORTED)
+  if(NOT simpleInstallImported)
+    message(FATAL_ERROR "Target S1_SimpleInstall could not be imported")
+  endif(NOT simpleInstallImported)
 
-ELSE(STAGE2)
+else(STAGE2)
   # Wipe out the install directory to do a fresh test.
-  FILE(REMOVE_RECURSE ${CMAKE_INSTALL_PREFIX}/MyTest)
+  file(REMOVE_RECURSE ${CMAKE_INSTALL_PREFIX}/MyTest)
 
   # this is stage 1, so create libraries and modules and install everything
-  ADD_LIBRARY(test1 STATIC lib1.cxx)
-  ADD_LIBRARY(test2 SHARED lib2.cxx)
-  ADD_LIBRARY(test3 MODULE lib3.cxx)
-  ADD_LIBRARY(test4 SHARED lib4.cxx)
+  add_library(test1 STATIC lib1.cxx)
+  add_library(test2 SHARED lib2.cxx)
+  add_library(test3 MODULE lib3.cxx)
+  add_library(test4 SHARED lib4.cxx)
 
   # Test <ARCHIVE|LIBRARY|RUNTIME>_OUTPUT_NAME properties.
-  SET_PROPERTY(TARGET test4 PROPERTY ARCHIVE_OUTPUT_NAME test4out)
-  SET_PROPERTY(TARGET test4 PROPERTY LIBRARY_OUTPUT_NAME test4out)
+  set_property(TARGET test4 PROPERTY ARCHIVE_OUTPUT_NAME test4out)
+  set_property(TARGET test4 PROPERTY LIBRARY_OUTPUT_NAME test4out)
 
-  ADD_EXECUTABLE (SimpleInstall inst.cxx foo.c foo.h)
-  TARGET_LINK_LIBRARIES(SimpleInstall test1 test2 test4)
-  SET(install_target SimpleInstall)
+  add_executable (SimpleInstall inst.cxx foo.c foo.h)
+  target_link_libraries(SimpleInstall test1 test2 test4)
+  set(install_target SimpleInstall)
 
-  SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES OUTPUT_NAME SimpleInstExe)
+  set_target_properties(SimpleInstall PROPERTIES OUTPUT_NAME SimpleInstExe)
   # Disable VERSION test until it is implemented in the Xcode generator.
-  IF(NOT XCODE)
-    SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES VERSION 1.2)
-  ENDIF(NOT XCODE)
+  if(NOT XCODE)
+    set_target_properties(SimpleInstall PROPERTIES VERSION 1.2)
+  endif(NOT XCODE)
 
   # Make sure the test executable can run from the install tree.
-  SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES
+  set_target_properties(SimpleInstall PROPERTIES
     INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/MyTest/lib)
 
   # Test per-configuration output name.
-  SET_TARGET_PROPERTIES(test1 PROPERTIES RELEASE_OUTPUT_NAME test1rel)
-  SET_TARGET_PROPERTIES(test2 PROPERTIES PUBLIC_HEADER foo.h)
+  set_target_properties(test1 PROPERTIES RELEASE_OUTPUT_NAME test1rel)
+  set_target_properties(test2 PROPERTIES PUBLIC_HEADER foo.h)
 
-  IF(CMAKE_GENERATOR MATCHES "Makefiles")
-    ADD_SUBDIRECTORY(TestSubDir)
-    ADD_DEPENDENCIES(SimpleInstall TSD)
-  ENDIF(CMAKE_GENERATOR MATCHES "Makefiles")
+  if(CMAKE_GENERATOR MATCHES "Makefiles")
+    add_subdirectory(TestSubDir)
+    add_dependencies(SimpleInstall TSD)
+  endif(CMAKE_GENERATOR MATCHES "Makefiles")
 
-  ADD_DEPENDENCIES(SimpleInstall test3)
-  ADD_DEPENDENCIES(test2 test3)
-  ADD_DEPENDENCIES(test4 test2)
+  add_dependencies(SimpleInstall test3)
+  add_dependencies(test2 test3)
+  add_dependencies(test4 test2)
 
-  INSTALL(TARGETS SimpleInstall test1 test2 test3 EXPORT SimpleInstallS1
+  install(TARGETS SimpleInstall test1 test2 test3 EXPORT SimpleInstallS1
     RUNTIME DESTINATION MyTest/bin        COMPONENT Runtime     # .exe, .dll
     LIBRARY DESTINATION MyTest/lib        COMPONENT Runtime     # .so, mod.dll
     ARCHIVE DESTINATION MyTest/lib/static COMPONENT Development # .a, .lib
     PUBLIC_HEADER DESTINATION MyTest/include COMPONENT Development
     )
 
-  INSTALL(TARGETS test4 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+  install(TARGETS test4 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
     RUNTIME DESTINATION MyTest/bin
     LIBRARY DESTINATION MyTest/lib
     ARCHIVE DESTINATION MyTest/lib/static
     OPTIONAL # for coverage...target should always exist
     )
-  INSTALL(FILES lib1.h DESTINATION MyTest/include/foo)
-  INSTALL(FILES lib2.h
+  install(FILES lib1.h DESTINATION MyTest/include/foo)
+  install(FILES lib2.h
     DESTINATION MyTest/include/foo
     COMPONENT Development
     PERMISSIONS OWNER_READ OWNER_WRITE
@@ -218,40 +218,40 @@ ELSE(STAGE2)
     )
 
   # Test old-style install commands.
-  INSTALL_FILES(/MyTest/include FILES lib3.h)
-  INSTALL_FILES(/MyTest/include/old .h lib3)
-  INSTALL_FILES(/MyTest/include/old "^lib2.h$")
-  INSTALL_PROGRAMS(/MyTest/share/old1 FILES
+  install_files(/MyTest/include FILES lib3.h)
+  install_files(/MyTest/include/old .h lib3)
+  install_files(/MyTest/include/old "^lib2.h$")
+  install_programs(/MyTest/share/old1 FILES
     scripts/sample_script scripts/sample_script.bat)
-  INSTALL_PROGRAMS(/MyTest/share/old2
+  install_programs(/MyTest/share/old2
     scripts/sample_script scripts/sample_script.bat)
 
 # "export" the targets collected in "SimpleInstallS1"
-  INSTALL(EXPORT SimpleInstallS1 FILE SimpleInstallS1Config.cmake
+  install(EXPORT SimpleInstallS1 FILE SimpleInstallS1Config.cmake
                                  DESTINATION MyTest/lib
                                  NAMESPACE S1_ )
 
-  EXPORT(TARGETS SimpleInstall test1 test2 test3
+  export(TARGETS SimpleInstall test1 test2 test3
          FILE "${CMAKE_CURRENT_BINARY_DIR}/SimpleInstallS1Config.cmake"
          NAMESPACE S2_ )
 
-  ADD_SUBDIRECTORY(scripts)
+  add_subdirectory(scripts)
 
   # Test optional installation.
-  INSTALL(FILES does_not_exist.h DESTINATION MyTest/include/foo OPTIONAL)
+  install(FILES does_not_exist.h DESTINATION MyTest/include/foo OPTIONAL)
 
   # Test configuration-specific installation.
-  INSTALL(FILES lib1.h RENAME lib1release.h CONFIGURATIONS Release
+  install(FILES lib1.h RENAME lib1release.h CONFIGURATIONS Release
     DESTINATION MyTest/include/Release
     )
-  INSTALL(FILES lib1.h RENAME lib1debug.h CONFIGURATIONS Debug
+  install(FILES lib1.h RENAME lib1debug.h CONFIGURATIONS Debug
     DESTINATION MyTest/include/Debug
     )
 
   # Test directory installation.
-  FILE(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS")
-  FILE(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS")
-  INSTALL(
+  file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS")
+  file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS")
+  install(
     DIRECTORY TestSubDir scripts/ DESTINATION MyTest/share
     FILE_PERMISSIONS OWNER_READ OWNER_WRITE
     DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
@@ -262,14 +262,14 @@ ELSE(STAGE2)
     )
 
   # Alternate directory installation for coverage.
-  INSTALL(
+  install(
     DIRECTORY scripts/ DESTINATION MyTest/share/alt
     COMPONENT Development
     USE_SOURCE_PERMISSIONS
     PATTERN "CVS" EXCLUDE
     REGEX "\\.txt$" EXCLUDE
     )
-  INSTALL(
+  install(
     DIRECTORY TestSubDir DESTINATION MyTest/share/alt
     FILE_PERMISSIONS OWNER_READ OWNER_WRITE
     DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
@@ -278,65 +278,65 @@ ELSE(STAGE2)
     )
 
   # Test empty directory installation.
-  INSTALL(DIRECTORY DESTINATION MyTest/share/empty)
+  install(DIRECTORY DESTINATION MyTest/share/empty)
 
   # Test optional directory installation.
-  INSTALL(DIRECTORY does-not-exist DESTINATION MyTest/share OPTIONAL)
+  install(DIRECTORY does-not-exist DESTINATION MyTest/share OPTIONAL)
 
   # Test user-specified install scripts, with and without COMPONENT.
-  INSTALL(
+  install(
     SCRIPT InstallScript1.cmake
-    CODE "SET(INSTALL_CODE_DID_RUN 1)"
+    CODE "set(INSTALL_CODE_DID_RUN 1)"
     SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/InstallScript2.cmake
     )
-  INSTALL(
+  install(
     SCRIPT InstallScript3.cmake
-    CODE "SET(INSTALL_CODE_WITH_COMPONENT_DID_RUN 1)"
+    CODE "set(INSTALL_CODE_WITH_COMPONENT_DID_RUN 1)"
     SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/InstallScript4.cmake
     COMPONENT Development
     )
-  SET_DIRECTORY_PROPERTIES(PROPERTIES
+  set_directory_properties(PROPERTIES
     ADDITIONAL_MAKE_CLEAN_FILES
     "${CMAKE_INSTALL_PREFIX}/InstallScriptOut.cmake;${CMAKE_INSTALL_PREFIX}/InstallScript4Out.cmake")
 
-  SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES PRE_INSTALL_SCRIPT
+  set_target_properties(SimpleInstall PROPERTIES PRE_INSTALL_SCRIPT
     ${CMAKE_CURRENT_SOURCE_DIR}/PreInstall.cmake)
-  SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES POST_INSTALL_SCRIPT
+  set_target_properties(SimpleInstall PROPERTIES POST_INSTALL_SCRIPT
     ${CMAKE_CURRENT_SOURCE_DIR}/PostInstall.cmake)
-  SET_TARGET_PROPERTIES(test4 PROPERTIES VERSION 1.2 SOVERSION 3
+  set_target_properties(test4 PROPERTIES VERSION 1.2 SOVERSION 3
         INSTALL_NAME_DIR @executable_path/../lib)
-ENDIF(STAGE2)
+endif(STAGE2)
 
-IF(CMAKE_CONFIGURATION_TYPES)
-  SET(SI_CONFIG -C ${CMAKE_CFG_INTDIR})
-ELSE(CMAKE_CONFIGURATION_TYPES)
-  SET(SI_CONFIG)
-ENDIF(CMAKE_CONFIGURATION_TYPES)
+if(CMAKE_CONFIGURATION_TYPES)
+  set(SI_CONFIG -C ${CMAKE_CFG_INTDIR})
+else(CMAKE_CONFIGURATION_TYPES)
+  set(SI_CONFIG)
+endif(CMAKE_CONFIGURATION_TYPES)
 
 # Dummy test of CPack
-SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Test of packaging with cpack")
-SET(CPACK_PACKAGE_VENDOR "Kitware")
-SET(CPACK_INSTALL_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/PackageScript.cmake")
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Test of packaging with cpack")
+set(CPACK_PACKAGE_VENDOR "Kitware")
+set(CPACK_INSTALL_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/PackageScript.cmake")
 
-IF(WIN32 AND NOT UNIX)
-  FIND_PROGRAM(NSIS_MAKENSIS NAMES makensis
+if(WIN32 AND NOT UNIX)
+  find_program(NSIS_MAKENSIS NAMES makensis
     PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS]
     DOC "Where is makensis.exe located"
     )
-  IF(NOT NSIS_MAKENSIS)
-    SET(CPACK_GENERATOR TGZ)
-  ENDIF(NOT NSIS_MAKENSIS)
-ENDIF(WIN32 AND NOT UNIX)
-IF(UNIX AND NOT APPLE)
-  SET(CPACK_GENERATOR "TGZ;STGZ;TZ")
-  #  FIND_PROGRAM(found_compress
+  if(NOT NSIS_MAKENSIS)
+    set(CPACK_GENERATOR TGZ)
+  endif(NOT NSIS_MAKENSIS)
+endif(WIN32 AND NOT UNIX)
+if(UNIX AND NOT APPLE)
+  set(CPACK_GENERATOR "TGZ;STGZ;TZ")
+  #  find_program(found_compress
   #    NAMES compress)
-  #  IF(found_compress)
-  #    FIND_PROGRAM(file_command NAMES file)
-  #    IF(NOT file_command)
+  #  if(found_compress)
+  #    find_program(file_command NAMES file)
+  #    if(NOT file_command)
   #      set(file_command file)
-  #    ENDIF(NOT file_command)
-  #    EXECUTE_PROCESS(COMMAND ${file_command} ${found_compress}
+  #    endif(NOT file_command)
+  #    execute_process(COMMAND ${file_command} ${found_compress}
   #      OUTPUT_VARIABLE output)
   #    set(SKIP_TZ FALSE)
   #    if("${output}" MATCHES "script")
@@ -348,39 +348,39 @@ IF(UNIX AND NOT APPLE)
   #    if(NOT SKIP_TZ)
   #      message("compress found and it was not a script")
   #      message("output from file command: [${output}]")
-  #      SET(CPACK_GENERATOR "${CPACK_GENERATOR};TZ")
+  #      set(CPACK_GENERATOR "${CPACK_GENERATOR};TZ")
   #    else(NOT SKIP_TZ)
   #      message("compress found, but it was a script so dont use it")
   #      message("output from file command: [${output}]")
   #    endif(NOT SKIP_TZ)
-  #  ENDIF(found_compress)
-  FIND_PROGRAM(found_bz2
+  #  endif(found_compress)
+  find_program(found_bz2
     NAMES bzip2)
-  IF(found_bz2)
-    SET(CPACK_GENERATOR "${CPACK_GENERATOR};TBZ2")
-  ENDIF(found_bz2)
-ENDIF(UNIX AND NOT APPLE)
+  if(found_bz2)
+    set(CPACK_GENERATOR "${CPACK_GENERATOR};TBZ2")
+  endif(found_bz2)
+endif(UNIX AND NOT APPLE)
 
-SET(CPACK_PACKAGE_EXECUTABLES "SimpleInstall" "Simple Install")
-SET(CMAKE_INSTALL_MFC_LIBRARIES 1)
-SET(CMAKE_INSTALL_DEBUG_LIBRARIES 1)
-INCLUDE(InstallRequiredSystemLibraries)
+set(CPACK_PACKAGE_EXECUTABLES "SimpleInstall" "Simple Install")
+set(CMAKE_INSTALL_MFC_LIBRARIES 1)
+set(CMAKE_INSTALL_DEBUG_LIBRARIES 1)
+include(InstallRequiredSystemLibraries)
 
-IF(CTEST_TEST_CPACK)
-  SET(PACKAGE_TARGET --build-target package)
+if(CTEST_TEST_CPACK)
+  set(PACKAGE_TARGET --build-target package)
 
   # Avoid settings that require the .zip file command line tools...
   # (just build an NSIS installer without component support)
   #
-  SET(CPACK_BINARY_ZIP OFF)
-  SET(CPACK_MONOLITHIC_INSTALL ON)
-ELSE(CTEST_TEST_CPACK)
-  SET(PACKAGE_TARGET)
-ENDIF(CTEST_TEST_CPACK)
+  set(CPACK_BINARY_ZIP OFF)
+  set(CPACK_MONOLITHIC_INSTALL ON)
+else(CTEST_TEST_CPACK)
+  set(PACKAGE_TARGET)
+endif(CTEST_TEST_CPACK)
 
-INCLUDE(CPack)
+include(CPack)
 
-ADD_CUSTOM_COMMAND(
+add_custom_command(
   TARGET ${install_target}
   POST_BUILD
   COMMAND ${CMAKE_CTEST_COMMAND}
diff --git a/Tests/SimpleInstall/InstallScript1.cmake b/Tests/SimpleInstall/InstallScript1.cmake
index 27b7725f8..85465bfed 100644
--- a/Tests/SimpleInstall/InstallScript1.cmake
+++ b/Tests/SimpleInstall/InstallScript1.cmake
@@ -1,5 +1,5 @@
-MESSAGE("This is install script 1.")
-SET(INSTALL_SCRIPT_1_DID_RUN 1)
-IF(INSTALL_CODE_DID_RUN)
-  MESSAGE(FATAL_ERROR "Install script 1 did not run before install code.")
-ENDIF(INSTALL_CODE_DID_RUN)
+message("This is install script 1.")
+set(INSTALL_SCRIPT_1_DID_RUN 1)
+if(INSTALL_CODE_DID_RUN)
+  message(FATAL_ERROR "Install script 1 did not run before install code.")
+endif(INSTALL_CODE_DID_RUN)
diff --git a/Tests/SimpleInstall/InstallScript2.cmake b/Tests/SimpleInstall/InstallScript2.cmake
index 927cae8b6..a675df7ea 100644
--- a/Tests/SimpleInstall/InstallScript2.cmake
+++ b/Tests/SimpleInstall/InstallScript2.cmake
@@ -1,14 +1,14 @@
-MESSAGE("This is install script 2.")
-IF(INSTALL_SCRIPT_1_DID_RUN)
-  MESSAGE("Install script ordering works.")
-ELSE(INSTALL_SCRIPT_1_DID_RUN)
-  MESSAGE(FATAL_ERROR "Install script 1 did not run before install script 2.")
-ENDIF(INSTALL_SCRIPT_1_DID_RUN)
-IF(INSTALL_CODE_DID_RUN)
-  MESSAGE("Install code ordering works.")
-ELSE(INSTALL_CODE_DID_RUN)
-  MESSAGE(FATAL_ERROR "Install script 2 did not run after install code.")
-ENDIF(INSTALL_CODE_DID_RUN)
-FILE(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake"
-  "SET(CMAKE_INSTALL_SCRIPT_DID_RUN 1)\n"
+message("This is install script 2.")
+if(INSTALL_SCRIPT_1_DID_RUN)
+  message("Install script ordering works.")
+else(INSTALL_SCRIPT_1_DID_RUN)
+  message(FATAL_ERROR "Install script 1 did not run before install script 2.")
+endif(INSTALL_SCRIPT_1_DID_RUN)
+if(INSTALL_CODE_DID_RUN)
+  message("Install code ordering works.")
+else(INSTALL_CODE_DID_RUN)
+  message(FATAL_ERROR "Install script 2 did not run after install code.")
+endif(INSTALL_CODE_DID_RUN)
+file(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake"
+  "set(CMAKE_INSTALL_SCRIPT_DID_RUN 1)\n"
   )
diff --git a/Tests/SimpleInstall/InstallScript3.cmake b/Tests/SimpleInstall/InstallScript3.cmake
index b1aecd4c2..a955be146 100644
--- a/Tests/SimpleInstall/InstallScript3.cmake
+++ b/Tests/SimpleInstall/InstallScript3.cmake
@@ -1,12 +1,12 @@
-MESSAGE("This is install script 3.")
-SET(INSTALL_SCRIPT_3_DID_RUN 1)
-IF(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
-  MESSAGE(FATAL_ERROR "Install script 3 did not run before install code with component.")
-ENDIF(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
+message("This is install script 3.")
+set(INSTALL_SCRIPT_3_DID_RUN 1)
+if(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
+  message(FATAL_ERROR "Install script 3 did not run before install code with component.")
+endif(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
 
-IF(CMAKE_INSTALL_COMPONENT)
-IF(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
-  MESSAGE("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"")
-  MESSAGE(FATAL_ERROR "Install script 3 should only run for \"Development\" INSTALL COMPONENT.")
-ENDIF(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
-ENDIF(CMAKE_INSTALL_COMPONENT)
+if(CMAKE_INSTALL_COMPONENT)
+if(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
+  message("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"")
+  message(FATAL_ERROR "Install script 3 should only run for \"Development\" INSTALL COMPONENT.")
+endif(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
+endif(CMAKE_INSTALL_COMPONENT)
diff --git a/Tests/SimpleInstall/InstallScript4.cmake b/Tests/SimpleInstall/InstallScript4.cmake
index 0ffea4bc8..0bbd9d2c8 100644
--- a/Tests/SimpleInstall/InstallScript4.cmake
+++ b/Tests/SimpleInstall/InstallScript4.cmake
@@ -1,22 +1,22 @@
-MESSAGE("This is install script 4.")
-IF(INSTALL_SCRIPT_3_DID_RUN)
-  MESSAGE("Install script ordering works.")
-ELSE(INSTALL_SCRIPT_3_DID_RUN)
-  MESSAGE(FATAL_ERROR "Install script 3 did not run before install script 4.")
-ENDIF(INSTALL_SCRIPT_3_DID_RUN)
-IF(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
-  MESSAGE("Install code ordering works.")
-ELSE(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
-  MESSAGE(FATAL_ERROR "Install script 4 did not run after install with component code.")
-ENDIF(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
+message("This is install script 4.")
+if(INSTALL_SCRIPT_3_DID_RUN)
+  message("Install script ordering works.")
+else(INSTALL_SCRIPT_3_DID_RUN)
+  message(FATAL_ERROR "Install script 3 did not run before install script 4.")
+endif(INSTALL_SCRIPT_3_DID_RUN)
+if(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
+  message("Install code ordering works.")
+else(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
+  message(FATAL_ERROR "Install script 4 did not run after install with component code.")
+endif(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
 
-IF(CMAKE_INSTALL_COMPONENT)
-IF(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
-  MESSAGE("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"")
-  MESSAGE(FATAL_ERROR "Install script 4 should only run for \"Development\" INSTALL COMPONENT.")
-ENDIF(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
-ENDIF(CMAKE_INSTALL_COMPONENT)
+if(CMAKE_INSTALL_COMPONENT)
+if(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
+  message("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"")
+  message(FATAL_ERROR "Install script 4 should only run for \"Development\" INSTALL COMPONENT.")
+endif(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
+endif(CMAKE_INSTALL_COMPONENT)
 
-FILE(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScript4Out.cmake"
-  "SET(CMAKE_INSTALL_SCRIPT_4_DID_RUN 1)\n"
+file(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScript4Out.cmake"
+  "set(CMAKE_INSTALL_SCRIPT_4_DID_RUN 1)\n"
   )
diff --git a/Tests/SimpleInstall/PackageScript.cmake b/Tests/SimpleInstall/PackageScript.cmake
index 36429e2f7..be07f89cc 100644
--- a/Tests/SimpleInstall/PackageScript.cmake
+++ b/Tests/SimpleInstall/PackageScript.cmake
@@ -1,10 +1,10 @@
-MESSAGE("This is packaging script")
-MESSAGE("It writes a file with all variables available in ${CMAKE_INSTALL_PREFIX}/AllVariables.txt")
+message("This is packaging script")
+message("It writes a file with all variables available in ${CMAKE_INSTALL_PREFIX}/AllVariables.txt")
 
-FILE(WRITE ${CMAKE_INSTALL_PREFIX}/AllVariables.txt "")
-GET_CMAKE_PROPERTY(res VARIABLES)
-FOREACH(var ${res})
-  FILE(APPEND ${CMAKE_INSTALL_PREFIX}/AllVariables.txt
+file(WRITE ${CMAKE_INSTALL_PREFIX}/AllVariables.txt "")
+get_cmake_property(res VARIABLES)
+foreach(var ${res})
+  file(APPEND ${CMAKE_INSTALL_PREFIX}/AllVariables.txt
              "${var} \"${${var}}\"\n")
-ENDFOREACH(var ${res})
+endforeach(var ${res})
 
diff --git a/Tests/SimpleInstall/PostInstall.cmake b/Tests/SimpleInstall/PostInstall.cmake
index 52ea140a5..222cc5ae9 100644
--- a/Tests/SimpleInstall/PostInstall.cmake
+++ b/Tests/SimpleInstall/PostInstall.cmake
@@ -1,6 +1,6 @@
-MESSAGE("In post install")
-IF(PRE_INSTALL_DID_RUN)
-  MESSAGE("Pre and post install work fine")
-ELSE(PRE_INSTALL_DID_RUN)
-  MESSAGE(FATAL_ERROR "Pre install did not run before post install")
-ENDIF(PRE_INSTALL_DID_RUN)
+message("In post install")
+if(PRE_INSTALL_DID_RUN)
+  message("Pre and post install work fine")
+else(PRE_INSTALL_DID_RUN)
+  message(FATAL_ERROR "Pre install did not run before post install")
+endif(PRE_INSTALL_DID_RUN)
diff --git a/Tests/SimpleInstall/PreInstall.cmake b/Tests/SimpleInstall/PreInstall.cmake
index 2ea2f7716..7a9851e1d 100644
--- a/Tests/SimpleInstall/PreInstall.cmake
+++ b/Tests/SimpleInstall/PreInstall.cmake
@@ -1,2 +1,2 @@
-MESSAGE("This is in pre install")
-SET(PRE_INSTALL_DID_RUN 1)
+message("This is in pre install")
+set(PRE_INSTALL_DID_RUN 1)
diff --git a/Tests/SimpleInstall/TestSubDir/CMakeLists.txt b/Tests/SimpleInstall/TestSubDir/CMakeLists.txt
index 4f6295300..860e10425 100644
--- a/Tests/SimpleInstall/TestSubDir/CMakeLists.txt
+++ b/Tests/SimpleInstall/TestSubDir/CMakeLists.txt
@@ -1,3 +1,3 @@
-ADD_EXECUTABLE(TSD TSD.cxx TSD_utils.cxx)
-INSTALL_FILES(/MyTest/include FILES TSD.h)
-INSTALL_TARGETS(/MyTest/bin TSD)
+add_executable(TSD TSD.cxx TSD_utils.cxx)
+install_files(/MyTest/include FILES TSD.h)
+install_targets(/MyTest/bin TSD)
diff --git a/Tests/SimpleInstall/scripts/CMakeLists.txt b/Tests/SimpleInstall/scripts/CMakeLists.txt
index d46c1652e..ec34e8c50 100644
--- a/Tests/SimpleInstall/scripts/CMakeLists.txt
+++ b/Tests/SimpleInstall/scripts/CMakeLists.txt
@@ -1 +1 @@
-INSTALL_PROGRAMS(/MyTest/share/old3 "^sample_script(\\.bat)?$")
+install_programs(/MyTest/share/old3 "^sample_script(\\.bat)?$")
diff --git a/Tests/SimpleInstallS2/CMakeLists.txt b/Tests/SimpleInstallS2/CMakeLists.txt
index a47c546e7..f05587eb2 100644
--- a/Tests/SimpleInstallS2/CMakeLists.txt
+++ b/Tests/SimpleInstallS2/CMakeLists.txt
@@ -1,216 +1,216 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT (TestSimpleInstall)
-SET(CMAKE_VERBOSE_MAKEFILE 1)
-SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY
+project (TestSimpleInstall)
+set(CMAKE_VERBOSE_MAKEFILE 1)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY
   "${TestSimpleInstall_BINARY_DIR}/bin")
-SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY
   "${TestSimpleInstall_BINARY_DIR}/lib/static")
-SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY
   "${TestSimpleInstall_BINARY_DIR}/lib")
 
 # Skip generating the rpath pointing at the build tree to make sure
 # the executable is installed with the proper rpath in the install
 # tree.
-SET(CMAKE_SKIP_BUILD_RPATH 1)
+set(CMAKE_SKIP_BUILD_RPATH 1)
 
 # Make sure the executable can run from the install tree.
-SET(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/MyTest/lib)
+set(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/MyTest/lib)
 
 # Skip the dependency that causes a build when installing.  This
 # avoids infinite loops when the post-build rule below installs.
-SET(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY 1)
-SET(CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY 1)
+set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY 1)
+set(CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY 1)
 
-SET(CMAKE_DEBUG_POSTFIX "_test_debug_postfix")
+set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix")
 
-SET(EXTRA_INSTALL_FLAGS)
-MESSAGE("Extra install: ${EXTRA_INSTALL_FLAGS}")
+set(EXTRA_INSTALL_FLAGS)
+message("Extra install: ${EXTRA_INSTALL_FLAGS}")
 
-IF(STAGE2)
-  SET(LIBPATHS
+if(STAGE2)
+  set(LIBPATHS
     ${CMAKE_INSTALL_PREFIX}/MyTest/lib/static
     ${CMAKE_INSTALL_PREFIX}/MyTest/lib
     )
-  SET(t1NAMES test1 test1${CMAKE_DEBUG_POSTFIX} test1rel)
-  SET(t2NAMES test2 test2${CMAKE_DEBUG_POSTFIX})
-  SET(t4NAMES test4out test4out${CMAKE_DEBUG_POSTFIX})
+  set(t1NAMES test1 test1${CMAKE_DEBUG_POSTFIX} test1rel)
+  set(t2NAMES test2 test2${CMAKE_DEBUG_POSTFIX})
+  set(t4NAMES test4out test4out${CMAKE_DEBUG_POSTFIX})
 
   # Make sure the install script ran.
-  SET(CMAKE_INSTALL_SCRIPT_DID_RUN 0)
-  INCLUDE(${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake OPTIONAL)
-  IF(CMAKE_INSTALL_SCRIPT_DID_RUN)
-    MESSAGE(STATUS "Stage 1 did run install script 2.")
-  ELSE(CMAKE_INSTALL_SCRIPT_DID_RUN)
-    MESSAGE(SEND_ERROR "Stage 1 did not run install script 2.")
-  ENDIF(CMAKE_INSTALL_SCRIPT_DID_RUN)
+  set(CMAKE_INSTALL_SCRIPT_DID_RUN 0)
+  include(${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake OPTIONAL)
+  if(CMAKE_INSTALL_SCRIPT_DID_RUN)
+    message(STATUS "Stage 1 did run install script 2.")
+  else(CMAKE_INSTALL_SCRIPT_DID_RUN)
+    message(SEND_ERROR "Stage 1 did not run install script 2.")
+  endif(CMAKE_INSTALL_SCRIPT_DID_RUN)
 
-  IF(CYGWIN OR MINGW)
-    SET(LIBPATHS ${LIBPATHS} "${CMAKE_INSTALL_PREFIX}/MyTest/bin")
-  ENDIF(CYGWIN OR MINGW)
-  MESSAGE("Search for library in: ${LIBPATHS}")
+  if(CYGWIN OR MINGW)
+    set(LIBPATHS ${LIBPATHS} "${CMAKE_INSTALL_PREFIX}/MyTest/bin")
+  endif(CYGWIN OR MINGW)
+  message("Search for library in: ${LIBPATHS}")
 
-  SET(TEST1_LIBRARY "TEST1_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE)
-  SET(TEST2_LIBRARY "TEST2_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE)
-  SET(TEST4_LIBRARY "TEST4_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE)
+  set(TEST1_LIBRARY "TEST1_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE)
+  set(TEST2_LIBRARY "TEST2_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE)
+  set(TEST4_LIBRARY "TEST4_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE)
 
-  FIND_LIBRARY(TEST1_LIBRARY
+  find_library(TEST1_LIBRARY
     NAMES ${t1NAMES}
     PATHS ${LIBPATHS}
     DOC "First library")
-  FIND_LIBRARY(TEST2_LIBRARY
+  find_library(TEST2_LIBRARY
     NAMES ${t2NAMES}
     PATHS ${LIBPATHS}
     DOC "Second library")
-  FIND_LIBRARY(TEST4_LIBRARY
+  find_library(TEST4_LIBRARY
     NAMES ${t4NAMES}
     PATHS ${LIBPATHS}
     DOC "Fourth library")
 
   # Test importing a library found on disk.
-  ADD_LIBRARY(lib_test4 UNKNOWN IMPORTED)
-  SET_PROPERTY(TARGET lib_test4 PROPERTY IMPORTED_LOCATION ${TEST4_LIBRARY})
+  add_library(lib_test4 UNKNOWN IMPORTED)
+  set_property(TARGET lib_test4 PROPERTY IMPORTED_LOCATION ${TEST4_LIBRARY})
 
-  INCLUDE_DIRECTORIES(${CMAKE_INSTALL_PREFIX}/MyTest/include)
-  ADD_EXECUTABLE (SimpleInstExeS2 inst2.cxx foo.c foo.h)
-  TARGET_LINK_LIBRARIES(SimpleInstExeS2 ${TEST1_LIBRARY} ${TEST2_LIBRARY} lib_test4)
-  SET(install_target SimpleInstExeS2)
+  include_directories(${CMAKE_INSTALL_PREFIX}/MyTest/include)
+  add_executable (SimpleInstExeS2 inst2.cxx foo.c foo.h)
+  target_link_libraries(SimpleInstExeS2 ${TEST1_LIBRARY} ${TEST2_LIBRARY} lib_test4)
+  set(install_target SimpleInstExeS2)
 
-  IF("${TEST1_LIBRARY}" MATCHES "static")
-    MESSAGE(STATUS "test1 correctly found in lib/static")
-  ELSE("${TEST1_LIBRARY}" MATCHES "static")
-    MESSAGE(SEND_ERROR "test1 not found in lib/static!")
-  ENDIF("${TEST1_LIBRARY}" MATCHES "static")
+  if("${TEST1_LIBRARY}" MATCHES "static")
+    message(STATUS "test1 correctly found in lib/static")
+  else("${TEST1_LIBRARY}" MATCHES "static")
+    message(SEND_ERROR "test1 not found in lib/static!")
+  endif("${TEST1_LIBRARY}" MATCHES "static")
 
   # Check for failure of configuration-specific installation.
-  IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h")
-    MESSAGE(FATAL_ERROR "Debug-configuration file installed for Release!")
-  ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h")
-  IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h")
-    MESSAGE(FATAL_ERROR "Release-configuration file installed for Debug!")
-  ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h")
+  if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h")
+    message(FATAL_ERROR "Debug-configuration file installed for Release!")
+  endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h")
+  if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h")
+    message(FATAL_ERROR "Release-configuration file installed for Debug!")
+  endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h")
 
   # Check for failure of directory installation.
-  IF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h")
-    MESSAGE(FATAL_ERROR "Directory installation did not install TSD.h")
-  ENDIF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h")
-  IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS")
-    MESSAGE(FATAL_ERROR "Directory installation installed CVS directory.")
-  ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS")
-  IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS")
-    MESSAGE(FATAL_ERROR "Directory installation installed CVS directory.")
-  ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS")
-  IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt")
-    MESSAGE(FATAL_ERROR "Directory installation installed CMakeLists.txt.")
-  ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt")
-  IF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h")
-    MESSAGE(FATAL_ERROR "Directory installation did not install alternate TSD.h")
-  ENDIF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h")
-  IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx")
-    MESSAGE(FATAL_ERROR "Directory installation installed alternate TSD.cxx")
-  ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx")
+  if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h")
+    message(FATAL_ERROR "Directory installation did not install TSD.h")
+  endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h")
+  if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS")
+    message(FATAL_ERROR "Directory installation installed CVS directory.")
+  endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS")
+  if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS")
+    message(FATAL_ERROR "Directory installation installed CVS directory.")
+  endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS")
+  if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt")
+    message(FATAL_ERROR "Directory installation installed CMakeLists.txt.")
+  endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt")
+  if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h")
+    message(FATAL_ERROR "Directory installation did not install alternate TSD.h")
+  endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h")
+  if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx")
+    message(FATAL_ERROR "Directory installation installed alternate TSD.cxx")
+  endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx")
 
   # Check that scripts properly installed.
-  IF(WIN32 AND NOT CYGWIN)
-    SET(BAT .bat)
-  ELSE(WIN32 AND NOT CYGWIN)
-    SET(BAT)
-  ENDIF(WIN32 AND NOT CYGWIN)
-  FOREACH(loc share share/old1 share/old2 share/old3 share/alt)
-    SET(CUR_SCRIPT "${CMAKE_INSTALL_PREFIX}/MyTest/${loc}/sample_script${BAT}")
-    EXECUTE_PROCESS(
+  if(WIN32 AND NOT CYGWIN)
+    set(BAT .bat)
+  else(WIN32 AND NOT CYGWIN)
+    set(BAT)
+  endif(WIN32 AND NOT CYGWIN)
+  foreach(loc share share/old1 share/old2 share/old3 share/alt)
+    set(CUR_SCRIPT "${CMAKE_INSTALL_PREFIX}/MyTest/${loc}/sample_script${BAT}")
+    execute_process(
       COMMAND ${CUR_SCRIPT}
       RESULT_VARIABLE SAMPLE_SCRIPT_RESULT
       OUTPUT_VARIABLE SAMPLE_SCRIPT_OUTPUT
       )
-    IF(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$")
-      MESSAGE(FATAL_ERROR
+    if(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$")
+      message(FATAL_ERROR
         "Sample script [${CUR_SCRIPT}] failed: [${SAMPLE_SCRIPT_RESULT}]")
-    ENDIF(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$")
-    IF(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output")
-      MESSAGE(FATAL_ERROR
+    endif(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$")
+    if(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output")
+      message(FATAL_ERROR
         "Bad sample script [${CUR_SCRIPT}] output: [${SAMPLE_SCRIPT_OUTPUT}]")
-    ENDIF(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output")
-  ENDFOREACH(loc)
+    endif(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output")
+  endforeach(loc)
 
   # Check for failure of empty directory installation.
-  IF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty")
-    MESSAGE(FATAL_ERROR "Empty directory installation did not install.")
-  ENDIF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty")
-  FILE(GLOB EMPTY_FILES "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty/*")
-  IF(EMPTY_FILES)
-    MESSAGE(FATAL_ERROR "Empty directory installed [${EMPTY_FILES}].")
-  ENDIF(EMPTY_FILES)
+  if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty")
+    message(FATAL_ERROR "Empty directory installation did not install.")
+  endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty")
+  file(GLOB EMPTY_FILES "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty/*")
+  if(EMPTY_FILES)
+    message(FATAL_ERROR "Empty directory installed [${EMPTY_FILES}].")
+  endif(EMPTY_FILES)
 
   # Make sure the test executable can run from the install tree.
-  SET_TARGET_PROPERTIES(SimpleInstExeS2 PROPERTIES
+  set_target_properties(SimpleInstExeS2 PROPERTIES
     INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/MyTest/lib)
 
-  INSTALL_TARGETS(/MyTest/bin SimpleInstExeS2)
+  install_targets(/MyTest/bin SimpleInstExeS2)
 
 # try to import the exported targets again
-  SET(SimpleInstallS1_DIR ${CMAKE_INSTALL_PREFIX}/MyTest/lib)
-  FIND_PACKAGE(SimpleInstallS1 REQUIRED)
-  GET_TARGET_PROPERTY(simpleInstallImported S1_SimpleInstall IMPORTED)
-  IF(NOT simpleInstallImported)
-    MESSAGE(FATAL_ERROR "Target S1_SimpleInstall could not be imported")
-  ENDIF(NOT simpleInstallImported)
+  set(SimpleInstallS1_DIR ${CMAKE_INSTALL_PREFIX}/MyTest/lib)
+  find_package(SimpleInstallS1 REQUIRED)
+  get_target_property(simpleInstallImported S1_SimpleInstall IMPORTED)
+  if(NOT simpleInstallImported)
+    message(FATAL_ERROR "Target S1_SimpleInstall could not be imported")
+  endif(NOT simpleInstallImported)
 
-ELSE(STAGE2)
+else(STAGE2)
   # Wipe out the install directory to do a fresh test.
-  FILE(REMOVE_RECURSE ${CMAKE_INSTALL_PREFIX}/MyTest)
+  file(REMOVE_RECURSE ${CMAKE_INSTALL_PREFIX}/MyTest)
 
   # this is stage 1, so create libraries and modules and install everything
-  ADD_LIBRARY(test1 STATIC lib1.cxx)
-  ADD_LIBRARY(test2 SHARED lib2.cxx)
-  ADD_LIBRARY(test3 MODULE lib3.cxx)
-  ADD_LIBRARY(test4 SHARED lib4.cxx)
+  add_library(test1 STATIC lib1.cxx)
+  add_library(test2 SHARED lib2.cxx)
+  add_library(test3 MODULE lib3.cxx)
+  add_library(test4 SHARED lib4.cxx)
 
   # Test <ARCHIVE|LIBRARY|RUNTIME>_OUTPUT_NAME properties.
-  SET_PROPERTY(TARGET test4 PROPERTY ARCHIVE_OUTPUT_NAME test4out)
-  SET_PROPERTY(TARGET test4 PROPERTY LIBRARY_OUTPUT_NAME test4out)
+  set_property(TARGET test4 PROPERTY ARCHIVE_OUTPUT_NAME test4out)
+  set_property(TARGET test4 PROPERTY LIBRARY_OUTPUT_NAME test4out)
 
-  ADD_EXECUTABLE (SimpleInstall inst.cxx foo.c foo.h)
-  TARGET_LINK_LIBRARIES(SimpleInstall test1 test2 test4)
-  SET(install_target SimpleInstall)
+  add_executable (SimpleInstall inst.cxx foo.c foo.h)
+  target_link_libraries(SimpleInstall test1 test2 test4)
+  set(install_target SimpleInstall)
 
-  SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES OUTPUT_NAME SimpleInstExe)
+  set_target_properties(SimpleInstall PROPERTIES OUTPUT_NAME SimpleInstExe)
   # Disable VERSION test until it is implemented in the Xcode generator.
-  IF(NOT XCODE)
-    SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES VERSION 1.2)
-  ENDIF(NOT XCODE)
+  if(NOT XCODE)
+    set_target_properties(SimpleInstall PROPERTIES VERSION 1.2)
+  endif(NOT XCODE)
 
   # Make sure the test executable can run from the install tree.
-  SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES
+  set_target_properties(SimpleInstall PROPERTIES
     INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/MyTest/lib)
 
   # Test per-configuration output name.
-  SET_TARGET_PROPERTIES(test1 PROPERTIES RELEASE_OUTPUT_NAME test1rel)
-  SET_TARGET_PROPERTIES(test2 PROPERTIES PUBLIC_HEADER foo.h)
+  set_target_properties(test1 PROPERTIES RELEASE_OUTPUT_NAME test1rel)
+  set_target_properties(test2 PROPERTIES PUBLIC_HEADER foo.h)
 
-  IF(CMAKE_GENERATOR MATCHES "Makefiles")
-    ADD_SUBDIRECTORY(TestSubDir)
-    ADD_DEPENDENCIES(SimpleInstall TSD)
-  ENDIF(CMAKE_GENERATOR MATCHES "Makefiles")
+  if(CMAKE_GENERATOR MATCHES "Makefiles")
+    add_subdirectory(TestSubDir)
+    add_dependencies(SimpleInstall TSD)
+  endif(CMAKE_GENERATOR MATCHES "Makefiles")
 
-  ADD_DEPENDENCIES(SimpleInstall test3)
-  ADD_DEPENDENCIES(test2 test3)
-  ADD_DEPENDENCIES(test4 test2)
+  add_dependencies(SimpleInstall test3)
+  add_dependencies(test2 test3)
+  add_dependencies(test4 test2)
 
-  INSTALL(TARGETS SimpleInstall test1 test2 test3 EXPORT SimpleInstallS1
+  install(TARGETS SimpleInstall test1 test2 test3 EXPORT SimpleInstallS1
     RUNTIME DESTINATION MyTest/bin        COMPONENT Runtime     # .exe, .dll
     LIBRARY DESTINATION MyTest/lib        COMPONENT Runtime     # .so, mod.dll
     ARCHIVE DESTINATION MyTest/lib/static COMPONENT Development # .a, .lib
     PUBLIC_HEADER DESTINATION MyTest/include COMPONENT Development
     )
 
-  INSTALL(TARGETS test4 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+  install(TARGETS test4 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
     RUNTIME DESTINATION MyTest/bin
     LIBRARY DESTINATION MyTest/lib
     ARCHIVE DESTINATION MyTest/lib/static
     OPTIONAL # for coverage...target should always exist
     )
-  INSTALL(FILES lib1.h DESTINATION MyTest/include/foo)
-  INSTALL(FILES lib2.h
+  install(FILES lib1.h DESTINATION MyTest/include/foo)
+  install(FILES lib2.h
     DESTINATION MyTest/include/foo
     COMPONENT Development
     PERMISSIONS OWNER_READ OWNER_WRITE
@@ -218,40 +218,40 @@ ELSE(STAGE2)
     )
 
   # Test old-style install commands.
-  INSTALL_FILES(/MyTest/include FILES lib3.h)
-  INSTALL_FILES(/MyTest/include/old .h lib3)
-  INSTALL_FILES(/MyTest/include/old "^lib2.h$")
-  INSTALL_PROGRAMS(/MyTest/share/old1 FILES
+  install_files(/MyTest/include FILES lib3.h)
+  install_files(/MyTest/include/old .h lib3)
+  install_files(/MyTest/include/old "^lib2.h$")
+  install_programs(/MyTest/share/old1 FILES
     scripts/sample_script scripts/sample_script.bat)
-  INSTALL_PROGRAMS(/MyTest/share/old2
+  install_programs(/MyTest/share/old2
     scripts/sample_script scripts/sample_script.bat)
 
 # "export" the targets collected in "SimpleInstallS1"
-  INSTALL(EXPORT SimpleInstallS1 FILE SimpleInstallS1Config.cmake
+  install(EXPORT SimpleInstallS1 FILE SimpleInstallS1Config.cmake
                                  DESTINATION MyTest/lib
                                  NAMESPACE S1_ )
 
-  EXPORT(TARGETS SimpleInstall test1 test2 test3
+  export(TARGETS SimpleInstall test1 test2 test3
          FILE "${CMAKE_CURRENT_BINARY_DIR}/SimpleInstallS1Config.cmake"
          NAMESPACE S2_ )
 
-  ADD_SUBDIRECTORY(scripts)
+  add_subdirectory(scripts)
 
   # Test optional installation.
-  INSTALL(FILES does_not_exist.h DESTINATION MyTest/include/foo OPTIONAL)
+  install(FILES does_not_exist.h DESTINATION MyTest/include/foo OPTIONAL)
 
   # Test configuration-specific installation.
-  INSTALL(FILES lib1.h RENAME lib1release.h CONFIGURATIONS Release
+  install(FILES lib1.h RENAME lib1release.h CONFIGURATIONS Release
     DESTINATION MyTest/include/Release
     )
-  INSTALL(FILES lib1.h RENAME lib1debug.h CONFIGURATIONS Debug
+  install(FILES lib1.h RENAME lib1debug.h CONFIGURATIONS Debug
     DESTINATION MyTest/include/Debug
     )
 
   # Test directory installation.
-  FILE(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS")
-  FILE(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS")
-  INSTALL(
+  file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS")
+  file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS")
+  install(
     DIRECTORY TestSubDir scripts/ DESTINATION MyTest/share
     FILE_PERMISSIONS OWNER_READ OWNER_WRITE
     DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
@@ -262,14 +262,14 @@ ELSE(STAGE2)
     )
 
   # Alternate directory installation for coverage.
-  INSTALL(
+  install(
     DIRECTORY scripts/ DESTINATION MyTest/share/alt
     COMPONENT Development
     USE_SOURCE_PERMISSIONS
     PATTERN "CVS" EXCLUDE
     REGEX "\\.txt$" EXCLUDE
     )
-  INSTALL(
+  install(
     DIRECTORY TestSubDir DESTINATION MyTest/share/alt
     FILE_PERMISSIONS OWNER_READ OWNER_WRITE
     DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
@@ -278,65 +278,65 @@ ELSE(STAGE2)
     )
 
   # Test empty directory installation.
-  INSTALL(DIRECTORY DESTINATION MyTest/share/empty)
+  install(DIRECTORY DESTINATION MyTest/share/empty)
 
   # Test optional directory installation.
-  INSTALL(DIRECTORY does-not-exist DESTINATION MyTest/share OPTIONAL)
+  install(DIRECTORY does-not-exist DESTINATION MyTest/share OPTIONAL)
 
   # Test user-specified install scripts, with and without COMPONENT.
-  INSTALL(
+  install(
     SCRIPT InstallScript1.cmake
-    CODE "SET(INSTALL_CODE_DID_RUN 1)"
+    CODE "set(INSTALL_CODE_DID_RUN 1)"
     SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/InstallScript2.cmake
     )
-  INSTALL(
+  install(
     SCRIPT InstallScript3.cmake
-    CODE "SET(INSTALL_CODE_WITH_COMPONENT_DID_RUN 1)"
+    CODE "set(INSTALL_CODE_WITH_COMPONENT_DID_RUN 1)"
     SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/InstallScript4.cmake
     COMPONENT Development
     )
-  SET_DIRECTORY_PROPERTIES(PROPERTIES
+  set_directory_properties(PROPERTIES
     ADDITIONAL_MAKE_CLEAN_FILES
     "${CMAKE_INSTALL_PREFIX}/InstallScriptOut.cmake;${CMAKE_INSTALL_PREFIX}/InstallScript4Out.cmake")
 
-  SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES PRE_INSTALL_SCRIPT
+  set_target_properties(SimpleInstall PROPERTIES PRE_INSTALL_SCRIPT
     ${CMAKE_CURRENT_SOURCE_DIR}/PreInstall.cmake)
-  SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES POST_INSTALL_SCRIPT
+  set_target_properties(SimpleInstall PROPERTIES POST_INSTALL_SCRIPT
     ${CMAKE_CURRENT_SOURCE_DIR}/PostInstall.cmake)
-  SET_TARGET_PROPERTIES(test4 PROPERTIES VERSION 1.2 SOVERSION 3
+  set_target_properties(test4 PROPERTIES VERSION 1.2 SOVERSION 3
         INSTALL_NAME_DIR @executable_path/../lib)
-ENDIF(STAGE2)
+endif(STAGE2)
 
-IF(CMAKE_CONFIGURATION_TYPES)
-  SET(SI_CONFIG -C ${CMAKE_CFG_INTDIR})
-ELSE(CMAKE_CONFIGURATION_TYPES)
-  SET(SI_CONFIG)
-ENDIF(CMAKE_CONFIGURATION_TYPES)
+if(CMAKE_CONFIGURATION_TYPES)
+  set(SI_CONFIG -C ${CMAKE_CFG_INTDIR})
+else(CMAKE_CONFIGURATION_TYPES)
+  set(SI_CONFIG)
+endif(CMAKE_CONFIGURATION_TYPES)
 
 # Dummy test of CPack
-SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Test of packaging with cpack")
-SET(CPACK_PACKAGE_VENDOR "Kitware")
-SET(CPACK_INSTALL_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/PackageScript.cmake")
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Test of packaging with cpack")
+set(CPACK_PACKAGE_VENDOR "Kitware")
+set(CPACK_INSTALL_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/PackageScript.cmake")
 
-IF(WIN32 AND NOT UNIX)
-  FIND_PROGRAM(NSIS_MAKENSIS NAMES makensis
+if(WIN32 AND NOT UNIX)
+  find_program(NSIS_MAKENSIS NAMES makensis
     PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS]
     DOC "Where is makensis.exe located"
     )
-  IF(NOT NSIS_MAKENSIS)
-    SET(CPACK_GENERATOR TGZ)
-  ENDIF(NOT NSIS_MAKENSIS)
-ENDIF(WIN32 AND NOT UNIX)
-IF(UNIX AND NOT APPLE)
-  SET(CPACK_GENERATOR "TGZ;STGZ;TZ")
-  #  FIND_PROGRAM(found_compress
+  if(NOT NSIS_MAKENSIS)
+    set(CPACK_GENERATOR TGZ)
+  endif(NOT NSIS_MAKENSIS)
+endif(WIN32 AND NOT UNIX)
+if(UNIX AND NOT APPLE)
+  set(CPACK_GENERATOR "TGZ;STGZ;TZ")
+  #  find_program(found_compress
   #    NAMES compress)
-  #  IF(found_compress)
-  #    FIND_PROGRAM(file_command NAMES file)
-  #    IF(NOT file_command)
+  #  if(found_compress)
+  #    find_program(file_command NAMES file)
+  #    if(NOT file_command)
   #      set(file_command file)
-  #    ENDIF(NOT file_command)
-  #    EXECUTE_PROCESS(COMMAND ${file_command} ${found_compress}
+  #    endif(NOT file_command)
+  #    execute_process(COMMAND ${file_command} ${found_compress}
   #      OUTPUT_VARIABLE output)
   #    set(SKIP_TZ FALSE)
   #    if("${output}" MATCHES "script")
@@ -348,39 +348,39 @@ IF(UNIX AND NOT APPLE)
   #    if(NOT SKIP_TZ)
   #      message("compress found and it was not a script")
   #      message("output from file command: [${output}]")
-  #      SET(CPACK_GENERATOR "${CPACK_GENERATOR};TZ")
+  #      set(CPACK_GENERATOR "${CPACK_GENERATOR};TZ")
   #    else(NOT SKIP_TZ)
   #      message("compress found, but it was a script so dont use it")
   #      message("output from file command: [${output}]")
   #    endif(NOT SKIP_TZ)
-  #  ENDIF(found_compress)
-  FIND_PROGRAM(found_bz2
+  #  endif(found_compress)
+  find_program(found_bz2
     NAMES bzip2)
-  IF(found_bz2)
-    SET(CPACK_GENERATOR "${CPACK_GENERATOR};TBZ2")
-  ENDIF(found_bz2)
-ENDIF(UNIX AND NOT APPLE)
+  if(found_bz2)
+    set(CPACK_GENERATOR "${CPACK_GENERATOR};TBZ2")
+  endif(found_bz2)
+endif(UNIX AND NOT APPLE)
 
-SET(CPACK_PACKAGE_EXECUTABLES "SimpleInstall" "Simple Install")
-SET(CMAKE_INSTALL_MFC_LIBRARIES 1)
-SET(CMAKE_INSTALL_DEBUG_LIBRARIES 1)
-INCLUDE(InstallRequiredSystemLibraries)
+set(CPACK_PACKAGE_EXECUTABLES "SimpleInstall" "Simple Install")
+set(CMAKE_INSTALL_MFC_LIBRARIES 1)
+set(CMAKE_INSTALL_DEBUG_LIBRARIES 1)
+include(InstallRequiredSystemLibraries)
 
-IF(CTEST_TEST_CPACK)
-  SET(PACKAGE_TARGET --build-target package)
+if(CTEST_TEST_CPACK)
+  set(PACKAGE_TARGET --build-target package)
 
   # Avoid settings that require the .zip file command line tools...
   # (just build an NSIS installer without component support)
   #
-  SET(CPACK_BINARY_ZIP OFF)
-  SET(CPACK_MONOLITHIC_INSTALL ON)
-ELSE(CTEST_TEST_CPACK)
-  SET(PACKAGE_TARGET)
-ENDIF(CTEST_TEST_CPACK)
+  set(CPACK_BINARY_ZIP OFF)
+  set(CPACK_MONOLITHIC_INSTALL ON)
+else(CTEST_TEST_CPACK)
+  set(PACKAGE_TARGET)
+endif(CTEST_TEST_CPACK)
 
-INCLUDE(CPack)
+include(CPack)
 
-ADD_CUSTOM_COMMAND(
+add_custom_command(
   TARGET ${install_target}
   POST_BUILD
   COMMAND ${CMAKE_CTEST_COMMAND}
diff --git a/Tests/SimpleInstallS2/InstallScript1.cmake b/Tests/SimpleInstallS2/InstallScript1.cmake
index 27b7725f8..85465bfed 100644
--- a/Tests/SimpleInstallS2/InstallScript1.cmake
+++ b/Tests/SimpleInstallS2/InstallScript1.cmake
@@ -1,5 +1,5 @@
-MESSAGE("This is install script 1.")
-SET(INSTALL_SCRIPT_1_DID_RUN 1)
-IF(INSTALL_CODE_DID_RUN)
-  MESSAGE(FATAL_ERROR "Install script 1 did not run before install code.")
-ENDIF(INSTALL_CODE_DID_RUN)
+message("This is install script 1.")
+set(INSTALL_SCRIPT_1_DID_RUN 1)
+if(INSTALL_CODE_DID_RUN)
+  message(FATAL_ERROR "Install script 1 did not run before install code.")
+endif(INSTALL_CODE_DID_RUN)
diff --git a/Tests/SimpleInstallS2/InstallScript2.cmake b/Tests/SimpleInstallS2/InstallScript2.cmake
index 927cae8b6..a675df7ea 100644
--- a/Tests/SimpleInstallS2/InstallScript2.cmake
+++ b/Tests/SimpleInstallS2/InstallScript2.cmake
@@ -1,14 +1,14 @@
-MESSAGE("This is install script 2.")
-IF(INSTALL_SCRIPT_1_DID_RUN)
-  MESSAGE("Install script ordering works.")
-ELSE(INSTALL_SCRIPT_1_DID_RUN)
-  MESSAGE(FATAL_ERROR "Install script 1 did not run before install script 2.")
-ENDIF(INSTALL_SCRIPT_1_DID_RUN)
-IF(INSTALL_CODE_DID_RUN)
-  MESSAGE("Install code ordering works.")
-ELSE(INSTALL_CODE_DID_RUN)
-  MESSAGE(FATAL_ERROR "Install script 2 did not run after install code.")
-ENDIF(INSTALL_CODE_DID_RUN)
-FILE(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake"
-  "SET(CMAKE_INSTALL_SCRIPT_DID_RUN 1)\n"
+message("This is install script 2.")
+if(INSTALL_SCRIPT_1_DID_RUN)
+  message("Install script ordering works.")
+else(INSTALL_SCRIPT_1_DID_RUN)
+  message(FATAL_ERROR "Install script 1 did not run before install script 2.")
+endif(INSTALL_SCRIPT_1_DID_RUN)
+if(INSTALL_CODE_DID_RUN)
+  message("Install code ordering works.")
+else(INSTALL_CODE_DID_RUN)
+  message(FATAL_ERROR "Install script 2 did not run after install code.")
+endif(INSTALL_CODE_DID_RUN)
+file(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake"
+  "set(CMAKE_INSTALL_SCRIPT_DID_RUN 1)\n"
   )
diff --git a/Tests/SimpleInstallS2/InstallScript3.cmake b/Tests/SimpleInstallS2/InstallScript3.cmake
index b1aecd4c2..a955be146 100644
--- a/Tests/SimpleInstallS2/InstallScript3.cmake
+++ b/Tests/SimpleInstallS2/InstallScript3.cmake
@@ -1,12 +1,12 @@
-MESSAGE("This is install script 3.")
-SET(INSTALL_SCRIPT_3_DID_RUN 1)
-IF(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
-  MESSAGE(FATAL_ERROR "Install script 3 did not run before install code with component.")
-ENDIF(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
+message("This is install script 3.")
+set(INSTALL_SCRIPT_3_DID_RUN 1)
+if(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
+  message(FATAL_ERROR "Install script 3 did not run before install code with component.")
+endif(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
 
-IF(CMAKE_INSTALL_COMPONENT)
-IF(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
-  MESSAGE("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"")
-  MESSAGE(FATAL_ERROR "Install script 3 should only run for \"Development\" INSTALL COMPONENT.")
-ENDIF(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
-ENDIF(CMAKE_INSTALL_COMPONENT)
+if(CMAKE_INSTALL_COMPONENT)
+if(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
+  message("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"")
+  message(FATAL_ERROR "Install script 3 should only run for \"Development\" INSTALL COMPONENT.")
+endif(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
+endif(CMAKE_INSTALL_COMPONENT)
diff --git a/Tests/SimpleInstallS2/InstallScript4.cmake b/Tests/SimpleInstallS2/InstallScript4.cmake
index 0ffea4bc8..0bbd9d2c8 100644
--- a/Tests/SimpleInstallS2/InstallScript4.cmake
+++ b/Tests/SimpleInstallS2/InstallScript4.cmake
@@ -1,22 +1,22 @@
-MESSAGE("This is install script 4.")
-IF(INSTALL_SCRIPT_3_DID_RUN)
-  MESSAGE("Install script ordering works.")
-ELSE(INSTALL_SCRIPT_3_DID_RUN)
-  MESSAGE(FATAL_ERROR "Install script 3 did not run before install script 4.")
-ENDIF(INSTALL_SCRIPT_3_DID_RUN)
-IF(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
-  MESSAGE("Install code ordering works.")
-ELSE(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
-  MESSAGE(FATAL_ERROR "Install script 4 did not run after install with component code.")
-ENDIF(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
+message("This is install script 4.")
+if(INSTALL_SCRIPT_3_DID_RUN)
+  message("Install script ordering works.")
+else(INSTALL_SCRIPT_3_DID_RUN)
+  message(FATAL_ERROR "Install script 3 did not run before install script 4.")
+endif(INSTALL_SCRIPT_3_DID_RUN)
+if(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
+  message("Install code ordering works.")
+else(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
+  message(FATAL_ERROR "Install script 4 did not run after install with component code.")
+endif(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
 
-IF(CMAKE_INSTALL_COMPONENT)
-IF(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
-  MESSAGE("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"")
-  MESSAGE(FATAL_ERROR "Install script 4 should only run for \"Development\" INSTALL COMPONENT.")
-ENDIF(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
-ENDIF(CMAKE_INSTALL_COMPONENT)
+if(CMAKE_INSTALL_COMPONENT)
+if(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
+  message("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"")
+  message(FATAL_ERROR "Install script 4 should only run for \"Development\" INSTALL COMPONENT.")
+endif(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
+endif(CMAKE_INSTALL_COMPONENT)
 
-FILE(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScript4Out.cmake"
-  "SET(CMAKE_INSTALL_SCRIPT_4_DID_RUN 1)\n"
+file(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScript4Out.cmake"
+  "set(CMAKE_INSTALL_SCRIPT_4_DID_RUN 1)\n"
   )
diff --git a/Tests/SimpleInstallS2/PackageScript.cmake b/Tests/SimpleInstallS2/PackageScript.cmake
index 36429e2f7..be07f89cc 100644
--- a/Tests/SimpleInstallS2/PackageScript.cmake
+++ b/Tests/SimpleInstallS2/PackageScript.cmake
@@ -1,10 +1,10 @@
-MESSAGE("This is packaging script")
-MESSAGE("It writes a file with all variables available in ${CMAKE_INSTALL_PREFIX}/AllVariables.txt")
+message("This is packaging script")
+message("It writes a file with all variables available in ${CMAKE_INSTALL_PREFIX}/AllVariables.txt")
 
-FILE(WRITE ${CMAKE_INSTALL_PREFIX}/AllVariables.txt "")
-GET_CMAKE_PROPERTY(res VARIABLES)
-FOREACH(var ${res})
-  FILE(APPEND ${CMAKE_INSTALL_PREFIX}/AllVariables.txt
+file(WRITE ${CMAKE_INSTALL_PREFIX}/AllVariables.txt "")
+get_cmake_property(res VARIABLES)
+foreach(var ${res})
+  file(APPEND ${CMAKE_INSTALL_PREFIX}/AllVariables.txt
              "${var} \"${${var}}\"\n")
-ENDFOREACH(var ${res})
+endforeach(var ${res})
 
diff --git a/Tests/SimpleInstallS2/PostInstall.cmake b/Tests/SimpleInstallS2/PostInstall.cmake
index 52ea140a5..222cc5ae9 100644
--- a/Tests/SimpleInstallS2/PostInstall.cmake
+++ b/Tests/SimpleInstallS2/PostInstall.cmake
@@ -1,6 +1,6 @@
-MESSAGE("In post install")
-IF(PRE_INSTALL_DID_RUN)
-  MESSAGE("Pre and post install work fine")
-ELSE(PRE_INSTALL_DID_RUN)
-  MESSAGE(FATAL_ERROR "Pre install did not run before post install")
-ENDIF(PRE_INSTALL_DID_RUN)
+message("In post install")
+if(PRE_INSTALL_DID_RUN)
+  message("Pre and post install work fine")
+else(PRE_INSTALL_DID_RUN)
+  message(FATAL_ERROR "Pre install did not run before post install")
+endif(PRE_INSTALL_DID_RUN)
diff --git a/Tests/SimpleInstallS2/PreInstall.cmake b/Tests/SimpleInstallS2/PreInstall.cmake
index 2ea2f7716..7a9851e1d 100644
--- a/Tests/SimpleInstallS2/PreInstall.cmake
+++ b/Tests/SimpleInstallS2/PreInstall.cmake
@@ -1,2 +1,2 @@
-MESSAGE("This is in pre install")
-SET(PRE_INSTALL_DID_RUN 1)
+message("This is in pre install")
+set(PRE_INSTALL_DID_RUN 1)
diff --git a/Tests/SimpleInstallS2/TestSubDir/CMakeLists.txt b/Tests/SimpleInstallS2/TestSubDir/CMakeLists.txt
index 4f6295300..860e10425 100644
--- a/Tests/SimpleInstallS2/TestSubDir/CMakeLists.txt
+++ b/Tests/SimpleInstallS2/TestSubDir/CMakeLists.txt
@@ -1,3 +1,3 @@
-ADD_EXECUTABLE(TSD TSD.cxx TSD_utils.cxx)
-INSTALL_FILES(/MyTest/include FILES TSD.h)
-INSTALL_TARGETS(/MyTest/bin TSD)
+add_executable(TSD TSD.cxx TSD_utils.cxx)
+install_files(/MyTest/include FILES TSD.h)
+install_targets(/MyTest/bin TSD)
diff --git a/Tests/SimpleInstallS2/scripts/CMakeLists.txt b/Tests/SimpleInstallS2/scripts/CMakeLists.txt
index d46c1652e..ec34e8c50 100644
--- a/Tests/SimpleInstallS2/scripts/CMakeLists.txt
+++ b/Tests/SimpleInstallS2/scripts/CMakeLists.txt
@@ -1 +1 @@
-INSTALL_PROGRAMS(/MyTest/share/old3 "^sample_script(\\.bat)?$")
+install_programs(/MyTest/share/old3 "^sample_script(\\.bat)?$")
diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt
index 13283d0c2..0af11f75b 100644
--- a/Tests/StringFileTest/CMakeLists.txt
+++ b/Tests/StringFileTest/CMakeLists.txt
@@ -1,164 +1,164 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(StringFileTest)
-INCLUDE_DIRECTORIES(${StringFileTest_BINARY_DIR})
+project(StringFileTest)
+include_directories(${StringFileTest_BINARY_DIR})
 
 # Read file test
-FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in" infile)
+file(READ "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in" infile)
 
 # Test reading a binary file into hex representation
-FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/test.bin" hexContents HEX)
+file(READ "${CMAKE_CURRENT_SOURCE_DIR}/test.bin" hexContents HEX)
 
-IF("${hexContents}" STREQUAL "0001027700")
-  MESSAGE("FILE(READ HEX) correctly read [${hexContents}]")
-ELSE("${hexContents}" STREQUAL "0001027700")
-  MESSAGE(SEND_ERROR "FILE(READ HEX) incorrectly read [${hexContents}], but expected was [0001027700]")
-ENDIF("${hexContents}" STREQUAL "0001027700")
+if("${hexContents}" STREQUAL "0001027700")
+  message("file(READ HEX) correctly read [${hexContents}]")
+else("${hexContents}" STREQUAL "0001027700")
+  message(SEND_ERROR "file(READ HEX) incorrectly read [${hexContents}], but expected was [0001027700]")
+endif("${hexContents}" STREQUAL "0001027700")
 
-# FILE(STRINGS) test
-FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in" infile_strings
+# file(STRINGS) test
+file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in" infile_strings
   LIMIT_COUNT 1 LIMIT_INPUT 1024 LIMIT_OUTPUT 1024
   LENGTH_MINIMUM 10 LENGTH_MAXIMUM 23 REGEX include NEWLINE_CONSUME)
-SET(infile_strings_goal "#include \"includefile\"\n")
-IF("${infile_strings}" STREQUAL "${infile_strings_goal}")
-  MESSAGE("FILE(STRINGS) correctly read [${infile_strings}]")
-ELSE("${infile_strings}" STREQUAL "${infile_strings_goal}")
-  MESSAGE(SEND_ERROR
-    "FILE(STRINGS) incorrectly read [${infile_strings}]")
-ENDIF("${infile_strings}" STREQUAL "${infile_strings_goal}")
+set(infile_strings_goal "#include \"includefile\"\n")
+if("${infile_strings}" STREQUAL "${infile_strings_goal}")
+  message("file(STRINGS) correctly read [${infile_strings}]")
+else("${infile_strings}" STREQUAL "${infile_strings_goal}")
+  message(SEND_ERROR
+    "file(STRINGS) incorrectly read [${infile_strings}]")
+endif("${infile_strings}" STREQUAL "${infile_strings_goal}")
 
 # test reading a file and getting its binary data as hex string
-FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/main.srec" infilehex LIMIT 4 HEX)
-IF(NOT "${infilehex}" STREQUAL "53313036")
-  MESSAGE(SEND_ERROR
-    "FILE(READ ... HEX) error, read: \"${infilehex}\", expected \"53313036\"")
-ENDIF(NOT "${infilehex}" STREQUAL "53313036")
+file(READ "${CMAKE_CURRENT_SOURCE_DIR}/main.srec" infilehex LIMIT 4 HEX)
+if(NOT "${infilehex}" STREQUAL "53313036")
+  message(SEND_ERROR
+    "file(READ ... HEX) error, read: \"${infilehex}\", expected \"53313036\"")
+endif(NOT "${infilehex}" STREQUAL "53313036")
 
 
-# test that FILE(STRINGS) also work with Intel hex and Motorola S-record files
+# test that file(STRINGS) also work with Intel hex and Motorola S-record files
 # this file has been created with "sdcc main.c"
-FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/main.ihx" infile_strings REGEX INFO)
-SET(infile_strings_goal "INFO:compiler\\[SDCC-HEX\\]")
-IF("${infile_strings}" MATCHES "${infile_strings_goal}")
-  MESSAGE("FILE(STRINGS) correctly read from hex file [${infile_strings}]")
-ELSE("${infile_strings}" MATCHES "${infile_strings_goal}")
-  MESSAGE(SEND_ERROR
-    "FILE(STRINGS) incorrectly read from hex file [${infile_strings}]")
-ENDIF("${infile_strings}" MATCHES "${infile_strings_goal}")
+file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/main.ihx" infile_strings REGEX INFO)
+set(infile_strings_goal "INFO:compiler\\[SDCC-HEX\\]")
+if("${infile_strings}" MATCHES "${infile_strings_goal}")
+  message("file(STRINGS) correctly read from hex file [${infile_strings}]")
+else("${infile_strings}" MATCHES "${infile_strings_goal}")
+  message(SEND_ERROR
+    "file(STRINGS) incorrectly read from hex file [${infile_strings}]")
+endif("${infile_strings}" MATCHES "${infile_strings_goal}")
 
 # this file has been created with "sdcc main.c --out-fmt-s19"
-FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/main.srec" infile_strings REGEX INFO)
-SET(infile_strings_goal "INFO:compiler\\[SDCC-SREC\\]")
-IF("${infile_strings}" MATCHES "${infile_strings_goal}")
-  MESSAGE("FILE(STRINGS) correctly read from srec file [${infile_strings}]")
-ELSE("${infile_strings}" MATCHES "${infile_strings_goal}")
-  MESSAGE(SEND_ERROR
-    "FILE(STRINGS) incorrectly read from srec file [${infile_strings}]")
-ENDIF("${infile_strings}" MATCHES "${infile_strings_goal}")
+file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/main.srec" infile_strings REGEX INFO)
+set(infile_strings_goal "INFO:compiler\\[SDCC-SREC\\]")
+if("${infile_strings}" MATCHES "${infile_strings_goal}")
+  message("file(STRINGS) correctly read from srec file [${infile_strings}]")
+else("${infile_strings}" MATCHES "${infile_strings_goal}")
+  message(SEND_ERROR
+    "file(STRINGS) incorrectly read from srec file [${infile_strings}]")
+endif("${infile_strings}" MATCHES "${infile_strings_goal}")
 
 # String test
-STRING(REGEX MATCH "[cC][mM][aA][kK][eE]" rmvar "CMake is great")
-STRING(REGEX MATCHALL "[cC][mM][aA][kK][eE]" rmallvar "CMake is better than cmake or CMake")
-STRING(REGEX REPLACE "[Aa][uU][tT][oO]([cC][oO][nN][fF]|[mM][aA][kK][eE])"
+string(REGEX MATCH "[cC][mM][aA][kK][eE]" rmvar "CMake is great")
+string(REGEX MATCHALL "[cC][mM][aA][kK][eE]" rmallvar "CMake is better than cmake or CMake")
+string(REGEX REPLACE "[Aa][uU][tT][oO]([cC][oO][nN][fF]|[mM][aA][kK][eE])"
   "CMake" rrepvar "People should use Autoconf and Automake")
-STRING(COMPARE EQUAL "CMake" "Autoconf" nceqvar)
-STRING(COMPARE EQUAL "CMake" "CMake" ceqvar)
-STRING(COMPARE NOTEQUAL "CMake" "Autoconf" cneqvar)
-STRING(COMPARE NOTEQUAL "CMake" "CMake" ncneqvar)
-STRING(COMPARE LESS "before" "after" nclvar)
-STRING(COMPARE LESS "max" "min" clvar)
-STRING(COMPARE GREATER "before" "after" cgvar)
-STRING(COMPARE GREATER "max" "min" ncgvar)
-STRING(ASCII 67 109 97 107 101 savar)
-STRING(TOUPPER "CMake" tuvar)
-STRING(TOLOWER "CMake" tlvar)
-STRING(REPLACE "Autoconf" "CMake" repvar "People should use Autoconf")
+string(COMPARE EQUAL "CMake" "Autoconf" nceqvar)
+string(COMPARE EQUAL "CMake" "CMake" ceqvar)
+string(COMPARE NOTEQUAL "CMake" "Autoconf" cneqvar)
+string(COMPARE NOTEQUAL "CMake" "CMake" ncneqvar)
+string(COMPARE LESS "before" "after" nclvar)
+string(COMPARE LESS "max" "min" clvar)
+string(COMPARE GREATER "before" "after" cgvar)
+string(COMPARE GREATER "max" "min" ncgvar)
+string(ASCII 67 109 97 107 101 savar)
+string(TOUPPER "CMake" tuvar)
+string(TOLOWER "CMake" tlvar)
+string(REPLACE "Autoconf" "CMake" repvar "People should use Autoconf")
 
-IF("abc" STREQUAL "xyz")
-  MESSAGE(SEND_ERROR "Problem with the IF(STREQUAL), \"abc\" and \"xyz\" considered equal")
-ENDIF("abc" STREQUAL "xyz")
+if("abc" STREQUAL "xyz")
+  message(SEND_ERROR "Problem with the if(STREQUAL), \"abc\" and \"xyz\" considered equal")
+endif("abc" STREQUAL "xyz")
 
-IF("CMake is cool" MATCHES "(CMake) (is).+")
-  IF(NOT "${CMAKE_MATCH_0}" STREQUAL "CMake is cool")
-    MESSAGE(SEND_ERROR "CMAKE_MATCH_0 wrong: \"${CMAKE_MATCH_0}\", expected \"CMake is cool\"")
-  ENDIF(NOT "${CMAKE_MATCH_0}" STREQUAL "CMake is cool")
-  IF(NOT "${CMAKE_MATCH_1}" STREQUAL "CMake")
-    MESSAGE(SEND_ERROR "CMAKE_MATCH_1 wrong: \"${CMAKE_MATCH_1}\", expected \"CMake\"")
-  ENDIF(NOT "${CMAKE_MATCH_1}" STREQUAL "CMake")
-  IF(NOT "${CMAKE_MATCH_2}" STREQUAL "is")
-    MESSAGE(SEND_ERROR "CMAKE_MATCH_2 wrong: \"${CMAKE_MATCH_2}\", expected \"is\"")
-  ENDIF(NOT "${CMAKE_MATCH_2}" STREQUAL "is")
-ELSE("CMake is cool" MATCHES "(CMake) (is).+")
-  MESSAGE(SEND_ERROR "Problem with the IF(MATCHES), no match found")
-ENDIF("CMake is cool" MATCHES "(CMake) (is).+")
+if("CMake is cool" MATCHES "(CMake) (is).+")
+  if(NOT "${CMAKE_MATCH_0}" STREQUAL "CMake is cool")
+    message(SEND_ERROR "CMAKE_MATCH_0 wrong: \"${CMAKE_MATCH_0}\", expected \"CMake is cool\"")
+  endif(NOT "${CMAKE_MATCH_0}" STREQUAL "CMake is cool")
+  if(NOT "${CMAKE_MATCH_1}" STREQUAL "CMake")
+    message(SEND_ERROR "CMAKE_MATCH_1 wrong: \"${CMAKE_MATCH_1}\", expected \"CMake\"")
+  endif(NOT "${CMAKE_MATCH_1}" STREQUAL "CMake")
+  if(NOT "${CMAKE_MATCH_2}" STREQUAL "is")
+    message(SEND_ERROR "CMAKE_MATCH_2 wrong: \"${CMAKE_MATCH_2}\", expected \"is\"")
+  endif(NOT "${CMAKE_MATCH_2}" STREQUAL "is")
+else("CMake is cool" MATCHES "(CMake) (is).+")
+  message(SEND_ERROR "Problem with the if(MATCHES), no match found")
+endif("CMake is cool" MATCHES "(CMake) (is).+")
 
-STRING(REGEX MATCH "(People).+CMake" matchResultVar "People should use CMake")
-IF(NOT "${matchResultVar}" STREQUAL "People should use CMake")
-  MESSAGE(SEND_ERROR "STRING(REGEX MATCH) problem: \"${matchResultVar}\", expected \"People should use CMake\"")
-ENDIF(NOT "${matchResultVar}" STREQUAL "People should use CMake")
-IF(NOT "${CMAKE_MATCH_0}" STREQUAL "People should use CMake")
-  MESSAGE(SEND_ERROR "CMAKE_MATCH_0 wrong: \"${CMAKE_MATCH_0}\", expected \"People should use CMake\"")
-ENDIF(NOT "${CMAKE_MATCH_0}" STREQUAL "People should use CMake")
-IF(NOT "${CMAKE_MATCH_1}" STREQUAL "People")
-  MESSAGE(SEND_ERROR "CMAKE_MATCH_1 wrong: \"${CMAKE_MATCH_1}\", expected \"People\"")
-ENDIF(NOT "${CMAKE_MATCH_1}" STREQUAL "People")
-IF(NOT "${CMAKE_MATCH_2}" STREQUAL "")
-  MESSAGE(SEND_ERROR "CMAKE_MATCH_2 wrong: \"${CMAKE_MATCH_2}\", expected empty string")
-ENDIF(NOT "${CMAKE_MATCH_2}" STREQUAL "")
+string(REGEX MATCH "(People).+CMake" matchResultVar "People should use CMake")
+if(NOT "${matchResultVar}" STREQUAL "People should use CMake")
+  message(SEND_ERROR "string(REGEX MATCH) problem: \"${matchResultVar}\", expected \"People should use CMake\"")
+endif(NOT "${matchResultVar}" STREQUAL "People should use CMake")
+if(NOT "${CMAKE_MATCH_0}" STREQUAL "People should use CMake")
+  message(SEND_ERROR "CMAKE_MATCH_0 wrong: \"${CMAKE_MATCH_0}\", expected \"People should use CMake\"")
+endif(NOT "${CMAKE_MATCH_0}" STREQUAL "People should use CMake")
+if(NOT "${CMAKE_MATCH_1}" STREQUAL "People")
+  message(SEND_ERROR "CMAKE_MATCH_1 wrong: \"${CMAKE_MATCH_1}\", expected \"People\"")
+endif(NOT "${CMAKE_MATCH_1}" STREQUAL "People")
+if(NOT "${CMAKE_MATCH_2}" STREQUAL "")
+  message(SEND_ERROR "CMAKE_MATCH_2 wrong: \"${CMAKE_MATCH_2}\", expected empty string")
+endif(NOT "${CMAKE_MATCH_2}" STREQUAL "")
 
 
-STRING(STRIP "
+string(STRIP "
   ST1
   " ST1)
-STRING(STRIP "ST2 " ST2)
-STRING(STRIP "  ST3" ST3)
+string(STRIP "ST2 " ST2)
+string(STRIP "  ST3" ST3)
 
-FOREACH(var ST1 ST2 ST3)
-  IF("${var}" STREQUAL "${${var}}")
-    MESSAGE("[${var}] == [${${var}}]")
-  ELSE("${var}" STREQUAL "${${var}}")
-    MESSAGE(SEND_ERROR "Problem with the STRIP command for ${var}: [${${var}}]")
-  ENDIF("${var}" STREQUAL "${${var}}")
-ENDFOREACH(var)
+foreach(var ST1 ST2 ST3)
+  if("${var}" STREQUAL "${${var}}")
+    message("[${var}] == [${${var}}]")
+  else("${var}" STREQUAL "${${var}}")
+    message(SEND_ERROR "Problem with the STRIP command for ${var}: [${${var}}]")
+  endif("${var}" STREQUAL "${${var}}")
+endforeach(var)
 
-STRING(SUBSTRING "People should use Autoconf" 7 10 substringres)
-SET(substringres "Everybody ${substringres} CMake")
+string(SUBSTRING "People should use Autoconf" 7 10 substringres)
+set(substringres "Everybody ${substringres} CMake")
 
-STRING(LENGTH ${substringres} lengthres)
+string(LENGTH ${substringres} lengthres)
 
-FILE(RELATIVE_PATH relpath "/usr/local/bin" "/usr/X11R6/bin/xnest")
+file(RELATIVE_PATH relpath "/usr/local/bin" "/usr/X11R6/bin/xnest")
 
 # Escaping test
-SET(var "\\ \" \  \t \n \r \# \( \) \0")
-MESSAGE("Output: [${var}]")
-SET(var \\ \" \  \t \n \r \# \( \) \0)
-MESSAGE("Output: [${var}]")
+set(var "\\ \" \  \t \n \r \# \( \) \0")
+message("Output: [${var}]")
+set(var \\ \" \  \t \n \r \# \( \) \0)
+message("Output: [${var}]")
 
 # Make-style unquoted argument test
-SET(var $(VAR1)$(VAR2)/$(VAR3))
-MESSAGE("Output: [${var}]")
-STRING(COMPARE EQUAL "${var}" "$(VAR1)$(VAR2)/$(VAR3)" result)
-IF(NOT result)
-  MESSAGE(SEND_ERROR "Unquoted $(VAR) syntax is broken.")
-ENDIF(NOT result)
+set(var $(VAR1)$(VAR2)/$(VAR3))
+message("Output: [${var}]")
+string(COMPARE EQUAL "${var}" "$(VAR1)$(VAR2)/$(VAR3)" result)
+if(NOT result)
+  message(SEND_ERROR "Unquoted $(VAR) syntax is broken.")
+endif(NOT result)
 
 # Obscure environment variable name
-SET("ENV{x+(y)}" "Obscure environment variable value")
-MESSAGE("Output: [$ENV{x+(y)}]")
-IF(NOT "$ENV{x+(y)}" STREQUAL "Obscure environment variable value")
-  MESSAGE(SEND_ERROR "Environment variable \"ENV{x+(y)}\" does not work.")
-ENDIF()
+set("ENV{x+(y)}" "Obscure environment variable value")
+message("Output: [$ENV{x+(y)}]")
+if(NOT "$ENV{x+(y)}" STREQUAL "Obscure environment variable value")
+  message(SEND_ERROR "Environment variable \"ENV{x+(y)}\" does not work.")
+endif()
 
 # Make directories test
-FILE(MAKE_DIRECTORY
+file(MAKE_DIRECTORY
   "${CMAKE_CURRENT_BINARY_DIR}/Includes"
   "${CMAKE_CURRENT_BINARY_DIR}/Directory1"
   "${CMAKE_CURRENT_BINARY_DIR}/Directory2"
   )
 
 # Write results to the file (test write file)
-SET(file "${CMAKE_CURRENT_BINARY_DIR}/Includes/Values.h")
-FILE(WRITE "${file}" "/* this file is generated */\n")
-FOREACH(var
+set(file "${CMAKE_CURRENT_BINARY_DIR}/Includes/Values.h")
+file(WRITE "${file}" "/* this file is generated */\n")
+foreach(var
     rmvar
     rmallvar
     rrepvar
@@ -177,28 +177,28 @@ FOREACH(var
     savar
     tuvar
     tlvar)
-  FILE(APPEND "${file}" "#define ${var} \"${${var}}\"\n")
-ENDFOREACH(var)
+  file(APPEND "${file}" "#define ${var} \"${${var}}\"\n")
+endforeach(var)
 
 # Verify that the file was created recently.
-IF(NOT "${file}" IS_NEWER_THAN "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in")
-  MESSAGE(FATAL_ERROR "IF(FILE_IS_NEWER) does not seem to work.")
-ENDIF(NOT "${file}" IS_NEWER_THAN "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in")
+if(NOT "${file}" IS_NEWER_THAN "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in")
+  message(FATAL_ERROR "if(FILE_IS_NEWER) does not seem to work.")
+endif(NOT "${file}" IS_NEWER_THAN "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in")
 
 # Test configuration of the string
-SET(TEST_DEFINED 123)
-SET(TEST_NOT_DEFINED)
-STRING(CONFIGURE "${infile}" infile+-/out @ONLY)
-SET(infile "${infile+-/out}")
+set(TEST_DEFINED 123)
+set(TEST_NOT_DEFINED)
+string(CONFIGURE "${infile}" infile+-/out @ONLY)
+set(infile "${infile+-/out}")
 
 # Write include file to a file
-STRING(REGEX REPLACE "includefile" "${file}" outfile "${infile}")
-FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/OutputFile.h-tmp" "${outfile}")
-FILE(RENAME "${CMAKE_CURRENT_BINARY_DIR}/OutputFile.h-tmp"
+string(REGEX REPLACE "includefile" "${file}" outfile "${infile}")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/OutputFile.h-tmp" "${outfile}")
+file(RENAME "${CMAKE_CURRENT_BINARY_DIR}/OutputFile.h-tmp"
             "${CMAKE_CURRENT_BINARY_DIR}/OutputFile.h")
 
 # Test file copy with relative paths
-FILE(COPY .
+file(COPY .
   DESTINATION src
   FILE_PERMISSIONS OWNER_READ # test no OWNER_WRITE
   DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
@@ -207,31 +207,31 @@ FILE(COPY .
   )
 
 # Test file glob
-FILE(GLOB_RECURSE src_files "${CMAKE_CURRENT_SOURCE_DIR}/*")
-MESSAGE("Files in ${CMAKE_CURRENT_SOURCE_DIR} are ${src_files}")
-SET(expr "${CMAKE_CURRENT_BINARY_DIR}/src/[sS][!a-su-zA-Z0-9][^a-qs-zA-Z0-9]ing?ile*.cxx")
-MESSAGE("Glob expression is [${expr}].")
-FILE(GLOB src_files "${expr}")
-MESSAGE("Globbed files [${src_files}].")
-ADD_EXECUTABLE(StringFileTest ${src_files})
+file(GLOB_RECURSE src_files "${CMAKE_CURRENT_SOURCE_DIR}/*")
+message("Files in ${CMAKE_CURRENT_SOURCE_DIR} are ${src_files}")
+set(expr "${CMAKE_CURRENT_BINARY_DIR}/src/[sS][!a-su-zA-Z0-9][^a-qs-zA-Z0-9]ing?ile*.cxx")
+message("Glob expression is [${expr}].")
+file(GLOB src_files "${expr}")
+message("Globbed files [${src_files}].")
+add_executable(StringFileTest ${src_files})
 
-SET(expr "${CMAKE_CURRENT_SOURCE_DIR}/../*.cxx")
-FILE(GLOB_RECURSE rel_src_files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/.." "${expr}")
-MESSAGE("Globbed files [${rel_src_files}].")
+set(expr "${CMAKE_CURRENT_SOURCE_DIR}/../*.cxx")
+file(GLOB_RECURSE rel_src_files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/.." "${expr}")
+message("Globbed files [${rel_src_files}].")
 
 # Test FOREACH range
-MESSAGE("Cheack if FOREACH with RANGE works")
-MACRO(TEST_RANGE ARGS CHECK)
-  SET(r)
-  FOREACH(a RANGE ${ARGS})
-    SET(r ${r} ${a})
-  ENDFOREACH(a)
-  MESSAGE("FOREACH with RANGE ${ARGS} produces ${r}")
-  IF("x${r}x" MATCHES "^x${CHECK}x$")
-  ELSE("x${r}x" MATCHES "^x${CHECK}x$")
-    MESSAGE(SEND_ERROR "The range resulted in: ${r} should be ${CHECK}")
-  ENDIF("x${r}x" MATCHES "^x${CHECK}x$")
-ENDMACRO(TEST_RANGE)
+message("Cheack if FOREACH with RANGE works")
+macro(TEST_RANGE ARGS CHECK)
+  set(r)
+  foreach(a RANGE ${ARGS})
+    set(r ${r} ${a})
+  endforeach(a)
+  message("FOREACH with RANGE ${ARGS} produces ${r}")
+  if("x${r}x" MATCHES "^x${CHECK}x$")
+  else("x${r}x" MATCHES "^x${CHECK}x$")
+    message(SEND_ERROR "The range resulted in: ${r} should be ${CHECK}")
+  endif("x${r}x" MATCHES "^x${CHECK}x$")
+endmacro(TEST_RANGE)
 TEST_RANGE("5" "0;1;2;3;4;5")
 TEST_RANGE("3;5" "3;4;5")
 TEST_RANGE("5;3" "5;4;3")
@@ -258,25 +258,25 @@ if(NOT "${var_b}" STREQUAL "x")
 endif()
 
 # Test SUBSTRING command
-SET(ST_INPUTSTRING "0123456789")
-STRING(SUBSTRING ${ST_INPUTSTRING} 3 0 ST_EMPTY)
-STRING(SUBSTRING ${ST_INPUTSTRING} 1 1 ST_ONE)
-STRING(SUBSTRING ${ST_INPUTSTRING} 0 10 ST_ALL)
-STRING(SUBSTRING ${ST_INPUTSTRING} 0 -1 ST_ALL_MINUS)
-STRING(SUBSTRING ${ST_INPUTSTRING} 9 -1 ST_NINE)
+set(ST_INPUTSTRING "0123456789")
+string(SUBSTRING ${ST_INPUTSTRING} 3 0 ST_EMPTY)
+string(SUBSTRING ${ST_INPUTSTRING} 1 1 ST_ONE)
+string(SUBSTRING ${ST_INPUTSTRING} 0 10 ST_ALL)
+string(SUBSTRING ${ST_INPUTSTRING} 0 -1 ST_ALL_MINUS)
+string(SUBSTRING ${ST_INPUTSTRING} 9 -1 ST_NINE)
 
-IF(ST_EMPTY)
-  MESSAGE(SEND_ERROR "SUBSTRING with length 0 does not return an empty string")
-ENDIF(ST_EMPTY)
-IF(NOT ST_ONE STREQUAL "1")
-  MESSAGE(SEND_ERROR "SUBSTING command does not cut the correct selected character, was \"" ${ST_ONE} "\", should be \"1\"")
-ENDIF(NOT ST_ONE STREQUAL "1")
-IF(NOT ST_INPUTSTRING STREQUAL ST_ALL)
-  MESSAGE(SEND_ERROR "SUBSTRING does not return the whole string when selected with length")
-ENDIF(NOT ST_INPUTSTRING STREQUAL ST_ALL)
-IF(NOT ST_INPUTSTRING STREQUAL ST_ALL_MINUS)
-  MESSAGE(SEND_ERROR "SUBSTRING does not return the whole string when selected with -1")
-ENDIF(NOT ST_INPUTSTRING STREQUAL ST_ALL_MINUS)
-IF(NOT ST_NINE STREQUAL "9")
-  MESSAGE(SEND_ERROR "SUBSTRING does not return the tail when selected with -1")
-ENDIF(NOT ST_NINE STREQUAL "9")
+if(ST_EMPTY)
+  message(SEND_ERROR "SUBSTRING with length 0 does not return an empty string")
+endif(ST_EMPTY)
+if(NOT ST_ONE STREQUAL "1")
+  message(SEND_ERROR "SUBSTING command does not cut the correct selected character, was \"" ${ST_ONE} "\", should be \"1\"")
+endif(NOT ST_ONE STREQUAL "1")
+if(NOT ST_INPUTSTRING STREQUAL ST_ALL)
+  message(SEND_ERROR "SUBSTRING does not return the whole string when selected with length")
+endif(NOT ST_INPUTSTRING STREQUAL ST_ALL)
+if(NOT ST_INPUTSTRING STREQUAL ST_ALL_MINUS)
+  message(SEND_ERROR "SUBSTRING does not return the whole string when selected with -1")
+endif(NOT ST_INPUTSTRING STREQUAL ST_ALL_MINUS)
+if(NOT ST_NINE STREQUAL "9")
+  message(SEND_ERROR "SUBSTRING does not return the tail when selected with -1")
+endif(NOT ST_NINE STREQUAL "9")
diff --git a/Tests/SubDir/CMakeLists.txt b/Tests/SubDir/CMakeLists.txt
index cf8fe97fa..2aec95635 100644
--- a/Tests/SubDir/CMakeLists.txt
+++ b/Tests/SubDir/CMakeLists.txt
@@ -1,46 +1,46 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(SUBDIR)
-SUBDIRS(Executable EXCLUDE_FROM_ALL Examples)
-WRITE_FILE(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.")
+project(SUBDIR)
+subdirs(Executable EXCLUDE_FROM_ALL Examples)
+write_file(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.")
 #WATCOM WMAKE does not support + in the name of a file!
-IF(WATCOM)
-  SET(PLUS_NAME_FILES
+if(WATCOM)
+  set(PLUS_NAME_FILES
     AnotherSubdir/pair_int.int.c
     vcl_algorithm_vcl_pair_double.foo.c)
-ELSE(WATCOM)
-    SET(PLUS_NAME_FILES
+else(WATCOM)
+    set(PLUS_NAME_FILES
     AnotherSubdir/pair+int.int.c
     vcl_algorithm+vcl_pair+double.foo.c)
-ENDIF(WATCOM)
+endif(WATCOM)
 
-ADD_EXECUTABLE(TestFromSubdir
+add_executable(TestFromSubdir
   AnotherSubdir/testfromsubdir.c
   AnotherSubdir/secondone
   ${PLUS_NAME_FILES}
   )
 
-AUX_SOURCE_DIRECTORY(ThirdSubDir SOURCES)
-IF(WATCOM)
-  FOREACH(f ${SOURCES})
-    IF("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
-    ELSE("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
-      SET(SOURCES2 ${f} ${SOURCES2})
-    ENDIF("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
-  ENDFOREACH(f)
-  SET(SOURCES ${SOURCES2})
-  SET(SOURCES ${SOURCES}
+aux_source_directory(ThirdSubDir SOURCES)
+if(WATCOM)
+  foreach(f ${SOURCES})
+    if("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
+    else("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
+      set(SOURCES2 ${f} ${SOURCES2})
+    endif("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
+  endforeach(f)
+  set(SOURCES ${SOURCES2})
+  set(SOURCES ${SOURCES}
     vcl_algorithm_vcl_pair_double.foo.c)
-ELSE(WATCOM)
-  FOREACH(f ${SOURCES})
-    IF("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
-    ELSE("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
-      SET(SOURCES2 ${f} ${SOURCES2})
-      MESSAGE("${f}")
-    ENDIF("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
-  ENDFOREACH(f)
-  SET(SOURCES ${SOURCES2})
-  SET(SOURCES ${SOURCES}
+else(WATCOM)
+  foreach(f ${SOURCES})
+    if("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
+    else("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
+      set(SOURCES2 ${f} ${SOURCES2})
+      message("${f}")
+    endif("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
+  endforeach(f)
+  set(SOURCES ${SOURCES2})
+  set(SOURCES ${SOURCES}
     vcl_algorithm+vcl_pair+double.foo.c)
-ENDIF(WATCOM)
-MESSAGE("Sources: ${SOURCES}")
-ADD_EXECUTABLE(TestWithAuxSourceDir ${SOURCES})
+endif(WATCOM)
+message("Sources: ${SOURCES}")
+add_executable(TestWithAuxSourceDir ${SOURCES})
diff --git a/Tests/SubDir/Examples/CMakeLists.txt b/Tests/SubDir/Examples/CMakeLists.txt
index b0f1e896c..8cd7e24e1 100644
--- a/Tests/SubDir/Examples/CMakeLists.txt
+++ b/Tests/SubDir/Examples/CMakeLists.txt
@@ -1,3 +1,3 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(Examples)
-SUBDIRS(example1 example2)
+project(Examples)
+subdirs(example1 example2)
diff --git a/Tests/SubDir/Examples/example1/CMakeLists.txt b/Tests/SubDir/Examples/example1/CMakeLists.txt
index 303618321..20d065e54 100644
--- a/Tests/SubDir/Examples/example1/CMakeLists.txt
+++ b/Tests/SubDir/Examples/example1/CMakeLists.txt
@@ -1,7 +1,7 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(example1)
-ADD_EXECUTABLE(example1 example1.cxx)
+project(example1)
+add_executable(example1 example1.cxx)
 
-ADD_CUSTOM_COMMAND(TARGET example1 POST_BUILD
+add_custom_command(TARGET example1 POST_BUILD
   COMMAND "${CMAKE_COMMAND}" ARGS -E remove ${SUBDIR_BINARY_DIR}/ShouldBeHere
   COMMENT "Remove marker file that should exist because this should not be run")
diff --git a/Tests/SubDir/Examples/example2/CMakeLists.txt b/Tests/SubDir/Examples/example2/CMakeLists.txt
index 19a537686..388e33c3d 100644
--- a/Tests/SubDir/Examples/example2/CMakeLists.txt
+++ b/Tests/SubDir/Examples/example2/CMakeLists.txt
@@ -1,2 +1,2 @@
-PROJECT(example2)
-ADD_EXECUTABLE(example2 example2.cxx)
+project(example2)
+add_executable(example2 example2.cxx)
diff --git a/Tests/SubDir/Executable/CMakeLists.txt b/Tests/SubDir/Executable/CMakeLists.txt
index d679168d8..77e6751cd 100644
--- a/Tests/SubDir/Executable/CMakeLists.txt
+++ b/Tests/SubDir/Executable/CMakeLists.txt
@@ -1 +1 @@
-ADD_EXECUTABLE(test test.cxx)
+add_executable(test test.cxx)
diff --git a/Tests/SubDirSpaces/CMakeLists.txt b/Tests/SubDirSpaces/CMakeLists.txt
index a0053a236..f1ace0f79 100644
--- a/Tests/SubDirSpaces/CMakeLists.txt
+++ b/Tests/SubDirSpaces/CMakeLists.txt
@@ -1,16 +1,16 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(SUBDIR)
+project(SUBDIR)
 
 # Some systems do not seem to support rpath with spaces.
-IF("${CMAKE_SYSTEM}" MATCHES "IRIX|QNX")
-  SET(CMAKE_SKIP_BUILD_RPATH 1)
-ENDIF("${CMAKE_SYSTEM}" MATCHES "IRIX|QNX")
+if("${CMAKE_SYSTEM}" MATCHES "IRIX|QNX")
+  set(CMAKE_SKIP_BUILD_RPATH 1)
+endif("${CMAKE_SYSTEM}" MATCHES "IRIX|QNX")
 
 # be able to see output from make on dashboards
-SET(CMAKE_VERBOSE_MAKEFILE 1)
+set(CMAKE_VERBOSE_MAKEFILE 1)
 message("${CMAKE_MAKE_PROGRAM}")
 set(CMAKE_PAREN TRUE)
-IF("${CMAKE_MAKE_PROGRAM}" MATCHES "wmake")
+if("${CMAKE_MAKE_PROGRAM}" MATCHES "wmake")
   message("wmake does not support () in path")
   set(CMAKE_PAREN FALSE)
 elseif("${CMAKE_MAKE_PROGRAM}" MATCHES "make")
@@ -23,55 +23,55 @@ elseif("${CMAKE_MAKE_PROGRAM}" MATCHES "make")
   endif()
 endif()
 
-IF(CMAKE_PAREN)
-  ADD_DEFINITIONS(-DCMAKE_PAREN=1)
-  SUBDIRS("Executable Sources" "Some(x86) Sources" EXCLUDE_FROM_ALL "Some Examples")
-ELSE(CMAKE_PAREN)
-  SUBDIRS("Executable Sources" EXCLUDE_FROM_ALL "Some Examples")
-ENDIF(CMAKE_PAREN)
+if(CMAKE_PAREN)
+  add_definitions(-DCMAKE_PAREN=1)
+  subdirs("Executable Sources" "Some(x86) Sources" EXCLUDE_FROM_ALL "Some Examples")
+else(CMAKE_PAREN)
+  subdirs("Executable Sources" EXCLUDE_FROM_ALL "Some Examples")
+endif(CMAKE_PAREN)
 
-WRITE_FILE(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.")
+write_file(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.")
 #WATCOM WMAKE does not support + in the name of a file!
-IF(WATCOM)
-  SET(PLUS_NAME_FILES
+if(WATCOM)
+  set(PLUS_NAME_FILES
     "Another Subdir/pair_int.int.c"
     vcl_algorithm_vcl_pair_double.foo.c)
-ELSE(WATCOM)
-    SET(PLUS_NAME_FILES
+else(WATCOM)
+    set(PLUS_NAME_FILES
     "Another Subdir/pair+int.int.c"
     vcl_algorithm+vcl_pair+double.foo.c)
-ENDIF(WATCOM)
+endif(WATCOM)
 
-ADD_EXECUTABLE(TestFromSubdir
+add_executable(TestFromSubdir
   "Another Subdir/testfromsubdir.c"
   "Another Subdir/secondone"
   ${PLUS_NAME_FILES}
   )
 
-AUX_SOURCE_DIRECTORY(ThirdSubDir SOURCES)
-IF(WATCOM)
-  FOREACH(f ${SOURCES})
-    IF("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
-    ELSE("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
-      SET(SOURCES2 ${f} ${SOURCES2})
-    ENDIF("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
-  ENDFOREACH(f)
-  SET(SOURCES ${SOURCES2})
-  SET(SOURCES ${SOURCES}
+aux_source_directory(ThirdSubDir SOURCES)
+if(WATCOM)
+  foreach(f ${SOURCES})
+    if("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
+    else("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
+      set(SOURCES2 ${f} ${SOURCES2})
+    endif("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
+  endforeach(f)
+  set(SOURCES ${SOURCES2})
+  set(SOURCES ${SOURCES}
     vcl_algorithm_vcl_pair_double.foo.c)
-ELSE(WATCOM)
-  FOREACH(f ${SOURCES})
-    IF("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
-    ELSE("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
-      SET(SOURCES2 ${f} ${SOURCES2})
-    ENDIF("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
-  ENDFOREACH(f)
-  SET(SOURCES ${SOURCES2})
-  SET(SOURCES ${SOURCES}
+else(WATCOM)
+  foreach(f ${SOURCES})
+    if("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
+    else("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
+      set(SOURCES2 ${f} ${SOURCES2})
+    endif("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
+  endforeach(f)
+  set(SOURCES ${SOURCES2})
+  set(SOURCES ${SOURCES}
     vcl_algorithm+vcl_pair+double.foo.c)
-ENDIF(WATCOM)
-ADD_EXECUTABLE(TestWithAuxSourceDir ${SOURCES})
-IF(CMAKE_PAREN)
+endif(WATCOM)
+add_executable(TestWithAuxSourceDir ${SOURCES})
+if(CMAKE_PAREN)
   target_link_libraries(TestWithAuxSourceDir testOddPath)
-ENDIF(CMAKE_PAREN)
+endif(CMAKE_PAREN)
 
diff --git a/Tests/SubDirSpaces/Executable Sources/CMakeLists.txt b/Tests/SubDirSpaces/Executable Sources/CMakeLists.txt
index d679168d8..77e6751cd 100644
--- a/Tests/SubDirSpaces/Executable Sources/CMakeLists.txt	
+++ b/Tests/SubDirSpaces/Executable Sources/CMakeLists.txt	
@@ -1 +1 @@
-ADD_EXECUTABLE(test test.cxx)
+add_executable(test test.cxx)
diff --git a/Tests/SubDirSpaces/Executable/CMakeLists.txt b/Tests/SubDirSpaces/Executable/CMakeLists.txt
index d679168d8..77e6751cd 100644
--- a/Tests/SubDirSpaces/Executable/CMakeLists.txt
+++ b/Tests/SubDirSpaces/Executable/CMakeLists.txt
@@ -1 +1 @@
-ADD_EXECUTABLE(test test.cxx)
+add_executable(test test.cxx)
diff --git a/Tests/SubDirSpaces/Some Examples/CMakeLists.txt b/Tests/SubDirSpaces/Some Examples/CMakeLists.txt
index b0f1e896c..8cd7e24e1 100644
--- a/Tests/SubDirSpaces/Some Examples/CMakeLists.txt	
+++ b/Tests/SubDirSpaces/Some Examples/CMakeLists.txt	
@@ -1,3 +1,3 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(Examples)
-SUBDIRS(example1 example2)
+project(Examples)
+subdirs(example1 example2)
diff --git a/Tests/SubDirSpaces/Some Examples/example1/CMakeLists.txt b/Tests/SubDirSpaces/Some Examples/example1/CMakeLists.txt
index 303618321..20d065e54 100644
--- a/Tests/SubDirSpaces/Some Examples/example1/CMakeLists.txt	
+++ b/Tests/SubDirSpaces/Some Examples/example1/CMakeLists.txt	
@@ -1,7 +1,7 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(example1)
-ADD_EXECUTABLE(example1 example1.cxx)
+project(example1)
+add_executable(example1 example1.cxx)
 
-ADD_CUSTOM_COMMAND(TARGET example1 POST_BUILD
+add_custom_command(TARGET example1 POST_BUILD
   COMMAND "${CMAKE_COMMAND}" ARGS -E remove ${SUBDIR_BINARY_DIR}/ShouldBeHere
   COMMENT "Remove marker file that should exist because this should not be run")
diff --git a/Tests/SubDirSpaces/Some Examples/example2/CMakeLists.txt b/Tests/SubDirSpaces/Some Examples/example2/CMakeLists.txt
index 19a537686..388e33c3d 100644
--- a/Tests/SubDirSpaces/Some Examples/example2/CMakeLists.txt	
+++ b/Tests/SubDirSpaces/Some Examples/example2/CMakeLists.txt	
@@ -1,2 +1,2 @@
-PROJECT(example2)
-ADD_EXECUTABLE(example2 example2.cxx)
+project(example2)
+add_executable(example2 example2.cxx)
diff --git a/Tests/SwigTest/CMakeLists.txt b/Tests/SwigTest/CMakeLists.txt
index 7e216446d..b3017f1ab 100644
--- a/Tests/SwigTest/CMakeLists.txt
+++ b/Tests/SwigTest/CMakeLists.txt
@@ -1,50 +1,50 @@
-SET(language "python")
+set(language "python")
 
 cmake_minimum_required (VERSION 2.6)
 
-PROJECT(example_${language}_class)
+project(example_${language}_class)
 
-FIND_PACKAGE(SWIG REQUIRED)
-INCLUDE(${SWIG_USE_FILE})
+find_package(SWIG REQUIRED)
+include(${SWIG_USE_FILE})
 
-IF(${language} MATCHES python)
-  FIND_PACKAGE(PythonLibs)
-  INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
-  SET(SWIG_LANG_LIBRARIES ${PYTHON_LIBRARIES})
-ENDIF(${language} MATCHES python)
-IF(${language} MATCHES perl)
-  FIND_PACKAGE(PerlLibs)
-  INCLUDE_DIRECTORIES(${PERL_INCLUDE_PATH})
-  ADD_DEFINITIONS(${PERL_EXTRA_C_FLAGS})
-  SET(SWIG_LANG_LIBRARIES ${PERL_LIBRARY})
-ENDIF(${language} MATCHES perl)
-IF(${language} MATCHES tcl)
-  FIND_PACKAGE(TCL)
-  INCLUDE_DIRECTORIES(${TCL_INCLUDE_PATH})
-  SET(SWIG_LANG_LIBRARIES ${TCL_LIBRARY})
-ENDIF(${language} MATCHES tcl)
-IF(${language} MATCHES ruby)
-  FIND_PACKAGE(Ruby)
-  INCLUDE_DIRECTORIES(${RUBY_INCLUDE_PATH})
-  SET(SWIG_LANG_LIBRARIES ${RUBY_LIBRARY})
-ENDIF(${language} MATCHES ruby)
-IF(${language} MATCHES php4)
-  FIND_PACKAGE(PHP4)
-  INCLUDE_DIRECTORIES(${PHP4_INCLUDE_PATH})
-  SET(SWIG_LANG_LIBRARIES ${PHP4_LIBRARY})
-ENDIF(${language} MATCHES php4)
-IF(${language} MATCHES pike)
-  FIND_PACKAGE(Pike)
-  INCLUDE_DIRECTORIES(${PIKE_INCLUDE_PATH})
-  SET(SWIG_LANG_LIBRARIES ${PIKE_LIBRARY})
-ENDIF(${language} MATCHES pike)
+if(${language} MATCHES python)
+  find_package(PythonLibs)
+  include_directories(${PYTHON_INCLUDE_PATH})
+  set(SWIG_LANG_LIBRARIES ${PYTHON_LIBRARIES})
+endif(${language} MATCHES python)
+if(${language} MATCHES perl)
+  find_package(PerlLibs)
+  include_directories(${PERL_INCLUDE_PATH})
+  add_definitions(${PERL_EXTRA_C_FLAGS})
+  set(SWIG_LANG_LIBRARIES ${PERL_LIBRARY})
+endif(${language} MATCHES perl)
+if(${language} MATCHES tcl)
+  find_package(TCL)
+  include_directories(${TCL_INCLUDE_PATH})
+  set(SWIG_LANG_LIBRARIES ${TCL_LIBRARY})
+endif(${language} MATCHES tcl)
+if(${language} MATCHES ruby)
+  find_package(Ruby)
+  include_directories(${RUBY_INCLUDE_PATH})
+  set(SWIG_LANG_LIBRARIES ${RUBY_LIBRARY})
+endif(${language} MATCHES ruby)
+if(${language} MATCHES php4)
+  find_package(PHP4)
+  include_directories(${PHP4_INCLUDE_PATH})
+  set(SWIG_LANG_LIBRARIES ${PHP4_LIBRARY})
+endif(${language} MATCHES php4)
+if(${language} MATCHES pike)
+  find_package(Pike)
+  include_directories(${PIKE_INCLUDE_PATH})
+  set(SWIG_LANG_LIBRARIES ${PIKE_LIBRARY})
+endif(${language} MATCHES pike)
 
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
 
-SET(CMAKE_SWIG_FLAGS "")
+set(CMAKE_SWIG_FLAGS "")
 
-SET_SOURCE_FILES_PROPERTIES(example.i PROPERTIES CPLUSPLUS ON)
-SET_SOURCE_FILES_PROPERTIES(example.i PROPERTIES SWIG_FLAGS "-includeall")
+set_source_files_properties(example.i PROPERTIES CPLUSPLUS ON)
+set_source_files_properties(example.i PROPERTIES SWIG_FLAGS "-includeall")
 SWIG_ADD_MODULE(example "${language}"
   example.i example.cxx)
 SWIG_LINK_LIBRARIES(example ${SWIG_LANG_LIBRARIES})
diff --git a/Tests/SystemInformation/CMakeLists.txt b/Tests/SystemInformation/CMakeLists.txt
index 6654664a1..c29f3e863 100644
--- a/Tests/SystemInformation/CMakeLists.txt
+++ b/Tests/SystemInformation/CMakeLists.txt
@@ -1,61 +1,61 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(SystemInformation)
+project(SystemInformation)
 
-INCLUDE_DIRECTORIES("This does not exists")
-GET_DIRECTORY_PROPERTY(incl INCLUDE_DIRECTORIES)
-SET_DIRECTORY_PROPERTIES(PROPERTIES INCLUDE_DIRECTORIES "${SystemInformation_BINARY_DIR};${SystemInformation_SOURCE_DIR}")
+include_directories("This does not exists")
+get_directory_property(incl INCLUDE_DIRECTORIES)
+set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${SystemInformation_BINARY_DIR};${SystemInformation_SOURCE_DIR}")
 
-MESSAGE("To prevent CTest from stripping output, you have to display: CTEST_FULL_OUTPUT")
+message("To prevent CTest from stripping output, you have to display: CTEST_FULL_OUTPUT")
 
 
-CONFIGURE_FILE(${SystemInformation_SOURCE_DIR}/SystemInformation.in
+configure_file(${SystemInformation_SOURCE_DIR}/SystemInformation.in
 ${SystemInformation_BINARY_DIR}/SystemInformation.out)
-CONFIGURE_FILE(${SystemInformation_SOURCE_DIR}/DumpInformation.h.in
+configure_file(${SystemInformation_SOURCE_DIR}/DumpInformation.h.in
 ${SystemInformation_BINARY_DIR}/DumpInformation.h)
-ADD_EXECUTABLE(SystemInformation DumpInformation.cxx)
+add_executable(SystemInformation DumpInformation.cxx)
 
-MACRO(FOO args)
-  MESSAGE("Test macro")
-ENDMACRO(FOO)
+macro(FOO args)
+  message("Test macro")
+endmacro(FOO)
 
 FOO(lala)
 
-FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt "")
-GET_CMAKE_PROPERTY(res VARIABLES)
-FOREACH(var ${res})
-  FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt "")
+get_cmake_property(res VARIABLES)
+foreach(var ${res})
+  file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt
              "${var} \"${${var}}\"\n")
-ENDFOREACH(var ${res})
+endforeach(var ${res})
 
-FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllCommands.txt "")
-GET_CMAKE_PROPERTY(res COMMANDS)
-FOREACH(var ${res})
-  FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllCommands.txt
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllCommands.txt "")
+get_cmake_property(res COMMANDS)
+foreach(var ${res})
+  file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllCommands.txt
              "${var}\n")
-ENDFOREACH(var ${res})
+endforeach(var ${res})
 
-FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt "")
-GET_CMAKE_PROPERTY(res MACROS)
-FOREACH(var ${res})
-  FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt "")
+get_cmake_property(res MACROS)
+foreach(var ${res})
+  file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt
              "${var}\n")
-ENDFOREACH(var ${res})
+endforeach(var ${res})
 
-FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt "")
-GET_DIRECTORY_PROPERTY(res INCLUDE_DIRECTORIES)
-FOREACH(var ${res})
-  FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt "")
+get_directory_property(res INCLUDE_DIRECTORIES)
+foreach(var ${res})
+  file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt
     "INCLUDE_DIRECTORY: ${var}\n")
-ENDFOREACH(var)
+endforeach(var)
 
-GET_DIRECTORY_PROPERTY(res LINK_DIRECTORIES)
-FOREACH(var ${res})
-  FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt
+get_directory_property(res LINK_DIRECTORIES)
+foreach(var ${res})
+  file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt
     "LINK_DIRECTORIES: ${var}\n")
-ENDFOREACH(var)
+endforeach(var)
 
-GET_DIRECTORY_PROPERTY(res INCLUDE_REGULAR_EXPRESSION)
-FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt
+get_directory_property(res INCLUDE_REGULAR_EXPRESSION)
+file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt
   "INCLUDE_REGULAR_EXPRESSION: ${res}\n")
 
 
diff --git a/Tests/TarTest/CMakeLists.txt b/Tests/TarTest/CMakeLists.txt
index a3c5b31ff..b1f1c6dc3 100644
--- a/Tests/TarTest/CMakeLists.txt
+++ b/Tests/TarTest/CMakeLists.txt
@@ -1,20 +1,20 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(TarTest)
+project(TarTest)
 
 # this is macro that we will be running
-MACRO(EXEC_TAR_COMMAND DIR ARGS)
-  EXEC_PROGRAM("${CMAKE_COMMAND}" "${DIR}" ARGS "-E tar ${ARGS}" RETURN_VALUE RET)
-  IF(${RET})
-    MESSAGE(FATAL_ERROR "CMake tar command failed with arguments \"${ARGS}\"")
-  ENDIF(${RET})
-ENDMACRO(EXEC_TAR_COMMAND)
+macro(EXEC_TAR_COMMAND DIR ARGS)
+  exec_program("${CMAKE_COMMAND}" "${DIR}" ARGS "-E tar ${ARGS}" RETURN_VALUE RET)
+  if(${RET})
+    message(FATAL_ERROR "CMake tar command failed with arguments \"${ARGS}\"")
+  endif(${RET})
+endmacro(EXEC_TAR_COMMAND)
 
 # Create a directory structure
-SET(CHECK_FILES)
-MACRO(COPY F1 F2)
-  CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/${F1}" "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${F2}" COPYONLY)
-  SET(CHECK_FILES ${CHECK_FILES} "${F2}")
-ENDMACRO(COPY)
+set(CHECK_FILES)
+macro(COPY F1 F2)
+  configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${F1}" "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${F2}" COPYONLY)
+  set(CHECK_FILES ${CHECK_FILES} "${F2}")
+endmacro(COPY)
 COPY("CMakeLists.txt" "f1.txt")
 COPY("CMakeLists.txt" "d1/f1.txt")
 COPY("CMakeLists.txt" "d 2/f1.txt")
@@ -23,22 +23,22 @@ COPY("CMakeLists.txt" "d_4/f1.txt")
 COPY("CMakeLists.txt" "d-4/f1.txt")
 COPY("CMakeLists.txt" "My Special Directory/f1.txt")
 
-IF(UNIX)
-  EXEC_PROGRAM("ln" ARGS "-sf f1.txt \"${CMAKE_CURRENT_BINARY_DIR}/tar_dir/d1/f2.txt\"")
-  SET(CHECK_FILES ${CHECK_FILES} "d1/f2.txt")
-ENDIF(UNIX)
+if(UNIX)
+  exec_program("ln" ARGS "-sf f1.txt \"${CMAKE_CURRENT_BINARY_DIR}/tar_dir/d1/f2.txt\"")
+  set(CHECK_FILES ${CHECK_FILES} "d1/f2.txt")
+endif(UNIX)
 
 # cleanup first in case there are files left from previous runs
 # if the umask is odd on the machine it might create files that
 # are not automatically over written.  These tests are run
 # each time the configure step is run.
-FILE(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test_tar.tar")
-FILE(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test_tgz.tgz")
-FILE(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/test_output_tar")
-FILE(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz")
+file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test_tar.tar")
+file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test_tgz.tgz")
+file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/test_output_tar")
+file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz")
 
-MAKE_DIRECTORY("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar")
-MAKE_DIRECTORY("${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz")
+make_directory("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar")
+make_directory("${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz")
 
 
 # Run tests
@@ -48,22 +48,22 @@ EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}" "cvfz \"${CMAKE_CURRENT_BINARY_DI
 EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar" "xvf \"${CMAKE_CURRENT_BINARY_DIR}/test_tar.tar\"")
 EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz" "xvfz \"${CMAKE_CURRENT_BINARY_DIR}/test_tgz.tgz\"")
 
-MACRO(CHECK_DIR_STRUCTURE DIR)
-  FOREACH(file ${CHECK_FILES})
-    SET(sfile "${DIR}/${file}")
-    SET(rfile "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${file}")
-    IF(NOT EXISTS "${sfile}")
-      MESSAGE(SEND_ERROR "Cannot find file ${sfile}")
-    ELSE(NOT EXISTS "${sfile}")
-      EXEC_PROGRAM("${CMAKE_COMMAND}" ARGS "-E compare_files \"${sfile}\" \"${rfile}\"" RETURN_VALUE ret)
-      IF(${ret})
-        MESSAGE(SEND_ERROR "Files \"${sfile}\" \"${rfile}\" are different")
-      ENDIF(${ret})
-    ENDIF(NOT EXISTS "${sfile}")
-  ENDFOREACH(file)
-ENDMACRO(CHECK_DIR_STRUCTURE)
+macro(CHECK_DIR_STRUCTURE DIR)
+  foreach(file ${CHECK_FILES})
+    set(sfile "${DIR}/${file}")
+    set(rfile "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${file}")
+    if(NOT EXISTS "${sfile}")
+      message(SEND_ERROR "Cannot find file ${sfile}")
+    else(NOT EXISTS "${sfile}")
+      exec_program("${CMAKE_COMMAND}" ARGS "-E compare_files \"${sfile}\" \"${rfile}\"" RETURN_VALUE ret)
+      if(${ret})
+        message(SEND_ERROR "Files \"${sfile}\" \"${rfile}\" are different")
+      endif(${ret})
+    endif(NOT EXISTS "${sfile}")
+  endforeach(file)
+endmacro(CHECK_DIR_STRUCTURE)
 
 CHECK_DIR_STRUCTURE("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar/tar_dir")
 
-ADD_EXECUTABLE(TarTest TestTarExec.cxx)
+add_executable(TarTest TestTarExec.cxx)
 
diff --git a/Tests/TestDriver/CMakeLists.txt b/Tests/TestDriver/CMakeLists.txt
index cc953ce3f..663ecab55 100644
--- a/Tests/TestDriver/CMakeLists.txt
+++ b/Tests/TestDriver/CMakeLists.txt
@@ -1,15 +1,15 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(TestDriverTest)
+project(TestDriverTest)
 
-SET(Extra_SRCS testExtraStuff.cxx testExtraStuff2.cxx )
-SET(Extra_SRCS ${Extra_SRCS};testExtraStuff3.cxx )
-INCLUDE_DIRECTORIES(${TestDriverTest_SOURCE_DIR})
-CREATE_TEST_SOURCELIST(testSrcs
+set(Extra_SRCS testExtraStuff.cxx testExtraStuff2.cxx )
+set(Extra_SRCS ${Extra_SRCS};testExtraStuff3.cxx )
+include_directories(${TestDriverTest_SOURCE_DIR})
+create_test_sourcelist(testSrcs
                        TestDriverTest.cxx
                        test1.cxx
                        test2.cxx
                        subdir/test3.cxx
                        EXTRA_INCLUDE testArgs.h FUNCTION testProccessArgs)
 
-ADD_EXECUTABLE(TestDriverTest ${testSrcs} ${Extra_SRCS})
+add_executable(TestDriverTest ${testSrcs} ${Extra_SRCS})
 
diff --git a/Tests/Testing/CMakeLists.txt b/Tests/Testing/CMakeLists.txt
index 5c6f37c6e..20af09bfa 100644
--- a/Tests/Testing/CMakeLists.txt
+++ b/Tests/Testing/CMakeLists.txt
@@ -2,58 +2,58 @@
 # Testing
 #
 cmake_minimum_required (VERSION 2.7)
-PROJECT (Testing)
+project (Testing)
 
 #
 # Lib and exe path
 #
-SET (LIBRARY_OUTPUT_PATH
+set (LIBRARY_OUTPUT_PATH
      ${Testing_BINARY_DIR}/bin/ CACHE PATH
      "Single output directory for building all libraries.")
 
-SET (EXECUTABLE_OUTPUT_PATH
+set (EXECUTABLE_OUTPUT_PATH
      ${Testing_BINARY_DIR}/bin/ CACHE PATH
      "Single output directory for building all executables.")
 
 #
 # Where will executable tests be written ?
 #
-IF (EXECUTABLE_OUTPUT_PATH)
-  SET (CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
-ELSE (EXECUTABLE_OUTPUT_PATH)
-  SET (CXX_TEST_PATH .)
-ENDIF (EXECUTABLE_OUTPUT_PATH)
+if (EXECUTABLE_OUTPUT_PATH)
+  set (CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
+else (EXECUTABLE_OUTPUT_PATH)
+  set (CXX_TEST_PATH .)
+endif (EXECUTABLE_OUTPUT_PATH)
 
 #
 # Include Dart
 # (will also set NSLOOKUP, HOSTNAME, etc.)
 #
-INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake)
+include (${CMAKE_ROOT}/Modules/Dart.cmake)
 
 #
 # Extra coverage
 #
-BUILD_COMMAND(BUILD_COMMAND_VAR ${CMAKE_MAKE_PROGRAM})
-BUILD_NAME(BUILD_NAME_VAR)
-SITE_NAME(SITE_NAME_VAR)
+build_command(BUILD_COMMAND_VAR ${CMAKE_MAKE_PROGRAM})
+build_name(BUILD_NAME_VAR)
+site_name(SITE_NAME_VAR)
 
 #
 # Enable testing
 #
-ENABLE_TESTING()
+enable_testing()
 
 #
 # Add test
 #
-ADD_EXECUTABLE(testing testing.cxx)
-ADD_TEST(testing.1 ${Testing_BINARY_DIR}/bin/testing)
+add_executable(testing testing.cxx)
+add_test(testing.1 ${Testing_BINARY_DIR}/bin/testing)
 
 #
 # skip level test
 #
-ADD_SUBDIRECTORY(Sub/Sub2)
+add_subdirectory(Sub/Sub2)
 
 # Per-config target name and generator expressions.
-ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../PerConfig PerConfig)
-ADD_TEST(NAME testing.perconfig COMMAND perconfig)
-ADD_TEST(NAME testing.driver COMMAND ${PerConfig_COMMAND})
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../PerConfig PerConfig)
+add_test(NAME testing.perconfig COMMAND perconfig)
+add_test(NAME testing.driver COMMAND ${PerConfig_COMMAND})
diff --git a/Tests/Testing/DartConfig.cmake b/Tests/Testing/DartConfig.cmake
index 9494eeccb..de6ea4b41 100644
--- a/Tests/Testing/DartConfig.cmake
+++ b/Tests/Testing/DartConfig.cmake
@@ -1,24 +1,24 @@
 # Dashboard is opened for submissions for a 24 hour period starting at
 # the specified NIGHLY_START_TIME. Time is specified in 24 hour format.
-SET (NIGHTLY_START_TIME "23:00:00 EST")
+set (NIGHTLY_START_TIME "23:00:00 EST")
 
 # Dart server to submit results (used by client)
-SET (DROP_SITE "")
-SET (DROP_LOCATION "")
-SET (DROP_SITE_USER "")
-SET (DROP_SITE_PASSWORD "")
-SET (TRIGGER_SITE "")
+set (DROP_SITE "")
+set (DROP_LOCATION "")
+set (DROP_SITE_USER "")
+set (DROP_SITE_PASSWORD "")
+set (TRIGGER_SITE "")
 
 # Dart server configuration
-# SET (CVS_WEB_URL "")
-# SET (CVS_WEB_CVSROOT "")
-# SET (USE_DOXYGEN "Off")
-# SET (DOXYGEN_URL "")
-# SET (GNATS_WEB_URL "")
+# set (CVS_WEB_URL "")
+# set (CVS_WEB_CVSROOT "")
+# set (USE_DOXYGEN "Off")
+# set (DOXYGEN_URL "")
+# set (GNATS_WEB_URL "")
 
 # Continuous email delivery variables
-# SET (CONTINUOUS_FROM "")
-# SET (SMTP_MAILHOST "")
-# SET (CONTINUOUS_MONITOR_LIST "")
-# SET (CONTINUOUS_BASE_URL "")
+# set (CONTINUOUS_FROM "")
+# set (SMTP_MAILHOST "")
+# set (CONTINUOUS_MONITOR_LIST "")
+# set (CONTINUOUS_BASE_URL "")
 
diff --git a/Tests/Testing/Sub/Sub2/CMakeLists.txt b/Tests/Testing/Sub/Sub2/CMakeLists.txt
index fb9e8619e..78f4d1a95 100644
--- a/Tests/Testing/Sub/Sub2/CMakeLists.txt
+++ b/Tests/Testing/Sub/Sub2/CMakeLists.txt
@@ -1,8 +1,8 @@
 #
 # Add test
 #
-ADD_EXECUTABLE(testing2 testing2.cxx)
-ADD_TEST(testing.2 ${Testing_BINARY_DIR}/bin/testing2)
+add_executable(testing2 testing2.cxx)
+add_test(testing.2 ${Testing_BINARY_DIR}/bin/testing2)
 
 add_test(NotCycle.a ${CMAKE_COMMAND} -E echo a)
 add_test(NotCycle.test1 ${CMAKE_COMMAND} -E echo test1)
diff --git a/Tests/TryCompile/CMakeLists.txt b/Tests/TryCompile/CMakeLists.txt
index 8bfb61eef..90f878e7b 100644
--- a/Tests/TryCompile/CMakeLists.txt
+++ b/Tests/TryCompile/CMakeLists.txt
@@ -1,120 +1,120 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(TryCompile)
+project(TryCompile)
 
-MACRO(TEST_ASSERT value msg)
-  IF (NOT ${value})
-    MESSAGE (SEND_ERROR "Assertion failure:" ${msg} )
-  ENDIF (NOT ${value})
-ENDMACRO(TEST_ASSERT)
+macro(TEST_ASSERT value msg)
+  if (NOT ${value})
+    message (SEND_ERROR "Assertion failure:" ${msg} )
+  endif (NOT ${value})
+endmacro(TEST_ASSERT)
 
-MACRO(TEST_FAIL value msg)
-  IF (${value})
-    MESSAGE (SEND_ERROR "Failing test succeeded:" ${msg} )
-  ENDIF (${value})
-ENDMACRO(TEST_FAIL)
+macro(TEST_FAIL value msg)
+  if (${value})
+    message (SEND_ERROR "Failing test succeeded:" ${msg} )
+  endif (${value})
+endmacro(TEST_FAIL)
 
-MACRO(TEST_EXPECT_EXACT command expected)
-  IF(NOT "x${result}" STREQUAL "x${expected}")
-    MESSAGE(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"")
-  ENDIF(NOT "x${result}" STREQUAL "x${expected}")
-ENDMACRO(TEST_EXPECT_EXACT command expected)
+macro(TEST_EXPECT_EXACT command expected)
+  if(NOT "x${result}" STREQUAL "x${expected}")
+    message(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"")
+  endif(NOT "x${result}" STREQUAL "x${expected}")
+endmacro(TEST_EXPECT_EXACT command expected)
 
-MACRO(TEST_EXPECT_CONTAINS command expected)
-  IF(NOT "${result}" MATCHES "${expected}")
-    MESSAGE(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"")
-  ENDIF(NOT "${result}" MATCHES "${expected}")
-ENDMACRO(TEST_EXPECT_CONTAINS command expected)
+macro(TEST_EXPECT_CONTAINS command expected)
+  if(NOT "${result}" MATCHES "${expected}")
+    message(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"")
+  endif(NOT "${result}" MATCHES "${expected}")
+endmacro(TEST_EXPECT_CONTAINS command expected)
 
 
 # try to compile a file that should compile
 # also check that COPY_FILE works
-TRY_COMPILE(SHOULD_PASS
+try_compile(SHOULD_PASS
     ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
     ${TryCompile_SOURCE_DIR}/pass.c
     OUTPUT_VARIABLE TRY_OUT
     COPY_FILE ${TryCompile_BINARY_DIR}/CopyOfPass
     )
 
-IF(NOT SHOULD_PASS)
-  MESSAGE(SEND_ERROR "should pass failed ${TRY_OUT}")
-ENDIF(NOT SHOULD_PASS)
-IF(NOT EXISTS "${TryCompile_BINARY_DIR}/CopyOfPass")
-   MESSAGE(SEND_ERROR "COPY_FILE to \"${TryCompile_BINARY_DIR}/CopyOfPass\" failed")
-ELSE(NOT EXISTS "${TryCompile_BINARY_DIR}/CopyOfPass")
-   FILE(REMOVE "${TryCompile_BINARY_DIR}/CopyOfPass")
-ENDIF(NOT EXISTS "${TryCompile_BINARY_DIR}/CopyOfPass")
+if(NOT SHOULD_PASS)
+  message(SEND_ERROR "should pass failed ${TRY_OUT}")
+endif(NOT SHOULD_PASS)
+if(NOT EXISTS "${TryCompile_BINARY_DIR}/CopyOfPass")
+   message(SEND_ERROR "COPY_FILE to \"${TryCompile_BINARY_DIR}/CopyOfPass\" failed")
+else(NOT EXISTS "${TryCompile_BINARY_DIR}/CopyOfPass")
+   file(REMOVE "${TryCompile_BINARY_DIR}/CopyOfPass")
+endif(NOT EXISTS "${TryCompile_BINARY_DIR}/CopyOfPass")
 
 # try to compile a file that should not compile
-TRY_COMPILE(SHOULD_FAIL
+try_compile(SHOULD_FAIL
     ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
     ${TryCompile_SOURCE_DIR}/fail.c
     OUTPUT_VARIABLE TRY_OUT)
-IF(SHOULD_FAIL)
-   MESSAGE(SEND_ERROR "Should fail passed ${TRY_OUT}")
-ENDIF(SHOULD_FAIL)
+if(SHOULD_FAIL)
+   message(SEND_ERROR "Should fail passed ${TRY_OUT}")
+endif(SHOULD_FAIL)
 
 # try to compile a file that should compile
-TRY_COMPILE(SHOULD_PASS
+try_compile(SHOULD_PASS
     ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
     ${TryCompile_SOURCE_DIR}/pass.c
     OUTPUT_VARIABLE TRY_OUT)
-IF(NOT SHOULD_PASS)
-  MESSAGE(SEND_ERROR "should pass failed ${TRY_OUT}")
-ENDIF(NOT SHOULD_PASS)
+if(NOT SHOULD_PASS)
+  message(SEND_ERROR "should pass failed ${TRY_OUT}")
+endif(NOT SHOULD_PASS)
 
 # try to compile a file that should not compile
-TRY_COMPILE(SHOULD_FAIL
+try_compile(SHOULD_FAIL
     ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
     ${TryCompile_SOURCE_DIR}/fail.c
     OUTPUT_VARIABLE TRY_OUT)
-IF(SHOULD_FAIL)
-   MESSAGE(SEND_ERROR "Should fail passed ${TRY_OUT}")
-ENDIF(SHOULD_FAIL)
+if(SHOULD_FAIL)
+   message(SEND_ERROR "Should fail passed ${TRY_OUT}")
+endif(SHOULD_FAIL)
 
-IF(NOT SHOULD_FAIL)
-  IF(SHOULD_PASS)
-    MESSAGE("All Tests passed, ignore all previous output.")
-  ELSE(SHOULD_PASS)
-    MESSAGE("Test failed")
-  ENDIF(SHOULD_PASS)
-ELSE(NOT SHOULD_FAIL)
-  MESSAGE("Test failed")
-ENDIF(NOT SHOULD_FAIL)
-TRY_COMPILE(CMAKE_ANSI_FOR_SCOPE
+if(NOT SHOULD_FAIL)
+  if(SHOULD_PASS)
+    message("All Tests passed, ignore all previous output.")
+  else(SHOULD_PASS)
+    message("Test failed")
+  endif(SHOULD_PASS)
+else(NOT SHOULD_FAIL)
+  message("Test failed")
+endif(NOT SHOULD_FAIL)
+try_compile(CMAKE_ANSI_FOR_SCOPE
   ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
     ${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx OUTPUT_VARIABLE OUT)
-IF (CMAKE_ANSI_FOR_SCOPE)
-   MESSAGE("Compiler supports ansi for")
-ELSE(CMAKE_ANSI_FOR_SCOPE)
-   MESSAGE("Compiler does not support ansi for scope")
-ENDIF(CMAKE_ANSI_FOR_SCOPE)
+if (CMAKE_ANSI_FOR_SCOPE)
+   message("Compiler supports ansi for")
+else(CMAKE_ANSI_FOR_SCOPE)
+   message("Compiler does not support ansi for scope")
+endif(CMAKE_ANSI_FOR_SCOPE)
 
-TRY_COMPILE(CMAKE_ANSI_FOR_SCOPE
+try_compile(CMAKE_ANSI_FOR_SCOPE
   ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
     ${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx OUTPUT_VARIABLE OUT)
-IF (CMAKE_ANSI_FOR_SCOPE)
-   MESSAGE("Compiler supports ansi for")
-ELSE(CMAKE_ANSI_FOR_SCOPE)
-   MESSAGE("Compiler does not support ansi for scope")
-ENDIF(CMAKE_ANSI_FOR_SCOPE)
+if (CMAKE_ANSI_FOR_SCOPE)
+   message("Compiler supports ansi for")
+else(CMAKE_ANSI_FOR_SCOPE)
+   message("Compiler does not support ansi for scope")
+endif(CMAKE_ANSI_FOR_SCOPE)
 
-MESSAGE("use the module now")
-INCLUDE(${CMAKE_ROOT}/Modules/TestForANSIForScope.cmake)
-IF (CMAKE_ANSI_FOR_SCOPE)
-   MESSAGE("Compiler supports ansi for")
-ELSE(CMAKE_ANSI_FOR_SCOPE)
-   MESSAGE("Compiler does not support ansi for scope")
-ENDIF(CMAKE_ANSI_FOR_SCOPE)
+message("use the module now")
+include(${CMAKE_ROOT}/Modules/TestForANSIForScope.cmake)
+if (CMAKE_ANSI_FOR_SCOPE)
+   message("Compiler supports ansi for")
+else(CMAKE_ANSI_FOR_SCOPE)
+   message("Compiler does not support ansi for scope")
+endif(CMAKE_ANSI_FOR_SCOPE)
 
-MESSAGE("Testing try_compile project mode")
-TRY_COMPILE(TEST_INNER
+message("Testing try_compile project mode")
+try_compile(TEST_INNER
   ${TryCompile_BINARY_DIR}/CMakeFiles/Inner
   ${TryCompile_SOURCE_DIR}/Inner
   TryCompileInner innerexe
   OUTPUT_VARIABLE output)
 TEST_ASSERT(TEST_INNER "try_compile project mode failed:\n${output}")
 
-ADD_EXECUTABLE(TryCompile pass.c)
+add_executable(TryCompile pass.c)
 
 ######################################
 
@@ -123,73 +123,73 @@ ADD_EXECUTABLE(TryCompile pass.c)
 # try to run a file that should compile and run without error
 # also check that OUTPUT_VARIABLE contains both the compile output
 # and the run output
-TRY_RUN(SHOULD_RUN SHOULD_COMPILE
+try_run(SHOULD_RUN SHOULD_COMPILE
     ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
     ${TryCompile_SOURCE_DIR}/exit_success.c
     OUTPUT_VARIABLE TRY_OUT)
-IF(NOT SHOULD_COMPILE)
-  MESSAGE(SEND_ERROR "exit_success failed compiling: ${TRY_OUT}")
-ENDIF(NOT SHOULD_COMPILE)
-IF(NOT "${SHOULD_RUN}" STREQUAL "0")
-  MESSAGE(SEND_ERROR "exit_success failed running with exit code ${SHOULD_RUN}")
-ENDIF(NOT "${SHOULD_RUN}" STREQUAL "0")
+if(NOT SHOULD_COMPILE)
+  message(SEND_ERROR "exit_success failed compiling: ${TRY_OUT}")
+endif(NOT SHOULD_COMPILE)
+if(NOT "${SHOULD_RUN}" STREQUAL "0")
+  message(SEND_ERROR "exit_success failed running with exit code ${SHOULD_RUN}")
+endif(NOT "${SHOULD_RUN}" STREQUAL "0")
 # check the compile output for the filename
-IF(NOT "${TRY_OUT}" MATCHES "exit_success")
-  MESSAGE(SEND_ERROR " TRY_OUT didn't contain \"exit_success\": \"${TRY_OUT}\"")
-ENDIF(NOT "${TRY_OUT}" MATCHES "exit_success")
+if(NOT "${TRY_OUT}" MATCHES "exit_success")
+  message(SEND_ERROR " TRY_OUT didn't contain \"exit_success\": \"${TRY_OUT}\"")
+endif(NOT "${TRY_OUT}" MATCHES "exit_success")
 # check the run output
-IF(NOT "${TRY_OUT}" MATCHES "hello world")
-  MESSAGE(SEND_ERROR " TRY_OUT didn't contain \"hello world\": \"${TRY_OUT}\"")
-ENDIF(NOT "${TRY_OUT}" MATCHES "hello world")
+if(NOT "${TRY_OUT}" MATCHES "hello world")
+  message(SEND_ERROR " TRY_OUT didn't contain \"hello world\": \"${TRY_OUT}\"")
+endif(NOT "${TRY_OUT}" MATCHES "hello world")
 
-TRY_RUN(ARG_TEST_RUN ARG_TEST_COMPILE
+try_run(ARG_TEST_RUN ARG_TEST_COMPILE
     ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
     ${TryCompile_SOURCE_DIR}/expect_arg.c
     OUTPUT_VARIABLE TRY_OUT
     ARGS arg1 arg2)
-IF(NOT ARG_TEST_COMPILE)
-  MESSAGE(SEND_ERROR "expect_arg failed compiling: ${TRY_OUT}")
-ENDIF(NOT ARG_TEST_COMPILE)
-IF(NOT "${ARG_TEST_RUN}" STREQUAL "0")
-  MESSAGE(SEND_ERROR "expect_arg failed running with exit code ${ARG_TEST_RUN} ${TRY_OUT}")
-ENDIF(NOT "${ARG_TEST_RUN}" STREQUAL "0")
+if(NOT ARG_TEST_COMPILE)
+  message(SEND_ERROR "expect_arg failed compiling: ${TRY_OUT}")
+endif(NOT ARG_TEST_COMPILE)
+if(NOT "${ARG_TEST_RUN}" STREQUAL "0")
+  message(SEND_ERROR "expect_arg failed running with exit code ${ARG_TEST_RUN} ${TRY_OUT}")
+endif(NOT "${ARG_TEST_RUN}" STREQUAL "0")
 
 # try to run a file that should compile and run, but return an error
-TRY_RUN(SHOULD_EXIT_WITH_ERROR SHOULD_COMPILE
+try_run(SHOULD_EXIT_WITH_ERROR SHOULD_COMPILE
     ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
     ${TryCompile_SOURCE_DIR}/exit_with_error.c
     COMPILE_OUTPUT_VARIABLE COMPILE_OUTPUT
     RUN_OUTPUT_VARIABLE RUN_OUTPUT)
 
-IF(NOT SHOULD_COMPILE)
-  MESSAGE(STATUS " exit_with_error failed compiling: ${COMPILE_OUTPUT}")
-ENDIF(NOT SHOULD_COMPILE)
-IF("${SHOULD_EXIT_WITH_ERROR}" STREQUAL "0")
-  MESSAGE(SEND_ERROR " exit_with_error passed with exit code ${SHOULD_EXIT_WITH_ERROR}")
-ENDIF("${SHOULD_EXIT_WITH_ERROR}" STREQUAL "0")
+if(NOT SHOULD_COMPILE)
+  message(STATUS " exit_with_error failed compiling: ${COMPILE_OUTPUT}")
+endif(NOT SHOULD_COMPILE)
+if("${SHOULD_EXIT_WITH_ERROR}" STREQUAL "0")
+  message(SEND_ERROR " exit_with_error passed with exit code ${SHOULD_EXIT_WITH_ERROR}")
+endif("${SHOULD_EXIT_WITH_ERROR}" STREQUAL "0")
 
 # check the compile output, it should contain the filename
-IF(NOT "${COMPILE_OUTPUT}" MATCHES "exit_with_error")
-  MESSAGE(SEND_ERROR " COMPILE_OUT didn't contain \"exit_with_error\": \"${COMPILE_OUTPUT}\"")
-ENDIF(NOT "${COMPILE_OUTPUT}" MATCHES "exit_with_error")
+if(NOT "${COMPILE_OUTPUT}" MATCHES "exit_with_error")
+  message(SEND_ERROR " COMPILE_OUT didn't contain \"exit_with_error\": \"${COMPILE_OUTPUT}\"")
+endif(NOT "${COMPILE_OUTPUT}" MATCHES "exit_with_error")
 #... but not the run time output
-IF("${COMPILE_OUTPUT}" MATCHES "hello world")
-  MESSAGE(SEND_ERROR " COMPILE_OUT contains the run output: \"${COMPILE_OUTPUT}\"")
-ENDIF("${COMPILE_OUTPUT}" MATCHES "hello world")
+if("${COMPILE_OUTPUT}" MATCHES "hello world")
+  message(SEND_ERROR " COMPILE_OUT contains the run output: \"${COMPILE_OUTPUT}\"")
+endif("${COMPILE_OUTPUT}" MATCHES "hello world")
 # check the run output, it should stdout
-IF(NOT "${RUN_OUTPUT}" MATCHES "hello world")
-  MESSAGE(SEND_ERROR " RUN_OUTPUT didn't contain \"hello world\": \"${RUN_OUTPUT}\"")
-ENDIF(NOT "${RUN_OUTPUT}" MATCHES "hello world")
+if(NOT "${RUN_OUTPUT}" MATCHES "hello world")
+  message(SEND_ERROR " RUN_OUTPUT didn't contain \"hello world\": \"${RUN_OUTPUT}\"")
+endif(NOT "${RUN_OUTPUT}" MATCHES "hello world")
 
 #######################################################################
 #
 # also test that the CHECK_C_SOURCE_COMPILES, CHECK_CXX_SOURCE_COMPILES
 # CHECK_C_SOURCE_RUNS and CHECK_CXX_SOURCE_RUNS macros work
 
-INCLUDE(CheckCSourceCompiles)
-INCLUDE(CheckCXXSourceCompiles)
-INCLUDE(CheckCSourceRuns)
-INCLUDE(CheckCXXSourceRuns)
+include(CheckCSourceCompiles)
+include(CheckCXXSourceCompiles)
+include(CheckCSourceRuns)
+include(CheckCXXSourceRuns)
 
 CHECK_C_SOURCE_COMPILES("I dont build" C_BUILD_SHOULD_FAIL)
 CHECK_C_SOURCE_COMPILES("int main() {return 0;}" C_BUILD_SHOULD_WORK)
@@ -211,27 +211,27 @@ TEST_ASSERT(CXX_BUILD_SHOULD_WORK "CHECK_CXX_SOURCE_COMPILES() failed")
 TEST_FAIL(CXX_RUN_SHOULD_FAIL "CHECK_CXX_SOURCE_RUNS() succeeded, but should have failed")
 TEST_ASSERT(CXX_RUN_SHOULD_WORK "CHECK_CXX_SOURCE_RUNS() failed")
 
-FOREACH(lang C CXX)
-  IF(NOT "${CMAKE_${lang}_COMPILER_ID}" MATCHES "^(PathScale)$")
-    SET(${lang}_DD --)
-  ENDIF()
-ENDFOREACH()
+foreach(lang C CXX)
+  if(NOT "${CMAKE_${lang}_COMPILER_ID}" MATCHES "^(PathScale)$")
+    set(${lang}_DD --)
+  endif()
+endforeach()
 
-UNSET(C_BOGUS_FLAG CACHE)
-INCLUDE(CheckCCompilerFlag)
+unset(C_BOGUS_FLAG CACHE)
+include(CheckCCompilerFlag)
 CHECK_C_COMPILER_FLAG(${C_DD}-_this_is_not_a_flag_ C_BOGUS_FLAG)
 TEST_FAIL(C_BOGUS_FLAG "CHECK_C_COMPILER_FLAG() succeeded, but should have failed")
 
-UNSET(CXX_BOGUS_FLAG CACHE)
-INCLUDE(CheckCXXCompilerFlag)
+unset(CXX_BOGUS_FLAG CACHE)
+include(CheckCXXCompilerFlag)
 CHECK_CXX_COMPILER_FLAG(${CXX_DD}-_this_is_not_a_flag_ CXX_BOGUS_FLAG)
 TEST_FAIL(CXX_BOGUS_FLAG "CHECK_CXX_COMPILER_FLAG() succeeded, but should have failed")
 
-IF("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
-  UNSET(C_STRICT_PROTOTYPES CACHE)
+if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
+  unset(C_STRICT_PROTOTYPES CACHE)
   CHECK_C_COMPILER_FLAG("-Werror;-Wstrict-prototypes" C_STRICT_PROTOTYPES)
   TEST_ASSERT(C_STRICT_PROTOTYPES "CHECK_C_COMPILER_FLAG failed -Werror -Wstrict-prototypes")
-ENDIF()
+endif()
 
 #######################################################################
 #
diff --git a/Tests/Tutorial/Step7/build1.cmake b/Tests/Tutorial/Step7/build1.cmake
index 039d5569b..baa475f28 100644
--- a/Tests/Tutorial/Step7/build1.cmake
+++ b/Tests/Tutorial/Step7/build1.cmake
@@ -1,5 +1,5 @@
-SET(CTEST_SOURCE_DIRECTORY "$ENV{HOME}/Dashboards/My Tests/CMake/Tests/Tutorial/Step7")
-SET(CTEST_BINARY_DIRECTORY "${CTEST_SOURCE_DIRECTORY}-build1")
+set(CTEST_SOURCE_DIRECTORY "$ENV{HOME}/Dashboards/My Tests/CMake/Tests/Tutorial/Step7")
+set(CTEST_BINARY_DIRECTORY "${CTEST_SOURCE_DIRECTORY}-build1")
 
-SET(CTEST_CMAKE_COMMAND "cmake")
-SET(CTEST_COMMAND "ctest -D Experimental")
+set(CTEST_CMAKE_COMMAND "cmake")
+set(CTEST_COMMAND "ctest -D Experimental")
diff --git a/Tests/Tutorial/Step7/build2.cmake b/Tests/Tutorial/Step7/build2.cmake
index 5112355b2..c2f2e2e10 100644
--- a/Tests/Tutorial/Step7/build2.cmake
+++ b/Tests/Tutorial/Step7/build2.cmake
@@ -1,6 +1,6 @@
-SET(CTEST_SOURCE_DIRECTORY "$ENV{HOME}/Dashboards/My Tests/CMake/Tests/Tutorial/Step7")
-SET(CTEST_BINARY_DIRECTORY "${CTEST_SOURCE_DIRECTORY}-build2")
-SET(CTEST_CMAKE_GENERATOR "Visual Studio 8 2005")
+set(CTEST_SOURCE_DIRECTORY "$ENV{HOME}/Dashboards/My Tests/CMake/Tests/Tutorial/Step7")
+set(CTEST_BINARY_DIRECTORY "${CTEST_SOURCE_DIRECTORY}-build2")
+set(CTEST_CMAKE_GENERATOR "Visual Studio 8 2005")
 
 CTEST_START("Experimental")
 CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}")
diff --git a/Tests/VSExternalInclude/CMakeLists.txt b/Tests/VSExternalInclude/CMakeLists.txt
index 4a413d598..af0b18f2c 100644
--- a/Tests/VSExternalInclude/CMakeLists.txt
+++ b/Tests/VSExternalInclude/CMakeLists.txt
@@ -1,54 +1,54 @@
 cmake_minimum_required (VERSION 2.6)
-PROJECT(VSExternalInclude)
+project(VSExternalInclude)
 
-IF(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
-  SET(PROJECT_EXT dsp)
-ELSE(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
-  SET(PROJECT_EXT vcproj)
-ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
-IF(${CMAKE_GENERATOR} MATCHES "Visual Studio 1[01]")
-  SET(PROJECT_EXT vcxproj)
-ENDIF()
+if(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
+  set(PROJECT_EXT dsp)
+else(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
+  set(PROJECT_EXT vcproj)
+endif(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
+if(${CMAKE_GENERATOR} MATCHES "Visual Studio 1[01]")
+  set(PROJECT_EXT vcxproj)
+endif()
 
 # make sure directories exists
-SET(LIB1_BINARY_DIR ${VSExternalInclude_BINARY_DIR}/Lib1)
-MAKE_DIRECTORY("${LIB1_BINARY_DIR}")
+set(LIB1_BINARY_DIR ${VSExternalInclude_BINARY_DIR}/Lib1)
+make_directory("${LIB1_BINARY_DIR}")
 
-SET(LIB2_BINARY_DIR ${VSExternalInclude_BINARY_DIR}/Lib2)
-MAKE_DIRECTORY("${LIB2_BINARY_DIR}")
+set(LIB2_BINARY_DIR ${VSExternalInclude_BINARY_DIR}/Lib2)
+make_directory("${LIB2_BINARY_DIR}")
 
 # generate lib1
-EXEC_PROGRAM("${CMAKE_COMMAND}" "${LIB1_BINARY_DIR}"  ARGS -G\"${CMAKE_GENERATOR}\"
+exec_program("${CMAKE_COMMAND}" "${LIB1_BINARY_DIR}"  ARGS -G\"${CMAKE_GENERATOR}\"
   \"${VSExternalInclude_SOURCE_DIR}/Lib1\" OUTPUT_VARIABLE OUT)
-MESSAGE("CMAKE Ran with the following output:\n\"${OUT}\"")
+message("CMAKE Ran with the following output:\n\"${OUT}\"")
 
 # generate lib2
-EXEC_PROGRAM("${CMAKE_COMMAND}" "${LIB2_BINARY_DIR}"  ARGS -G\"${CMAKE_GENERATOR}\"
+exec_program("${CMAKE_COMMAND}" "${LIB2_BINARY_DIR}"  ARGS -G\"${CMAKE_GENERATOR}\"
   \"${VSExternalInclude_SOURCE_DIR}/Lib2\" OUTPUT_VARIABLE OUT)
-MESSAGE("CMAKE Ran with the following output:\n\"${OUT}\"")
+message("CMAKE Ran with the following output:\n\"${OUT}\"")
 
 
-INCLUDE_EXTERNAL_MSPROJECT(lib1 ${VSExternalInclude_BINARY_DIR}/Lib1/LIB1.${PROJECT_EXT})
+include_external_msproject(lib1 ${VSExternalInclude_BINARY_DIR}/Lib1/LIB1.${PROJECT_EXT})
 # lib2 depends on lib1
-INCLUDE_EXTERNAL_MSPROJECT(lib2 ${VSExternalInclude_BINARY_DIR}/Lib2/LIB2.${PROJECT_EXT} lib1)
+include_external_msproject(lib2 ${VSExternalInclude_BINARY_DIR}/Lib2/LIB2.${PROJECT_EXT} lib1)
 
-INCLUDE_DIRECTORIES(${VSExternalInclude_SOURCE_DIR}/Lib2 ${VSExternalInclude_SOURCE_DIR}/Lib1)
+include_directories(${VSExternalInclude_SOURCE_DIR}/Lib2 ${VSExternalInclude_SOURCE_DIR}/Lib1)
 
-SET(SOURCES main.cpp)
+set(SOURCES main.cpp)
 
-ADD_EXECUTABLE(VSExternalInclude ${SOURCES})
+add_executable(VSExternalInclude ${SOURCES})
 
 # target depends on lib2
-ADD_DEPENDENCIES(VSExternalInclude lib2)
+add_dependencies(VSExternalInclude lib2)
 # VS 10 vcxproj files have depends in them
 # Since lib1 and lib2 do not depend on each other
 # then the vcxproj files do not depend on each other
 # and the sln file can no longer be the only source
 # of that depend.  So, for VS 10 make the executable
 # depend on lib1 and lib2
-IF(MSVC10 OR MSVC11)
-  ADD_DEPENDENCIES(VSExternalInclude lib1)
-ENDIF()
+if(MSVC10 OR MSVC11)
+  add_dependencies(VSExternalInclude lib1)
+endif()
 
 # Interaction testing between the FOLDER target property and
 # INCLUDE_EXTERNAL_MSPROJECT targets:
diff --git a/Tests/VSExternalInclude/Lib1/CMakeLists.txt b/Tests/VSExternalInclude/Lib1/CMakeLists.txt
index 72ffcedc1..1cb01c5dd 100644
--- a/Tests/VSExternalInclude/Lib1/CMakeLists.txt
+++ b/Tests/VSExternalInclude/Lib1/CMakeLists.txt
@@ -1,5 +1,5 @@
-PROJECT(LIB1)
+project(LIB1)
 
-SET(SOURCES lib1.cpp)
+set(SOURCES lib1.cpp)
 
-ADD_LIBRARY(lib1 ${SOURCES})
+add_library(lib1 ${SOURCES})
diff --git a/Tests/VSExternalInclude/Lib2/CMakeLists.txt b/Tests/VSExternalInclude/Lib2/CMakeLists.txt
index 31e40e4e1..f726c3f8b 100644
--- a/Tests/VSExternalInclude/Lib2/CMakeLists.txt
+++ b/Tests/VSExternalInclude/Lib2/CMakeLists.txt
@@ -1,7 +1,7 @@
-PROJECT(VSEXTERNAL_LIB2)
+project(VSEXTERNAL_LIB2)
 
-INCLUDE_DIRECTORIES(${VSEXTERNAL_LIB2_SOURCE_DIR}/../Lib1)
+include_directories(${VSEXTERNAL_LIB2_SOURCE_DIR}/../Lib1)
 
-SET(SOURCES lib2.cpp)
+set(SOURCES lib2.cpp)
 
-ADD_LIBRARY(lib2 ${SOURCES})
+add_library(lib2 ${SOURCES})
diff --git a/Tests/Wrapping/CMakeLists.txt b/Tests/Wrapping/CMakeLists.txt
index 5f441dd9e..344b11de2 100644
--- a/Tests/Wrapping/CMakeLists.txt
+++ b/Tests/Wrapping/CMakeLists.txt
@@ -2,82 +2,82 @@
 # Wrapping
 #
 cmake_minimum_required (VERSION 2.6)
-PROJECT (Wrapping)
+project (Wrapping)
 
 # Disable cleaning of custom command outputs to preserve the hacks
 # used to generate the files using CONFIGURE_FILE.
-SET_DIRECTORY_PROPERTIES(PROPERTIES CLEAN_NO_CUSTOM 1)
+set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM 1)
 
 #
 # Lib and exe path
 #
-SET (LIBRARY_OUTPUT_PATH
+set (LIBRARY_OUTPUT_PATH
   ${Wrapping_BINARY_DIR}/bin/ CACHE INTERNAL
   "Single output directory for building all libraries.")
 
-SET (EXECUTABLE_OUTPUT_PATH
+set (EXECUTABLE_OUTPUT_PATH
   ${Wrapping_BINARY_DIR}/bin/ CACHE INTERNAL
   "Single output directory for building all executables.")
 
 #
 # Where will executable tests be written ?
 #
-IF (EXECUTABLE_OUTPUT_PATH)
-  SET (CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
-ELSE (EXECUTABLE_OUTPUT_PATH)
-  SET (CXX_TEST_PATH .)
-ENDIF (EXECUTABLE_OUTPUT_PATH)
+if (EXECUTABLE_OUTPUT_PATH)
+  set (CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
+else (EXECUTABLE_OUTPUT_PATH)
+  set (CXX_TEST_PATH .)
+endif (EXECUTABLE_OUTPUT_PATH)
 
 #
 # Add exe
 #
-ADD_EXECUTABLE (wrapping wrapping.cxx)
+add_executable (wrapping wrapping.cxx)
 
-ADD_EXECUTABLE (Wrap Wrap.c)
-IF(WIN32)
-  SET(EXE_EXT ".exe")
-ENDIF(WIN32)
-SET(WRAP ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/Wrap${EXE_EXT})
+add_executable (Wrap Wrap.c)
+if(WIN32)
+  set(EXE_EXT ".exe")
+endif(WIN32)
+set(WRAP ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/Wrap${EXE_EXT})
 
 #
 # QT Wrappers
 #
 
-SET (QT_WRAP_CPP "On")
-SET (QT_MOC_EXE "echo")
-INCLUDE( FindQt3 )
+set (QT_WRAP_CPP "On")
+set (QT_MOC_EXE "echo")
+include( FindQt3 )
 
-IF (QT_FOUND AND QT_WRAP_UI)
+if (QT_FOUND AND QT_WRAP_UI)
   message("found qt 3 test it...")
-  INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR} )
-  INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} )
+  include_directories( ${QT_INCLUDE_DIR} )
+  include_directories( ${CMAKE_CURRENT_BINARY_DIR} )
 
 
-  CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/foo.ui.in
+  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/foo.ui.in
     ${CMAKE_CURRENT_BINARY_DIR}/foo.ui IMMEDIATE)
 
-  SET (QT_WRAP_UI "On")
-  SET (QT_UIC_EXE "${QT_UIC_EXECUTABLE}")
+  set (QT_WRAP_UI "On")
+  set (QT_UIC_EXE "${QT_UIC_EXECUTABLE}")
 
 
-  SET (QTUI_SRCS
+  set (QTUI_SRCS
     qtwrapping.ui
     ${CMAKE_CURRENT_BINARY_DIR}/foo.ui
     )
-  QT_WRAP_UI (myqtlib QTUI_H_SRCS QTUI_S_SRCS ${QTUI_SRCS})
-  QT_WRAP_CPP (myqtlib QT_MOC_SRCS ${SRCS} vtkTestMoc.h)
+  qt_wrap_ui (myqtlib QTUI_H_SRCS QTUI_S_SRCS ${QTUI_SRCS})
+  qt_wrap_cpp (myqtlib QT_MOC_SRCS ${SRCS} vtkTestMoc.h)
 
-  MESSAGE("QT files are ${QTUI_S_SRCS}")
-  MESSAGE("QT other files are ${QTUI_H_SRCS}")
-  ADD_DEFINITIONS(${QT_DEFINITIONS})
-  ADD_LIBRARY(myqtlib ${QTUI_S_SRCS} ${QT_MOC_SRCS})
-  ADD_EXECUTABLE (qtwrapping qtwrappingmain.cxx)
-  TARGET_LINK_LIBRARIES(qtwrapping myqtlib)
+  message("QT files are ${QTUI_S_SRCS}")
+  message("QT other files are ${QTUI_H_SRCS}")
+  add_definitions(${QT_DEFINITIONS})
+  add_library(myqtlib ${QTUI_S_SRCS} ${QT_MOC_SRCS})
+  add_executable (qtwrapping qtwrappingmain.cxx)
+  target_link_libraries(qtwrapping myqtlib)
 
-  TARGET_LINK_LIBRARIES( qtwrapping ${QT_LIBRARIES} )
-ELSE (QT_FOUND AND QT_WRAP_UI)
-  ADD_EXECUTABLE (qtwrapping qtnoqtmain.cxx)
-ENDIF (QT_FOUND AND QT_WRAP_UI)
+  target_link_libraries( qtwrapping ${QT_LIBRARIES} )
+else (QT_FOUND AND QT_WRAP_UI)
+  add_executable (qtwrapping qtnoqtmain.cxx)
+endif (QT_FOUND AND QT_WRAP_UI)
 
 #
 # FLTK Wrappers
@@ -85,23 +85,23 @@ ENDIF (QT_FOUND AND QT_WRAP_UI)
 # Since FLTK_FLUID_EXE is supposed to create a .cxx/.h from a .fl/.fld,
 # create an empty one so that the dependencies can be met.
 #
-SET (FLTK_SRCS
+set (FLTK_SRCS
   fltk1.fl
   )
-ADD_EXECUTABLE(fakefluid fakefluid.cxx)
-GET_TARGET_PROPERTY(FLUID_LOC fakefluid LOCATION)
-SET (FLTK_WRAP_UI "On")
-SET (FLTK_FLUID_EXECUTABLE "${FLUID_LOC}")
-FLTK_WRAP_UI (wraplibFLTK ${FLTK_SRCS})
-ADD_LIBRARY(wraplibFLTK ${wraplibFLTK_FLTK_UI_SRCS})
-ADD_DEPENDENCIES(wraplibFLTK fakefluid)
-ADD_DEPENDENCIES(fakefluid Wrap)
+add_executable(fakefluid fakefluid.cxx)
+get_target_property(FLUID_LOC fakefluid LOCATION)
+set (FLTK_WRAP_UI "On")
+set (FLTK_FLUID_EXECUTABLE "${FLUID_LOC}")
+fltk_wrap_ui (wraplibFLTK ${FLTK_SRCS})
+add_library(wraplibFLTK ${wraplibFLTK_FLTK_UI_SRCS})
+add_dependencies(wraplibFLTK fakefluid)
+add_dependencies(fakefluid Wrap)
 #
 # Mangled Mesa
 #
-CONFIGURE_FILE(
+configure_file(
   ${Wrapping_SOURCE_DIR}/dummy
   ${Wrapping_BINARY_DIR}/gl.h
   COPYONLY IMMEDIATE)
-USE_MANGLED_MESA (${Wrapping_BINARY_DIR} ${Wrapping_BINARY_DIR}/mangled_mesa)
+use_mangled_mesa (${Wrapping_BINARY_DIR} ${Wrapping_BINARY_DIR}/mangled_mesa)
 
diff --git a/Tests/X11/CMakeLists.txt b/Tests/X11/CMakeLists.txt
index 3859ba229..33ee27720 100644
--- a/Tests/X11/CMakeLists.txt
+++ b/Tests/X11/CMakeLists.txt
@@ -1,40 +1,40 @@
 # a simple C only test case
 cmake_minimum_required (VERSION 2.6)
-PROJECT (UseX11 CXX C)
+project (UseX11 CXX C)
 
-INCLUDE (${CMAKE_ROOT}/Modules/FindX11.cmake)
-MESSAGE("X11_FOUND: ${X11_FOUND}")
+include (${CMAKE_ROOT}/Modules/FindX11.cmake)
+message("X11_FOUND: ${X11_FOUND}")
 
-ADD_EXECUTABLE (UseX11 X11.c)
+add_executable (UseX11 X11.c)
 install(TARGETS UseX11 DESTINATION bin)
 
 # so for universal binaries this test will fail if
 #
-IF(APPLE)
-  LIST(LENGTH CMAKE_OSX_ARCHITECTURES NUMARCH)
-  IF(NUMARCH GREATER 1)
-    IF(NOT EXISTS /usr/X11R6/lib//libSM.6.dylib)
-      SET(X11_FOUND FALSE)
-      MESSAGE("disable X11, because of universal binary and sysroot")
-    ENDIF(NOT EXISTS /usr/X11R6/lib//libSM.6.dylib)
-  ENDIF(NUMARCH GREATER 1)
-ENDIF(APPLE)
+if(APPLE)
+  list(LENGTH CMAKE_OSX_ARCHITECTURES NUMARCH)
+  if(NUMARCH GREATER 1)
+    if(NOT EXISTS /usr/X11R6/lib//libSM.6.dylib)
+      set(X11_FOUND FALSE)
+      message("disable X11, because of universal binary and sysroot")
+    endif(NOT EXISTS /usr/X11R6/lib//libSM.6.dylib)
+  endif(NUMARCH GREATER 1)
+endif(APPLE)
 
-IF(X11_FOUND)
-  ADD_DEFINITIONS(-DCMAKE_HAS_X)
-  INCLUDE_DIRECTORIES(${X11_INCLUDE_DIR})
-  TARGET_LINK_LIBRARIES(UseX11 ${X11_LIBRARIES})
-  IF(APPLE)
-    ADD_EXECUTABLE(HelloWorldX11 HelloWorldX11.cxx)
-    TARGET_LINK_LIBRARIES(HelloWorldX11 ${X11_LIBRARIES})
+if(X11_FOUND)
+  add_definitions(-DCMAKE_HAS_X)
+  include_directories(${X11_INCLUDE_DIR})
+  target_link_libraries(UseX11 ${X11_LIBRARIES})
+  if(APPLE)
+    add_executable(HelloWorldX11 HelloWorldX11.cxx)
+    target_link_libraries(HelloWorldX11 ${X11_LIBRARIES})
     install(TARGETS HelloWorldX11 DESTINATION bin)
 
     set(CPACK_BINARY_OSXX11 ON CACHE BOOL "" FORCE)
     set(CPACK_BINARY_PACKAGEMAKER OFF CACHE BOOL "" FORCE )
     set(CPACK_PACKAGE_NAME HelloWorldX11Package)
     set(CPACK_PACKAGE_EXECUTABLES HelloWorldX11 HelloWorldX11)
-  ENDIF(APPLE)
-ENDIF(X11_FOUND)
+  endif(APPLE)
+endif(X11_FOUND)
 
 # build a CPack driven installer package
 include(CPack)
diff --git a/Tests/test_clean.cmake.in b/Tests/test_clean.cmake.in
index ce5e62b79..d700749ca 100644
--- a/Tests/test_clean.cmake.in
+++ b/Tests/test_clean.cmake.in
@@ -1,2 +1,2 @@
-SET(TEST_BUILD_DIRS "@TEST_BUILD_DIRS@")
-FILE(REMOVE_RECURSE ${TEST_BUILD_DIRS})
+set(TEST_BUILD_DIRS "@TEST_BUILD_DIRS@")
+file(REMOVE_RECURSE ${TEST_BUILD_DIRS})
diff --git a/Utilities/CMakeLists.txt b/Utilities/CMakeLists.txt
index 8a52e22b3..98c1cfdf5 100644
--- a/Utilities/CMakeLists.txt
+++ b/Utilities/CMakeLists.txt
@@ -9,14 +9,14 @@
 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 # See the License for more information.
 #=============================================================================
-SUBDIRS(Doxygen KWStyle)
+subdirs(Doxygen KWStyle)
 
-MAKE_DIRECTORY(${CMake_BINARY_DIR}/Docs)
+make_directory(${CMake_BINARY_DIR}/Docs)
 
 # Add a documentation target.
-SET(DOC_FILES "")
+set(DOC_FILES "")
 
-SET(MAN_FILES
+set(MAN_FILES
   ${CMake_BINARY_DIR}/Docs/cmake.1
   ${CMake_BINARY_DIR}/Docs/cmakecommands.1
   ${CMake_BINARY_DIR}/Docs/cmakecompat.1
@@ -25,7 +25,7 @@ SET(MAN_FILES
   ${CMake_BINARY_DIR}/Docs/cmakevars.1
   ${CMake_BINARY_DIR}/Docs/cmakemodules.1
   )
-SET(TEXT_FILES
+set(TEXT_FILES
   ${CMake_BINARY_DIR}/Docs/cmake.txt
   ${CMake_BINARY_DIR}/Docs/cmake.docbook
   ${CMake_BINARY_DIR}/Docs/cmake-policies.txt
@@ -35,7 +35,7 @@ SET(TEXT_FILES
   ${CMake_BINARY_DIR}/Docs/cmake-commands.txt
   ${CMake_BINARY_DIR}/Docs/cmake-compatcommands.txt
   )
-SET(HTML_FILES
+set(HTML_FILES
   ${CMake_BINARY_DIR}/Docs/cmake.html
   ${CMake_BINARY_DIR}/Docs/cmake-policies.html
   ${CMake_BINARY_DIR}/Docs/cmake-properties.html
@@ -45,12 +45,12 @@ SET(HTML_FILES
   ${CMake_BINARY_DIR}/Docs/cmake-compatcommands.html
   )
 
-MACRO(ADD_DOCS target dependency)
+macro(ADD_DOCS target dependency)
   # Generate documentation for "ctest" executable.
-  GET_TARGET_PROPERTY(CMD ${target} LOCATION)
+  get_target_property(CMD ${target} LOCATION)
   # only generate the documentation if the target is actually built
-  IF(CMD)
-    ADD_CUSTOM_COMMAND(
+  if(CMD)
+    add_custom_command(
       OUTPUT ${CMake_BINARY_DIR}/Docs/${target}.txt
       ${${target}-PATH} # Possibly set PATH, see below.
       COMMAND ${CMD}
@@ -61,27 +61,27 @@ MACRO(ADD_DOCS target dependency)
       DEPENDS ${target}
       MAIN_DEPENDENCY ${dependency}
       )
-    SET(DOC_FILES ${DOC_FILES} ${CMake_BINARY_DIR}/Docs/${target}.txt)
-    LIST(APPEND MAN_FILES ${CMake_BINARY_DIR}/Docs/${target}.1)
-    LIST(APPEND TEXT_FILES
+    set(DOC_FILES ${DOC_FILES} ${CMake_BINARY_DIR}/Docs/${target}.txt)
+    list(APPEND MAN_FILES ${CMake_BINARY_DIR}/Docs/${target}.1)
+    list(APPEND TEXT_FILES
       ${CMake_BINARY_DIR}/Docs/${target}.txt
       ${CMake_BINARY_DIR}/Docs/${target}.docbook
       )
-    LIST(APPEND HTML_FILES ${CMake_BINARY_DIR}/Docs/${target}.html)
-  ENDIF(CMD)
-ENDMACRO(ADD_DOCS target dependency)
+    list(APPEND HTML_FILES ${CMake_BINARY_DIR}/Docs/${target}.html)
+  endif(CMD)
+endmacro(ADD_DOCS target dependency)
 
 # Help cmake-gui find the Qt DLLs on Windows.
-SET(WIN_SHELL_GENS "Visual Studio|NMake|MinGW|Watcom|Borland")
-IF(BUILD_QtDialog AND "${CMAKE_GENERATOR}" MATCHES "${WIN_SHELL_GENS}"
+set(WIN_SHELL_GENS "Visual Studio|NMake|MinGW|Watcom|Borland")
+if(BUILD_QtDialog AND "${CMAKE_GENERATOR}" MATCHES "${WIN_SHELL_GENS}"
     AND EXISTS "${QT_QMAKE_EXECUTABLE}" AND NOT CMAKE_NO_AUTO_QT_ENV)
-  GET_FILENAME_COMPONENT(Qt_BIN_DIR "${QT_QMAKE_EXECUTABLE}" PATH)
-  IF(EXISTS "${Qt_BIN_DIR}/QtCore4.dll")
+  get_filename_component(Qt_BIN_DIR "${QT_QMAKE_EXECUTABLE}" PATH)
+  if(EXISTS "${Qt_BIN_DIR}/QtCore4.dll")
     # Tell the macro to set the path before running cmake-gui.
-    STRING(REPLACE ";" "\\;" _PATH "PATH=${Qt_BIN_DIR};%PATH%")
-    SET(cmake-gui-PATH COMMAND set "${_PATH}")
-  ENDIF(EXISTS "${Qt_BIN_DIR}/QtCore4.dll")
-ENDIF(BUILD_QtDialog AND "${CMAKE_GENERATOR}" MATCHES "${WIN_SHELL_GENS}"
+    string(REPLACE ";" "\\;" _PATH "PATH=${Qt_BIN_DIR};%PATH%")
+    set(cmake-gui-PATH COMMAND set "${_PATH}")
+  endif(EXISTS "${Qt_BIN_DIR}/QtCore4.dll")
+endif(BUILD_QtDialog AND "${CMAKE_GENERATOR}" MATCHES "${WIN_SHELL_GENS}"
   AND EXISTS "${QT_QMAKE_EXECUTABLE}" AND NOT CMAKE_NO_AUTO_QT_ENV)
 
 # add the docs for the executables
@@ -93,8 +93,8 @@ ADD_DOCS(cmake-gui ${CMake_SOURCE_DIR}/Utilities/Doxygen/doxyfile.in)
 
 # add the documentation for cmake itself
 
-GET_TARGET_PROPERTY(CMD cmake LOCATION)
-ADD_CUSTOM_COMMAND(
+get_target_property(CMD cmake LOCATION)
+add_custom_command(
   OUTPUT ${CMake_BINARY_DIR}/Docs/cmake.txt
   COMMAND ${CMD}
   ARGS --copyright ${CMake_BINARY_DIR}/Docs/Copyright.txt
@@ -124,12 +124,12 @@ ADD_CUSTOM_COMMAND(
   MAIN_DEPENDENCY ${CMake_SOURCE_DIR}/Utilities/Doxygen/authors.txt
   )
 
-INSTALL_FILES(${CMAKE_MAN_DIR}/man1 FILES ${MAN_FILES})
-INSTALL_FILES(${CMAKE_DOC_DIR} FILES ${HTML_FILES} ${TEXT_FILES})
-INSTALL(FILES cmake.m4 DESTINATION share/aclocal)
+install_files(${CMAKE_MAN_DIR}/man1 FILES ${MAN_FILES})
+install_files(${CMAKE_DOC_DIR} FILES ${HTML_FILES} ${TEXT_FILES})
+install(FILES cmake.m4 DESTINATION share/aclocal)
 
 # Drive documentation generation.
-ADD_CUSTOM_TARGET(documentation ALL DEPENDS ${DOC_FILES} ${CMake_BINARY_DIR}/Docs/cmake.txt )
+add_custom_target(documentation ALL DEPENDS ${DOC_FILES} ${CMake_BINARY_DIR}/Docs/cmake.txt )
 
 # Documentation testing.
 if(BUILD_TESTING)
diff --git a/Utilities/Doxygen/CMakeLists.txt b/Utilities/Doxygen/CMakeLists.txt
index 2430391fd..ab40fdf8c 100644
--- a/Utilities/Doxygen/CMakeLists.txt
+++ b/Utilities/Doxygen/CMakeLists.txt
@@ -13,27 +13,27 @@
 #
 # Build the documentation
 #
-INCLUDE (${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL)
+include (${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL)
 
-IF (BUILD_DOCUMENTATION)
+if (BUILD_DOCUMENTATION)
 
   #
   # Configure the script and the doxyfile, then add target
   #
-  IF(NOT DOT_PATH)
-    GET_FILENAME_COMPONENT(DOT_PATH ${DOT} PATH)
-  ENDIF(NOT DOT_PATH)
+  if(NOT DOT_PATH)
+    get_filename_component(DOT_PATH ${DOT} PATH)
+  endif(NOT DOT_PATH)
 
-  CONFIGURE_FILE(
+  configure_file(
     ${CMake_SOURCE_DIR}/Utilities/Doxygen/doxyfile.in
     ${CMake_BINARY_DIR}/Utilities/Doxygen/doxyfile)
 
-  CONFIGURE_FILE(
+  configure_file(
     ${CMake_SOURCE_DIR}/Utilities/Doxygen/doc_makeall.sh.in
     ${CMake_BINARY_DIR}/Utilities/Doxygen/doc_makeall.sh)
 
-  ADD_CUSTOM_TARGET(DoxygenDoc
+  add_custom_target(DoxygenDoc
     ${BASH}
     ${CMake_BINARY_DIR}/Utilities/Doxygen/doc_makeall.sh)
 
-ENDIF (BUILD_DOCUMENTATION)
+endif (BUILD_DOCUMENTATION)
diff --git a/Utilities/KWIML/CMakeLists.txt b/Utilities/KWIML/CMakeLists.txt
index 6a8641adc..62b6fffb7 100644
--- a/Utilities/KWIML/CMakeLists.txt
+++ b/Utilities/KWIML/CMakeLists.txt
@@ -13,8 +13,8 @@
 # Import the KWIML directory tree into a subdirectory under a parent
 # project and configure the library as follows:
 #
-#  SET(KWIML myIML)
-#  SUBDIRS(KWIML)
+#  set(KWIML myIML)
+#  subdirs(KWIML)
 #
 # Optional settings are as follows:
 #
@@ -22,8 +22,8 @@
 #    Headers will go in a directory called "${KWIML}" under this root.
 #    For example:
 #
-#      SET(KWIML_HEADER_ROOT ${PROJECT_BINARY_DIR})
-#      INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR})
+#      set(KWIML_HEADER_ROOT ${PROJECT_BINARY_DIR})
+#      include_directories(${PROJECT_BINARY_DIR})
 #
 #  KWIML_INSTALL_INCLUDE_DIR = install KWIML with "make install"
 #    Specify a value relative to the install prefix and do NOT start with '/'.
diff --git a/Utilities/KWStyle/CMakeLists.txt b/Utilities/KWStyle/CMakeLists.txt
index fbaa67b37..b08dbde6f 100644
--- a/Utilities/KWStyle/CMakeLists.txt
+++ b/Utilities/KWStyle/CMakeLists.txt
@@ -16,63 +16,63 @@
 # Search for a built-from-source KWStyle under Dashboards/Support on a typical
 # dashboard machines:
 #
-SET(home "$ENV{HOME}")
-IF(NOT home)
-  STRING(REPLACE "\\" "/" home "$ENV{USERPROFILE}")
-ENDIF()
+set(home "$ENV{HOME}")
+if(NOT home)
+  string(REPLACE "\\" "/" home "$ENV{USERPROFILE}")
+endif()
 
-FIND_PROGRAM(KWSTYLE_EXECUTABLE
+find_program(KWSTYLE_EXECUTABLE
   NAMES KWStyle
   PATHS
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Kitware Inc.\\KWStyle 1.0.0]/bin"
   "${home}/Dashboards/Support/KWStyle/bin"
   )
-MARK_AS_ADVANCED(KWSTYLE_EXECUTABLE)
+mark_as_advanced(KWSTYLE_EXECUTABLE)
 
-SET(CMAKE_USE_KWSTYLE_DEFAULT OFF)
-IF(KWSTYLE_EXECUTABLE)
-  SET(CMAKE_USE_KWSTYLE_DEFAULT ON)
-ENDIF()
+set(CMAKE_USE_KWSTYLE_DEFAULT OFF)
+if(KWSTYLE_EXECUTABLE)
+  set(CMAKE_USE_KWSTYLE_DEFAULT ON)
+endif()
 
-OPTION(CMAKE_USE_KWSTYLE
+option(CMAKE_USE_KWSTYLE
   "Add StyleCheck target and KWStyle test: run KWStyle to check for coding standard violations."
   ${CMAKE_USE_KWSTYLE_DEFAULT})
-MARK_AS_ADVANCED(CMAKE_USE_KWSTYLE)
+mark_as_advanced(CMAKE_USE_KWSTYLE)
 
-IF(CMAKE_USE_KWSTYLE)
-  OPTION(KWSTYLE_USE_VIM_FORMAT "Set KWStyle to generate errors with a VIM-compatible format." OFF)
-  OPTION(KWSTYLE_USE_MSVC_FORMAT "Set KWStyle to generate errors with a VisualStudio-compatible format." OFF)
-  MARK_AS_ADVANCED(KWSTYLE_USE_VIM_FORMAT)
-  MARK_AS_ADVANCED(KWSTYLE_USE_MSVC_FORMAT)
+if(CMAKE_USE_KWSTYLE)
+  option(KWSTYLE_USE_VIM_FORMAT "Set KWStyle to generate errors with a VIM-compatible format." OFF)
+  option(KWSTYLE_USE_MSVC_FORMAT "Set KWStyle to generate errors with a VisualStudio-compatible format." OFF)
+  mark_as_advanced(KWSTYLE_USE_VIM_FORMAT)
+  mark_as_advanced(KWSTYLE_USE_MSVC_FORMAT)
 
-  IF(KWSTYLE_USE_VIM_FORMAT)
-    SET(KWSTYLE_ARGUMENTS -vim ${KWSTYLE_ARGUMENTS})
-  ENDIF(KWSTYLE_USE_VIM_FORMAT)
+  if(KWSTYLE_USE_VIM_FORMAT)
+    set(KWSTYLE_ARGUMENTS -vim ${KWSTYLE_ARGUMENTS})
+  endif(KWSTYLE_USE_VIM_FORMAT)
 
-  IF(KWSTYLE_USE_MSVC_FORMAT)
-    SET(KWSTYLE_ARGUMENTS -msvc ${KWSTYLE_ARGUMENTS})
-  ENDIF(KWSTYLE_USE_MSVC_FORMAT)
+  if(KWSTYLE_USE_MSVC_FORMAT)
+    set(KWSTYLE_ARGUMENTS -msvc ${KWSTYLE_ARGUMENTS})
+  endif(KWSTYLE_USE_MSVC_FORMAT)
 
-  CONFIGURE_FILE(${CMake_SOURCE_DIR}/Utilities/KWStyle/CMake.kws.xml.in
+  configure_file(${CMake_SOURCE_DIR}/Utilities/KWStyle/CMake.kws.xml.in
                ${CMake_BINARY_DIR}/CMake.kws.xml)
-  CONFIGURE_FILE(${CMake_SOURCE_DIR}/Utilities/KWStyle/CMakeMoreChecks.kws.xml.in
+  configure_file(${CMake_SOURCE_DIR}/Utilities/KWStyle/CMakeMoreChecks.kws.xml.in
                ${CMake_BINARY_DIR}/CMakeMoreChecks.kws.xml)
 
-  CONFIGURE_FILE(${CMake_SOURCE_DIR}/Utilities/KWStyle/CMakeFiles.txt.in
+  configure_file(${CMake_SOURCE_DIR}/Utilities/KWStyle/CMakeFiles.txt.in
                  ${CMake_BINARY_DIR}/CMakeKWSFiles.txt)
 
-  ADD_CUSTOM_COMMAND(
+  add_custom_command(
     OUTPUT ${CMake_BINARY_DIR}/KWStyleReport.txt
     COMMAND ${KWSTYLE_EXECUTABLE}
     ARGS    -xml ${CMake_BINARY_DIR}/CMake.kws.xml -o ${CMake_SOURCE_DIR}/Utilities/KWStyle/CMakeOverwrite.txt -v ${KWSTYLE_ARGUMENTS} -D ${CMake_BINARY_DIR}/CMakeKWSFiles.txt
     COMMENT "Coding Style Checker"
     )
 
-  ADD_CUSTOM_TARGET(MoreStyleChecks
+  add_custom_target(MoreStyleChecks
     COMMAND ${KWSTYLE_EXECUTABLE}
     -xml ${CMake_BINARY_DIR}/CMakeMoreChecks.kws.xml -html ${CMake_BINARY_DIR}/html -o ${CMake_SOURCE_DIR}/Utilities/KWStyle/CMakeOverwrite.txt -v ${KWSTYLE_ARGUMENTS} -D ${CMake_BINARY_DIR}/CMakeKWSFiles.txt
     COMMENT "Coding Style Checker, more checks enabled"
     )
 
-  ADD_CUSTOM_TARGET(StyleCheck DEPENDS ${CMake_BINARY_DIR}/KWStyleReport.txt)
-ENDIF(CMAKE_USE_KWSTYLE)
+  add_custom_target(StyleCheck DEPENDS ${CMake_BINARY_DIR}/KWStyleReport.txt)
+endif(CMAKE_USE_KWSTYLE)
diff --git a/Utilities/Release/Cygwin/CMakeLists.txt b/Utilities/Release/Cygwin/CMakeLists.txt
index 565c9a4d6..6a453615f 100644
--- a/Utilities/Release/Cygwin/CMakeLists.txt
+++ b/Utilities/Release/Cygwin/CMakeLists.txt
@@ -1,25 +1,25 @@
-FILE(GLOB INSTALLED_CURSES /usr/bin/cygncurses-*.dll)
-SET(MAX 0)
-FOREACH(f ${INSTALLED_CURSES})
-  IF(NOT "${f}" MATCHES "\\+")
-    STRING(REGEX REPLACE ".*-([0-9]*).dll" "\\1" NUMBER "${f}")
-    IF(NUMBER GREATER MAX)
-      SET(MAX ${NUMBER})
-    ENDIF(NUMBER GREATER MAX)
-  ENDIF(NOT "${f}" MATCHES "\\+")
-ENDFOREACH(f)
-STRING(REGEX REPLACE "/usr/bin/" "\\1" NUMBER "${f}")
-SET(CMAKE_NCURSES_VERSION "libncurses${MAX}")
-MESSAGE(STATUS "Using curses version: libncurses${MAX}")
-CONFIGURE_FILE("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/cygwin-setup.hint.in"
+file(GLOB INSTALLED_CURSES /usr/bin/cygncurses-*.dll)
+set(MAX 0)
+foreach(f ${INSTALLED_CURSES})
+  if(NOT "${f}" MATCHES "\\+")
+    string(REGEX REPLACE ".*-([0-9]*).dll" "\\1" NUMBER "${f}")
+    if(NUMBER GREATER MAX)
+      set(MAX ${NUMBER})
+    endif(NUMBER GREATER MAX)
+  endif(NOT "${f}" MATCHES "\\+")
+endforeach(f)
+string(REGEX REPLACE "/usr/bin/" "\\1" NUMBER "${f}")
+set(CMAKE_NCURSES_VERSION "libncurses${MAX}")
+message(STATUS "Using curses version: libncurses${MAX}")
+configure_file("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/cygwin-setup.hint.in"
   "${CMake_BINARY_DIR}/setup.hint")
-CONFIGURE_FILE("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/README.cygwin.in"
+configure_file("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/README.cygwin.in"
   "${CMake_BINARY_DIR}/Docs/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.README")
-INSTALL_FILES(/share/doc/Cygwin FILES
+install_files(/share/doc/Cygwin FILES
   ${CMake_BINARY_DIR}/Docs/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.README
   )
-CONFIGURE_FILE("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/cygwin-package.sh.in"
+configure_file("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/cygwin-package.sh.in"
   ${CPACK_CYGWIN_BUILD_SCRIPT})
-CONFIGURE_FILE("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/cygwin-patch.diff.in"
+configure_file("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/cygwin-patch.diff.in"
   ${CPACK_CYGWIN_PATCH_FILE})
 
diff --git a/Utilities/Release/release_cmake.cmake b/Utilities/Release/release_cmake.cmake
index b5b86aff0..04ec2e5e6 100644
--- a/Utilities/Release/release_cmake.cmake
+++ b/Utilities/Release/release_cmake.cmake
@@ -73,12 +73,12 @@ configure_file(${SCRIPT_PATH}/release_cmake.sh.in ${SCRIPT_FILE} @ONLY)
 
 # run the script by starting a shell on the remote machine
 # then using the script file as input to the shell
-IF(RUN_LOCAL)
+if(RUN_LOCAL)
   message(FATAL_ERROR "run this command: ${RUN_SHELL} ${SCRIPT_FILE}")
-ELSE(RUN_LOCAL)
+else(RUN_LOCAL)
   remote_command("run release_cmake-${HOST}.sh on server"
     "${RUN_SHELL}" ${SCRIPT_FILE})
-ENDIF(RUN_LOCAL)
+endif(RUN_LOCAL)
 
 # now figure out which types of packages were created
 set(generators ${CPACK_BINARY_GENERATORS} ${CPACK_SOURCE_GENERATORS})
diff --git a/bootstrap b/bootstrap
index 801882d7a..f7bc00436 100755
--- a/bootstrap
+++ b/bootstrap
@@ -19,7 +19,7 @@ die() {
 cmake_version_component()
 {
   cat "${cmake_source_dir}/Source/CMakeVersion.cmake" | sed -n "
-/^SET(CMake_VERSION_${1}/ {s/SET(CMake_VERSION_${1} *\([0-9]*\))/\1/;p;}
+/^set(CMake_VERSION_${1}/ {s/set(CMake_VERSION_${1} *\([0-9]*\))/\1/;p;}
 "
 }
 
@@ -1493,21 +1493,21 @@ rebuild_cache:
 echo '
 # Generated by '"${cmake_source_dir}"'/bootstrap
 # Default cmake settings.  These may be overridden any settings below.
-SET (CMAKE_INSTALL_PREFIX "'"${cmake_prefix_dir}"'" CACHE PATH "Install path prefix, prepended onto install directories." FORCE)
-SET (CMAKE_DOC_DIR "'"${cmake_doc_dir}"'" CACHE PATH "Install location for documentation (relative to prefix)." FORCE)
-SET (CMAKE_MAN_DIR "'"${cmake_man_dir}"'" CACHE PATH "Install location for man pages (relative to prefix)." FORCE)
-SET (CMAKE_DATA_DIR "'"${cmake_data_dir}"'" CACHE PATH "Install location for data (relative to prefix)." FORCE)
+set (CMAKE_INSTALL_PREFIX "'"${cmake_prefix_dir}"'" CACHE PATH "Install path prefix, prepended onto install directories." FORCE)
+set (CMAKE_DOC_DIR "'"${cmake_doc_dir}"'" CACHE PATH "Install location for documentation (relative to prefix)." FORCE)
+set (CMAKE_MAN_DIR "'"${cmake_man_dir}"'" CACHE PATH "Install location for man pages (relative to prefix)." FORCE)
+set (CMAKE_DATA_DIR "'"${cmake_data_dir}"'" CACHE PATH "Install location for data (relative to prefix)." FORCE)
 ' > "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
 
 # Add configuration settings given as command-line options.
 if [ "x${cmake_bootstrap_qt_gui}" != "x" ]; then
   echo '
-SET (BUILD_QtDialog '"${cmake_bootstrap_qt_gui}"' CACHE BOOL "Build Qt dialog for CMake" FORCE)
+set (BUILD_QtDialog '"${cmake_bootstrap_qt_gui}"' CACHE BOOL "Build Qt dialog for CMake" FORCE)
 ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
 fi
 if [ "x${cmake_bootstrap_qt_qmake}" != "x" ]; then
   echo '
-SET (QT_QMAKE_EXECUTABLE "'"${cmake_bootstrap_qt_qmake}"'" CACHE FILEPATH "Location of Qt qmake" FORCE)
+set (QT_QMAKE_EXECUTABLE "'"${cmake_bootstrap_qt_qmake}"'" CACHE FILEPATH "Location of Qt qmake" FORCE)
 ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
 fi
 
diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in
index 03137d5af..0005d9ef2 100644
--- a/cmake_uninstall.cmake.in
+++ b/cmake_uninstall.cmake.in
@@ -1,22 +1,22 @@
-IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
-  MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
-ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+  message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
+endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
 
-FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
-STRING(REGEX REPLACE "\n" ";" files "${files}")
-FOREACH(file ${files})
-  MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
-  IF(EXISTS "$ENV{DESTDIR}${file}")
-    EXEC_PROGRAM(
+file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
+string(REGEX REPLACE "\n" ";" files "${files}")
+foreach(file ${files})
+  message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
+  if(EXISTS "$ENV{DESTDIR}${file}")
+    exec_program(
       "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
       OUTPUT_VARIABLE rm_out
       RETURN_VALUE rm_retval
       )
-    IF("${rm_retval}" STREQUAL 0)
-    ELSE("${rm_retval}" STREQUAL 0)
-      MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
-    ENDIF("${rm_retval}" STREQUAL 0)
-  ELSE(EXISTS "$ENV{DESTDIR}${file}")
-    MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
-  ENDIF(EXISTS "$ENV{DESTDIR}${file}")
-ENDFOREACH(file)
+    if("${rm_retval}" STREQUAL 0)
+    else("${rm_retval}" STREQUAL 0)
+      message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
+    endif("${rm_retval}" STREQUAL 0)
+  else(EXISTS "$ENV{DESTDIR}${file}")
+    message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
+  endif(EXISTS "$ENV{DESTDIR}${file}")
+endforeach(file)

From 9db3116226cb99fcf54e936c833953abcde9b729 Mon Sep 17 00:00:00 2001
From: Kitware Robot <kwrobot@kitware.com>
Date: Mon, 13 Aug 2012 13:50:14 -0400
Subject: [PATCH 4/7] Remove CMake-language block-end command arguments

Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the
block.  This is no longer the preferred style.

Run the following shell code:

for c in else endif endforeach endfunction endmacro endwhile; do
    echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
egrep -z -v 'Tests/CMakeTests/While-Endwhile-' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
---
 CMakeCPack.cmake                              |  26 +-
 CMakeCPackOptions.cmake.in                    |  10 +-
 CMakeLists.txt                                |  94 +++----
 CTestCustom.cmake.in                          |   4 +-
 CompileFlags.cmake                            |  20 +-
 Modules/AddFileDependencies.cmake             |   6 +-
 Modules/BundleUtilities.cmake                 | 154 +++++------
 Modules/CMakeASMInformation.cmake             |  36 +--
 Modules/CMakeBackwardCompatibilityC.cmake     |  10 +-
 Modules/CMakeBackwardCompatibilityCXX.cmake   |  12 +-
 Modules/CMakeCCompiler.cmake.in               |   8 +-
 Modules/CMakeCInformation.cmake               |  44 ++--
 Modules/CMakeCXXCompiler.cmake.in             |   8 +-
 Modules/CMakeCXXInformation.cmake             |  76 +++---
 Modules/CMakeCommonLanguageInclude.cmake      |   4 +-
 Modules/CMakeDependentOption.cmake            |  20 +-
 Modules/CMakeDetermineASMCompiler.cmake       |  32 +--
 Modules/CMakeDetermineASM_MASMCompiler.cmake  |   4 +-
 Modules/CMakeDetermineASM_NASMCompiler.cmake  |   2 +-
 Modules/CMakeDetermineCCompiler.cmake         |  36 +--
 Modules/CMakeDetermineCXXCompiler.cmake       |  38 +--
 Modules/CMakeDetermineCompilerABI.cmake       |  18 +-
 Modules/CMakeDetermineCompilerId.cmake        |  72 +++---
 Modules/CMakeDetermineFortranCompiler.cmake   |  44 ++--
 Modules/CMakeDetermineJavaCompiler.cmake      |  28 +-
 Modules/CMakeDetermineRCCompiler.cmake        |  20 +-
 Modules/CMakeDetermineSystem.cmake            |  46 ++--
 Modules/CMakeExpandImportedTargets.cmake      |  26 +-
 Modules/CMakeExportBuildSettings.cmake        |   6 +-
 ...etermineCompilerMacrosAndIncludeDirs.cmake |   6 +-
 Modules/CMakeFindBinUtils.cmake               |   6 +-
 Modules/CMakeFindCodeBlocks.cmake             |   2 +-
 Modules/CMakeFindFrameworks.cmake             |  10 +-
 Modules/CMakeFindKDevelop3.cmake              |   2 +-
 Modules/CMakeFindPackageMode.cmake            |   2 +-
 Modules/CMakeForceCompiler.cmake              |  12 +-
 Modules/CMakeFortranCompiler.cmake.in         |  10 +-
 Modules/CMakeFortranInformation.cmake         |  38 +--
 Modules/CMakeGenericSystem.cmake              |  14 +-
 Modules/CMakeImportBuildSettings.cmake        |   6 +-
 Modules/CMakeJavaInformation.cmake            |  12 +-
 Modules/CMakeMinGWFindMake.cmake              |   2 +-
 Modules/CMakePackageConfigHelpers.cmake       |   2 +-
 Modules/CMakeParseArguments.cmake             |  14 +-
 Modules/CMakePushCheckState.cmake             |   4 +-
 Modules/CMakeRCInformation.cmake              |   2 +-
 Modules/CMakeSystemSpecificInformation.cmake  |   8 +-
 Modules/CMakeTestCCompiler.cmake              |  12 +-
 Modules/CMakeTestCXXCompiler.cmake            |  12 +-
 Modules/CMakeTestFortranCompiler.cmake        |  18 +-
 Modules/CMakeVS8FindMake.cmake                |   2 +-
 Modules/CMakeVS9FindMake.cmake                |   2 +-
 Modules/CMakeVerifyManifest.cmake             |   8 +-
 Modules/CPack.cmake                           |  76 +++---
 Modules/CPackComponent.cmake                  |  60 ++---
 Modules/CPackDeb.cmake                        |  64 ++---
 Modules/CPackRPM.cmake                        | 206 +++++++--------
 Modules/CPackZIP.cmake                        |  12 +-
 Modules/CTest.cmake                           |  58 ++---
 Modules/CTestTargets.cmake                    |  18 +-
 Modules/CheckCCompilerFlag.cmake              |   2 +-
 Modules/CheckCSourceCompiles.cmake            |  16 +-
 Modules/CheckCSourceRuns.cmake                |  22 +-
 Modules/CheckCXXCompilerFlag.cmake            |   2 +-
 Modules/CheckCXXSourceCompiles.cmake          |  16 +-
 Modules/CheckCXXSourceRuns.cmake              |  22 +-
 Modules/CheckCXXSymbolExists.cmake            |   2 +-
 Modules/CheckFortranFunctionExists.cmake      |  12 +-
 Modules/CheckFunctionExists.cmake             |  16 +-
 Modules/CheckIncludeFile.cmake                |  16 +-
 Modules/CheckIncludeFileCXX.cmake             |  16 +-
 Modules/CheckIncludeFiles.cmake               |  14 +-
 Modules/CheckLibraryExists.cmake              |  10 +-
 Modules/CheckPrototypeDefinition.cmake        |  18 +-
 Modules/CheckStructHasMember.cmake            |   4 +-
 Modules/CheckSymbolExists.cmake               |  20 +-
 Modules/CheckTypeSize.cmake                   |   4 +-
 Modules/CheckVariableExists.cmake             |  12 +-
 Modules/Compiler/GNU.cmake                    |   2 +-
 Modules/Compiler/Intel-ASM.cmake              |   4 +-
 Modules/Compiler/SunPro-ASM.cmake             |   2 +-
 Modules/Compiler/SunPro-C.cmake               |   2 +-
 Modules/Compiler/SunPro-CXX.cmake             |   2 +-
 Modules/Dart.cmake                            |  12 +-
 Modules/Documentation.cmake                   |   2 +-
 Modules/ExternalProject.cmake                 |  54 ++--
 Modules/FeatureSummary.cmake                  |  32 +--
 Modules/FindAVIFile.cmake                     |   2 +-
 Modules/FindArmadillo.cmake                   |   6 +-
 Modules/FindBISON.cmake                       |  10 +-
 Modules/FindBLAS.cmake                        | 146 +++++------
 Modules/FindBZip2.cmake                       |   6 +-
 Modules/FindBoost.cmake                       |  90 +++----
 Modules/FindCABLE.cmake                       |  14 +-
 Modules/FindCUDA.cmake                        |  66 ++---
 Modules/FindCUDA/make2cmake.cmake             |   2 +-
 Modules/FindCUDA/parse_cubin.cmake            |  14 +-
 Modules/FindCUDA/run_nvcc.cmake               |   4 +-
 Modules/FindCURL.cmake                        |   4 +-
 Modules/FindCVS.cmake                         |   2 +-
 Modules/FindCoin3D.cmake                      |  20 +-
 Modules/FindCups.cmake                        |  16 +-
 Modules/FindCurses.cmake                      |  24 +-
 Modules/FindCxxTest.cmake                     |   2 +-
 Modules/FindCygwin.cmake                      |   2 +-
 Modules/FindDoxygen.cmake                     |   4 +-
 Modules/FindEXPAT.cmake                       |  12 +-
 Modules/FindFLEX.cmake                        |   6 +-
 Modules/FindFLTK.cmake                        |  50 ++--
 Modules/FindFLTK2.cmake                       |  66 ++---
 Modules/FindFreetype.cmake                    |  12 +-
 Modules/FindGLU.cmake                         |   2 +-
 Modules/FindGLUT.cmake                        |  10 +-
 Modules/FindGTK.cmake                         |  10 +-
 Modules/FindGTK2.cmake                        |   4 +-
 Modules/FindGettext.cmake                     |  34 +--
 Modules/FindGit.cmake                         |   2 +-
 Modules/FindGnuTLS.cmake                      |   4 +-
 Modules/FindHTMLHelp.cmake                    |   2 +-
 Modules/FindImageMagick.cmake                 |  24 +-
 Modules/FindJNI.cmake                         |  48 ++--
 Modules/FindJPEG.cmake                        |   4 +-
 Modules/FindJasper.cmake                      |   6 +-
 Modules/FindJava.cmake                        |  10 +-
 Modules/FindKDE3.cmake                        |  64 ++---
 Modules/FindKDE4.cmake                        |  30 +--
 Modules/FindLAPACK.cmake                      | 114 ++++----
 Modules/FindLATEX.cmake                       |   6 +-
 Modules/FindLibLZMA.cmake                     |   6 +-
 Modules/FindLua50.cmake                       |  10 +-
 Modules/FindLua51.cmake                       |   6 +-
 Modules/FindMFC.cmake                         |  12 +-
 Modules/FindMPEG.cmake                        |   2 +-
 Modules/FindMPEG2.cmake                       |   4 +-
 Modules/FindMatlab.cmake                      |  24 +-
 Modules/FindMotif.cmake                       |   2 +-
 Modules/FindOpenGL.cmake                      |  38 +--
 Modules/FindOpenMP.cmake                      |  10 +-
 Modules/FindOpenSSL.cmake                     |  22 +-
 Modules/FindPHP4.cmake                        |   8 +-
 Modules/FindPNG.cmake                         |  14 +-
 Modules/FindPackageHandleStandardArgs.cmake   |  88 +++----
 Modules/FindPackageMessage.cmake              |  10 +-
 Modules/FindPerl.cmake                        |   4 +-
 Modules/FindPerlLibs.cmake                    |  28 +-
 Modules/FindPkgConfig.cmake                   |  92 +++----
 Modules/FindPostgreSQL.cmake                  |   8 +-
 Modules/FindProtobuf.cmake                    |   2 +-
 Modules/FindPythonInterp.cmake                |  12 +-
 Modules/FindPythonLibs.cmake                  |  50 ++--
 Modules/FindQt.cmake                          |  50 ++--
 Modules/FindQt3.cmake                         |  60 ++---
 Modules/FindQt4.cmake                         | 184 ++++++-------
 Modules/FindQuickTime.cmake                   |   4 +-
 Modules/FindRTI.cmake                         |  16 +-
 Modules/FindRuby.cmake                        |  38 +--
 Modules/FindSDL.cmake                         |  20 +-
 Modules/FindSDL_sound.cmake                   |  38 +--
 Modules/FindSWIG.cmake                        |  16 +-
 Modules/FindSelfPackers.cmake                 |   8 +-
 Modules/FindSquish.cmake                      |  28 +-
 Modules/FindSubversion.cmake                  |  14 +-
 Modules/FindTCL.cmake                         |  20 +-
 Modules/FindTIFF.cmake                        |   2 +-
 Modules/FindTclStub.cmake                     |   2 +-
 Modules/FindTclsh.cmake                       |   6 +-
 Modules/FindThreads.cmake                     |  16 +-
 Modules/FindVTK.cmake                         |  14 +-
 Modules/FindWish.cmake                        |   4 +-
 Modules/FindX11.cmake                         | 120 ++++-----
 Modules/FindXMLRPC.cmake                      |  44 ++--
 Modules/FindZLIB.cmake                        |   2 +-
 Modules/Findosg_functions.cmake               |   4 +-
 Modules/FindwxWidgets.cmake                   | 210 +++++++--------
 Modules/FindwxWindows.cmake                   | 100 +++----
 Modules/FortranCInterface.cmake               |   2 +-
 Modules/FortranCInterface/Detect.cmake        |   2 +-
 Modules/GetPrerequisites.cmake                | 194 +++++++-------
 Modules/InstallRequiredSystemLibraries.cmake  |  64 ++---
 Modules/KDE3Macros.cmake                      |  92 +++----
 Modules/MacroAddFileDependencies.cmake        |   6 +-
 Modules/Platform/AIX.cmake                    |   2 +-
 Modules/Platform/BlueGeneL.cmake              |   8 +-
 Modules/Platform/CYGWIN-GNU.cmake             |   2 +-
 Modules/Platform/Darwin-icc.cmake             |  16 +-
 Modules/Platform/Darwin.cmake                 |  36 +--
 Modules/Platform/FreeBSD.cmake                |   4 +-
 Modules/Platform/Generic-ADSP-Common.cmake    |  36 +--
 Modules/Platform/Generic-SDCC-C.cmake         |   4 +-
 Modules/Platform/HP-UX.cmake                  |   6 +-
 Modules/Platform/Haiku.cmake                  |   2 +-
 Modules/Platform/IRIX.cmake                   |   8 +-
 Modules/Platform/IRIX64.cmake                 |  16 +-
 Modules/Platform/Linux-Intel.cmake            |   2 +-
 Modules/Platform/Linux.cmake                  |  12 +-
 Modules/Platform/MP-RAS.cmake                 |   4 +-
 Modules/Platform/NetBSD.cmake                 |   2 +-
 Modules/Platform/OSF1.cmake                   |  18 +-
 Modules/Platform/QNX.cmake                    |   2 +-
 Modules/Platform/SunOS.cmake                  |  10 +-
 Modules/Platform/Windows-GNU.cmake            |   2 +-
 Modules/Platform/Windows-Intel.cmake          |  10 +-
 Modules/Platform/Windows-cl.cmake             |  56 ++--
 Modules/Platform/Windows-df.cmake             |  12 +-
 Modules/Platform/Windows-wcl386.cmake         |   4 +-
 Modules/Platform/Windows.cmake                |   4 +-
 Modules/Platform/cl.cmake                     |   6 +-
 Modules/Platform/eCos.cmake                   |   8 +-
 Modules/Platform/gas.cmake                    |   4 +-
 Modules/Platform/syllable.cmake               |   2 +-
 Modules/Qt4ConfigDependentSettings.cmake      | 106 ++++----
 Modules/Qt4Macros.cmake                       | 140 +++++-----
 Modules/SelectLibraryConfigurations.cmake     |  12 +-
 Modules/SquishTestScript.cmake                |   8 +-
 Modules/SystemInformation.cmake               |  16 +-
 Modules/TestBigEndian.cmake                   |  32 +--
 Modules/TestCXXAcceptsFlag.cmake              |   8 +-
 Modules/TestForANSIForScope.cmake             |   6 +-
 Modules/TestForANSIStreamHeaders.cmake        |   6 +-
 Modules/TestForSSTREAM.cmake                  |   6 +-
 Modules/TestForSTDNamespace.cmake             |   6 +-
 Modules/UseEcos.cmake                         |  36 +--
 Modules/UseJava.cmake                         | 118 ++++-----
 Modules/UseJavaClassFilelist.cmake            |  16 +-
 Modules/UseJavaSymlinks.cmake                 |   6 +-
 Modules/UsePkgConfig.cmake                    |  10 +-
 Modules/UseQt4.cmake                          |  32 +--
 Modules/UseSWIG.cmake                         |  64 ++---
 Modules/UseVTKConfig40.cmake                  |  70 ++---
 Modules/Use_wxWindows.cmake                   |  14 +-
 Modules/UsewxWidgets.cmake                    |  26 +-
 Modules/VTKCompatibility.cmake                |   4 +-
 Modules/WriteBasicConfigVersionFile.cmake     |   4 +-
 Modules/ecos_clean.cmake                      |   6 +-
 Source/CMakeLists.txt                         |  48 ++--
 Source/CursesDialog/form/CMakeLists.txt       |   2 +-
 Source/QtDialog/CMakeLists.txt                |  20 +-
 Source/QtDialog/QtDialogCPack.cmake.in        |   4 +-
 Tests/ArgumentExpansion/CMakeLists.txt        |  10 +-
 Tests/Assembler/CMakeLists.txt                |   8 +-
 Tests/BuildDepends/CMakeLists.txt             |  30 +--
 Tests/BuildDepends/Project/CMakeLists.txt     |   6 +-
 Tests/BundleTest/CMakeLists.txt               |  10 +-
 Tests/BundleUtilities/bundleutils.cmake       |   4 +-
 Tests/CMakeBuildTest.cmake.in                 |  14 +-
 Tests/CMakeLists.txt                          | 244 +++++++++---------
 Tests/CMakeOnly/AllFindModules/CMakeLists.txt |  14 +-
 .../CheckCXXSymbolExists/CMakeLists.txt       |  14 +-
 .../CheckSymbolExists/CMakeLists.txt          |  10 +-
 .../RunCMake.cmake                            |   2 +-
 Tests/CMakeTests/CMakeLists.txt               |   2 +-
 Tests/CMakeTests/FindBaseTest.cmake.in        |  16 +-
 .../GetFilenameComponentRealpathTest.cmake.in |   2 +-
 .../CMakeTests/GetPrerequisitesTest.cmake.in  |  10 +-
 Tests/CMakeTests/IncludeTest.cmake.in         |  10 +-
 Tests/CMakeTests/ListTest.cmake.in            |   6 +-
 Tests/CMakeTests/StringTestScript.cmake       |  12 +-
 Tests/CMakeTests/ToolchainTest.cmake.in       |  36 +--
 Tests/CMakeTests/VariableWatchTest.cmake.in   |   2 +-
 Tests/CMakeTests/WhileTest.cmake.in           |   2 +-
 Tests/COnly/CMakeLists.txt                    |   6 +-
 Tests/CPackComponents/VerifyResult.cmake      |  14 +-
 Tests/CPackComponentsForAll/CMakeLists.txt    |   2 +-
 .../MyLibCPackConfig-AllInOne.cmake.in        |   6 +-
 .../MyLibCPackConfig-IgnoreGroup.cmake.in     |   6 +-
 .../MyLibCPackConfig-OnePackPerGroup.cmake.in |   8 +-
 .../RunCPackVerifyResult.cmake                |  26 +-
 .../CTestTestScriptMode.cmake.in              |   2 +-
 Tests/CTestTestCostSerial/CMakeLists.txt      |   2 +-
 Tests/CTestTestCostSerial/test.cmake.in       |   2 +-
 Tests/CTestTestScheduler/CMakeLists.txt       |   2 +-
 Tests/CTestTestScheduler/test.cmake.in        |   2 +-
 Tests/CTestTestStopTime/GetDate.cmake         |  50 ++--
 Tests/CTestUpdateBZR.cmake.in                 |   2 +-
 Tests/CTestUpdateCVS.cmake.in                 |   2 +-
 Tests/CTestUpdateCommon.cmake                 |  44 ++--
 Tests/CTestUpdateGIT.cmake.in                 |   4 +-
 Tests/CTestUpdateHG.cmake.in                  |   2 +-
 Tests/CTestUpdateSVN.cmake.in                 |   2 +-
 Tests/CommandLineTest/CMakeLists.txt          |  24 +-
 Tests/Complex/CMakeLists.txt                  |  88 +++----
 Tests/Complex/Executable/CMakeLists.txt       |  28 +-
 Tests/Complex/Library/CMakeLists.txt          |  22 +-
 Tests/Complex/Library/test_preprocess.cmake   |   4 +-
 Tests/Complex/VarTests.cmake                  | 100 +++----
 Tests/ComplexOneConfig/CMakeLists.txt         |  88 +++----
 .../Executable/CMakeLists.txt                 |  28 +-
 Tests/ComplexOneConfig/Library/CMakeLists.txt |  22 +-
 .../Library/test_preprocess.cmake             |   4 +-
 Tests/ComplexOneConfig/VarTests.cmake         | 100 +++----
 Tests/CustomCommand/CMakeLists.txt            |   4 +-
 Tests/CustomCommand/check_mark.cmake          |   4 +-
 Tests/EnforceConfig.cmake.in                  |  14 +-
 Tests/ExportImport/CMakeLists.txt             |   8 +-
 Tests/ExportImport/Export/CMakeLists.txt      |   4 +-
 Tests/ExportImport/Import/A/CMakeLists.txt    |   2 +-
 Tests/ExternalOBJ/CMakeLists.txt              |  12 +-
 Tests/ExternalOBJ/Object/CMakeLists.txt       |   4 +-
 Tests/ExternalProject/TryCheckout.cmake       |   4 +-
 Tests/FindModulesExecuteAll/CMakeLists.txt    |   4 +-
 .../Baz 1.1/BazConfigVersion.cmake            |   4 +-
 .../Baz 1.2/CMake/BazConfigVersion.cmake      |   4 +-
 Tests/FindPackageTest/CMakeLists.txt          |  28 +-
 Tests/FindPackageTest/FindVersionTestA.cmake  |  12 +-
 Tests/FindPackageTest/FindVersionTestB.cmake  |  12 +-
 Tests/FindPackageTest/FindVersionTestC.cmake  |  12 +-
 Tests/FindPackageTest/FindVersionTestD.cmake  |  12 +-
 .../cmake/zot-4.0/zot-config-version.cmake    |   4 +-
 .../lib/arch/zot-3.1/zot-config-version.cmake |   4 +-
 .../cmake/zot-4.0/zot-config-version.cmake    |   4 +-
 .../suffix/test/SuffixTestConfigVersion.cmake |   4 +-
 .../lib/zot-2.0/zot-config-version.cmake      |   2 +-
 .../lib/zot-3.0/zot-config-version.cmake      |   2 +-
 .../lib/zot-3.1/zot-config-version.cmake      |   4 +-
 .../lib/zot/zot-config-version.cmake          |   4 +-
 Tests/Fortran/CMakeLists.txt                  |  12 +-
 Tests/Fortran/Library/CMakeLists.txt          |   2 +-
 Tests/FunctionTest/CMakeLists.txt             |  82 +++---
 Tests/FunctionTest/SubDirScope/CMakeLists.txt |   8 +-
 Tests/FunctionTest/Util.cmake                 |   2 +-
 Tests/JCTest/CMakeLists.txt                   |   2 +-
 Tests/Jump/Executable/CMakeLists.txt          |   2 +-
 Tests/Jump/Library/Shared/CMakeLists.txt      |   8 +-
 Tests/LibName/CMakeLists.txt                  |   2 +-
 .../LoadCommand/CMakeCommands/CMakeLists.txt  |   4 +-
 Tests/LoadCommand/CMakeLists.txt              |  12 +-
 .../CMakeCommands/CMakeLists.txt              |   6 +-
 Tests/LoadCommandOneConfig/CMakeLists.txt     |  12 +-
 Tests/MacroTest/CMakeLists.txt                |  34 +--
 Tests/MacroTest/context.cmake                 |   2 +-
 Tests/MakeClean/CMakeLists.txt                |  12 +-
 Tests/MathTest/CMakeLists.txt                 |   2 +-
 Tests/OutOfSource/CMakeLists.txt              |   2 +-
 .../OutOfSourceSubdir/CMakeLists.txt          |   8 +-
 Tests/PolicyScope/CMakeLists.txt              |   8 +-
 Tests/PrecompiledHeader/CMakeLists.txt        |  14 +-
 Tests/Preprocess/CMakeLists.txt               |  52 ++--
 Tests/Properties/CMakeLists.txt               |  16 +-
 Tests/ReturnTest/CMakeLists.txt               |  76 +++---
 .../check_utils.cmake                         |  20 +-
 Tests/RuntimePath/CMakeLists.txt              |   2 +-
 Tests/Simple/CMakeLists.txt                   |   2 +-
 Tests/SimpleCOnly/CMakeLists.txt              |   2 +-
 Tests/SimpleExclude/run.cmake.in              |   4 +-
 Tests/SimpleInstall/CMakeLists.txt            |  78 +++---
 Tests/SimpleInstall/InstallScript1.cmake      |   2 +-
 Tests/SimpleInstall/InstallScript2.cmake      |   8 +-
 Tests/SimpleInstall/InstallScript3.cmake      |   6 +-
 Tests/SimpleInstall/InstallScript4.cmake      |  12 +-
 Tests/SimpleInstall/PackageScript.cmake       |   2 +-
 Tests/SimpleInstall/PostInstall.cmake         |   4 +-
 Tests/SimpleInstallS2/CMakeLists.txt          |  78 +++---
 Tests/SimpleInstallS2/InstallScript1.cmake    |   2 +-
 Tests/SimpleInstallS2/InstallScript2.cmake    |   8 +-
 Tests/SimpleInstallS2/InstallScript3.cmake    |   6 +-
 Tests/SimpleInstallS2/InstallScript4.cmake    |  12 +-
 Tests/SimpleInstallS2/PackageScript.cmake     |   2 +-
 Tests/SimpleInstallS2/PostInstall.cmake       |   4 +-
 Tests/StringFileTest/CMakeLists.txt           |  70 ++---
 Tests/SubDir/CMakeLists.txt                   |  20 +-
 Tests/SubDirSpaces/CMakeLists.txt             |  28 +-
 Tests/SwigTest/CMakeLists.txt                 |  12 +-
 Tests/SystemInformation/CMakeLists.txt        |  12 +-
 Tests/TarTest/CMakeLists.txt                  |  18 +-
 Tests/TargetName/scripts/CMakeLists.txt       |   2 +-
 Tests/Testing/CMakeLists.txt                  |   4 +-
 Tests/TryCompile/CMakeLists.txt               |  70 ++---
 Tests/Tutorial/Step2/CMakeLists.txt           |   2 +-
 Tests/Tutorial/Step3/CMakeLists.txt           |   2 +-
 Tests/Tutorial/Step4/CMakeLists.txt           |   4 +-
 Tests/Tutorial/Step5/CMakeLists.txt           |   4 +-
 Tests/Tutorial/Step6/CMakeLists.txt           |   4 +-
 Tests/Tutorial/Step7/CMakeLists.txt           |   4 +-
 Tests/Unset/CMakeLists.txt                    |  20 +-
 Tests/VSExternalInclude/CMakeLists.txt        |   4 +-
 Tests/Wrapping/CMakeLists.txt                 |  10 +-
 Tests/X11/CMakeLists.txt                      |  10 +-
 Utilities/CMakeLists.txt                      |   6 +-
 Utilities/Doxygen/CMakeLists.txt              |   4 +-
 Utilities/KWStyle/CMakeLists.txt              |   6 +-
 Utilities/Release/Cygwin/CMakeLists.txt       |   6 +-
 Utilities/Release/create-cmake-release.cmake  |   2 +-
 Utilities/Release/release_cmake.cmake         |  64 ++---
 Utilities/Release/upload_release.cmake        |   2 +-
 cmake_uninstall.cmake.in                      |  12 +-
 385 files changed, 4107 insertions(+), 4107 deletions(-)

diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake
index 7a36d5d35..480fc6264 100644
--- a/CMakeCPack.cmake
+++ b/CMakeCPack.cmake
@@ -23,7 +23,7 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
     endif()
 
     include(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake)
-  endif(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
+  endif()
 
   set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool")
   set(CPACK_PACKAGE_VENDOR "Kitware")
@@ -56,17 +56,17 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
     # cygwin is good for the system name
     if("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
       set(CPACK_SYSTEM_NAME Cygwin)
-    else("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
+    else()
       set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
-    endif("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
-  endif(NOT DEFINED CPACK_SYSTEM_NAME)
+    endif()
+  endif()
   if(${CPACK_SYSTEM_NAME} MATCHES Windows)
     if(CMAKE_CL_64)
       set(CPACK_SYSTEM_NAME win64-x64)
-    else(CMAKE_CL_64)
+    else()
       set(CPACK_SYSTEM_NAME win32-x86)
-    endif(CMAKE_CL_64)
-  endif(${CPACK_SYSTEM_NAME} MATCHES Windows)
+    endif()
+  endif()
 
   if(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
     # if the CPACK_PACKAGE_FILE_NAME is not defined by the cache
@@ -74,11 +74,11 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
     # needed
     if(CYGWIN)
       set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
-    else(CYGWIN)
+    else()
       set(CPACK_PACKAGE_FILE_NAME
         "${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
-    endif(CYGWIN)
-  endif(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
+    endif()
+  endif()
 
   set(CPACK_PACKAGE_CONTACT "cmake@cmake.org")
 
@@ -86,7 +86,7 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
     set(CPACK_STRIP_FILES "bin/ccmake;bin/cmake;bin/cpack;bin/ctest")
     set(CPACK_SOURCE_STRIP_FILES "")
     set(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake")
-  endif(UNIX)
+  endif()
 
   # cygwin specific packaging stuff
   if(CYGWIN)
@@ -110,7 +110,7 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
     # configures some files and adds some install targets
     # this file uses some of the package file name variables
     include(Utilities/Release/Cygwin/CMakeLists.txt)
-  endif(CYGWIN)
+  endif()
 
   # Set the options file that needs to be included inside CMakeCPackOptions.cmake
   set(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake)
@@ -120,4 +120,4 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
 
   # include CPack model once all variables are set
   include(CPack)
-endif(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
+endif()
diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in
index 868331f14..3a72eaa5c 100644
--- a/CMakeCPackOptions.cmake.in
+++ b/CMakeCPackOptions.cmake.in
@@ -32,7 +32,7 @@ if(CPACK_GENERATOR MATCHES "NSIS")
   set(CPACK_NSIS_URL_INFO_ABOUT "http://www.kitware.com")
   set(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@)
   set(CPACK_NSIS_MODIFY_PATH ON)
-endif(CPACK_GENERATOR MATCHES "NSIS")
+endif()
 
 # include the cpack options for qt dialog if they exisit
 # they might not if qt was not enabled for the build
@@ -42,12 +42,12 @@ if(CPACK_GENERATOR MATCHES "CygwinSource")
   # when packaging source make sure the .build directory is not included
     set(CPACK_SOURCE_IGNORE_FILES
       "/CVS/" "/\\.build/" "/\\.svn/" "\\.swp$" "\\.#" "/#" "~$")
-endif(CPACK_GENERATOR MATCHES "CygwinSource")
+endif()
 
 if("${CPACK_GENERATOR}" STREQUAL "PackageMaker")
   if(CMAKE_PACKAGE_QTGUI)
     set(CPACK_PACKAGE_DEFAULT_LOCATION "/Applications")
-  else(CMAKE_PACKAGE_QTGUI)
+  else()
     set(CPACK_PACKAGE_DEFAULT_LOCATION "/usr")
-  endif(CMAKE_PACKAGE_QTGUI)
-endif("${CPACK_GENERATOR}" STREQUAL "PackageMaker")
+  endif()
+endif()
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0beed6267..f0789a30b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -67,7 +67,7 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
     else()
       set(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF)
     endif()
-  endforeach(util)
+  endforeach()
   if(CMAKE_BOOTSTRAP)
     unset(CMAKE_USE_SYSTEM_LIBRARIES CACHE)
   endif()
@@ -87,15 +87,15 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
   foreach(util ${UTILITIES})
     if(CMAKE_USE_SYSTEM_${util})
       message(STATUS "Using system-installed ${util}")
-    endif(CMAKE_USE_SYSTEM_${util})
-  endforeach(util)
+    endif()
+  endforeach()
 
   # Inform utility library header wrappers whether to use system versions.
   configure_file(${CMake_SOURCE_DIR}/Utilities/cmThirdParty.h.in
     ${CMake_BINARY_DIR}/Utilities/cmThirdParty.h
     @ONLY)
 
-endmacro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
+endmacro()
 
 
 
@@ -103,7 +103,7 @@ endmacro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
 set(CMAKE_BUILD_ON_VISUAL_STUDIO 0)
 if(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
   set(CMAKE_BUILD_ON_VISUAL_STUDIO 1)
-endif(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
+endif()
 
 
 #-----------------------------------------------------------------------
@@ -113,7 +113,7 @@ endif(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
 macro(CMAKE_SETUP_TESTING)
   if (NOT DART_ROOT)
     set(MAKEPROGRAM ${CMAKE_MAKE_PROGRAM})
-  endif (NOT DART_ROOT)
+  endif ()
 
   if(BUILD_TESTING)
     set(CMAKE_TEST_GENERATOR "" CACHE STRING
@@ -123,28 +123,28 @@ macro(CMAKE_SETUP_TESTING)
     if(NOT CMAKE_TEST_GENERATOR)
       set(CMAKE_TEST_GENERATOR "${CMAKE_GENERATOR}")
       set(CMAKE_TEST_MAKEPROGRAM "${MAKEPROGRAM}")
-    else(NOT CMAKE_TEST_GENERATOR)
+    else()
       set(CMAKE_TEST_DIFFERENT_GENERATOR TRUE)
-    endif(NOT CMAKE_TEST_GENERATOR)
+    endif()
 
     # Are we testing with the MSVC compiler?
     set(CMAKE_TEST_MSVC 0)
     if(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
       set(CMAKE_TEST_MSVC 1)
-    else(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
+    else()
       if("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
           "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio")
         set(CMAKE_TEST_MSVC 1)
       endif("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
         "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio")
-    endif(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
+    endif()
 
     set(CMAKE_TEST_SYSTEM_LIBRARIES 0)
     foreach(util CURL EXPAT XMLRPC ZLIB)
       if(CMAKE_USE_SYSTEM_${util})
         set(CMAKE_TEST_SYSTEM_LIBRARIES 1)
-      endif(CMAKE_USE_SYSTEM_${util})
-    endforeach(util)
+      endif()
+    endforeach()
 
     # This variable is set by cmake, however to
     # test cmake we want to make sure that
@@ -154,7 +154,7 @@ macro(CMAKE_SETUP_TESTING)
     set(CMAKE_CTEST_COMMAND "${CMake_BIN_DIR}/ctest")
     set(CMAKE_CMAKE_COMMAND "${CMake_BIN_DIR}/cmake")
     set(CMAKE_CPACK_COMMAND "${CMake_BIN_DIR}/cpack")
-  endif(BUILD_TESTING)
+  endif()
 
   # configure some files for testing
   configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Templates/CTestScript.cmake.in"
@@ -171,10 +171,10 @@ macro(CMAKE_SETUP_TESTING)
   if(BUILD_TESTING AND DART_ROOT)
     configure_file(${CMake_SOURCE_DIR}/CMakeLogo.gif
       ${CMake_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY)
-  endif(BUILD_TESTING AND DART_ROOT)
+  endif()
   mark_as_advanced(DART_ROOT)
   mark_as_advanced(CURL_TESTING)
-endmacro(CMAKE_SETUP_TESTING)
+endmacro()
 
 
 # Provide a way for Visual Studio Express users to turn OFF the new FOLDER
@@ -205,7 +205,7 @@ macro(CMAKE_SET_TARGET_FOLDER tgt folder)
   else()
     set_property(GLOBAL PROPERTY USE_FOLDERS OFF)
   endif()
-endmacro(CMAKE_SET_TARGET_FOLDER)
+endmacro()
 
 
 #-----------------------------------------------------------------------
@@ -266,15 +266,15 @@ macro (CMAKE_BUILD_UTILITIES)
     if(NOT ZLIB_FOUND)
       message(FATAL_ERROR
         "CMAKE_USE_SYSTEM_ZLIB is ON but a zlib is not found!")
-    endif(NOT ZLIB_FOUND)
+    endif()
     set(CMAKE_ZLIB_INCLUDES ${ZLIB_INCLUDE_DIR})
     set(CMAKE_ZLIB_LIBRARIES ${ZLIB_LIBRARIES})
-  else(CMAKE_USE_SYSTEM_ZLIB)
+  else()
     set(CMAKE_ZLIB_INCLUDES ${CMake_SOURCE_DIR}/Utilities)
     set(CMAKE_ZLIB_LIBRARIES cmzlib)
     add_subdirectory(Utilities/cmzlib)
     CMAKE_SET_TARGET_FOLDER(cmzlib "Utilities/3rdParty")
-  endif(CMAKE_USE_SYSTEM_ZLIB)
+  endif()
 
   #---------------------------------------------------------------------
   # Build Curl library for CTest.
@@ -283,26 +283,26 @@ macro (CMAKE_BUILD_UTILITIES)
     if(NOT CURL_FOUND)
       message(FATAL_ERROR
         "CMAKE_USE_SYSTEM_CURL is ON but a curl is not found!")
-    endif(NOT CURL_FOUND)
+    endif()
     set(CMAKE_CURL_INCLUDES ${CURL_INCLUDE_DIRS})
     set(CMAKE_CURL_LIBRARIES ${CURL_LIBRARIES})
-  else(CMAKE_USE_SYSTEM_CURL)
+  else()
     set(CURL_SPECIAL_ZLIB_H ${CMAKE_ZLIB_HEADER})
     set(CURL_SPECIAL_LIBZ_INCLUDES ${CMAKE_ZLIB_INCLUDES})
     set(CURL_SPECIAL_LIBZ ${CMAKE_ZLIB_LIBRARIES})
     option(CMAKE_BUILD_CURL_SHARED "Should curl be built shared" FALSE)
     if(NOT CMAKE_BUILD_CURL_SHARED)
       add_definitions(-DCURL_STATICLIB)
-    endif(NOT CMAKE_BUILD_CURL_SHARED)
+    endif()
     set(CMAKE_CURL_INCLUDES)
     set(CMAKE_CURL_LIBRARIES cmcurl)
     if(CMAKE_TESTS_CDASH_SERVER)
       set(CMAKE_CURL_TEST_URL "${CMAKE_TESTS_CDASH_SERVER}/user.php")
-    endif(CMAKE_TESTS_CDASH_SERVER)
+    endif()
     add_subdirectory(Utilities/cmcurl)
     CMAKE_SET_TARGET_FOLDER(cmcurl "Utilities/3rdParty")
     CMAKE_SET_TARGET_FOLDER(LIBCURL "Utilities/3rdParty")
-  endif(CMAKE_USE_SYSTEM_CURL)
+  endif()
 
   #---------------------------------------------------------------------
   # Build Compress library for CTest.
@@ -334,7 +334,7 @@ macro (CMAKE_BUILD_UTILITIES)
     endif()
     set(CMAKE_TAR_INCLUDES ${LibArchive_INCLUDE_DIRS})
     set(CMAKE_TAR_LIBRARIES ${LibArchive_LIBRARIES})
-  else(CMAKE_USE_SYSTEM_LIBARCHIVE)
+  else()
     set(ZLIB_INCLUDE_DIR ${CMAKE_ZLIB_INCLUDES})
     set(ZLIB_LIBRARY ${CMAKE_ZLIB_LIBRARIES})
     add_definitions(-DLIBARCHIVE_STATIC)
@@ -346,7 +346,7 @@ macro (CMAKE_BUILD_UTILITIES)
     add_subdirectory(Utilities/cmlibarchive)
     CMAKE_SET_TARGET_FOLDER(cmlibarchive "Utilities/3rdParty")
     set(CMAKE_TAR_LIBRARIES cmlibarchive ${BZIP2_LIBRARIES})
-  endif(CMAKE_USE_SYSTEM_LIBARCHIVE)
+  endif()
 
   #---------------------------------------------------------------------
   # Build expat library for CMake and CTest.
@@ -355,15 +355,15 @@ macro (CMAKE_BUILD_UTILITIES)
     if(NOT EXPAT_FOUND)
       message(FATAL_ERROR
         "CMAKE_USE_SYSTEM_EXPAT is ON but a expat is not found!")
-    endif(NOT EXPAT_FOUND)
+    endif()
     set(CMAKE_EXPAT_INCLUDES ${EXPAT_INCLUDE_DIRS})
     set(CMAKE_EXPAT_LIBRARIES ${EXPAT_LIBRARIES})
-  else(CMAKE_USE_SYSTEM_EXPAT)
+  else()
     set(CMAKE_EXPAT_INCLUDES)
     set(CMAKE_EXPAT_LIBRARIES cmexpat)
     add_subdirectory(Utilities/cmexpat)
     CMAKE_SET_TARGET_FOLDER(cmexpat "Utilities/3rdParty")
-  endif(CMAKE_USE_SYSTEM_EXPAT)
+  endif()
 
   #---------------------------------------------------------------------
   # Build XMLRPC library for CMake and CTest.
@@ -372,10 +372,10 @@ macro (CMAKE_BUILD_UTILITIES)
     if(NOT XMLRPC_FOUND)
       message(FATAL_ERROR
         "CTEST_USE_XMLRPC is ON but xmlrpc is not found!")
-    endif(NOT XMLRPC_FOUND)
+    endif()
     set(CMAKE_XMLRPC_INCLUDES ${XMLRPC_INCLUDE_DIRS})
     set(CMAKE_XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES})
-  endif(CTEST_USE_XMLRPC)
+  endif()
 
   #---------------------------------------------------------------------
   # Use curses?
@@ -386,20 +386,20 @@ macro (CMAKE_BUILD_UTILITIES)
       find_package(Curses QUIET)
       if (CURSES_LIBRARY)
         option(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" ON)
-      else (CURSES_LIBRARY)
+      else ()
         message("Curses libraries were not found. Curses GUI for CMake will not be built.")
         set(BUILD_CursesDialog 0)
-      endif (CURSES_LIBRARY)
-    else(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
+      endif ()
+    else()
       set(BUILD_CursesDialog 0)
-    endif(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
-  else (UNIX)
+    endif()
+  else ()
     set(BUILD_CursesDialog 0)
-  endif (UNIX)
+  endif ()
   if(BUILD_CursesDialog)
     add_subdirectory(Source/CursesDialog/form)
-  endif(BUILD_CursesDialog)
-endmacro (CMAKE_BUILD_UTILITIES)
+  endif()
+endmacro ()
 
 #-----------------------------------------------------------------------
 if(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
@@ -509,7 +509,7 @@ CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
 #
 if("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x")
   set(CMAKE_TESTS_CDASH_SERVER "http://www.cdash.org/CDash")
-endif("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x")
+endif()
 
 # build the utilities (a macro defined in this file)
 CMAKE_BUILD_UTILITIES()
@@ -524,8 +524,8 @@ if(BUILD_CursesDialog)
   set(CURSES_NEED_RPATH FALSE)
   if(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64")
     set(CURSES_NEED_RPATH TRUE)
-  endif(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64")
-endif(BUILD_CursesDialog)
+  endif()
+endif()
 
 if(BUILD_QtDialog)
   if(APPLE)
@@ -538,16 +538,16 @@ if(BUILD_QtDialog)
     string(SUBSTRING "${CMAKE_INSTALL_PREFIX}" ${LEN} 1 ENDCH)
     if(NOT "${ENDCH}" STREQUAL "/")
       set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
-    endif(NOT "${ENDCH}" STREQUAL "/")
+    endif()
     set(CMAKE_INSTALL_PREFIX
       "${CMAKE_INSTALL_PREFIX}${CMAKE_BUNDLE_NAME}.app/Contents")
-  endif(APPLE)
+  endif()
 
   set(QT_NEED_RPATH FALSE)
   if(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64")
     set(QT_NEED_RPATH TRUE)
-  endif(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64")
-endif(BUILD_QtDialog)
+  endif()
+endif()
 
 
 # The same might be true on other systems for other libraries.
@@ -563,7 +563,7 @@ if (UNIX)
     set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
   endif(CMAKE_USE_SYSTEM_CURL   OR  CMAKE_USE_SYSTEM_ZLIB
         OR  CMAKE_USE_SYSTEM_EXPAT  OR  CTEST_USE_XMLRPC  OR  CURSES_NEED_RPATH  OR  QT_NEED_RPATH)
-endif (UNIX)
+endif ()
 
 
 # add the uninstall support
diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in
index 52173f3e2..1e6224b4b 100644
--- a/CTestCustom.cmake.in
+++ b/CTestCustom.cmake.in
@@ -61,14 +61,14 @@ if(NOT "@CMAKE_GENERATOR@" MATCHES "Xcode")
     ${CTEST_CUSTOM_COVERAGE_EXCLUDE}
     "XCode"
     )
-endif (NOT "@CMAKE_GENERATOR@" MATCHES "Xcode")
+endif ()
 
 if(NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop")
   set(CTEST_CUSTOM_COVERAGE_EXCLUDE
     ${CTEST_CUSTOM_COVERAGE_EXCLUDE}
     "Kdevelop"
     )
-endif (NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop")
+endif ()
 
 set(CTEST_CUSTOM_COVERAGE_EXCLUDE
   ${CTEST_CUSTOM_COVERAGE_EXCLUDE}
diff --git a/CompileFlags.cmake b/CompileFlags.cmake
index f144337c3..b2044e441 100644
--- a/CompileFlags.cmake
+++ b/CompileFlags.cmake
@@ -15,10 +15,10 @@
 #
 if(CMAKE_GENERATOR MATCHES "Visual Studio 7")
   set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
-endif(CMAKE_GENERATOR MATCHES "Visual Studio 7")
+endif()
 if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
   set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
-endif(CMAKE_GENERATOR MATCHES "Visual Studio 6")
+endif()
 include (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake)
 
 if(WIN32 AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$")
@@ -38,27 +38,27 @@ endif()
 if(CMAKE_SYSTEM MATCHES "AIX.*")
   if(NOT CMAKE_COMPILER_IS_GNUCXX)
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bhalt:5 ")
-  endif(NOT CMAKE_COMPILER_IS_GNUCXX)
-endif(CMAKE_SYSTEM MATCHES "AIX.*")
+  endif()
+endif()
 
 if(CMAKE_SYSTEM MATCHES "IRIX.*")
   if(NOT CMAKE_COMPILER_IS_GNUCXX)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-woff84 -no_auto_include")
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-woff15")
-  endif(NOT CMAKE_COMPILER_IS_GNUCXX)
-endif(CMAKE_SYSTEM MATCHES "IRIX.*")
+  endif()
+endif()
 
 if(CMAKE_SYSTEM MATCHES "OSF1-V.*")
   if(NOT CMAKE_COMPILER_IS_GNUCXX)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ")
-  endif(NOT CMAKE_COMPILER_IS_GNUCXX)
-endif(CMAKE_SYSTEM MATCHES "OSF1-V.*")
+  endif()
+endif()
 
 # use the ansi CXX compile flag for building cmake
 if (CMAKE_ANSI_CXXFLAGS)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
-endif (CMAKE_ANSI_CXXFLAGS)
+endif ()
 
 if (CMAKE_ANSI_CFLAGS)
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
-endif (CMAKE_ANSI_CFLAGS)
+endif ()
diff --git a/Modules/AddFileDependencies.cmake b/Modules/AddFileDependencies.cmake
index af7f42f53..e88025c14 100644
--- a/Modules/AddFileDependencies.cmake
+++ b/Modules/AddFileDependencies.cmake
@@ -20,10 +20,10 @@ macro(ADD_FILE_DEPENDENCIES _file)
    get_source_file_property(_deps ${_file} OBJECT_DEPENDS)
    if (_deps)
       set(_deps ${_deps} ${ARGN})
-   else (_deps)
+   else ()
       set(_deps ${ARGN})
-   endif (_deps)
+   endif ()
 
    set_source_files_properties(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}")
 
-endmacro(ADD_FILE_DEPENDENCIES)
+endmacro()
diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake
index 0143d593d..4557be6e0 100644
--- a/Modules/BundleUtilities.cmake
+++ b/Modules/BundleUtilities.cmake
@@ -184,17 +184,17 @@ function(get_bundle_main_executable bundle result_var)
       if(line_is_main_executable)
         string(REGEX REPLACE "^.*<string>(.*)</string>.*$" "\\1" bundle_executable "${line}")
         break()
-      endif(line_is_main_executable)
+      endif()
 
       if(line MATCHES "^.*<key>CFBundleExecutable</key>.*$")
         set(line_is_main_executable 1)
-      endif(line MATCHES "^.*<key>CFBundleExecutable</key>.*$")
-    endforeach(line)
+      endif()
+    endforeach()
 
     if(NOT "${bundle_executable}" STREQUAL "")
       if(EXISTS "${bundle}/Contents/MacOS/${bundle_executable}")
         set(result "${bundle}/Contents/MacOS/${bundle_executable}")
-      else(EXISTS "${bundle}/Contents/MacOS/${bundle_executable}")
+      else()
 
         # Ultimate goal:
         # If not in "Contents/MacOS" then scan the bundle for matching files. If
@@ -207,9 +207,9 @@ function(get_bundle_main_executable bundle result_var)
         # for the bundle to be in Contents/MacOS, it's an error if it's not:
         #
         set(result "error: '${bundle}/Contents/MacOS/${bundle_executable}' does not exist")
-      endif(EXISTS "${bundle}/Contents/MacOS/${bundle_executable}")
-    endif(NOT "${bundle_executable}" STREQUAL "")
-  else(EXISTS "${bundle}/Contents/Info.plist")
+      endif()
+    endif()
+  else()
     #
     # More inclusive technique... (This one would work on Windows and Linux
     # too, if a developer followed the typical Mac bundle naming convention...)
@@ -217,10 +217,10 @@ function(get_bundle_main_executable bundle result_var)
     # If there is no Info.plist file, try to find an executable with the same
     # base name as the .app directory:
     #
-  endif(EXISTS "${bundle}/Contents/Info.plist")
+  endif()
 
   set(${result_var} "${result}" PARENT_SCOPE)
-endfunction(get_bundle_main_executable)
+endfunction()
 
 
 function(get_dotapp_dir exe dotapp_dir_var)
@@ -240,9 +240,9 @@ function(get_dotapp_dir exe dotapp_dir_var)
       if(sname MATCHES "\\.app$")
         set(done 1)
         set(dotapp_dir "${sdir}/${sname}")
-      endif(sname MATCHES "\\.app$")
-    endwhile(NOT ${done})
-  else(s MATCHES "^.*/.*\\.app/.*$")
+      endif()
+    endwhile()
+  else()
     # Otherwise use a directory containing the exe
     #   (typical of a non-bundle executable on Mac, Windows or Linux)
     #
@@ -250,14 +250,14 @@ function(get_dotapp_dir exe dotapp_dir_var)
     if(is_executable)
       get_filename_component(sdir "${s}" PATH)
       set(dotapp_dir "${sdir}")
-    else(is_executable)
+    else()
       set(dotapp_dir "${s}")
-    endif(is_executable)
-  endif(s MATCHES "^.*/.*\\.app/.*$")
+    endif()
+  endif()
 
 
   set(${dotapp_dir_var} "${dotapp_dir}" PARENT_SCOPE)
-endfunction(get_dotapp_dir)
+endfunction()
 
 
 function(get_bundle_and_executable app bundle_var executable_var valid_var)
@@ -273,13 +273,13 @@ function(get_bundle_and_executable app bundle_var executable_var valid_var)
           set(${executable_var} "${executable}" PARENT_SCOPE)
           set(valid 1)
           #message(STATUS "info: handled .app directory case...")
-        else(EXISTS "${app}" AND EXISTS "${executable}")
+        else()
           message(STATUS "warning: *NOT* handled - .app directory case...")
-        endif(EXISTS "${app}" AND EXISTS "${executable}")
-      else(app MATCHES "\\.app$")
+        endif()
+      else()
         message(STATUS "warning: *NOT* handled - directory but not .app case...")
-      endif(app MATCHES "\\.app$")
-    else(IS_DIRECTORY "${app}")
+      endif()
+    else()
       # Is it an executable file?
       is_file_executable("${app}" is_executable)
       if(is_executable)
@@ -296,21 +296,21 @@ function(get_bundle_and_executable app bundle_var executable_var valid_var)
           set(valid 1)
           #message(STATUS "info: handled executable file in any dir case...")
         endif()
-      else(is_executable)
+      else()
         message(STATUS "warning: *NOT* handled - not .app dir, not executable file...")
-      endif(is_executable)
-    endif(IS_DIRECTORY "${app}")
-  else(EXISTS "${app}")
+      endif()
+    endif()
+  else()
     message(STATUS "warning: *NOT* handled - directory/file does not exist...")
-  endif(EXISTS "${app}")
+  endif()
 
   if(NOT valid)
     set(${bundle_var} "error: not a bundle" PARENT_SCOPE)
     set(${executable_var} "error: not a bundle" PARENT_SCOPE)
-  endif(NOT valid)
+  endif()
 
   set(${valid_var} ${valid} PARENT_SCOPE)
-endfunction(get_bundle_and_executable)
+endfunction()
 
 
 function(get_bundle_all_executables bundle exes_var)
@@ -321,11 +321,11 @@ function(get_bundle_all_executables bundle exes_var)
     is_file_executable("${f}" is_executable)
     if(is_executable)
       set(exes ${exes} "${f}")
-    endif(is_executable)
-  endforeach(f)
+    endif()
+  endforeach()
 
   set(${exes_var} "${exes}" PARENT_SCOPE)
-endfunction(get_bundle_all_executables)
+endfunction()
 
 
 function(get_item_key item key_var)
@@ -335,7 +335,7 @@ function(get_item_key item key_var)
   endif()
   string(REGEX REPLACE "\\." "_" ${key_var} "${item_name}")
   set(${key_var} ${${key_var}} PARENT_SCOPE)
-endfunction(get_item_key)
+endfunction()
 
 
 function(clear_bundle_keys keys_var)
@@ -346,9 +346,9 @@ function(clear_bundle_keys keys_var)
     set(${key}_EMBEDDED_ITEM PARENT_SCOPE)
     set(${key}_RESOLVED_EMBEDDED_ITEM PARENT_SCOPE)
     set(${key}_COPYFLAG PARENT_SCOPE)
-  endforeach(key)
+  endforeach()
   set(${keys_var} PARENT_SCOPE)
-endfunction(clear_bundle_keys)
+endfunction()
 
 
 function(set_bundle_key_values keys_var context item exepath dirs copyflag)
@@ -370,12 +370,12 @@ function(set_bundle_key_values keys_var context item exepath dirs copyflag)
       # opening "${item_name}.framework/" to the closing "/${item_name}":
       #
       string(REGEX REPLACE "^.*(${item_name}.framework/.*/${item_name}).*$" "${default_embedded_path}/\\1" embedded_item "${item}")
-    else(item MATCHES "[^/]+\\.framework/")
+    else()
       # For other items, just use the same name as the original, but in the
       # embedded path:
       #
       set(embedded_item "${default_embedded_path}/${item_name}")
-    endif(item MATCHES "[^/]+\\.framework/")
+    endif()
 
     # Replace @executable_path and resolve ".." references:
     #
@@ -391,7 +391,7 @@ function(set_bundle_key_values keys_var context item exepath dirs copyflag)
     #
     if(NOT copyflag)
       set(resolved_embedded_item "${resolved_item}")
-    endif(NOT copyflag)
+    endif()
 
     set(${keys_var} ${${keys_var}} PARENT_SCOPE)
     set(${key}_ITEM "${item}" PARENT_SCOPE)
@@ -400,10 +400,10 @@ function(set_bundle_key_values keys_var context item exepath dirs copyflag)
     set(${key}_EMBEDDED_ITEM "${embedded_item}" PARENT_SCOPE)
     set(${key}_RESOLVED_EMBEDDED_ITEM "${resolved_embedded_item}" PARENT_SCOPE)
     set(${key}_COPYFLAG "${copyflag}" PARENT_SCOPE)
-  else(NOT length_before EQUAL length_after)
+  else()
     #message("warning: item key '${key}' already in the list, subsequent references assumed identical to first")
-  endif(NOT length_before EQUAL length_after)
-endfunction(set_bundle_key_values)
+  endif()
+endfunction()
 
 
 function(get_bundle_keys app libs dirs keys_var)
@@ -432,8 +432,8 @@ function(get_bundle_keys app libs dirs keys_var)
       get_prerequisites("${lib}" prereqs 1 1 "${exepath}" "${dirs}")
       foreach(pr ${prereqs})
         set_bundle_key_values(${keys_var} "${lib}" "${pr}" "${exepath}" "${dirs}" 1)
-      endforeach(pr)
-    endforeach(lib)
+      endforeach()
+    endforeach()
 
     # For each executable found in the bundle, accumulate keys as we go.
     # The list of keys should be complete when all prerequisites of all
@@ -450,8 +450,8 @@ function(get_bundle_keys app libs dirs keys_var)
       get_prerequisites("${exe}" prereqs 1 1 "${exepath}" "${dirs}")
       foreach(pr ${prereqs})
         set_bundle_key_values(${keys_var} "${exe}" "${pr}" "${exepath}" "${dirs}" 1)
-      endforeach(pr)
-    endforeach(exe)
+      endforeach()
+    endforeach()
 
     # Propagate values to caller's scope:
     #
@@ -463,9 +463,9 @@ function(get_bundle_keys app libs dirs keys_var)
       set(${key}_EMBEDDED_ITEM "${${key}_EMBEDDED_ITEM}" PARENT_SCOPE)
       set(${key}_RESOLVED_EMBEDDED_ITEM "${${key}_RESOLVED_EMBEDDED_ITEM}" PARENT_SCOPE)
       set(${key}_COPYFLAG "${${key}_COPYFLAG}" PARENT_SCOPE)
-    endforeach(key)
-  endif(valid)
-endfunction(get_bundle_keys)
+    endforeach()
+  endif()
+endfunction()
 
 
 function(copy_resolved_item_into_bundle resolved_item resolved_embedded_item)
@@ -485,10 +485,10 @@ function(copy_resolved_item_into_bundle resolved_item resolved_embedded_item)
     execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${resolved_item}" "${resolved_embedded_item}")
     if(UNIX AND NOT APPLE)
       file(RPATH_REMOVE FILE "${resolved_embedded_item}")
-    endif(UNIX AND NOT APPLE)
+    endif()
   endif()
 
-endfunction(copy_resolved_item_into_bundle)
+endfunction()
 
 
 function(copy_resolved_framework_into_bundle resolved_item resolved_embedded_item)
@@ -527,10 +527,10 @@ function(copy_resolved_framework_into_bundle resolved_item resolved_embedded_ite
     endif()
     if(UNIX AND NOT APPLE)
       file(RPATH_REMOVE FILE "${resolved_embedded_item}")
-    endif(UNIX AND NOT APPLE)
+    endif()
   endif()
 
-endfunction(copy_resolved_framework_into_bundle)
+endfunction()
 
 
 function(fixup_bundle_item resolved_embedded_item exepath dirs)
@@ -580,10 +580,10 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs)
 
     if(NOT "${${rkey}_EMBEDDED_ITEM}" STREQUAL "")
       set(changes ${changes} "-change" "${pr}" "${${rkey}_EMBEDDED_ITEM}")
-    else(NOT "${${rkey}_EMBEDDED_ITEM}" STREQUAL "")
+    else()
       message("warning: unexpected reference to '${pr}'")
-    endif(NOT "${${rkey}_EMBEDDED_ITEM}" STREQUAL "")
-  endforeach(pr)
+    endif()
+  endforeach()
 
   if(BU_CHMOD_BUNDLE_ITEMS)
     execute_process(COMMAND chmod u+w "${resolved_embedded_item}")
@@ -595,7 +595,7 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs)
   execute_process(COMMAND install_name_tool
     ${changes} -id "${${ikey}_EMBEDDED_ITEM}" "${resolved_embedded_item}"
   )
-endfunction(fixup_bundle_item)
+endfunction()
 
 
 function(fixup_bundle app libs dirs)
@@ -620,9 +620,9 @@ function(fixup_bundle app libs dirs)
       math(EXPR i ${i}+1)
       if(${${key}_COPYFLAG})
         message(STATUS "${i}/${n}: copying '${${key}_RESOLVED_ITEM}'")
-      else(${${key}_COPYFLAG})
+      else()
         message(STATUS "${i}/${n}: *NOT* copying '${${key}_RESOLVED_ITEM}'")
-      endif(${${key}_COPYFLAG})
+      endif()
 
       set(show_status 0)
       if(show_status)
@@ -634,7 +634,7 @@ function(fixup_bundle app libs dirs)
         message(STATUS "resolved_embedded_item='${${key}_RESOLVED_EMBEDDED_ITEM}'")
         message(STATUS "copyflag='${${key}_COPYFLAG}'")
         message(STATUS "")
-      endif(show_status)
+      endif()
 
       if(${${key}_COPYFLAG})
         set(item "${${key}_ITEM}")
@@ -645,8 +645,8 @@ function(fixup_bundle app libs dirs)
           copy_resolved_item_into_bundle("${${key}_RESOLVED_ITEM}"
             "${${key}_RESOLVED_EMBEDDED_ITEM}")
         endif()
-      endif(${${key}_COPYFLAG})
-    endforeach(key)
+      endif()
+    endforeach()
 
     message(STATUS "fixup_bundle: fixing...")
     foreach(key ${keys})
@@ -654,28 +654,28 @@ function(fixup_bundle app libs dirs)
       if(APPLE)
         message(STATUS "${i}/${n}: fixing up '${${key}_RESOLVED_EMBEDDED_ITEM}'")
         fixup_bundle_item("${${key}_RESOLVED_EMBEDDED_ITEM}" "${exepath}" "${dirs}")
-      else(APPLE)
+      else()
         message(STATUS "${i}/${n}: fix-up not required on this platform '${${key}_RESOLVED_EMBEDDED_ITEM}'")
-      endif(APPLE)
-    endforeach(key)
+      endif()
+    endforeach()
 
     message(STATUS "fixup_bundle: cleaning up...")
     clear_bundle_keys(keys)
 
     message(STATUS "fixup_bundle: verifying...")
     verify_app("${app}")
-  else(valid)
+  else()
     message(SEND_ERROR "error: fixup_bundle: not a valid bundle")
-  endif(valid)
+  endif()
 
   message(STATUS "fixup_bundle: done")
-endfunction(fixup_bundle)
+endfunction()
 
 
 function(copy_and_fixup_bundle src dst libs dirs)
   execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${src}" "${dst}")
   fixup_bundle("${dst}" "${libs}" "${dirs}")
-endfunction(copy_and_fixup_bundle)
+endfunction()
 
 
 function(verify_bundle_prerequisites bundle result_var info_var)
@@ -720,23 +720,23 @@ function(verify_bundle_prerequisites bundle result_var info_var)
             set(external_prereqs ${external_prereqs} "${p}")
           endif()
         endif()
-      endforeach(p)
+      endforeach()
 
       if(external_prereqs)
         # Found non-system/somehow-unacceptable prerequisites:
         set(result 0)
         set(info ${info} "external prerequisites found:\nf='${f}'\nexternal_prereqs='${external_prereqs}'\n")
-      endif(external_prereqs)
-    endif(is_executable)
-  endforeach(f)
+      endif()
+    endif()
+  endforeach()
 
   if(result)
     set(info "Verified ${count} executable files in '${bundle}'")
-  endif(result)
+  endif()
 
   set(${result_var} "${result}" PARENT_SCOPE)
   set(${info_var} "${info}" PARENT_SCOPE)
-endfunction(verify_bundle_prerequisites)
+endfunction()
 
 
 function(verify_bundle_symlinks bundle result_var info_var)
@@ -749,7 +749,7 @@ function(verify_bundle_symlinks bundle result_var info_var)
 
   set(${result_var} "${result}" PARENT_SCOPE)
   set(${info_var} "${info}" PARENT_SCOPE)
-endfunction(verify_bundle_symlinks)
+endfunction()
 
 
 function(verify_app app)
@@ -778,9 +778,9 @@ function(verify_app app)
     message(STATUS "verified='${verified}'")
     message(STATUS "info='${info}'")
     message(STATUS "")
-  endif(verified)
+  endif()
 
   if(NOT verified)
     message(FATAL_ERROR "error: verify_app failed")
-  endif(NOT verified)
-endfunction(verify_app)
+  endif()
+endfunction()
diff --git a/Modules/CMakeASMInformation.cmake b/Modules/CMakeASMInformation.cmake
index 69554e4cc..dce162496 100644
--- a/Modules/CMakeASMInformation.cmake
+++ b/Modules/CMakeASMInformation.cmake
@@ -14,9 +14,9 @@
 
 if(UNIX)
   set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .o)
-else(UNIX)
+else()
   set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .obj)
-endif(UNIX)
+endif()
 
 set(CMAKE_INCLUDE_FLAG_ASM${ASM_DIALECT} "-I")       # -I
 set(CMAKE_BASE_NAME)
@@ -24,36 +24,36 @@ get_filename_component(CMAKE_BASE_NAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAM
 
 if("${CMAKE_BASE_NAME}" STREQUAL "as")
   set(CMAKE_BASE_NAME gas)
-endif("${CMAKE_BASE_NAME}" STREQUAL "as")
+endif()
 
 # Load compiler-specific information.
 set(_INCLUDED_FILE "")
 if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
   include(Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL  RESULT_VARIABLE _INCLUDED_FILE)
-endif(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
+endif()
 if(NOT _INCLUDED_FILE)
   if("ASM${ASM_DIALECT}" STREQUAL "ASM")
     message(STATUS "Warning: Did not find file Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}")
-  endif("ASM${ASM_DIALECT}" STREQUAL "ASM")
+  endif()
   include(Platform/${CMAKE_BASE_NAME} OPTIONAL)
-endif(NOT _INCLUDED_FILE)
+endif()
 
 if(CMAKE_SYSTEM_PROCESSOR)
   include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL  RESULT_VARIABLE _INCLUDED_FILE)
   if(NOT _INCLUDED_FILE)
     include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
-  endif(NOT _INCLUDED_FILE)
-endif(CMAKE_SYSTEM_PROCESSOR)
+  endif()
+endif()
 
 include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL  RESULT_VARIABLE _INCLUDED_FILE)
 if(NOT _INCLUDED_FILE)
   include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
-endif(NOT _INCLUDED_FILE)
+endif()
 
 # Set default assembler file extensions:
 if(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS)
   set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;S;asm)
-endif(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS)
+endif()
 
 
 # Support for CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT and friends:
@@ -61,7 +61,7 @@ set(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT "$ENV{ASM${ASM_DIALECT}FLAGS} ${CMAKE_ASM
 # avoid just having a space as the initial value for the cache
 if(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ")
   set(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT)
-endif(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ")
+endif()
 set (CMAKE_ASM${ASM_DIALECT}_FLAGS "${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}" CACHE STRING
      "Flags used by the assembler during all build types.")
 
@@ -70,7 +70,7 @@ if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
   if(NOT CMAKE_NO_BUILD_TYPE)
     set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
       "Choose the type of build, options are: None, Debug Release RelWithDebInfo MinSizeRel.")
-  endif(NOT CMAKE_NO_BUILD_TYPE)
+  endif()
   set (CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG "${CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG_INIT}" CACHE STRING
     "Flags used by the assembler during debug builds.")
   set (CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL "${CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL_INIT}" CACHE STRING
@@ -79,7 +79,7 @@ if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
     "Flags used by the assembler during release builds.")
   set (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
     "Flags used by the assembler during Release with Debug Info builds.")
-endif(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+endif()
 
 mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_FLAGS
                  CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG
@@ -91,18 +91,18 @@ mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_FLAGS
 
 if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT)
   set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
-endif(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT)
+endif()
 
 if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY)
   set(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY
       "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> "
       "<CMAKE_RANLIB> <TARGET> ")
-endif(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY)
+endif()
 
 if(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE)
   set(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE
     "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> <CMAKE_ASM${ASM_DIALECT}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS>  -o <TARGET> <LINK_LIBRARIES>")
-endif(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE)
+endif()
 
 if(NOT CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG)
   set(CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_ASM${ASM_DIALECT}_FLAG})
@@ -119,11 +119,11 @@ endif()
 # to be done
 if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
   set(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
-endif(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
+endif()
 
 if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
   set(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
-endif(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
+endif()
 
 
 set(CMAKE_ASM${ASM_DIALECT}_INFOMATION_LOADED 1)
diff --git a/Modules/CMakeBackwardCompatibilityC.cmake b/Modules/CMakeBackwardCompatibilityC.cmake
index 90ad12e02..e3b6c823e 100644
--- a/Modules/CMakeBackwardCompatibilityC.cmake
+++ b/Modules/CMakeBackwardCompatibilityC.cmake
@@ -16,11 +16,11 @@
 if(CMAKE_GENERATOR MATCHES "Visual Studio 7")
   include(CMakeVS7BackwardCompatibility)
   set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
-endif(CMAKE_GENERATOR MATCHES "Visual Studio 7")
+endif()
 if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
   include(CMakeVS6BackwardCompatibility)
   set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
-endif(CMAKE_GENERATOR MATCHES "Visual Studio 6")
+endif()
 
 if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
   # Old CMake versions did not support OS X universal binaries anyway,
@@ -57,10 +57,10 @@ if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
 
   if("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
     set (CMAKE_X_CFLAGS "" CACHE STRING "X11 extra flags.")
-  else("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
+  else()
     set (CMAKE_X_CFLAGS "-I${X11_X11_INCLUDE_PATH}" CACHE STRING
          "X11 extra flags.")
-  endif("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
+  endif()
   set (CMAKE_X_LIBS "${X11_LIBRARIES}" CACHE STRING
        "Libraries and options used in X11 programs.")
   set (CMAKE_HAS_X "${X11_FOUND}" CACHE INTERNAL "Is X11 around.")
@@ -86,7 +86,7 @@ if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
     set(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
     set(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
   endif()
-endif(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
+endif()
 
 mark_as_advanced(
 CMAKE_HP_PTHREADS
diff --git a/Modules/CMakeBackwardCompatibilityCXX.cmake b/Modules/CMakeBackwardCompatibilityCXX.cmake
index 6888636b9..cfc1d91f9 100644
--- a/Modules/CMakeBackwardCompatibilityCXX.cmake
+++ b/Modules/CMakeBackwardCompatibilityCXX.cmake
@@ -26,10 +26,10 @@ if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
     set(CMAKE_TRY_ANSI_CXX_FLAGS "")
     if(CMAKE_SYSTEM MATCHES "IRIX.*")
       set(CMAKE_TRY_ANSI_CXX_FLAGS "-LANG:std")
-    endif(CMAKE_SYSTEM MATCHES "IRIX.*")
+    endif()
     if(CMAKE_SYSTEM MATCHES "OSF.*")
       set(CMAKE_TRY_ANSI_CXX_FLAGS "-std strict_ansi -nopure_cname")
-    endif(CMAKE_SYSTEM MATCHES "OSF.*")
+    endif()
     # if CMAKE_TRY_ANSI_CXX_FLAGS has something in it, see
     # if the compiler accepts it
     if( CMAKE_TRY_ANSI_CXX_FLAGS MATCHES ".+")
@@ -39,9 +39,9 @@ if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
       if(CMAKE_CXX_ACCEPTS_FLAGS)
         set(CMAKE_ANSI_CXXFLAGS ${CMAKE_TRY_ANSI_CXX_FLAGS} CACHE INTERNAL
         "What flags are required by the c++ compiler to make it ansi." )
-      endif(CMAKE_CXX_ACCEPTS_FLAGS)
-    endif( CMAKE_TRY_ANSI_CXX_FLAGS MATCHES ".+")
-  endif(NOT CMAKE_COMPILER_IS_GNUCXX)
+      endif()
+    endif()
+  endif()
   set(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS})
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
   include(TestForANSIStreamHeaders)
@@ -50,5 +50,5 @@ if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
   include(TestForANSIForScope)
   include(TestForSSTREAM)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_SAVE}")
-endif(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
+endif()
 
diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in
index 6166ec0c1..b4eabe599 100644
--- a/Modules/CMakeCCompiler.cmake.in
+++ b/Modules/CMakeCCompiler.cmake.in
@@ -14,13 +14,13 @@ set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
 if(CMAKE_COMPILER_IS_CYGWIN)
   set(CYGWIN 1)
   set(UNIX 1)
-endif(CMAKE_COMPILER_IS_CYGWIN)
+endif()
 
 set(CMAKE_C_COMPILER_ENV_VAR "CC")
 
 if(CMAKE_COMPILER_IS_MINGW)
   set(MINGW 1)
-endif(CMAKE_COMPILER_IS_MINGW)
+endif()
 set(CMAKE_C_COMPILER_ID_RUN 1)
 set(CMAKE_C_SOURCE_FILE_EXTENSIONS c)
 set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
@@ -33,11 +33,11 @@ set(CMAKE_C_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
 
 if(CMAKE_C_SIZEOF_DATA_PTR)
   set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
-endif(CMAKE_C_SIZEOF_DATA_PTR)
+endif()
 
 if(CMAKE_C_COMPILER_ABI)
   set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
-endif(CMAKE_C_COMPILER_ABI)
+endif()
 
 if(CMAKE_C_LIBRARY_ARCHITECTURE)
   set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
diff --git a/Modules/CMakeCInformation.cmake b/Modules/CMakeCInformation.cmake
index f0b7fe87b..ce5ce4409 100644
--- a/Modules/CMakeCInformation.cmake
+++ b/Modules/CMakeCInformation.cmake
@@ -22,51 +22,51 @@
 # so set the extension here first so it can be overridden by the compiler specific file
 if(UNIX)
   set(CMAKE_C_OUTPUT_EXTENSION .o)
-else(UNIX)
+else()
   set(CMAKE_C_OUTPUT_EXTENSION .obj)
-endif(UNIX)
+endif()
 
 set(_INCLUDED_FILE 0)
 
 # Load compiler-specific information.
 if(CMAKE_C_COMPILER_ID)
   include(Compiler/${CMAKE_C_COMPILER_ID}-C OPTIONAL)
-endif(CMAKE_C_COMPILER_ID)
+endif()
 
 set(CMAKE_BASE_NAME)
 get_filename_component(CMAKE_BASE_NAME ${CMAKE_C_COMPILER} NAME_WE)
 if(CMAKE_COMPILER_IS_GNUCC)
   set(CMAKE_BASE_NAME gcc)
-endif(CMAKE_COMPILER_IS_GNUCC)
+endif()
 
 
 # load a hardware specific file, mostly useful for embedded compilers
 if(CMAKE_SYSTEM_PROCESSOR)
   if(CMAKE_C_COMPILER_ID)
     include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
-  endif(CMAKE_C_COMPILER_ID)
+  endif()
   if (NOT _INCLUDED_FILE)
     include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
-  endif (NOT _INCLUDED_FILE)
-endif(CMAKE_SYSTEM_PROCESSOR)
+  endif ()
+endif()
 
 
 # load the system- and compiler specific files
 if(CMAKE_C_COMPILER_ID)
   include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C
     OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
-endif(CMAKE_C_COMPILER_ID)
+endif()
 if (NOT _INCLUDED_FILE)
   include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}
     OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
-endif (NOT _INCLUDED_FILE)
+endif ()
 # We specify the compiler information in the system file for some
 # platforms, but this language may not have been enabled when the file
 # was first included.  Include it again to get the language info.
 # Remove this when all compiler info is removed from system files.
 if (NOT _INCLUDED_FILE)
   include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
-endif (NOT _INCLUDED_FILE)
+endif ()
 
 if(CMAKE_C_SIZEOF_DATA_PTR)
   foreach(f ${CMAKE_C_ABI_FILES})
@@ -100,13 +100,13 @@ endif()
 if(NOT CMAKE_MODULE_EXISTS)
   set(CMAKE_SHARED_MODULE_C_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
   set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
-endif(NOT CMAKE_MODULE_EXISTS)
+endif()
 
 set(CMAKE_C_FLAGS_INIT "$ENV{CFLAGS} ${CMAKE_C_FLAGS_INIT}")
 # avoid just having a space as the initial value for the cache
 if(CMAKE_C_FLAGS_INIT STREQUAL " ")
   set(CMAKE_C_FLAGS_INIT)
-endif(CMAKE_C_FLAGS_INIT STREQUAL " ")
+endif()
 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT}" CACHE STRING
      "Flags used by the compiler during all build types.")
 
@@ -115,7 +115,7 @@ if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
   if(NOT CMAKE_NO_BUILD_TYPE)
     set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
       "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
-  endif(NOT CMAKE_NO_BUILD_TYPE)
+  endif()
   set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG_INIT}" CACHE STRING
     "Flags used by the compiler during debug builds.")
   set (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL_INIT}" CACHE STRING
@@ -124,13 +124,13 @@ if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
     "Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
   set (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
     "Flags used by the compiler during Release with Debug Info builds.")
-endif(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+endif()
 
 if(CMAKE_C_STANDARD_LIBRARIES_INIT)
   set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES_INIT}"
     CACHE STRING "Libraries linked by defalut with all C applications.")
   mark_as_advanced(CMAKE_C_STANDARD_LIBRARIES)
-endif(CMAKE_C_STANDARD_LIBRARIES_INIT)
+endif()
 
 include(CMakeCommonLanguageInclude)
 
@@ -165,12 +165,12 @@ include(CMakeCommonLanguageInclude)
 if(NOT CMAKE_C_CREATE_SHARED_LIBRARY)
   set(CMAKE_C_CREATE_SHARED_LIBRARY
       "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
-endif(NOT CMAKE_C_CREATE_SHARED_LIBRARY)
+endif()
 
 # create a C shared module just copy the shared library rule
 if(NOT CMAKE_C_CREATE_SHARED_MODULE)
   set(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY})
-endif(NOT CMAKE_C_CREATE_SHARED_MODULE)
+endif()
 
 # Create a static archive incrementally for large object file counts.
 # If CMAKE_C_CREATE_STATIC_LIBRARY is set it will override these.
@@ -188,24 +188,24 @@ endif()
 if(NOT CMAKE_C_COMPILE_OBJECT)
   set(CMAKE_C_COMPILE_OBJECT
     "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -o <OBJECT>   -c <SOURCE>")
-endif(NOT CMAKE_C_COMPILE_OBJECT)
+endif()
 
 if(NOT CMAKE_C_LINK_EXECUTABLE)
   set(CMAKE_C_LINK_EXECUTABLE
     "<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS>  -o <TARGET> <LINK_LIBRARIES>")
-endif(NOT CMAKE_C_LINK_EXECUTABLE)
+endif()
 
 if(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG)
   set(CMAKE_EXECUTABLE_RUNTIME_C_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
-endif(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG)
+endif()
 
 if(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP)
   set(CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
-endif(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP)
+endif()
 
 if(NOT CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG)
   set(CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
-endif(NOT CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG)
+endif()
 
 mark_as_advanced(
 CMAKE_C_FLAGS
diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in
index 3cef7f82d..b6477dfe4 100644
--- a/Modules/CMakeCXXCompiler.cmake.in
+++ b/Modules/CMakeCXXCompiler.cmake.in
@@ -14,13 +14,13 @@ set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
 if(CMAKE_COMPILER_IS_CYGWIN)
   set(CYGWIN 1)
   set(UNIX 1)
-endif(CMAKE_COMPILER_IS_CYGWIN)
+endif()
 
 set(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
 
 if(CMAKE_COMPILER_IS_MINGW)
   set(MINGW 1)
-endif(CMAKE_COMPILER_IS_MINGW)
+endif()
 set(CMAKE_CXX_COMPILER_ID_RUN 1)
 set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
 set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP)
@@ -34,11 +34,11 @@ set(CMAKE_CXX_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
 
 if(CMAKE_CXX_SIZEOF_DATA_PTR)
   set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
-endif(CMAKE_CXX_SIZEOF_DATA_PTR)
+endif()
 
 if(CMAKE_CXX_COMPILER_ABI)
   set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}")
-endif(CMAKE_CXX_COMPILER_ABI)
+endif()
 
 if(CMAKE_CXX_LIBRARY_ARCHITECTURE)
   set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake
index 961d9cddf..933c15a82 100644
--- a/Modules/CMakeCXXInformation.cmake
+++ b/Modules/CMakeCXXInformation.cmake
@@ -22,50 +22,50 @@
 # so set the extension here first so it can be overridden by the compiler specific file
 if(UNIX)
   set(CMAKE_CXX_OUTPUT_EXTENSION .o)
-else(UNIX)
+else()
   set(CMAKE_CXX_OUTPUT_EXTENSION .obj)
-endif(UNIX)
+endif()
 
 set(_INCLUDED_FILE 0)
 
 # Load compiler-specific information.
 if(CMAKE_CXX_COMPILER_ID)
   include(Compiler/${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL)
-endif(CMAKE_CXX_COMPILER_ID)
+endif()
 
 set(CMAKE_BASE_NAME)
 get_filename_component(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER} NAME_WE)
 # since the gnu compiler has several names force g++
 if(CMAKE_COMPILER_IS_GNUCXX)
   set(CMAKE_BASE_NAME g++)
-endif(CMAKE_COMPILER_IS_GNUCXX)
+endif()
 
 
 # load a hardware specific file, mostly useful for embedded compilers
 if(CMAKE_SYSTEM_PROCESSOR)
   if(CMAKE_CXX_COMPILER_ID)
     include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
-  endif(CMAKE_CXX_COMPILER_ID)
+  endif()
   if (NOT _INCLUDED_FILE)
     include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
-  endif (NOT _INCLUDED_FILE)
-endif(CMAKE_SYSTEM_PROCESSOR)
+  endif ()
+endif()
 
 # load the system- and compiler specific files
 if(CMAKE_CXX_COMPILER_ID)
   include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
-endif(CMAKE_CXX_COMPILER_ID)
+endif()
 if (NOT _INCLUDED_FILE)
   include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
           RESULT_VARIABLE _INCLUDED_FILE)
-endif (NOT _INCLUDED_FILE)
+endif ()
 # We specify the compiler information in the system file for some
 # platforms, but this language may not have been enabled when the file
 # was first included.  Include it again to get the language info.
 # Remove this when all compiler info is removed from system files.
 if (NOT _INCLUDED_FILE)
   include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
-endif (NOT _INCLUDED_FILE)
+endif ()
 
 if(CMAKE_CXX_SIZEOF_DATA_PTR)
   foreach(f ${CMAKE_CXX_ABI_FILES})
@@ -98,39 +98,39 @@ endif()
 # so if these are not set just copy the flags from the c version
 if(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS)
   set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
-endif(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS)
+endif()
 
 if(NOT CMAKE_CXX_COMPILE_OPTIONS_PIC)
   set(CMAKE_CXX_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC})
-endif(NOT CMAKE_CXX_COMPILE_OPTIONS_PIC)
+endif()
 
 if(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE)
   set(CMAKE_CXX_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
-endif(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE)
+endif()
 
 if(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL)
   set(CMAKE_CXX_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
-endif(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL)
+endif()
 
 if(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS)
   set(CMAKE_SHARED_LIBRARY_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
-endif(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS)
+endif()
 
 if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
   set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
-endif(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
+endif()
 
 if(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG)
   set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
-endif(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG)
+endif()
 
 if(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP)
   set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
-endif(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP)
+endif()
 
 if(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG)
   set(CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
-endif(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG)
+endif()
 
 if(NOT DEFINED CMAKE_EXE_EXPORTS_CXX_FLAG)
   set(CMAKE_EXE_EXPORTS_CXX_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG})
@@ -142,27 +142,27 @@ endif()
 
 if(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG)
   set(CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG})
-endif(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG)
+endif()
 
 if(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP)
   set(CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP})
-endif(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP)
+endif()
 
 if(NOT CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG)
   set(CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG})
-endif(NOT CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG)
+endif()
 
 if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH)
   set(CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH})
-endif(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH)
+endif()
 
 if(NOT CMAKE_INCLUDE_FLAG_CXX)
   set(CMAKE_INCLUDE_FLAG_CXX ${CMAKE_INCLUDE_FLAG_C})
-endif(NOT CMAKE_INCLUDE_FLAG_CXX)
+endif()
 
 if(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
   set(CMAKE_INCLUDE_FLAG_SEP_CXX ${CMAKE_INCLUDE_FLAG_SEP_C})
-endif(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
+endif()
 
 # for most systems a module is the same as a shared library
 # so unless the variable CMAKE_MODULE_EXISTS is set just
@@ -170,28 +170,28 @@ endif(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
 if(NOT CMAKE_MODULE_EXISTS)
   set(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
   set(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS})
-endif(NOT CMAKE_MODULE_EXISTS)
+endif()
 
 # repeat for modules
 if(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS)
   set(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
-endif(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS)
+endif()
 
 if(NOT CMAKE_SHARED_MODULE_CXX_FLAGS)
   set(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
-endif(NOT CMAKE_SHARED_MODULE_CXX_FLAGS)
+endif()
 
 # Initialize CXX link type selection flags from C versions.
 foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
   if(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS)
     set(CMAKE_${type}_LINK_STATIC_CXX_FLAGS
       ${CMAKE_${type}_LINK_STATIC_C_FLAGS})
-  endif(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS)
+  endif()
   if(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS)
     set(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS
       ${CMAKE_${type}_LINK_DYNAMIC_C_FLAGS})
-  endif(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS)
-endforeach(type)
+  endif()
+endforeach()
 
 # add the flags to the cache based
 # on the initial values computed in the platform/*.cmake files
@@ -201,7 +201,7 @@ set(CMAKE_CXX_FLAGS_INIT "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_INIT}")
 # avoid just having a space as the initial value for the cache
 if(CMAKE_CXX_FLAGS_INIT STREQUAL " ")
   set(CMAKE_CXX_FLAGS_INIT)
-endif(CMAKE_CXX_FLAGS_INIT STREQUAL " ")
+endif()
 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT}" CACHE STRING
      "Flags used by the compiler during all build types.")
 
@@ -215,13 +215,13 @@ if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
   set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
      "Flags used by the compiler during Release with Debug Info builds.")
 
-endif(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+endif()
 
 if(CMAKE_CXX_STANDARD_LIBRARIES_INIT)
   set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES_INIT}"
     CACHE STRING "Libraries linked by defalut with all C++ applications.")
   mark_as_advanced(CMAKE_CXX_STANDARD_LIBRARIES)
-endif(CMAKE_CXX_STANDARD_LIBRARIES_INIT)
+endif()
 
 include(CMakeCommonLanguageInclude)
 
@@ -255,12 +255,12 @@ include(CMakeCommonLanguageInclude)
 if(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY)
   set(CMAKE_CXX_CREATE_SHARED_LIBRARY
       "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
-endif(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY)
+endif()
 
 # create a c++ shared module copy the shared library rule by default
 if(NOT CMAKE_CXX_CREATE_SHARED_MODULE)
   set(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
-endif(NOT CMAKE_CXX_CREATE_SHARED_MODULE)
+endif()
 
 
 # Create a static archive incrementally for large object file counts.
@@ -279,12 +279,12 @@ endif()
 if(NOT CMAKE_CXX_COMPILE_OBJECT)
   set(CMAKE_CXX_COMPILE_OBJECT
     "<CMAKE_CXX_COMPILER>  <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
-endif(NOT CMAKE_CXX_COMPILE_OBJECT)
+endif()
 
 if(NOT CMAKE_CXX_LINK_EXECUTABLE)
   set(CMAKE_CXX_LINK_EXECUTABLE
     "<CMAKE_CXX_COMPILER>  <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS>  -o <TARGET> <LINK_LIBRARIES>")
-endif(NOT CMAKE_CXX_LINK_EXECUTABLE)
+endif()
 
 mark_as_advanced(
 CMAKE_BUILD_TOOL
diff --git a/Modules/CMakeCommonLanguageInclude.cmake b/Modules/CMakeCommonLanguageInclude.cmake
index 99b5f1177..bf94f9ff6 100644
--- a/Modules/CMakeCommonLanguageInclude.cmake
+++ b/Modules/CMakeCommonLanguageInclude.cmake
@@ -25,7 +25,7 @@ if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
   if(NOT CMAKE_NO_BUILD_TYPE)
     set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
       "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
-  endif(NOT CMAKE_NO_BUILD_TYPE)
+  endif()
 
   set (CMAKE_EXE_LINKER_FLAGS_DEBUG ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
      "Flags used by the linker during debug builds.")
@@ -68,7 +68,7 @@ if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
      ${CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
      "Flags used by the linker during Release with Debug Info builds.")
 
-endif(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+endif()
 # shared linker flags
 set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
      CACHE STRING "Flags used by the linker during the creation of dll's.")
diff --git a/Modules/CMakeDependentOption.cmake b/Modules/CMakeDependentOption.cmake
index 98cae45e5..990728f9f 100644
--- a/Modules/CMakeDependentOption.cmake
+++ b/Modules/CMakeDependentOption.cmake
@@ -31,21 +31,21 @@ macro(CMAKE_DEPENDENT_OPTION option doc default depends force)
     foreach(d ${depends})
       string(REGEX REPLACE " +" ";" CMAKE_DEPENDENT_OPTION_DEP "${d}")
       if(${CMAKE_DEPENDENT_OPTION_DEP})
-      else(${CMAKE_DEPENDENT_OPTION_DEP})
+      else()
         set(${option}_AVAILABLE 0)
-      endif(${CMAKE_DEPENDENT_OPTION_DEP})
-    endforeach(d)
+      endif()
+    endforeach()
     if(${option}_AVAILABLE)
       option(${option} "${doc}" "${default}")
       set(${option} "${${option}}" CACHE BOOL "${doc}" FORCE)
-    else(${option}_AVAILABLE)
+    else()
       if(${option} MATCHES "^${option}$")
-      else(${option} MATCHES "^${option}$")
+      else()
         set(${option} "${${option}}" CACHE INTERNAL "${doc}")
-      endif(${option} MATCHES "^${option}$")
+      endif()
       set(${option} ${force})
-    endif(${option}_AVAILABLE)
-  else(${option}_ISSET MATCHES "^${option}_ISSET$")
+    endif()
+  else()
     set(${option} "${${option}_ISSET}")
-  endif(${option}_ISSET MATCHES "^${option}_ISSET$")
-endmacro(CMAKE_DEPENDENT_OPTION)
+  endif()
+endmacro()
diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake
index ad6616cbc..4cf29dd34 100644
--- a/Modules/CMakeDetermineASMCompiler.cmake
+++ b/Modules/CMakeDetermineASMCompiler.cmake
@@ -20,7 +20,7 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
   # prefer the environment variable ASM
   if($ENV{ASM${ASM_DIALECT}} MATCHES ".+")
     set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT "$ENV{ASM${ASM_DIALECT}}")
-  endif($ENV{ASM${ASM_DIALECT}} MATCHES ".+")
+  endif()
 
   # finally list compilers to try
   if("ASM${ASM_DIALECT}" STREQUAL "ASM") # the generic assembler support
@@ -47,7 +47,7 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
   # Find the compiler.
   _cmake_find_compiler(ASM${ASM_DIALECT})
 
-else(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
+else()
 
   # we only get here if CMAKE_ASM${ASM_DIALECT}_COMPILER was specified using -D or a pre-made CMakeCache.txt
   # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
@@ -62,14 +62,14 @@ else(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
     mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH)
     if(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH)
       set(CMAKE_ASM${ASM_DIALECT}_COMPILER ${CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH} CACHE FILEPATH "Assembler" FORCE)
-    endif(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH)
-  endif(NOT _CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH)
-endif(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
+    endif()
+  endif()
+endif()
 mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_COMPILER)
 
 if (NOT _CMAKE_TOOLCHAIN_LOCATION)
   get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" PATH)
-endif (NOT _CMAKE_TOOLCHAIN_LOCATION)
+endif ()
 
 
 if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
@@ -110,9 +110,9 @@ endif()
 
 if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
   message(STATUS "The ASM${ASM_DIALECT} compiler identification is ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}")
-else(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
+else()
   message(STATUS "The ASM${ASM_DIALECT} compiler identification is unknown")
-endif(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
+endif()
 
 
 
@@ -127,22 +127,22 @@ if (NOT _CMAKE_TOOLCHAIN_PREFIX)
   get_filename_component(COMPILER_BASENAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME)
   if (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
     set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
-  endif (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
-endif (NOT _CMAKE_TOOLCHAIN_PREFIX)
+  endif ()
+endif ()
 
 # Now try the C compiler regexp:
 if (NOT _CMAKE_TOOLCHAIN_PREFIX)
   if (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
     set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
-  endif (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
-endif (NOT _CMAKE_TOOLCHAIN_PREFIX)
+  endif ()
+endif ()
 
 # Finally try the CXX compiler regexp:
 if (NOT _CMAKE_TOOLCHAIN_PREFIX)
   if (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
     set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
-  endif (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
-endif (NOT _CMAKE_TOOLCHAIN_PREFIX)
+  endif ()
+endif ()
 
 
 include(CMakeFindBinUtils)
@@ -151,9 +151,9 @@ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR "ASM${ASM_DIALECT}")
 
 if(CMAKE_ASM${ASM_DIALECT}_COMPILER)
   message(STATUS "Found assembler: ${CMAKE_ASM${ASM_DIALECT}_COMPILER}")
-else(CMAKE_ASM${ASM_DIALECT}_COMPILER)
+else()
   message(STATUS "Didn't find assembler")
-endif(CMAKE_ASM${ASM_DIALECT}_COMPILER)
+endif()
 
 
 set(_CMAKE_ASM_COMPILER "${CMAKE_ASM${ASM_DIALECT}_COMPILER}")
diff --git a/Modules/CMakeDetermineASM_MASMCompiler.cmake b/Modules/CMakeDetermineASM_MASMCompiler.cmake
index 364953791..665a65cc5 100644
--- a/Modules/CMakeDetermineASM_MASMCompiler.cmake
+++ b/Modules/CMakeDetermineASM_MASMCompiler.cmake
@@ -19,9 +19,9 @@ set(ASM_DIALECT "_MASM")
 # if we are using the 64bit cl compiler, assume we also want the 64bit assembler
 if(CMAKE_CL_64)
    set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml64)
-else(CMAKE_CL_64)
+else()
    set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml)
-endif(CMAKE_CL_64)
+endif()
 
 include(CMakeDetermineASMCompiler)
 set(ASM_DIALECT)
diff --git a/Modules/CMakeDetermineASM_NASMCompiler.cmake b/Modules/CMakeDetermineASM_NASMCompiler.cmake
index a9a9e052a..50f71dd8c 100644
--- a/Modules/CMakeDetermineASM_NASMCompiler.cmake
+++ b/Modules/CMakeDetermineASM_NASMCompiler.cmake
@@ -19,7 +19,7 @@ set(CMAKE_ASM_NASM_COMPILER_INIT nasm yasm)
 if(NOT CMAKE_ASM_NASM_COMPILER)
   find_program(CMAKE_ASM_NASM_COMPILER nasm
     "$ENV{ProgramFiles}/NASM")
-endif(NOT CMAKE_ASM_NASM_COMPILER)
+endif()
 
 # Load the generic DetermineASM compiler file with the DIALECT set properly:
 set(ASM_DIALECT "_NASM")
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 6bed02168..171eaddfe 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -47,18 +47,18 @@ if(NOT CMAKE_C_COMPILER)
     get_filename_component(CMAKE_C_COMPILER_INIT $ENV{CC} PROGRAM PROGRAM_ARGS CMAKE_C_FLAGS_ENV_INIT)
     if(CMAKE_C_FLAGS_ENV_INIT)
       set(CMAKE_C_COMPILER_ARG1 "${CMAKE_C_FLAGS_ENV_INIT}" CACHE STRING "First argument to C compiler")
-    endif(CMAKE_C_FLAGS_ENV_INIT)
+    endif()
     if(NOT EXISTS ${CMAKE_C_COMPILER_INIT})
       message(FATAL_ERROR "Could not find compiler set in environment variable CC:\n$ENV{CC}.")
-    endif(NOT EXISTS ${CMAKE_C_COMPILER_INIT})
-  endif($ENV{CC} MATCHES ".+")
+    endif()
+  endif()
 
   # next try prefer the compiler specified by the generator
   if(CMAKE_GENERATOR_CC)
     if(NOT CMAKE_C_COMPILER_INIT)
       set(CMAKE_C_COMPILER_INIT ${CMAKE_GENERATOR_CC})
-    endif(NOT CMAKE_C_COMPILER_INIT)
-  endif(CMAKE_GENERATOR_CC)
+    endif()
+  endif()
 
   # finally list compilers to try
   if(NOT CMAKE_C_COMPILER_INIT)
@@ -67,7 +67,7 @@ if(NOT CMAKE_C_COMPILER)
 
   _cmake_find_compiler(C)
 
-else(NOT CMAKE_C_COMPILER)
+else()
 
   # we only get here if CMAKE_C_COMPILER was specified using -D or a pre-made CMakeCache.txt
   # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
@@ -78,7 +78,7 @@ else(NOT CMAKE_C_COMPILER)
   if("${_CMAKE_C_COMPILER_LIST_LENGTH}" EQUAL 2)
     list(GET CMAKE_C_COMPILER 1 CMAKE_C_COMPILER_ARG1)
     list(GET CMAKE_C_COMPILER 0 CMAKE_C_COMPILER)
-  endif("${_CMAKE_C_COMPILER_LIST_LENGTH}" EQUAL 2)
+  endif()
 
   # if a compiler was specified by the user but without path,
   # now try to find it with the full path
@@ -91,21 +91,21 @@ else(NOT CMAKE_C_COMPILER)
     mark_as_advanced(CMAKE_C_COMPILER_WITH_PATH)
     if(CMAKE_C_COMPILER_WITH_PATH)
       set(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_WITH_PATH} CACHE STRING "C compiler" FORCE)
-    endif(CMAKE_C_COMPILER_WITH_PATH)
-  endif(NOT _CMAKE_USER_C_COMPILER_PATH)
-endif(NOT CMAKE_C_COMPILER)
+    endif()
+  endif()
+endif()
 mark_as_advanced(CMAKE_C_COMPILER)
 
 if (NOT _CMAKE_TOOLCHAIN_LOCATION)
   get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_C_COMPILER}" PATH)
-endif (NOT _CMAKE_TOOLCHAIN_LOCATION)
+endif ()
 
 # Build a small source file to identify the compiler.
 if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
   set(CMAKE_C_COMPILER_ID_RUN 1)
   set(CMAKE_C_PLATFORM_ID "Windows")
   set(CMAKE_C_COMPILER_ID "MSVC")
-endif(${CMAKE_GENERATOR} MATCHES "Visual Studio")
+endif()
 
 if(NOT CMAKE_C_COMPILER_ID_RUN)
   set(CMAKE_C_COMPILER_ID_RUN 1)
@@ -131,13 +131,13 @@ if(NOT CMAKE_C_COMPILER_ID_RUN)
   # Set old compiler and platform id variables.
   if("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
     set(CMAKE_COMPILER_IS_GNUCC 1)
-  endif("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
+  endif()
   if("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW")
     set(CMAKE_COMPILER_IS_MINGW 1)
   elseif("${CMAKE_C_PLATFORM_ID}" MATCHES "Cygwin")
     set(CMAKE_COMPILER_IS_CYGWIN 1)
-  endif("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW")
-endif(NOT CMAKE_C_COMPILER_ID_RUN)
+  endif()
+endif()
 
 # If we have a gcc cross compiler, they have usually some prefix, like
 # e.g. powerpc-linux-gcc, arm-elf-gcc or i586-mingw32msvc-gcc, optionally
@@ -152,13 +152,13 @@ if (CMAKE_CROSSCOMPILING
   get_filename_component(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME)
   if (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
     set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
-  endif (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
+  endif ()
 
   # if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils
   # but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.)
   if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
     set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
-  endif ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
+  endif ()
 
 endif (CMAKE_CROSSCOMPILING
     AND "${CMAKE_C_COMPILER_ID}" MATCHES "GNU"
@@ -169,7 +169,7 @@ include(CMakeFindBinUtils)
 if(MSVC_C_ARCHITECTURE_ID)
   set(SET_MSVC_C_ARCHITECTURE_ID
     "set(MSVC_C_ARCHITECTURE_ID ${MSVC_C_ARCHITECTURE_ID})")
-endif(MSVC_C_ARCHITECTURE_ID)
+endif()
 # configure variables set in this file for fast reload later on
 configure_file(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
   "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCCompiler.cmake"
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index aaabb201c..898947ad1 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -46,18 +46,18 @@ if(NOT CMAKE_CXX_COMPILER)
     get_filename_component(CMAKE_CXX_COMPILER_INIT $ENV{CXX} PROGRAM PROGRAM_ARGS CMAKE_CXX_FLAGS_ENV_INIT)
     if(CMAKE_CXX_FLAGS_ENV_INIT)
       set(CMAKE_CXX_COMPILER_ARG1 "${CMAKE_CXX_FLAGS_ENV_INIT}" CACHE STRING "First argument to CXX compiler")
-    endif(CMAKE_CXX_FLAGS_ENV_INIT)
+    endif()
     if(NOT EXISTS ${CMAKE_CXX_COMPILER_INIT})
       message(FATAL_ERROR "Could not find compiler set in environment variable CXX:\n$ENV{CXX}.\n${CMAKE_CXX_COMPILER_INIT}")
-    endif(NOT EXISTS ${CMAKE_CXX_COMPILER_INIT})
-  endif($ENV{CXX} MATCHES ".+")
+    endif()
+  endif()
 
   # next prefer the generator specified compiler
   if(CMAKE_GENERATOR_CXX)
     if(NOT CMAKE_CXX_COMPILER_INIT)
       set(CMAKE_CXX_COMPILER_INIT ${CMAKE_GENERATOR_CXX})
-    endif(NOT CMAKE_CXX_COMPILER_INIT)
-  endif(CMAKE_GENERATOR_CXX)
+    endif()
+  endif()
 
   # finally list compilers to try
   if(NOT CMAKE_CXX_COMPILER_INIT)
@@ -65,7 +65,7 @@ if(NOT CMAKE_CXX_COMPILER)
   endif()
 
   _cmake_find_compiler(CXX)
-else(NOT CMAKE_CXX_COMPILER)
+else()
 
 # we only get here if CMAKE_CXX_COMPILER was specified using -D or a pre-made CMakeCache.txt
 # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
@@ -77,7 +77,7 @@ else(NOT CMAKE_CXX_COMPILER)
   if("${_CMAKE_CXX_COMPILER_LIST_LENGTH}" EQUAL 2)
     list(GET CMAKE_CXX_COMPILER 1 CMAKE_CXX_COMPILER_ARG1)
     list(GET CMAKE_CXX_COMPILER 0 CMAKE_CXX_COMPILER)
-  endif("${_CMAKE_CXX_COMPILER_LIST_LENGTH}" EQUAL 2)
+  endif()
 
 # if a compiler was specified by the user but without path,
 # now try to find it with the full path
@@ -90,14 +90,14 @@ else(NOT CMAKE_CXX_COMPILER)
     mark_as_advanced(CMAKE_CXX_COMPILER_WITH_PATH)
     if(CMAKE_CXX_COMPILER_WITH_PATH)
       set(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER_WITH_PATH} CACHE STRING "CXX compiler" FORCE)
-    endif(CMAKE_CXX_COMPILER_WITH_PATH)
-  endif(NOT _CMAKE_USER_CXX_COMPILER_PATH)
-endif(NOT CMAKE_CXX_COMPILER)
+    endif()
+  endif()
+endif()
 mark_as_advanced(CMAKE_CXX_COMPILER)
 
 if (NOT _CMAKE_TOOLCHAIN_LOCATION)
   get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_CXX_COMPILER}" PATH)
-endif (NOT _CMAKE_TOOLCHAIN_LOCATION)
+endif ()
 
 # This block was used before the compiler was identified by building a
 # source file.  Unless g++ crashes when building a small C++
@@ -109,14 +109,14 @@ endif (NOT _CMAKE_TOOLCHAIN_LOCATION)
 # if(BEOS)
 #   set(CMAKE_COMPILER_IS_GNUCXX 1)
 #   set(CMAKE_COMPILER_IS_GNUCXX_RUN 1)
-# endif(BEOS)
+# endif()
 
 # Build a small source file to identify the compiler.
 if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
   set(CMAKE_CXX_COMPILER_ID_RUN 1)
   set(CMAKE_CXX_PLATFORM_ID "Windows")
   set(CMAKE_CXX_COMPILER_ID "MSVC")
-endif(${CMAKE_GENERATOR} MATCHES "Visual Studio")
+endif()
 if(NOT CMAKE_CXX_COMPILER_ID_RUN)
   set(CMAKE_CXX_COMPILER_ID_RUN 1)
 
@@ -138,13 +138,13 @@ if(NOT CMAKE_CXX_COMPILER_ID_RUN)
   # Set old compiler and platform id variables.
   if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
     set(CMAKE_COMPILER_IS_GNUCXX 1)
-  endif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
+  endif()
   if("${CMAKE_CXX_PLATFORM_ID}" MATCHES "MinGW")
     set(CMAKE_COMPILER_IS_MINGW 1)
   elseif("${CMAKE_CXX_PLATFORM_ID}" MATCHES "Cygwin")
     set(CMAKE_COMPILER_IS_CYGWIN 1)
-  endif("${CMAKE_CXX_PLATFORM_ID}" MATCHES "MinGW")
-endif(NOT CMAKE_CXX_COMPILER_ID_RUN)
+  endif()
+endif()
 
 # if we have a g++ cross compiler, they have usually some prefix, like
 # e.g. powerpc-linux-g++, arm-elf-g++ or i586-mingw32msvc-g++ , optionally
@@ -159,13 +159,13 @@ if (CMAKE_CROSSCOMPILING
   get_filename_component(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME)
   if (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
     set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
-  endif (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
+  endif ()
 
   # if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils
   # but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.)
   if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
     set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
-  endif ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
+  endif ()
 
 endif (CMAKE_CROSSCOMPILING
     AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU"
@@ -176,7 +176,7 @@ include(CMakeFindBinUtils)
 if(MSVC_CXX_ARCHITECTURE_ID)
   set(SET_MSVC_CXX_ARCHITECTURE_ID
     "set(MSVC_CXX_ARCHITECTURE_ID ${MSVC_CXX_ARCHITECTURE_ID})")
-endif(MSVC_CXX_ARCHITECTURE_ID)
+endif()
 # configure all variables set in this file
 configure_file(${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in
   ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake
index b79afdf54..ae2eb9b23 100644
--- a/Modules/CMakeDetermineCompilerABI.cmake
+++ b/Modules/CMakeDetermineCompilerABI.cmake
@@ -49,21 +49,21 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
       foreach(info ${ABI_STRINGS})
         if("${info}" MATCHES ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*")
           string(REGEX REPLACE ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*" "\\1" ABI_SIZEOF_DPTR "${info}")
-        endif("${info}" MATCHES ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*")
+        endif()
         if("${info}" MATCHES ".*INFO:abi\\[([^]]*)\\].*")
           string(REGEX REPLACE ".*INFO:abi\\[([^]]*)\\].*" "\\1" ABI_NAME "${info}")
-        endif("${info}" MATCHES ".*INFO:abi\\[([^]]*)\\].*")
-      endforeach(info)
+        endif()
+      endforeach()
 
       if(ABI_SIZEOF_DPTR)
         set(CMAKE_${lang}_SIZEOF_DATA_PTR "${ABI_SIZEOF_DPTR}" PARENT_SCOPE)
       elseif(CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT)
         set(CMAKE_${lang}_SIZEOF_DATA_PTR "${CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT}" PARENT_SCOPE)
-      endif(ABI_SIZEOF_DPTR)
+      endif()
 
       if(ABI_NAME)
         set(CMAKE_${lang}_COMPILER_ABI "${ABI_NAME}" PARENT_SCOPE)
-      endif(ABI_NAME)
+      endif()
 
       # Parse implicit linker information for this language, if available.
       set(implicit_dirs "")
@@ -122,10 +122,10 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
         endforeach()
       endif()
 
-    else(CMAKE_DETERMINE_${lang}_ABI_COMPILED)
+    else()
       message(STATUS "Detecting ${lang} compiler ABI info - failed")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Detecting ${lang} compiler ABI info failed to compile with the following output:\n${OUTPUT}\n\n")
-    endif(CMAKE_DETERMINE_${lang}_ABI_COMPILED)
-  endif(NOT DEFINED CMAKE_DETERMINE_${lang}_ABI_COMPILED)
-endfunction(CMAKE_DETERMINE_COMPILER_ABI)
+    endif()
+  endif()
+endfunction()
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 6fd0add59..f574978d7 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -24,9 +24,9 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
   # Make sure user-specified compiler flags are used.
   if(CMAKE_${lang}_FLAGS)
     set(CMAKE_${lang}_COMPILER_ID_FLAGS ${CMAKE_${lang}_FLAGS})
-  else(CMAKE_${lang}_FLAGS)
+  else()
     set(CMAKE_${lang}_COMPILER_ID_FLAGS $ENV{${flagvar}})
-  endif(CMAKE_${lang}_FLAGS)
+  endif()
   string(REGEX REPLACE " " ";" CMAKE_${lang}_COMPILER_ID_FLAGS_LIST "${CMAKE_${lang}_COMPILER_ID_FLAGS}")
 
   # Compute the directory in which to run the test.
@@ -39,9 +39,9 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
       CMAKE_DETERMINE_COMPILER_ID_BUILD("${lang}" "${flags}" "${src}")
       foreach(file ${COMPILER_${lang}_PRODUCED_FILES})
         CMAKE_DETERMINE_COMPILER_ID_CHECK("${lang}" "${CMAKE_${lang}_COMPILER_ID_DIR}/${file}" "${src}")
-      endforeach(file)
-    endif(NOT CMAKE_${lang}_COMPILER_ID)
-  endforeach(flags)
+      endforeach()
+    endif()
+  endforeach()
 
   # If the compiler is still unknown, try to query its vendor.
   if(NOT CMAKE_${lang}_COMPILER_ID)
@@ -51,7 +51,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
   # if the format is unknown after all files have been checked, put "Unknown" in the cache
   if(NOT CMAKE_EXECUTABLE_FORMAT)
     set(CMAKE_EXECUTABLE_FORMAT "Unknown" CACHE INTERNAL "Executable file format")
-  endif(NOT CMAKE_EXECUTABLE_FORMAT)
+  endif()
 
   # Display the final identification result.
   if(CMAKE_${lang}_COMPILER_ID)
@@ -62,16 +62,16 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
     endif()
     message(STATUS "The ${lang} compiler identification is "
       "${CMAKE_${lang}_COMPILER_ID}${_version}")
-  else(CMAKE_${lang}_COMPILER_ID)
+  else()
     message(STATUS "The ${lang} compiler identification is unknown")
-  endif(CMAKE_${lang}_COMPILER_ID)
+  endif()
 
   set(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE)
   set(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
   set(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
     PARENT_SCOPE)
   set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
-endfunction(CMAKE_DETERMINE_COMPILER_ID)
+endfunction()
 
 #-----------------------------------------------------------------------------
 # Function to write the compiler id source file.
@@ -79,7 +79,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_WRITE lang src)
   file(READ ${CMAKE_ROOT}/Modules/${src}.in ID_CONTENT_IN)
   string(CONFIGURE "${ID_CONTENT_IN}" ID_CONTENT_OUT @ONLY)
   file(WRITE ${CMAKE_${lang}_COMPILER_ID_DIR}/${src} "${ID_CONTENT_OUT}")
-endfunction(CMAKE_DETERMINE_COMPILER_ID_WRITE)
+endfunction()
 
 #-----------------------------------------------------------------------------
 # Function to build the compiler id source file and look for output
@@ -110,7 +110,7 @@ Id flags: ${testflags}
       ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
       RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT
       )
-  else(COMMAND EXECUTE_PROCESS)
+  else()
     exec_program(
       ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_COMPILER_ID_DIR}
       ARGS ${CMAKE_${lang}_COMPILER_ID_ARG1}
@@ -120,7 +120,7 @@ Id flags: ${testflags}
       OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
       RETURN_VALUE CMAKE_${lang}_COMPILER_ID_RESULT
       )
-  endif(COMMAND EXECUTE_PROCESS)
+  endif()
 
   # Check the result of compilation.
   if(CMAKE_${lang}_COMPILER_ID_RESULT)
@@ -136,11 +136,11 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT}
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "${MSG}")
     #if(NOT CMAKE_${lang}_COMPILER_ID_ALLOW_FAIL)
     #  message(FATAL_ERROR "${MSG}")
-    #endif(NOT CMAKE_${lang}_COMPILER_ID_ALLOW_FAIL)
+    #endif()
 
     # No output files should be inspected.
     set(COMPILER_${lang}_PRODUCED_FILES)
-  else(CMAKE_${lang}_COMPILER_ID_RESULT)
+  else()
     # Compilation succeeded.
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Compiling the ${lang} compiler identification source file \"${src}\" succeeded.
@@ -161,7 +161,7 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT}
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Compilation of the ${lang} compiler identification source \""
         "${src}\" produced \"${file}\"\n\n")
-    endforeach(file)
+    endforeach()
 
     if(NOT COMPILER_${lang}_PRODUCED_FILES)
       # No executable was found.
@@ -169,12 +169,12 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT}
         "Compilation of the ${lang} compiler identification source \""
         "${src}\" did not produce an executable in \""
         "${CMAKE_${lang}_COMPILER_ID_DIR}\".\n\n")
-    endif(NOT COMPILER_${lang}_PRODUCED_FILES)
-  endif(CMAKE_${lang}_COMPILER_ID_RESULT)
+    endif()
+  endif()
 
   # Return the files produced by the compilation.
   set(COMPILER_${lang}_PRODUCED_FILES "${COMPILER_${lang}_PRODUCED_FILES}" PARENT_SCOPE)
-endfunction(CMAKE_DETERMINE_COMPILER_ID_BUILD lang testflags src)
+endfunction()
 
 #-----------------------------------------------------------------------------
 # Function to extract the compiler id from an executable.
@@ -192,24 +192,24 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
       if("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*")
         if(COMPILER_ID)
           set(COMPILER_ID_TWICE 1)
-        endif(COMPILER_ID)
+        endif()
         string(REGEX REPLACE ".*INFO:compiler\\[([^]]*)\\].*" "\\1"
           COMPILER_ID "${info}")
-      endif("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*")
+      endif()
       if("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*")
         string(REGEX REPLACE ".*INFO:platform\\[([^]]*)\\].*" "\\1"
           PLATFORM_ID "${info}")
-      endif("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*")
+      endif()
       if("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*")
         string(REGEX REPLACE ".*INFO:arch\\[([^]]*)\\].*" "\\1"
           ARCHITECTURE_ID "${info}")
-      endif("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*")
+      endif()
       if("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*")
         string(REGEX REPLACE ".*INFO:compiler_version\\[([^]]*)\\].*" "\\1" COMPILER_VERSION "${info}")
         string(REGEX REPLACE "^0+([0-9])" "\\1" COMPILER_VERSION "${COMPILER_VERSION}")
         string(REGEX REPLACE "\\.0+([0-9])" ".\\1" COMPILER_VERSION "${COMPILER_VERSION}")
-      endif("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*")
-    endforeach(info)
+      endif()
+    endforeach()
 
     # Check if a valid compiler and platform were found.
     if(COMPILER_ID AND NOT COMPILER_ID_TWICE)
@@ -217,7 +217,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
       set(CMAKE_${lang}_PLATFORM_ID "${PLATFORM_ID}")
       set(MSVC_${lang}_ARCHITECTURE_ID "${ARCHITECTURE_ID}")
       set(CMAKE_${lang}_COMPILER_VERSION "${COMPILER_VERSION}")
-    endif(COMPILER_ID AND NOT COMPILER_ID_TWICE)
+    endif()
 
     # Check the compiler identification string.
     if(CMAKE_${lang}_COMPILER_ID)
@@ -225,13 +225,13 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "The ${lang} compiler identification is ${CMAKE_${lang}_COMPILER_ID}, found in \""
         "${file}\"\n\n")
-    else(CMAKE_${lang}_COMPILER_ID)
+    else()
       # The compiler identification could not be found.
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "The ${lang} compiler identification could not be found in \""
         "${file}\"\n\n")
-    endif(CMAKE_${lang}_COMPILER_ID)
-  endif(NOT CMAKE_${lang}_COMPILER_ID)
+    endif()
+  endif()
 
   # try to figure out the executable format: ELF, COFF, Mach-O
   if(NOT CMAKE_EXECUTABLE_FORMAT)
@@ -240,22 +240,22 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
     # ELF files start with 0x7f"ELF"
     if("${CMAKE_EXECUTABLE_MAGIC}" STREQUAL "7f454c46")
       set(CMAKE_EXECUTABLE_FORMAT "ELF" CACHE INTERNAL "Executable file format")
-    endif("${CMAKE_EXECUTABLE_MAGIC}" STREQUAL "7f454c46")
+    endif()
 
 #    # COFF (.exe) files start with "MZ"
 #    if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "4d5a....")
 #      set(CMAKE_EXECUTABLE_FORMAT "COFF" CACHE STRING "Executable file format")
-#    endif("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "4d5a....")
+#    endif()
 #
 #    # Mach-O files start with CAFEBABE or FEEDFACE, according to http://radio.weblogs.com/0100490/2003/01/28.html
 #    if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "cafebabe")
 #      set(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
-#    endif("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "cafebabe")
+#    endif()
 #    if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface")
 #      set(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
-#    endif("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface")
+#    endif()
 
-  endif(NOT CMAKE_EXECUTABLE_FORMAT)
+  endif()
   if(NOT DEFINED CMAKE_EXECUTABLE_FORMAT)
     set(CMAKE_EXECUTABLE_FORMAT)
   endif()
@@ -266,7 +266,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
     PARENT_SCOPE)
   set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
   set(CMAKE_EXECUTABLE_FORMAT "${CMAKE_EXECUTABLE_FORMAT}" PARENT_SCOPE)
-endfunction(CMAKE_DETERMINE_COMPILER_ID_CHECK lang)
+endfunction()
 
 #-----------------------------------------------------------------------------
 # Function to query the compiler vendor.
@@ -285,7 +285,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
     set(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CompilerId${lang})
     file(REMOVE_RECURSE ${CMAKE_${lang}_COMPILER_ID_DIR})
     file(MAKE_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR})
-  endif(NOT CMAKE_${lang}_COMPILER_ID_DIR)
+  endif()
 
 
   foreach(vendor ${CMAKE_${lang}_COMPILER_ID_VENDORS})
@@ -320,4 +320,4 @@ function(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
        endif()
     endif()
   endforeach()
-endfunction(CMAKE_DETERMINE_COMPILER_ID_VENDOR)
+endfunction()
diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake
index c8e561256..da77e21d6 100644
--- a/Modules/CMakeDetermineFortranCompiler.cmake
+++ b/Modules/CMakeDetermineFortranCompiler.cmake
@@ -31,19 +31,19 @@ if(NOT CMAKE_Fortran_COMPILER)
     get_filename_component(CMAKE_Fortran_COMPILER_INIT $ENV{FC} PROGRAM PROGRAM_ARGS CMAKE_Fortran_FLAGS_ENV_INIT)
     if(CMAKE_Fortran_FLAGS_ENV_INIT)
       set(CMAKE_Fortran_COMPILER_ARG1 "${CMAKE_Fortran_FLAGS_ENV_INIT}" CACHE STRING "First argument to Fortran compiler")
-    endif(CMAKE_Fortran_FLAGS_ENV_INIT)
+    endif()
     if(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
-    else(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
+    else()
       message(FATAL_ERROR "Could not find compiler set in environment variable FC:\n$ENV{FC}.")
-    endif(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
-  endif($ENV{FC} MATCHES ".+")
+    endif()
+  endif()
 
   # next try prefer the compiler specified by the generator
   if(CMAKE_GENERATOR_FC)
     if(NOT CMAKE_Fortran_COMPILER_INIT)
       set(CMAKE_Fortran_COMPILER_INIT ${CMAKE_GENERATOR_FC})
-    endif(NOT CMAKE_Fortran_COMPILER_INIT)
-  endif(CMAKE_GENERATOR_FC)
+    endif()
+  endif()
 
   # finally list compilers to try
   if(NOT CMAKE_Fortran_COMPILER_INIT)
@@ -85,7 +85,7 @@ if(NOT CMAKE_Fortran_COMPILER)
 
   _cmake_find_compiler(Fortran)
 
-else(NOT CMAKE_Fortran_COMPILER)
+else()
    # we only get here if CMAKE_Fortran_COMPILER was specified using -D or a pre-made CMakeCache.txt
   # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
   # if CMAKE_Fortran_COMPILER is a list of length 2, use the first item as
@@ -95,7 +95,7 @@ else(NOT CMAKE_Fortran_COMPILER)
   if("${_CMAKE_Fortran_COMPILER_LIST_LENGTH}" EQUAL 2)
     list(GET CMAKE_Fortran_COMPILER 1 CMAKE_Fortran_COMPILER_ARG1)
     list(GET CMAKE_Fortran_COMPILER 0 CMAKE_Fortran_COMPILER)
-  endif("${_CMAKE_Fortran_COMPILER_LIST_LENGTH}" EQUAL 2)
+  endif()
 
   # if a compiler was specified by the user but without path,
   # now try to find it with the full path
@@ -109,9 +109,9 @@ else(NOT CMAKE_Fortran_COMPILER)
     if(CMAKE_Fortran_COMPILER_WITH_PATH)
       set(CMAKE_Fortran_COMPILER ${CMAKE_Fortran_COMPILER_WITH_PATH}
         CACHE STRING "Fortran compiler" FORCE)
-    endif(CMAKE_Fortran_COMPILER_WITH_PATH)
-  endif(NOT _CMAKE_USER_Fortran_COMPILER_PATH)
-endif(NOT CMAKE_Fortran_COMPILER)
+    endif()
+  endif()
+endif()
 
 mark_as_advanced(CMAKE_Fortran_COMPILER)
 
@@ -120,7 +120,7 @@ if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
   set(CMAKE_Fortran_COMPILER_ID_RUN 1)
   set(CMAKE_Fortran_PLATFORM_ID "Windows")
   set(CMAKE_Fortran_COMPILER_ID "Intel")
-endif(${CMAKE_GENERATOR} MATCHES "Visual Studio")
+endif()
 
 if(NOT CMAKE_Fortran_COMPILER_ID_RUN)
   set(CMAKE_Fortran_COMPILER_ID_RUN 1)
@@ -160,32 +160,32 @@ if(NOT CMAKE_Fortran_COMPILER_ID_RUN)
         file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
           "Determining if the Fortran compiler is GNU succeeded with "
           "the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n")
-      else("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
+      else()
         file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
           "Determining if the Fortran compiler is GNU failed with "
           "the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n")
-      endif("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
+      endif()
       if(NOT CMAKE_Fortran_PLATFORM_ID)
         if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" )
           set(CMAKE_Fortran_PLATFORM_ID "MinGW")
-        endif("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" )
+        endif()
         if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" )
           set(CMAKE_Fortran_PLATFORM_ID "Cygwin")
-        endif("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" )
-      endif(NOT CMAKE_Fortran_PLATFORM_ID)
-    endif(NOT CMAKE_COMPILER_RETURN)
-  endif(NOT CMAKE_Fortran_COMPILER_ID)
+        endif()
+      endif()
+    endif()
+  endif()
 
   # Set old compiler and platform id variables.
   if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
     set(CMAKE_COMPILER_IS_GNUG77 1)
-  endif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
+  endif()
   if("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "MinGW")
     set(CMAKE_COMPILER_IS_MINGW 1)
   elseif("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "Cygwin")
     set(CMAKE_COMPILER_IS_CYGWIN 1)
-  endif("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "MinGW")
-endif(NOT CMAKE_Fortran_COMPILER_ID_RUN)
+  endif()
+endif()
 
 include(CMakeFindBinUtils)
 
diff --git a/Modules/CMakeDetermineJavaCompiler.cmake b/Modules/CMakeDetermineJavaCompiler.cmake
index f35b9ff5e..3f430b477 100644
--- a/Modules/CMakeDetermineJavaCompiler.cmake
+++ b/Modules/CMakeDetermineJavaCompiler.cmake
@@ -22,25 +22,25 @@ if(NOT CMAKE_Java_COMPILER)
     get_filename_component(CMAKE_Java_COMPILER_INIT $ENV{JAVA_COMPILER} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
     if(CMAKE_Java_FLAGS_ENV_INIT)
       set(CMAKE_Java_COMPILER_ARG1 "${CMAKE_Java_FLAGS_ENV_INIT}" CACHE STRING "First argument to Java compiler")
-    endif(CMAKE_Java_FLAGS_ENV_INIT)
+    endif()
     if(NOT EXISTS ${CMAKE_Java_COMPILER_INIT})
       message(SEND_ERROR "Could not find compiler set in environment variable JAVA_COMPILER:\n$ENV{JAVA_COMPILER}.")
-    endif(NOT EXISTS ${CMAKE_Java_COMPILER_INIT})
-  endif($ENV{JAVA_COMPILER} MATCHES ".+")
+    endif()
+  endif()
 
   if($ENV{JAVA_RUNTIME} MATCHES ".+")
     get_filename_component(CMAKE_Java_RUNTIME_INIT $ENV{JAVA_RUNTIME} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
     if(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT})
       message(SEND_ERROR "Could not find compiler set in environment variable JAVA_RUNTIME:\n$ENV{JAVA_RUNTIME}.")
-    endif(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT})
-  endif($ENV{JAVA_RUNTIME} MATCHES ".+")
+    endif()
+  endif()
 
   if($ENV{JAVA_ARCHIVE} MATCHES ".+")
     get_filename_component(CMAKE_Java_ARCHIVE_INIT $ENV{JAVA_ARCHIVE} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
     if(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT})
       message(SEND_ERROR "Could not find compiler set in environment variable JAVA_ARCHIVE:\n$ENV{JAVA_ARCHIVE}.")
-    endif(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT})
-  endif($ENV{JAVA_ARCHIVE} MATCHES ".+")
+    endif()
+  endif()
 
   set(Java_BIN_PATH
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\2.0;JavaHome]/bin"
@@ -67,33 +67,33 @@ if(NOT CMAKE_Java_COMPILER)
   # if no compiler has been specified yet, then look for one
   if(CMAKE_Java_COMPILER_INIT)
     set(CMAKE_Java_COMPILER ${CMAKE_Java_COMPILER_INIT} CACHE PATH "Java Compiler")
-  else(CMAKE_Java_COMPILER_INIT)
+  else()
     find_program(CMAKE_Java_COMPILER
       NAMES javac
       PATHS ${Java_BIN_PATH}
     )
-  endif(CMAKE_Java_COMPILER_INIT)
+  endif()
 
   # if no runtime has been specified yet, then look for one
   if(CMAKE_Java_RUNTIME_INIT)
     set(CMAKE_Java_RUNTIME ${CMAKE_Java_RUNTIME_INIT} CACHE PATH "Java Compiler")
-  else(CMAKE_Java_RUNTIME_INIT)
+  else()
     find_program(CMAKE_Java_RUNTIME
       NAMES java
       PATHS ${Java_BIN_PATH}
     )
-  endif(CMAKE_Java_RUNTIME_INIT)
+  endif()
 
   # if no archive has been specified yet, then look for one
   if(CMAKE_Java_ARCHIVE_INIT)
     set(CMAKE_Java_ARCHIVE ${CMAKE_Java_ARCHIVE_INIT} CACHE PATH "Java Compiler")
-  else(CMAKE_Java_ARCHIVE_INIT)
+  else()
     find_program(CMAKE_Java_ARCHIVE
       NAMES jar
       PATHS ${Java_BIN_PATH}
     )
-  endif(CMAKE_Java_ARCHIVE_INIT)
-endif(NOT CMAKE_Java_COMPILER)
+  endif()
+endif()
 mark_as_advanced(CMAKE_Java_COMPILER)
 
 # configure variables set in this file for fast reload later on
diff --git a/Modules/CMakeDetermineRCCompiler.cmake b/Modules/CMakeDetermineRCCompiler.cmake
index 41a7af5f4..669dd16b1 100644
--- a/Modules/CMakeDetermineRCCompiler.cmake
+++ b/Modules/CMakeDetermineRCCompiler.cmake
@@ -24,33 +24,33 @@ if(NOT CMAKE_RC_COMPILER)
     get_filename_component(CMAKE_RC_COMPILER_INIT $ENV{RC} PROGRAM PROGRAM_ARGS CMAKE_RC_FLAGS_ENV_INIT)
     if(CMAKE_RC_FLAGS_ENV_INIT)
       set(CMAKE_RC_COMPILER_ARG1 "${CMAKE_RC_FLAGS_ENV_INIT}" CACHE STRING "First argument to RC compiler")
-    endif(CMAKE_RC_FLAGS_ENV_INIT)
+    endif()
     if(EXISTS ${CMAKE_RC_COMPILER_INIT})
-    else(EXISTS ${CMAKE_RC_COMPILER_INIT})
+    else()
       message(FATAL_ERROR "Could not find compiler set in environment variable RC:\n$ENV{RC}.")
-    endif(EXISTS ${CMAKE_RC_COMPILER_INIT})
-  endif($ENV{RC} MATCHES ".+")
+    endif()
+  endif()
 
   # next try prefer the compiler specified by the generator
   if(CMAKE_GENERATOR_RC)
     if(NOT CMAKE_RC_COMPILER_INIT)
       set(CMAKE_RC_COMPILER_INIT ${CMAKE_GENERATOR_RC})
-    endif(NOT CMAKE_RC_COMPILER_INIT)
-  endif(CMAKE_GENERATOR_RC)
+    endif()
+  endif()
 
   # finally list compilers to try
   if(CMAKE_RC_COMPILER_INIT)
     set(CMAKE_RC_COMPILER_LIST ${CMAKE_RC_COMPILER_INIT})
-  else(CMAKE_RC_COMPILER_INIT)
+  else()
     set(CMAKE_RC_COMPILER_LIST rc)
-  endif(CMAKE_RC_COMPILER_INIT)
+  endif()
 
   # Find the compiler.
   find_program(CMAKE_RC_COMPILER NAMES ${CMAKE_RC_COMPILER_LIST} DOC "RC compiler")
   if(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER)
     set(CMAKE_RC_COMPILER "${CMAKE_RC_COMPILER_INIT}" CACHE FILEPATH "RC compiler" FORCE)
-  endif(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER)
-endif(NOT CMAKE_RC_COMPILER)
+  endif()
+endif()
 
 mark_as_advanced(CMAKE_RC_COMPILER)
 
diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake
index a72bd5f96..22c501614 100644
--- a/Modules/CMakeDetermineSystem.cmake
+++ b/Modules/CMakeDetermineSystem.cmake
@@ -59,23 +59,23 @@ if(CMAKE_HOST_UNIX)
       if("${val}" GREATER 0)
         exec_program(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
           RETURN_VALUE val)
-      endif("${val}" GREATER 0)
+      endif()
     endif()
     # check the return of the last uname -m or -p
     if("${val}" GREATER 0)
         set(CMAKE_HOST_SYSTEM_PROCESSOR "unknown")
-    endif("${val}" GREATER 0)
+    endif()
     set(CMAKE_UNAME ${CMAKE_UNAME} CACHE INTERNAL "uname command")
     # processor may have double quote in the name, and that needs to be removed
     string(REGEX REPLACE "\"" "" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
     string(REGEX REPLACE "/" "_" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
-  endif(CMAKE_UNAME)
-else(CMAKE_HOST_UNIX)
+  endif()
+else()
   if(CMAKE_HOST_WIN32)
     set (CMAKE_HOST_SYSTEM_NAME "Windows")
     set (CMAKE_HOST_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITECTURE}")
-  endif(CMAKE_HOST_WIN32)
-endif(CMAKE_HOST_UNIX)
+  endif()
+endif()
 
 # if a toolchain file is used, the user wants to cross compile.
 # in this case read the toolchain file and keep the CMAKE_HOST_SYSTEM_*
@@ -87,15 +87,15 @@ if(CMAKE_TOOLCHAIN_FILE)
   if(NOT _INCLUDED_TOOLCHAIN_FILE)
      # if the file isn't found there, check the default locations
      include("${CMAKE_TOOLCHAIN_FILE}" OPTIONAL RESULT_VARIABLE _INCLUDED_TOOLCHAIN_FILE)
-  endif(NOT _INCLUDED_TOOLCHAIN_FILE)
+  endif()
 
   if(_INCLUDED_TOOLCHAIN_FILE)
     set(CMAKE_TOOLCHAIN_FILE "${_INCLUDED_TOOLCHAIN_FILE}" CACHE FILEPATH "The CMake toolchain file" FORCE)
-  else(_INCLUDED_TOOLCHAIN_FILE)
+  else()
     message(FATAL_ERROR "Could not find toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
     set(CMAKE_TOOLCHAIN_FILE "NOTFOUND" CACHE FILEPATH "The CMake toolchain file" FORCE)
-  endif(_INCLUDED_TOOLCHAIN_FILE)
-endif(CMAKE_TOOLCHAIN_FILE)
+  endif()
+endif()
 
 
 # if CMAKE_SYSTEM_NAME is here already set, either it comes from a toolchain file
@@ -104,45 +104,45 @@ endif(CMAKE_TOOLCHAIN_FILE)
 if(CMAKE_SYSTEM_NAME)
   if(NOT DEFINED CMAKE_CROSSCOMPILING)
     set(CMAKE_CROSSCOMPILING TRUE)
-  endif(NOT DEFINED CMAKE_CROSSCOMPILING)
+  endif()
   set(PRESET_CMAKE_SYSTEM_NAME TRUE)
-else(CMAKE_SYSTEM_NAME)
+else()
   set(CMAKE_SYSTEM_NAME      "${CMAKE_HOST_SYSTEM_NAME}")
   set(CMAKE_SYSTEM_VERSION   "${CMAKE_HOST_SYSTEM_VERSION}")
   set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
   set(CMAKE_CROSSCOMPILING FALSE)
   set(PRESET_CMAKE_SYSTEM_NAME FALSE)
-endif(CMAKE_SYSTEM_NAME)
+endif()
 
 
 macro(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX)
   if(NOT ${_PREFIX}_NAME)
     set(${_PREFIX}_NAME "UnknownOS")
-  endif(NOT ${_PREFIX}_NAME)
+  endif()
 
   # fix for BSD/OS , remove the /
   if(${_PREFIX}_NAME MATCHES BSD.OS)
     set(${_PREFIX}_NAME BSDOS)
-  endif(${_PREFIX}_NAME MATCHES BSD.OS)
+  endif()
 
   # fix for GNU/kFreeBSD, remove the GNU/
   if(${_PREFIX}_NAME MATCHES kFreeBSD)
     set(${_PREFIX}_NAME kFreeBSD)
-  endif(${_PREFIX}_NAME MATCHES kFreeBSD)
+  endif()
 
   # fix for CYGWIN which has windows version in it
   if(${_PREFIX}_NAME MATCHES CYGWIN)
     set(${_PREFIX}_NAME CYGWIN)
-  endif(${_PREFIX}_NAME MATCHES CYGWIN)
+  endif()
 
   # set CMAKE_SYSTEM to the CMAKE_SYSTEM_NAME
   set(${_PREFIX}  ${${_PREFIX}_NAME})
   # if there is a CMAKE_SYSTEM_VERSION then add a -${CMAKE_SYSTEM_VERSION}
   if(${_PREFIX}_VERSION)
     set(${_PREFIX} ${${_PREFIX}}-${${_PREFIX}_VERSION})
-  endif(${_PREFIX}_VERSION)
+  endif()
 
-endmacro(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX)
+endmacro()
 
 ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_SYSTEM)
 ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_HOST_SYSTEM)
@@ -156,21 +156,21 @@ if(CMAKE_BINARY_DIR)
                 "The target system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n")
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
                 "The host system is: ${CMAKE_HOST_SYSTEM_NAME} - ${CMAKE_HOST_SYSTEM_VERSION} - ${CMAKE_HOST_SYSTEM_PROCESSOR}\n")
-  else(PRESET_CMAKE_SYSTEM_NAME)
+  else()
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
                 "The system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n")
-  endif(PRESET_CMAKE_SYSTEM_NAME)
+  endif()
 
   # if a toolchain file is used, it needs to be included in the configured file,
   # so settings done there are also available if they don't go in the cache and in try_compile()
   set(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED)
   if(DEFINED CMAKE_TOOLCHAIN_FILE)
     set(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED "include(\"${CMAKE_TOOLCHAIN_FILE}\")")
-  endif(DEFINED CMAKE_TOOLCHAIN_FILE)
+  endif()
 
   # configure variables set in this file for fast reload, the template file is defined at the top of this file
   configure_file(${CMAKE_ROOT}/Modules/CMakeSystem.cmake.in
                 ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake
                 IMMEDIATE @ONLY)
 
-endif(CMAKE_BINARY_DIR)
+endif()
diff --git a/Modules/CMakeExpandImportedTargets.cmake b/Modules/CMakeExpandImportedTargets.cmake
index d698ad8b6..14551d1f8 100644
--- a/Modules/CMakeExpandImportedTargets.cmake
+++ b/Modules/CMakeExpandImportedTargets.cmake
@@ -76,16 +76,16 @@ function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT )
             # guard against infinite loop: abort after 100 iterations ( 100 is arbitrary chosen)
             if ("${_CCSR_LOOP_COUNTER}" LESS 100)
                set(_CHECK_FOR_IMPORTED_TARGETS TRUE)
-#                else ("${_CCSR_LOOP_COUNTER}" LESS 1)
+#                else ()
 #                   message(STATUS "********* aborting loop, counter : ${_CCSR_LOOP_COUNTER}")
-            endif ("${_CCSR_LOOP_COUNTER}" LESS 100)
+            endif ()
 
             # if one of the imported configurations equals ${CMAKE_TRY_COMPILE_CONFIGURATION},
             # use it, otherwise simply use the first one:
             list(FIND _importedConfigs "${CEIT_CONFIGURATION}" _configIndexToUse)
             if("${_configIndexToUse}" EQUAL -1)
               set(_configIndexToUse 0)
-            endif("${_configIndexToUse}" EQUAL -1)
+            endif()
             list(GET _importedConfigs ${_configIndexToUse} _importedConfigToUse)
 
             get_target_property(_importedLocation "${_CURRENT_LIB}" IMPORTED_LOCATION_${_importedConfigToUse})
@@ -98,18 +98,18 @@ function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT )
 #                  message(STATUS "Appending link interface lib ${_currentLinkInterfaceLib}")
                   if(_currentLinkInterfaceLib)
                      list(APPEND _CCSR_NEW_REQ_LIBS "${_currentLinkInterfaceLib}" )
-                  endif(_currentLinkInterfaceLib)
-               endforeach(_currentLinkInterfaceLib "${_linkInterfaceLibs}")
-            endif(_linkInterfaceLibs)
-         else(_importedConfigs)
+                  endif()
+               endforeach()
+            endif()
+         else()
             # "Normal" libraries are just used as they are.
             list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" )
 #            message(STATUS "Appending lib directly: ${_CURRENT_LIB}")
-         endif(_importedConfigs)
-      endforeach(_CURRENT_LIB ${_CCSR_REQ_LIBS})
+         endif()
+      endforeach()
 
       set(_CCSR_REQ_LIBS ${_CCSR_NEW_REQ_LIBS} )
-   endwhile(_CHECK_FOR_IMPORTED_TARGETS)
+   endwhile()
 
    # Finally we iterate once more over all libraries. This loop only removes
    # all remaining imported target names (there shouldn't be any left anyway).
@@ -119,10 +119,10 @@ function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT )
       if (NOT _importedConfigs)
          list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" )
 #         message(STATUS "final: appending ${_CURRENT_LIB}")
-      else (NOT _importedConfigs)
+      else ()
 #             message(STATUS "final: skipping ${_CURRENT_LIB}")
-      endif (NOT _importedConfigs)
-   endforeach(_CURRENT_LIB ${_CCSR_REQ_LIBS})
+      endif ()
+   endforeach()
 #   message(STATUS "setting -${_RESULT}- to -${_CCSR_NEW_REQ_LIBS}-")
    set(${_RESULT} "${_CCSR_NEW_REQ_LIBS}" PARENT_SCOPE)
 
diff --git a/Modules/CMakeExportBuildSettings.cmake b/Modules/CMakeExportBuildSettings.cmake
index 7392e6bec..a18f95062 100644
--- a/Modules/CMakeExportBuildSettings.cmake
+++ b/Modules/CMakeExportBuildSettings.cmake
@@ -30,7 +30,7 @@ macro(CMAKE_EXPORT_BUILD_SETTINGS SETTINGS_FILE)
   if(${SETTINGS_FILE} MATCHES ".+")
     configure_file(${CMAKE_ROOT}/Modules/CMakeBuildSettings.cmake.in
                    ${SETTINGS_FILE} @ONLY IMMEDIATE)
-  else(${SETTINGS_FILE} MATCHES ".+")
+  else()
     message(SEND_ERROR "CMAKE_EXPORT_BUILD_SETTINGS called with no argument.")
-  endif(${SETTINGS_FILE} MATCHES ".+")
-endmacro(CMAKE_EXPORT_BUILD_SETTINGS)
+  endif()
+endmacro()
diff --git a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake
index 0fe2abbe5..54a641899 100644
--- a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake
+++ b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake
@@ -44,7 +44,7 @@ macro(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines
     foreach(nextLine ${_includeLines})
       string(STRIP "${nextLine}" _includePath)
       list(APPEND ${_resultIncludeDirs} "${_includePath}")
-    endforeach(nextLine)
+    endforeach()
 
   endif()
 
@@ -71,9 +71,9 @@ macro(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines
     else()
       list(APPEND ${_resultDefines} " ")
     endif()
-  endforeach(nextLine)
+  endforeach()
 
-endmacro(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang)
+endmacro()
 
 # Save the current LC_ALL, LC_MESSAGES, and LANG environment variables and set them
 # to "C" that way GCC's "search starts here" text is in English and we can grok it.
diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake
index 71537fff3..362052fb5 100644
--- a/Modules/CMakeFindBinUtils.cmake
+++ b/Modules/CMakeFindBinUtils.cmake
@@ -48,7 +48,7 @@ else("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
   find_program(CMAKE_RANLIB NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ranlib HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
   if(NOT CMAKE_RANLIB)
     set(CMAKE_RANLIB : CACHE INTERNAL "noop for ranlib")
-  endif(NOT CMAKE_RANLIB)
+  endif()
 
   find_program(CMAKE_STRIP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}strip HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
   find_program(CMAKE_LINKER NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ld HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
@@ -69,7 +69,7 @@ if(APPLE)
 
   if(NOT CMAKE_INSTALL_NAME_TOOL)
     message(FATAL_ERROR "Could not find install_name_tool, please check your installation.")
-  endif(NOT CMAKE_INSTALL_NAME_TOOL)
+  endif()
 
   mark_as_advanced(CMAKE_INSTALL_NAME_TOOL)
-endif(APPLE)
+endif()
diff --git a/Modules/CMakeFindCodeBlocks.cmake b/Modules/CMakeFindCodeBlocks.cmake
index 6ca7c1983..f8d8d5908 100644
--- a/Modules/CMakeFindCodeBlocks.cmake
+++ b/Modules/CMakeFindCodeBlocks.cmake
@@ -19,7 +19,7 @@ find_program(CMAKE_CODEBLOCKS_EXECUTABLE NAMES codeblocks DOC "The CodeBlocks ex
 
 if(CMAKE_CODEBLOCKS_EXECUTABLE)
    set(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_CODEBLOCKS_EXECUTABLE} <PROJECT_FILE>" )
-endif(CMAKE_CODEBLOCKS_EXECUTABLE)
+endif()
 
 # Determine builtin macros and include dirs:
 include(${CMAKE_CURRENT_LIST_DIR}/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake)
diff --git a/Modules/CMakeFindFrameworks.cmake b/Modules/CMakeFindFrameworks.cmake
index b47f44448..7fdeb84be 100644
--- a/Modules/CMakeFindFrameworks.cmake
+++ b/Modules/CMakeFindFrameworks.cmake
@@ -25,8 +25,8 @@ if(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
           /Network/Library/Frameworks/${fwk}.framework)
         if(EXISTS ${dir})
           set(${fwk}_FRAMEWORKS ${${fwk}_FRAMEWORKS} ${dir})
-        endif(EXISTS ${dir})
-      endforeach(dir)
-    endif(APPLE)
-  endmacro(CMAKE_FIND_FRAMEWORKS)
-endif(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
+        endif()
+      endforeach()
+    endif()
+  endmacro()
+endif()
diff --git a/Modules/CMakeFindKDevelop3.cmake b/Modules/CMakeFindKDevelop3.cmake
index dd144842c..2abd52376 100644
--- a/Modules/CMakeFindKDevelop3.cmake
+++ b/Modules/CMakeFindKDevelop3.cmake
@@ -19,5 +19,5 @@ find_program(CMAKE_KDEVELOP3_EXECUTABLE NAMES kdevelop DOC "The KDevelop3 execut
 
 if(CMAKE_KDEVELOP3_EXECUTABLE)
    set(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_KDEVELOP3_EXECUTABLE} <PROJECT_FILE>" )
-endif(CMAKE_KDEVELOP3_EXECUTABLE)
+endif()
 
diff --git a/Modules/CMakeFindPackageMode.cmake b/Modules/CMakeFindPackageMode.cmake
index 59c7ba5ee..30d62bc38 100644
--- a/Modules/CMakeFindPackageMode.cmake
+++ b/Modules/CMakeFindPackageMode.cmake
@@ -179,7 +179,7 @@ if(${NAME}_FOUND  OR  ${UPPERCASE_NAME}_FOUND)
     set_compile_flags_var(${NAME})
   elseif("${MODE}" STREQUAL "LINK")
     set_link_flags_var(${NAME})
-  else("${MODE}" STREQUAL "LINK")
+  else()
     message(FATAL_ERROR "Invalid mode argument ${MODE} given.")
   endif()
 
diff --git a/Modules/CMakeForceCompiler.cmake b/Modules/CMakeForceCompiler.cmake
index c56406bb8..980cc17aa 100644
--- a/Modules/CMakeForceCompiler.cmake
+++ b/Modules/CMakeForceCompiler.cmake
@@ -52,8 +52,8 @@ macro(CMAKE_FORCE_C_COMPILER compiler id)
   # Set old compiler id variables.
   if("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
     set(CMAKE_COMPILER_IS_GNUCC 1)
-  endif("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
-endmacro(CMAKE_FORCE_C_COMPILER)
+  endif()
+endmacro()
 
 macro(CMAKE_FORCE_CXX_COMPILER compiler id)
   set(CMAKE_CXX_COMPILER "${compiler}")
@@ -65,8 +65,8 @@ macro(CMAKE_FORCE_CXX_COMPILER compiler id)
   # Set old compiler id variables.
   if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
     set(CMAKE_COMPILER_IS_GNUCXX 1)
-  endif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
-endmacro(CMAKE_FORCE_CXX_COMPILER)
+  endif()
+endmacro()
 
 macro(CMAKE_FORCE_Fortran_COMPILER compiler id)
   set(CMAKE_Fortran_COMPILER "${compiler}")
@@ -78,5 +78,5 @@ macro(CMAKE_FORCE_Fortran_COMPILER compiler id)
   # Set old compiler id variables.
   if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
     set(CMAKE_COMPILER_IS_GNUG77 1)
-  endif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
-endmacro(CMAKE_FORCE_Fortran_COMPILER)
+  endif()
+endmacro()
diff --git a/Modules/CMakeFortranCompiler.cmake.in b/Modules/CMakeFortranCompiler.cmake.in
index d5905123c..c7529fc8e 100644
--- a/Modules/CMakeFortranCompiler.cmake.in
+++ b/Modules/CMakeFortranCompiler.cmake.in
@@ -12,7 +12,7 @@ set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
 if(CMAKE_COMPILER_IS_CYGWIN)
   set(CYGWIN 1)
   set(UNIX 1)
-endif(CMAKE_COMPILER_IS_CYGWIN)
+endif()
 
 set(CMAKE_Fortran_COMPILER_ENV_VAR "FC")
 
@@ -20,16 +20,16 @@ set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 @CMAKE_Fortran_COMPILER_SUPPORTS_F90@)
 
 if(CMAKE_COMPILER_IS_MINGW)
   set(MINGW 1)
-endif(CMAKE_COMPILER_IS_MINGW)
+endif()
 set(CMAKE_Fortran_COMPILER_ID_RUN 1)
 set(CMAKE_Fortran_SOURCE_FILE_EXTENSIONS f;F;f77;F77;f90;F90;for;For;FOR;f95;F95)
 set(CMAKE_Fortran_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
 set(CMAKE_Fortran_LINKER_PREFERENCE 20)
 if(UNIX)
   set(CMAKE_Fortran_OUTPUT_EXTENSION .o)
-else(UNIX)
+else()
   set(CMAKE_Fortran_OUTPUT_EXTENSION .obj)
-endif(UNIX)
+endif()
 
 # Save compiler ABI information.
 set(CMAKE_Fortran_SIZEOF_DATA_PTR "@CMAKE_Fortran_SIZEOF_DATA_PTR@")
@@ -42,7 +42,7 @@ endif()
 
 if(CMAKE_Fortran_COMPILER_ABI)
   set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_Fortran_COMPILER_ABI}")
-endif(CMAKE_Fortran_COMPILER_ABI)
+endif()
 
 if(CMAKE_Fortran_LIBRARY_ARCHITECTURE)
   set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@")
diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake
index c63b3dced..512ec4864 100644
--- a/Modules/CMakeFortranInformation.cmake
+++ b/Modules/CMakeFortranInformation.cmake
@@ -21,28 +21,28 @@ set(_INCLUDED_FILE 0)
 # Load compiler-specific information.
 if(CMAKE_Fortran_COMPILER_ID)
   include(Compiler/${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL)
-endif(CMAKE_Fortran_COMPILER_ID)
+endif()
 
 set(CMAKE_BASE_NAME)
 get_filename_component(CMAKE_BASE_NAME ${CMAKE_Fortran_COMPILER} NAME_WE)
 # since the gnu compiler has several names force g++
 if(CMAKE_COMPILER_IS_GNUG77)
   set(CMAKE_BASE_NAME g77)
-endif(CMAKE_COMPILER_IS_GNUG77)
+endif()
 if(CMAKE_Fortran_COMPILER_ID)
   include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
-endif(CMAKE_Fortran_COMPILER_ID)
+endif()
 if (NOT _INCLUDED_FILE)
   include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
           RESULT_VARIABLE _INCLUDED_FILE)
-endif (NOT _INCLUDED_FILE)
+endif ()
 # We specify the compiler information in the system file for some
 # platforms, but this language may not have been enabled when the file
 # was first included.  Include it again to get the language info.
 # Remove this when all compiler info is removed from system files.
 if (NOT _INCLUDED_FILE)
   include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
-endif (NOT _INCLUDED_FILE)
+endif ()
 
 if(CMAKE_Fortran_SIZEOF_DATA_PTR)
   foreach(f ${CMAKE_Fortran_ABI_FILES})
@@ -76,15 +76,15 @@ set(CMAKE_NEEDS_REQUIRES_STEP_Fortran_FLAG 1)
 
 if(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIC)
   set(CMAKE_Fortran_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC})
-endif(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIC)
+endif()
 
 if(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE)
   set(CMAKE_Fortran_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
-endif(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE)
+endif()
 
 if(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL)
   set(CMAKE_Fortran_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
-endif(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL)
+endif()
 
 # Create a set of shared library variable specific to Fortran
 # For 90% of the systems, these are the same flags as the C versions
@@ -127,7 +127,7 @@ endif()
 if(NOT CMAKE_MODULE_EXISTS)
   set(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_Fortran_FLAGS})
   set(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS})
-endif(NOT CMAKE_MODULE_EXISTS)
+endif()
 
 # repeat for modules
 if(NOT DEFINED CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS)
@@ -152,15 +152,15 @@ endif()
 
 if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH)
   set(CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH})
-endif(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH)
+endif()
 
 if(NOT CMAKE_INCLUDE_FLAG_Fortran)
   set(CMAKE_INCLUDE_FLAG_Fortran ${CMAKE_INCLUDE_FLAG_C})
-endif(NOT CMAKE_INCLUDE_FLAG_Fortran)
+endif()
 
 if(NOT CMAKE_INCLUDE_FLAG_SEP_Fortran)
   set(CMAKE_INCLUDE_FLAG_SEP_Fortran ${CMAKE_INCLUDE_FLAG_SEP_C})
-endif(NOT CMAKE_INCLUDE_FLAG_SEP_Fortran)
+endif()
 
 set(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make.  This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")
 
@@ -168,7 +168,7 @@ set(CMAKE_Fortran_FLAGS_INIT "$ENV{FFLAGS} ${CMAKE_Fortran_FLAGS_INIT}")
 # avoid just having a space as the initial value for the cache
 if(CMAKE_Fortran_FLAGS_INIT STREQUAL " ")
   set(CMAKE_Fortran_FLAGS_INIT)
-endif(CMAKE_Fortran_FLAGS_INIT STREQUAL " ")
+endif()
 set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_INIT}" CACHE STRING
      "Flags for Fortran compiler.")
 
@@ -184,12 +184,12 @@ include(CMakeCommonLanguageInclude)
 if(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY)
   set(CMAKE_Fortran_CREATE_SHARED_LIBRARY
       "<CMAKE_Fortran_COMPILER> <CMAKE_SHARED_LIBRARY_Fortran_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
-endif(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY)
+endif()
 
 # create a Fortran shared module just copy the shared library rule
 if(NOT CMAKE_Fortran_CREATE_SHARED_MODULE)
   set(CMAKE_Fortran_CREATE_SHARED_MODULE ${CMAKE_Fortran_CREATE_SHARED_LIBRARY})
-endif(NOT CMAKE_Fortran_CREATE_SHARED_MODULE)
+endif()
 
 # Create a static archive incrementally for large object file counts.
 # If CMAKE_Fortran_CREATE_STATIC_LIBRARY is set it will override these.
@@ -208,19 +208,19 @@ endif()
 if(NOT CMAKE_Fortran_COMPILE_OBJECT)
   set(CMAKE_Fortran_COMPILE_OBJECT
     "<CMAKE_Fortran_COMPILER> <DEFINES> <FLAGS> -c <SOURCE> -o <OBJECT>")
-endif(NOT CMAKE_Fortran_COMPILE_OBJECT)
+endif()
 
 # link a fortran program
 if(NOT CMAKE_Fortran_LINK_EXECUTABLE)
   set(CMAKE_Fortran_LINK_EXECUTABLE
     "<CMAKE_Fortran_COMPILER> <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <FLAGS> <OBJECTS>  -o <TARGET> <LINK_LIBRARIES>")
-endif(NOT CMAKE_Fortran_LINK_EXECUTABLE)
+endif()
 
 if(CMAKE_Fortran_STANDARD_LIBRARIES_INIT)
   set(CMAKE_Fortran_STANDARD_LIBRARIES "${CMAKE_Fortran_STANDARD_LIBRARIES_INIT}"
     CACHE STRING "Libraries linked by defalut with all Fortran applications.")
   mark_as_advanced(CMAKE_Fortran_STANDARD_LIBRARIES)
-endif(CMAKE_Fortran_STANDARD_LIBRARIES_INIT)
+endif()
 
 if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
   set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG_INIT}" CACHE STRING
@@ -232,7 +232,7 @@ if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
   set (CMAKE_Fortran_FLAGS_RELWITHDEBINFO "${CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
      "Flags used by the compiler during Release with Debug Info builds.")
 
-endif(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+endif()
 
 mark_as_advanced(
 CMAKE_Fortran_FLAGS
diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake
index 91904d7a5..8a14aea60 100644
--- a/Modules/CMakeGenericSystem.cmake
+++ b/Modules/CMakeGenericSystem.cmake
@@ -51,21 +51,21 @@ if(CMAKE_GENERATOR MATCHES "Makefiles")
   mark_as_advanced(CMAKE_COLOR_MAKEFILE)
   if(DEFINED CMAKE_RULE_MESSAGES)
     set_property(GLOBAL PROPERTY RULE_MESSAGES ${CMAKE_RULE_MESSAGES})
-  endif(DEFINED CMAKE_RULE_MESSAGES)
+  endif()
   if(CMAKE_GENERATOR MATCHES "Unix Makefiles")
     set(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL
       "Enable/Disable output of compile commands during generation."
       )
     mark_as_advanced(CMAKE_EXPORT_COMPILE_COMMANDS)
-  endif(CMAKE_GENERATOR MATCHES "Unix Makefiles")
-endif(CMAKE_GENERATOR MATCHES "Makefiles")
+  endif()
+endif()
 
 if(CMAKE_GENERATOR MATCHES "Ninja")
   set(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL
     "Enable/Disable output of compile commands during generation."
     )
   mark_as_advanced(CMAKE_EXPORT_COMPILE_COMMANDS)
-endif(CMAKE_GENERATOR MATCHES "Ninja")
+endif()
 
 # GetDefaultWindowsPrefixBase
 #
@@ -162,19 +162,19 @@ endfunction()
 # command line to override it.
 if(NOT DEFINED CMAKE_INSTALL_PREFIX)
   set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 1)
-endif(NOT DEFINED CMAKE_INSTALL_PREFIX)
+endif()
 
 # Choose a default install prefix for this platform.
 if(CMAKE_HOST_UNIX)
   set(CMAKE_INSTALL_PREFIX "/usr/local"
     CACHE PATH "Install path prefix, prepended onto install directories.")
-else(CMAKE_HOST_UNIX)
+else()
   GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES)
   set(CMAKE_INSTALL_PREFIX
     "${CMAKE_GENERIC_PROGRAM_FILES}/${PROJECT_NAME}"
     CACHE PATH "Install path prefix, prepended onto install directories.")
   set(CMAKE_GENERIC_PROGRAM_FILES)
-endif(CMAKE_HOST_UNIX)
+endif()
 
 # Set a variable which will be used as component name in install() commands
 # where no COMPONENT has been given:
diff --git a/Modules/CMakeImportBuildSettings.cmake b/Modules/CMakeImportBuildSettings.cmake
index f0080ecd5..60b887aed 100644
--- a/Modules/CMakeImportBuildSettings.cmake
+++ b/Modules/CMakeImportBuildSettings.cmake
@@ -18,7 +18,7 @@
 # stored settings using the CMAKE_EXPORT_BUILD_SETTINGS macro.
 macro(CMAKE_IMPORT_BUILD_SETTINGS SETTINGS_FILE)
   if(${SETTINGS_FILE} MATCHES ".+")
-  else(${SETTINGS_FILE} MATCHES ".+")
+  else()
     message(SEND_ERROR "CMAKE_IMPORT_BUILD_SETTINGS called with no argument.")
-  endif(${SETTINGS_FILE} MATCHES ".+")
-endmacro(CMAKE_IMPORT_BUILD_SETTINGS)
+  endif()
+endmacro()
diff --git a/Modules/CMakeJavaInformation.cmake b/Modules/CMakeJavaInformation.cmake
index 79208ca51..928c6ac32 100644
--- a/Modules/CMakeJavaInformation.cmake
+++ b/Modules/CMakeJavaInformation.cmake
@@ -34,26 +34,26 @@ endif()
 if(NOT CMAKE_Java_CREATE_STATIC_LIBRARY)
 #  if(WIN32)
 #    set(class_files_mask "*.class")
-#  else(WIN32)
+#  else()
     set(class_files_mask ".")
-#  endif(WIN32)
+#  endif()
 
   set(CMAKE_Java_CREATE_STATIC_LIBRARY
       "<CMAKE_Java_ARCHIVE> -cf <TARGET> -C <OBJECT_DIR> ${class_files_mask}")
     # "${class_files_mask}" should really be "<OBJECTS>" but compling a *.java
     # file can create more than one *.class file...
-endif(NOT CMAKE_Java_CREATE_STATIC_LIBRARY)
+endif()
 
 # compile a Java file into an object file
 if(NOT CMAKE_Java_COMPILE_OBJECT)
   set(CMAKE_Java_COMPILE_OBJECT
     "<CMAKE_Java_COMPILER> <FLAGS> <SOURCE> -d <OBJECT_DIR>")
-endif(NOT CMAKE_Java_COMPILE_OBJECT)
+endif()
 
 # set java include flag option and the separator for multiple include paths
 set(CMAKE_INCLUDE_FLAG_Java "-classpath ")
 if(WIN32 AND NOT CYGWIN)
   set(CMAKE_INCLUDE_FLAG_SEP_Java ";")
-else(WIN32 AND NOT CYGWIN)
+else()
   set(CMAKE_INCLUDE_FLAG_SEP_Java ":")
-endif(WIN32 AND NOT CYGWIN)
+endif()
diff --git a/Modules/CMakeMinGWFindMake.cmake b/Modules/CMakeMinGWFindMake.cmake
index 9081e68c1..efba20a31 100644
--- a/Modules/CMakeMinGWFindMake.cmake
+++ b/Modules/CMakeMinGWFindMake.cmake
@@ -19,6 +19,6 @@ find_program(CMAKE_SH sh.exe )
 if(CMAKE_SH)
   message(FATAL_ERROR "sh.exe was found in your PATH, here:\n${CMAKE_SH}\nFor MinGW make to work correctly sh.exe must NOT be in your path.\nRun cmake from a shell that does not have sh.exe in your PATH.\nIf you want to use a UNIX shell, then use MSYS Makefiles.\n")
   set(CMAKE_MAKE_PROGRAM NOTFOUND)
-endif(CMAKE_SH)
+endif()
 
 mark_as_advanced(CMAKE_MAKE_PROGRAM CMAKE_SH)
diff --git a/Modules/CMakePackageConfigHelpers.cmake b/Modules/CMakePackageConfigHelpers.cmake
index 457a7ae6d..96ecb4270 100644
--- a/Modules/CMakePackageConfigHelpers.cmake
+++ b/Modules/CMakePackageConfigHelpers.cmake
@@ -214,7 +214,7 @@ macro(check_required_components _NAME)
         set(\${_NAME}_FOUND FALSE)
       endif()
     endif()
-  endforeach(comp)
+  endforeach()
 endmacro()
 ")
   endif()
diff --git a/Modules/CMakeParseArguments.cmake b/Modules/CMakeParseArguments.cmake
index 7ce4c49ae..406780eb4 100644
--- a/Modules/CMakeParseArguments.cmake
+++ b/Modules/CMakeParseArguments.cmake
@@ -84,11 +84,11 @@ function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgName
   # first set all result variables to empty/FALSE
   foreach(arg_name ${_singleArgNames} ${_multiArgNames})
     set(${prefix}_${arg_name})
-  endforeach(arg_name)
+  endforeach()
 
   foreach(option ${_optionNames})
     set(${prefix}_${option} FALSE)
-  endforeach(option)
+  endforeach()
 
   set(${prefix}_UNPARSED_ARGUMENTS)
 
@@ -109,9 +109,9 @@ function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgName
         elseif("${insideValues}" STREQUAL "MULTI")
           list(APPEND ${prefix}_${currentArgName} ${currentArg})
         endif()
-      else(insideValues)
+      else()
         list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg})
-      endif(insideValues)
+      endif()
     else()
       if(NOT ${optionIndex} EQUAL -1)
         set(${prefix}_${currentArg} TRUE)
@@ -127,12 +127,12 @@ function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgName
       endif()
     endif()
 
-  endforeach(currentArg)
+  endforeach()
 
   # propagate the result variables to the caller:
   foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames})
     set(${prefix}_${arg_name}  ${${prefix}_${arg_name}} PARENT_SCOPE)
-  endforeach(arg_name)
+  endforeach()
   set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE)
 
-endfunction(CMAKE_PARSE_ARGUMENTS _options _singleArgs _multiArgs)
+endfunction()
diff --git a/Modules/CMakePushCheckState.cmake b/Modules/CMakePushCheckState.cmake
index fa6e81c6c..08809bf25 100644
--- a/Modules/CMakePushCheckState.cmake
+++ b/Modules/CMakePushCheckState.cmake
@@ -43,7 +43,7 @@ macro(CMAKE_PUSH_CHECK_STATE)
    set(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS})
    set(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}   ${CMAKE_REQUIRED_LIBRARIES})
    set(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}       ${CMAKE_REQUIRED_FLAGS})
-endmacro(CMAKE_PUSH_CHECK_STATE)
+endmacro()
 
 macro(CMAKE_POP_CHECK_STATE)
 
@@ -58,4 +58,4 @@ macro(CMAKE_POP_CHECK_STATE)
       math(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}-1")
    endif()
 
-endmacro(CMAKE_POP_CHECK_STATE)
+endmacro()
diff --git a/Modules/CMakeRCInformation.cmake b/Modules/CMakeRCInformation.cmake
index 2f1387c37..8ffe50aba 100644
--- a/Modules/CMakeRCInformation.cmake
+++ b/Modules/CMakeRCInformation.cmake
@@ -44,7 +44,7 @@ set(CMAKE_INCLUDE_FLAG_RC "-I")
 if(NOT CMAKE_RC_COMPILE_OBJECT)
   set(CMAKE_RC_COMPILE_OBJECT
     "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> /fo<OBJECT> <SOURCE>")
-endif(NOT CMAKE_RC_COMPILE_OBJECT)
+endif()
 
 mark_as_advanced(
 CMAKE_RC_FLAGS
diff --git a/Modules/CMakeSystemSpecificInformation.cmake b/Modules/CMakeSystemSpecificInformation.cmake
index 6f85ccc91..b9f8e0aaa 100644
--- a/Modules/CMakeSystemSpecificInformation.cmake
+++ b/Modules/CMakeSystemSpecificInformation.cmake
@@ -44,8 +44,8 @@ if(NOT _INCLUDED_SYSTEM_INFO_FILE)
                    ${CMAKE_BINARY_DIR}/CopyOfCMakeCache.txt COPYONLY)
     message("Your CMakeCache.txt file was copied to CopyOfCMakeCache.txt. "
             "Please send that file to cmake@www.cmake.org.")
-   endif(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
-endif(NOT _INCLUDED_SYSTEM_INFO_FILE)
+   endif()
+endif()
 
 
 # optionally include a file which can do extra-generator specific things, e.g.
@@ -53,7 +53,7 @@ endif(NOT _INCLUDED_SYSTEM_INFO_FILE)
 if(CMAKE_EXTRA_GENERATOR)
   string(REPLACE " " "" _CMAKE_EXTRA_GENERATOR_NO_SPACES ${CMAKE_EXTRA_GENERATOR} )
   include("CMakeFind${_CMAKE_EXTRA_GENERATOR_NO_SPACES}" OPTIONAL)
-endif(CMAKE_EXTRA_GENERATOR)
+endif()
 
 
 # for most systems a module is the same as a shared library
@@ -63,7 +63,7 @@ endif(CMAKE_EXTRA_GENERATOR)
 if(NOT CMAKE_MODULE_EXISTS)
   set(CMAKE_SHARED_MODULE_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}")
   set(CMAKE_SHARED_MODULE_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}")
-endif(NOT CMAKE_MODULE_EXISTS)
+endif()
 
 
 set(CMAKE_SYSTEM_SPECIFIC_INFORMATION_LOADED 1)
diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake
index 9881c9d24..14291a7e7 100644
--- a/Modules/CMakeTestCCompiler.cmake
+++ b/Modules/CMakeTestCCompiler.cmake
@@ -37,7 +37,7 @@ if(NOT CMAKE_C_COMPILER_WORKS)
     ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c
     OUTPUT_VARIABLE __CMAKE_C_COMPILER_OUTPUT)
   set(C_TEST_WAS_RUN 1)
-endif(NOT CMAKE_C_COMPILER_WORKS)
+endif()
 
 if(NOT CMAKE_C_COMPILER_WORKS)
   PrintTestCompilerStatus("C" " -- broken")
@@ -53,19 +53,19 @@ if(NOT CMAKE_C_COMPILER_WORKS)
     "is not able to compile a simple test program.\nIt fails "
     "with the following output:\n ${__CMAKE_C_COMPILER_OUTPUT}\n\n"
     "CMake will not be able to correctly generate this project.")
-else(NOT CMAKE_C_COMPILER_WORKS)
+else()
   if(C_TEST_WAS_RUN)
     PrintTestCompilerStatus("C" " -- works")
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining if the C compiler works passed with "
       "the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n")
-  endif(C_TEST_WAS_RUN)
+  endif()
   set(CMAKE_C_COMPILER_WORKS 1 CACHE INTERNAL "")
 
   if(CMAKE_C_COMPILER_FORCED)
     # The compiler configuration was forced by the user.
     # Assume the user has configured all compiler information.
-  else(CMAKE_C_COMPILER_FORCED)
+  else()
     # Try to identify the ABI and configure it into CMakeCCompiler.cmake
     include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
     CMAKE_DETERMINE_COMPILER_ABI(C ${CMAKE_ROOT}/Modules/CMakeCCompilerABI.c)
@@ -75,13 +75,13 @@ else(NOT CMAKE_C_COMPILER_WORKS)
       @ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
       )
     include(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCCompiler.cmake)
-  endif(CMAKE_C_COMPILER_FORCED)
+  endif()
   if(CMAKE_C_SIZEOF_DATA_PTR)
     foreach(f ${CMAKE_C_ABI_FILES})
       include(${f})
     endforeach()
     unset(CMAKE_C_ABI_FILES)
   endif()
-endif(NOT CMAKE_C_COMPILER_WORKS)
+endif()
 
 unset(__CMAKE_C_COMPILER_OUTPUT)
diff --git a/Modules/CMakeTestCXXCompiler.cmake b/Modules/CMakeTestCXXCompiler.cmake
index 52eaa3cca..5ed826b78 100644
--- a/Modules/CMakeTestCXXCompiler.cmake
+++ b/Modules/CMakeTestCXXCompiler.cmake
@@ -30,7 +30,7 @@ if(NOT CMAKE_CXX_COMPILER_WORKS)
     ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx
     OUTPUT_VARIABLE __CMAKE_CXX_COMPILER_OUTPUT)
   set(CXX_TEST_WAS_RUN 1)
-endif(NOT CMAKE_CXX_COMPILER_WORKS)
+endif()
 
 if(NOT CMAKE_CXX_COMPILER_WORKS)
   PrintTestCompilerStatus("CXX" " -- broken")
@@ -46,19 +46,19 @@ if(NOT CMAKE_CXX_COMPILER_WORKS)
     "is not able to compile a simple test program.\nIt fails "
     "with the following output:\n ${__CMAKE_CXX_COMPILER_OUTPUT}\n\n"
     "CMake will not be able to correctly generate this project.")
-else(NOT CMAKE_CXX_COMPILER_WORKS)
+else()
   if(CXX_TEST_WAS_RUN)
     PrintTestCompilerStatus("CXX" " -- works")
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining if the CXX compiler works passed with "
       "the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n")
-  endif(CXX_TEST_WAS_RUN)
+  endif()
   set(CMAKE_CXX_COMPILER_WORKS 1 CACHE INTERNAL "")
 
   if(CMAKE_CXX_COMPILER_FORCED)
     # The compiler configuration was forced by the user.
     # Assume the user has configured all compiler information.
-  else(CMAKE_CXX_COMPILER_FORCED)
+  else()
     # Try to identify the ABI and configure it into CMakeCXXCompiler.cmake
     include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
     CMAKE_DETERMINE_COMPILER_ABI(CXX ${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp)
@@ -68,13 +68,13 @@ else(NOT CMAKE_CXX_COMPILER_WORKS)
       @ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
       )
     include(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake)
-  endif(CMAKE_CXX_COMPILER_FORCED)
+  endif()
   if(CMAKE_CXX_SIZEOF_DATA_PTR)
     foreach(f ${CMAKE_CXX_ABI_FILES})
       include(${f})
     endforeach()
     unset(CMAKE_CXX_ABI_FILES)
   endif()
-endif(NOT CMAKE_CXX_COMPILER_WORKS)
+endif()
 
 unset(__CMAKE_CXX_COMPILER_OUTPUT)
diff --git a/Modules/CMakeTestFortranCompiler.cmake b/Modules/CMakeTestFortranCompiler.cmake
index 4f711d8e3..b388d1ec7 100644
--- a/Modules/CMakeTestFortranCompiler.cmake
+++ b/Modules/CMakeTestFortranCompiler.cmake
@@ -30,7 +30,7 @@ if(NOT CMAKE_Fortran_COMPILER_WORKS)
     ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f
     OUTPUT_VARIABLE OUTPUT)
   set(FORTRAN_TEST_WAS_RUN 1)
-endif(NOT CMAKE_Fortran_COMPILER_WORKS)
+endif()
 
 if(NOT CMAKE_Fortran_COMPILER_WORKS)
   PrintTestCompilerStatus("Fortran" "  -- broken")
@@ -41,19 +41,19 @@ if(NOT CMAKE_Fortran_COMPILER_WORKS)
     "is not able to compile a simple test program.\nIt fails "
     "with the following output:\n ${OUTPUT}\n\n"
     "CMake will not be able to correctly generate this project.")
-else(NOT CMAKE_Fortran_COMPILER_WORKS)
+else()
   if(FORTRAN_TEST_WAS_RUN)
     PrintTestCompilerStatus("Fortran" "  -- works")
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining if the Fortran compiler works passed with "
       "the following output:\n${OUTPUT}\n\n")
-  endif(FORTRAN_TEST_WAS_RUN)
+  endif()
   set(CMAKE_Fortran_COMPILER_WORKS 1 CACHE INTERNAL "")
 
   if(CMAKE_Fortran_COMPILER_FORCED)
     # The compiler configuration was forced by the user.
     # Assume the user has configured all compiler information.
-  else(CMAKE_Fortran_COMPILER_FORCED)
+  else()
     # Try to identify the ABI and configure it into CMakeFortranCompiler.cmake
     include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
     CMAKE_DETERMINE_COMPILER_ABI(Fortran ${CMAKE_ROOT}/Modules/CMakeFortranCompilerABI.F)
@@ -75,15 +75,15 @@ else(NOT CMAKE_Fortran_COMPILER_WORKS)
           "Determining if the Fortran compiler supports Fortran 90 passed with "
           "the following output:\n${OUTPUT}\n\n")
         set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 1)
-      else(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
+      else()
         message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- no")
         file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
           "Determining if the Fortran compiler supports Fortran 90 failed with "
           "the following output:\n${OUTPUT}\n\n")
         set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 0)
-      endif(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
+      endif()
       unset(CMAKE_Fortran_COMPILER_SUPPORTS_F90 CACHE)
-    endif(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90)
+    endif()
 
     configure_file(
       ${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in
@@ -91,11 +91,11 @@ else(NOT CMAKE_Fortran_COMPILER_WORKS)
       @ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
       )
     include(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake)
-  endif(CMAKE_Fortran_COMPILER_FORCED)
+  endif()
   if(CMAKE_Fortran_SIZEOF_DATA_PTR)
     foreach(f ${CMAKE_Fortran_ABI_FILES})
       include(${f})
     endforeach()
     unset(CMAKE_Fortran_ABI_FILES)
   endif()
-endif(NOT CMAKE_Fortran_COMPILER_WORKS)
+endif()
diff --git a/Modules/CMakeVS8FindMake.cmake b/Modules/CMakeVS8FindMake.cmake
index 790ca2b6a..31df0268d 100644
--- a/Modules/CMakeVS8FindMake.cmake
+++ b/Modules/CMakeVS8FindMake.cmake
@@ -16,7 +16,7 @@
 set( _CMAKE_MAKE_PROGRAM_NAMES devenv)
 if(NOT CMAKE_CROSSCOMPILING)
   set( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress)
-endif(NOT CMAKE_CROSSCOMPILING)
+endif()
 
 find_program(CMAKE_MAKE_PROGRAM
   NAMES ${_CMAKE_MAKE_PROGRAM_NAMES}
diff --git a/Modules/CMakeVS9FindMake.cmake b/Modules/CMakeVS9FindMake.cmake
index c7aba3692..35e9f981a 100644
--- a/Modules/CMakeVS9FindMake.cmake
+++ b/Modules/CMakeVS9FindMake.cmake
@@ -16,7 +16,7 @@
 set( _CMAKE_MAKE_PROGRAM_NAMES devenv)
 if(NOT CMAKE_CROSSCOMPILING)
   set( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress)
-endif(NOT CMAKE_CROSSCOMPILING)
+endif()
 
 find_program(CMAKE_MAKE_PROGRAM
   NAMES ${_CMAKE_MAKE_PROGRAM_NAMES}
diff --git a/Modules/CMakeVerifyManifest.cmake b/Modules/CMakeVerifyManifest.cmake
index 1d16e1881..aebe77ea1 100644
--- a/Modules/CMakeVerifyManifest.cmake
+++ b/Modules/CMakeVerifyManifest.cmake
@@ -47,7 +47,7 @@ function(crt_version file list_var)
     else()
       message(FATAL_ERROR "Parse error could not find version in [${s}]")
     endif()
-  endforeach(s)
+  endforeach()
   if(NOT DEFINED has_match)
     message("Information: no embeded manifest in: ${file}")
     return()
@@ -57,7 +57,7 @@ function(crt_version file list_var)
   if(version_list)
     set(${list_var} ${version_list} PARENT_SCOPE)
   endif()
-endfunction(crt_version)
+endfunction()
 set(fatal_error FALSE)
 
 # check_version:
@@ -75,7 +75,7 @@ function(check_version file manifest_versions)
       message("ERROR: ${file} uses ${ver} not found in shipped manifests:[${manifest_versions}].")
       set(fatal_error TRUE PARENT_SCOPE)
     endif()
-  endforeach(ver)
+  endforeach()
   list(LENGTH file_versions len)
   if(${len} GREATER 1)
     message("WARNING: found more than one version of MICROSOFT.VC80.CRT referenced in ${file}: [${file_versions}]")
@@ -88,7 +88,7 @@ set(manifest_version_list )
 file(GLOB_RECURSE manifest_files "*.manifest")
 foreach(f ${manifest_files})
   crt_version("${f}" manifest_version_list)
-endforeach(f)
+endforeach()
 list(LENGTH manifest_version_list LEN)
 if(LEN EQUAL 0)
   message(FATAL_ERROR "No .manifest files found, no version check can be done.")
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index 513e11275..6886ed9fd 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -287,19 +287,19 @@
 # Define this var in order to avoid (or warn) concerning multiple inclusion
 if(CPack_CMake_INCLUDED)
   message(WARNING "CPack.cmake has already been included!!")
-else(CPack_CMake_INCLUDED)
+else()
   set(CPack_CMake_INCLUDED 1)
-endif(CPack_CMake_INCLUDED)
+endif()
 
 # Pick a configuration file
 set(cpack_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
 if(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
   set(cpack_input_file "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
-endif(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
+endif()
 set(cpack_source_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
 if(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
   set(cpack_source_input_file "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
-endif(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
+endif()
 
 # Backward compatibility
 # Include CPackComponent macros if it has not already been included before.
@@ -309,8 +309,8 @@ include(CPackComponent)
 macro(cpack_set_if_not_set name value)
   if(NOT DEFINED "${name}")
     set(${name} "${value}")
-  endif(NOT DEFINED "${name}")
-endmacro(cpack_set_if_not_set)
+  endif()
+endmacro()
 
 # cpack_encode_variables - Macro to encode variables for the configuration file
 # find any variable that starts with CPACK and create a variable
@@ -324,9 +324,9 @@ macro(cpack_encode_variables)
     if("xxx${var}" MATCHES "xxxCPACK")
       set(_CPACK_OTHER_VARIABLES_
         "${_CPACK_OTHER_VARIABLES_}\nSET(${var} \"${${var}}\")")
-      endif("xxx${var}" MATCHES "xxxCPACK")
-  endforeach(var ${res})
-endmacro(cpack_encode_variables)
+      endif()
+  endforeach()
+endmacro()
 
 # Set the package name
 cpack_set_if_not_set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
@@ -352,20 +352,20 @@ cpack_set_if_not_set(CPACK_MODULE_PATH "${CMAKE_MODULE_PATH}")
 
 if(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL)
   set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
-endif(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL)
+endif()
 
 if(CPACK_NSIS_MODIFY_PATH)
   set(CPACK_NSIS_MODIFY_PATH ON)
-endif(CPACK_NSIS_MODIFY_PATH)
+endif()
 
 set(__cpack_system_name ${CMAKE_SYSTEM_NAME})
 if(${__cpack_system_name} MATCHES Windows)
   if(CMAKE_CL_64)
     set(__cpack_system_name win64)
-  else(CMAKE_CL_64)
+  else()
     set(__cpack_system_name win32)
-  endif(CMAKE_CL_64)
-endif(${__cpack_system_name} MATCHES Windows)
+  endif()
+endif()
 cpack_set_if_not_set(CPACK_SYSTEM_NAME "${__cpack_system_name}")
 
 # Root dir: default value should be the string literal "$PROGRAMFILES"
@@ -386,15 +386,15 @@ cpack_set_if_not_set(CPACK_PACKAGE_RELOCATABLE "true")
 # always force to exactly "true" or "false" for CPack.Info.plist.in:
 if(CPACK_PACKAGE_RELOCATABLE)
   set(CPACK_PACKAGE_RELOCATABLE "true")
-else(CPACK_PACKAGE_RELOCATABLE)
+else()
   set(CPACK_PACKAGE_RELOCATABLE "false")
-endif(CPACK_PACKAGE_RELOCATABLE)
+endif()
 
 macro(cpack_check_file_exists file description)
   if(NOT EXISTS "${file}")
     message(SEND_ERROR "CPack ${description} file: \"${file}\" could not be found.")
-  endif(NOT EXISTS "${file}")
-endmacro(cpack_check_file_exists)
+  endif()
+endmacro()
 
 cpack_check_file_exists("${CPACK_PACKAGE_DESCRIPTION_FILE}" "package description")
 cpack_check_file_exists("${CPACK_RESOURCE_FILE_LICENSE}"    "license resource")
@@ -404,8 +404,8 @@ cpack_check_file_exists("${CPACK_RESOURCE_FILE_WELCOME}"    "welcome resource")
 macro(cpack_optional_append _list _cond _item)
   if(${_cond})
     set(${_list} ${${_list}} ${_item})
-  endif(${_cond})
-endmacro(cpack_optional_append _list _cond _item)
+  endif()
+endmacro()
 
 ##variable
 # CPACK_BINARY_<GENNAME> - CPack generated options for binary generators. The
@@ -420,26 +420,26 @@ if(NOT CPACK_GENERATOR)
   if(UNIX)
     if(CYGWIN)
       option(CPACK_BINARY_CYGWIN "Enable to build Cygwin binary packages" ON)
-    else(CYGWIN)
+    else()
       if(APPLE)
         option(CPACK_BINARY_BUNDLE       "Enable to build OSX bundles"      OFF)
         option(CPACK_BINARY_DRAGNDROP    "Enable to build OSX Drag And Drop package" OFF)
         option(CPACK_BINARY_PACKAGEMAKER "Enable to build PackageMaker packages" ON)
         option(CPACK_BINARY_OSXX11       "Enable to build OSX X11 packages"      OFF)
-      else(APPLE)
+      else()
         option(CPACK_BINARY_TZ  "Enable to build TZ packages"     ON)
-      endif(APPLE)
+      endif()
       option(CPACK_BINARY_STGZ "Enable to build STGZ packages"    ON)
       option(CPACK_BINARY_TGZ  "Enable to build TGZ packages"     ON)
       option(CPACK_BINARY_TBZ2 "Enable to build TBZ2 packages"    OFF)
       option(CPACK_BINARY_DEB  "Enable to build Debian packages"  OFF)
       option(CPACK_BINARY_RPM  "Enable to build RPM packages"     OFF)
       option(CPACK_BINARY_NSIS "Enable to build NSIS packages"    OFF)
-    endif(CYGWIN)
-  else(UNIX)
+    endif()
+  else()
     option(CPACK_BINARY_NSIS "Enable to build NSIS packages" ON)
     option(CPACK_BINARY_ZIP  "Enable to build ZIP packages" OFF)
-  endif(UNIX)
+  endif()
 
   cpack_optional_append(CPACK_GENERATOR  CPACK_BINARY_BUNDLE       Bundle)
   cpack_optional_append(CPACK_GENERATOR  CPACK_BINARY_DRAGNDROP    DragNDrop)
@@ -455,29 +455,29 @@ if(NOT CPACK_GENERATOR)
   cpack_optional_append(CPACK_GENERATOR  CPACK_BINARY_TZ           TZ)
   cpack_optional_append(CPACK_GENERATOR  CPACK_BINARY_ZIP          ZIP)
 
-endif(NOT CPACK_GENERATOR)
+endif()
 
 # Provide options to choose source generators
 if(NOT CPACK_SOURCE_GENERATOR)
   if(UNIX)
     if(CYGWIN)
       option(CPACK_SOURCE_CYGWIN "Enable to build Cygwin source packages" ON)
-    else(CYGWIN)
+    else()
       option(CPACK_SOURCE_TBZ2 "Enable to build TBZ2 source packages" ON)
       option(CPACK_SOURCE_TGZ  "Enable to build TGZ source packages"  ON)
       option(CPACK_SOURCE_TZ   "Enable to build TZ source packages"   ON)
       option(CPACK_SOURCE_ZIP  "Enable to build ZIP source packages"  OFF)
-    endif(CYGWIN)
-  else(UNIX)
+    endif()
+  else()
     option(CPACK_SOURCE_ZIP "Enable to build ZIP source packages" ON)
-  endif(UNIX)
+  endif()
 
   cpack_optional_append(CPACK_SOURCE_GENERATOR  CPACK_SOURCE_CYGWIN  CygwinSource)
   cpack_optional_append(CPACK_SOURCE_GENERATOR  CPACK_SOURCE_TGZ     TGZ)
   cpack_optional_append(CPACK_SOURCE_GENERATOR  CPACK_SOURCE_TBZ2    TBZ2)
   cpack_optional_append(CPACK_SOURCE_GENERATOR  CPACK_SOURCE_TZ      TZ)
   cpack_optional_append(CPACK_SOURCE_GENERATOR  CPACK_SOURCE_ZIP     ZIP)
-endif(NOT CPACK_SOURCE_GENERATOR)
+endif()
 
 # mark the above options as advanced
 mark_as_advanced(CPACK_BINARY_CYGWIN CPACK_BINARY_PACKAGEMAKER CPACK_BINARY_OSXX11
@@ -526,12 +526,12 @@ if(DEFINED CPACK_COMPONENTS_ALL)
   if(CPACK_MONOLITHIC_INSTALL)
     message("CPack warning: both CPACK_COMPONENTS_ALL and CPACK_MONOLITHIC_INSTALL have been set.\nDefaulting to a monolithic installation.")
     set(CPACK_COMPONENTS_ALL)
-  else(CPACK_MONOLITHIC_INSTALL)
+  else()
     # The user has provided the set of components to be installed as
     # part of a component-based installation; trust her.
     set(CPACK_COMPONENTS_ALL_SET_BY_USER TRUE)
-  endif(CPACK_MONOLITHIC_INSTALL)
-else(DEFINED CPACK_COMPONENTS_ALL)
+  endif()
+else()
   # If the user has not specifically requested a monolithic installer
   # but has specified components in various "install" commands, tell
   # CPack about those components.
@@ -543,10 +543,10 @@ else(DEFINED CPACK_COMPONENTS_ALL)
       # (at least, it isn't a component-based installation, but may
       # become one later if the user uses the cpack_add_* commands).
       set(CPACK_COMPONENTS_ALL)
-    endif(CPACK_COMPONENTS_LEN EQUAL 1)
+    endif()
     set(CPACK_COMPONENTS_LEN)
-  endif(NOT CPACK_MONOLITHIC_INSTALL)
-endif(DEFINED CPACK_COMPONENTS_ALL)
+  endif()
+endif()
 
 # CMake always generates a component named "Unspecified", which is
 # used to install everything that doesn't have an explicitly-provided
diff --git a/Modules/CPackComponent.cmake b/Modules/CPackComponent.cmake
index d7d3cf84b..c85cfb454 100644
--- a/Modules/CPackComponent.cmake
+++ b/Modules/CPackComponent.cmake
@@ -283,10 +283,10 @@ macro(cpack_parse_arguments prefix arg_names option_names)
   set(${prefix}_DEFAULT_ARGS)
   foreach(arg_name ${arg_names})
     set(${prefix}_${arg_name})
-  endforeach(arg_name)
+  endforeach()
   foreach(option ${option_names})
     set(${prefix}_${option} FALSE)
-  endforeach(option)
+  endforeach()
 
   set(current_arg_name DEFAULT_ARGS)
   set(current_arg_list)
@@ -297,18 +297,18 @@ macro(cpack_parse_arguments prefix arg_names option_names)
       set(${prefix}_${current_arg_name} ${current_arg_list})
       set(current_arg_name ${arg})
       set(current_arg_list)
-    else (is_arg_name GREATER -1)
+    else ()
       set(loption_names ${option_names})
       list(FIND loption_names "${arg}" is_option)
       if (is_option GREATER -1)
         set(${prefix}_${arg} TRUE)
-      else (is_option GREATER -1)
+      else ()
         set(current_arg_list ${current_arg_list} ${arg})
-      endif (is_option GREATER -1)
-    endif (is_arg_name GREATER -1)
-  endforeach(arg)
+      endif ()
+    endif ()
+  endforeach()
   set(${prefix}_${current_arg_name} ${current_arg_list})
-endmacro(cpack_parse_arguments)
+endmacro()
 
 # Macro that appends a SET command for the given variable name (var)
 # to the macro named strvar, but only if the variable named "var"
@@ -319,10 +319,10 @@ macro(cpack_append_variable_set_command var strvar)
     set(${strvar} "${${strvar}}set(${var}")
     foreach(APPENDVAL ${${var}})
       set(${strvar} "${${strvar}} ${APPENDVAL}")
-    endforeach(APPENDVAL)
+    endforeach()
     set(${strvar} "${${strvar}})\n")
-  endif (DEFINED ${var})
-endmacro(cpack_append_variable_set_command)
+  endif ()
+endmacro()
 
 # Macro that appends a SET command for the given variable name (var)
 # to the macro named strvar, but only if the variable named "var"
@@ -333,9 +333,9 @@ macro(cpack_append_string_variable_set_command var strvar)
     list(LENGTH ${var} CPACK_APP_VALUE_LEN)
     if(${CPACK_APP_VALUE_LEN} EQUAL 1)
       set(${strvar} "${${strvar}}set(${var} \"${${var}}\")\n")
-    endif(${CPACK_APP_VALUE_LEN} EQUAL 1)
-  endif (DEFINED ${var})
-endmacro(cpack_append_string_variable_set_command)
+    endif()
+  endif ()
+endmacro()
 
 # Macro that appends a SET command for the given variable name (var)
 # to the macro named strvar, but only if the variable named "var"
@@ -346,9 +346,9 @@ macro(cpack_append_option_set_command var strvar)
     list(LENGTH ${var} CPACK_APP_VALUE_LEN)
     if(${CPACK_APP_VALUE_LEN} EQUAL 1)
       set(${strvar} "${${strvar}}set(${var} TRUE)\n")
-    endif(${CPACK_APP_VALUE_LEN} EQUAL 1)
-  endif (${var})
-endmacro(cpack_append_option_set_command)
+    endif()
+  endif ()
+endmacro()
 
 # Macro that adds a component to the CPack installer
 macro(cpack_add_component compname)
@@ -375,10 +375,10 @@ macro(cpack_add_component compname)
       set(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR}\nSET(CPACK_COMPONENTS_ALL")
       foreach(COMP ${CPACK_ADDCOMP_COMPONENTS})
        set(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR} ${COMP}")
-      endforeach(COMP)
+      endforeach()
       set(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR})\n")
-    endif(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
-  endif(NOT CPACK_MONOLITHIC_INSTALL)
+    endif()
+  endif()
 
   cpack_append_string_variable_set_command(
     CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DISPLAY_NAME
@@ -416,8 +416,8 @@ macro(cpack_add_component compname)
   # will be encoded by cpack_encode_variables.
   if(CPack_CMake_INCLUDED)
     file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDCOMP_STR}")
-  endif(CPack_CMake_INCLUDED)
-endmacro(cpack_add_component)
+  endif()
+endmacro()
 
 # Macro that adds a component group to the CPack installer
 macro(cpack_add_component_group grpname)
@@ -447,8 +447,8 @@ macro(cpack_add_component_group grpname)
   # will be encoded by cpack_encode_variables.
   if(CPack_CMake_INCLUDED)
     file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDGRP_STR}")
-  endif(CPack_CMake_INCLUDED)
-endmacro(cpack_add_component_group)
+  endif()
+endmacro()
 
 # Macro that adds an installation type to the CPack installer
 macro(cpack_add_install_type insttype)
@@ -472,8 +472,8 @@ macro(cpack_add_install_type insttype)
   # will be encoded by cpack_encode_variables.
   if(CPack_CMake_INCLUDED)
     file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_INSTTYPE_STR}")
-  endif(CPack_CMake_INCLUDED)
-endmacro(cpack_add_install_type)
+  endif()
+endmacro()
 
 macro(cpack_configure_downloads site)
   cpack_parse_arguments(CPACK_DOWNLOAD
@@ -497,7 +497,7 @@ macro(cpack_configure_downloads site)
     CPACK_CONFIG_DL_STR)
   if (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
     set(CPACK_DOWNLOAD_ADD_REMOVE ON)
-  endif (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
+  endif ()
   set(CPACK_ADD_REMOVE ${CPACK_DOWNLOAD_ADD_REMOVE})
   cpack_append_option_set_command(
     CPACK_ADD_REMOVE
@@ -508,6 +508,6 @@ macro(cpack_configure_downloads site)
   # will be encoded by cpack_encode_variables.
   if(CPack_CMake_INCLUDED)
     file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_CONFIG_DL_STR}")
-  endif(CPack_CMake_INCLUDED)
-endmacro(cpack_configure_downloads)
-endif(NOT CPackComponent_CMake_INCLUDED)
+  endif()
+endmacro()
+endif()
diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake
index 640cf9a0e..106b44c27 100644
--- a/Modules/CPackDeb.cmake
+++ b/Modules/CPackDeb.cmake
@@ -187,22 +187,22 @@
 
 if(CMAKE_BINARY_DIR)
   message(FATAL_ERROR "CPackDeb.cmake may only be used by CPack internally.")
-endif(CMAKE_BINARY_DIR)
+endif()
 
 if(NOT UNIX)
   message(FATAL_ERROR "CPackDeb.cmake may only be used under UNIX.")
-endif(NOT UNIX)
+endif()
 
 # CPACK_DEBIAN_PACKAGE_SHLIBDEPS
 # If specify OFF, only user depends are used
 if(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
   set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF)
-endif(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
+endif()
 
 find_program(FAKEROOT_EXECUTABLE fakeroot)
 if(FAKEROOT_EXECUTABLE)
   set(CPACK_DEBIAN_FAKEROOT_EXECUTABLE ${FAKEROOT_EXECUTABLE})
-endif(FAKEROOT_EXECUTABLE)
+endif()
 
 if(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
   # dpkg-shlibdeps is a Debian utility for generating dependency list
@@ -220,7 +220,7 @@ if(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
     set(SHLIBDEPS_EXECUTABLE_VERSION "${CMAKE_MATCH_1}")
     if(CPACK_DEBIAN_PACKAGE_DEBUG)
       message( "CPackDeb Debug: dpkg-shlibdeps version is <${SHLIBDEPS_EXECUTABLE_VERSION}>")
-    endif(CPACK_DEBIAN_PACKAGE_DEBUG)
+    endif()
 
     # Generating binary list - Get type of all install files
     execute_process(COMMAND find -type f
@@ -260,17 +260,17 @@ if(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
     if(CPACK_DEBIAN_PACKAGE_DEBUG)
       # dpkg-shlibdeps will throw some warnings if some input files are not binary
       message( "CPackDeb Debug: dpkg-shlibdeps warnings \n${SHLIBDEPS_ERROR}")
-    endif(CPACK_DEBIAN_PACKAGE_DEBUG)
+    endif()
     if (NOT SHLIBDEPS_RESULT EQUAL 0)
       message (FATAL_ERROR "CPackDeb: dpkg-shlibdeps: ${SHLIBDEPS_ERROR}")
-    endif (NOT SHLIBDEPS_RESULT EQUAL 0)
+    endif ()
 
     #Get rid of prefix generated by dpkg-shlibdeps
     string (REGEX REPLACE "^.*Depends=" "" CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS ${SHLIBDEPS_OUTPUT})
 
     if(CPACK_DEBIAN_PACKAGE_DEBUG)
       message( "CPackDeb Debug: Found dependency: ${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}")
-    endif(CPACK_DEBIAN_PACKAGE_DEBUG)
+    endif()
 
     # Remove blank control file
     # Might not be safe if package actual contain file or directory named debian
@@ -279,21 +279,21 @@ if(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
     # Append user depend if set
     if (CPACK_DEBIAN_PACKAGE_DEPENDS)
       set (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}, ${CPACK_DEBIAN_PACKAGE_DEPENDS}")
-    else (CPACK_DEBIAN_PACKAGE_DEPENDS)
+    else ()
       set (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}")
-    endif (CPACK_DEBIAN_PACKAGE_DEPENDS)
+    endif ()
 
-  else (SHLIBDEPS_EXECUTABLE)
+  else ()
     if(CPACK_DEBIAN_PACKAGE_DEBUG)
       message( "CPackDeb Debug: Using only user-provided depends because dpkg-shlibdeps is not found.")
-    endif(CPACK_DEBIAN_PACKAGE_DEBUG)
-  endif(SHLIBDEPS_EXECUTABLE)
+    endif()
+  endif()
 
-else (CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
+else ()
   if(CPACK_DEBIAN_PACKAGE_DEBUG)
     message( "CPackDeb Debug: Using only user-provided depends")
-  endif(CPACK_DEBIAN_PACKAGE_DEBUG)
-endif(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
+  endif()
+endif()
 
 # Let's define the control file found in debian package:
 
@@ -305,15 +305,15 @@ endif(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
 # Package: (mandatory)
 if(NOT CPACK_DEBIAN_PACKAGE_NAME)
   string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_DEBIAN_PACKAGE_NAME)
-endif(NOT CPACK_DEBIAN_PACKAGE_NAME)
+endif()
 
 # Version: (mandatory)
 if(NOT CPACK_DEBIAN_PACKAGE_VERSION)
   if(NOT CPACK_PACKAGE_VERSION)
     message(FATAL_ERROR "CPackDeb: Debian package requires a package version")
-  endif(NOT CPACK_PACKAGE_VERSION)
+  endif()
   set(CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
-endif(NOT CPACK_DEBIAN_PACKAGE_VERSION)
+endif()
 
 # Architecture: (mandatory)
 if(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
@@ -323,12 +323,12 @@ if(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
   if(NOT DPKG_CMD)
     message(STATUS "CPackDeb: Can not find dpkg in your path, default to i386.")
     set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386)
-  endif(NOT DPKG_CMD)
+  endif()
   execute_process(COMMAND "${DPKG_CMD}" --print-architecture
     OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
     OUTPUT_STRIP_TRAILING_WHITESPACE
     )
-endif(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
+endif()
 
 # have a look at get_property(result GLOBAL PROPERTY ENABLED_FEATURES),
 # this returns the successful find_package() calls, maybe this can help
@@ -337,33 +337,33 @@ endif(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
 # TODO: automate 'objdump -p | grep NEEDED'
 if(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
   message(STATUS "CPACK_DEBIAN_PACKAGE_DEPENDS not set, the package will have no dependencies.")
-endif(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
+endif()
 
 # Maintainer: (mandatory)
 if(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER)
   if(NOT CPACK_PACKAGE_CONTACT)
     message(FATAL_ERROR "CPackDeb: Debian package requires a maintainer for a package, set CPACK_PACKAGE_CONTACT or CPACK_DEBIAN_PACKAGE_MAINTAINER")
-  endif(NOT CPACK_PACKAGE_CONTACT)
+  endif()
   set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT})
-endif(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER)
+endif()
 
 # Description: (mandatory)
 if(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
   if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
     message(FATAL_ERROR "CPackDeb: Debian package requires a summary for a package, set CPACK_PACKAGE_DESCRIPTION_SUMMARY or CPACK_DEBIAN_PACKAGE_DESCRIPTION")
-  endif(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
+  endif()
   set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
-endif(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
+endif()
 
 # Section: (recommended)
 if(NOT CPACK_DEBIAN_PACKAGE_SECTION)
   set(CPACK_DEBIAN_PACKAGE_SECTION "devel")
-endif(NOT CPACK_DEBIAN_PACKAGE_SECTION)
+endif()
 
 # Priority: (recommended)
 if(NOT CPACK_DEBIAN_PACKAGE_PRIORITY)
   set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
-endif(NOT CPACK_DEBIAN_PACKAGE_PRIORITY )
+endif()
 
 # Recommends:
 # You should set: CPACK_DEBIAN_PACKAGE_RECOMMENDS
@@ -388,11 +388,11 @@ if(CPACK_DEB_PACKAGE_COMPONENT)
   set(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "/${CPACK_DEB_PACKAGE_COMPONENT}")
   set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${CPACK_DEB_PACKAGE_COMPONENT}")
   string(TOLOWER "${CPACK_PACKAGE_NAME}${CPACK_DEB_PACKAGE_COMPONENT_PART_NAME}" CPACK_DEBIAN_PACKAGE_NAME)
-else(CPACK_DEB_PACKAGE_COMPONENT)
+else()
   set(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "")
   set(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "")
   set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
-endif(CPACK_DEB_PACKAGE_COMPONENT)
+endif()
 
 # Print out some debug information if we were asked for that
 if(CPACK_DEBIAN_PACKAGE_DEBUG)
@@ -404,7 +404,7 @@ if(CPACK_DEBIAN_PACKAGE_DEBUG)
    message("CPackDeb:Debug: CPACK_PACKAGE_FILE_NAME           = ${CPACK_PACKAGE_FILE_NAME}")
    message("CPackDeb:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY   = ${CPACK_PACKAGE_INSTALL_DIRECTORY}")
    message("CPackDeb:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
-endif(CPACK_DEBIAN_PACKAGE_DEBUG)
+endif()
 
 # For debian source packages:
 # debian/control
@@ -418,4 +418,4 @@ endif(CPACK_DEBIAN_PACKAGE_DEBUG)
 #  set(CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS
 #    "debhelper (>> 5.0.0), libncurses5-dev, tcl8.4"
 #  )
-#endif(NOT CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS)
+#endif()
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index 66237d88d..066b295ca 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -241,11 +241,11 @@
 
 if(CMAKE_BINARY_DIR)
   message(FATAL_ERROR "CPackRPM.cmake may only be used by CPack internally.")
-endif(CMAKE_BINARY_DIR)
+endif()
 
 if(NOT UNIX)
   message(FATAL_ERROR "CPackRPM.cmake may only be used under UNIX.")
-endif(NOT UNIX)
+endif()
 
 # rpmbuild is the basic command for building RPM package
 # it may be a simple (symbolic) link to rpm command.
@@ -264,12 +264,12 @@ if(RPMBUILD_EXECUTABLE)
          ${_TMP_VERSION})
   if(CPACK_RPM_PACKAGE_DEBUG)
     message("CPackRPM:Debug: rpmbuild version is <${RPMBUILD_EXECUTABLE_VERSION}>")
-  endif(CPACK_RPM_PACKAGE_DEBUG)
-endif(RPMBUILD_EXECUTABLE)
+  endif()
+endif()
 
 if(NOT RPMBUILD_EXECUTABLE)
   message(FATAL_ERROR "RPM package requires rpmbuild executable")
-endif(NOT RPMBUILD_EXECUTABLE)
+endif()
 
 # Display lsb_release output if DEBUG mode enable
 # This will help to diagnose problem with CPackRPM
@@ -284,11 +284,11 @@ if(CPACK_RPM_PACKAGE_DEBUG)
     string(REGEX REPLACE "\n" ", "
            LSB_RELEASE_OUTPUT
            ${_TMP_LSB_RELEASE_OUTPUT})
-  else (LSB_RELEASE_EXECUTABLE)
+  else ()
     set(LSB_RELEASE_OUTPUT "lsb_release not installed/found!")
-  endif(LSB_RELEASE_EXECUTABLE)
+  endif()
   message("CPackRPM:Debug: LSB_RELEASE  = ${LSB_RELEASE_OUTPUT}")
-endif(CPACK_RPM_PACKAGE_DEBUG)
+endif()
 
 # We may use RPM version in the future in order
 # to shut down warning about space in buildtree
@@ -296,7 +296,7 @@ endif(CPACK_RPM_PACKAGE_DEBUG)
 # not checked [yet].
 if(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*")
   message(FATAL_ERROR "${RPMBUILD_EXECUTABLE} can't handle paths with spaces, use a build directory without spaces for building RPMs.")
-endif(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*")
+endif()
 
 # If rpmbuild is found
 # we try to discover alien since we may be on non RPM distro like Debian.
@@ -306,18 +306,18 @@ endif(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*")
 find_program(ALIEN_EXECUTABLE alien)
 if(ALIEN_EXECUTABLE)
   message(STATUS "alien found, we may be on a Debian based distro.")
-endif(ALIEN_EXECUTABLE)
+endif()
 
 # Are we packaging components ?
 if(CPACK_RPM_PACKAGE_COMPONENT)
   set(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "-${CPACK_RPM_PACKAGE_COMPONENT}")
   set(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "/${CPACK_RPM_PACKAGE_COMPONENT}")
   set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${CPACK_RPM_PACKAGE_COMPONENT}")
-else(CPACK_RPM_PACKAGE_COMPONENT)
+else()
   set(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "")
   set(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "")
   set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
-endif(CPACK_RPM_PACKAGE_COMPONENT)
+endif()
 
 #
 # Use user-defined RPM specific variables value
@@ -333,23 +333,23 @@ if(NOT CPACK_RPM_PACKAGE_SUMMARY)
   # if neither var is defined lets use the name as summary
   if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
     string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_SUMMARY)
-  else(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
+  else()
     set(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
-  endif(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
-endif(NOT CPACK_RPM_PACKAGE_SUMMARY)
+  endif()
+endif()
 
 # CPACK_RPM_PACKAGE_NAME (mandatory)
 if(NOT CPACK_RPM_PACKAGE_NAME)
   string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_NAME)
-endif(NOT CPACK_RPM_PACKAGE_NAME)
+endif()
 
 # CPACK_RPM_PACKAGE_VERSION (mandatory)
 if(NOT CPACK_RPM_PACKAGE_VERSION)
   if(NOT CPACK_PACKAGE_VERSION)
     message(FATAL_ERROR "RPM package requires a package version")
-  endif(NOT CPACK_PACKAGE_VERSION)
+  endif()
   set(CPACK_RPM_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
-endif(NOT CPACK_RPM_PACKAGE_VERSION)
+endif()
 # Replace '-' in version with '_'
 # '-' character is  an Illegal RPM version character
 # it is illegal because it is used to separate
@@ -361,10 +361,10 @@ if(CPACK_RPM_PACKAGE_ARCHITECTURE)
   set(TMP_RPM_BUILDARCH "Buildarch: ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
   if(CPACK_RPM_PACKAGE_DEBUG)
     message("CPackRPM:Debug: using user-specified build arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
-  endif(CPACK_RPM_PACKAGE_DEBUG)
-else(CPACK_RPM_PACKAGE_ARCHITECTURE)
+  endif()
+else()
   set(TMP_RPM_BUILDARCH "")
-endif(CPACK_RPM_PACKAGE_ARCHITECTURE)
+endif()
 
 # CPACK_RPM_PACKAGE_RELEASE
 # The RPM release is the numbering of the RPM package ITSELF
@@ -376,26 +376,26 @@ endif(CPACK_RPM_PACKAGE_ARCHITECTURE)
 # If not set, 1 is a good candidate
 if(NOT CPACK_RPM_PACKAGE_RELEASE)
   set(CPACK_RPM_PACKAGE_RELEASE 1)
-endif(NOT CPACK_RPM_PACKAGE_RELEASE)
+endif()
 
 # CPACK_RPM_PACKAGE_LICENSE
 if(NOT CPACK_RPM_PACKAGE_LICENSE)
   set(CPACK_RPM_PACKAGE_LICENSE "unknown")
-endif(NOT CPACK_RPM_PACKAGE_LICENSE)
+endif()
 
 # CPACK_RPM_PACKAGE_GROUP
 if(NOT CPACK_RPM_PACKAGE_GROUP)
   set(CPACK_RPM_PACKAGE_GROUP "unknown")
-endif(NOT CPACK_RPM_PACKAGE_GROUP)
+endif()
 
 # CPACK_RPM_PACKAGE_VENDOR
 if(NOT CPACK_RPM_PACKAGE_VENDOR)
   if(CPACK_PACKAGE_VENDOR)
     set(CPACK_RPM_PACKAGE_VENDOR "${CPACK_PACKAGE_VENDOR}")
-  else(CPACK_PACKAGE_VENDOR)
+  else()
     set(CPACK_RPM_PACKAGE_VENDOR "unknown")
-  endif(CPACK_PACKAGE_VENDOR)
-endif(NOT CPACK_RPM_PACKAGE_VENDOR)
+  endif()
+endif()
 
 # CPACK_RPM_PACKAGE_SOURCE
 # The name of the source tarball in case we generate a source RPM
@@ -410,70 +410,70 @@ endif(NOT CPACK_RPM_PACKAGE_VENDOR)
 if (NOT CPACK_RPM_PACKAGE_DESCRIPTION)
         if (CPACK_PACKAGE_DESCRIPTION_FILE)
                 file(READ ${CPACK_PACKAGE_DESCRIPTION_FILE} CPACK_RPM_PACKAGE_DESCRIPTION)
-        else (CPACK_PACKAGE_DESCRIPTION_FILE)
+        else ()
                 set(CPACK_RPM_PACKAGE_DESCRIPTION "no package description available")
-        endif (CPACK_PACKAGE_DESCRIPTION_FILE)
-endif (NOT CPACK_RPM_PACKAGE_DESCRIPTION)
+        endif ()
+endif ()
 
 # CPACK_RPM_COMPRESSION_TYPE
 #
 if (CPACK_RPM_COMPRESSION_TYPE)
    if(CPACK_RPM_PACKAGE_DEBUG)
      message("CPackRPM:Debug: User Specified RPM compression type: ${CPACK_RPM_COMPRESSION_TYPE}")
-   endif(CPACK_RPM_PACKAGE_DEBUG)
+   endif()
    if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "lzma")
      set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.lzdio")
-   endif(CPACK_RPM_COMPRESSION_TYPE STREQUAL "lzma")
+   endif()
    if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz")
      set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w7.xzdio")
-   endif(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz")
+   endif()
    if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2")
      set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.bzdio")
-   endif(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2")
+   endif()
    if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip")
      set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.gzdio")
-   endif(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip")
-else(CPACK_RPM_COMPRESSION_TYPE)
+   endif()
+else()
    set(CPACK_RPM_COMPRESSION_TYPE_TMP "")
-endif(CPACK_RPM_COMPRESSION_TYPE)
+endif()
 
 if(CPACK_PACKAGE_RELOCATABLE)
   set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE)
-endif(CPACK_PACKAGE_RELOCATABLE)
+endif()
 if(CPACK_RPM_PACKAGE_RELOCATABLE)
   if(CPACK_RPM_PACKAGE_DEBUG)
     message("CPackRPM:Debug: Trying to build a relocatable package")
-  endif(CPACK_RPM_PACKAGE_DEBUG)
+  endif()
   if(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON"))
     message("CPackRPM:Warning: CPACK_SET_DESTDIR is set (=${CPACK_SET_DESTDIR}) while requesting a relocatable package (CPACK_RPM_PACKAGE_RELOCATABLE is set): this is not supported, the package won't be relocatable.")
-  else(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON"))
+  else()
     set(CPACK_RPM_PACKAGE_PREFIX ${CPACK_PACKAGING_INSTALL_PREFIX})
-  endif(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON"))
-endif(CPACK_RPM_PACKAGE_RELOCATABLE)
+  endif()
+endif()
 
 # Check if additional fields for RPM spec header are given
 # There may be some COMPONENT specific variables as well
 foreach(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLICTS AUTOPROV AUTOREQ AUTOREQPROV)
     if(CPACK_RPM_PACKAGE_DEBUG)
       message("CPackRPM:Debug: processing ${_RPM_SPEC_HEADER}")
-    endif(CPACK_RPM_PACKAGE_DEBUG)
+    endif()
     if(CPACK_RPM_PACKAGE_COMPONENT)
         if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER})
             if(CPACK_RPM_PACKAGE_DEBUG)
               message("CPackRPM:Debug: using CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}")
-            endif(CPACK_RPM_PACKAGE_DEBUG)
+            endif()
             set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}})
         else()
             if(CPACK_RPM_PACKAGE_DEBUG)
               message("CPackRPM:Debug: CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER} not defined")
               message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}")
-            endif(CPACK_RPM_PACKAGE_DEBUG)
+            endif()
             set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}})
         endif()
     else()
         if(CPACK_RPM_PACKAGE_DEBUG)
           message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}")
-        endif(CPACK_RPM_PACKAGE_DEBUG)
+        endif()
         set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}})
     endif()
 
@@ -486,13 +486,13 @@ foreach(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLIC
     set(_PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_NAME}${_PACKAGE_HEADER_TAIL}")
     if(CPACK_RPM_PACKAGE_DEBUG)
       message("CPackRPM:Debug: User defined ${_PACKAGE_HEADER_NAME}:\n ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}")
-    endif(CPACK_RPM_PACKAGE_DEBUG)
+    endif()
     set(TMP_RPM_${_RPM_SPEC_HEADER} "${_PACKAGE_HEADER_NAME}: ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}")
-  else(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
+  else()
     # Do not forget to unset previously set header (from previous component)
     unset(TMP_RPM_${_RPM_SPEC_HEADER})
-  endif(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
-endforeach(_RPM_SPEC_HEADER)
+  endif()
+endforeach()
 
 # CPACK_RPM_SPEC_INSTALL_POST
 # May be used to define a RPM post intallation script
@@ -501,9 +501,9 @@ endforeach(_RPM_SPEC_HEADER)
 if(CPACK_RPM_SPEC_INSTALL_POST)
   if(CPACK_RPM_PACKAGE_DEBUG)
     message("CPackRPM:Debug: User defined CPACK_RPM_SPEC_INSTALL_POST = ${CPACK_RPM_SPEC_INSTALL_POST}")
-  endif(CPACK_RPM_PACKAGE_DEBUG)
+  endif()
   set(TMP_RPM_SPEC_INSTALL_POST "%define __spec_install_post ${CPACK_RPM_SPEC_INSTALL_POST}")
-endif(CPACK_RPM_SPEC_INSTALL_POST)
+endif()
 
 # CPACK_RPM_POST_INSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_POST_INSTALL_SCRIPT_FILE)
 # CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_POST_UNINSTALL_SCRIPT_FILE)
@@ -518,39 +518,39 @@ if(CPACK_RPM_PACKAGE_COMPONENT)
   endif()
   if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_UNINSTALL_SCRIPT_FILE)
     set(CPACK_RPM_POST_UNINSTALL_READ_FILE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_UNINSTALL_SCRIPT_FILE})
-  else(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_UNINSTALL_SCRIPT_FILE)
+  else()
     set(CPACK_RPM_POST_UNINSTALL_READ_FILE ${CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE})
-  endif(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_UNINSTALL_SCRIPT_FILE)
-else(CPACK_RPM_PACKAGE_COMPONENT)
+  endif()
+else()
   set(CPACK_RPM_POST_INSTALL_READ_FILE ${CPACK_RPM_POST_INSTALL_SCRIPT_FILE})
   set(CPACK_RPM_POST_UNINSTALL_READ_FILE ${CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE})
-endif(CPACK_RPM_PACKAGE_COMPONENT)
+endif()
 
 # Handle post-install file if it has been specified
 if(CPACK_RPM_POST_INSTALL_READ_FILE)
   if(EXISTS ${CPACK_RPM_POST_INSTALL_READ_FILE})
     file(READ ${CPACK_RPM_POST_INSTALL_READ_FILE} CPACK_RPM_SPEC_POSTINSTALL)
-  else(EXISTS ${CPACK_RPM_POST_INSTALL_READ_FILE})
+  else()
     message("CPackRPM:Warning: CPACK_RPM_POST_INSTALL_SCRIPT_FILE <${CPACK_RPM_POST_INSTALL_READ_FILE}> does not exists - ignoring")
-  endif(EXISTS ${CPACK_RPM_POST_INSTALL_READ_FILE})
-else(CPACK_RPM_POST_INSTALL_READ_FILE)
+  endif()
+else()
   # reset SPEC var value if no post install file has been specified
   # (either globally or component-wise)
   set(CPACK_RPM_SPEC_POSTINSTALL "")
-endif(CPACK_RPM_POST_INSTALL_READ_FILE)
+endif()
 
 # Handle post-uninstall file if it has been specified
 if(CPACK_RPM_POST_UNINSTALL_READ_FILE)
   if(EXISTS ${CPACK_RPM_POST_UNINSTALL_READ_FILE})
     file(READ ${CPACK_RPM_POST_UNINSTALL_READ_FILE} CPACK_RPM_SPEC_POSTUNINSTALL)
-  else(EXISTS ${CPACK_RPM_POST_UNINSTALL_READ_FILE})
+  else()
     message("CPackRPM:Warning: CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE <${CPACK_RPM_POST_UNINSTALL_READ_FILE}> does not exists - ignoring")
-  endif(EXISTS ${CPACK_RPM_POST_UNINSTALL_READ_FILE})
-else(CPACK_RPM_POST_UNINSTALL_READ_FILE)
+  endif()
+else()
   # reset SPEC var value if no post uninstall file has been specified
   # (either globally or component-wise)
   set(CPACK_RPM_SPEC_POSTUNINSTALL "")
-endif(CPACK_RPM_POST_UNINSTALL_READ_FILE)
+endif()
 
 # CPACK_RPM_PRE_INSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_PRE_INSTALL_SCRIPT_FILE)
 # CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_PRE_UNINSTALL_SCRIPT_FILE)
@@ -560,44 +560,44 @@ endif(CPACK_RPM_POST_UNINSTALL_READ_FILE)
 if(CPACK_RPM_PACKAGE_COMPONENT)
   if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE)
     set(CPACK_RPM_PRE_INSTALL_READ_FILE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE})
-  else(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE)
+  else()
     set(CPACK_RPM_PRE_INSTALL_READ_FILE ${CPACK_RPM_PRE_INSTALL_SCRIPT_FILE})
-  endif(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE)
+  endif()
   if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_UNINSTALL_SCRIPT_FILE)
     set(CPACK_RPM_PRE_UNINSTALL_READ_FILE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_UNINSTALL_SCRIPT_FILE})
-  else(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_UNINSTALL_SCRIPT_FILE)
+  else()
     set(CPACK_RPM_PRE_UNINSTALL_READ_FILE ${CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE})
-  endif(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_UNINSTALL_SCRIPT_FILE)
-else(CPACK_RPM_PACKAGE_COMPONENT)
+  endif()
+else()
   set(CPACK_RPM_PRE_INSTALL_READ_FILE ${CPACK_RPM_PRE_INSTALL_SCRIPT_FILE})
   set(CPACK_RPM_PRE_UNINSTALL_READ_FILE ${CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE})
-endif(CPACK_RPM_PACKAGE_COMPONENT)
+endif()
 
 # Handle pre-install file if it has been specified
 if(CPACK_RPM_PRE_INSTALL_READ_FILE)
   if(EXISTS ${CPACK_RPM_PRE_INSTALL_READ_FILE})
     file(READ ${CPACK_RPM_PRE_INSTALL_READ_FILE} CPACK_RPM_SPEC_PREINSTALL)
-  else(EXISTS ${CPACK_RPM_PRE_INSTALL_READ_FILE})
+  else()
     message("CPackRPM:Warning: CPACK_RPM_PRE_INSTALL_SCRIPT_FILE <${CPACK_RPM_PRE_INSTALL_READ_FILE}> does not exists - ignoring")
-  endif(EXISTS ${CPACK_RPM_PRE_INSTALL_READ_FILE})
-else(CPACK_RPM_PRE_INSTALL_READ_FILE)
+  endif()
+else()
   # reset SPEC var value if no pre-install file has been specified
   # (either globally or component-wise)
   set(CPACK_RPM_SPEC_PREINSTALL "")
-endif(CPACK_RPM_PRE_INSTALL_READ_FILE)
+endif()
 
 # Handle pre-uninstall file if it has been specified
 if(CPACK_RPM_PRE_UNINSTALL_READ_FILE)
   if(EXISTS ${CPACK_RPM_PRE_UNINSTALL_READ_FILE})
     file(READ ${CPACK_RPM_PRE_UNINSTALL_READ_FILE} CPACK_RPM_SPEC_PREUNINSTALL)
-  else(EXISTS ${CPACK_RPM_PRE_UNINSTALL_READ_FILE})
+  else()
     message("CPackRPM:Warning: CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE <${CPACK_RPM_PRE_UNINSTALL_READ_FILE}> does not exists - ignoring")
-  endif(EXISTS ${CPACK_RPM_PRE_UNINSTALL_READ_FILE})
-else(CPACK_RPM_PRE_UNINSTALL_READ_FILE)
+  endif()
+else()
   # reset SPEC var value if no pre-uninstall file has been specified
   # (either globally or component-wise)
   set(CPACK_RPM_SPEC_PREUNINSTALL "")
-endif(CPACK_RPM_PRE_UNINSTALL_READ_FILE)
+endif()
 
 # CPACK_RPM_CHANGELOG_FILE
 # May be used to embed a changelog in the spec file.
@@ -605,20 +605,20 @@ endif(CPACK_RPM_PRE_UNINSTALL_READ_FILE)
 if(CPACK_RPM_CHANGELOG_FILE)
   if(EXISTS ${CPACK_RPM_CHANGELOG_FILE})
     file(READ ${CPACK_RPM_CHANGELOG_FILE} CPACK_RPM_SPEC_CHANGELOG)
-  else(EXISTS ${CPACK_RPM_CHANGELOG_FILE})
+  else()
     message(SEND_ERROR "CPackRPM:Warning: CPACK_RPM_CHANGELOG_FILE <${CPACK_RPM_CHANGELOG_FILE}> does not exists - ignoring")
-  endif(EXISTS ${CPACK_RPM_CHANGELOG_FILE})
-else(CPACK_RPM_CHANGELOG_FILE)
+  endif()
+else()
   set(CPACK_RPM_SPEC_CHANGELOG "* Sun Jul 4 2010 Erk <eric.noulard@gmail.com>\n  Generated by CPack RPM (no Changelog file were provided)")
-endif(CPACK_RPM_CHANGELOG_FILE)
+endif()
 
 # CPACK_RPM_SPEC_MORE_DEFINE
 # This is a generated spec rpm file spaceholder
 if(CPACK_RPM_SPEC_MORE_DEFINE)
   if(CPACK_RPM_PACKAGE_DEBUG)
     message("CPackRPM:Debug: User defined more define spec line specified:\n ${CPACK_RPM_SPEC_MORE_DEFINE}")
-  endif(CPACK_RPM_PACKAGE_DEBUG)
-endif(CPACK_RPM_SPEC_MORE_DEFINE)
+  endif()
+endif()
 
 # Now we may create the RPM build tree structure
 set(CPACK_RPM_ROOTDIR "${CPACK_TOPLEVEL_DIRECTORY}")
@@ -683,7 +683,7 @@ if(CPACK_RPM_PACKAGE_COMPONENT)
    if(CPACK_RPM_PACKAGE_DEBUG)
      message("CPackRPM:Debug: Handling Absolute Destination Files: <${CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL}>")
      message("CPackRPM:Debug: in component = ${CPACK_RPM_PACKAGE_COMPONENT}")
-   endif(CPACK_RPM_PACKAGE_DEBUG)
+   endif()
   endif()
 else()
   if(CPACK_ABSOLUTE_DESTINATION_FILES)
@@ -698,7 +698,7 @@ if(CPACK_RPM_PACKAGE_COMPONENT)
     if(CPACK_RPM_PACKAGE_DEBUG)
       message("CPackRPM:Debug: Handling User Filelist: <${CPACK_RPM_USER_FILELIST_INTERNAL}>")
       message("CPackRPM:Debug: in component = ${CPACK_RPM_PACKAGE_COMPONENT}")
-    endif(CPACK_RPM_PACKAGE_DEBUG)
+    endif()
   else()
     set(CPACK_RPM_USER_FILELIST_INTERNAL "")
   endif()
@@ -717,7 +717,7 @@ endif()
 if(CPACK_RPM_USER_FILELIST_INTERNAL)
   if(CPACK_RPM_PACKAGE_DEBUG)
     message("CPackRPM:Debug: Handling User Filelist: <${CPACK_RPM_USER_FILELIST_INTERNAL}>")
-  endif(CPACK_RPM_PACKAGE_DEBUG)
+  endif()
 
   # Create CMake list from CPACK_RPM_INSTALL_FILES
   string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST)
@@ -747,7 +747,7 @@ if(CPACK_RPM_USER_FILELIST_INTERNAL)
   set(CPACK_RPM_INSTALL_FILES "")
   foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST)
     set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}\"${F}\"\n")
-  endforeach(F)
+  endforeach()
 else()
   set(CPACK_RPM_USER_INSTALL_FILES "")
 endif()
@@ -755,7 +755,7 @@ endif()
 if (CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
   if(CPACK_RPM_PACKAGE_DEBUG)
     message("CPackRPM:Debug: Handling Absolute Destination Files: ${CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL}")
-  endif(CPACK_RPM_PACKAGE_DEBUG)
+  endif()
   # Remove trailing space
   string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST)
   # Transform endline separated - string into CMake List
@@ -768,20 +768,20 @@ if (CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
   set(CPACK_RPM_INSTALL_FILES "")
   foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST)
     set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}\"${F}\"\n")
-  endforeach(F)
+  endforeach()
   # Build ABSOLUTE_INSTALL_FILES
   set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "")
   foreach(F IN LISTS CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
     set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "${CPACK_RPM_ABSOLUTE_INSTALL_FILES}%config \"${F}\"\n")
-  endforeach(F)
+  endforeach()
   if(CPACK_RPM_PACKAGE_DEBUG)
     message("CPackRPM:Debug: CPACK_RPM_ABSOLUTE_INSTALL_FILES=${CPACK_RPM_ABSOLUTE_INSTALL_FILES}")
     message("CPackRPM:Debug: CPACK_RPM_INSTALL_FILES=${CPACK_RPM_INSTALL_FILES}")
-  endif(CPACK_RPM_PACKAGE_DEBUG)
+  endif()
 else()
   # reset vars in order to avoid leakage of value(s) from one component to another
   set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "")
-endif(CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
+endif()
 
 # Prepend directories in ${CPACK_RPM_INSTALL_FILES} with %dir
 # This is necessary to avoid duplicate files since rpmbuild do
@@ -799,7 +799,7 @@ foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST)
   else()
     set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}\"${F}\"\n")
   endif()
-endforeach(F)
+endforeach()
 set(CPACK_RPM_INSTALL_FILES_LIST "")
 
 # The name of the final spec file to be used by rpmbuild
@@ -816,7 +816,7 @@ if(CPACK_RPM_PACKAGE_DEBUG)
    message("CPackRPM:Debug: CPACK_RPM_BINARY_SPECFILE         = ${CPACK_RPM_BINARY_SPECFILE}")
    message("CPackRPM:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY   = ${CPACK_PACKAGE_INSTALL_DIRECTORY}")
    message("CPackRPM:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
-endif(CPACK_RPM_PACKAGE_DEBUG)
+endif()
 
 # USER generated spec file handling.
 # We should generate a spec file template:
@@ -900,8 +900,8 @@ ${CPACK_RPM_USER_INSTALL_FILES}
   # to customize their own spec file.
   if(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE)
      message(FATAL_ERROR "CPackRPM: STOP here Generated USER binary spec file templare is: ${CPACK_RPM_BINARY_SPECFILE}.in")
-  endif(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE)
-endif(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE)
+  endif()
+endif()
 
 # After that we may either use a user provided spec file
 # or generate one using appropriate variables value.
@@ -910,12 +910,12 @@ if(CPACK_RPM_USER_BINARY_SPECFILE)
   message("CPackRPM: Will use USER specified spec file: ${CPACK_RPM_USER_BINARY_SPECFILE}")
   # The user provided file is processed for @var replacement
   configure_file(${CPACK_RPM_USER_BINARY_SPECFILE} ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
-else(CPACK_RPM_USER_BINARY_SPECFILE)
+else()
   # No User specified spec file, will use the generated spec file
   message("CPackRPM: Will use GENERATED spec file: ${CPACK_RPM_BINARY_SPECFILE}")
   # Note the just created file is processed for @var replacement
   configure_file(${CPACK_RPM_BINARY_SPECFILE}.in ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
-endif(CPACK_RPM_USER_BINARY_SPECFILE)
+endif()
 
 if(RPMBUILD_EXECUTABLE)
   # Now call rpmbuild using the SPECFILE
@@ -936,9 +936,9 @@ if(RPMBUILD_EXECUTABLE)
     message("CPackRPM:Debug: *** ${RPMBUILDERR} ***")
     message("CPackRPM:Debug:    - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out")
     message("CPackRPM:Debug: *** ${RPMBUILDERR} ***")
-  endif(CPACK_RPM_PACKAGE_DEBUG OR CPACK_RPMBUILD_EXEC_RESULT)
-else(RPMBUILD_EXECUTABLE)
+  endif()
+else()
   if(ALIEN_EXECUTABLE)
     message(FATAL_ERROR "RPM packaging through alien not done (yet)")
-  endif(ALIEN_EXECUTABLE)
-endif(RPMBUILD_EXECUTABLE)
+  endif()
+endif()
diff --git a/Modules/CPackZIP.cmake b/Modules/CPackZIP.cmake
index bf7062a76..a36589bd6 100644
--- a/Modules/CPackZIP.cmake
+++ b/Modules/CPackZIP.cmake
@@ -14,21 +14,21 @@
 
 if(CMAKE_BINARY_DIR)
   message(FATAL_ERROR "CPackZIP.cmake may only be used by CPack internally.")
-endif(CMAKE_BINARY_DIR)
+endif()
 
 find_program(ZIP_EXECUTABLE wzzip PATHS "$ENV{ProgramFiles}/WinZip")
 if(ZIP_EXECUTABLE)
   set(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" -P \"<ARCHIVE>\" @<FILELIST>")
   set(CPACK_ZIP_NEED_QUOTES TRUE)
-endif(ZIP_EXECUTABLE)
+endif()
 
 if(NOT ZIP_EXECUTABLE)
   find_program(ZIP_EXECUTABLE 7z PATHS "$ENV{ProgramFiles}/7-Zip")
   if(ZIP_EXECUTABLE)
     set(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" a -tzip \"<ARCHIVE>\" @<FILELIST>")
   set(CPACK_ZIP_NEED_QUOTES TRUE)
-  endif(ZIP_EXECUTABLE)
-endif(NOT ZIP_EXECUTABLE)
+  endif()
+endif()
 
 if(NOT ZIP_EXECUTABLE)
   find_package(Cygwin)
@@ -36,6 +36,6 @@ if(NOT ZIP_EXECUTABLE)
   if(ZIP_EXECUTABLE)
     set(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" -r \"<ARCHIVE>\" . -i@<FILELIST>")
     set(CPACK_ZIP_NEED_QUOTES FALSE)
-  endif(ZIP_EXECUTABLE)
-endif(NOT ZIP_EXECUTABLE)
+  endif()
+endif()
 
diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake
index 4e861a92a..1e2dd5ca6 100644
--- a/Modules/CTest.cmake
+++ b/Modules/CTest.cmake
@@ -67,31 +67,31 @@ function(GET_VS_VERSION_STRING generator var)
     NUMBER "${generator}")
   if("${generator}" MATCHES "Visual Studio 7 .NET 2003")
     set(ver_string "vs71")
-  else("${generator}" MATCHES "Visual Studio 7 .NET 2003")
+  else()
     set(ver_string "vs${NUMBER}")
-  endif("${generator}" MATCHES "Visual Studio 7 .NET 2003")
+  endif()
   set(${var} ${ver_string} PARENT_SCOPE)
-endfunction(GET_VS_VERSION_STRING)
+endfunction()
 
 if(BUILD_TESTING)
   # Setup some auxilary macros
   macro(SET_IF_NOT_SET var val)
     if(NOT DEFINED "${var}")
       set("${var}" "${val}")
-    endif(NOT DEFINED "${var}")
-  endmacro(SET_IF_NOT_SET)
+    endif()
+  endmacro()
 
   macro(SET_IF_SET var val)
     if(NOT "${val}" MATCHES "^$")
       set("${var}" "${val}")
-    endif(NOT "${val}" MATCHES "^$")
-  endmacro(SET_IF_SET)
+    endif()
+  endmacro()
 
   macro(SET_IF_SET_AND_NOT_SET var val)
     if(NOT "${val}" MATCHES "^$")
       SET_IF_NOT_SET("${var}" "${val}")
-    endif(NOT "${val}" MATCHES "^$")
-  endmacro(SET_IF_SET_AND_NOT_SET)
+    endif()
+  endmacro()
 
   # Make sure testing is enabled
   enable_testing()
@@ -107,18 +107,18 @@ if(BUILD_TESTING)
     SET_IF_SET_AND_NOT_SET(DROP_LOCATION "${CTEST_DROP_LOCATION}")
     SET_IF_SET_AND_NOT_SET(TRIGGER_SITE "${CTEST_TRIGGER_SITE}")
     SET_IF_SET_AND_NOT_SET(UPDATE_TYPE "${CTEST_UPDATE_TYPE}")
-  endif(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake")
+  endif()
 
   # the project can have a DartConfig.cmake file
   if(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake")
     include("${PROJECT_SOURCE_DIR}/DartConfig.cmake")
-  else(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake")
+  else()
     # Dashboard is opened for submissions for a 24 hour period starting at
     # the specified NIGHTLY_START_TIME. Time is specified in 24 hour format.
     SET_IF_NOT_SET (NIGHTLY_START_TIME "00:00:00 EDT")
     SET_IF_NOT_SET(DROP_METHOD "http")
     SET_IF_NOT_SET (COMPRESS_SUBMISSION ON)
-  endif(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake")
+  endif()
   SET_IF_NOT_SET (NIGHTLY_START_TIME "00:00:00 EDT")
 
   find_program(CVSCOMMAND cvs )
@@ -141,7 +141,7 @@ if(BUILD_TESTING)
     elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
       set(UPDATE_TYPE git)
     endif()
-  endif(NOT UPDATE_TYPE)
+  endif()
 
   string(TOLOWER "${UPDATE_TYPE}" _update_type)
   if("${_update_type}" STREQUAL "cvs")
@@ -199,36 +199,36 @@ if(BUILD_TESTING)
     set(DART_COMPILER "${CMAKE_CXX_COMPILER}")
     if(NOT DART_COMPILER)
       set(DART_COMPILER "${CMAKE_C_COMPILER}")
-    endif(NOT DART_COMPILER)
+    endif()
     if(NOT DART_COMPILER)
       set(DART_COMPILER "unknown")
-    endif(NOT DART_COMPILER)
+    endif()
     if(WIN32)
       set(DART_NAME_COMPONENT "NAME_WE")
-    else(WIN32)
+    else()
       set(DART_NAME_COMPONENT "NAME")
-    endif(WIN32)
+    endif()
     if(NOT BUILD_NAME_SYSTEM_NAME)
       set(BUILD_NAME_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}")
-    endif(NOT BUILD_NAME_SYSTEM_NAME)
+    endif()
     if(WIN32)
       set(BUILD_NAME_SYSTEM_NAME "Win32")
-    endif(WIN32)
+    endif()
     if(UNIX OR BORLAND)
       get_filename_component(DART_CXX_NAME
         "${CMAKE_CXX_COMPILER}" ${DART_NAME_COMPONENT})
-    else(UNIX OR BORLAND)
+    else()
       get_filename_component(DART_CXX_NAME
         "${CMAKE_BUILD_TOOL}" ${DART_NAME_COMPONENT})
-    endif(UNIX OR BORLAND)
+    endif()
     if(DART_CXX_NAME MATCHES "msdev")
       set(DART_CXX_NAME "vs60")
-    endif(DART_CXX_NAME MATCHES "msdev")
+    endif()
     if(DART_CXX_NAME MATCHES "devenv")
       GET_VS_VERSION_STRING("${CMAKE_GENERATOR}" DART_CXX_NAME)
-    endif(DART_CXX_NAME MATCHES "devenv")
+    endif()
     set(BUILDNAME "${BUILD_NAME_SYSTEM_NAME}-${DART_CXX_NAME}")
-  endif(NOT BUILDNAME)
+  endif()
 
   # the build command
   build_command(MAKECOMMAND_DEFAULT_VALUE
@@ -241,11 +241,11 @@ if(BUILD_TESTING)
   set(DEFAULT_CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}")
   if(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "")
     set(DEFAULT_CTEST_CONFIGURATION_TYPE "Release")
-  endif(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "")
+  endif()
 
   if(NOT "${CMAKE_GENERATOR}" MATCHES "Make")
     set(CTEST_USE_LAUNCHERS 0)
-  endif(NOT "${CMAKE_GENERATOR}" MATCHES "Make")
+  endif()
   if(CTEST_USE_LAUNCHERS)
     set(CTEST_LAUNCH_COMPILE "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OBJECT> --source <SOURCE> --language <LANGUAGE> --")
     set(CTEST_LAUNCH_LINK    "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <TARGET> --target-type <TARGET_TYPE> --language <LANGUAGE> --")
@@ -253,7 +253,7 @@ if(BUILD_TESTING)
     set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CTEST_LAUNCH_COMPILE}")
     set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CTEST_LAUNCH_LINK}")
     set_property(GLOBAL PROPERTY RULE_LAUNCH_CUSTOM "${CTEST_LAUNCH_CUSTOM}")
-  endif(CTEST_USE_LAUNCHERS)
+  endif()
 
   mark_as_advanced(
     BZRCOMMAND
@@ -282,5 +282,5 @@ if(BUILD_TESTING)
     set(RUN_FROM_CTEST_OR_DART 1)
     include(CTestTargets)
     set(RUN_FROM_CTEST_OR_DART)
-  endif(NOT RUN_FROM_DART)
-endif(BUILD_TESTING)
+  endif()
+endif()
diff --git a/Modules/CTestTargets.cmake b/Modules/CTestTargets.cmake
index 15be42dac..fd4bd8024 100644
--- a/Modules/CTestTargets.cmake
+++ b/Modules/CTestTargets.cmake
@@ -14,7 +14,7 @@
 
 if(NOT RUN_FROM_CTEST_OR_DART)
   message(FATAL_ERROR "Do not incldue CTestTargets.cmake directly")
-endif(NOT RUN_FROM_CTEST_OR_DART)
+endif()
 
 # make directories in the binary tree
 file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/Testing/Temporary)
@@ -30,11 +30,11 @@ if(CTEST_NEW_FORMAT)
   configure_file(
     ${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in
     ${PROJECT_BINARY_DIR}/CTestConfiguration.ini )
-else(CTEST_NEW_FORMAT)
+else()
   configure_file(
     ${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in
     ${PROJECT_BINARY_DIR}/DartConfiguration.tcl )
-endif(CTEST_NEW_FORMAT)
+endif()
 
 #
 # Section 3:
@@ -47,7 +47,7 @@ set(__conf_types "")
 if(CMAKE_CONFIGURATION_TYPES)
   # We need to pass the configuration type on the test command line.
   set(__conf_types -C "${CMAKE_CFG_INTDIR}")
-endif(CMAKE_CONFIGURATION_TYPES)
+endif()
 
 # Add convenience targets.  Do this at most once in case of nested
 # projects.
@@ -66,7 +66,7 @@ if(NOT _CTEST_TARGETS_ADDED)
       )
     set_property(TARGET ${mode} PROPERTY RULE_LAUNCH_CUSTOM "")
     set_property(TARGET ${mode} PROPERTY FOLDER "CTestDashboardTargets")
-  endforeach(mode)
+  endforeach()
 
   # For Makefile generators add more granular targets.
   if("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)")
@@ -81,9 +81,9 @@ if(NOT _CTEST_TARGETS_ADDED)
           )
         set_property(TARGET ${mode}${testtype} PROPERTY RULE_LAUNCH_CUSTOM "")
         set_property(TARGET ${mode}${testtype} PROPERTY FOLDER "CTestDashboardTargets")
-      endforeach(testtype)
-    endforeach(mode)
-  endif("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)")
+      endforeach()
+    endforeach()
+  endif()
 
   # If requested, add an alias that is the equivalent of the built-in "test"
   # or "RUN_TESTS" target:
@@ -92,4 +92,4 @@ if(NOT _CTEST_TARGETS_ADDED)
       ${CMAKE_CTEST_COMMAND} ${__conf_types}
       )
   endif()
-endif(NOT _CTEST_TARGETS_ADDED)
+endif()
diff --git a/Modules/CheckCCompilerFlag.cmake b/Modules/CheckCCompilerFlag.cmake
index 2f54e392d..08e80f756 100644
--- a/Modules/CheckCCompilerFlag.cmake
+++ b/Modules/CheckCCompilerFlag.cmake
@@ -42,4 +42,4 @@ macro (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
      FAIL_REGEX "WARNING: unknown flag:"                    # Open64
      )
    set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
-endmacro (CHECK_C_COMPILER_FLAG)
+endmacro ()
diff --git a/Modules/CheckCSourceCompiles.cmake b/Modules/CheckCSourceCompiles.cmake
index 3c6e6a9fb..b4577544e 100644
--- a/Modules/CheckCSourceCompiles.cmake
+++ b/Modules/CheckCSourceCompiles.cmake
@@ -47,15 +47,15 @@ macro(CHECK_C_SOURCE_COMPILES SOURCE VAR)
       CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
       set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
         "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
-    else(CMAKE_REQUIRED_LIBRARIES)
+    else()
       set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
-    endif(CMAKE_REQUIRED_LIBRARIES)
+    endif()
     if(CMAKE_REQUIRED_INCLUDES)
       set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
         "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
-    else(CMAKE_REQUIRED_INCLUDES)
+    else()
       set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
-    endif(CMAKE_REQUIRED_INCLUDES)
+    endif()
     file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
       "${SOURCE}\n")
 
@@ -82,14 +82,14 @@ macro(CHECK_C_SOURCE_COMPILES SOURCE VAR)
         "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
         "${OUTPUT}\n"
         "Source file was:\n${SOURCE}\n")
-    else(${VAR})
+    else()
       message(STATUS "Performing Test ${VAR} - Failed")
       set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
         "${OUTPUT}\n"
         "Source file was:\n${SOURCE}\n")
-    endif(${VAR})
-  endif("${VAR}" MATCHES "^${VAR}$")
-endmacro(CHECK_C_SOURCE_COMPILES)
+    endif()
+  endif()
+endmacro()
 
diff --git a/Modules/CheckCSourceRuns.cmake b/Modules/CheckCSourceRuns.cmake
index a8fb554aa..bc64acd31 100644
--- a/Modules/CheckCSourceRuns.cmake
+++ b/Modules/CheckCSourceRuns.cmake
@@ -36,15 +36,15 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
       CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
       set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
         "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
-    else(CMAKE_REQUIRED_LIBRARIES)
+    else()
       set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
-    endif(CMAKE_REQUIRED_LIBRARIES)
+    endif()
     if(CMAKE_REQUIRED_INCLUDES)
       set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
         "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
-    else(CMAKE_REQUIRED_INCLUDES)
+    else()
       set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
-    endif(CMAKE_REQUIRED_INCLUDES)
+    endif()
     file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
       "${SOURCE}\n")
 
@@ -61,7 +61,7 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
     # if it did not compile make the return value fail code of 1
     if(NOT ${VAR}_COMPILED)
       set(${VAR}_EXITCODE 1)
-    endif(NOT ${VAR}_COMPILED)
+    endif()
     # if the return value was 0 then it worked
     if("${${VAR}_EXITCODE}" EQUAL 0)
       set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
@@ -71,12 +71,12 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
         "${OUTPUT}\n"
         "Return value: ${${VAR}}\n"
         "Source file was:\n${SOURCE}\n")
-    else("${${VAR}_EXITCODE}" EQUAL 0)
+    else()
       if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
         set(${VAR} "${${VAR}_EXITCODE}")
-      else(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+      else()
         set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
-      endif(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+      endif()
 
       message(STATUS "Performing Test ${VAR} - Failed")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
@@ -85,7 +85,7 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
         "Return value: ${${VAR}_EXITCODE}\n"
         "Source file was:\n${SOURCE}\n")
 
-    endif("${${VAR}_EXITCODE}" EQUAL 0)
-  endif("${VAR}" MATCHES "^${VAR}$")
-endmacro(CHECK_C_SOURCE_RUNS)
+    endif()
+  endif()
+endmacro()
 
diff --git a/Modules/CheckCXXCompilerFlag.cmake b/Modules/CheckCXXCompilerFlag.cmake
index 7e763f7fd..662640340 100644
--- a/Modules/CheckCXXCompilerFlag.cmake
+++ b/Modules/CheckCXXCompilerFlag.cmake
@@ -44,5 +44,5 @@ macro (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
      FAIL_REGEX "WARNING: unknown flag:"                    # Open64
      )
    set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
-endmacro (CHECK_CXX_COMPILER_FLAG)
+endmacro ()
 
diff --git a/Modules/CheckCXXSourceCompiles.cmake b/Modules/CheckCXXSourceCompiles.cmake
index d13142362..c0be1f784 100644
--- a/Modules/CheckCXXSourceCompiles.cmake
+++ b/Modules/CheckCXXSourceCompiles.cmake
@@ -48,15 +48,15 @@ macro(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
       CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
       set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
         "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
-    else(CMAKE_REQUIRED_LIBRARIES)
+    else()
       set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
-    endif(CMAKE_REQUIRED_LIBRARIES)
+    endif()
     if(CMAKE_REQUIRED_INCLUDES)
       set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES
         "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
-    else(CMAKE_REQUIRED_INCLUDES)
+    else()
       set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES)
-    endif(CMAKE_REQUIRED_INCLUDES)
+    endif()
     file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
       "${SOURCE}\n")
 
@@ -83,14 +83,14 @@ macro(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
         "Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n"
         "${OUTPUT}\n"
         "Source file was:\n${SOURCE}\n")
-    else(${VAR})
+    else()
       message(STATUS "Performing Test ${VAR} - Failed")
       set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
         "${OUTPUT}\n"
         "Source file was:\n${SOURCE}\n")
-    endif(${VAR})
-  endif("${VAR}" MATCHES "^${VAR}$")
-endmacro(CHECK_CXX_SOURCE_COMPILES)
+    endif()
+  endif()
+endmacro()
 
diff --git a/Modules/CheckCXXSourceRuns.cmake b/Modules/CheckCXXSourceRuns.cmake
index 515951741..47ab1614b 100644
--- a/Modules/CheckCXXSourceRuns.cmake
+++ b/Modules/CheckCXXSourceRuns.cmake
@@ -36,15 +36,15 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
       CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
       set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
         "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
-    else(CMAKE_REQUIRED_LIBRARIES)
+    else()
       set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
-    endif(CMAKE_REQUIRED_LIBRARIES)
+    endif()
     if(CMAKE_REQUIRED_INCLUDES)
       set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES
         "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
-    else(CMAKE_REQUIRED_INCLUDES)
+    else()
       set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES)
-    endif(CMAKE_REQUIRED_INCLUDES)
+    endif()
     file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
       "${SOURCE}\n")
 
@@ -62,7 +62,7 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
     # if it did not compile make the return value fail code of 1
     if(NOT ${VAR}_COMPILED)
       set(${VAR}_EXITCODE 1)
-    endif(NOT ${VAR}_COMPILED)
+    endif()
     # if the return value was 0 then it worked
     if("${${VAR}_EXITCODE}" EQUAL 0)
       set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
@@ -72,12 +72,12 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
         "${OUTPUT}\n"
         "Return value: ${${VAR}}\n"
         "Source file was:\n${SOURCE}\n")
-    else("${${VAR}_EXITCODE}" EQUAL 0)
+    else()
       if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
         set(${VAR} "${${VAR}_EXITCODE}")
-      else(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+      else()
         set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
-      endif(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+      endif()
 
       message(STATUS "Performing Test ${VAR} - Failed")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
@@ -85,7 +85,7 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
         "${OUTPUT}\n"
         "Return value: ${${VAR}_EXITCODE}\n"
         "Source file was:\n${SOURCE}\n")
-    endif("${${VAR}_EXITCODE}" EQUAL 0)
-  endif("${VAR}" MATCHES "^${VAR}$")
-endmacro(CHECK_CXX_SOURCE_RUNS)
+    endif()
+  endif()
+endmacro()
 
diff --git a/Modules/CheckCXXSymbolExists.cmake b/Modules/CheckCXXSymbolExists.cmake
index ebb3a92d8..210097378 100644
--- a/Modules/CheckCXXSymbolExists.cmake
+++ b/Modules/CheckCXXSymbolExists.cmake
@@ -39,4 +39,4 @@ include(CheckSymbolExists)
 
 macro(CHECK_CXX_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
   _CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.cxx" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
-endmacro(CHECK_CXX_SYMBOL_EXISTS)
+endmacro()
diff --git a/Modules/CheckFortranFunctionExists.cmake b/Modules/CheckFortranFunctionExists.cmake
index 0ccf64a5e..4b9f9b70d 100644
--- a/Modules/CheckFortranFunctionExists.cmake
+++ b/Modules/CheckFortranFunctionExists.cmake
@@ -33,9 +33,9 @@ macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE)
       cmake_expand_imported_targets(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
       set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
         "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
-    else(CMAKE_REQUIRED_LIBRARIES)
+    else()
       set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
-    endif(CMAKE_REQUIRED_LIBRARIES)
+    endif()
     file(WRITE
     ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f
     "
@@ -58,12 +58,12 @@ macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE)
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if the Fortran ${FUNCTION} exists passed with the following output:\n"
         "${OUTPUT}\n\n")
-    else(${VARIABLE})
+    else()
       message(STATUS "Looking for Fortran ${FUNCTION} - not found")
       set(${VARIABLE} "" CACHE INTERNAL "Have Fortran function ${FUNCTION}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if the Fortran ${FUNCTION} exists failed with the following output:\n"
         "${OUTPUT}\n\n")
-    endif(${VARIABLE})
-  endif(NOT DEFINED ${VARIABLE})
-endmacro(CHECK_FORTRAN_FUNCTION_EXISTS)
+    endif()
+  endif()
+endmacro()
diff --git a/Modules/CheckFunctionExists.cmake b/Modules/CheckFunctionExists.cmake
index b9c0f26f8..3f952e0ec 100644
--- a/Modules/CheckFunctionExists.cmake
+++ b/Modules/CheckFunctionExists.cmake
@@ -40,15 +40,15 @@ macro(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
       CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
       set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
         "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
-    else(CMAKE_REQUIRED_LIBRARIES)
+    else()
       set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
-    endif(CMAKE_REQUIRED_LIBRARIES)
+    endif()
     if(CMAKE_REQUIRED_INCLUDES)
       set(CHECK_FUNCTION_EXISTS_ADD_INCLUDES
         "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
-    else(CMAKE_REQUIRED_INCLUDES)
+    else()
       set(CHECK_FUNCTION_EXISTS_ADD_INCLUDES)
-    endif(CMAKE_REQUIRED_INCLUDES)
+    endif()
     try_compile(${VARIABLE}
       ${CMAKE_BINARY_DIR}
       ${CMAKE_ROOT}/Modules/CheckFunctionExists.c
@@ -63,12 +63,12 @@ macro(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if the function ${FUNCTION} exists passed with the following output:\n"
         "${OUTPUT}\n\n")
-    else(${VARIABLE})
+    else()
       message(STATUS "Looking for ${FUNCTION} - not found")
       set(${VARIABLE} "" CACHE INTERNAL "Have function ${FUNCTION}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if the function ${FUNCTION} exists failed with the following output:\n"
         "${OUTPUT}\n\n")
-    endif(${VARIABLE})
-  endif("${VARIABLE}" MATCHES "^${VARIABLE}$")
-endmacro(CHECK_FUNCTION_EXISTS)
+    endif()
+  endif()
+endmacro()
diff --git a/Modules/CheckIncludeFile.cmake b/Modules/CheckIncludeFile.cmake
index 07d4966b9..8067e65ce 100644
--- a/Modules/CheckIncludeFile.cmake
+++ b/Modules/CheckIncludeFile.cmake
@@ -32,9 +32,9 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
   if("${VARIABLE}" MATCHES "^${VARIABLE}$")
     if(CMAKE_REQUIRED_INCLUDES)
       set(CHECK_INCLUDE_FILE_C_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}")
-    else(CMAKE_REQUIRED_INCLUDES)
+    else()
       set(CHECK_INCLUDE_FILE_C_INCLUDE_DIRS)
-    endif(CMAKE_REQUIRED_INCLUDES)
+    endif()
     set(MACRO_CHECK_INCLUDE_FILE_FLAGS ${CMAKE_REQUIRED_FLAGS})
     set(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
     configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in
@@ -43,7 +43,7 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
     if(${ARGC} EQUAL 3)
       set(CMAKE_C_FLAGS_SAVE ${CMAKE_C_FLAGS})
       set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARGV2}")
-    endif(${ARGC} EQUAL 3)
+    endif()
 
     try_compile(${VARIABLE}
       ${CMAKE_BINARY_DIR}
@@ -56,7 +56,7 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
 
     if(${ARGC} EQUAL 3)
       set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS_SAVE})
-    endif(${ARGC} EQUAL 3)
+    endif()
 
     if(${VARIABLE})
       message(STATUS "Looking for ${INCLUDE} - found")
@@ -65,13 +65,13 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
         "Determining if the include file ${INCLUDE} "
         "exists passed with the following output:\n"
         "${OUTPUT}\n\n")
-    else(${VARIABLE})
+    else()
       message(STATUS "Looking for ${INCLUDE} - not found")
       set(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if the include file ${INCLUDE} "
         "exists failed with the following output:\n"
         "${OUTPUT}\n\n")
-    endif(${VARIABLE})
-  endif("${VARIABLE}" MATCHES "^${VARIABLE}$")
-endmacro(CHECK_INCLUDE_FILE)
+    endif()
+  endif()
+endmacro()
diff --git a/Modules/CheckIncludeFileCXX.cmake b/Modules/CheckIncludeFileCXX.cmake
index adc39f3cd..22c2d1ac7 100644
--- a/Modules/CheckIncludeFileCXX.cmake
+++ b/Modules/CheckIncludeFileCXX.cmake
@@ -32,9 +32,9 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
   if("${VARIABLE}" MATCHES "^${VARIABLE}$")
     if(CMAKE_REQUIRED_INCLUDES)
       set(CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}")
-    else(CMAKE_REQUIRED_INCLUDES)
+    else()
       set(CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS)
-    endif(CMAKE_REQUIRED_INCLUDES)
+    endif()
     set(MACRO_CHECK_INCLUDE_FILE_FLAGS ${CMAKE_REQUIRED_FLAGS})
     set(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
     configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
@@ -43,7 +43,7 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
     if(${ARGC} EQUAL 3)
       set(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS})
       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARGV2}")
-    endif(${ARGC} EQUAL 3)
+    endif()
 
     try_compile(${VARIABLE}
       ${CMAKE_BINARY_DIR}
@@ -56,7 +56,7 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
 
     if(${ARGC} EQUAL 3)
       set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_SAVE})
-    endif(${ARGC} EQUAL 3)
+    endif()
 
     if(${VARIABLE})
       message(STATUS "Looking for C++ include ${INCLUDE} - found")
@@ -65,13 +65,13 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
         "Determining if the include file ${INCLUDE} "
         "exists passed with the following output:\n"
         "${OUTPUT}\n\n")
-    else(${VARIABLE})
+    else()
       message(STATUS "Looking for C++ include ${INCLUDE} - not found")
       set(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if the include file ${INCLUDE} "
         "exists failed with the following output:\n"
         "${OUTPUT}\n\n")
-    endif(${VARIABLE})
-  endif("${VARIABLE}" MATCHES "^${VARIABLE}$")
-endmacro(CHECK_INCLUDE_FILE_CXX)
+    endif()
+  endif()
+endmacro()
diff --git a/Modules/CheckIncludeFiles.cmake b/Modules/CheckIncludeFiles.cmake
index 02e3aac2e..70ab9be5b 100644
--- a/Modules/CheckIncludeFiles.cmake
+++ b/Modules/CheckIncludeFiles.cmake
@@ -30,15 +30,15 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
     set(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n")
     if(CMAKE_REQUIRED_INCLUDES)
       set(CHECK_INCLUDE_FILES_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}")
-    else(CMAKE_REQUIRED_INCLUDES)
+    else()
       set(CHECK_INCLUDE_FILES_INCLUDE_DIRS)
-    endif(CMAKE_REQUIRED_INCLUDES)
+    endif()
     set(CHECK_INCLUDE_FILES_CONTENT "/* */\n")
     set(MACRO_CHECK_INCLUDE_FILES_FLAGS ${CMAKE_REQUIRED_FLAGS})
     foreach(FILE ${INCLUDE})
       set(CMAKE_CONFIGURABLE_FILE_CONTENT
         "${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n")
-    endforeach(FILE)
+    endforeach()
     set(CMAKE_CONFIGURABLE_FILE_CONTENT
       "${CMAKE_CONFIGURABLE_FILE_CONTENT}\n\nint main(){return 0;}\n")
     configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
@@ -70,13 +70,13 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
         "Determining if files ${INCLUDE} "
         "exist passed with the following output:\n"
         "${OUTPUT}\n\n")
-    else(${VARIABLE})
+    else()
       message(STATUS "Looking for ${_description} - not found.")
       set(${VARIABLE} "" CACHE INTERNAL "Have includes ${INCLUDE}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if files ${INCLUDE} "
         "exist failed with the following output:\n"
         "${OUTPUT}\nSource:\n${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
-    endif(${VARIABLE})
-  endif("${VARIABLE}" MATCHES "^${VARIABLE}$")
-endmacro(CHECK_INCLUDE_FILES)
+    endif()
+  endif()
+endmacro()
diff --git a/Modules/CheckLibraryExists.cmake b/Modules/CheckLibraryExists.cmake
index 447e97d75..697f8a4dc 100644
--- a/Modules/CheckLibraryExists.cmake
+++ b/Modules/CheckLibraryExists.cmake
@@ -40,7 +40,7 @@ macro(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
       CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
       set(CHECK_LIBRARY_EXISTS_LIBRARIES
         ${CHECK_LIBRARY_EXISTS_LIBRARIES} ${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES})
-    endif(CMAKE_REQUIRED_LIBRARIES)
+    endif()
     try_compile(${VARIABLE}
       ${CMAKE_BINARY_DIR}
       ${CMAKE_ROOT}/Modules/CheckFunctionExists.c
@@ -58,13 +58,13 @@ macro(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
         "Determining if the function ${FUNCTION} exists in the ${LIBRARY} "
         "passed with the following output:\n"
         "${OUTPUT}\n\n")
-    else(${VARIABLE})
+    else()
       message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - not found")
       set(${VARIABLE} "" CACHE INTERNAL "Have library ${LIBRARY}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if the function ${FUNCTION} exists in the ${LIBRARY} "
         "failed with the following output:\n"
         "${OUTPUT}\n\n")
-    endif(${VARIABLE})
-  endif("${VARIABLE}" MATCHES "^${VARIABLE}$")
-endmacro(CHECK_LIBRARY_EXISTS)
+    endif()
+  endif()
+endmacro()
diff --git a/Modules/CheckPrototypeDefinition.cmake b/Modules/CheckPrototypeDefinition.cmake
index 63d424237..74b94b86f 100644
--- a/Modules/CheckPrototypeDefinition.cmake
+++ b/Modules/CheckPrototypeDefinition.cmake
@@ -50,20 +50,20 @@ function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIAB
       cmake_expand_imported_targets(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
       set(CHECK_PROTOTYPE_DEFINITION_LIBS
         "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
-    else(CMAKE_REQUIRED_LIBRARIES)
+    else()
       set(CHECK_PROTOTYPE_DEFINITION_LIBS)
-    endif(CMAKE_REQUIRED_LIBRARIES)
+    endif()
     if (CMAKE_REQUIRED_INCLUDES)
       set(CMAKE_SYMBOL_EXISTS_INCLUDES
         "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
-    else(CMAKE_REQUIRED_INCLUDES)
+    else()
       set(CMAKE_SYMBOL_EXISTS_INCLUDES)
-    endif(CMAKE_REQUIRED_INCLUDES)
+    endif()
 
     foreach(_FILE ${_HEADER})
       set(CHECK_PROTOTYPE_DEFINITION_HEADER
         "${CHECK_PROTOTYPE_DEFINITION_HEADER}#include <${_FILE}>\n")
-    endforeach(_FILE)
+    endforeach()
 
     set(CHECK_PROTOTYPE_DEFINITION_SYMBOL ${_FUNCTION})
     set(CHECK_PROTOTYPE_DEFINITION_PROTO ${_PROTOTYPE})
@@ -89,13 +89,13 @@ function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIAB
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} passed with the following output:\n"
         "${OUTPUT}\n\n")
-    else (${_VARIABLE})
+    else ()
       message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - False")
       set(${_VARIABLE} 0 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} failed with the following output:\n"
         "${OUTPUT}\n\n${_SOURCE}\n\n")
-    endif (${_VARIABLE})
-  endif("${_VARIABLE}" MATCHES "^${_VARIABLE}$")
+    endif ()
+  endif()
 
-endfunction(CHECK_PROTOTYPE_DEFINITION)
+endfunction()
diff --git a/Modules/CheckStructHasMember.cmake b/Modules/CheckStructHasMember.cmake
index fb9703ea2..ea2891c8b 100644
--- a/Modules/CheckStructHasMember.cmake
+++ b/Modules/CheckStructHasMember.cmake
@@ -34,7 +34,7 @@ macro (CHECK_STRUCT_HAS_MEMBER _STRUCT _MEMBER _HEADER _RESULT)
    set(_INCLUDE_FILES)
    foreach (it ${_HEADER})
       set(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n")
-   endforeach (it)
+   endforeach ()
 
    set(_CHECK_STRUCT_MEMBER_SOURCE_CODE "
 ${_INCLUDE_FILES}
@@ -47,5 +47,5 @@ int main()
 ")
    CHECK_C_SOURCE_COMPILES("${_CHECK_STRUCT_MEMBER_SOURCE_CODE}" ${_RESULT})
 
-endmacro (CHECK_STRUCT_HAS_MEMBER)
+endmacro ()
 
diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake
index c843c31e2..59b9942d6 100644
--- a/Modules/CheckSymbolExists.cmake
+++ b/Modules/CheckSymbolExists.cmake
@@ -40,7 +40,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
 
 macro(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
   _CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.c" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
-endmacro(CHECK_SYMBOL_EXISTS)
+endmacro()
 
 macro(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
   if("${VARIABLE}" MATCHES "^${VARIABLE}$")
@@ -51,19 +51,19 @@ macro(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
       CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
       set(CHECK_SYMBOL_EXISTS_LIBS
         "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
-    else(CMAKE_REQUIRED_LIBRARIES)
+    else()
       set(CHECK_SYMBOL_EXISTS_LIBS)
-    endif(CMAKE_REQUIRED_LIBRARIES)
+    endif()
     if(CMAKE_REQUIRED_INCLUDES)
       set(CMAKE_SYMBOL_EXISTS_INCLUDES
         "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
-    else(CMAKE_REQUIRED_INCLUDES)
+    else()
       set(CMAKE_SYMBOL_EXISTS_INCLUDES)
-    endif(CMAKE_REQUIRED_INCLUDES)
+    endif()
     foreach(FILE ${FILES})
       set(CMAKE_CONFIGURABLE_FILE_CONTENT
         "${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n")
-    endforeach(FILE)
+    endforeach()
     set(CMAKE_CONFIGURABLE_FILE_CONTENT
       "${CMAKE_CONFIGURABLE_FILE_CONTENT}\nint main(int argc, char** argv)\n{\n  (void)argv;\n#ifndef ${SYMBOL}\n  return ((int*)(&${SYMBOL}))[argc];\n#else\n  (void)argc;\n  return 0;\n#endif\n}\n")
 
@@ -88,7 +88,7 @@ macro(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
         "exist passed with the following output:\n"
         "${OUTPUT}\nFile ${SOURCEFILE}:\n"
         "${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
-    else(${VARIABLE})
+    else()
       message(STATUS "Looking for ${SYMBOL} - not found.")
       set(${VARIABLE} "" CACHE INTERNAL "Have symbol ${SYMBOL}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
@@ -96,6 +96,6 @@ macro(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
         "exist failed with the following output:\n"
         "${OUTPUT}\nFile ${SOURCEFILE}:\n"
         "${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
-    endif(${VARIABLE})
-  endif("${VARIABLE}" MATCHES "^${VARIABLE}$")
-endmacro(_CHECK_SYMBOL_EXISTS)
+    endif()
+  endif()
+endmacro()
diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake
index 1717718c9..1b9dc9fbb 100644
--- a/Modules/CheckTypeSize.cmake
+++ b/Modules/CheckTypeSize.cmake
@@ -142,7 +142,7 @@ function(__check_type_size_impl type var map builtin)
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining size of ${type} passed with the following output:\n${output}\n\n")
     set(${var} "${${var}}" CACHE INTERNAL "CHECK_TYPE_SIZE: sizeof(${type})")
-  else(HAVE_${var})
+  else()
     # The check failed to compile.
     message(STATUS "Check size of ${type} - failed")
     file(READ ${src} content)
@@ -150,7 +150,7 @@ function(__check_type_size_impl type var map builtin)
       "Determining size of ${type} failed with the following output:\n${output}\n${src}:\n${content}\n\n")
     set(${var} "" CACHE INTERNAL "CHECK_TYPE_SIZE: ${type} unknown")
     file(REMOVE ${map})
-  endif(HAVE_${var})
+  endif()
 endfunction()
 
 #-----------------------------------------------------------------------------
diff --git a/Modules/CheckVariableExists.cmake b/Modules/CheckVariableExists.cmake
index 48e848b31..f9155a014 100644
--- a/Modules/CheckVariableExists.cmake
+++ b/Modules/CheckVariableExists.cmake
@@ -39,9 +39,9 @@ macro(CHECK_VARIABLE_EXISTS VAR VARIABLE)
       CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
       set(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES
         "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
-    else(CMAKE_REQUIRED_LIBRARIES)
+    else()
       set(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES)
-    endif(CMAKE_REQUIRED_LIBRARIES)
+    endif()
     try_compile(${VARIABLE}
       ${CMAKE_BINARY_DIR}
       ${CMAKE_ROOT}/Modules/CheckVariableExists.c
@@ -55,12 +55,12 @@ macro(CHECK_VARIABLE_EXISTS VAR VARIABLE)
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if the variable ${VAR} exists passed with the following output:\n"
         "${OUTPUT}\n\n")
-    else(${VARIABLE})
+    else()
       set(${VARIABLE} "" CACHE INTERNAL "Have variable ${VAR}")
       message(STATUS "Looking for ${VAR} - not found")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if the variable ${VAR} exists failed with the following output:\n"
         "${OUTPUT}\n\n")
-    endif(${VARIABLE})
-  endif("${VARIABLE}" MATCHES "^${VARIABLE}$")
-endmacro(CHECK_VARIABLE_EXISTS)
+    endif()
+  endif()
+endmacro()
diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake
index 4f316f6e8..0827e437a 100644
--- a/Modules/Compiler/GNU.cmake
+++ b/Modules/Compiler/GNU.cmake
@@ -50,5 +50,5 @@ macro(__compiler_gnu lang)
   set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
   if(NOT APPLE)
     set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ")
-  endif(NOT APPLE)
+  endif()
 endmacro()
diff --git a/Modules/Compiler/Intel-ASM.cmake b/Modules/Compiler/Intel-ASM.cmake
index 0dd7b0d64..1f064c9d3 100644
--- a/Modules/Compiler/Intel-ASM.cmake
+++ b/Modules/Compiler/Intel-ASM.cmake
@@ -8,6 +8,6 @@ set(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
 
 if(UNIX)
   set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;S)
-else(UNIX)
+else()
   set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS asm)
-endif(UNIX)
+endif()
diff --git a/Modules/Compiler/SunPro-ASM.cmake b/Modules/Compiler/SunPro-ASM.cmake
index 371e23373..97776da93 100644
--- a/Modules/Compiler/SunPro-ASM.cmake
+++ b/Modules/Compiler/SunPro-ASM.cmake
@@ -21,4 +21,4 @@ set(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-g -xO2")
 foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
   set(CMAKE_${type}_LINK_STATIC_ASM_FLAGS "-Bstatic")
   set(CMAKE_${type}_LINK_DYNAMIC_ASM_FLAGS "-Bdynamic")
-endforeach(type)
+endforeach()
diff --git a/Modules/Compiler/SunPro-C.cmake b/Modules/Compiler/SunPro-C.cmake
index 668ddaea5..9e36051e4 100644
--- a/Modules/Compiler/SunPro-C.cmake
+++ b/Modules/Compiler/SunPro-C.cmake
@@ -21,7 +21,7 @@ set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g -xO2")
 foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
   set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Bstatic")
   set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Bdynamic")
-endforeach(type)
+endforeach()
 
 set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
 set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
diff --git a/Modules/Compiler/SunPro-CXX.cmake b/Modules/Compiler/SunPro-CXX.cmake
index d912eefcd..af31c7bc9 100644
--- a/Modules/Compiler/SunPro-CXX.cmake
+++ b/Modules/Compiler/SunPro-CXX.cmake
@@ -21,7 +21,7 @@ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-g -xO2")
 foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
   set(CMAKE_${type}_LINK_STATIC_CXX_FLAGS "-Bstatic")
   set(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS "-Bdynamic")
-endforeach(type)
+endforeach()
 
 set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
 set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
diff --git a/Modules/Dart.cmake b/Modules/Dart.cmake
index 97addcc2a..bd744b003 100644
--- a/Modules/Dart.cmake
+++ b/Modules/Dart.cmake
@@ -6,7 +6,7 @@
 #  include(Dart)
 #  if(BUILD_TESTING)
 #    # ... testing related CMake code ...
-#  endif(BUILD_TESTING)
+#  endif()
 # The BUILD_TESTING option is created by the Dart module to determine
 # whether testing support should be enabled.  The default is ON.
 
@@ -76,7 +76,7 @@ if(BUILD_TESTING)
   set(HAVE_DART)
   if(EXISTS "${DART_ROOT}/Source/Client/Dart.conf.in")
     set(HAVE_DART 1)
-  endif(EXISTS "${DART_ROOT}/Source/Client/Dart.conf.in")
+  endif()
 
   #
   # Section #2:
@@ -86,7 +86,7 @@ if(BUILD_TESTING)
   # find a tcl shell command
   if(HAVE_DART)
     find_package(Tclsh)
-  endif(HAVE_DART)
+  endif()
 
 
   if (HAVE_DART)
@@ -110,13 +110,13 @@ if(BUILD_TESTING)
     set(DART_EXPERIMENTAL_NAME Experimental)
     if(DART_EXPERIMENTAL_USE_PROJECT_NAME)
       set(DART_EXPERIMENTAL_NAME "${DART_EXPERIMENTAL_NAME}${PROJECT_NAME}")
-    endif(DART_EXPERIMENTAL_USE_PROJECT_NAME)
-  endif (HAVE_DART)
+    endif()
+  endif ()
 
   set(RUN_FROM_CTEST_OR_DART 1)
   include(CTestTargets)
   set(RUN_FROM_CTEST_OR_DART)
-endif(BUILD_TESTING)
+endif()
 
 #
 # End of Dart.cmake
diff --git a/Modules/Documentation.cmake b/Modules/Documentation.cmake
index ec989f408..d1c3afe47 100644
--- a/Modules/Documentation.cmake
+++ b/Modules/Documentation.cmake
@@ -49,4 +49,4 @@ if (BUILD_DOCUMENTATION)
   # We will probably need bash to create the custom target
   #
 
-endif (BUILD_DOCUMENTATION)
+endif ()
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index a0a9aead5..f0471ff2c 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -226,7 +226,7 @@ function(_ep_parse_arguments f name ns args)
       set(key "${arg}")
     endif()
   endforeach()
-endfunction(_ep_parse_arguments)
+endfunction()
 
 
 define_property(DIRECTORY PROPERTY "EP_BASE" INHERITED
@@ -329,7 +329,7 @@ endif()
 "
 )
 
-endfunction(_ep_write_gitclone_script)
+endfunction()
 
 
 function(_ep_write_downloadfile_script script_filename remote local timeout md5)
@@ -377,7 +377,7 @@ message(STATUS \"downloading... done\")
 "
 )
 
-endfunction(_ep_write_downloadfile_script)
+endfunction()
 
 
 function(_ep_write_verifyfile_script script_filename local md5)
@@ -422,7 +422,7 @@ endif()
 "
 )
 
-endfunction(_ep_write_verifyfile_script)
+endfunction()
 
 
 function(_ep_write_extractfile_script script_filename name filename directory)
@@ -502,7 +502,7 @@ message(STATUS \"extracting... done\")
 "
 )
 
-endfunction(_ep_write_extractfile_script)
+endfunction()
 
 
 function(_ep_set_directories name)
@@ -523,7 +523,7 @@ function(_ep_set_directories name)
     set(binary_default "${prefix}/src/${name}-build")
     set(stamp_default "${prefix}/src/${name}-stamp")
     set(install_default "${prefix}")
-  else() # assert(base)
+  else()
     set(tmp_default "${base}/tmp/${name}")
     set(download_default "${base}/Download/${name}")
     set(source_default "${base}/Source/${name}")
@@ -573,7 +573,7 @@ function(_ep_set_directories name)
       message(FATAL_ERROR "dir '${dir}' does not exist after file(MAKE_DIRECTORY)")
     endif()
   endforeach()
-endfunction(_ep_set_directories)
+endfunction()
 
 
 # IMPORTANT: this MUST be a macro and not a function because of the
@@ -633,7 +633,7 @@ function(_ep_write_initial_cache target_name script_filename args)
     file(WRITE "${script_filename}.in" "\@script_initial_cache\@\n")
   endif()
   configure_file("${script_filename}.in" "${script_filename}")
-endfunction(_ep_write_initial_cache)
+endfunction()
 
 
 function(ExternalProject_Get_Property name)
@@ -645,7 +645,7 @@ function(ExternalProject_Get_Property name)
     endif()
     set(${var} "${${var}}" PARENT_SCOPE)
   endforeach()
-endfunction(ExternalProject_Get_Property)
+endfunction()
 
 
 function(_ep_get_configure_command_id name cfg_cmd_id_var)
@@ -671,7 +671,7 @@ function(_ep_get_configure_command_id name cfg_cmd_id_var)
       endif()
     endif()
   endif()
-endfunction(_ep_get_configure_command_id)
+endfunction()
 
 
 function(_ep_get_build_command name step cmd_var)
@@ -710,7 +710,7 @@ function(_ep_get_build_command name step cmd_var)
           set(args "")
         endif()
       endif()
-    else() # if(cfg_cmd_id STREQUAL "configure")
+    else()
       # Non-CMake project.  Guess "make" and "make install" and "make test".
       if("${CMAKE_GENERATOR}" MATCHES "Makefiles")
         # Try to get the parallel arguments
@@ -736,7 +736,7 @@ function(_ep_get_build_command name step cmd_var)
   endif()
 
   set(${cmd_var} "${cmd}" PARENT_SCOPE)
-endfunction(_ep_get_build_command)
+endfunction()
 
 function(_ep_write_log_script name step cmd_var)
   ExternalProject_Get_Property(${name} stamp_dir)
@@ -784,7 +784,7 @@ if(result)
   set(msg \"Command failed (\${result}):\\n\")
   foreach(arg IN LISTS command)
     set(msg \"\${msg} '\${arg}'\")
-  endforeach(arg)
+  endforeach()
   message(FATAL_ERROR \"\${msg}\")
 endif()
 ")
@@ -823,7 +823,7 @@ if(result)
   set(msg \"Command failed: \${result}\\n\")
   foreach(arg IN LISTS command)
     set(msg \"\${msg} '\${arg}'\")
-  endforeach(arg)
+  endforeach()
   set(msg \"\${msg}\\nSee also\\n  ${logbase}-*.log\\n\")
   message(FATAL_ERROR \"\${msg}\")
 else()
@@ -833,7 +833,7 @@ endif()
 ")
   set(command ${CMAKE_COMMAND} ${make} ${config} -P ${script})
   set(${cmd_var} "${command}" PARENT_SCOPE)
-endfunction(_ep_write_log_script)
+endfunction()
 
 # This module used to use "/${CMAKE_CFG_INTDIR}" directly and produced
 # makefiles with "/./" in paths for custom command dependencies. Which
@@ -849,7 +849,7 @@ function(_ep_get_configuration_subdir_suffix suffix_var)
     set(suffix "/${CMAKE_CFG_INTDIR}")
   endif()
   set(${suffix_var} "${suffix}" PARENT_SCOPE)
-endfunction(_ep_get_configuration_subdir_suffix)
+endfunction()
 
 
 function(_ep_get_step_stampfile name step stampfile_var)
@@ -876,7 +876,7 @@ function(ExternalProject_Add_StepTargets name)
       add_dependencies(${name}-${step} ${arg})
     endforeach()
   endforeach()
-endfunction(ExternalProject_Add_StepTargets)
+endfunction()
 
 
 function(ExternalProject_Add_Step name step)
@@ -974,7 +974,7 @@ function(ExternalProject_Add_Step name step)
       break()
     endif()
   endforeach()
-endfunction(ExternalProject_Add_Step)
+endfunction()
 
 
 function(_ep_add_mkdir_command name)
@@ -992,7 +992,7 @@ function(_ep_add_mkdir_command name)
     COMMAND ${CMAKE_COMMAND} -E make_directory ${stamp_dir}${cfgdir}
     COMMAND ${CMAKE_COMMAND} -E make_directory ${download_dir}
     )
-endfunction(_ep_add_mkdir_command)
+endfunction()
 
 
 function(_ep_get_git_version git_EXECUTABLE git_version_var)
@@ -1215,7 +1215,7 @@ function(_ep_add_download_command name)
     DEPENDEES mkdir
     ${log}
     )
-endfunction(_ep_add_download_command)
+endfunction()
 
 
 function(_ep_add_update_command name)
@@ -1297,7 +1297,7 @@ function(_ep_add_update_command name)
     DEPENDEES download
     ${log}
     )
-endfunction(_ep_add_update_command)
+endfunction()
 
 
 function(_ep_add_patch_command name)
@@ -1317,7 +1317,7 @@ function(_ep_add_patch_command name)
     WORKING_DIRECTORY ${work_dir}
     DEPENDEES download
     )
-endfunction(_ep_add_patch_command)
+endfunction()
 
 
 # TODO: Make sure external projects use the proper compiler
@@ -1392,7 +1392,7 @@ function(_ep_add_configure_command name)
     DEPENDS ${file_deps}
     ${log}
     )
-endfunction(_ep_add_configure_command)
+endfunction()
 
 
 function(_ep_add_build_command name)
@@ -1418,7 +1418,7 @@ function(_ep_add_build_command name)
     DEPENDEES configure
     ${log}
     )
-endfunction(_ep_add_build_command)
+endfunction()
 
 
 function(_ep_add_install_command name)
@@ -1444,7 +1444,7 @@ function(_ep_add_install_command name)
     DEPENDEES build
     ${log}
     )
-endfunction(_ep_add_install_command)
+endfunction()
 
 
 function(_ep_add_test_command name)
@@ -1484,7 +1484,7 @@ function(_ep_add_test_command name)
       ${log}
       )
   endif()
-endfunction(_ep_add_test_command)
+endfunction()
 
 
 function(ExternalProject_Add name)
@@ -1550,4 +1550,4 @@ function(ExternalProject_Add name)
   # on install.
   #
   _ep_add_test_command(${name})
-endfunction(ExternalProject_Add)
+endfunction()
diff --git a/Modules/FeatureSummary.cmake b/Modules/FeatureSummary.cmake
index 718a0d90d..41bce1e85 100644
--- a/Modules/FeatureSummary.cmake
+++ b/Modules/FeatureSummary.cmake
@@ -188,7 +188,7 @@ function(ADD_FEATURE_INFO _name _enabled _desc)
   endif ()
 
   set_property(GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION "${_desc}" )
-endfunction(ADD_FEATURE_INFO)
+endfunction()
 
 
 
@@ -253,7 +253,7 @@ function(SET_PACKAGE_PROPERTIES _name _props)
     set_property(GLOBAL PROPERTY _CMAKE_${_name}_TYPE "${_SPP_TYPE}" )
   endif()
 
-endfunction(SET_PACKAGE_PROPERTIES)
+endfunction()
 
 
 
@@ -306,28 +306,28 @@ function(_FS_GET_FEATURE_SUMMARY _property _var _includeQuiet)
         get_property(_info  GLOBAL PROPERTY _CMAKE_${_currentFeature}_REQUIRED_VERSION)
         if(_info)
           set(_currentFeatureText "${_currentFeatureText} (required version ${_info})")
-        endif(_info)
+        endif()
         get_property(_info  GLOBAL PROPERTY _CMAKE_${_currentFeature}_DESCRIPTION)
         if(_info)
           set(_currentFeatureText "${_currentFeatureText} , ${_info}")
-        endif(_info)
+        endif()
         get_property(_info  GLOBAL PROPERTY _CMAKE_${_currentFeature}_URL)
         if(_info)
           set(_currentFeatureText "${_currentFeatureText} , <${_info}>")
-        endif(_info)
+        endif()
 
         get_property(_info  GLOBAL PROPERTY _CMAKE_${_currentFeature}_PURPOSE)
         foreach(_purpose ${_info})
           set(_currentFeatureText "${_currentFeatureText}\n   ${_purpose}")
         endforeach()
 
-      endif(includeThisOne)
+      endif()
 
-    endif("${_type}" STREQUAL ANY  OR  "${_type}" STREQUAL "${_currentType}")
+    endif()
 
-  endforeach(_currentFeature)
+  endforeach()
   set(${_var} "${_currentFeatureText}" PARENT_SCOPE)
-endfunction(_FS_GET_FEATURE_SUMMARY)
+endfunction()
 
 
 
@@ -412,11 +412,11 @@ function(FEATURE_SUMMARY)
   if(_FS_FILENAME)
     if(_FS_APPEND)
       file(APPEND "${_FS_FILENAME}" "${_fullText}")
-    else(_FS_APPEND)
+    else()
       file(WRITE  "${_FS_FILENAME}" "${_fullText}")
     endif()
 
-  else(_FS_FILENAME)
+  else()
     if(NOT _FS_VAR)
       message(STATUS "${_fullText}")
     endif()
@@ -430,7 +430,7 @@ function(FEATURE_SUMMARY)
     message(FATAL_ERROR "feature_summary() Error: REQUIRED package(s) are missing, aborting CMake run.")
   endif()
 
-endfunction(FEATURE_SUMMARY)
+endfunction()
 
 
 # The stuff below is only kept for compatibility
@@ -445,22 +445,22 @@ function(SET_PACKAGE_INFO _name _desc)
   if(_purpose MATCHES ".+")
     set_property(GLOBAL APPEND PROPERTY _CMAKE_${_name}_PURPOSE "${_purpose}" )
   endif()
-endfunction(SET_PACKAGE_INFO)
+endfunction()
 
 
 
 function(SET_FEATURE_INFO)
   SET_PACKAGE_INFO(${ARGN})
-endfunction(SET_FEATURE_INFO)
+endfunction()
 
 
 
 function(PRINT_ENABLED_FEATURES)
   FEATURE_SUMMARY(WHAT ENABLED_FEATURES  DESCRIPTION "Enabled features:")
-endfunction(PRINT_ENABLED_FEATURES)
+endfunction()
 
 
 
 function(PRINT_DISABLED_FEATURES)
   FEATURE_SUMMARY(WHAT DISABLED_FEATURES  DESCRIPTION "Disabled features:")
-endfunction(PRINT_DISABLED_FEATURES)
+endfunction()
diff --git a/Modules/FindAVIFile.cmake b/Modules/FindAVIFile.cmake
index ce4e1e726..93fa40004 100644
--- a/Modules/FindAVIFile.cmake
+++ b/Modules/FindAVIFile.cmake
@@ -33,7 +33,7 @@ if (UNIX)
     /usr/local/avifile/lib
   )
 
-endif (UNIX)
+endif ()
 
 # handle the QUIETLY and REQUIRED arguments and set AVIFILE_FOUND to TRUE if
 # all listed variables are TRUE
diff --git a/Modules/FindArmadillo.cmake b/Modules/FindArmadillo.cmake
index 84ed3cab6..aad22d2b3 100644
--- a/Modules/FindArmadillo.cmake
+++ b/Modules/FindArmadillo.cmake
@@ -66,10 +66,10 @@ if(ARMADILLO_INCLUDE_DIR)
     # WARNING: The number of spaces before the version name is not one.
     string(REGEX REPLACE ".*#define ARMA_VERSION_NAME\ +\"([0-9a-zA-Z\ _-]+)\".*" "\\1" ARMADILLO_VERSION_NAME "${_armadillo_HEADER_CONTENTS}")
 
-  endif(EXISTS "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/arma_version.hpp")
+  endif()
 
   set(ARMADILLO_VERSION_STRING "${ARMADILLO_VERSION_MAJOR}.${ARMADILLO_VERSION_MINOR}.${ARMADILLO_VERSION_PATCH}")
-endif (ARMADILLO_INCLUDE_DIR)
+endif ()
 
 #======================
 
@@ -84,7 +84,7 @@ find_package_handle_standard_args(Armadillo
 if (ARMADILLO_FOUND)
   set(ARMADILLO_INCLUDE_DIRS ${ARMADILLO_INCLUDE_DIR})
   set(ARMADILLO_LIBRARIES ${ARMADILLO_LIBRARY})
-endif (ARMADILLO_FOUND)
+endif ()
 
 
 # Hide internal variables
diff --git a/Modules/FindBISON.cmake b/Modules/FindBISON.cmake
index d0e0a222f..a0afd344c 100644
--- a/Modules/FindBISON.cmake
+++ b/Modules/FindBISON.cmake
@@ -98,14 +98,14 @@ if(BISON_EXECUTABLE)
     set(BISON_${Name}_VERBOSE_FILE ${filename})
     list(APPEND BISON_TARGET_extraoutputs
       "${BISON_TARGET_output_path}/${BISON_TARGET_output_name}.output")
-  endmacro(BISON_TARGET_option_verbose)
+  endmacro()
 
   # internal macro
   macro(BISON_TARGET_option_extraopts Options)
     set(BISON_TARGET_extraopts "${Options}")
     separate_arguments(BISON_TARGET_extraopts)
     list(APPEND BISON_TARGET_cmdopt ${BISON_TARGET_extraopts})
-  endmacro(BISON_TARGET_option_extraopts)
+  endmacro()
 
   #============================================================
   # BISON_TARGET (public macro)
@@ -161,12 +161,12 @@ if(BISON_EXECUTABLE)
       set(BISON_${Name}_COMPILE_FLAGS ${BISON_TARGET_cmdopt})
       set(BISON_${Name}_OUTPUT_SOURCE "${BisonOutput}")
 
-    endif(NOT ${ARGC} EQUAL 3 AND NOT ${ARGC} EQUAL 5 AND NOT ${ARGC} EQUAL 7)
-  endmacro(BISON_TARGET)
+    endif()
+  endmacro()
   #
   #============================================================
 
-endif(BISON_EXECUTABLE)
+endif()
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON REQUIRED_VARS  BISON_EXECUTABLE
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index 84bc7bb34..d9b3c618c 100644
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -54,11 +54,11 @@ elseif( (_LANGUAGES_ MATCHES C) OR (_LANGUAGES_ MATCHES CXX) )
 else()
   if(BLAS_FIND_REQUIRED)
     message(FATAL_ERROR "FindBLAS requires Fortran, C, or C++ to be enabled.")
-  else(BLAS_FIND_REQUIRED)
+  else()
     message(STATUS "Looking for BLAS... - NOT found (Unsupported languages)")
     return()
-  endif(BLAS_FIND_REQUIRED)
-endif( )
+  endif()
+endif()
 
 macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
 # This macro checks for the existence of the combination of fortran libraries
@@ -94,18 +94,18 @@ foreach(_library ${_list})
     if (BLA_STATIC)
       if (WIN32)
         set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
-      endif ( WIN32 )
+      endif ()
       if (APPLE)
         set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
-      else (APPLE)
+      else ()
         set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
-      endif (APPLE)
-    else (BLA_STATIC)
+      endif ()
+    else ()
       if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
         # for ubuntu's libblas3gf and liblapack3gf packages
         set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf)
       endif ()
-    endif (BLA_STATIC)
+    endif ()
     find_library(${_prefix}_${_library}_LIBRARY
       NAMES ${_library}
       PATHS ${_libdir}
@@ -113,8 +113,8 @@ foreach(_library ${_list})
     mark_as_advanced(${_prefix}_${_library}_LIBRARY)
     set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
     set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
-  endif(_libraries_work)
-endforeach(_library ${_list})
+  endif()
+endforeach()
 if(_libraries_work)
   # Test this combination of libraries.
   set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_thread})
@@ -127,23 +127,23 @@ if(_libraries_work)
   set(CMAKE_REQUIRED_LIBRARIES)
   mark_as_advanced(${_prefix}${_combined_name}_WORKS)
   set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
-endif(_libraries_work)
+endif()
 if(NOT _libraries_work)
   set(${LIBRARIES} FALSE)
-endif(NOT _libraries_work)
+endif()
 #message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
-endmacro(Check_Fortran_Libraries)
+endmacro()
 
 set(BLAS_LINKER_FLAGS)
 set(BLAS_LIBRARIES)
 set(BLAS95_LIBRARIES)
 if ($ENV{BLA_VENDOR} MATCHES ".+")
   set(BLA_VENDOR $ENV{BLA_VENDOR})
-else ($ENV{BLA_VENDOR} MATCHES ".+")
+else ()
   if(NOT BLA_VENDOR)
     set(BLA_VENDOR "All")
-  endif(NOT BLA_VENDOR)
-endif ($ENV{BLA_VENDOR} MATCHES ".+")
+  endif()
+endif ()
 
 if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
  if(NOT BLAS_LIBRARIES)
@@ -156,8 +156,8 @@ if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
   "goto2"
   ""
   )
- endif(NOT BLAS_LIBRARIES)
-endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
+ endif()
+endif ()
 
 if (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All")
  if(NOT BLAS_LIBRARIES)
@@ -170,8 +170,8 @@ if (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All")
   "f77blas;atlas"
   ""
   )
- endif(NOT BLAS_LIBRARIES)
-endif (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All")
+ endif()
+endif ()
 
 # BLAS in PhiPACK libraries? (requires generic BLAS lib, too)
 if (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All")
@@ -184,8 +184,8 @@ if (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All")
   "sgemm;dgemm;blas"
   ""
   )
- endif(NOT BLAS_LIBRARIES)
-endif (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All")
+ endif()
+endif ()
 
 # BLAS in Alpha CXML library?
 if (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All")
@@ -198,8 +198,8 @@ if (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All")
   "cxml"
   ""
   )
- endif(NOT BLAS_LIBRARIES)
-endif (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All")
+ endif()
+endif ()
 
 # BLAS in Alpha DXML library? (now called CXML, see above)
 if (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All")
@@ -212,8 +212,8 @@ if (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All")
   "dxml"
   ""
   )
- endif(NOT BLAS_LIBRARIES)
-endif (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All")
+ endif()
+endif ()
 
 # BLAS in Sun Performance library?
 if (BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All")
@@ -228,9 +228,9 @@ if (BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All")
   )
   if(BLAS_LIBRARIES)
     set(BLAS_LINKER_FLAGS "-xlic_lib=sunperf")
-  endif(BLAS_LIBRARIES)
- endif(NOT BLAS_LIBRARIES)
-endif (BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All")
+  endif()
+ endif()
+endif ()
 
 # BLAS in SCSL library?  (SGI/Cray Scientific Library)
 if (BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All")
@@ -243,8 +243,8 @@ if (BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All")
   "scsl"
   ""
   )
- endif(NOT BLAS_LIBRARIES)
-endif (BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All")
+ endif()
+endif ()
 
 # BLAS in SGIMATH library?
 if (BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All")
@@ -257,8 +257,8 @@ if (BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All")
   "complib.sgimath"
   ""
   )
- endif(NOT BLAS_LIBRARIES)
-endif (BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All")
+ endif()
+endif ()
 
 # BLAS in IBM ESSL library? (requires generic BLAS lib, too)
 if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
@@ -271,8 +271,8 @@ if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
   "essl;blas"
   ""
   )
- endif(NOT BLAS_LIBRARIES)
-endif (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
+ endif()
+endif ()
 
 #BLAS in acml library?
 if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
@@ -321,7 +321,7 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
    elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "NAG" )
     set( _ACML_COMPILER32 "nag32" )
     set( _ACML_COMPILER64 "nag64" )
-   else() #if( CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" )
+   else()
     set( _ACML_COMPILER32 "gfortran32" )
     set( _ACML_COMPILER64 "gfortran64" )
    endif()
@@ -330,7 +330,7 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
     set(_ACML_MP_LIB_DIRS
      "${_ACML_ROOT}/${_ACML_COMPILER32}_mp${_ACML_PATH_SUFFIX}/lib"
      "${_ACML_ROOT}/${_ACML_COMPILER64}_mp${_ACML_PATH_SUFFIX}/lib" )
-   else() #if( _BLAS_VENDOR STREQUAL "ACML" )
+   else()
     set(_ACML_LIB_DIRS
      "${_ACML_ROOT}/${_ACML_COMPILER32}${_ACML_PATH_SUFFIX}/lib"
      "${_ACML_ROOT}/${_ACML_COMPILER64}${_ACML_PATH_SUFFIX}/lib" )
@@ -364,7 +364,7 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
     break()
    endif()
   endforeach()
- else() #if( _BLAS_VENDOR STREQUAL "ACML" )
+ else()
   foreach( BLAS_ACML_LIB_DIRS ${_ACML_LIB_DIRS} )
    check_fortran_libraries (
      BLAS_LIBRARIES
@@ -388,7 +388,7 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
   "acml;acml_mv"
   ""
   )
- endif(NOT BLAS_LIBRARIES)
+ endif()
  if(NOT BLAS_LIBRARIES)
   check_fortran_libraries(
   BLAS_LIBRARIES
@@ -398,7 +398,7 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
   "acml_mp;acml_mv"
   ""
   )
- endif(NOT BLAS_LIBRARIES)
+ endif()
  if(NOT BLAS_LIBRARIES)
   check_fortran_libraries(
   BLAS_LIBRARIES
@@ -408,7 +408,7 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
   "acml;acml_mv;CALBLAS"
   ""
   )
- endif(NOT BLAS_LIBRARIES)
+ endif()
 endif () # ACML
 
 # Apple BLAS library?
@@ -422,8 +422,8 @@ if(NOT BLAS_LIBRARIES)
   "Accelerate"
   ""
   )
- endif(NOT BLAS_LIBRARIES)
-endif (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
+ endif()
+endif ()
 
 if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
  if ( NOT BLAS_LIBRARIES )
@@ -435,8 +435,8 @@ if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
     "vecLib"
     ""
     )
- endif ( NOT BLAS_LIBRARIES )
-endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
+ endif ()
+endif ()
 # Generic BLAS library?
 if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
  if(NOT BLAS_LIBRARIES)
@@ -448,8 +448,8 @@ if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
   "blas"
   ""
   )
- endif(NOT BLAS_LIBRARIES)
-endif (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
+ endif()
+endif ()
 
 #BLAS in intel mkl 10 library? (em64t 64bit)
 if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
@@ -459,9 +459,9 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
  if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
   if(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
     find_package(Threads)
-  else(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
+  else()
     find_package(Threads REQUIRED)
-  endif(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
+  endif()
 
   set(BLAS_SEARCH_LIBS "")
 
@@ -471,7 +471,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
     if (WIN32)
       list(APPEND BLAS_SEARCH_LIBS
         "mkl_blas95 mkl_intel_c mkl_intel_thread mkl_core libguide40")
-    else (WIN32)
+    else ()
       if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
         list(APPEND BLAS_SEARCH_LIBS
           "mkl_blas95 mkl_intel mkl_intel_thread mkl_core guide")
@@ -490,18 +490,18 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
             "mkl_blas95_lp64 mkl_intel_lp64 mkl_intel_thread mkl_core iomp5")
         endif ()
       endif ()
-    endif (WIN32)
+    endif ()
     if (BLA_VENDOR STREQUAL "Intel10_64lp_seq" OR BLA_VENDOR STREQUAL "All")
       list(APPEND BLAS_SEARCH_LIBS
         "mkl_blas95_lp64 mkl_intel_lp64 mkl_sequential mkl_core")
     endif ()
-  else (BLA_F95)
+  else ()
     set(BLAS_mkl_SEARCH_SYMBOL sgemm)
     set(_LIBRARIES BLAS_LIBRARIES)
     if (WIN32)
       list(APPEND BLAS_SEARCH_LIBS
         "mkl_c_dll mkl_intel_thread_dll mkl_core_dll libguide40")
-    else (WIN32)
+    else ()
       if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
         list(APPEND BLAS_SEARCH_LIBS
           "mkl_intel mkl_intel_thread mkl_core guide")
@@ -531,12 +531,12 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
         list(APPEND BLAS_SEARCH_LIBS
           "mkl_em64t")
       endif ()
-    endif (WIN32)
+    endif ()
     if (BLA_VENDOR STREQUAL "Intel10_64lp_seq" OR BLA_VENDOR STREQUAL "All")
       list(APPEND BLAS_SEARCH_LIBS
         "mkl_intel_lp64 mkl_sequential mkl_core")
     endif ()
-  endif (BLA_F95)
+  endif ()
 
   foreach (IT ${BLAS_SEARCH_LIBS})
     string(REPLACE " " ";" SEARCH_LIBS ${IT})
@@ -553,54 +553,54 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
     endif ()
   endforeach ()
 
- endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
-endif (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
+ endif ()
+endif ()
 
 
 if(BLA_F95)
  if(BLAS95_LIBRARIES)
     set(BLAS95_FOUND TRUE)
-  else(BLAS95_LIBRARIES)
+  else()
     set(BLAS95_FOUND FALSE)
-  endif(BLAS95_LIBRARIES)
+  endif()
 
   if(NOT BLAS_FIND_QUIETLY)
     if(BLAS95_FOUND)
       message(STATUS "A library with BLAS95 API found.")
-    else(BLAS95_FOUND)
+    else()
       if(BLAS_FIND_REQUIRED)
         message(FATAL_ERROR
         "A required library with BLAS95 API not found. Please specify library location.")
-      else(BLAS_FIND_REQUIRED)
+      else()
         message(STATUS
         "A library with BLAS95 API not found. Please specify library location.")
-      endif(BLAS_FIND_REQUIRED)
-    endif(BLAS95_FOUND)
-  endif(NOT BLAS_FIND_QUIETLY)
+      endif()
+    endif()
+  endif()
   set(BLAS_FOUND TRUE)
   set(BLAS_LIBRARIES "${BLAS95_LIBRARIES}")
-else(BLA_F95)
+else()
   if(BLAS_LIBRARIES)
     set(BLAS_FOUND TRUE)
-  else(BLAS_LIBRARIES)
+  else()
     set(BLAS_FOUND FALSE)
-  endif(BLAS_LIBRARIES)
+  endif()
 
   if(NOT BLAS_FIND_QUIETLY)
     if(BLAS_FOUND)
       message(STATUS "A library with BLAS API found.")
-    else(BLAS_FOUND)
+    else()
       if(BLAS_FIND_REQUIRED)
         message(FATAL_ERROR
         "A required library with BLAS API not found. Please specify library location."
         )
-      else(BLAS_FIND_REQUIRED)
+      else()
         message(STATUS
         "A library with BLAS API not found. Please specify library location."
         )
-      endif(BLAS_FIND_REQUIRED)
-    endif(BLAS_FOUND)
-  endif(NOT BLAS_FIND_QUIETLY)
-endif(BLA_F95)
+      endif()
+    endif()
+  endif()
+endif()
 
 set(CMAKE_FIND_LIBRARY_SUFFIXES ${_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
diff --git a/Modules/FindBZip2.cmake b/Modules/FindBZip2.cmake
index 121d3f089..8b9d235d1 100644
--- a/Modules/FindBZip2.cmake
+++ b/Modules/FindBZip2.cmake
@@ -34,12 +34,12 @@ if (NOT BZIP2_LIBRARIES)
 
     include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
     SELECT_LIBRARY_CONFIGURATIONS(BZIP2)
-endif (NOT BZIP2_LIBRARIES)
+endif ()
 
 if (BZIP2_INCLUDE_DIR AND EXISTS "${BZIP2_INCLUDE_DIR}/bzlib.h")
     file(STRINGS "${BZIP2_INCLUDE_DIR}/bzlib.h" BZLIB_H REGEX "bzip2/libbzip2 version [0-9]+\\.[^ ]+ of [0-9]+ ")
     string(REGEX REPLACE ".* bzip2/libbzip2 version ([0-9]+\\.[^ ]+) of [0-9]+ .*" "\\1" BZIP2_VERSION_STRING "${BZLIB_H}")
-endif (BZIP2_INCLUDE_DIR AND EXISTS "${BZIP2_INCLUDE_DIR}/bzlib.h")
+endif ()
 
 # handle the QUIETLY and REQUIRED arguments and set BZip2_FOUND to TRUE if
 # all listed variables are TRUE
@@ -51,6 +51,6 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(BZip2
 if (BZIP2_FOUND)
    include(CheckLibraryExists)
    CHECK_LIBRARY_EXISTS("${BZIP2_LIBRARIES}" BZ2_bzCompressInit "" BZIP2_NEED_PREFIX)
-endif (BZIP2_FOUND)
+endif ()
 
 mark_as_advanced(BZIP2_INCLUDE_DIR)
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index e536b6e4d..607e2494f 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -361,16 +361,16 @@ macro(_Boost_ADJUST_LIB_VARS basename)
 
       set(Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIRS} CACHE FILEPATH "Boost library directory")
       set(Boost_${basename}_FOUND ON CACHE INTERNAL "Whether the Boost ${basename} library found")
-    endif(Boost_${basename}_LIBRARY)
+    endif()
 
-  endif(Boost_INCLUDE_DIR )
+  endif()
   # Make variables changeble to the advanced user
   mark_as_advanced(
       Boost_${basename}_LIBRARY
       Boost_${basename}_LIBRARY_RELEASE
       Boost_${basename}_LIBRARY_DEBUG
   )
-endmacro(_Boost_ADJUST_LIB_VARS)
+endmacro()
 
 #-------------------------------------------------------------------------------
 
@@ -479,21 +479,21 @@ function(_Boost_GUESS_COMPILER_PREFIX _ret)
               # In Boost 1.36.0 and newer, the mangled compiler name used
               # on Mac OS X/Darwin is "xgcc".
               set(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}")
-            else(${Boost_MINOR_VERSION} GREATER 35)
+            else()
               # In Boost <= 1.35.0, there is no mangled compiler name for
               # the Mac OS X/Darwin version of GCC.
               set(_boost_COMPILER "")
-            endif(${Boost_MINOR_VERSION} GREATER 35)
-          else(Boost_MINOR_VERSION)
+            endif()
+          else()
             # We don't know the Boost version, so assume it's
             # pre-1.36.0.
             set(_boost_COMPILER "")
-          endif(Boost_MINOR_VERSION)
+          endif()
         else()
           set(_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}")
         endif()
       endif()
-    endif (CMAKE_COMPILER_IS_GNUCXX)
+    endif ()
   else()
     # TODO at least Boost_DEBUG here?
     set(_boost_COMPILER "")
@@ -525,7 +525,7 @@ if(Boost_FIND_VERSION_EXACT)
   set(_boost_TEST_VERSIONS
     "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.${Boost_FIND_VERSION_PATCH}"
     "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
-else(Boost_FIND_VERSION_EXACT)
+else()
   # The user has not requested an exact version.  Among known
   # versions, find those that are acceptable to the user request.
   set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
@@ -549,12 +549,12 @@ else(Boost_FIND_VERSION_EXACT)
         # the patch level dropped.
         list(APPEND _boost_TEST_VERSIONS "${version}")
       endif()
-    endforeach(version)
-  else(Boost_FIND_VERSION)
+    endforeach()
+  else()
     # Any version is acceptable.
     set(_boost_TEST_VERSIONS "${_Boost_KNOWN_VERSIONS}")
-  endif(Boost_FIND_VERSION)
-endif(Boost_FIND_VERSION_EXACT)
+  endif()
+endif()
 
 # The reason that we failed to find Boost. This will be set to a
 # user-friendly message when we fail to find some necessary piece of
@@ -597,7 +597,7 @@ set(Boost_ERROR_REASON)
     # for linking.
     set(Boost_LIB_DIAGNOSTIC_DEFINITIONS
       "-DBOOST_LIB_DIAGNOSTIC" CACHE STRING "Boost diagnostic define")
-  endif(WIN32)
+  endif()
 
   set(_boost_INCLUDE_SEARCH_DIRS_SYSTEM
     C:/boost/include
@@ -671,7 +671,7 @@ set(Boost_ERROR_REASON)
     file(TO_CMAKE_PATH ${BOOST_INCLUDEDIR} BOOST_INCLUDEDIR)
     set(_boost_INCLUDE_SEARCH_DIRS
       ${BOOST_INCLUDEDIR} ${_boost_INCLUDE_SEARCH_DIRS})
-  endif( BOOST_INCLUDEDIR )
+  endif()
 
   # ------------------------------------------------------------------------
   #  Search for Boost include DIR
@@ -699,7 +699,7 @@ set(Boost_ERROR_REASON)
       list(APPEND _boost_PATH_SUFFIXES "boost-${_boost_BOOSTIFIED_VERSION}")
       list(APPEND _boost_PATH_SUFFIXES "boost_${_boost_BOOSTIFIED_VERSION}")
 
-    endforeach(_boost_VER)
+    endforeach()
 
     if(Boost_DEBUG)
       message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
@@ -717,7 +717,7 @@ set(Boost_ERROR_REASON)
       PATH_SUFFIXES ${_boost_PATH_SUFFIXES}
       ${_boost_FIND_OPTIONS}
       )
-  endif( NOT Boost_INCLUDE_DIR )
+  endif()
 
   # ------------------------------------------------------------------------
   #  Extract version information from version.hpp
@@ -748,16 +748,16 @@ set(Boost_ERROR_REASON)
 
       set(Boost_ERROR_REASON
           "${Boost_ERROR_REASON}Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}")
-    endif(NOT "${Boost_VERSION}" STREQUAL "0")
+    endif()
     if(Boost_DEBUG)
       message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
                      "version.hpp reveals boost "
                      "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
     endif()
-  else(Boost_INCLUDE_DIR)
+  else()
     set(Boost_ERROR_REASON
       "${Boost_ERROR_REASON}Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers.")
-  endif(Boost_INCLUDE_DIR)
+  endif()
 
   # ------------------------------------------------------------------------
   #  Suffix initialization and compiler suffix detection.
@@ -1007,7 +1007,7 @@ set(Boost_ERROR_REASON)
 
     _Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT})
 
-  endforeach(COMPONENT)
+  endforeach()
 
   # Restore the original find library ordering
   if( Boost_USE_STATIC_LIBS )
@@ -1044,9 +1044,9 @@ set(Boost_ERROR_REASON)
         if( Boost_FIND_VERSION_PATCH AND Boost_SUBMINOR_VERSION LESS "${Boost_FIND_VERSION_PATCH}" )
           set( Boost_FOUND FALSE )
           set(_Boost_VERSION_AGE "old")
-        endif( Boost_FIND_VERSION_PATCH AND Boost_SUBMINOR_VERSION LESS "${Boost_FIND_VERSION_PATCH}" )
-      endif( Boost_MINOR_VERSION LESS "${Boost_FIND_VERSION_MINOR}" )
-    endif( Boost_MAJOR_VERSION LESS "${Boost_FIND_VERSION_MAJOR}" )
+        endif()
+      endif()
+    endif()
 
     if (NOT Boost_FOUND)
       _Boost_MARK_COMPONENTS_FOUND(OFF)
@@ -1061,7 +1061,7 @@ set(Boost_ERROR_REASON)
       # If the user didn't specify a patchlevel, it's 0.
       if (NOT Boost_FIND_VERSION_PATCH)
         set(Boost_FIND_VERSION_PATCH 0)
-      endif (NOT Boost_FIND_VERSION_PATCH)
+      endif ()
 
       # We'll set Boost_FOUND true again if we have an exact version match.
       set(Boost_FOUND FALSE)
@@ -1071,10 +1071,10 @@ set(Boost_ERROR_REASON)
           if(Boost_SUBMINOR_VERSION EQUAL "${Boost_FIND_VERSION_PATCH}" )
             set( Boost_FOUND TRUE )
             _Boost_MARK_COMPONENTS_FOUND(ON)
-          endif(Boost_SUBMINOR_VERSION EQUAL "${Boost_FIND_VERSION_PATCH}" )
-        endif( Boost_MINOR_VERSION EQUAL "${Boost_FIND_VERSION_MINOR}" )
-      endif( Boost_MAJOR_VERSION EQUAL "${Boost_FIND_VERSION_MAJOR}" )
-    endif (Boost_FOUND AND Boost_FIND_VERSION_EXACT)
+          endif()
+        endif()
+      endif()
+    endif ()
 
     if(NOT Boost_FOUND)
       # State that we found a version of Boost that is too new or too old.
@@ -1083,12 +1083,12 @@ set(Boost_ERROR_REASON)
       if (Boost_FIND_VERSION_PATCH)
         set(Boost_ERROR_REASON
           "${Boost_ERROR_REASON}.${Boost_FIND_VERSION_PATCH}")
-      endif (Boost_FIND_VERSION_PATCH)
+      endif ()
       if (NOT Boost_FIND_VERSION_EXACT)
         set(Boost_ERROR_REASON "${Boost_ERROR_REASON} (or newer)")
-      endif (NOT Boost_FIND_VERSION_EXACT)
+      endif ()
       set(Boost_ERROR_REASON "${Boost_ERROR_REASON}.")
-    endif (NOT Boost_FOUND)
+    endif ()
 
     # Always check for missing components
     set(_boost_CHECKED_COMPONENT FALSE)
@@ -1101,7 +1101,7 @@ set(Boost_ERROR_REASON)
         list(APPEND _Boost_MISSING_COMPONENTS ${COMPONENT})
         set( Boost_FOUND FALSE)
       endif()
-    endforeach(COMPONENT)
+    endforeach()
 
     if(Boost_DEBUG)
       message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] Boost_FOUND = ${Boost_FOUND}")
@@ -1115,18 +1115,18 @@ set(Boost_ERROR_REASON)
       foreach(COMPONENT ${_Boost_MISSING_COMPONENTS})
         set(Boost_ERROR_REASON
           "${Boost_ERROR_REASON}        boost_${COMPONENT}\n")
-      endforeach(COMPONENT)
+      endforeach()
 
       list(LENGTH Boost_FIND_COMPONENTS Boost_NUM_COMPONENTS_WANTED)
       list(LENGTH _Boost_MISSING_COMPONENTS Boost_NUM_MISSING_COMPONENTS)
       if (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS})
         set(Boost_ERROR_REASON
           "${Boost_ERROR_REASON}No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.")
-      else (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS})
+      else ()
         set(Boost_ERROR_REASON
           "${Boost_ERROR_REASON}Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.")
-      endif (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS})
-    endif (_Boost_MISSING_COMPONENTS)
+      endif ()
+    endif ()
 
     if( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT )
       # Compatibility Code for backwards compatibility with CMake
@@ -1160,11 +1160,11 @@ set(Boost_ERROR_REASON)
         set(Boost_LIBRARY_DIRS ${_boost_LIB_DIR} CACHE FILEPATH "Boost library directory")
       endif()
 
-    endif( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT )
+    endif()
 
-  else(Boost_INCLUDE_DIR)
+  else()
     set( Boost_FOUND FALSE)
-  endif(Boost_INCLUDE_DIR)
+  endif()
 
   # ------------------------------------------------------------------------
   #  Notification to end user about what was found
@@ -1176,16 +1176,16 @@ set(Boost_ERROR_REASON)
         if(Boost_FIND_COMPONENTS)
           message(STATUS "Found the following Boost libraries:")
         endif()
-      endif(NOT Boost_FIND_QUIETLY)
+      endif()
       foreach( COMPONENT  ${Boost_FIND_COMPONENTS} )
         string( TOUPPER ${COMPONENT} UPPERCOMPONENT )
         if( Boost_${UPPERCOMPONENT}_FOUND )
           if(NOT Boost_FIND_QUIETLY)
             message (STATUS "  ${COMPONENT}")
-          endif(NOT Boost_FIND_QUIETLY)
+          endif()
           set(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${UPPERCOMPONENT}_LIBRARY})
-        endif( Boost_${UPPERCOMPONENT}_FOUND )
-      endforeach(COMPONENT)
+        endif()
+      endforeach()
   else()
     if(Boost_FIND_REQUIRED)
       message(SEND_ERROR "Unable to find the requested Boost libraries.\n${Boost_ERROR_REASON}")
@@ -1201,7 +1201,7 @@ set(Boost_ERROR_REASON)
           message(STATUS "Could NOT find Boost")
         endif()
       endif()
-    endif(Boost_FIND_REQUIRED)
+    endif()
   endif()
 
   # show the Boost_INCLUDE_DIRS AND Boost_LIBRARIES variables only in the advanced view
diff --git a/Modules/FindCABLE.cmake b/Modules/FindCABLE.cmake
index 72a8805ca..3e2d5d3bb 100644
--- a/Modules/FindCABLE.cmake
+++ b/Modules/FindCABLE.cmake
@@ -25,7 +25,7 @@
 
 if(NOT CABLE)
   find_path(CABLE_BUILD_DIR cableVersion.h)
-endif(NOT CABLE)
+endif()
 
 if(CABLE_BUILD_DIR)
   load_cache(${CABLE_BUILD_DIR}
@@ -43,25 +43,25 @@ if(CABLE_BUILD_DIR)
     find_library(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS
                  ${CABLE_LIBRARY_PATH}
                  ${CABLE_LIBRARY_PATH}/*)
-  else(CABLE_LIBRARY_PATH)
+  else()
     find_library(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS
                  ${CABLE_BINARY_DIR}/CableTclFacility
                  ${CABLE_BINARY_DIR}/CableTclFacility/*)
-  endif(CABLE_LIBRARY_PATH)
+  endif()
 
   if(CABLE_EXECUTABLE_PATH)
     find_program(CABLE NAMES cable PATHS
                  ${CABLE_EXECUTABLE_PATH}
                  ${CABLE_EXECUTABLE_PATH}/*)
-  else(CABLE_EXECUTABLE_PATH)
+  else()
     find_program(CABLE NAMES cable PATHS
                  ${CABLE_BINARY_DIR}/Executables
                  ${CABLE_BINARY_DIR}/Executables/*)
-  endif(CABLE_EXECUTABLE_PATH)
+  endif()
 
   find_path(CABLE_INCLUDE_DIR CableTclFacility/ctCalls.h
             ${CABLE_SOURCE_DIR})
-else(CABLE_BUILD_DIR)
+else()
   # Find the cable executable in the path.
   find_program(CABLE NAMES cable)
 
@@ -78,4 +78,4 @@ else(CABLE_BUILD_DIR)
   # executable.
   find_library(CABLE_TCL_LIBRARY NAMES CableTclFacility PATHS
                ${CABLE_ROOT_BIN}/../lib/Cable)
-endif(CABLE_BUILD_DIR)
+endif()
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 94e4500be..f15243780 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -291,7 +291,7 @@ macro(CUDA_FIND_HELPER_FILE _name _extension)
   endif()
   # Set this variable as internal, so the user isn't bugged with it.
   set(CUDA_${_name} ${CUDA_${_name}} CACHE INTERNAL "Location of ${_full_name}" FORCE)
-endmacro(CUDA_FIND_HELPER_FILE)
+endmacro()
 
 #####################################################################
 ## CUDA_INCLUDE_NVCC_DEPENDENCIES
@@ -339,12 +339,12 @@ macro(CUDA_INCLUDE_NVCC_DEPENDENCIES dependency_file)
         #message("file ${f} not found")
         set(CUDA_NVCC_DEPEND_REGENERATE TRUE)
       endif()
-    endforeach(f)
-  else(CUDA_NVCC_DEPEND)
+    endforeach()
+  else()
     #message("CUDA_NVCC_DEPEND false")
     # No dependencies, so regenerate the file.
     set(CUDA_NVCC_DEPEND_REGENERATE TRUE)
-  endif(CUDA_NVCC_DEPEND)
+  endif()
 
   #message("CUDA_NVCC_DEPEND_REGENERATE = ${CUDA_NVCC_DEPEND_REGENERATE}")
   # No incoming dependencies, so we need to generate them.  Make the
@@ -354,9 +354,9 @@ macro(CUDA_INCLUDE_NVCC_DEPENDENCIES dependency_file)
     set(CUDA_NVCC_DEPEND ${dependency_file})
     #message("Generating an empty dependency_file: ${dependency_file}")
     file(WRITE ${dependency_file} "#FindCUDA.cmake generated file.  Do not edit.\n")
-  endif(CUDA_NVCC_DEPEND_REGENERATE)
+  endif()
 
-endmacro(CUDA_INCLUDE_NVCC_DEPENDENCIES)
+endmacro()
 
 ###############################################################################
 ###############################################################################
@@ -482,15 +482,15 @@ if(NOT CUDA_TOOLKIT_ROOT_DIR)
     string(REGEX REPLACE "[/\\\\]?bin[64]*[/\\\\]?$" "" CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR})
     # We need to force this back into the cache.
     set(CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR} CACHE PATH "Toolkit location." FORCE)
-  endif(CUDA_TOOLKIT_ROOT_DIR)
+  endif()
   if (NOT EXISTS ${CUDA_TOOLKIT_ROOT_DIR})
     if(CUDA_FIND_REQUIRED)
       message(FATAL_ERROR "Specify CUDA_TOOLKIT_ROOT_DIR")
     elseif(NOT CUDA_FIND_QUIETLY)
       message("CUDA_TOOLKIT_ROOT_DIR not found or specified")
     endif()
-  endif (NOT EXISTS ${CUDA_TOOLKIT_ROOT_DIR})
-endif (NOT CUDA_TOOLKIT_ROOT_DIR)
+  endif ()
+endif ()
 
 # CUDA_NVCC_EXECUTABLE
 find_program(CUDA_NVCC_EXECUTABLE
@@ -595,7 +595,7 @@ find_library_local_first(CUDA_CUDA_LIBRARY cuda "\"cuda\" library (older version
 # Add cuda library to the link line only if it is found.
 if (CUDA_CUDA_LIBRARY)
   set(CUDA_LIBRARIES ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY})
-endif(CUDA_CUDA_LIBRARY)
+endif()
 
 mark_as_advanced(
   CUDA_CUDA_LIBRARY
@@ -607,7 +607,7 @@ mark_as_advanced(
 macro(FIND_CUDA_HELPER_LIBS _name)
   find_library_local_first(CUDA_${_name}_LIBRARY ${_name} "\"${_name}\" library")
   mark_as_advanced(CUDA_${_name}_LIBRARY)
-endmacro(FIND_CUDA_HELPER_LIBS)
+endmacro()
 
 #######################
 # Disable emulation for v3.1 onward
@@ -691,9 +691,9 @@ set(CUDA_SDK_SEARCH_PATH
 
 # if(CMAKE_SIZEOF_VOID_P EQUAL 8)
 #   set(cuda_cutil_name cutil64)
-# else(CMAKE_SIZEOF_VOID_P EQUAL 8)
+# else()
 #   set(cuda_cutil_name cutil32)
-# endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
+# endif()
 
 # find_library(CUDA_CUT_LIBRARY
 #   NAMES cutil ${cuda_cutil_name}
@@ -743,8 +743,8 @@ find_package_handle_standard_args(CUDA
 macro(CUDA_INCLUDE_DIRECTORIES)
   foreach(dir ${ARGN})
     list(APPEND CUDA_NVCC_INCLUDE_ARGS_USER -I${dir})
-  endforeach(dir ${ARGN})
-endmacro(CUDA_INCLUDE_DIRECTORIES)
+  endforeach()
+endmacro()
 
 
 ##############################################################################
@@ -914,20 +914,20 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
   if (CUDA_BUILD_EMULATION)
     # Emulation.
     set(nvcc_flags ${nvcc_flags} --device-emulation -D_DEVICEEMU -g)
-  else(CUDA_BUILD_EMULATION)
+  else()
     # Device mode.  No flags necessary.
-  endif(CUDA_BUILD_EMULATION)
+  endif()
 
   if(CUDA_HOST_COMPILATION_CPP)
     set(CUDA_C_OR_CXX CXX)
-  else(CUDA_HOST_COMPILATION_CPP)
+  else()
     if(CUDA_VERSION VERSION_LESS "3.0")
       set(nvcc_flags ${nvcc_flags} --host-compilation C)
     else()
       message(WARNING "--host-compilation flag is deprecated in CUDA version >= 3.0.  Removing --host-compilation C flag" )
     endif()
     set(CUDA_C_OR_CXX C)
-  endif(CUDA_HOST_COMPILATION_CPP)
+  endif()
 
   set(generated_extension ${CMAKE_${CUDA_C_OR_CXX}_OUTPUT_EXTENSION})
 
@@ -1080,11 +1080,11 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
         set(generated_file_basename "${cuda_target}_generated_${basename}.ptx")
         set(format_flag "-ptx")
         file(MAKE_DIRECTORY "${cuda_compile_output_dir}")
-      else( compile_to_ptx )
+      else()
         set(generated_file_path "${cuda_compile_output_dir}/${CMAKE_CFG_INTDIR}")
         set(generated_file_basename "${cuda_target}_generated_${basename}${generated_extension}")
         set(format_flag "-c")
-      endif( compile_to_ptx )
+      endif()
 
       # Set all of our file names.  Make sure that whatever filenames that have
       # generated_file_path in them get passed in through as a command line
@@ -1118,17 +1118,17 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
       # Convience string for output ###########################################
       if(CUDA_BUILD_EMULATION)
         set(cuda_build_type "Emulation")
-      else(CUDA_BUILD_EMULATION)
+      else()
         set(cuda_build_type "Device")
-      endif(CUDA_BUILD_EMULATION)
+      endif()
 
       # Build the NVCC made dependency file ###################################
       set(build_cubin OFF)
       if ( NOT CUDA_BUILD_EMULATION AND CUDA_BUILD_CUBIN )
          if ( NOT compile_to_ptx )
            set ( build_cubin ON )
-         endif( NOT compile_to_ptx )
-      endif( NOT CUDA_BUILD_EMULATION AND CUDA_BUILD_CUBIN )
+         endif()
+      endif()
 
       # Configure the build script
       configure_file("${CUDA_run_nvcc}" "${custom_target_script}" @ONLY)
@@ -1203,12 +1203,12 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
       list(REMOVE_DUPLICATES CUDA_ADDITIONAL_CLEAN_FILES)
       set(CUDA_ADDITIONAL_CLEAN_FILES ${CUDA_ADDITIONAL_CLEAN_FILES} CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.")
 
-    endif(${file} MATCHES ".*\\.cu$" AND NOT _is_header)
-  endforeach(file)
+    endif()
+  endforeach()
 
   # Set the return parameter
   set(${generated_files} ${_cuda_wrap_generated_files})
-endmacro(CUDA_WRAP_SRCS)
+endmacro()
 
 
 ###############################################################################
@@ -1245,7 +1245,7 @@ macro(CUDA_ADD_LIBRARY cuda_target)
     LINKER_LANGUAGE ${CUDA_C_OR_CXX}
     )
 
-endmacro(CUDA_ADD_LIBRARY cuda_target)
+endmacro()
 
 
 ###############################################################################
@@ -1279,7 +1279,7 @@ macro(CUDA_ADD_EXECUTABLE cuda_target)
     LINKER_LANGUAGE ${CUDA_C_OR_CXX}
     )
 
-endmacro(CUDA_ADD_EXECUTABLE cuda_target)
+endmacro()
 
 
 ###############################################################################
@@ -1297,7 +1297,7 @@ macro(CUDA_COMPILE generated_files)
 
   set( ${generated_files} ${_generated_files})
 
-endmacro(CUDA_COMPILE)
+endmacro()
 
 
 ###############################################################################
@@ -1315,7 +1315,7 @@ macro(CUDA_COMPILE_PTX generated_files)
 
   set( ${generated_files} ${_generated_files})
 
-endmacro(CUDA_COMPILE_PTX)
+endmacro()
 
 ###############################################################################
 ###############################################################################
@@ -1364,4 +1364,4 @@ macro(CUDA_BUILD_CLEAN_TARGET)
   # This is useful so that the files won't persist in the list after targets
   # have been removed.
   set(CUDA_ADDITIONAL_CLEAN_FILES "" CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.")
-endmacro(CUDA_BUILD_CLEAN_TARGET)
+endmacro()
diff --git a/Modules/FindCUDA/make2cmake.cmake b/Modules/FindCUDA/make2cmake.cmake
index d41b72dc2..c2405f44f 100644
--- a/Modules/FindCUDA/make2cmake.cmake
+++ b/Modules/FindCUDA/make2cmake.cmake
@@ -76,7 +76,7 @@ if (${depend_text} MATCHES ".+")
       list(APPEND dependency_list "${file_absolute}")
     endif()
 
-  endforeach(file)
+  endforeach()
 
 else()
   # message("FOUND NO DEPENDS")
diff --git a/Modules/FindCUDA/parse_cubin.cmake b/Modules/FindCUDA/parse_cubin.cmake
index 2518c6852..94be7e2cb 100644
--- a/Modules/FindCUDA/parse_cubin.cmake
+++ b/Modules/FindCUDA/parse_cubin.cmake
@@ -65,11 +65,11 @@ if (${file_text} MATCHES ".+")
             # Skip the rest of this block.
             # message("Skipping ${entry}")
             # set(skip TRUE)
-          # else (${entry} MATCHES "^_")
+          # else ()
             message("Kernel:    ${entry}")
-          # endif (${entry} MATCHES "^_")
+          # endif ()
 
-        endif(${entry} MATCHES "[^g]name = ([^ ]+)")
+        endif()
 
         # Skip the rest of the block if necessary
         if(NOT skip)
@@ -96,14 +96,14 @@ if (${file_text} MATCHES ".+")
             message("")
           endif()
 
-        endif(NOT skip)
+        endif()
 
 
-      endforeach(entry)
+      endforeach()
 
-    endif(line MATCHES "^code")
+    endif()
 
-  endforeach(line)
+  endforeach()
 
 else()
   # message("FOUND NO DEPENDS")
diff --git a/Modules/FindCUDA/run_nvcc.cmake b/Modules/FindCUDA/run_nvcc.cmake
index b31011c0e..8274cc718 100644
--- a/Modules/FindCUDA/run_nvcc.cmake
+++ b/Modules/FindCUDA/run_nvcc.cmake
@@ -139,7 +139,7 @@ macro(cuda_execute_process status command)
     endforeach()
     # Echo the command
     execute_process(COMMAND ${CMAKE_COMMAND} -E echo ${cuda_execute_process_string})
-  endif(verbose)
+  endif()
   # Run the command
   execute_process(COMMAND ${ARGN} RESULT_VARIABLE CUDA_result )
 endmacro()
@@ -277,4 +277,4 @@ if( build_cubin )
     -P "${CUDA_parse_cubin}"
     )
 
-endif( build_cubin )
+endif()
diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake
index 5c58b8437..e080f1a7d 100644
--- a/Modules/FindCURL.cmake
+++ b/Modules/FindCURL.cmake
@@ -43,7 +43,7 @@ if(CURL_INCLUDE_DIR)
       unset(curl_version_str)
       break()
     endif()
-  endforeach(_curl_version_header)
+  endforeach()
 endif()
 
 # handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if
@@ -56,4 +56,4 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL
 if(CURL_FOUND)
   set(CURL_LIBRARIES ${CURL_LIBRARY})
   set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
-endif(CURL_FOUND)
+endif()
diff --git a/Modules/FindCVS.cmake b/Modules/FindCVS.cmake
index 84bcaa19c..07079bb5a 100644
--- a/Modules/FindCVS.cmake
+++ b/Modules/FindCVS.cmake
@@ -5,7 +5,7 @@
 #   find_package(CVS)
 #   if(CVS_FOUND)
 #     message("CVS found: ${CVS_EXECUTABLE}")
-#   endif(CVS_FOUND)
+#   endif()
 
 #=============================================================================
 # Copyright 2008-2009 Kitware, Inc.
diff --git a/Modules/FindCoin3D.cmake b/Modules/FindCoin3D.cmake
index 914d74b11..bbda87b3a 100644
--- a/Modules/FindCoin3D.cmake
+++ b/Modules/FindCoin3D.cmake
@@ -28,7 +28,7 @@ if (WIN32)
     find_path(COIN3D_INCLUDE_DIRS Inventor/So.h)
     find_library(COIN3D_LIBRARIES Coin)
 
-  else (CYGWIN)
+  else ()
 
     find_path(COIN3D_INCLUDE_DIRS Inventor/So.h
       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/include"
@@ -45,18 +45,18 @@ if (WIN32)
     if (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
       set(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
                            debug ${COIN3D_LIBRARY_DEBUG})
-    else (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
+    else ()
       if (COIN3D_LIBRARY_DEBUG)
         set (COIN3D_LIBRARIES ${COIN3D_LIBRARY_DEBUG})
-      endif (COIN3D_LIBRARY_DEBUG)
+      endif ()
       if (COIN3D_LIBRARY_RELEASE)
         set (COIN3D_LIBRARIES ${COIN3D_LIBRARY_RELEASE})
-      endif (COIN3D_LIBRARY_RELEASE)
-    endif (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
+      endif ()
+    endif ()
 
-  endif (CYGWIN)
+  endif ()
 
-else (WIN32)
+else ()
   if(APPLE)
     find_path(COIN3D_INCLUDE_DIRS Inventor/So.h
      /Library/Frameworks/Inventor.framework/Headers
@@ -65,14 +65,14 @@ else (WIN32)
       /Library/Frameworks/Inventor.framework/Libraries
     )
     set(COIN3D_LIBRARIES "-framework Coin3d" CACHE STRING "Coin3D library for OSX")
-  else(APPLE)
+  else()
 
     find_path(COIN3D_INCLUDE_DIRS Inventor/So.h)
     find_library(COIN3D_LIBRARIES Coin)
 
-  endif(APPLE)
+  endif()
 
-endif (WIN32)
+endif ()
 
 # handle the QUIETLY and REQUIRED arguments and set COIN3D_FOUND to TRUE if
 # all listed variables are TRUE
diff --git a/Modules/FindCups.cmake b/Modules/FindCups.cmake
index 05d2c270b..f74366bb7 100644
--- a/Modules/FindCups.cmake
+++ b/Modules/FindCups.cmake
@@ -32,7 +32,7 @@ if (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES AND CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE)
 
     # ippDeleteAttribute is new in cups-1.1.19 (and used by kdeprint)
     CHECK_LIBRARY_EXISTS(cups ippDeleteAttribute "" CUPS_HAS_IPP_DELETE_ATTRIBUTE)
-endif (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES AND CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE)
+endif ()
 
 if (CUPS_INCLUDE_DIR AND EXISTS "${CUPS_INCLUDE_DIR}/cups/cups.h")
     file(STRINGS "${CUPS_INCLUDE_DIR}/cups/cups.h" cups_version_str
@@ -46,13 +46,13 @@ if (CUPS_INCLUDE_DIR AND EXISTS "${CUPS_INCLUDE_DIR}/cups/cups.h")
                        CUPS_VERSION_PART "${VLINE}")
                 if(CUPS_VERSION_STRING)
                     set(CUPS_VERSION_STRING "${CUPS_VERSION_STRING}.${CUPS_VERSION_PART}")
-                else(CUPS_VERSION_STRING)
+                else()
                     set(CUPS_VERSION_STRING "${CUPS_VERSION_PART}")
-                endif(CUPS_VERSION_STRING)
+                endif()
             endif()
-        endforeach(VLINE)
-    endforeach(VPART)
-endif (CUPS_INCLUDE_DIR AND EXISTS "${CUPS_INCLUDE_DIR}/cups/cups.h")
+        endforeach()
+    endforeach()
+endif ()
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 
@@ -60,10 +60,10 @@ if (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE)
     FIND_PACKAGE_HANDLE_STANDARD_ARGS(Cups
                                       REQUIRED_VARS CUPS_LIBRARIES CUPS_INCLUDE_DIR CUPS_HAS_IPP_DELETE_ATTRIBUTE
                                       VERSION_VAR CUPS_VERSION_STRING)
-else (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE)
+else ()
     FIND_PACKAGE_HANDLE_STANDARD_ARGS(Cups
                                       REQUIRED_VARS CUPS_LIBRARIES CUPS_INCLUDE_DIR
                                       VERSION_VAR CUPS_VERSION_STRING)
-endif (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE)
+endif ()
 
 mark_as_advanced(CUPS_INCLUDE_DIR CUPS_LIBRARIES)
diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake
index de719921e..6acf42126 100644
--- a/Modules/FindCurses.cmake
+++ b/Modules/FindCurses.cmake
@@ -32,7 +32,7 @@ set(CURSES_USE_NCURSES FALSE)
 
 if(CURSES_NCURSES_LIBRARY  AND NOT  CURSES_CURSES_LIBRARY)
   set(CURSES_USE_NCURSES TRUE)
-endif(CURSES_NCURSES_LIBRARY  AND NOT  CURSES_CURSES_LIBRARY)
+endif()
 # http://cygwin.com/ml/cygwin-announce/2010-01/msg00002.html
 # cygwin ncurses stopped providing curses.h symlinks see above
 # message.  Cygwin is an ncurses package, so force ncurses on
@@ -65,10 +65,10 @@ if(CURSES_CURSES_LIBRARY  AND  CURSES_NEED_NCURSES)
       wsyncup "" CURSES_NCURSES_HAS_WSYNCUP)
     if( CURSES_NCURSES_HAS_WSYNCUP)
       set(CURSES_USE_NCURSES TRUE)
-    endif( CURSES_NCURSES_HAS_WSYNCUP)
-  endif(CURSES_NCURSES_LIBRARY  AND NOT  CURSES_CURSES_HAS_WSYNCUP)
+    endif()
+  endif()
 
-endif(CURSES_CURSES_LIBRARY  AND  CURSES_NEED_NCURSES)
+endif()
 
 
 if(NOT CURSES_USE_NCURSES)
@@ -83,7 +83,7 @@ if(NOT CURSES_USE_NCURSES)
     CACHE FILEPATH "The curses include path")
   set(CURSES_LIBRARY "${CURSES_CURSES_LIBRARY}"
     CACHE FILEPATH "The curses library")
-else(NOT CURSES_USE_NCURSES)
+else()
 # we need to find ncurses
   get_filename_component(_cursesLibDir "${CURSES_NCURSES_LIBRARY}" PATH)
   get_filename_component(_cursesParentDir "${_cursesLibDir}" PATH)
@@ -109,23 +109,23 @@ else(NOT CURSES_USE_NCURSES)
   if(NOT CURSES_NCURSES_INCLUDE_PATH AND CURSES_HAVE_NCURSES_NCURSES_H)
     get_filename_component(CURSES_NCURSES_INCLUDE_PATH
       "${CURSES_HAVE_NCURSES_NCURSES_H}" PATH)
-  endif(NOT CURSES_NCURSES_INCLUDE_PATH AND CURSES_HAVE_NCURSES_NCURSES_H)
+  endif()
   if(CURSES_NCURSES_INCLUDE_PATH AND CURSES_NCURSES_LIBRARY)
     set( FORCE_IT )
     if(CURSES_INCLUDE_PATH MATCHES NOTFOUND)
       set(FORCE_IT FORCE)
-    endif(CURSES_INCLUDE_PATH MATCHES NOTFOUND)
+    endif()
     set(CURSES_INCLUDE_PATH "${CURSES_NCURSES_INCLUDE_PATH}"
       CACHE FILEPATH "The curses include path" ${FORCE_IT})
     set( FORCE_IT)
     if(CURSES_LIBRARY MATCHES NOTFOUND)
       set(FORCE_IT FORCE)
-    endif(CURSES_LIBRARY MATCHES NOTFOUND)
+    endif()
     set(CURSES_LIBRARY "${CURSES_NCURSES_LIBRARY}"
       CACHE FILEPATH "The curses library" ${FORCE_IT})
-  endif(CURSES_NCURSES_INCLUDE_PATH AND CURSES_NCURSES_LIBRARY)
+  endif()
 
-endif(NOT CURSES_USE_NCURSES)
+endif()
 
 find_library(CURSES_EXTRA_LIBRARY cur_colr HINTS "${_cursesLibDir}")
 find_library(CURSES_EXTRA_LIBRARY cur_colr )
@@ -144,11 +144,11 @@ set(CURSES_LIBRARIES ${CURSES_LIBRARY})
 
 if(CURSES_EXTRA_LIBRARY)
   set(CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_EXTRA_LIBRARY})
-endif(CURSES_EXTRA_LIBRARY)
+endif()
 
 if(CURSES_FORM_LIBRARY)
   set(CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_FORM_LIBRARY})
-endif(CURSES_FORM_LIBRARY)
+endif()
 
 # Proper name is *_INCLUDE_DIR
 set(CURSES_INCLUDE_DIR ${CURSES_INCLUDE_PATH})
diff --git a/Modules/FindCxxTest.cmake b/Modules/FindCxxTest.cmake
index 4207961d0..48de64afd 100644
--- a/Modules/FindCxxTest.cmake
+++ b/Modules/FindCxxTest.cmake
@@ -147,7 +147,7 @@ macro(CXXTEST_ADD_TEST _cxxtest_testname _cxxtest_outfname)
         add_test(${_cxxtest_testname} ${CMAKE_CURRENT_BINARY_DIR}/${_cxxtest_testname})
     endif()
 
-endmacro(CXXTEST_ADD_TEST)
+endmacro()
 
 #=============================================================
 # main()
diff --git a/Modules/FindCygwin.cmake b/Modules/FindCygwin.cmake
index 75e3342ba..d7ab7cc80 100644
--- a/Modules/FindCygwin.cmake
+++ b/Modules/FindCygwin.cmake
@@ -25,4 +25,4 @@ if (WIN32)
   mark_as_advanced(
     CYGWIN_INSTALL_PATH
   )
-endif (WIN32)
+endif ()
diff --git a/Modules/FindDoxygen.cmake b/Modules/FindDoxygen.cmake
index d63044f42..d2ede6ab9 100644
--- a/Modules/FindDoxygen.cmake
+++ b/Modules/FindDoxygen.cmake
@@ -35,7 +35,7 @@
 # For backwards compatibility support
 if(Doxygen_FIND_QUIETLY)
   set(DOXYGEN_FIND_QUIETLY TRUE)
-endif(Doxygen_FIND_QUIETLY)
+endif()
 
 # ===== Rationale for OS X AppBundle mods below =====
 #     With the OS X GUI version, Doxygen likes to be installed to /Applications and
@@ -109,7 +109,7 @@ if(NOT DOXYGEN_SKIP_DOT)
     get_filename_component(DOXYGEN_DOT_PATH "${DOXYGEN_DOT_EXECUTABLE}" PATH CACHE)
   endif()
 
-endif(NOT DOXYGEN_SKIP_DOT)
+endif()
 
 #
 # Backwards compatibility...
diff --git a/Modules/FindEXPAT.cmake b/Modules/FindEXPAT.cmake
index e8523a059..c681a0dfd 100644
--- a/Modules/FindEXPAT.cmake
+++ b/Modules/FindEXPAT.cmake
@@ -36,13 +36,13 @@ if (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h")
                        EXPAT_VERSION_PART "${VLINE}")
                 if(EXPAT_VERSION_STRING)
                     set(EXPAT_VERSION_STRING "${EXPAT_VERSION_STRING}.${EXPAT_VERSION_PART}")
-                else(EXPAT_VERSION_STRING)
+                else()
                     set(EXPAT_VERSION_STRING "${EXPAT_VERSION_PART}")
-                endif(EXPAT_VERSION_STRING)
+                endif()
             endif()
-        endforeach(VLINE)
-    endforeach(VPART)
-endif (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h")
+        endforeach()
+    endforeach()
+endif ()
 
 # handle the QUIETLY and REQUIRED arguments and set EXPAT_FOUND to TRUE if
 # all listed variables are TRUE
@@ -55,6 +55,6 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(EXPAT
 if(EXPAT_FOUND)
   set(EXPAT_LIBRARIES ${EXPAT_LIBRARY})
   set(EXPAT_INCLUDE_DIRS ${EXPAT_INCLUDE_DIR})
-endif(EXPAT_FOUND)
+endif()
 
 mark_as_advanced(EXPAT_INCLUDE_DIR EXPAT_LIBRARY)
diff --git a/Modules/FindFLEX.cmake b/Modules/FindFLEX.cmake
index 64c1d535a..e397d284f 100644
--- a/Modules/FindFLEX.cmake
+++ b/Modules/FindFLEX.cmake
@@ -129,7 +129,7 @@ if(FLEX_EXECUTABLE)
     set(FLEX_${Name}_OUTPUTS ${Output})
     set(FLEX_${Name}_INPUT ${Input})
     set(FLEX_${Name}_COMPILE_FLAGS ${FLEX_EXECUTABLE_opts})
-  endmacro(FLEX_TARGET)
+  endmacro()
   #============================================================
 
 
@@ -149,10 +149,10 @@ if(FLEX_EXECUTABLE)
 
     set_source_files_properties(${FLEX_${FlexTarget}_OUTPUTS}
       PROPERTIES OBJECT_DEPENDS ${BISON_${BisonTarget}_OUTPUT_HEADER})
-  endmacro(ADD_FLEX_BISON_DEPENDENCY)
+  endmacro()
   #============================================================
 
-endif(FLEX_EXECUTABLE)
+endif()
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(FLEX REQUIRED_VARS FLEX_EXECUTABLE
diff --git a/Modules/FindFLTK.cmake b/Modules/FindFLTK.cmake
index 402fe2f5e..a02d0318c 100644
--- a/Modules/FindFLTK.cmake
+++ b/Modules/FindFLTK.cmake
@@ -51,26 +51,26 @@ if(WIN32)
   if(NOT CYGWIN)
     if(BORLAND)
       set( FLTK_PLATFORM_DEPENDENT_LIBS import32 )
-    else(BORLAND)
+    else()
       set( FLTK_PLATFORM_DEPENDENT_LIBS wsock32 comctl32 )
-    endif(BORLAND)
-  endif(NOT CYGWIN)
-endif(WIN32)
+    endif()
+  endif()
+endif()
 
 if(UNIX)
   include(FindX11)
   find_library(FLTK_MATH_LIBRARY m)
   set( FLTK_PLATFORM_DEPENDENT_LIBS ${X11_LIBRARIES} ${FLTK_MATH_LIBRARY})
-endif(UNIX)
+endif()
 
 if(APPLE)
   set( FLTK_PLATFORM_DEPENDENT_LIBS  "-framework Carbon -framework Cocoa -framework ApplicationServices -lz")
-endif(APPLE)
+endif()
 
 # If FLTK_INCLUDE_DIR is already defined we assigne its value to FLTK_DIR
 if(FLTK_INCLUDE_DIR)
   set(FLTK_DIR ${FLTK_INCLUDE_DIR})
-endif(FLTK_INCLUDE_DIR)
+endif()
 
 
 # If FLTK has been built using CMake we try to find everything directly
@@ -85,7 +85,7 @@ if(NOT FLTK_DIR)
   set(FLTK_DIR_SEARCH "")
   foreach(dir ${FLTK_DIR_SEARCH2})
     set(FLTK_DIR_SEARCH ${FLTK_DIR_SEARCH} "${dir}/../lib/fltk")
-  endforeach(dir)
+  endforeach()
   string(REPLACE "//" "/" FLTK_DIR_SEARCH "${FLTK_DIR_SEARCH}")
 
   #
@@ -122,12 +122,12 @@ if(NOT FLTK_DIR)
     # Help the user find it if we cannot.
     DOC "The ${FLTK_DIR_STRING}"
     )
-endif(NOT FLTK_DIR)
+endif()
 
   # Check if FLTK was built using CMake
   if(EXISTS ${FLTK_DIR}/FLTKConfig.cmake)
     set(FLTK_BUILT_WITH_CMAKE 1)
-  endif(EXISTS ${FLTK_DIR}/FLTKConfig.cmake)
+  endif()
 
   if(FLTK_BUILT_WITH_CMAKE)
     set(FLTK_FOUND 1)
@@ -136,14 +136,14 @@ endif(NOT FLTK_DIR)
     # Fluid
     if(FLUID_COMMAND)
       set(FLTK_FLUID_EXECUTABLE ${FLUID_COMMAND} CACHE FILEPATH "Fluid executable")
-    else(FLUID_COMMAND)
+    else()
       find_program(FLTK_FLUID_EXECUTABLE fluid PATHS
         ${FLTK_EXECUTABLE_DIRS}
         ${FLTK_EXECUTABLE_DIRS}/RelWithDebInfo
         ${FLTK_EXECUTABLE_DIRS}/Debug
         ${FLTK_EXECUTABLE_DIRS}/Release
         NO_SYSTEM_PATH)
-    endif(FLUID_COMMAND)
+    endif()
     # mark_as_advanced(FLTK_FLUID_EXECUTABLE)
 
     set(FLTK_INCLUDE_DIR ${FLTK_DIR})
@@ -165,17 +165,17 @@ endif(NOT FLTK_DIR)
     set(FLTK_IMAGES_LIBS "")
     if(FLFLTK_USE_SYSTEM_JPEG)
       set(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} fltk_jpeg)
-    endif(FLFLTK_USE_SYSTEM_JPEG)
+    endif()
     if(FLFLTK_USE_SYSTEM_PNG)
       set(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} fltk_png)
-    endif(FLFLTK_USE_SYSTEM_PNG)
+    endif()
     if(FLFLTK_USE_SYSTEM_ZLIB)
       set(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} fltk_zlib)
-    endif(FLFLTK_USE_SYSTEM_ZLIB)
+    endif()
     set(FLTK_IMAGES_LIBS "${FLTK_IMAGES_LIBS}" CACHE INTERNAL
       "Extra libraries for fltk_images library.")
 
-  else(FLTK_BUILT_WITH_CMAKE)
+  else()
 
     # if FLTK was not built using CMake
     # Find fluid executable.
@@ -191,7 +191,7 @@ endif(NOT FLTK_DIR)
       set(FLTK_LIBRARY_SEARCH_PATH ${FLTK_LIBRARY_SEARCH_PATH}
         ${FLTK_BIN_DIR}/../lib)
       set(FLTK_WRAP_UI 1)
-    endif(FLTK_FLUID_EXECUTABLE)
+    endif()
 
     #
     # Try to find FLTK include dir using fltk-config
@@ -209,7 +209,7 @@ endif(NOT FLTK_DIR)
               string(STRIP ${_dir} _output)
               list(APPEND _FLTK_POSSIBLE_INCLUDE_DIRS ${_output})
             endforeach()
-          endif(FLTK_CXXFLAGS)
+          endif()
         endif()
       endif()
     endif()
@@ -265,11 +265,11 @@ endif(NOT FLTK_DIR)
           # the file that originally included this module.  Save the answer.
           set(FLTK_IMAGES_LIBS "${FLTK_IMAGES_LIBS}" CACHE INTERNAL
             "Extra libraries for fltk_images library.")
-        endif("${FLTK_IMAGES_LDFLAGS}" MATCHES "${FLTK_LIBS_EXTRACT_REGEX}")
-      endif(FLTK_CONFIG_SCRIPT)
-    endif(UNIX)
+        endif()
+      endif()
+    endif()
 
-  endif(FLTK_BUILT_WITH_CMAKE)
+  endif()
 
   # Append all of the required libraries together (by default, everything)
   set(FLTK_LIBRARIES)
@@ -296,14 +296,14 @@ endif()
 if(FLTK_FOUND)
   if(APPLE)
     set(FLTK_LIBRARIES ${FLTK_PLATFORM_DEPENDENT_LIBS} ${FLTK_LIBRARIES})
-  else(APPLE)
+  else()
     set(FLTK_LIBRARIES ${FLTK_LIBRARIES} ${FLTK_PLATFORM_DEPENDENT_LIBS})
-  endif(APPLE)
+  endif()
 
   # The following deprecated settings are for compatibility with CMake 1.4
   set (HAS_FLTK ${FLTK_FOUND})
   set (FLTK_INCLUDE_PATH ${FLTK_INCLUDE_DIR})
   set (FLTK_FLUID_EXE ${FLTK_FLUID_EXECUTABLE})
   set (FLTK_LIBRARY ${FLTK_LIBRARIES})
-endif(FLTK_FOUND)
+endif()
 
diff --git a/Modules/FindFLTK2.cmake b/Modules/FindFLTK2.cmake
index 059ecdbcf..3ea558c1f 100644
--- a/Modules/FindFLTK2.cmake
+++ b/Modules/FindFLTK2.cmake
@@ -30,27 +30,27 @@ if(WIN32)
   if(NOT CYGWIN)
     if(BORLAND)
       set( FLTK2_PLATFORM_DEPENDENT_LIBS import32 )
-    else(BORLAND)
+    else()
       set( FLTK2_PLATFORM_DEPENDENT_LIBS wsock32 comctl32 )
-    endif(BORLAND)
-  endif(NOT CYGWIN)
-endif(WIN32)
+    endif()
+  endif()
+endif()
 
 if(UNIX)
   include(${CMAKE_ROOT}/Modules/FindX11.cmake)
   set( FLTK2_PLATFORM_DEPENDENT_LIBS ${X11_LIBRARIES} -lm)
-endif(UNIX)
+endif()
 
 if(APPLE)
   set( FLTK2_PLATFORM_DEPENDENT_LIBS  "-framework Carbon -framework Cocoa -framework ApplicationServices -lz")
-endif(APPLE)
+endif()
 
 # If FLTK2_INCLUDE_DIR is already defined we assigne its value to FLTK2_DIR
 if(FLTK2_INCLUDE_DIR)
   set(FLTK2_DIR ${FLTK2_INCLUDE_DIR})
-else(FLTK2_INCLUDE_DIR)
+else()
   set(FLTK2_INCLUDE_DIR ${FLTK2_DIR})
-endif(FLTK2_INCLUDE_DIR)
+endif()
 
 
 # If FLTK2 has been built using CMake we try to find everything directly
@@ -65,7 +65,7 @@ if(NOT FLTK2_DIR)
   set(FLTK2_DIR_SEARCH "")
   foreach(dir ${FLTK2_DIR_SEARCH2})
     set(FLTK2_DIR_SEARCH ${FLTK2_DIR_SEARCH} "${dir}/../lib/fltk")
-  endforeach(dir)
+  endforeach()
   string(REPLACE "//" "/" FLTK2_DIR_SEARCH "${FLTK2_DIR_SEARCH}")
 
   #
@@ -103,9 +103,9 @@ if(NOT FLTK2_DIR)
 
   if(NOT FLTK2_DIR)
     find_path(FLTK2_DIR fltk/run.h ${FLTK2_INCLUDE_SEARCH_PATH})
-  endif(NOT FLTK2_DIR)
+  endif()
 
-endif(NOT FLTK2_DIR)
+endif()
 
 
 # If FLTK2 was found, load the configuration file to get the rest of the
@@ -115,7 +115,7 @@ if(FLTK2_DIR)
   # Check if FLTK2 was built using CMake
   if(EXISTS ${FLTK2_DIR}/FLTK2Config.cmake)
     set(FLTK2_BUILT_WITH_CMAKE 1)
-  endif(EXISTS ${FLTK2_DIR}/FLTK2Config.cmake)
+  endif()
 
   if(FLTK2_BUILT_WITH_CMAKE)
     set(FLTK2_FOUND 1)
@@ -124,14 +124,14 @@ if(FLTK2_DIR)
     # Fluid
     if(FLUID_COMMAND)
       set(FLTK2_FLUID_EXECUTABLE ${FLUID_COMMAND} CACHE FILEPATH "Fluid executable")
-    else(FLUID_COMMAND)
+    else()
       find_program(FLTK2_FLUID_EXECUTABLE fluid2 PATHS
         ${FLTK2_EXECUTABLE_DIRS}
         ${FLTK2_EXECUTABLE_DIRS}/RelWithDebInfo
         ${FLTK2_EXECUTABLE_DIRS}/Debug
         ${FLTK2_EXECUTABLE_DIRS}/Release
         NO_SYSTEM_PATH)
-    endif(FLUID_COMMAND)
+    endif()
 
     mark_as_advanced(FLTK2_FLUID_EXECUTABLE)
     set( FLTK_FLUID_EXECUTABLE ${FLTK2_FLUID_EXECUTABLE} )
@@ -157,17 +157,17 @@ if(FLTK2_DIR)
     set(FLTK2_IMAGES_LIBS "")
     if(FLFLTK2_USE_SYSTEM_JPEG)
       set(FLTK2_IMAGES_LIBS ${FLTK2_IMAGES_LIBS} fltk2_jpeg)
-    endif(FLFLTK2_USE_SYSTEM_JPEG)
+    endif()
     if(FLFLTK2_USE_SYSTEM_PNG)
       set(FLTK2_IMAGES_LIBS ${FLTK2_IMAGES_LIBS} fltk2_png)
-    endif(FLFLTK2_USE_SYSTEM_PNG)
+    endif()
     if(FLFLTK2_USE_SYSTEM_ZLIB)
       set(FLTK2_IMAGES_LIBS ${FLTK2_IMAGES_LIBS} fltk2_zlib)
-    endif(FLFLTK2_USE_SYSTEM_ZLIB)
+    endif()
     set(FLTK2_IMAGES_LIBS "${FLTK2_IMAGES_LIBS}" CACHE INTERNAL
       "Extra libraries for fltk2_images library.")
 
-  else(FLTK2_BUILT_WITH_CMAKE)
+  else()
 
     # if FLTK2 was not built using CMake
     # Find fluid executable.
@@ -184,7 +184,7 @@ if(FLTK2_DIR)
       set(FLTK2_LIBRARY_SEARCH_PATH ${FLTK2_LIBRARY_SEARCH_PATH}
         ${FLTK2_BIN_DIR}/../lib)
       set(FLTK2_WRAP_UI 1)
-    endif(FLTK2_FLUID_EXECUTABLE)
+    endif()
 
     set(FLTK2_INCLUDE_SEARCH_PATH ${FLTK2_INCLUDE_SEARCH_PATH}
       /usr/local/fltk2
@@ -221,12 +221,12 @@ if(FLTK2_DIR)
           # the file that originally included this module.  Save the answer.
           set(FLTK2_IMAGES_LIBS "${FLTK2_IMAGES_LIBS}" CACHE INTERNAL
             "Extra libraries for fltk_images library.")
-        endif("${FLTK2_IMAGES_LDFLAGS}" MATCHES "${FLTK2_LIBS_EXTRACT_REGEX}")
-      endif(FLTK2_CONFIG_SCRIPT)
-    endif(UNIX)
+        endif()
+      endif()
+    endif()
 
-  endif(FLTK2_BUILT_WITH_CMAKE)
-endif(FLTK2_DIR)
+  endif()
+endif()
 
 
 set(FLTK2_FOUND 1)
@@ -236,32 +236,32 @@ foreach(var FLTK2_FLUID_EXECUTABLE FLTK2_INCLUDE_DIR
   if(NOT ${var})
     message( STATUS "${var} not found" )
     set(FLTK2_FOUND 0)
-  endif(NOT ${var})
-endforeach(var)
+  endif()
+endforeach()
 
 
 if(FLTK2_FOUND)
   set(FLTK2_LIBRARIES ${FLTK2_IMAGES_LIBRARY} ${FLTK2_IMAGES_LIBS} ${FLTK2_BASE_LIBRARY} ${FLTK2_GL_LIBRARY} )
   if(APPLE)
     set(FLTK2_LIBRARIES ${FLTK2_PLATFORM_DEPENDENT_LIBS} ${FLTK2_LIBRARIES})
-  else(APPLE)
+  else()
     set(FLTK2_LIBRARIES ${FLTK2_LIBRARIES} ${FLTK2_PLATFORM_DEPENDENT_LIBS})
-  endif(APPLE)
+  endif()
 
   # The following deprecated settings are for compatibility with CMake 1.4
   set (HAS_FLTK2 ${FLTK2_FOUND})
   set (FLTK2_INCLUDE_PATH ${FLTK2_INCLUDE_DIR})
   set (FLTK2_FLUID_EXE ${FLTK2_FLUID_EXECUTABLE})
   set (FLTK2_LIBRARY ${FLTK2_LIBRARIES})
-else(FLTK2_FOUND)
+else()
   # make FIND_PACKAGE friendly
   if(NOT FLTK2_FIND_QUIETLY)
     if(FLTK2_FIND_REQUIRED)
       message(FATAL_ERROR
               "FLTK2 required, please specify its location with FLTK2_DIR.")
-    else(FLTK2_FIND_REQUIRED)
+    else()
       message(STATUS "FLTK2 was not found.")
-    endif(FLTK2_FIND_REQUIRED)
-  endif(NOT FLTK2_FIND_QUIETLY)
-endif(FLTK2_FOUND)
+    endif()
+  endif()
+endif()
 
diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake
index d89683371..08b4a0d4c 100644
--- a/Modules/FindFreetype.cmake
+++ b/Modules/FindFreetype.cmake
@@ -75,7 +75,7 @@ find_library(FREETYPE_LIBRARY
 # set the user variables
 if(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
   set(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
-endif(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
+endif()
 set(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}")
 
 if(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
@@ -90,14 +90,14 @@ if(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/
                        FREETYPE_VERSION_PART "${VLINE}")
                 if(FREETYPE_VERSION_STRING)
                     set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}")
-                else(FREETYPE_VERSION_STRING)
+                else()
                     set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}")
-                endif(FREETYPE_VERSION_STRING)
+                endif()
                 unset(FREETYPE_VERSION_PART)
             endif()
-        endforeach(VLINE)
-    endforeach(VPART)
-endif(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
+        endforeach()
+    endforeach()
+endif()
 
 
 # handle the QUIETLY and REQUIRED arguments and set FREETYPE_FOUND to TRUE if
diff --git a/Modules/FindGLU.cmake b/Modules/FindGLU.cmake
index 3db2ce4c6..d87945ada 100644
--- a/Modules/FindGLU.cmake
+++ b/Modules/FindGLU.cmake
@@ -24,5 +24,5 @@ include(FindOpenGL)
 if (OPENGL_GLU_FOUND)
   set (GLU_LIBRARY ${OPENGL_LIBRARIES})
   set (GLU_INCLUDE_PATH ${OPENGL_INCLUDE_DIR})
-endif (OPENGL_GLU_FOUND)
+endif ()
 
diff --git a/Modules/FindGLUT.cmake b/Modules/FindGLUT.cmake
index edff53cb9..55790ae7c 100644
--- a/Modules/FindGLUT.cmake
+++ b/Modules/FindGLUT.cmake
@@ -28,7 +28,7 @@ if (WIN32)
     ${OPENGL_LIBRARY_DIR}
     ${GLUT_ROOT_PATH}/Release
     )
-else (WIN32)
+else ()
 
   if (APPLE)
     # These values for Apple could probably do with improvement.
@@ -38,7 +38,7 @@ else (WIN32)
       )
     set(GLUT_glut_LIBRARY "-framework GLUT" CACHE STRING "GLUT library for OSX")
     set(GLUT_cocoa_LIBRARY "-framework Cocoa" CACHE STRING "Cocoa framework for OSX")
-  else (APPLE)
+  else ()
 
     find_path( GLUT_INCLUDE_DIR GL/glut.h
       /usr/include/GL
@@ -60,9 +60,9 @@ else (WIN32)
       /usr/openwin/lib
       )
 
-  endif (APPLE)
+  endif ()
 
-endif (WIN32)
+endif ()
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLUT REQUIRED_VARS GLUT_glut_LIBRARY GLUT_INCLUDE_DIR)
@@ -80,7 +80,7 @@ if (GLUT_FOUND)
   #The following deprecated settings are for backwards compatibility with CMake1.4
   set (GLUT_LIBRARY ${GLUT_LIBRARIES})
   set (GLUT_INCLUDE_PATH ${GLUT_INCLUDE_DIR})
-endif(GLUT_FOUND)
+endif()
 
 mark_as_advanced(
   GLUT_INCLUDE_DIR
diff --git a/Modules/FindGTK.cmake b/Modules/FindGTK.cmake
index 780932e61..505a05123 100644
--- a/Modules/FindGTK.cmake
+++ b/Modules/FindGTK.cmake
@@ -120,13 +120,13 @@ if(UNIX)
 
     if(GTK_gmodule_LIBRARY)
       set(GTK_LIBRARIES ${GTK_LIBRARIES} ${GTK_gmodule_LIBRARY})
-    endif(GTK_gmodule_LIBRARY)
+    endif()
     if(GTK_gthread_LIBRARY)
       set(GTK_LIBRARIES ${GTK_LIBRARIES} ${GTK_gthread_LIBRARY})
-    endif(GTK_gthread_LIBRARY)
+    endif()
     if(GTK_Xi_LIBRARY)
       set(GTK_LIBRARIES ${GTK_LIBRARIES} ${GTK_Xi_LIBRARY})
-    endif(GTK_Xi_LIBRARY)
+    endif()
 
     if(GTK_gtkgl_INCLUDE_PATH AND GTK_gtkgl_LIBRARY)
       set( GTK_GL_FOUND "YES" )
@@ -137,7 +137,7 @@ if(UNIX)
         GTK_gtkgl_LIBRARY
         GTK_gtkgl_INCLUDE_PATH
         )
-    endif(GTK_gtkgl_INCLUDE_PATH AND GTK_gtkgl_LIBRARY)
+    endif()
 
   endif(GTK_gtk_INCLUDE_PATH
      AND GTK_glibconfig_INCLUDE_PATH
@@ -159,7 +159,7 @@ if(UNIX)
     GTK_gtkgl_LIBRARY
   )
 
-endif(UNIX)
+endif()
 
 
 
diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake
index f734b3b59..d10b4190e 100644
--- a/Modules/FindGTK2.cmake
+++ b/Modules/FindGTK2.cmake
@@ -214,7 +214,7 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr)
         endif()
     endif()
 
-endfunction(_GTK2_FIND_INCLUDE_DIR)
+endfunction()
 
 #=============================================================
 # _GTK2_FIND_LIBRARY
@@ -343,7 +343,7 @@ function(_GTK2_FIND_LIBRARY _var _lib _expand_vc _append_version)
         set(${_var}_DEBUG ${${_var}})
         set(${_var}_DEBUG ${${_var}} PARENT_SCOPE)
     endif()
-endfunction(_GTK2_FIND_LIBRARY)
+endfunction()
 
 #=============================================================
 
diff --git a/Modules/FindGettext.cmake b/Modules/FindGettext.cmake
index a801a29c8..c4774d94b 100644
--- a/Modules/FindGettext.cmake
+++ b/Modules/FindGettext.cmake
@@ -52,7 +52,7 @@ if(GETTEXT_MSGMERGE_EXECUTABLE)
       string(REGEX REPLACE "^msgmerge \\([^\\)]*\\) ([0-9\\.]+[^ \n]*).*" "\\1" GETTEXT_VERSION_STRING "${gettext_version}")
    endif()
    unset(gettext_version)
-endif(GETTEXT_MSGMERGE_EXECUTABLE)
+endif()
 
 include(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gettext
@@ -85,7 +85,7 @@ macro(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg)
    if(${_firstPoFile} STREQUAL "ALL")
       set(_addToAll "ALL")
       set(_firstPoFile)
-   endif(${_firstPoFile} STREQUAL "ALL")
+   endif()
 
    foreach (_currentPoFile ${_firstPoFile} ${ARGN})
       get_filename_component(_absFile ${_currentPoFile} ABSOLUTE)
@@ -103,7 +103,7 @@ macro(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg)
       install(FILES ${_gmoFile} DESTINATION share/locale/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
       set(_gmoFiles ${_gmoFiles} ${_gmoFile})
 
-   endforeach (_currentPoFile )
+   endforeach ()
 
    if(NOT TARGET translations)
       add_custom_target(translations)
@@ -115,7 +115,7 @@ macro(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg)
 
    add_dependencies(translations ${uniqueTargetName})
 
-endmacro(GETTEXT_CREATE_TRANSLATIONS )
+endmacro()
 
 
 function(GETTEXT_PROCESS_POT_FILE _potFile)
@@ -148,9 +148,9 @@ function(GETTEXT_PROCESS_POT_FILE _potFile)
 
       if(_parsedArguments_INSTALL_DESTINATION)
          install(FILES ${_gmoFile} DESTINATION ${_parsedArguments_INSTALL_DESTINATION}/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
-      endif(_parsedArguments_INSTALL_DESTINATION)
+      endif()
       list(APPEND _gmoFiles ${_gmoFile})
-   endforeach (_lang )
+   endforeach ()
 
   if(NOT TARGET potfiles)
      add_custom_target(potfiles)
@@ -160,13 +160,13 @@ function(GETTEXT_PROCESS_POT_FILE _potFile)
 
    if(_parsedArguments_ALL)
       add_custom_target(${uniqueTargetName} ALL DEPENDS ${_gmoFiles})
-   else(_parsedArguments_ALL)
+   else()
       add_custom_target(${uniqueTargetName} DEPENDS ${_gmoFiles})
-   endif(_parsedArguments_ALL)
+   endif()
 
    add_dependencies(potfiles ${uniqueTargetName})
 
-endfunction(GETTEXT_PROCESS_POT_FILE)
+endfunction()
 
 
 function(GETTEXT_PROCESS_PO_FILES _lang)
@@ -189,9 +189,9 @@ function(GETTEXT_PROCESS_PO_FILES _lang)
 
       if(_parsedArguments_INSTALL_DESTINATION)
          install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo DESTINATION ${_parsedArguments_INSTALL_DESTINATION}/${_lang}/LC_MESSAGES/ RENAME ${_basename}.mo)
-      endif(_parsedArguments_INSTALL_DESTINATION)
+      endif()
       list(APPEND _gmoFiles ${_gmoFile})
-   endforeach(_current_PO_FILE)
+   endforeach()
 
 
   if(NOT TARGET pofiles)
@@ -202,19 +202,19 @@ function(GETTEXT_PROCESS_PO_FILES _lang)
 
    if(_parsedArguments_ALL)
       add_custom_target(${uniqueTargetName} ALL DEPENDS ${_gmoFiles})
-   else(_parsedArguments_ALL)
+   else()
       add_custom_target(${uniqueTargetName} DEPENDS ${_gmoFiles})
-   endif(_parsedArguments_ALL)
+   endif()
 
    add_dependencies(pofiles ${uniqueTargetName})
 
-endfunction(GETTEXT_PROCESS_PO_FILES)
+endfunction()
 
 if (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
    set(GETTEXT_FOUND TRUE)
-else (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
+else ()
    set(GETTEXT_FOUND FALSE)
    if (GetText_REQUIRED)
       message(FATAL_ERROR "GetText not found")
-   endif (GetText_REQUIRED)
-endif (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
+   endif ()
+endif ()
diff --git a/Modules/FindGit.cmake b/Modules/FindGit.cmake
index f89d1afa3..41d2a7a8c 100644
--- a/Modules/FindGit.cmake
+++ b/Modules/FindGit.cmake
@@ -51,7 +51,7 @@ if(GIT_EXECUTABLE)
     string(REPLACE "git version " "" GIT_VERSION_STRING "${git_version}")
   endif()
   unset(git_version)
-endif(GIT_EXECUTABLE)
+endif()
 
 # Handle the QUIETLY and REQUIRED arguments and set GIT_FOUND to TRUE if
 # all listed variables are TRUE
diff --git a/Modules/FindGnuTLS.cmake b/Modules/FindGnuTLS.cmake
index a05efe6b0..7315f1dd4 100644
--- a/Modules/FindGnuTLS.cmake
+++ b/Modules/FindGnuTLS.cmake
@@ -29,7 +29,7 @@
 if (GNUTLS_INCLUDE_DIR AND GNUTLS_LIBRARY)
    # in cache already
    set(gnutls_FIND_QUIETLY TRUE)
-endif (GNUTLS_INCLUDE_DIR AND GNUTLS_LIBRARY)
+endif ()
 
 if (NOT WIN32)
    # try using pkg-config to get the directories and then use these values
@@ -39,7 +39,7 @@ if (NOT WIN32)
    PKG_CHECK_MODULES(PC_GNUTLS QUIET gnutls)
    set(GNUTLS_DEFINITIONS ${PC_GNUTLS_CFLAGS_OTHER})
    set(GNUTLS_VERSION_STRING ${PC_GNUTLS_VERSION})
-endif (NOT WIN32)
+endif ()
 
 find_path(GNUTLS_INCLUDE_DIR gnutls/gnutls.h
    HINTS
diff --git a/Modules/FindHTMLHelp.cmake b/Modules/FindHTMLHelp.cmake
index d51b3987a..c69e9e948 100644
--- a/Modules/FindHTMLHelp.cmake
+++ b/Modules/FindHTMLHelp.cmake
@@ -51,4 +51,4 @@ if(WIN32)
     HTML_HELP_LIBRARY
     )
 
-endif(WIN32)
+endif()
diff --git a/Modules/FindImageMagick.cmake b/Modules/FindImageMagick.cmake
index 436bb4bb6..bf0961691 100644
--- a/Modules/FindImageMagick.cmake
+++ b/Modules/FindImageMagick.cmake
@@ -104,8 +104,8 @@ function(FIND_IMAGEMAGICK_API component header)
       ${ImageMagick_${component}_LIBRARY}
       )
     set(ImageMagick_LIBRARIES ${ImageMagick_LIBRARIES} PARENT_SCOPE)
-  endif(ImageMagick_${component}_INCLUDE_DIR AND ImageMagick_${component}_LIBRARY)
-endfunction(FIND_IMAGEMAGICK_API)
+  endif()
+endfunction()
 
 function(FIND_IMAGEMAGICK_EXE component)
   set(_IMAGEMAGICK_EXECUTABLE
@@ -116,10 +116,10 @@ function(FIND_IMAGEMAGICK_EXE component)
        PARENT_SCOPE
        )
     set(ImageMagick_${component}_FOUND TRUE PARENT_SCOPE)
-  else(EXISTS ${_IMAGEMAGICK_EXECUTABLE})
+  else()
     set(ImageMagick_${component}_FOUND FALSE PARENT_SCOPE)
-  endif(EXISTS ${_IMAGEMAGICK_EXECUTABLE})
-endfunction(FIND_IMAGEMAGICK_EXE)
+  endif()
+endfunction()
 
 #---------------------------------------------------------------------
 # Start Actual Work
@@ -160,23 +160,23 @@ foreach(component ${ImageMagick_FIND_COMPONENTS}
       Magick MagickCore CORE_RL_magick_
       )
     list(APPEND ImageMagick_REQUIRED_VARS ImageMagick_MagickCore_LIBRARY)
-  else(component STREQUAL "Magick++")
+  else()
     if(ImageMagick_EXECUTABLE_DIR)
       FIND_IMAGEMAGICK_EXE(${component})
-    endif(ImageMagick_EXECUTABLE_DIR)
+    endif()
 
     if(ImageMagick_FIND_COMPONENTS)
       list(FIND ImageMagick_FIND_COMPONENTS ${component} is_requested)
       if(is_requested GREATER -1)
         list(APPEND ImageMagick_REQUIRED_VARS ImageMagick_${component}_EXECUTABLE)
-      endif(is_requested GREATER -1)
+      endif()
     elseif(ImageMagick_${component}_EXECUTABLE)
       # if no components were requested explicitly put all (default) executables
       # in the list
       list(APPEND ImageMagick_DEFAULT_EXECUTABLES ImageMagick_${component}_EXECUTABLE)
-    endif(ImageMagick_FIND_COMPONENTS)
-  endif(component STREQUAL "Magick++")
-endforeach(component)
+    endif()
+  endif()
+endforeach()
 
 if(NOT ImageMagick_FIND_COMPONENTS AND NOT ImageMagick_DEFAULT_EXECUTABLES)
   # No components were requested, and none of the default components were
@@ -199,7 +199,7 @@ if(ImageMagick_mogrify_EXECUTABLE)
     string(REGEX REPLACE "^Version: ImageMagick ([-0-9\\.]+).*" "\\1" ImageMagick_VERSION_STRING "${imagemagick_version}")
   endif()
   unset(imagemagick_version)
-endif(ImageMagick_mogrify_EXECUTABLE)
+endif()
 
 #---------------------------------------------------------------------
 # Standard Package Output
diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake
index 1dae07e7f..0de3f7985 100644
--- a/Modules/FindJNI.cmake
+++ b/Modules/FindJNI.cmake
@@ -59,15 +59,15 @@ macro(java_append_library_directories _var)
         set(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "s390" "s390x")
     elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^sh")
         set(_java_libarch "sh")
-    else(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+    else()
         set(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}")
-    endif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+    endif()
 
     # Append default list architectures if CMAKE_SYSTEM_PROCESSOR was empty or
     # system is non-Linux (where the code above has not been well tested)
     if(NOT _java_libarch OR NOT (CMAKE_SYSTEM_NAME MATCHES "Linux"))
         list(APPEND _java_libarch "i386" "amd64" "ppc")
-    endif(NOT _java_libarch OR NOT (CMAKE_SYSTEM_NAME MATCHES "Linux"))
+    endif()
 
     # Sometimes ${CMAKE_SYSTEM_PROCESSOR} is added to the list to prefer
     # current value to a hardcoded list. Remove possible duplicates.
@@ -78,12 +78,12 @@ macro(java_append_library_directories _var)
             foreach(_libarch ${_java_libarch})
                 string(REPLACE "{libarch}" "${_libarch}" _newpath "${_path}")
                 list(APPEND ${_var} "${_newpath}")
-            endforeach(_libarch)
-        else(_path MATCHES "{libarch}")
+            endforeach()
+        else()
             list(APPEND ${_var} "${_path}")
-        endif(_path MATCHES "{libarch}")
-    endforeach(_path)
-endmacro(java_append_library_directories)
+        endif()
+    endforeach()
+endmacro()
 
 get_filename_component(java_install_version
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit;CurrentVersion]" NAME)
@@ -130,7 +130,7 @@ foreach(dir ${JAVA_AWT_LIBRARY_DIRECTORIES})
     "${dir}/client"
     "${dir}/server"
     )
-endforeach(dir)
+endforeach()
 
 
 set(JAVA_AWT_INCLUDE_DIRECTORIES
@@ -160,43 +160,43 @@ foreach(JAVA_PROG "${JAVA_RUNTIME}" "${JAVA_COMPILE}" "${JAVA_ARCHIVE}")
   foreach(JAVA_INC_PATH ../include ../java/include ../share/java/include)
     if(EXISTS ${jpath}/${JAVA_INC_PATH})
       set(JAVA_AWT_INCLUDE_DIRECTORIES ${JAVA_AWT_INCLUDE_DIRECTORIES} "${jpath}/${JAVA_INC_PATH}")
-    endif(EXISTS ${jpath}/${JAVA_INC_PATH})
-  endforeach(JAVA_INC_PATH)
+    endif()
+  endforeach()
   foreach(JAVA_LIB_PATH
     ../lib ../jre/lib ../jre/lib/i386
     ../java/lib ../java/jre/lib ../java/jre/lib/i386
     ../share/java/lib ../share/java/jre/lib ../share/java/jre/lib/i386)
     if(EXISTS ${jpath}/${JAVA_LIB_PATH})
       set(JAVA_AWT_LIBRARY_DIRECTORIES ${JAVA_AWT_LIBRARY_DIRECTORIES} "${jpath}/${JAVA_LIB_PATH}")
-    endif(EXISTS ${jpath}/${JAVA_LIB_PATH})
-  endforeach(JAVA_LIB_PATH)
-endforeach(JAVA_PROG)
+    endif()
+  endforeach()
+endforeach()
 
 if(APPLE)
   if(EXISTS ~/Library/Frameworks/JavaVM.framework)
     set(JAVA_HAVE_FRAMEWORK 1)
-  endif(EXISTS ~/Library/Frameworks/JavaVM.framework)
+  endif()
   if(EXISTS /Library/Frameworks/JavaVM.framework)
     set(JAVA_HAVE_FRAMEWORK 1)
-  endif(EXISTS /Library/Frameworks/JavaVM.framework)
+  endif()
   if(EXISTS /System/Library/Frameworks/JavaVM.framework)
     set(JAVA_HAVE_FRAMEWORK 1)
-  endif(EXISTS /System/Library/Frameworks/JavaVM.framework)
+  endif()
 
   if(JAVA_HAVE_FRAMEWORK)
     if(NOT JAVA_AWT_LIBRARY)
       set (JAVA_AWT_LIBRARY "-framework JavaVM" CACHE FILEPATH "Java Frameworks" FORCE)
-    endif(NOT JAVA_AWT_LIBRARY)
+    endif()
 
     if(NOT JAVA_JVM_LIBRARY)
       set (JAVA_JVM_LIBRARY "-framework JavaVM" CACHE FILEPATH "Java Frameworks" FORCE)
-    endif(NOT JAVA_JVM_LIBRARY)
+    endif()
 
     if(NOT JAVA_AWT_INCLUDE_PATH)
       if(EXISTS /System/Library/Frameworks/JavaVM.framework/Headers/jawt.h)
         set (JAVA_AWT_INCLUDE_PATH "/System/Library/Frameworks/JavaVM.framework/Headers" CACHE FILEPATH "jawt.h location" FORCE)
-      endif(EXISTS /System/Library/Frameworks/JavaVM.framework/Headers/jawt.h)
-    endif(NOT JAVA_AWT_INCLUDE_PATH)
+      endif()
+    endif()
 
     # If using "-framework JavaVM", prefer its headers *before* the others in
     # JAVA_AWT_INCLUDE_DIRECTORIES... (*prepend* to the list here)
@@ -207,15 +207,15 @@ if(APPLE)
       /System/Library/Frameworks/JavaVM.framework/Headers
       ${JAVA_AWT_INCLUDE_DIRECTORIES}
       )
-  endif(JAVA_HAVE_FRAMEWORK)
-else(APPLE)
+  endif()
+else()
   find_library(JAVA_AWT_LIBRARY jawt
     PATHS ${JAVA_AWT_LIBRARY_DIRECTORIES}
   )
   find_library(JAVA_JVM_LIBRARY NAMES jvm JavaVM
     PATHS ${JAVA_JVM_LIBRARY_DIRECTORIES}
   )
-endif(APPLE)
+endif()
 
 # add in the include path
 find_path(JAVA_INCLUDE_PATH jni.h
diff --git a/Modules/FindJPEG.cmake b/Modules/FindJPEG.cmake
index 9b0d8f48a..7c1f0fd94 100644
--- a/Modules/FindJPEG.cmake
+++ b/Modules/FindJPEG.cmake
@@ -32,12 +32,12 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(JPEG DEFAULT_MSG JPEG_LIBRARY JPEG_INCLUDE_DIR
 
 if(JPEG_FOUND)
   set(JPEG_LIBRARIES ${JPEG_LIBRARY})
-endif(JPEG_FOUND)
+endif()
 
 # Deprecated declarations.
 set (NATIVE_JPEG_INCLUDE_PATH ${JPEG_INCLUDE_DIR} )
 if(JPEG_LIBRARY)
   get_filename_component (NATIVE_JPEG_LIB_PATH ${JPEG_LIBRARY} PATH)
-endif(JPEG_LIBRARY)
+endif()
 
 mark_as_advanced(JPEG_LIBRARY JPEG_INCLUDE_DIR )
diff --git a/Modules/FindJasper.cmake b/Modules/FindJasper.cmake
index c5b865a12..136056b84 100644
--- a/Modules/FindJasper.cmake
+++ b/Modules/FindJasper.cmake
@@ -31,13 +31,13 @@ if (NOT JASPER_LIBRARIES)
 
     include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
     SELECT_LIBRARY_CONFIGURATIONS(JASPER)
-endif (NOT JASPER_LIBRARIES)
+endif ()
 
 if (JASPER_INCLUDE_DIR AND EXISTS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h")
     file(STRINGS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h" jasper_version_str REGEX "^#define[\t ]+JAS_VERSION[\t ]+\".*\".*")
 
     string(REGEX REPLACE "^#define[\t ]+JAS_VERSION[\t ]+\"([^\"]+)\".*" "\\1" JASPER_VERSION_STRING "${jasper_version_str}")
-endif (JASPER_INCLUDE_DIR AND EXISTS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h")
+endif ()
 
 # handle the QUIETLY and REQUIRED arguments and set JASPER_FOUND to TRUE if
 # all listed variables are TRUE
@@ -48,6 +48,6 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Jasper
 
 if (JASPER_FOUND)
    set(JASPER_LIBRARIES ${JASPER_LIBRARIES} ${JPEG_LIBRARIES} )
-endif (JASPER_FOUND)
+endif ()
 
 mark_as_advanced(JASPER_INCLUDE_DIR)
diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake
index 24af0e00b..1b4593d9c 100644
--- a/Modules/FindJava.cmake
+++ b/Modules/FindJava.cmake
@@ -118,7 +118,7 @@ if(Java_JAVA_EXECUTABLE)
       else()
         if(NOT Java_FIND_QUIETLY)
           message(WARNING "regex not supported: ${var}. Please report")
-        endif(NOT Java_FIND_QUIETLY)
+        endif()
       endif()
       string( REGEX REPLACE "([0-9]+).*" "\\1" Java_VERSION_MAJOR "${Java_VERSION_STRING}" )
       string( REGEX REPLACE "[0-9]+\\.([0-9]+).*" "\\1" Java_VERSION_MINOR "${Java_VERSION_STRING}" )
@@ -127,12 +127,12 @@ if(Java_JAVA_EXECUTABLE)
       string( REGEX REPLACE "[0-9]+\\.[0-9]+\\.[0-9]+[_\\.]?([0-9]*).*$" "\\1" Java_VERSION_TWEAK "${Java_VERSION_STRING}" )
       if( Java_VERSION_TWEAK STREQUAL "" ) # check case where tweak is not defined
         set(Java_VERSION ${Java_VERSION_MAJOR}.${Java_VERSION_MINOR}.${Java_VERSION_PATCH})
-      else( )
+      else()
         set(Java_VERSION ${Java_VERSION_MAJOR}.${Java_VERSION_MINOR}.${Java_VERSION_PATCH}.${Java_VERSION_TWEAK})
-      endif( )
+      endif()
     endif()
 
-endif(Java_JAVA_EXECUTABLE)
+endif()
 
 
 find_program(Java_JAR_EXECUTABLE
@@ -178,7 +178,7 @@ if(Java_FIND_COMPONENTS)
       message(FATAL_ERROR "Comp: ${component} is not handled")
     endif()
     set(Java_${component}_FOUND TRUE)
-  endforeach(component)
+  endforeach()
 else()
   # Check for everything
   find_package_handle_standard_args(Java
diff --git a/Modules/FindKDE3.cmake b/Modules/FindKDE3.cmake
index a8d30a890..a09211684 100644
--- a/Modules/FindKDE3.cmake
+++ b/Modules/FindKDE3.cmake
@@ -79,19 +79,19 @@
 
 if(NOT UNIX AND KDE3_FIND_REQUIRED)
    message(FATAL_ERROR "Compiling KDE3 applications and libraries under Windows is not supported")
-endif(NOT UNIX AND KDE3_FIND_REQUIRED)
+endif()
 
 # If Qt4 has already been found, fail.
 if(QT4_FOUND)
   if(KDE3_FIND_REQUIRED)
     message( FATAL_ERROR "KDE3/Qt3 and Qt4 cannot be used together in one project.")
-  else(KDE3_FIND_REQUIRED)
+  else()
     if(NOT KDE3_FIND_QUIETLY)
       message( STATUS    "KDE3/Qt3 and Qt4 cannot be used together in one project.")
-    endif(NOT KDE3_FIND_QUIETLY)
+    endif()
     return()
-  endif(KDE3_FIND_REQUIRED)
-endif(QT4_FOUND)
+  endif()
+endif()
 
 
 set(QT_MT_REQUIRED TRUE)
@@ -100,7 +100,7 @@ set(QT_MT_REQUIRED TRUE)
 #this line includes FindQt.cmake, which searches the Qt library and headers
 if(KDE3_FIND_REQUIRED)
   set(_REQ_STRING_KDE3 "REQUIRED")
-endif(KDE3_FIND_REQUIRED)
+endif()
 
 find_package(Qt3 ${_REQ_STRING_KDE3})
 find_package(X11 ${_REQ_STRING_KDE3})
@@ -126,8 +126,8 @@ if(KDECONFIG_EXECUTABLE)
                         OUTPUT_VARIABLE kdedir )
       string(REGEX REPLACE "\n" "" KDE3PREFIX "${kdedir}")
 
-    endif ("${kde_version}" MATCHES "KDE: 3\\.")
-endif(KDECONFIG_EXECUTABLE)
+    endif ()
+endif()
 
 
 
@@ -161,10 +161,10 @@ get_filename_component(KDE3_LIB_DIR ${KDE3_KDECORE_LIBRARY} PATH )
 if(NOT KDE3_LIBTOOL_DIR)
    if(KDE3_KDECORE_LIBRARY MATCHES lib64)
      set(KDE3_LIBTOOL_DIR /lib64/kde3)
-   else(KDE3_KDECORE_LIBRARY MATCHES lib64)
+   else()
      set(KDE3_LIBTOOL_DIR /lib/kde3)
-   endif(KDE3_KDECORE_LIBRARY MATCHES lib64)
-endif(NOT KDE3_LIBTOOL_DIR)
+   endif()
+endif()
 
 #now search for the dcop utilities
 find_program(KDE3_DCOPIDL_EXECUTABLE NAMES dcopidl
@@ -198,9 +198,9 @@ find_program(KDE3_KCFGC_EXECUTABLE NAMES kconfig_compiler
 #SET KDE3_FOUND
 if (KDE3_INCLUDE_DIR AND KDE3_LIB_DIR AND KDE3_DCOPIDL_EXECUTABLE AND KDE3_DCOPIDL2CPP_EXECUTABLE AND KDE3_KCFGC_EXECUTABLE)
    set(KDE3_FOUND TRUE)
-else (KDE3_INCLUDE_DIR AND KDE3_LIB_DIR AND KDE3_DCOPIDL_EXECUTABLE AND KDE3_DCOPIDL2CPP_EXECUTABLE AND KDE3_KCFGC_EXECUTABLE)
+else ()
    set(KDE3_FOUND FALSE)
-endif (KDE3_INCLUDE_DIR AND KDE3_LIB_DIR AND KDE3_DCOPIDL_EXECUTABLE AND KDE3_DCOPIDL2CPP_EXECUTABLE AND KDE3_KCFGC_EXECUTABLE)
+endif ()
 
 # add some KDE specific stuff
 set(KDE3_DEFINITIONS -DQT_CLEAN_NAMESPACE -D_GNU_SOURCE)
@@ -216,32 +216,32 @@ if(KDE3_FOUND)
       # I guess 2.95 also doesn't then
       if("${out}" MATCHES "2.9[56]")
          set(_KDE3_USE_FLAGS FALSE)
-      endif("${out}" MATCHES "2.9[56]")
-   endif(CMAKE_COMPILER_IS_GNUCXX)
+      endif()
+   endif()
 
    #only on linux, but NOT e.g. on FreeBSD:
    if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND _KDE3_USE_FLAGS)
       set (KDE3_DEFINITIONS ${KDE3_DEFINITIONS} -D_XOPEN_SOURCE=500 -D_BSD_SOURCE)
       set ( CMAKE_C_FLAGS     "${CMAKE_C_FLAGS} -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common")
       set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -fno-exceptions -fno-check-new -fno-common")
-   endif(CMAKE_SYSTEM_NAME MATCHES "Linux" AND _KDE3_USE_FLAGS)
+   endif()
 
    # works on FreeBSD, NOT tested on NetBSD and OpenBSD
    if (CMAKE_SYSTEM_NAME MATCHES BSD AND _KDE3_USE_FLAGS)
       set ( CMAKE_C_FLAGS     "${CMAKE_C_FLAGS} -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common")
       set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common")
-   endif (CMAKE_SYSTEM_NAME MATCHES BSD AND _KDE3_USE_FLAGS)
+   endif ()
 
    # if no special buildtype is selected, add -O2 as default optimization
    if (NOT CMAKE_BUILD_TYPE AND _KDE3_USE_FLAGS)
       set ( CMAKE_C_FLAGS     "${CMAKE_C_FLAGS} -O2")
       set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
-   endif (NOT CMAKE_BUILD_TYPE AND _KDE3_USE_FLAGS)
+   endif ()
 
 #set(CMAKE_SHARED_LINKER_FLAGS "-avoid-version -module -Wl,--no-undefined -Wl,--allow-shlib-undefined")
 #set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -avoid-version -Wl,--no-undefined -lc")
 #set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings -avoid-version -Wl,--no-undefined -lc")
-endif(KDE3_FOUND)
+endif()
 
 
 # KDE3Macros.cmake contains all the KDE specific macros
@@ -251,35 +251,35 @@ include(KDE3Macros)
 macro (KDE3_PRINT_RESULTS)
    if(KDE3_INCLUDE_DIR)
       message(STATUS "Found KDE3 include dir: ${KDE3_INCLUDE_DIR}")
-   else(KDE3_INCLUDE_DIR)
+   else()
       message(STATUS "Didn't find KDE3 headers")
-   endif(KDE3_INCLUDE_DIR)
+   endif()
 
    if(KDE3_LIB_DIR)
       message(STATUS "Found KDE3 library dir: ${KDE3_LIB_DIR}")
-   else(KDE3_LIB_DIR)
+   else()
       message(STATUS "Didn't find KDE3 core library")
-   endif(KDE3_LIB_DIR)
+   endif()
 
    if(KDE3_DCOPIDL_EXECUTABLE)
       message(STATUS "Found KDE3 dcopidl preprocessor: ${KDE3_DCOPIDL_EXECUTABLE}")
-   else(KDE3_DCOPIDL_EXECUTABLE)
+   else()
       message(STATUS "Didn't find the KDE3 dcopidl preprocessor")
-   endif(KDE3_DCOPIDL_EXECUTABLE)
+   endif()
 
    if(KDE3_DCOPIDL2CPP_EXECUTABLE)
       message(STATUS "Found KDE3 dcopidl2cpp preprocessor: ${KDE3_DCOPIDL2CPP_EXECUTABLE}")
-   else(KDE3_DCOPIDL2CPP_EXECUTABLE)
+   else()
       message(STATUS "Didn't find the KDE3 dcopidl2cpp preprocessor")
-   endif(KDE3_DCOPIDL2CPP_EXECUTABLE)
+   endif()
 
    if(KDE3_KCFGC_EXECUTABLE)
       message(STATUS "Found KDE3 kconfig_compiler preprocessor: ${KDE3_KCFGC_EXECUTABLE}")
-   else(KDE3_KCFGC_EXECUTABLE)
+   else()
       message(STATUS "Didn't find the KDE3 kconfig_compiler preprocessor")
-   endif(KDE3_KCFGC_EXECUTABLE)
+   endif()
 
-endmacro (KDE3_PRINT_RESULTS)
+endmacro ()
 
 
 if (KDE3_FIND_REQUIRED AND NOT KDE3_FOUND)
@@ -287,12 +287,12 @@ if (KDE3_FIND_REQUIRED AND NOT KDE3_FOUND)
    KDE3_PRINT_RESULTS()
    message(FATAL_ERROR "Could NOT find everything required for compiling KDE 3 programs")
 
-endif (KDE3_FIND_REQUIRED AND NOT KDE3_FOUND)
+endif ()
 
 
 if (NOT KDE3_FIND_QUIETLY)
    KDE3_PRINT_RESULTS()
-endif (NOT KDE3_FIND_QUIETLY)
+endif ()
 
 #add the found Qt and KDE include directories to the current include path
 set(KDE3_INCLUDE_DIRS ${QT_INCLUDE_DIR} ${KDE3_INCLUDE_DIR})
diff --git a/Modules/FindKDE4.cmake b/Modules/FindKDE4.cmake
index 9cff20ebb..c653a04cd 100644
--- a/Modules/FindKDE4.cmake
+++ b/Modules/FindKDE4.cmake
@@ -27,13 +27,13 @@
 if(QT_QT_LIBRARY)
   if(KDE4_FIND_REQUIRED)
     message( FATAL_ERROR "KDE4/Qt4 and Qt3 cannot be used together in one project.")
-  else(KDE4_FIND_REQUIRED)
+  else()
     if(NOT KDE4_FIND_QUIETLY)
       message( STATUS    "KDE4/Qt4 and Qt3 cannot be used together in one project.")
-    endif(NOT KDE4_FIND_QUIETLY)
+    endif()
     return()
-  endif(KDE4_FIND_REQUIRED)
-endif(QT_QT_LIBRARY)
+  endif()
+endif()
 
 file(TO_CMAKE_PATH "$ENV{KDEDIRS}" _KDEDIRS)
 
@@ -56,8 +56,8 @@ find_program(KDE4_KDECONFIG_EXECUTABLE NAMES kde4-config
 if (NOT KDE4_KDECONFIG_EXECUTABLE)
    if (KDE4_FIND_REQUIRED)
       message(FATAL_ERROR "ERROR: Could not find KDE4 kde4-config")
-   endif (KDE4_FIND_REQUIRED)
-endif (NOT KDE4_KDECONFIG_EXECUTABLE)
+   endif ()
+endif ()
 
 
 # when cross compiling, KDE4_DATA_DIR may be already preset
@@ -66,7 +66,7 @@ if(NOT KDE4_DATA_DIR)
       # when cross compiling, don't run kde4-config but use its location as install dir
       get_filename_component(KDE4_DATA_DIR "${KDE4_KDECONFIG_EXECUTABLE}" PATH)
       get_filename_component(KDE4_DATA_DIR "${KDE4_DATA_DIR}" PATH)
-   else(CMAKE_CROSSCOMPILING)
+   else()
       # then ask kde4-config for the kde data dirs
 
       if(KDE4_KDECONFIG_EXECUTABLE)
@@ -74,9 +74,9 @@ if(NOT KDE4_DATA_DIR)
         file(TO_CMAKE_PATH "${_data_DIR}" _data_DIR)
         # then check the data dirs for FindKDE4Internal.cmake
         find_path(KDE4_DATA_DIR cmake/modules/FindKDE4Internal.cmake HINTS ${_data_DIR})
-      endif(KDE4_KDECONFIG_EXECUTABLE)
-   endif(CMAKE_CROSSCOMPILING)
-endif(NOT KDE4_DATA_DIR)
+      endif()
+   endif()
+endif()
 
 # if it has been found...
 if (KDE4_DATA_DIR)
@@ -85,16 +85,16 @@ if (KDE4_DATA_DIR)
 
    if (KDE4_FIND_QUIETLY)
       set(_quiet QUIET)
-   endif (KDE4_FIND_QUIETLY)
+   endif ()
 
    if (KDE4_FIND_REQUIRED)
       set(_req REQUIRED)
-   endif (KDE4_FIND_REQUIRED)
+   endif ()
 
    # use FindKDE4Internal.cmake to do the rest
    find_package(KDE4Internal ${_req} ${_quiet})
-else (KDE4_DATA_DIR)
+else ()
    if (KDE4_FIND_REQUIRED)
       message(FATAL_ERROR "ERROR: cmake/modules/FindKDE4Internal.cmake not found in ${_data_DIR}")
-   endif (KDE4_FIND_REQUIRED)
-endif (KDE4_DATA_DIR)
+   endif ()
+endif ()
diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake
index b867f2133..430e45f2c 100644
--- a/Modules/FindLAPACK.cmake
+++ b/Modules/FindLAPACK.cmake
@@ -41,9 +41,9 @@ set(_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
 get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES)
 if (NOT _LANGUAGES_ MATCHES Fortran)
 include(CheckFunctionExists)
-else (NOT _LANGUAGES_ MATCHES Fortran)
+else ()
 include(CheckFortranFunctionExists)
-endif (NOT _LANGUAGES_ MATCHES Fortran)
+endif ()
 
 set(LAPACK_FOUND FALSE)
 set(LAPACK95_FOUND FALSE)
@@ -81,18 +81,18 @@ foreach(_library ${_list})
     if (BLA_STATIC)
       if (WIN32)
         set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
-      endif ( WIN32 )
+      endif ()
       if (APPLE)
         set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
-      else (APPLE)
+      else ()
         set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
-      endif (APPLE)
-    else (BLA_STATIC)
+      endif ()
+    else ()
 			if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
         # for ubuntu's libblas3gf and liblapack3gf packages
         set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf)
       endif ()
-    endif (BLA_STATIC)
+    endif ()
     find_library(${_prefix}_${_library}_LIBRARY
       NAMES ${_library}
       PATHS ${_libdir}
@@ -100,35 +100,35 @@ foreach(_library ${_list})
     mark_as_advanced(${_prefix}_${_library}_LIBRARY)
     set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
     set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
-  endif(_libraries_work)
-endforeach(_library ${_list})
+  endif()
+endforeach()
 
 if(_libraries_work)
   # Test this combination of libraries.
   if(UNIX AND BLA_STATIC)
     set(CMAKE_REQUIRED_LIBRARIES ${_flags} "-Wl,--start-group" ${${LIBRARIES}} ${_blas} "-Wl,--end-group" ${_threads})
-  else(UNIX AND BLA_STATIC)
+  else()
     set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas} ${_threads})
-  endif(UNIX AND BLA_STATIC)
+  endif()
 #  message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
   if (NOT _LANGUAGES_ MATCHES Fortran)
     check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS)
-  else (NOT _LANGUAGES_ MATCHES Fortran)
+  else ()
     check_fortran_function_exists(${_name} ${_prefix}${_combined_name}_WORKS)
-  endif (NOT _LANGUAGES_ MATCHES Fortran)
+  endif ()
   set(CMAKE_REQUIRED_LIBRARIES)
   mark_as_advanced(${_prefix}${_combined_name}_WORKS)
   set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
   #message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
-endif(_libraries_work)
+endif()
 
  if(_libraries_work)
    set(${LIBRARIES} ${${LIBRARIES}} ${_blas} ${_threads})
- else(_libraries_work)
+ else()
     set(${LIBRARIES} FALSE)
- endif(_libraries_work)
+ endif()
 
-endmacro(Check_Lapack_Libraries)
+endmacro()
 
 
 set(LAPACK_LINKER_FLAGS)
@@ -138,20 +138,20 @@ set(LAPACK95_LIBRARIES)
 
 if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
   find_package(BLAS)
-else(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
+else()
   find_package(BLAS REQUIRED)
-endif(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
+endif()
 
 
 if(BLAS_FOUND)
   set(LAPACK_LINKER_FLAGS ${BLAS_LINKER_FLAGS})
   if ($ENV{BLA_VENDOR} MATCHES ".+")
     set(BLA_VENDOR $ENV{BLA_VENDOR})
-  else ($ENV{BLA_VENDOR} MATCHES ".+")
+  else ()
     if(NOT BLA_VENDOR)
       set(BLA_VENDOR "All")
-    endif(NOT BLA_VENDOR)
-  endif ($ENV{BLA_VENDOR} MATCHES ".+")
+    endif()
+  endif ()
 
 if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
  if(NOT LAPACK_LIBRARIES)
@@ -164,8 +164,8 @@ if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
   "${BLAS_LIBRARIES}"
   ""
   )
- endif(NOT LAPACK_LIBRARIES)
-endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
+ endif()
+endif ()
 
 
 #acml lapack
@@ -187,8 +187,8 @@ if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
   "${BLAS_LIBRARIES}"
   ""
   )
- endif(NOT LAPACK_LIBRARIES)
-endif (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
+ endif()
+endif ()
 if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
   if ( NOT LAPACK_LIBRARIES )
     check_lapack_libraries(
@@ -200,8 +200,8 @@ if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
     "${BLAS_LIBRARIES}"
     ""
     )
-  endif ( NOT LAPACK_LIBRARIES )
-endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
+  endif ()
+endif ()
 # Generic LAPACK library?
 if (BLA_VENDOR STREQUAL "Generic" OR
     BLA_VENDOR STREQUAL "ATLAS" OR
@@ -216,7 +216,7 @@ if (BLA_VENDOR STREQUAL "Generic" OR
     "${BLAS_LIBRARIES}"
     ""
     )
-  endif ( NOT LAPACK_LIBRARIES )
+  endif ()
 endif ()
 #intel lapack
 if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
@@ -226,9 +226,9 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
   if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
     if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
       find_PACKAGE(Threads)
-    else(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
+    else()
       find_package(Threads REQUIRED)
-    endif(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
+    endif()
     if (BLA_F95)
       if(NOT LAPACK95_LIBRARIES)
         # old
@@ -241,7 +241,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
           "${BLAS95_LIBRARIES}"
           "${CMAKE_THREAD_LIBS_INIT};${LM}"
           )
-      endif(NOT LAPACK95_LIBRARIES)
+      endif()
       if(NOT LAPACK95_LIBRARIES)
         # new >= 10.3
         check_lapack_libraries(
@@ -253,8 +253,8 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
           "${BLAS95_LIBRARIES}"
           "${CMAKE_THREAD_LIBS_INIT};${LM}"
           )
-      endif(NOT LAPACK95_LIBRARIES)
-    else(BLA_F95)
+      endif()
+    else()
       if(NOT LAPACK_LIBRARIES)
         # old
         check_lapack_libraries(
@@ -266,7 +266,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
           "${BLAS_LIBRARIES}"
           "${CMAKE_THREAD_LIBS_INIT};${LM}"
           )
-      endif(NOT LAPACK_LIBRARIES)
+      endif()
       if(NOT LAPACK_LIBRARIES)
         # new >= 10.3
         check_lapack_libraries(
@@ -278,59 +278,59 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
           "${BLAS_LIBRARIES}"
           "${CMAKE_THREAD_LIBS_INIT};${LM}"
           )
-      endif(NOT LAPACK_LIBRARIES)
-    endif(BLA_F95)
-  endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
-endif(BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
-else(BLAS_FOUND)
+      endif()
+    endif()
+  endif ()
+endif()
+else()
   message(STATUS "LAPACK requires BLAS")
-endif(BLAS_FOUND)
+endif()
 
 if(BLA_F95)
  if(LAPACK95_LIBRARIES)
   set(LAPACK95_FOUND TRUE)
- else(LAPACK95_LIBRARIES)
+ else()
   set(LAPACK95_FOUND FALSE)
- endif(LAPACK95_LIBRARIES)
+ endif()
  if(NOT LAPACK_FIND_QUIETLY)
   if(LAPACK95_FOUND)
     message(STATUS "A library with LAPACK95 API found.")
-  else(LAPACK95_FOUND)
+  else()
     if(LAPACK_FIND_REQUIRED)
       message(FATAL_ERROR
       "A required library with LAPACK95 API not found. Please specify library location."
       )
-    else(LAPACK_FIND_REQUIRED)
+    else()
       message(STATUS
       "A library with LAPACK95 API not found. Please specify library location."
       )
-    endif(LAPACK_FIND_REQUIRED)
-  endif(LAPACK95_FOUND)
- endif(NOT LAPACK_FIND_QUIETLY)
+    endif()
+  endif()
+ endif()
  set(LAPACK_FOUND "${LAPACK95_FOUND}")
  set(LAPACK_LIBRARIES "${LAPACK95_LIBRARIES}")
-else(BLA_F95)
+else()
  if(LAPACK_LIBRARIES)
   set(LAPACK_FOUND TRUE)
- else(LAPACK_LIBRARIES)
+ else()
   set(LAPACK_FOUND FALSE)
- endif(LAPACK_LIBRARIES)
+ endif()
 
  if(NOT LAPACK_FIND_QUIETLY)
   if(LAPACK_FOUND)
     message(STATUS "A library with LAPACK API found.")
-  else(LAPACK_FOUND)
+  else()
     if(LAPACK_FIND_REQUIRED)
       message(FATAL_ERROR
       "A required library with LAPACK API not found. Please specify library location."
       )
-    else(LAPACK_FIND_REQUIRED)
+    else()
       message(STATUS
       "A library with LAPACK API not found. Please specify library location."
       )
-    endif(LAPACK_FIND_REQUIRED)
-  endif(LAPACK_FOUND)
- endif(NOT LAPACK_FIND_QUIETLY)
-endif(BLA_F95)
+    endif()
+  endif()
+ endif()
+endif()
 
 set(CMAKE_FIND_LIBRARY_SUFFIXES ${_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
diff --git a/Modules/FindLATEX.cmake b/Modules/FindLATEX.cmake
index 020272724..bc752a95a 100644
--- a/Modules/FindLATEX.cmake
+++ b/Modules/FindLATEX.cmake
@@ -58,7 +58,7 @@ if (WIN32)
   )
   mark_as_advanced(GHOSTSCRIPT_LIBRARY_PATH)
 
-endif (WIN32)
+endif ()
 
 find_program(LATEX_COMPILER
   NAMES latex
@@ -101,11 +101,11 @@ if (WIN32)
     NAMES ps2pdf14.bat
     PATHS ${GHOSTSCRIPT_LIBRARY_PATH}
   )
-else (WIN32)
+else ()
   find_program(PS2PDF_CONVERTER
     NAMES ps2pdf14 ps2pdf
   )
-endif (WIN32)
+endif ()
 
 find_program(LATEX2HTML_CONVERTER
   NAMES latex2html
diff --git a/Modules/FindLibLZMA.cmake b/Modules/FindLibLZMA.cmake
index 852d61314..37cace822 100644
--- a/Modules/FindLibLZMA.cmake
+++ b/Modules/FindLibLZMA.cmake
@@ -40,7 +40,7 @@ if(LIBLZMA_INCLUDE_DIR AND EXISTS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h")
     string(REGEX REPLACE ".*#define LZMA_VERSION_PATCH ([0-9]+).*" "\\1" LIBLZMA_VERSION_PATCH "${LIBLZMA_HEADER_CONTENTS}")
 
     set(LIBLZMA_VERSION_STRING "${LIBLZMA_VERSION_MAJOR}.${LIBLZMA_VERSION_MINOR}.${LIBLZMA_VERSION_PATCH}")
-endif(LIBLZMA_INCLUDE_DIR AND EXISTS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h")
+endif()
 
 # We're using new code known now as XZ, even library still been called LZMA
 # it can be found in http://tukaani.org/xz/
@@ -50,7 +50,7 @@ if (LIBLZMA_LIBRARY)
    CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY} lzma_auto_decoder "" LIBLZMA_HAS_AUTO_DECODER)
    CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY} lzma_easy_encoder "" LIBLZMA_HAS_EASY_ENCODER)
    CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY} lzma_lzma_preset "" LIBLZMA_HAS_LZMA_PRESET)
-endif (LIBLZMA_LIBRARY)
+endif ()
 
 include(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibLZMA  REQUIRED_VARS  LIBLZMA_INCLUDE_DIR
@@ -64,6 +64,6 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibLZMA  REQUIRED_VARS  LIBLZMA_INCLUDE_DIR
 if (LIBLZMA_FOUND)
     set(LIBLZMA_LIBRARIES ${LIBLZMA_LIBRARY})
     set(LIBLZMA_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIR})
-endif (LIBLZMA_FOUND)
+endif ()
 
 mark_as_advanced( LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY )
diff --git a/Modules/FindLua50.cmake b/Modules/FindLua50.cmake
index cfe2e7294..2b8ee9787 100644
--- a/Modules/FindLua50.cmake
+++ b/Modules/FindLua50.cmake
@@ -55,7 +55,7 @@ find_library(LUA_LIBRARY_lua
 # (like GLU in OpenGL.framework)
 if(${LUA_LIBRARY_lua} MATCHES "framework")
   set( LUA_LIBRARIES "${LUA_LIBRARY_lua}" CACHE STRING "Lua framework")
-else(${LUA_LIBRARY_lua} MATCHES "framework")
+else()
   find_library(LUA_LIBRARY_lualib
     NAMES lualib50 lualib5.0 lualib5 lualib
     HINTS
@@ -74,11 +74,11 @@ else(${LUA_LIBRARY_lua} MATCHES "framework")
       find_library(MATH_LIBRARY_FOR_LUA m)
       set( LUA_LIBRARIES "${LUA_LIBRARY_lualib};${LUA_LIBRARY_lua};${MATH_LIBRARY_FOR_LUA}" CACHE STRING "This is the concatentation of lua and lualib libraries")
     # For Windows and Mac, don't need to explicitly include the math library
-    else(UNIX AND NOT APPLE)
+    else()
       set( LUA_LIBRARIES "${LUA_LIBRARY_lualib};${LUA_LIBRARY_lua}" CACHE STRING "This is the concatentation of lua and lualib libraries")
-    endif(UNIX AND NOT APPLE)
-  endif(LUA_LIBRARY_lualib AND LUA_LIBRARY_lua)
-endif(${LUA_LIBRARY_lua} MATCHES "framework")
+    endif()
+  endif()
+endif()
 
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
diff --git a/Modules/FindLua51.cmake b/Modules/FindLua51.cmake
index 2d189e4c6..b5a547141 100644
--- a/Modules/FindLua51.cmake
+++ b/Modules/FindLua51.cmake
@@ -58,10 +58,10 @@ if(LUA_LIBRARY)
     find_library(LUA_MATH_LIBRARY m)
     set( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
   # For Windows and Mac, don't need to explicitly include the math library
-  else(UNIX AND NOT APPLE)
+  else()
     set( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")
-  endif(UNIX AND NOT APPLE)
-endif(LUA_LIBRARY)
+  endif()
+endif()
 
 if(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
   file(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")
diff --git a/Modules/FindMFC.cmake b/Modules/FindMFC.cmake
index f45046dca..4ff7586dc 100644
--- a/Modules/FindMFC.cmake
+++ b/Modules/FindMFC.cmake
@@ -24,7 +24,7 @@ set(MFC_FOUND "NO")
 set(MFC_ATTEMPT_TRY_COMPILE 0)
 if(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW)
   set(MFC_ATTEMPT_TRY_COMPILE 1)
-endif(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW)
+endif()
 
 if(MFC_ATTEMPT_TRY_COMPILE)
   if("MFC_HAVE_MFC" MATCHES "^MFC_HAVE_MFC$")
@@ -45,16 +45,16 @@ if(MFC_ATTEMPT_TRY_COMPILE)
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if MFC exists passed with the following output:\n"
         "${OUTPUT}\n\n")
-    else(MFC_HAVE_MFC)
+    else()
       message(STATUS "Looking for MFC - not found")
       set(MFC_HAVE_MFC 0 CACHE INTERNAL "Have MFC?")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if MFC exists failed with the following output:\n"
         "${OUTPUT}\n\n")
-    endif(MFC_HAVE_MFC)
-  endif("MFC_HAVE_MFC" MATCHES "^MFC_HAVE_MFC$")
+    endif()
+  endif()
 
   if(MFC_HAVE_MFC)
     set(MFC_FOUND "YES")
-  endif(MFC_HAVE_MFC)
-endif(MFC_ATTEMPT_TRY_COMPILE)
+  endif()
+endif()
diff --git a/Modules/FindMPEG.cmake b/Modules/FindMPEG.cmake
index 698329e9b..f99f87b87 100644
--- a/Modules/FindMPEG.cmake
+++ b/Modules/FindMPEG.cmake
@@ -39,6 +39,6 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(MPEG DEFAULT_MSG MPEG_INCLUDE_DIR MPEG_mpeg2_L
 
 if(MPEG_FOUND)
   set( MPEG_LIBRARIES ${MPEG_mpeg2_LIBRARY} ${MPEG_vo_LIBRARY} )
-endif(MPEG_FOUND)
+endif()
 
 mark_as_advanced(MPEG_INCLUDE_DIR MPEG_mpeg2_LIBRARY MPEG_vo_LIBRARY)
diff --git a/Modules/FindMPEG2.cmake b/Modules/FindMPEG2.cmake
index 153ed7f57..0290ecaf2 100644
--- a/Modules/FindMPEG2.cmake
+++ b/Modules/FindMPEG2.cmake
@@ -48,7 +48,7 @@ if(MPEG2_FOUND)
   include( FindSDL )
   if(SDL_FOUND)
     set( MPEG2_LIBRARIES ${MPEG2_LIBRARIES} ${SDL_LIBRARY})
-  endif(SDL_FOUND)
-endif(MPEG2_FOUND)
+  endif()
+endif()
 
 mark_as_advanced(MPEG2_INCLUDE_DIR MPEG2_mpeg2_LIBRARY MPEG2_vo_LIBRARY)
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index 20dc1daf9..803848806 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -23,22 +23,22 @@ set(MATLAB_FOUND 0)
 if(WIN32)
   if(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
     set(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/msvc60")
-  else(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
+  else()
     if(${CMAKE_GENERATOR} MATCHES "Visual Studio 7")
       # Assume people are generally using 7.1,
       # if using 7.0 need to link to: ../extern/lib/win32/microsoft/msvc70
       set(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/msvc71")
-    else(${CMAKE_GENERATOR} MATCHES "Visual Studio 7")
+    else()
       if(${CMAKE_GENERATOR} MATCHES "Borland")
         # Same here, there are also: bcc50 and bcc51 directories
         set(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/bcc54")
-      else(${CMAKE_GENERATOR} MATCHES "Borland")
+      else()
         if(MATLAB_FIND_REQUIRED)
           message(FATAL_ERROR "Generator not compatible: ${CMAKE_GENERATOR}")
-        endif(MATLAB_FIND_REQUIRED)
-      endif(${CMAKE_GENERATOR} MATCHES "Borland")
-    endif(${CMAKE_GENERATOR} MATCHES "Visual Studio 7")
-  endif(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
+        endif()
+      endif()
+    endif()
+  endif()
   find_library(MATLAB_MEX_LIBRARY
     libmex
     ${MATLAB_ROOT}
@@ -56,7 +56,7 @@ if(WIN32)
     "mex.h"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/include"
     )
-else( WIN32 )
+else()
   if(CMAKE_SIZEOF_VOID_P EQUAL 4)
     # Regular x86
     set(MATLAB_ROOT
@@ -65,7 +65,7 @@ else( WIN32 )
       $ENV{HOME}/matlab-7sp1/bin/glnx86/
       $ENV{HOME}/redhat-matlab/bin/glnx86/
       )
-  else(CMAKE_SIZEOF_VOID_P EQUAL 4)
+  else()
     # AMD64:
     set(MATLAB_ROOT
       /usr/local/matlab-7sp1/bin/glnxa64/
@@ -74,7 +74,7 @@ else( WIN32 )
       $ENV{HOME}/matlab-7sp1/bin/glnxa64/
       $ENV{HOME}/redhat-matlab/bin/glnxa64/
       )
-  endif(CMAKE_SIZEOF_VOID_P EQUAL 4)
+  endif()
   find_library(MATLAB_MEX_LIBRARY
     mex
     ${MATLAB_ROOT}
@@ -95,7 +95,7 @@ else( WIN32 )
     "$ENV{HOME}/redhat-matlab/extern/include/"
     )
 
-endif(WIN32)
+endif()
 
 # This is common to UNIX and Win32:
 set(MATLAB_LIBRARIES
@@ -106,7 +106,7 @@ set(MATLAB_LIBRARIES
 
 if(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)
   set(MATLAB_FOUND 1)
-endif(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)
+endif()
 
 mark_as_advanced(
   MATLAB_LIBRARIES
diff --git a/Modules/FindMotif.cmake b/Modules/FindMotif.cmake
index 5b7e6a108..5065e3a2d 100644
--- a/Modules/FindMotif.cmake
+++ b/Modules/FindMotif.cmake
@@ -30,7 +30,7 @@ if(UNIX)
     /usr/openwin/lib
     )
 
-endif(UNIX)
+endif()
 
 # handle the QUIETLY and REQUIRED arguments and set MOTIF_FOUND to TRUE if
 # all listed variables are TRUE
diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake
index 15650117b..a6f450385 100644
--- a/Modules/FindOpenGL.cmake
+++ b/Modules/FindOpenGL.cmake
@@ -37,19 +37,19 @@ if (WIN32)
 
     find_library(OPENGL_glu_LIBRARY glu32 )
 
-  else (CYGWIN)
+  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(BORLAND)
+    else()
       set (OPENGL_gl_LIBRARY opengl32 CACHE STRING "OpenGL library for win32")
       set (OPENGL_glu_LIBRARY glu32 CACHE STRING "GLU library for win32")
-    endif(BORLAND)
+    endif()
 
-  endif (CYGWIN)
+  endif ()
 
-else (WIN32)
+else ()
 
   if (APPLE)
 
@@ -57,16 +57,16 @@ else (WIN32)
     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")
 
-  else(APPLE)
+  else()
     # 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(HPUX_IA_OPENGL_LIB_PATH /opt/graphics/OpenGL/lib/hpux32/)
-    else(CMAKE_SIZEOF_VOID_P EQUAL 4)
+    else()
       set(HPUX_IA_OPENGL_LIB_PATH
         /opt/graphics/OpenGL/lib/hpux64/
         /opt/graphics/OpenGL/lib/pa20_64)
-    endif(CMAKE_SIZEOF_VOID_P EQUAL 4)
+    endif()
 
     # The first line below is to make sure that the proper headers
     # are used on a Linux machine with the NVidia drivers installed.
@@ -104,13 +104,13 @@ else (WIN32)
     if (OPENGL_gl_LIBRARY)
       if(NOT X11_FOUND)
         include(FindX11)
-      endif(NOT X11_FOUND)
+      endif()
       if (X11_FOUND)
         if (NOT APPLE)
           set (OPENGL_LIBRARIES ${X11_LIBRARIES})
-        endif (NOT APPLE)
-      endif (X11_FOUND)
-    endif (OPENGL_gl_LIBRARY)
+        endif ()
+      endif ()
+    endif ()
 
     find_library(OPENGL_glu_LIBRARY
       NAMES GLU MesaGLU
@@ -120,29 +120,29 @@ else (WIN32)
             /usr/shlib /usr/X11R6/lib
     )
 
-  endif(APPLE)
-endif (WIN32)
+  endif()
+endif ()
 
 if(OPENGL_gl_LIBRARY)
 
     if(OPENGL_xmesa_INCLUDE_DIR)
       set( OPENGL_XMESA_FOUND "YES" )
-    else(OPENGL_xmesa_INCLUDE_DIR)
+    else()
       set( OPENGL_XMESA_FOUND "NO" )
-    endif(OPENGL_xmesa_INCLUDE_DIR)
+    endif()
 
     set( OPENGL_LIBRARIES  ${OPENGL_gl_LIBRARY} ${OPENGL_LIBRARIES})
     if(OPENGL_glu_LIBRARY)
       set( OPENGL_GLU_FOUND "YES" )
       set( OPENGL_LIBRARIES ${OPENGL_glu_LIBRARY} ${OPENGL_LIBRARIES} )
-    else(OPENGL_glu_LIBRARY)
+    else()
       set( OPENGL_GLU_FOUND "NO" )
-    endif(OPENGL_glu_LIBRARY)
+    endif()
 
     # This deprecated setting is for backward compatibility with CMake1.4
     set (OPENGL_LIBRARY ${OPENGL_LIBRARIES})
 
-endif(OPENGL_gl_LIBRARY)
+endif()
 
 # This deprecated setting is for backward compatibility with CMake1.4
 set(OPENGL_INCLUDE_PATH ${OPENGL_INCLUDE_DIR})
diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake
index 87c9d032d..ad15d8ccc 100644
--- a/Modules/FindOpenMP.cmake
+++ b/Modules/FindOpenMP.cmake
@@ -72,7 +72,7 @@ function(_OPENMP_FLAG_CANDIDATES LANG)
   endif()
 
   set(OpenMP_${LANG}_FLAG_CANDIDATES "${OpenMP_FLAG_CANDIDATES}" PARENT_SCOPE)
-endfunction(_OPENMP_FLAG_CANDIDATES)
+endfunction()
 
 # sample openmp source code to test
 set(OpenMP_C_TEST_SOURCE
@@ -108,8 +108,8 @@ if(CMAKE_C_COMPILER_LOADED)
     if(OpenMP_FLAG_DETECTED)
       set(OpenMP_C_FLAGS_INTERNAL "${FLAG}")
       break()
-    endif(OpenMP_FLAG_DETECTED)
-  endforeach(FLAG ${OpenMP_C_FLAG_CANDIDATES})
+    endif()
+  endforeach()
 
   set(OpenMP_C_FLAGS "${OpenMP_C_FLAGS_INTERNAL}"
     CACHE STRING "C compiler flags for OpenMP parallization")
@@ -142,8 +142,8 @@ if(CMAKE_CXX_COMPILER_LOADED)
     if(OpenMP_FLAG_DETECTED)
       set(OpenMP_CXX_FLAGS_INTERNAL "${FLAG}")
       break()
-    endif(OpenMP_FLAG_DETECTED)
-  endforeach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES})
+    endif()
+  endforeach()
 
   set(OpenMP_CXX_FLAGS "${OpenMP_CXX_FLAGS_INTERNAL}"
     CACHE STRING "C++ compiler flags for OpenMP parallization")
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index b812b22bb..e2cc42702 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -27,7 +27,7 @@
 if (UNIX)
   find_package(PkgConfig QUIET)
   pkg_check_modules(_OPENSSL QUIET openssl)
-endif (UNIX)
+endif ()
 
 if (WIN32)
   # http://www.slproweb.com/products/Win32OpenSSL.html
@@ -162,7 +162,7 @@ if(WIN32 AND NOT CYGWIN)
     set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
     unset(LIB_EAY_NAMES)
     unset(SSL_EAY_NAMES)
-  else(MSVC)
+  else()
     # Not sure what to pick for -say- intel, let's use the toplevel ones and hope someone report issues:
     find_library(LIB_EAY
       NAMES
@@ -186,8 +186,8 @@ if(WIN32 AND NOT CYGWIN)
 
     mark_as_advanced(SSL_EAY LIB_EAY)
     set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
-  endif(MSVC)
-else(WIN32 AND NOT CYGWIN)
+  endif()
+else()
 
   find_library(OPENSSL_SSL_LIBRARY
     NAMES
@@ -219,7 +219,7 @@ else(WIN32 AND NOT CYGWIN)
 
   set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
 
-endif(WIN32 AND NOT CYGWIN)
+endif()
 
 function(from_hex HEX DEC)
   string(TOUPPER "${HEX}" HEX)
@@ -250,7 +250,7 @@ function(from_hex HEX DEC)
   endwhile()
 
   set(${DEC} ${_res} PARENT_SCOPE)
-endfunction(from_hex)
+endfunction()
 
 if (OPENSSL_INCLUDE_DIR)
   if (_OPENSSL_VERSION)
@@ -284,11 +284,11 @@ if (OPENSSL_INCLUDE_DIR)
       # this should be updated to handle that, too. This has not happened yet
       # so it is simply ignored here for now.
       string(ASCII "${OPENSSL_VERSION_PATCH_ASCII}" OPENSSL_VERSION_PATCH_STRING)
-    endif (NOT OPENSSL_VERSION_PATCH STREQUAL "00")
+    endif ()
 
     set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_FIX}${OPENSSL_VERSION_PATCH_STRING}")
-  endif (_OPENSSL_VERSION)
-endif (OPENSSL_INCLUDE_DIR)
+  endif ()
+endif ()
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 
@@ -302,11 +302,11 @@ if (OPENSSL_VERSION)
     FAIL_MESSAGE
       "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
   )
-else (OPENSSL_VERSION)
+else ()
   find_package_handle_standard_args(OpenSSL "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
     OPENSSL_LIBRARIES
     OPENSSL_INCLUDE_DIR
   )
-endif (OPENSSL_VERSION)
+endif ()
 
 mark_as_advanced(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES)
diff --git a/Modules/FindPHP4.cmake b/Modules/FindPHP4.cmake
index 2c6a7c8d0..4267ac155 100644
--- a/Modules/FindPHP4.cmake
+++ b/Modules/FindPHP4.cmake
@@ -39,9 +39,9 @@ if(PHP4_FOUND_INCLUDE_PATH)
   set(php4_paths "${PHP4_POSSIBLE_INCLUDE_PATHS}")
   foreach(php4_path Zend main TSRM)
     set(php4_paths ${php4_paths} "${PHP4_FOUND_INCLUDE_PATH}/${php4_path}")
-  endforeach(php4_path Zend main TSRM)
+  endforeach()
   set(PHP4_INCLUDE_PATH "${php4_paths}" INTERNAL "PHP4 include paths")
-endif(PHP4_FOUND_INCLUDE_PATH)
+endif()
 
 find_program(PHP4_EXECUTABLE NAMES php4 php )
 
@@ -78,8 +78,8 @@ if(APPLE)
     )
     set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
       "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS},-U,${symbol}")
-  endforeach(symbol)
-endif(APPLE)
+  endforeach()
+endif()
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(PHP4 DEFAULT_MSG PHP4_EXECUTABLE PHP4_INCLUDE_PATH)
diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake
index 50cb7d85e..d96d2ccf9 100644
--- a/Modules/FindPNG.cmake
+++ b/Modules/FindPNG.cmake
@@ -30,7 +30,7 @@
 
 if(PNG_FIND_QUIETLY)
   set(_FIND_ZLIB_ARG QUIET)
-endif(PNG_FIND_QUIETLY)
+endif()
 find_package(ZLIB ${_FIND_ZLIB_ARG})
 
 if(ZLIB_FOUND)
@@ -50,20 +50,20 @@ if(ZLIB_FOUND)
       if (CYGWIN)
         if(BUILD_SHARED_LIBS)
            # No need to define PNG_USE_DLL here, because it's default for Cygwin.
-        else(BUILD_SHARED_LIBS)
+        else()
           set (PNG_DEFINITIONS -DPNG_STATIC)
-        endif(BUILD_SHARED_LIBS)
-      endif (CYGWIN)
+        endif()
+      endif ()
 
-  endif (PNG_LIBRARY AND PNG_PNG_INCLUDE_DIR)
+  endif ()
 
   if (PNG_PNG_INCLUDE_DIR AND EXISTS "${PNG_PNG_INCLUDE_DIR}/png.h")
       file(STRINGS "${PNG_PNG_INCLUDE_DIR}/png.h" png_version_str REGEX "^#define[ \t]+PNG_LIBPNG_VER_STRING[ \t]+\".+\"")
 
       string(REGEX REPLACE "^#define[ \t]+PNG_LIBPNG_VER_STRING[ \t]+\"([^\"]+)\".*" "\\1" PNG_VERSION_STRING "${png_version_str}")
       unset(png_version_str)
-  endif (PNG_PNG_INCLUDE_DIR AND EXISTS "${PNG_PNG_INCLUDE_DIR}/png.h")
-endif(ZLIB_FOUND)
+  endif ()
+endif()
 
 # handle the QUIETLY and REQUIRED arguments and set PNG_FOUND to TRUE if
 # all listed variables are TRUE
diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake
index 1dd865281..449fd9f80 100644
--- a/Modules/FindPackageHandleStandardArgs.cmake
+++ b/Modules/FindPackageHandleStandardArgs.cmake
@@ -95,12 +95,12 @@ include(CMakeParseArguments)
 macro(_FPHSA_FAILURE_MESSAGE _msg)
   if (${_NAME}_FIND_REQUIRED)
     message(FATAL_ERROR "${_msg}")
-  else (${_NAME}_FIND_REQUIRED)
+  else ()
     if (NOT ${_NAME}_FIND_QUIETLY)
       message(STATUS "${_msg}")
-    endif (NOT ${_NAME}_FIND_QUIETLY)
-  endif (${_NAME}_FIND_REQUIRED)
-endmacro(_FPHSA_FAILURE_MESSAGE _msg)
+    endif ()
+  endif ()
+endmacro()
 
 
 # internal helper macro to generate the failure message when used in CONFIG_MODE:
@@ -108,7 +108,7 @@ macro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
   # <name>_CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found:
   if(${_NAME}_CONFIG)
     _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: missing: ${MISSING_VARS} (found ${${_NAME}_CONFIG} ${VERSION_MSG})")
-  else(${_NAME}_CONFIG)
+  else()
     # If _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version.
     # List them all in the error message:
     if(${_NAME}_CONSIDERED_CONFIGS)
@@ -119,15 +119,15 @@ macro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
         list(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename)
         list(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version)
         set(configsText "${configsText}    ${filename} (version ${version})\n")
-      endforeach(currentConfigIndex)
+      endforeach()
       _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}")
 
-    else(${_NAME}_CONSIDERED_CONFIGS)
+    else()
       # Simple case: No Config-file was found at all:
       _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake ${VERSION_MSG}")
-    endif(${_NAME}_CONSIDERED_CONFIGS)
-  endif(${_NAME}_CONFIG)
-endmacro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
+    endif()
+  endif()
+endmacro()
 
 
 function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
@@ -144,24 +144,24 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
     set(FPHSA_FAIL_MESSAGE ${_FIRST_ARG})
     set(FPHSA_REQUIRED_VARS ${ARGN})
     set(FPHSA_VERSION_VAR)
-  else(${INDEX} EQUAL -1)
+  else()
 
     CMAKE_PARSE_ARGUMENTS(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}"  ${_FIRST_ARG} ${ARGN})
 
     if(FPHSA_UNPARSED_ARGUMENTS)
       message(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"")
-    endif(FPHSA_UNPARSED_ARGUMENTS)
+    endif()
 
     if(NOT FPHSA_FAIL_MESSAGE)
       set(FPHSA_FAIL_MESSAGE  "DEFAULT_MSG")
-    endif(NOT FPHSA_FAIL_MESSAGE)
-  endif(${INDEX} EQUAL -1)
+    endif()
+  endif()
 
 # now that we collected all arguments, process them
 
   if("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
     set(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}")
-  endif("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
+  endif()
 
   # In config-mode, we rely on the variable <package>_CONFIG, which is set by find_package()
   # when it successfully found the config-file, including version checking:
@@ -169,11 +169,11 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
     list(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG)
     list(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS)
     set(FPHSA_VERSION_VAR ${_NAME}_VERSION)
-  endif(FPHSA_CONFIG_MODE)
+  endif()
 
   if(NOT FPHSA_REQUIRED_VARS)
     message(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()")
-  endif(NOT FPHSA_REQUIRED_VARS)
+  endif()
 
   list(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR)
 
@@ -190,10 +190,10 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
     if(NOT ${_CURRENT_VAR})
       set(${_NAME_UPPER}_FOUND FALSE)
       set(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}")
-    else(NOT ${_CURRENT_VAR})
+    else()
       set(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]")
-    endif(NOT ${_CURRENT_VAR})
-  endforeach(_CURRENT_VAR)
+    endif()
+  endforeach()
 
   # component handling
   unset(FOUND_COMPONENTS_MSG)
@@ -221,10 +221,10 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
         endif()
 
       endif()
-    endforeach(comp)
+    endforeach()
     set(COMPONENT_MSG "${FOUND_COMPONENTS_MSG} ${MISSING_COMPONENTS_MSG}")
     set(DETAILS "${DETAILS}[c${COMPONENT_MSG}]")
-  endif(FPHSA_HANDLE_COMPONENTS)
+  endif()
 
   # version handling:
   set(VERSION_MSG "")
@@ -238,59 +238,59 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
         if (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
           set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
           set(VERSION_OK FALSE)
-        else (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
+        else ()
           set(VERSION_MSG "(found suitable exact version \"${VERSION}\")")
-        endif (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
+        endif ()
 
-      else(${_NAME}_FIND_VERSION_EXACT)     # minimum version specified:
+      else()     # minimum version specified:
         if ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
           set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"")
           set(VERSION_OK FALSE)
-        else ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
+        else ()
           set(VERSION_MSG "(found suitable version \"${VERSION}\", required is \"${${_NAME}_FIND_VERSION}\")")
-        endif ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
-      endif(${_NAME}_FIND_VERSION_EXACT)
+        endif ()
+      endif()
 
-    else(VERSION)
+    else()
 
       # if the package was not found, but a version was given, add that to the output:
       if(${_NAME}_FIND_VERSION_EXACT)
          set(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")")
-      else(${_NAME}_FIND_VERSION_EXACT)
+      else()
          set(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")")
-      endif(${_NAME}_FIND_VERSION_EXACT)
+      endif()
 
-    endif(VERSION)
-  else (${_NAME}_FIND_VERSION)
+    endif()
+  else ()
     if(VERSION)
       set(VERSION_MSG "(found version \"${VERSION}\")")
-    endif(VERSION)
-  endif (${_NAME}_FIND_VERSION)
+    endif()
+  endif ()
 
   if(VERSION_OK)
     set(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]")
-  else(VERSION_OK)
+  else()
     set(${_NAME_UPPER}_FOUND FALSE)
-  endif(VERSION_OK)
+  endif()
 
 
   # print the result:
   if (${_NAME_UPPER}_FOUND)
     FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}")
-  else (${_NAME_UPPER}_FOUND)
+  else ()
 
     if(FPHSA_CONFIG_MODE)
       _FPHSA_HANDLE_FAILURE_CONFIG_MODE()
-    else(FPHSA_CONFIG_MODE)
+    else()
       if(NOT VERSION_OK)
         _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})")
-      else(NOT VERSION_OK)
+      else()
         _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}")
-      endif(NOT VERSION_OK)
-    endif(FPHSA_CONFIG_MODE)
+      endif()
+    endif()
 
-  endif (${_NAME_UPPER}_FOUND)
+  endif ()
 
   set(${_NAME_UPPER}_FOUND ${${_NAME_UPPER}_FOUND} PARENT_SCOPE)
 
-endfunction(FIND_PACKAGE_HANDLE_STANDARD_ARGS _FIRST_ARG)
+endfunction()
diff --git a/Modules/FindPackageMessage.cmake b/Modules/FindPackageMessage.cmake
index f78792d26..5cea43e35 100644
--- a/Modules/FindPackageMessage.cmake
+++ b/Modules/FindPackageMessage.cmake
@@ -14,9 +14,9 @@
 #  if(X11_FOUND)
 #    FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
 #      "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
-#  else(X11_FOUND)
+#  else()
 #   ...
-#  endif(X11_FOUND)
+#  endif()
 
 #=============================================================================
 # Copyright 2008-2009 Kitware, Inc.
@@ -44,6 +44,6 @@ function(FIND_PACKAGE_MESSAGE pkg msg details)
       # message again.
       set("${DETAILS_VAR}" "${details}"
         CACHE INTERNAL "Details about finding ${pkg}")
-    endif(NOT "${details}" STREQUAL "${${DETAILS_VAR}}")
-  endif(NOT ${pkg}_FIND_QUIETLY)
-endfunction(FIND_PACKAGE_MESSAGE)
+    endif()
+  endif()
+endfunction()
diff --git a/Modules/FindPerl.cmake b/Modules/FindPerl.cmake
index 4f45da619..e908a6556 100644
--- a/Modules/FindPerl.cmake
+++ b/Modules/FindPerl.cmake
@@ -33,7 +33,7 @@ if(WIN32)
     "C:/Perl/bin"
     [HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActivePerl\\${ActivePerl_CurrentVersion}]/bin
     )
-endif(WIN32)
+endif()
 
 find_program(PERL_EXECUTABLE
   NAMES perl
@@ -68,7 +68,7 @@ if(PERL_EXECUTABLE)
       string(REGEX REPLACE ".*This is perl, version ([0-9\\._]+) +.*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE})
     endif()
   endif()
-endif(PERL_EXECUTABLE)
+endif()
 
 # Deprecated settings for compatibility with CMake1.4
 set(PERL ${PERL_EXECUTABLE})
diff --git a/Modules/FindPerlLibs.cmake b/Modules/FindPerlLibs.cmake
index 101aebfd4..e9313adc9 100644
--- a/Modules/FindPerlLibs.cmake
+++ b/Modules/FindPerlLibs.cmake
@@ -53,7 +53,7 @@ if (PERL_EXECUTABLE)
 
   if (NOT PERL_PREFIX_RESULT_VARIABLE)
     string(REGEX REPLACE "prefix='([^']+)'.*" "\\1" PERL_PREFIX ${PERL_PREFIX_OUTPUT_VARIABLE})
-  endif (NOT PERL_PREFIX_RESULT_VARIABLE)
+  endif ()
 
   ### PERL_ARCHNAME
   execute_process(
@@ -66,7 +66,7 @@ if (PERL_EXECUTABLE)
   )
   if (NOT PERL_ARCHNAME_RESULT_VARIABLE)
     string(REGEX REPLACE "archname='([^']+)'.*" "\\1" PERL_ARCHNAME ${PERL_ARCHNAME_OUTPUT_VARIABLE})
-  endif (NOT PERL_ARCHNAME_RESULT_VARIABLE)
+  endif ()
 
 
 
@@ -81,7 +81,7 @@ if (PERL_EXECUTABLE)
     )
   if (NOT PERL_CPPFLAGS_RESULT_VARIABLE)
     string(REGEX REPLACE "cppflags='([^']+)'.*" "\\1" PERL_EXTRA_C_FLAGS ${PERL_CPPFLAGS_OUTPUT_VARIABLE})
-  endif (NOT PERL_CPPFLAGS_RESULT_VARIABLE)
+  endif ()
 
   ### PERL_SITESEARCH
   execute_process(
@@ -95,7 +95,7 @@ if (PERL_EXECUTABLE)
   if (NOT PERL_SITESEARCH_RESULT_VARIABLE)
     string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_SITESEARCH ${PERL_SITESEARCH_OUTPUT_VARIABLE})
     file(TO_CMAKE_PATH "${PERL_SITESEARCH}" PERL_SITESEARCH)
-  endif (NOT PERL_SITESEARCH_RESULT_VARIABLE)
+  endif ()
 
   ### PERL_SITELIB
   execute_process(
@@ -109,7 +109,7 @@ if (PERL_EXECUTABLE)
   if (NOT PERL_SITELIB_RESULT_VARIABLE)
     string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_SITELIB ${PERL_SITELIB_OUTPUT_VARIABLE})
     file(TO_CMAKE_PATH "${PERL_SITELIB}" PERL_SITELIB)
-  endif (NOT PERL_SITELIB_RESULT_VARIABLE)
+  endif ()
 
   ### PERL_VENDORARCH
   execute_process(
@@ -123,7 +123,7 @@ if (PERL_EXECUTABLE)
   if (NOT PERL_VENDORARCH_RESULT_VARIABLE)
     string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_VENDORARCH ${PERL_VENDORARCH_OUTPUT_VARIABLE})
     file(TO_CMAKE_PATH "${PERL_VENDORARCH}" PERL_VENDORARCH)
-  endif (NOT PERL_VENDORARCH_RESULT_VARIABLE)
+  endif ()
 
   ### PERL_VENDORLIB
   execute_process(
@@ -137,7 +137,7 @@ if (PERL_EXECUTABLE)
   if (NOT PERL_VENDORLIB_RESULT_VARIABLE)
     string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_VENDORLIB ${PERL_VENDORLIB_OUTPUT_VARIABLE})
     file(TO_CMAKE_PATH "${PERL_VENDORLIB}" PERL_VENDORLIB)
-  endif (NOT PERL_VENDORLIB_RESULT_VARIABLE)
+  endif ()
 
   macro(perl_adjust_darwin_lib_variable varname)
     string( TOUPPER PERL_${varname} FINDPERL_VARNAME )
@@ -160,9 +160,9 @@ if (PERL_EXECUTABLE)
 
       if (PERL_NEEDS_ADJUSTMENT)
         string(REGEX REPLACE "(.*)/Updates/" "/System/\\1/" ${FINDPERL_VARNAME} ${${FINDPERL_VARNAME}})
-      endif (PERL_NEEDS_ADJUSTMENT)
+      endif ()
 
-    endif (NOT PERL_MINUSV_RESULT_VARIABLE)
+    endif ()
   endmacro()
 
   ### PERL_ARCHLIB
@@ -178,7 +178,7 @@ if (PERL_EXECUTABLE)
     string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_ARCHLIB ${PERL_ARCHLIB_OUTPUT_VARIABLE})
     perl_adjust_darwin_lib_variable( ARCHLIB )
     file(TO_CMAKE_PATH "${PERL_ARCHLIB}" PERL_ARCHLIB)
-  endif (NOT PERL_ARCHLIB_RESULT_VARIABLE)
+  endif ()
 
   ### PERL_PRIVLIB
   execute_process(
@@ -193,7 +193,7 @@ if (PERL_EXECUTABLE)
     string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_PRIVLIB ${PERL_PRIVLIB_OUTPUT_VARIABLE})
     perl_adjust_darwin_lib_variable( PRIVLIB )
     file(TO_CMAKE_PATH "${PERL_PRIVLIB}" PERL_PRIVLIB)
-  endif (NOT PERL_PRIVLIB_RESULT_VARIABLE)
+  endif ()
 
   ### PERL_POSSIBLE_LIBRARY_NAMES
   execute_process(
@@ -206,9 +206,9 @@ if (PERL_EXECUTABLE)
   )
   if (NOT PERL_LIBRARY_RESULT_VARIABLE)
     string(REGEX REPLACE "libperl='([^']+)'.*" "\\1" PERL_POSSIBLE_LIBRARY_NAMES ${PERL_LIBRARY_OUTPUT_VARIABLE})
-  else (NOT PERL_LIBRARY_RESULT_VARIABLE)
+  else ()
     set(PERL_POSSIBLE_LIBRARY_NAMES perl${PERL_VERSION_STRING} perl)
-  endif (NOT PERL_LIBRARY_RESULT_VARIABLE)
+  endif ()
 
   ### PERL_INCLUDE_PATH
   find_path(PERL_INCLUDE_PATH
@@ -234,7 +234,7 @@ if (PERL_EXECUTABLE)
       /usr/lib/perl/${PERL_VERSION_STRING}/CORE
   )
 
-endif (PERL_EXECUTABLE)
+endif ()
 
 # handle the QUIETLY and REQUIRED arguments and set PERLLIBS_FOUND to TRUE if
 # all listed variables are TRUE
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
index 99b2c1fe2..2766f9780 100644
--- a/Modules/FindPkgConfig.cmake
+++ b/Modules/FindPkgConfig.cmake
@@ -96,7 +96,7 @@ if (PKG_CONFIG_EXECUTABLE)
     OUTPUT_VARIABLE PKG_CONFIG_VERSION_STRING
     ERROR_QUIET
     OUTPUT_STRIP_TRAILING_WHITESPACE)
-endif (PKG_CONFIG_EXECUTABLE)
+endif ()
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 find_package_handle_standard_args(PkgConfig
@@ -111,11 +111,11 @@ set(PKG_CONFIG_FOUND "${PKGCONFIG_FOUND}")
 # Unsets the given variables
 macro(_pkgconfig_unset var)
   set(${var} "" CACHE INTERNAL "")
-endmacro(_pkgconfig_unset)
+endmacro()
 
 macro(_pkgconfig_set var value)
   set(${var} ${value} CACHE INTERNAL "")
-endmacro(_pkgconfig_set)
+endmacro()
 
 # Invokes pkgconfig, cleans up the result and sets variables
 macro(_pkgconfig_invoke _pkglist _prefix _varname _regexp)
@@ -129,28 +129,28 @@ macro(_pkgconfig_invoke _pkglist _prefix _varname _regexp)
   if (_pkgconfig_failed)
     set(_pkgconfig_${_varname} "")
     _pkgconfig_unset(${_prefix}_${_varname})
-  else(_pkgconfig_failed)
+  else()
     string(REGEX REPLACE "[\r\n]"                  " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}")
     string(REGEX REPLACE " +$"                     ""  _pkgconfig_invoke_result "${_pkgconfig_invoke_result}")
 
     if (NOT ${_regexp} STREQUAL "")
       string(REGEX REPLACE "${_regexp}" " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}")
-    endif(NOT ${_regexp} STREQUAL "")
+    endif()
 
     separate_arguments(_pkgconfig_invoke_result)
 
     #message(STATUS "  ${_varname} ... ${_pkgconfig_invoke_result}")
     set(_pkgconfig_${_varname} ${_pkgconfig_invoke_result})
     _pkgconfig_set(${_prefix}_${_varname} "${_pkgconfig_invoke_result}")
-  endif(_pkgconfig_failed)
-endmacro(_pkgconfig_invoke)
+  endif()
+endmacro()
 
 # Invokes pkgconfig two times; once without '--static' and once with
 # '--static'
 macro(_pkgconfig_invoke_dyn _pkglist _prefix _varname cleanup_regexp)
   _pkgconfig_invoke("${_pkglist}" ${_prefix}        ${_varname} "${cleanup_regexp}" ${ARGN})
   _pkgconfig_invoke("${_pkglist}" ${_prefix} STATIC_${_varname} "${cleanup_regexp}" --static  ${ARGN})
-endmacro(_pkgconfig_invoke_dyn)
+endmacro()
 
 # Splits given arguments into options and a package list
 macro(_pkgconfig_parse_options _result _is_req _is_silent)
@@ -160,16 +160,16 @@ macro(_pkgconfig_parse_options _result _is_req _is_silent)
   foreach(_pkg ${ARGN})
     if (_pkg STREQUAL "REQUIRED")
       set(${_is_req} 1)
-    endif (_pkg STREQUAL "REQUIRED")
+    endif ()
     if (_pkg STREQUAL "QUIET")
       set(${_is_silent} 1)
-    endif (_pkg STREQUAL "QUIET")
-  endforeach(_pkg ${ARGN})
+    endif ()
+  endforeach()
 
   set(${_result} ${ARGN})
   list(REMOVE_ITEM ${_result} "REQUIRED")
   list(REMOVE_ITEM ${_result} "QUIET")
-endmacro(_pkgconfig_parse_options)
+endmacro()
 
 ###
 macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
@@ -203,10 +203,10 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
     if (NOT ${_is_silent})
       if (_pkg_check_modules_cnt EQUAL 1)
         message(STATUS "checking for module '${_pkg_check_modules_list}'")
-      else(_pkg_check_modules_cnt EQUAL 1)
+      else()
         message(STATUS "checking for modules '${_pkg_check_modules_list}'")
-      endif(_pkg_check_modules_cnt EQUAL 1)
-    endif(NOT ${_is_silent})
+      endif()
+    endif()
 
     set(_pkg_check_modules_packages)
     set(_pkg_check_modules_failed)
@@ -220,24 +220,24 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
         string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\1" _pkg_check_modules_pkg_name "${_pkg_check_modules_pkg}")
         string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\2" _pkg_check_modules_pkg_op   "${_pkg_check_modules_pkg}")
         string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\3" _pkg_check_modules_pkg_ver  "${_pkg_check_modules_pkg}")
-      else(_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*")
+      else()
         set(_pkg_check_modules_pkg_name "${_pkg_check_modules_pkg}")
         set(_pkg_check_modules_pkg_op)
         set(_pkg_check_modules_pkg_ver)
-      endif(_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*")
+      endif()
 
       # handle the operands
       if (_pkg_check_modules_pkg_op STREQUAL ">=")
         list(APPEND _pkg_check_modules_exist_query --atleast-version)
-      endif(_pkg_check_modules_pkg_op STREQUAL ">=")
+      endif()
 
       if (_pkg_check_modules_pkg_op STREQUAL "=")
         list(APPEND _pkg_check_modules_exist_query --exact-version)
-      endif(_pkg_check_modules_pkg_op STREQUAL "=")
+      endif()
 
       if (_pkg_check_modules_pkg_op STREQUAL "<=")
         list(APPEND _pkg_check_modules_exist_query --max-version)
-      endif(_pkg_check_modules_pkg_op STREQUAL "<=")
+      endif()
 
       # create the final query which is of the format:
       # * --atleast-version <version> <pkg-name>
@@ -246,9 +246,9 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
       # * --exists <pkg-name>
       if (_pkg_check_modules_pkg_op)
         list(APPEND _pkg_check_modules_exist_query "${_pkg_check_modules_pkg_ver}")
-      else(_pkg_check_modules_pkg_op)
+      else()
         list(APPEND _pkg_check_modules_exist_query --exists)
-      endif(_pkg_check_modules_pkg_op)
+      endif()
 
       _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_VERSION)
       _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_PREFIX)
@@ -267,18 +267,18 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
       if (_pkgconfig_retval)
         if(NOT ${_is_silent})
           message(STATUS "  package '${_pkg_check_modules_pkg}' not found")
-        endif(NOT ${_is_silent})
+        endif()
 
         set(_pkg_check_modules_failed 1)
-      endif(_pkgconfig_retval)
-    endforeach(_pkg_check_modules_pkg)
+      endif()
+    endforeach()
 
     if(_pkg_check_modules_failed)
       # fail when requested
       if (${_is_required})
         message(SEND_ERROR "A required package was not found")
-      endif (${_is_required})
-    else(_pkg_check_modules_failed)
+      endif ()
+    else()
       # when we are here, we checked whether requested modules
       # exist. Now, go through them and set variables
 
@@ -290,9 +290,9 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
         # handle case when there is only one package required
         if (pkg_count EQUAL 1)
           set(_pkg_check_prefix "${_prefix}")
-        else(pkg_count EQUAL 1)
+        else()
           set(_pkg_check_prefix "${_prefix}_${_pkg_check_modules_pkg}")
-        endif(pkg_count EQUAL 1)
+        endif()
 
         _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" VERSION    ""   --modversion )
         _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" PREFIX     ""   --variable=prefix )
@@ -301,8 +301,8 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
 
         if (NOT ${_is_silent})
           message(STATUS "  found ${_pkg_check_modules_pkg}, version ${_pkgconfig_VERSION}")
-        endif (NOT ${_is_silent})
-      endforeach(_pkg_check_modules_pkg)
+        endif ()
+      endforeach()
 
       # set variables which are combined for multiple modules
       _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LIBRARIES           "(^| )-l" --libs-only-l )
@@ -313,13 +313,13 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
       _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" INCLUDE_DIRS        "(^| )-I" --cflags-only-I )
       _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS              ""        --cflags )
       _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS_OTHER        ""        --cflags-only-other )
-    endif(_pkg_check_modules_failed)
-  else(PKG_CONFIG_EXECUTABLE)
+    endif()
+  else()
     if (${_is_required})
       message(SEND_ERROR "pkg-config tool not found")
-    endif (${_is_required})
-  endif(PKG_CONFIG_EXECUTABLE)
-endmacro(_pkg_check_modules_internal)
+    endif ()
+  endif()
+endmacro()
 
 ###
 ### User visible macros start here
@@ -333,8 +333,8 @@ macro(pkg_check_modules _prefix _module0)
     _pkg_check_modules_internal("${_pkg_is_required}" "${_pkg_is_silent}" "${_prefix}" ${_pkg_modules})
 
     _pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION})
-  endif(NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND)
-endmacro(pkg_check_modules)
+  endif()
+endmacro()
 
 ###
 macro(pkg_search_module _prefix _module0)
@@ -345,28 +345,28 @@ macro(pkg_search_module _prefix _module0)
 
     if (NOT ${_pkg_is_silent})
       message(STATUS "checking for one of the modules '${_pkg_modules_alt}'")
-    endif (NOT ${_pkg_is_silent})
+    endif ()
 
     # iterate through all modules and stop at the first working one.
     foreach(_pkg_alt ${_pkg_modules_alt})
       if(NOT _pkg_modules_found)
         _pkg_check_modules_internal(0 1 "${_prefix}" "${_pkg_alt}")
-      endif(NOT _pkg_modules_found)
+      endif()
 
       if (${_prefix}_FOUND)
         set(_pkg_modules_found 1)
-      endif(${_prefix}_FOUND)
-    endforeach(_pkg_alt)
+      endif()
+    endforeach()
 
     if (NOT ${_prefix}_FOUND)
       if(${_pkg_is_required})
         message(SEND_ERROR "None of the required '${_pkg_modules_alt}' found")
-      endif(${_pkg_is_required})
-    endif(NOT ${_prefix}_FOUND)
+      endif()
+    endif()
 
     _pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION})
-  endif(NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND)
-endmacro(pkg_search_module)
+  endif()
+endmacro()
 
 ### Local Variables:
 ### mode: cmake
diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake
index ad671603b..699cd4145 100644
--- a/Modules/FindPostgreSQL.cmake
+++ b/Modules/FindPostgreSQL.cmake
@@ -77,7 +77,7 @@ set(PostgreSQL_ROOT_DIR_MESSAGE "Set the PostgreSQL_ROOT system variable to wher
 set(PostgreSQL_ROOT_DIRECTORIES $ENV{PostgreSQL_ROOT})
 if(PostgreSQL_ROOT_DIRECTORIES)
   file(TO_CMAKE_PATH ${PostgreSQL_ROOT_DIRECTORIES} PostgreSQL_ROOT_DIRECTORIES)
-endif(PostgreSQL_ROOT_DIRECTORIES)
+endif()
 
 set(PostgreSQL_KNOWN_VERSIONS ${PostgreSQL_ADDITIONAL_VERSIONS}
     "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0")
@@ -86,8 +86,8 @@ set(PostgreSQL_KNOWN_VERSIONS ${PostgreSQL_ADDITIONAL_VERSIONS}
 if ( WIN32 )
   foreach (suffix ${PostgreSQL_KNOWN_VERSIONS} )
     set(PostgreSQL_ADDITIONAL_SEARCH_PATHS ${PostgreSQL_ADDITIONAL_SEARCH_PATHS} "C:/Program Files/PostgreSQL/${suffix}" )
-  endforeach(suffix)
-endif( WIN32 )
+  endforeach()
+endif()
 set( PostgreSQL_ROOT_DIRECTORIES
    ${PostgreSQL_ROOT_DIRECTORIES}
    ${PostgreSQL_ROOT}
@@ -167,6 +167,6 @@ if(PostgreSQL_FOUND)
   #message("Final PostgreSQL include dir: ${PostgreSQL_INCLUDE_DIRS}")
   #message("Final PostgreSQL library dir: ${PostgreSQL_LIBRARY_DIRS}")
   #message("Final PostgreSQL libraries:   ${PostgreSQL_LIBRARIES}")
-endif(PostgreSQL_FOUND)
+endif()
 
 mark_as_advanced(PostgreSQL_INCLUDE_DIR PostgreSQL_TYPE_INCLUDE_DIR PostgreSQL_LIBRARY )
diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake
index c8616cc51..af0c2ddf0 100644
--- a/Modules/FindProtobuf.cmake
+++ b/Modules/FindProtobuf.cmake
@@ -78,7 +78,7 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS)
   if(NOT ARGN)
     message(SEND_ERROR "Error: PROTOBUF_GENERATE_CPP() called without any proto files")
     return()
-  endif(NOT ARGN)
+  endif()
 
   if(PROTOBUF_GENERATE_CPP_APPEND_PATH)
     # Create an include path for each file specified
diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake
index a131c5fde..7fb65b869 100644
--- a/Modules/FindPythonInterp.cmake
+++ b/Modules/FindPythonInterp.cmake
@@ -47,16 +47,16 @@ if(PythonInterp_FIND_VERSION)
                     list(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V})
                 endif()
              endforeach()
-        endif(NOT PythonInterp_FIND_VERSION_EXACT)
+        endif()
         unset(_PYTHON_FIND_MAJ_MIN)
         unset(_PYTHON_FIND_MAJ)
-    else(PythonInterp_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
+    else()
         list(APPEND _Python_NAMES python${PythonInterp_FIND_VERSION})
         set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON${PythonInterp_FIND_VERSION}_VERSIONS})
-    endif(PythonInterp_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
-else(PythonInterp_FIND_VERSION)
+    endif()
+else()
     set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS})
-endif(PythonInterp_FIND_VERSION)
+endif()
 
 list(APPEND _Python_NAMES python)
 
@@ -131,7 +131,7 @@ if(PYTHON_EXECUTABLE)
     endif()
     unset(_PYTHON_VERSION_RESULT)
     unset(_VERSION)
-endif(PYTHON_EXECUTABLE)
+endif()
 
 # handle the QUIETLY and REQUIRED arguments and set PYTHONINTERP_FOUND to TRUE if
 # all listed variables are TRUE
diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
index 932fbdcc9..0a9a99080 100644
--- a/Modules/FindPythonLibs.cmake
+++ b/Modules/FindPythonLibs.cmake
@@ -48,24 +48,24 @@ if(PythonLibs_FIND_VERSION)
         if(PythonLibs_FIND_VERSION_EXACT)
             if(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION)
                 set(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}")
-            else(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION)
+            else()
                 set(_PYTHON_FIND_OTHER_VERSIONS "${PythonLibs_FIND_VERSION}" "${_PYTHON_FIND_MAJ_MIN}")
-            endif(_PYTHON_FIND_MAJ_MIN STREQUAL PythonLibs_FIND_VERSION)
-        else(PythonLibs_FIND_VERSION_EXACT)
+            endif()
+        else()
             foreach(_PYTHON_V ${_PYTHON${_PYTHON_FIND_MAJ}_VERSIONS})
                 if(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN)
                     list(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V})
                 endif()
              endforeach()
-        endif(PythonLibs_FIND_VERSION_EXACT)
+        endif()
         unset(_PYTHON_FIND_MAJ_MIN)
         unset(_PYTHON_FIND_MAJ)
-    else(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
+    else()
         set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON${PythonLibs_FIND_VERSION}_VERSIONS})
-    endif(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
-else(PythonLibs_FIND_VERSION)
+    endif()
+else()
     set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS})
-endif(PythonLibs_FIND_VERSION)
+endif()
 
 # Set up the versions we know about, in the order we will search. Always add
 # the user supplied additional versions to the front.
@@ -90,7 +90,7 @@ foreach(_CURRENT_VERSION ${_Python_VERSIONS})
       [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
       [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
       )
-  endif(WIN32)
+  endif()
 
   find_library(PYTHON_LIBRARY
     NAMES
@@ -119,15 +119,15 @@ foreach(_CURRENT_VERSION ${_Python_VERSIONS})
   if(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR)
     set(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_PATH}" CACHE PATH
       "Path to where Python.h is found" FORCE)
-  endif(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR)
+  endif()
 
   set(PYTHON_FRAMEWORK_INCLUDES)
   if(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
     foreach(dir ${Python_FRAMEWORKS})
       set(PYTHON_FRAMEWORK_INCLUDES ${PYTHON_FRAMEWORK_INCLUDES}
         ${dir}/Versions/${_CURRENT_VERSION}/include/python${_CURRENT_VERSION})
-    endforeach(dir)
-  endif(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
+    endforeach()
+  endif()
 
   find_path(PYTHON_INCLUDE_DIR
     NAMES Python.h
@@ -151,12 +151,12 @@ foreach(_CURRENT_VERSION ${_Python_VERSIONS})
     string(REGEX REPLACE "^#define[ \t]+PY_VERSION[ \t]+\"([^\"]+)\".*" "\\1"
                          PYTHONLIBS_VERSION_STRING "${python_version_str}")
     unset(python_version_str)
-  endif(PYTHON_INCLUDE_DIR AND EXISTS "${PYTHON_INCLUDE_DIR}/patchlevel.h")
+  endif()
 
   if(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR)
     break()
-  endif(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR)
-endforeach(_CURRENT_VERSION)
+  endif()
+endforeach()
 
 mark_as_advanced(
   PYTHON_DEBUG_LIBRARY
@@ -204,10 +204,10 @@ function(PYTHON_ADD_MODULE _NAME )
   if(PYTHON_ENABLE_MODULE_${_NAME})
     if(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
       set(PY_MODULE_TYPE MODULE)
-    else(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
+    else()
       set(PY_MODULE_TYPE STATIC)
       set_property(GLOBAL  APPEND  PROPERTY  PY_STATIC_MODULES_LIST ${_NAME})
-    endif(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
+    endif()
 
     set_property(GLOBAL  APPEND  PROPERTY  PY_MODULES_LIST ${_NAME})
     add_library(${_NAME} ${PY_MODULE_TYPE} ${ARGN})
@@ -217,11 +217,11 @@ function(PYTHON_ADD_MODULE _NAME )
       set_target_properties(${_NAME} PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX}")
       if(WIN32 AND NOT CYGWIN)
         set_target_properties(${_NAME} PROPERTIES SUFFIX ".pyd")
-      endif(WIN32 AND NOT CYGWIN)
-    endif(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
+      endif()
+    endif()
 
-  endif(PYTHON_ENABLE_MODULE_${_NAME})
-endfunction(PYTHON_ADD_MODULE)
+  endif()
+endfunction()
 
 function(PYTHON_WRITE_MODULES_HEADER _filename)
 
@@ -248,7 +248,7 @@ extern \"C\" {
 
   foreach(_currentModule ${PY_STATIC_MODULES_LIST})
     file(APPEND ${_filenameTmp} "extern void init${PYTHON_MODULE_PREFIX}${_currentModule}(void);\n\n")
-  endforeach(_currentModule ${PY_STATIC_MODULES_LIST})
+  endforeach()
 
   file(APPEND ${_filenameTmp}
 "#ifdef __cplusplus
@@ -260,16 +260,16 @@ extern \"C\" {
 
   foreach(_currentModule ${PY_STATIC_MODULES_LIST})
     file(APPEND ${_filenameTmp} "int ${_name}_${_currentModule}(void) \n{\n  static char name[]=\"${PYTHON_MODULE_PREFIX}${_currentModule}\"; return PyImport_AppendInittab(name, init${PYTHON_MODULE_PREFIX}${_currentModule});\n}\n\n")
-  endforeach(_currentModule ${PY_STATIC_MODULES_LIST})
+  endforeach()
 
   file(APPEND ${_filenameTmp} "void ${_name}_LoadAllPythonModules(void)\n{\n")
   foreach(_currentModule ${PY_STATIC_MODULES_LIST})
     file(APPEND ${_filenameTmp} "  ${_name}_${_currentModule}();\n")
-  endforeach(_currentModule ${PY_STATIC_MODULES_LIST})
+  endforeach()
   file(APPEND ${_filenameTmp} "}\n\n")
   file(APPEND ${_filenameTmp} "#ifndef EXCLUDE_LOAD_ALL_FUNCTION\nvoid CMakeLoadAllPythonModules(void)\n{\n  ${_name}_LoadAllPythonModules();\n}\n#endif\n\n#endif\n")
 
 # with configure_file() cmake complains that you may not use a file created using file(WRITE) as input file for configure_file()
   execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_filenameTmp}" "${_filename}" OUTPUT_QUIET ERROR_QUIET)
 
-endfunction(PYTHON_WRITE_MODULES_HEADER)
+endfunction()
diff --git a/Modules/FindQt.cmake b/Modules/FindQt.cmake
index 53b1da7cf..eeeaf5958 100644
--- a/Modules/FindQt.cmake
+++ b/Modules/FindQt.cmake
@@ -34,26 +34,26 @@
 file(GLOB GLOB_TEMP_VAR /usr/lib/qt-3*/bin/qmake)
 if(GLOB_TEMP_VAR)
   set(QT3_INSTALLED TRUE)
-endif(GLOB_TEMP_VAR)
+endif()
 set(GLOB_TEMP_VAR)
 
 file(GLOB GLOB_TEMP_VAR /usr/local/qt-x11-commercial-3*/bin/qmake)
 if(GLOB_TEMP_VAR)
   set(QT3_INSTALLED TRUE)
-endif(GLOB_TEMP_VAR)
+endif()
 set(GLOB_TEMP_VAR)
 
 # look for qt4 installations
 file(GLOB GLOB_TEMP_VAR /usr/local/qt-x11-commercial-4*/bin/qmake)
 if(GLOB_TEMP_VAR)
   set(QT4_INSTALLED TRUE)
-endif(GLOB_TEMP_VAR)
+endif()
 set(GLOB_TEMP_VAR)
 
 file(GLOB GLOB_TEMP_VAR /usr/local/Trolltech/Qt-4*/bin/qmake)
 if(GLOB_TEMP_VAR)
   set(QT4_INSTALLED TRUE)
-endif(GLOB_TEMP_VAR)
+endif()
 set(GLOB_TEMP_VAR)
 
 # now find qmake
@@ -64,17 +64,17 @@ if(QT_QMAKE_EXECUTABLE_FINDQT)
   if(QTVERSION MATCHES "4.*")
     set(QT_QMAKE_EXECUTABLE ${QT_QMAKE_EXECUTABLE_FINDQT} CACHE PATH "QT4 qmake program.")
     set(QT4_INSTALLED TRUE)
-  endif(QTVERSION MATCHES "4.*")
+  endif()
   if(QTVERSION MATCHES "Unknown")
     set(QT3_INSTALLED TRUE)
-  endif(QTVERSION MATCHES "Unknown")
-endif(QT_QMAKE_EXECUTABLE_FINDQT)
+  endif()
+endif()
 
 if(QT_QMAKE_EXECUTABLE_FINDQT)
   exec_program( ${QT_QMAKE_EXECUTABLE_FINDQT}
     ARGS "-query QT_INSTALL_HEADERS"
     OUTPUT_VARIABLE qt_headers )
-endif(QT_QMAKE_EXECUTABLE_FINDQT)
+endif()
 
 find_file( QT4_QGLOBAL_H_FILE qglobal.h
   "${QT_SEARCH_PATH}/Qt/include"
@@ -91,7 +91,7 @@ find_file( QT4_QGLOBAL_H_FILE qglobal.h
 
 if(QT4_QGLOBAL_H_FILE)
   set(QT4_INSTALLED TRUE)
-endif(QT4_QGLOBAL_H_FILE)
+endif()
 
 find_file( QT3_QGLOBAL_H_FILE qglobal.h
   "${QT_SEARCH_PATH}/Qt/include"
@@ -111,50 +111,50 @@ find_file( QT3_QGLOBAL_H_FILE qglobal.h
 
 if(QT3_QGLOBAL_H_FILE)
   set(QT3_INSTALLED TRUE)
-endif(QT3_QGLOBAL_H_FILE)
+endif()
 
 if(QT3_INSTALLED AND QT4_INSTALLED )
   # force user to pick if we have both
   set(DESIRED_QT_VERSION 0 CACHE STRING "Pick a version of QT to use: 3 or 4")
-else(QT3_INSTALLED AND QT4_INSTALLED )
+else()
   # if only one found then pick that one
   if(QT3_INSTALLED)
     set(DESIRED_QT_VERSION 3 CACHE STRING "Pick a version of QT to use: 3 or 4")
-  endif(QT3_INSTALLED)
+  endif()
   if(QT4_INSTALLED)
     set(DESIRED_QT_VERSION 4 CACHE STRING "Pick a version of QT to use: 3 or 4")
-  endif(QT4_INSTALLED)
-endif(QT3_INSTALLED AND QT4_INSTALLED )
+  endif()
+endif()
 
 if(DESIRED_QT_VERSION MATCHES 3)
   set(Qt3_FIND_REQUIRED ${Qt_FIND_REQUIRED})
   set(Qt3_FIND_QUIETLY  ${Qt_FIND_QUIETLY})
   include(FindQt3)
-endif(DESIRED_QT_VERSION MATCHES 3)
+endif()
 if(DESIRED_QT_VERSION MATCHES 4)
   set(Qt4_FIND_REQUIRED ${Qt_FIND_REQUIRED})
   set(Qt4_FIND_QUIETLY  ${Qt_FIND_QUIETLY})
   include(FindQt4)
-endif(DESIRED_QT_VERSION MATCHES 4)
+endif()
 
 if(NOT QT3_INSTALLED AND NOT QT4_INSTALLED)
   if(QT_REQUIRED)
     message(SEND_ERROR "CMake was unable to find any QT versions, put qmake in your path, or set QT_QMAKE_EXECUTABLE.")
-  endif(QT_REQUIRED)
-else(NOT QT3_INSTALLED AND NOT QT4_INSTALLED)
+  endif()
+else()
   if(NOT QT_FOUND AND NOT DESIRED_QT_VERSION)
     if(QT_REQUIRED)
       message(SEND_ERROR "Multiple versions of QT found please set DESIRED_QT_VERSION")
-    else(QT_REQUIRED)
+    else()
       message("Multiple versions of QT found please set DESIRED_QT_VERSION")
-    endif(QT_REQUIRED)
-  endif(NOT QT_FOUND AND NOT DESIRED_QT_VERSION)
+    endif()
+  endif()
   if(NOT QT_FOUND AND DESIRED_QT_VERSION)
     if(QT_REQUIRED)
       message(FATAL_ERROR "CMake was unable to find QT version: ${DESIRED_QT_VERSION}. Set advanced values QT_QMAKE_EXECUTABLE and QT${DESIRED_QT_VERSION}_QGLOBAL_FILE, if those are set then QT_QT_LIBRARY or QT_LIBRARY_DIR.")
-    else(QT_REQUIRED)
+    else()
       message( "CMake was unable to find desired QT version: ${DESIRED_QT_VERSION}. Set advanced values QT_QMAKE_EXECUTABLE and QT${DESIRED_QT_VERSION}_QGLOBAL_FILE.")
-    endif(QT_REQUIRED)
-  endif(NOT QT_FOUND AND DESIRED_QT_VERSION)
-endif(NOT QT3_INSTALLED AND NOT QT4_INSTALLED)
+    endif()
+  endif()
+endif()
 mark_as_advanced(QT3_QGLOBAL_H_FILE QT4_QGLOBAL_H_FILE QT_QMAKE_EXECUTABLE_FINDQT)
diff --git a/Modules/FindQt3.cmake b/Modules/FindQt3.cmake
index 0440a8592..15fbc0bb5 100644
--- a/Modules/FindQt3.cmake
+++ b/Modules/FindQt3.cmake
@@ -38,19 +38,19 @@
 if(QT4_FOUND)
   if(Qt3_FIND_REQUIRED)
     message( FATAL_ERROR "Qt3 and Qt4 cannot be used together in one project.")
-  else(Qt3_FIND_REQUIRED)
+  else()
     if(NOT Qt3_FIND_QUIETLY)
       message( STATUS    "Qt3 and Qt4 cannot be used together in one project.")
-    endif(NOT Qt3_FIND_QUIETLY)
+    endif()
     return()
-  endif(Qt3_FIND_REQUIRED)
-endif(QT4_FOUND)
+  endif()
+endif()
 
 
 file(GLOB GLOB_PATHS /usr/lib/qt-3*)
 foreach(GLOB_PATH ${GLOB_PATHS})
   list(APPEND GLOB_PATHS_BIN "${GLOB_PATH}/bin")
-endforeach(GLOB_PATH)
+endforeach()
 find_path(QT_INCLUDE_DIR qt.h
   "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/include/Qt"
   "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/include/Qt"
@@ -70,7 +70,7 @@ find_path(QT_INCLUDE_DIR qt.h
 # QT_INCLUDE_DIR to NOTFOUND
 if(NOT EXISTS ${QT_INCLUDE_DIR}/qglobal.h)
   set(QT_INCLUDE_DIR QT_INCLUDE_DIR-NOTFOUND CACHE PATH "path to Qt3 include directory" FORCE)
-endif(NOT EXISTS ${QT_INCLUDE_DIR}/qglobal.h)
+endif()
 
 if(QT_INCLUDE_DIR)
   #extract the version string from qglobal.h
@@ -82,7 +82,7 @@ if(QT_INCLUDE_DIR)
   # version X.Y.Z, so we need to remove the dots from version
   string(REGEX REPLACE "\\." "" qt_version_str_lib "${qt_version_str}")
   set(QT_VERSION_STRING "${qt_version_str}")
-endif(QT_INCLUDE_DIR)
+endif()
 
 file(GLOB GLOB_PATHS_LIB /usr/lib/qt-3*/lib/)
 if (QT_MT_REQUIRED)
@@ -104,7 +104,7 @@ if (QT_MT_REQUIRED)
     C:/Progra~1/qt/lib
     )
 
-else (QT_MT_REQUIRED)
+else ()
   find_library(QT_QT_LIBRARY
     NAMES
     qt qt-${qt_version_str_lib} qt-edu${qt_version_str_lib}
@@ -123,7 +123,7 @@ else (QT_MT_REQUIRED)
     /usr/share/qt3/lib
     C:/Progra~1/qt/lib
     )
-endif (QT_MT_REQUIRED)
+endif ()
 
 
 find_library(QT_QASSISTANTCLIENT_LIBRARY
@@ -162,7 +162,7 @@ find_program(QT_MOC_EXECUTABLE
 
 if(QT_MOC_EXECUTABLE)
   set ( QT_WRAP_CPP "YES")
-endif(QT_MOC_EXECUTABLE)
+endif()
 
 # qt 3 should prefer QTDIR over the PATH
 find_program(QT_UIC_EXECUTABLE
@@ -184,7 +184,7 @@ find_program(QT_UIC_EXECUTABLE
 
 if(QT_UIC_EXECUTABLE)
   set ( QT_WRAP_UI "YES")
-endif(QT_UIC_EXECUTABLE)
+endif()
 
 if (WIN32)
   find_library(QT_QTMAIN_LIBRARY qtmain
@@ -198,12 +198,12 @@ if (WIN32)
     "C:/Program Files/qt/lib"
     DOC "This Library is only needed by and included with Qt3 on MSWindows. It should be NOTFOUND, undefined or IGNORE otherwise."
     )
-endif (WIN32)
+endif ()
 
 #support old QT_MIN_VERSION if set, but not if version is supplied by find_package()
 if(NOT Qt3_FIND_VERSION AND QT_MIN_VERSION)
   set(Qt3_FIND_VERSION ${QT_MIN_VERSION})
-endif(NOT Qt3_FIND_VERSION AND QT_MIN_VERSION)
+endif()
 
 # if the include a library are found then we have it
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
@@ -222,23 +222,23 @@ if(QT_FOUND)
       set (QT_DEFINITIONS -DQT_DLL -DQT_THREAD_SUPPORT -DNO_DEBUG)
       set (QT_LIBRARIES imm32.lib ${QT_QT_LIBRARY} ${QT_QTMAIN_LIBRARY} )
       set (QT_LIBRARIES ${QT_LIBRARIES} winmm wsock32)
-    else (QT_QTMAIN_LIBRARY)
+    else ()
       # for version 2
       set (QT_LIBRARIES imm32.lib ws2_32.lib ${QT_QT_LIBRARY} )
-    endif (QT_QTMAIN_LIBRARY)
-  else (WIN32 AND NOT CYGWIN)
+    endif ()
+  else ()
     set (QT_LIBRARIES ${QT_QT_LIBRARY} )
 
     set (QT_DEFINITIONS -DQT_SHARED -DQT_NO_DEBUG)
     if(QT_QT_LIBRARY MATCHES "qt-mt")
       set (QT_DEFINITIONS ${QT_DEFINITIONS} -DQT_THREAD_SUPPORT -D_REENTRANT)
-    endif(QT_QT_LIBRARY MATCHES "qt-mt")
+    endif()
 
-  endif (WIN32 AND NOT CYGWIN)
+  endif ()
 
   if (QT_QASSISTANTCLIENT_LIBRARY)
     set (QT_LIBRARIES ${QT_QASSISTANTCLIENT_LIBRARY} ${QT_LIBRARIES})
-  endif (QT_QASSISTANTCLIENT_LIBRARY)
+  endif ()
 
   # Backwards compatibility for CMake1.4 and 1.2
   set (QT_MOC_EXE ${QT_MOC_EXECUTABLE} )
@@ -248,47 +248,47 @@ if(QT_FOUND)
     find_package(X11)
     if (X11_FOUND)
       set (QT_LIBRARIES ${QT_LIBRARIES} ${X11_LIBRARIES})
-    endif (X11_FOUND)
+    endif ()
     if (CMAKE_DL_LIBS)
       set (QT_LIBRARIES ${QT_LIBRARIES} ${CMAKE_DL_LIBS})
-    endif (CMAKE_DL_LIBS)
-  endif(UNIX)
+    endif ()
+  endif()
   if(QT_QT_LIBRARY MATCHES "qt-mt")
     find_package(Threads)
     set(QT_LIBRARIES ${QT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
-  endif(QT_QT_LIBRARY MATCHES "qt-mt")
-endif(QT_FOUND)
+  endif()
+endif()
 
 if(QT_MOC_EXECUTABLE)
   execute_process(COMMAND ${QT_MOC_EXECUTABLE} "-v"
                   OUTPUT_VARIABLE QTVERSION_MOC
                   ERROR_QUIET)
-endif(QT_MOC_EXECUTABLE)
+endif()
 if(QT_UIC_EXECUTABLE)
   execute_process(COMMAND ${QT_UIC_EXECUTABLE} "-version"
                   OUTPUT_VARIABLE QTVERSION_UIC
                   ERROR_QUIET)
-endif(QT_UIC_EXECUTABLE)
+endif()
 
 set(_QT_UIC_VERSION_3 FALSE)
 if("${QTVERSION_UIC}" MATCHES ".* 3..*")
   set(_QT_UIC_VERSION_3 TRUE)
-endif("${QTVERSION_UIC}" MATCHES ".* 3..*")
+endif()
 
 set(_QT_MOC_VERSION_3 FALSE)
 if("${QTVERSION_MOC}" MATCHES ".* 3..*")
   set(_QT_MOC_VERSION_3 TRUE)
-endif("${QTVERSION_MOC}" MATCHES ".* 3..*")
+endif()
 
 set(QT_WRAP_CPP FALSE)
 if (QT_MOC_EXECUTABLE AND _QT_MOC_VERSION_3)
   set ( QT_WRAP_CPP TRUE)
-endif (QT_MOC_EXECUTABLE AND _QT_MOC_VERSION_3)
+endif ()
 
 set(QT_WRAP_UI FALSE)
 if (QT_UIC_EXECUTABLE AND _QT_UIC_VERSION_3)
   set ( QT_WRAP_UI TRUE)
-endif (QT_UIC_EXECUTABLE AND _QT_UIC_VERSION_3)
+endif ()
 
 mark_as_advanced(
   QT_INCLUDE_DIR
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index e20e76465..e7d25c981 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -339,30 +339,30 @@ if( Qt4_FIND_COMPONENTS )
   foreach( component ${Qt4_FIND_COMPONENTS} )
     string( TOUPPER ${component} _COMPONENT )
     set( QT_USE_${_COMPONENT} 1 )
-  endforeach( component )
+  endforeach()
 
   # To make sure we don't use QtCore or QtGui when not in COMPONENTS
   if(NOT QT_USE_QTCORE)
     set( QT_DONT_USE_QTCORE 1 )
-  endif(NOT QT_USE_QTCORE)
+  endif()
 
   if(NOT QT_USE_QTGUI)
     set( QT_DONT_USE_QTGUI 1 )
-  endif(NOT QT_USE_QTGUI)
+  endif()
 
-endif( Qt4_FIND_COMPONENTS )
+endif()
 
 # If Qt3 has already been found, fail.
 if(QT_QT_LIBRARY)
   if(Qt4_FIND_REQUIRED)
     message( FATAL_ERROR "Qt3 and Qt4 cannot be used together in one project.  If switching to Qt4, the CMakeCache.txt needs to be cleaned.")
-  else(Qt4_FIND_REQUIRED)
+  else()
     if(NOT Qt4_FIND_QUIETLY)
       message( STATUS    "Qt3 and Qt4 cannot be used together in one project.  If switching to Qt4, the CMakeCache.txt needs to be cleaned.")
-    endif(NOT Qt4_FIND_QUIETLY)
+    endif()
     return()
-  endif(Qt4_FIND_REQUIRED)
-endif(QT_QT_LIBRARY)
+  endif()
+endif()
 
 
 include(CheckCXXSymbolExists)
@@ -393,7 +393,7 @@ macro (_QT4_ADJUST_LIB_VARS _camelCaseBasename)
         else()
           set_property(TARGET Qt4::${_camelCaseBasename}        PROPERTY IMPORTED_LOCATION_RELEASE "${QT_${basename}_LIBRARY_RELEASE}" )
         endif()
-      endif (QT_${basename}_LIBRARY_RELEASE)
+      endif ()
 
       if (QT_${basename}_LIBRARY_DEBUG)
         set_property(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
@@ -402,8 +402,8 @@ macro (_QT4_ADJUST_LIB_VARS _camelCaseBasename)
         else()
           set_property(TARGET Qt4::${_camelCaseBasename}        PROPERTY IMPORTED_LOCATION_DEBUG "${QT_${basename}_LIBRARY_DEBUG}" )
         endif()
-      endif (QT_${basename}_LIBRARY_DEBUG)
-    endif(NOT TARGET Qt4::${_camelCaseBasename})
+      endif ()
+    endif()
 
     # If QT_USE_IMPORTED_TARGETS is enabled, the QT_QTFOO_LIBRARY variables are set to point at these
     # imported targets. This works better in general, and is also in almost all cases fully
@@ -416,7 +416,7 @@ macro (_QT4_ADJUST_LIB_VARS _camelCaseBasename)
     if(QT_USE_IMPORTED_TARGETS)
         set(QT_${basename}_LIBRARY       Qt4::${_camelCaseBasename} )
         set(QT_${basename}_LIBRARIES     Qt4::${_camelCaseBasename} )
-    else(QT_USE_IMPORTED_TARGETS)
+    else()
 
       # if the release- as well as the debug-version of the library have been found:
       if (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
@@ -424,49 +424,49 @@ macro (_QT4_ADJUST_LIB_VARS _camelCaseBasename)
         # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
         if (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
           set(QT_${basename}_LIBRARY       optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
-        else(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+        else()
           # if there are no configuration types and CMAKE_BUILD_TYPE has no value
           # then just use the release libraries
           set(QT_${basename}_LIBRARY       ${QT_${basename}_LIBRARY_RELEASE} )
-        endif(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+        endif()
         set(QT_${basename}_LIBRARIES       optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
-      endif (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
+      endif ()
 
       # if only the release version was found, set the debug variable also to the release version
       if (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
         set(QT_${basename}_LIBRARY_DEBUG ${QT_${basename}_LIBRARY_RELEASE})
         set(QT_${basename}_LIBRARY       ${QT_${basename}_LIBRARY_RELEASE})
         set(QT_${basename}_LIBRARIES     ${QT_${basename}_LIBRARY_RELEASE})
-      endif (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
+      endif ()
 
       # if only the debug version was found, set the release variable also to the debug version
       if (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)
         set(QT_${basename}_LIBRARY_RELEASE ${QT_${basename}_LIBRARY_DEBUG})
         set(QT_${basename}_LIBRARY         ${QT_${basename}_LIBRARY_DEBUG})
         set(QT_${basename}_LIBRARIES       ${QT_${basename}_LIBRARY_DEBUG})
-      endif (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)
+      endif ()
 
       # put the value in the cache:
       set(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY} CACHE STRING "The Qt ${basename} library" FORCE)
 
-    endif(QT_USE_IMPORTED_TARGETS)
+    endif()
 
     set(QT_${basename}_FOUND 1)
 
-  else (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
+  else ()
 
     set(QT_${basename}_LIBRARY "" CACHE STRING "The Qt ${basename} library" FORCE)
 
-  endif (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
+  endif ()
 
   if (QT_${basename}_INCLUDE_DIR)
     #add the include directory to QT_INCLUDES
     set(QT_INCLUDES "${QT_${basename}_INCLUDE_DIR}" ${QT_INCLUDES})
-  endif (QT_${basename}_INCLUDE_DIR)
+  endif ()
 
   # Make variables changeble to the advanced user
   mark_as_advanced(QT_${basename}_LIBRARY QT_${basename}_LIBRARY_RELEASE QT_${basename}_LIBRARY_DEBUG QT_${basename}_INCLUDE_DIR)
-endmacro (_QT4_ADJUST_LIB_VARS)
+endmacro ()
 
 function(_QT4_QUERY_QMAKE VAR RESULT)
   execute_process(COMMAND "${QT_QMAKE_EXECUTABLE}" -query ${VAR}
@@ -476,8 +476,8 @@ function(_QT4_QUERY_QMAKE VAR RESULT)
   if(NOT return_code)
     file(TO_CMAKE_PATH "${output}" output)
     set(${RESULT} ${output} PARENT_SCOPE)
-  endif(NOT return_code)
-endfunction(_QT4_QUERY_QMAKE)
+  endif()
+endfunction()
 
 
 set(QT4_INSTALLED_VERSION_TOO_OLD FALSE)
@@ -499,7 +499,7 @@ if (QT_QMAKE_EXECUTABLE)
 
   if(QT_QMAKE_EXECUTABLE_LAST)
     string(COMPARE NOTEQUAL "${QT_QMAKE_EXECUTABLE_LAST}" "${QT_QMAKE_EXECUTABLE}" QT_QMAKE_CHANGED)
-  endif(QT_QMAKE_EXECUTABLE_LAST)
+  endif()
 
   set(QT_QMAKE_EXECUTABLE_LAST "${QT_QMAKE_EXECUTABLE}" CACHE INTERNAL "" FORCE)
 
@@ -516,10 +516,10 @@ if (QT_QMAKE_EXECUTABLE)
       )
     if(QT_QMAKE_EXECUTABLE)
       _qt4_query_qmake(QT_VERSION QTVERSION)
-    endif(QT_QMAKE_EXECUTABLE)
-  endif(NOT QTVERSION)
+    endif()
+  endif()
 
-endif (QT_QMAKE_EXECUTABLE)
+endif ()
 
 if (QT_QMAKE_EXECUTABLE AND QTVERSION)
 
@@ -531,11 +531,11 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
     # and windows should already use ; as a separator
     if(NOT WIN32)
       string(REPLACE ":" ";" qt_mkspecs_dirs "${qt_mkspecs_dirs}")
-    endif(NOT WIN32)
+    endif()
     set(qt_cross_paths)
     foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH})
       set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/mkspecs")
-    endforeach(qt_cross_path)
+    endforeach()
     set(QT_MKSPECS_DIR NOTFOUND)
     find_path(QT_MKSPECS_DIR NAMES qconfig.pri
       HINTS ${qt_cross_paths} ${qt_mkspecs_dirs}
@@ -549,10 +549,10 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
     string(REGEX MATCH "EDITION[^\n]+" QT_EDITION "${_qconfig_FILE_contents}")
     string(REGEX MATCH "QT_LIBINFIX[^\n]+" _qconfig_qt_libinfix "${_qconfig_FILE_contents}")
     string(REGEX REPLACE "QT_LIBINFIX *= *([^\n]*)" "\\1" QT_LIBINFIX "${_qconfig_qt_libinfix}")
-  endif(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
+  endif()
   if("${QT_EDITION}" MATCHES "DesktopLight")
     set(QT_EDITION_DESKTOPLIGHT 1)
-  endif("${QT_EDITION}" MATCHES "DesktopLight")
+  endif()
 
   # ask qmake for the library dir as a hint, then search for QtCore library and use that as a reference for finding the
   # others and for setting QT_LIBRARY_DIR
@@ -580,14 +580,14 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
                    NAMES QtCore${QT_LIBINFIX}_debug QtCore${QT_LIBINFIX}d QtCore${QT_LIBINFIX}d4
                    HINTS ${QT_LIBRARY_DIR_TMP}
           )
-    endif(NOT QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCORE_LIBRARY_DEBUG)
+    endif()
 
     # 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.")
-      endif(EXISTS ${QT_LIBRARY_DIR_TMP}/libqtmain.a)
-    endif(NOT QT_QTCORE_LIBRARY_RELEASE AND MSVC)
+      endif()
+    endif()
 
   endif ()
 
@@ -606,25 +606,25 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
                     "Qt is NOT installed correctly for the target build environment.")
     if(Qt4_FIND_REQUIRED)
       message( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.")
-    endif(Qt4_FIND_REQUIRED)
+    endif()
   endif()
 
   # ask qmake for the binary dir
   if (NOT QT_BINARY_DIR  OR  QT_QMAKE_CHANGED)
     _qt4_query_qmake(QT_INSTALL_BINS qt_bins)
     set(QT_BINARY_DIR ${qt_bins} CACHE INTERNAL "" FORCE)
-  endif (NOT QT_BINARY_DIR  OR  QT_QMAKE_CHANGED)
+  endif ()
 
   if (APPLE)
     set(CMAKE_FIND_FRAMEWORK_OLD ${CMAKE_FIND_FRAMEWORK})
     if (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
       set(QT_USE_FRAMEWORKS ON CACHE INTERNAL "" FORCE)
       set(CMAKE_FIND_FRAMEWORK FIRST)
-    else (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
+    else ()
       set(QT_USE_FRAMEWORKS OFF CACHE INTERNAL "" FORCE)
       set(CMAKE_FIND_FRAMEWORK LAST)
-    endif (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
-  endif (APPLE)
+    endif ()
+  endif ()
 
   # ask qmake for the include dir
   if (QT_LIBRARY_DIR AND (NOT QT_QTCORE_INCLUDE_DIR OR NOT QT_HEADERS_DIR OR  QT_QMAKE_CHANGED))
@@ -639,10 +639,10 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
       if(QT_QTCORE_INCLUDE_DIR)
         if(QT_USE_FRAMEWORKS)
           set(QT_HEADERS_DIR "${qt_headers}" CACHE INTERNAL "" FORCE)
-        else(QT_USE_FRAMEWORKS)
+        else()
           get_filename_component(qt_headers "${QT_QTCORE_INCLUDE_DIR}/../" ABSOLUTE)
           set(QT_HEADERS_DIR "${qt_headers}" CACHE INTERNAL "" FORCE)
-        endif(QT_USE_FRAMEWORKS)
+        endif()
       elseif()
         message("Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_HEADERS as ${qt_headers}")
         message("Warning: But QtCore couldn't be found.  Qt must NOT be installed correctly.")
@@ -651,7 +651,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
 
   if(APPLE)
     set(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_OLD})
-  endif(APPLE)
+  endif()
 
   # Set QT_INCLUDE_DIR based on QT_HEADERS_DIR
   if(QT_HEADERS_DIR)
@@ -660,10 +660,10 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
       # One is the framework include for which CMake will add a -F flag
       # and the other is an include dir for non-framework Qt modules
       set(QT_INCLUDE_DIR ${QT_HEADERS_DIR} ${QT_QTCORE_LIBRARY_RELEASE} )
-    else(QT_USE_FRAMEWORKS)
+    else()
       set(QT_INCLUDE_DIR ${QT_HEADERS_DIR})
-    endif(QT_USE_FRAMEWORKS)
-  endif(QT_HEADERS_DIR)
+    endif()
+  endif()
 
   # Set QT_INCLUDES
   set( QT_INCLUDES ${QT_MKSPECS_DIR}/default ${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
@@ -673,7 +673,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
   if (QT_LIBRARY_DIR AND NOT QT_DOC_DIR  OR  QT_QMAKE_CHANGED)
     _qt4_query_qmake(QT_INSTALL_DOCS qt_doc_dir)
     set(QT_DOC_DIR ${qt_doc_dir} CACHE PATH "The location of the Qt docs" FORCE)
-  endif (QT_LIBRARY_DIR AND NOT QT_DOC_DIR  OR  QT_QMAKE_CHANGED)
+  endif ()
 
 
   # ask qmake for the plugins directory
@@ -682,17 +682,17 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
     set(QT_PLUGINS_DIR NOTFOUND)
     foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH})
       set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/plugins")
-    endforeach(qt_cross_path)
+    endforeach()
     find_path(QT_PLUGINS_DIR NAMES accessible imageformats sqldrivers codecs designer
       HINTS ${qt_cross_paths} ${qt_plugins_dir}
       DOC "The location of the Qt plugins")
-  endif (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR  OR  QT_QMAKE_CHANGED)
+  endif ()
 
   # ask qmake for the translations directory
   if (QT_LIBRARY_DIR AND NOT QT_TRANSLATIONS_DIR  OR  QT_QMAKE_CHANGED)
     _qt4_query_qmake(QT_INSTALL_TRANSLATIONS qt_translations_dir)
     set(QT_TRANSLATIONS_DIR ${qt_translations_dir} CACHE PATH "The location of the Qt translations" FORCE)
-  endif (QT_LIBRARY_DIR AND NOT QT_TRANSLATIONS_DIR  OR  QT_QMAKE_CHANGED)
+  endif ()
 
   # ask qmake for the imports directory
   if (QT_LIBRARY_DIR AND NOT QT_IMPORTS_DIR OR QT_QMAKE_CHANGED)
@@ -701,15 +701,15 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
       set(QT_IMPORTS_DIR NOTFOUND)
       foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH})
         set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/imports")
-      endforeach(qt_cross_path)
+      endforeach()
       find_path(QT_IMPORTS_DIR NAMES Qt
         HINTS ${qt_cross_paths} ${qt_imports_dir}
         DOC "The location of the Qt imports"
         NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH
         NO_CMAKE_SYSTEM_PATH)
       mark_as_advanced(QT_IMPORTS_DIR)
-    endif(qt_imports_dir)
-  endif (QT_LIBRARY_DIR AND NOT QT_IMPORTS_DIR  OR  QT_QMAKE_CHANGED)
+    endif()
+  endif ()
 
   # Make variables changeble to the advanced user
   mark_as_advanced( QT_LIBRARY_DIR QT_DOC_DIR QT_MKSPECS_DIR
@@ -736,16 +736,16 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
   if(Q_WS_MAC)
     if(QT_QMAKE_CHANGED)
       unset(QT_MAC_USE_COCOA CACHE)
-    endif(QT_QMAKE_CHANGED)
+    endif()
     CHECK_CXX_SYMBOL_EXISTS(QT_MAC_USE_COCOA "QtCore/qconfig.h" QT_MAC_USE_COCOA)
-  endif(Q_WS_MAC)
+  endif()
 
   if (QT_QTCOPY_REQUIRED)
      CHECK_CXX_SYMBOL_EXISTS(QT_IS_QTCOPY "QtCore/qglobal.h" QT_KDE_QT_COPY)
      if (NOT QT_IS_QTCOPY)
         message(FATAL_ERROR "qt-copy is required, but hasn't been found")
-     endif (NOT QT_IS_QTCOPY)
-  endif (QT_QTCOPY_REQUIRED)
+     endif ()
+  endif ()
 
   # Restore CMAKE_REQUIRED_INCLUDES and CMAKE_REQUIRED_FLAGS variables
   set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})
@@ -768,7 +768,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
 
   if(Q_WS_X11)
     set(QT_MODULES ${QT_MODULES} QtMotif)
-  endif(Q_WS_X11)
+  endif()
 
   if(QT_QMAKE_CHANGED)
     foreach(QT_MODULE ${QT_MODULES})
@@ -776,7 +776,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
       set(QT_${_upper_qt_module}_INCLUDE_DIR NOTFOUND)
       set(QT_${_upper_qt_module}_LIBRARY_RELEASE NOTFOUND)
       set(QT_${_upper_qt_module}_LIBRARY_DEBUG NOTFOUND)
-    endforeach(QT_MODULE)
+    endforeach()
     set(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR NOTFOUND)
     set(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NOTFOUND)
     set(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG NOTFOUND)
@@ -797,8 +797,8 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
     if(Q_WS_WIN)
       set(QT_QTMAIN_LIBRARY_DEBUG NOTFOUND)
       set(QT_QTMAIN_LIBRARY_RELEASE NOTFOUND)
-    endif(Q_WS_WIN)
-  endif(QT_QMAKE_CHANGED)
+    endif()
+  endif()
 
   foreach(QT_MODULE ${QT_MODULES})
     string(TOUPPER ${QT_MODULE} _upper_qt_module)
@@ -817,8 +817,8 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
                 ${QT_LIBRARY_DIR}/${QT_MODULE}.framework/Headers
                 NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
         )
-    endif(${QT_MODULE} STREQUAL "phonon")
-  endforeach(QT_MODULE)
+    endif()
+  endforeach()
 
   if(Q_WS_WIN)
     set(QT_MODULES ${QT_MODULES} QAxContainer QAxServer)
@@ -831,7 +831,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
       PATHS ${QT_HEADERS_DIR}/ActiveQt
       NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
       )
-  endif(Q_WS_WIN)
+  endif()
 
   # Set QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR
   find_path(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR QDesignerComponents
@@ -874,13 +874,13 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
                  NAMES ${QT_MODULE}${QT_LIBINFIX}_debug ${QT_MODULE}${QT_LIBINFIX}d ${QT_MODULE}${QT_LIBINFIX}d4
                  PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
         )
-  endforeach(QT_MODULE)
+  endforeach()
 
   # QtUiTools is sometimes not in the same directory as the other found libraries
   # e.g. on Mac, its never a framework like the others are
   if(QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTUITOOLS_LIBRARY_RELEASE)
     find_library(QT_QTUITOOLS_LIBRARY_RELEASE NAMES QtUiTools${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR})
-  endif(QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTUITOOLS_LIBRARY_RELEASE)
+  endif()
 
   # Set QT_QTDESIGNERCOMPONENTS_LIBRARY
   find_library(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NAMES QtDesignerComponents${QT_LIBINFIX} QtDesignerComponents${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
@@ -890,7 +890,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
   if(Q_WS_WIN)
     find_library(QT_QTMAIN_LIBRARY_RELEASE NAMES qtmain${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
     find_library(QT_QTMAIN_LIBRARY_DEBUG NAMES qtmain${QT_LIBINFIX}d PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
-  endif(Q_WS_WIN)
+  endif()
 
   # Set QT_QTASSISTANTCLIENT_LIBRARY
   find_library(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
@@ -905,7 +905,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
   find_library(QT_QTCLUCENE_LIBRARY_DEBUG   NAMES QtCLucene${QT_LIBINFIX}_debug QtCLucene${QT_LIBINFIX}d QtCLucene${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
   if(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCLUCENE_LIBRARY_RELEASE)
     find_library(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR})
-  endif(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCLUCENE_LIBRARY_RELEASE)
+  endif()
 
 
   ############################################
@@ -921,7 +921,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
 
   foreach(QT_MODULE ${QT_MODULES})
     _QT4_ADJUST_LIB_VARS(${QT_MODULE})
-  endforeach(QT_MODULE)
+  endforeach()
 
   _QT4_ADJUST_LIB_VARS(QtAssistant)
   _QT4_ADJUST_LIB_VARS(QtAssistantClient)
@@ -933,7 +933,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
     _QT4_ADJUST_LIB_VARS(qtmain)
     _QT4_ADJUST_LIB_VARS(QAxServer)
     _QT4_ADJUST_LIB_VARS(QAxContainer)
-  endif(Q_WS_WIN)
+  endif()
 
 
   #######################################
@@ -956,7 +956,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
     set(QT_QCOLLECTIONGENERATOR_EXECUTABLE NOTFOUND)
     set(QT_DESIGNER_EXECUTABLE NOTFOUND)
     set(QT_LINGUIST_EXECUTABLE NOTFOUND)
-  endif(QT_QMAKE_CHANGED)
+  endif()
 
   find_program(QT_MOC_EXECUTABLE
     NAMES moc-qt4 moc
@@ -1026,11 +1026,11 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
 
   if (QT_MOC_EXECUTABLE)
      set(QT_WRAP_CPP "YES")
-  endif (QT_MOC_EXECUTABLE)
+  endif ()
 
   if (QT_UIC_EXECUTABLE)
      set(QT_WRAP_UI "YES")
-  endif (QT_UIC_EXECUTABLE)
+  endif ()
 
 
 
@@ -1100,9 +1100,9 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
         unset(QT_${_upper_qt_plugin}_PLUGIN_RELEASE CACHE)
         unset(QT_${_upper_qt_plugin}_PLUGIN_DEBUG CACHE)
         unset(QT_${_upper_qt_plugin}_PLUGIN CACHE)
-      endforeach(QT_PLUGIN)
-    endforeach(QT_PLUGIN_TYPE)
-  endif(QT_QMAKE_CHANGED)
+      endforeach()
+    endforeach()
+  endif()
 
   # find_library works better than find_file but we need to set prefixes to only match plugins
   foreach(QT_PLUGIN_TYPE ${QT_PLUGIN_TYPES})
@@ -1120,7 +1120,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
                      PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
             )
         _QT4_ADJUST_LIB_VARS(${QT_PLUGIN})
-      else(QT_IS_STATIC)
+      else()
         # find_library works easier/better than find_file but we need to set suffixes to only match plugins
         set(CMAKE_FIND_LIBRARY_SUFFIXES_DEFAULT ${CMAKE_FIND_LIBRARY_SUFFIXES})
         set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_MODULE_SUFFIX} ${CMAKE_SHARED_LIBRARY_SUFFIX})
@@ -1134,9 +1134,9 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
             )
         mark_as_advanced(QT_${_upper_qt_plugin}_PLUGIN_RELEASE QT_${_upper_qt_plugin}_PLUGIN_DEBUG)
         set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_DEFAULT})
-      endif(QT_IS_STATIC)
-    endforeach(QT_PLUGIN)
-  endforeach(QT_PLUGIN_TYPE)
+      endif()
+    endforeach()
+  endforeach()
 
 
   ######################################
@@ -1152,12 +1152,12 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
   string(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" QT_VERSION_MINOR "${QTVERSION}")
   string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" QT_VERSION_PATCH "${QTVERSION}")
 
-endif(QT_QMAKE_EXECUTABLE AND QTVERSION)
+endif()
 
 #support old QT_MIN_VERSION if set, but not if version is supplied by find_package()
 if(NOT Qt4_FIND_VERSION AND QT_MIN_VERSION)
   set(Qt4_FIND_VERSION ${QT_MIN_VERSION})
-endif(NOT Qt4_FIND_VERSION AND QT_MIN_VERSION)
+endif()
 
 if( Qt4_FIND_COMPONENTS )
 
@@ -1168,34 +1168,34 @@ if( Qt4_FIND_COMPONENTS )
     if(${_COMPONENT} STREQUAL "QTMAIN")
       if(Q_WS_WIN)
         set(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_${_COMPONENT}_LIBRARY)
-      endif(Q_WS_WIN)
-    else(${_COMPONENT} STREQUAL "QTMAIN")
+      endif()
+    else()
       set(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_${_COMPONENT}_INCLUDE_DIR QT_${_COMPONENT}_LIBRARY)
-    endif(${_COMPONENT} STREQUAL "QTMAIN")
-  endforeach( component )
+    endif()
+  endforeach()
 
   if(Qt4_FIND_COMPONENTS MATCHES QtGui)
     set(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_UIC_EXECUTABLE)
-  endif(Qt4_FIND_COMPONENTS MATCHES QtGui)
+  endif()
 
-else( Qt4_FIND_COMPONENTS )
+else()
 
   # if no components specified, we'll make a default set of required variables to say Qt is found
   set(_QT4_FOUND_REQUIRED_VARS QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_UIC_EXECUTABLE QT_INCLUDE_DIR
     QT_LIBRARY_DIR QT_QTCORE_LIBRARY)
 
-endif( Qt4_FIND_COMPONENTS )
+endif()
 
 if (QT_VERSION_MAJOR GREATER 4)
     set(VERSION_MSG "Found unsuitable Qt version \"${QTVERSION}\" from ${QT_QMAKE_EXECUTABLE}")
     set(QT4_FOUND FALSE)
     if(Qt4_FIND_REQUIRED)
        message( FATAL_ERROR "${VERSION_MSG}, this code requires Qt 4.x")
-    else(Qt4_FIND_REQUIRED)
+    else()
       if(NOT Qt4_FIND_QUIETLY)
          message( STATUS    "${VERSION_MSG}")
-      endif(NOT Qt4_FIND_QUIETLY)
-    endif(Qt4_FIND_REQUIRED)
+      endif()
+    endif()
 else()
   FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt4
     REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS}
diff --git a/Modules/FindQuickTime.cmake b/Modules/FindQuickTime.cmake
index 518f42323..57de73779 100644
--- a/Modules/FindQuickTime.cmake
+++ b/Modules/FindQuickTime.cmake
@@ -28,7 +28,7 @@
 if(APPLE)
   find_path(QUICKTIME_INCLUDE_DIR QuickTime/QuickTime.h)
   find_library(QUICKTIME_LIBRARY QuickTime)
-else(APPLE)
+else()
   find_path(QUICKTIME_INCLUDE_DIR QuickTime.h
     HINTS
     $ENV{QUICKTIME_DIR}/include
@@ -39,7 +39,7 @@ else(APPLE)
     $ENV{QUICKTIME_DIR}/lib
     $ENV{QUICKTIME_DIR}
   )
-endif(APPLE)
+endif()
 
 # handle the QUIETLY and REQUIRED arguments and set QUICKTIME_FOUND to TRUE if
 # all listed variables are TRUE
diff --git a/Modules/FindRTI.cmake b/Modules/FindRTI.cmake
index e806e03ba..eef0daee9 100644
--- a/Modules/FindRTI.cmake
+++ b/Modules/FindRTI.cmake
@@ -32,14 +32,14 @@
 macro(RTI_MESSAGE_QUIETLY QUIET TYPE MSG)
   if(NOT ${QUIET})
     message(${TYPE} "${MSG}")
-  endif(NOT ${QUIET})
-endmacro(RTI_MESSAGE_QUIETLY QUIET TYPE MSG)
+  endif()
+endmacro()
 
 # Detect the CERTI installation, http://www.cert.fr/CERTI
 if ("$ENV{CERTI_HOME}" STRGREATER "")
   file(TO_CMAKE_PATH "$ENV{CERTI_HOME}" CERTI_HOME)
   RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "Using environment defined CERTI_HOME: ${CERTI_HOME}")
-endif ("$ENV{CERTI_HOME}" STRGREATER "")
+endif ()
 
 set(RTI_DEFINITIONS "-DRTI_USES_STD_FSTREAM")
 
@@ -65,9 +65,9 @@ find_library(RTI_LIBRARY
 if (RTI_LIBRARY)
   set(RTI_LIBRARIES ${RTI_LIBRARY})
   RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI library found: ${RTI_LIBRARY}")
-else (RTI_LIBRARY)
+else ()
   RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI library NOT found")
-endif (RTI_LIBRARY)
+endif ()
 
 find_library(RTI_FEDTIME_LIBRARY
   NAMES FedTime
@@ -78,7 +78,7 @@ find_library(RTI_FEDTIME_LIBRARY
 if (RTI_FEDTIME_LIBRARY)
   set(RTI_LIBRARIES ${RTI_LIBRARIES} ${RTI_FEDTIME_LIBRARY})
   RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI FedTime found: ${RTI_FEDTIME_LIBRARY}")
-endif (RTI_FEDTIME_LIBRARY)
+endif ()
 
 find_path(RTI_INCLUDE_DIR
   NAMES RTI.hh
@@ -88,9 +88,9 @@ find_path(RTI_INCLUDE_DIR
 
 if (RTI_INCLUDE_DIR)
   RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI headers found: ${RTI_INCLUDE_DIR}")
-else (RTI_INCLUDE_DIR)
+else ()
   RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "RTI headers NOT found")
-endif (RTI_INCLUDE_DIR)
+endif ()
 
 # Set the modified system variables back to the original value.
 set(CMAKE_FIND_LIBRARY_PREFIXES "${RTI_OLD_FIND_LIBRARY_PREFIXES}")
diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake
index b4a306a07..119cb63dd 100644
--- a/Modules/FindRuby.cmake
+++ b/Modules/FindRuby.cmake
@@ -46,16 +46,16 @@ set(_RUBY_POSSIBLE_EXECUTABLE_NAMES ruby)
 # if 1.9 is required, don't look for ruby18 and ruby1.8, default to version 1.8
 if(Ruby_FIND_VERSION_MAJOR  AND  Ruby_FIND_VERSION_MINOR)
    set(Ruby_FIND_VERSION_SHORT_NODOT "${Ruby_FIND_VERSION_MAJOR}${RUBY_FIND_VERSION_MINOR}")
-else(Ruby_FIND_VERSION_MAJOR  AND  Ruby_FIND_VERSION_MINOR)
+else()
    set(Ruby_FIND_VERSION_SHORT_NODOT "18")
-endif(Ruby_FIND_VERSION_MAJOR  AND  Ruby_FIND_VERSION_MINOR)
+endif()
 
 set(_RUBY_POSSIBLE_EXECUTABLE_NAMES ${_RUBY_POSSIBLE_EXECUTABLE_NAMES} ruby1.9 ruby19)
 
 # if we want a version below 1.9, also look for ruby 1.8
 if("${Ruby_FIND_VERSION_SHORT_NODOT}" VERSION_LESS "19")
    set(_RUBY_POSSIBLE_EXECUTABLE_NAMES ${_RUBY_POSSIBLE_EXECUTABLE_NAMES} ruby1.8 ruby18)
-endif("${Ruby_FIND_VERSION_SHORT_NODOT}" VERSION_LESS "19")
+endif()
 
 find_program(RUBY_EXECUTABLE NAMES ${_RUBY_POSSIBLE_EXECUTABLE_NAMES})
 
@@ -71,9 +71,9 @@ if(RUBY_EXECUTABLE  AND NOT  RUBY_VERSION_MAJOR)
         RESULT_VARIABLE _RUBY_SUCCESS
         OUTPUT_VARIABLE _RUBY_OUTPUT
         ERROR_QUIET)
-    endif(_RUBY_SUCCESS OR NOT _RUBY_OUTPUT)
+    endif()
     set(${OUTVAR} "${_RUBY_OUTPUT}" PARENT_SCOPE)
-  endfunction(_RUBY_CONFIG_VAR)
+  endfunction()
 
 
   # query the ruby version
@@ -99,7 +99,7 @@ if(RUBY_EXECUTABLE  AND NOT  RUBY_VERSION_MAJOR)
    if(RUBY_HAS_VENDOR_RUBY)
       _RUBY_CONFIG_VAR("vendorlibdir" RUBY_VENDORLIB_DIR)
       _RUBY_CONFIG_VAR("vendorarchdir" RUBY_VENDORARCH_DIR)
-   endif(RUBY_HAS_VENDOR_RUBY)
+   endif()
 
    # save the results in the cache so we don't have to run ruby the next time again
    set(RUBY_VERSION_MAJOR    ${RUBY_VERSION_MAJOR}    CACHE PATH "The Ruby major version" FORCE)
@@ -130,7 +130,7 @@ if(RUBY_EXECUTABLE  AND NOT  RUBY_VERSION_MAJOR)
      RUBY_VERSION_MINOR
      RUBY_VERSION_PATCH
      )
-endif(RUBY_EXECUTABLE  AND NOT  RUBY_VERSION_MAJOR)
+endif()
 
 # In case RUBY_EXECUTABLE could not be executed (e.g. cross compiling)
 # try to detect which version we found. This is not too good.
@@ -143,15 +143,15 @@ if(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR)
    if(${RUBY_EXECUTABLE} MATCHES "ruby1.?9"  OR  RUBY_HDR_DIR)
       set(RUBY_VERSION_MAJOR 1)
       set(RUBY_VERSION_MINOR 9)
-   endif(${RUBY_EXECUTABLE} MATCHES "ruby1.?9"  OR  RUBY_HDR_DIR)
-endif(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR)
+   endif()
+endif()
 
 if(RUBY_VERSION_MAJOR)
    set(RUBY_VERSION "${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}.${RUBY_VERSION_PATCH}")
    set(_RUBY_VERSION_SHORT "${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}")
    set(_RUBY_VERSION_SHORT_NODOT "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}")
    set(_RUBY_NODOT_VERSION "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}${RUBY_VERSION_PATCH}")
-endif(RUBY_VERSION_MAJOR)
+endif()
 
 find_path(RUBY_INCLUDE_DIR
    NAMES ruby.h
@@ -172,7 +172,7 @@ if( "${Ruby_FIND_VERSION_SHORT_NODOT}" GREATER 18  OR  "${_RUBY_VERSION_SHORT_NO
      )
 
    set(RUBY_INCLUDE_DIRS ${RUBY_INCLUDE_DIRS} ${RUBY_CONFIG_INCLUDE_DIR} )
-endif( "${Ruby_FIND_VERSION_SHORT_NODOT}" GREATER 18  OR  "${_RUBY_VERSION_SHORT_NODOT}" GREATER 18  OR  RUBY_HDR_DIR)
+endif()
 
 
 # Determine the list of possible names for the ruby library
@@ -182,26 +182,26 @@ if(WIN32)
    set( _RUBY_MSVC_RUNTIME "" )
    if( MSVC60 )
      set( _RUBY_MSVC_RUNTIME "60" )
-   endif( MSVC60 )
+   endif()
    if( MSVC70 )
      set( _RUBY_MSVC_RUNTIME "70" )
-   endif( MSVC70 )
+   endif()
    if( MSVC71 )
      set( _RUBY_MSVC_RUNTIME "71" )
-   endif( MSVC71 )
+   endif()
    if( MSVC80 )
      set( _RUBY_MSVC_RUNTIME "80" )
-   endif( MSVC80 )
+   endif()
    if( MSVC90 )
      set( _RUBY_MSVC_RUNTIME "90" )
-   endif( MSVC90 )
+   endif()
 
    list(APPEND _RUBY_POSSIBLE_LIB_NAMES
                "msvcr${_RUBY_MSVC_RUNTIME}-ruby${_RUBY_NODOT_VERSION}"
                "msvcr${_RUBY_MSVC_RUNTIME}-ruby${_RUBY_NODOT_VERSION}-static"
                "msvcrt-ruby${_RUBY_NODOT_VERSION}"
                "msvcrt-ruby${_RUBY_NODOT_VERSION}-static" )
-endif(WIN32)
+endif()
 
 find_library(RUBY_LIBRARY NAMES ${_RUBY_POSSIBLE_LIB_NAMES} HINTS ${RUBY_POSSIBLE_LIB_DIR} )
 
@@ -209,7 +209,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 set(_RUBY_REQUIRED_VARS RUBY_EXECUTABLE RUBY_INCLUDE_DIR RUBY_LIBRARY)
 if(_RUBY_VERSION_SHORT_NODOT GREATER 18)
    list(APPEND _RUBY_REQUIRED_VARS RUBY_CONFIG_INCLUDE_DIR)
-endif(_RUBY_VERSION_SHORT_NODOT GREATER 18)
+endif()
 
 if(_RUBY_DEBUG_OUTPUT)
    message(STATUS "--------FindRuby.cmake debug------------")
@@ -225,7 +225,7 @@ if(_RUBY_DEBUG_OUTPUT)
    message(STATUS "RUBY_INCLUDE_DIR: ${RUBY_INCLUDE_DIR}")
    message(STATUS "RUBY_CONFIG_INCLUDE_DIR: ${RUBY_CONFIG_INCLUDE_DIR}")
    message(STATUS "--------------------")
-endif(_RUBY_DEBUG_OUTPUT)
+endif()
 
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Ruby  REQUIRED_VARS  ${_RUBY_REQUIRED_VARS}
                                         VERSION_VAR RUBY_VERSION )
diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake
index 65fea848d..806b6596d 100644
--- a/Modules/FindSDL.cmake
+++ b/Modules/FindSDL.cmake
@@ -113,8 +113,8 @@ if(NOT SDL_BUILDING_LIBRARY)
       /opt/csw
       /opt
     )
-  endif(NOT ${SDL_INCLUDE_DIR} MATCHES ".framework")
-endif(NOT SDL_BUILDING_LIBRARY)
+  endif()
+endif()
 
 # SDL may require threads on your system.
 # The Apple build may not need an explicit flag because one of the
@@ -122,22 +122,22 @@ endif(NOT SDL_BUILDING_LIBRARY)
 # But for non-OSX systems, I will use the CMake Threads package.
 if(NOT APPLE)
   find_package(Threads)
-endif(NOT APPLE)
+endif()
 
 # MinGW needs an additional library, mwindows
 # It's total link flags should look like -lmingw32 -lSDLmain -lSDL -lmwindows
 # (Actually on second look, I think it only needs one of the m* libraries.)
 if(MINGW)
   set(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
-endif(MINGW)
+endif()
 
 if(SDL_LIBRARY_TEMP)
   # For SDLmain
   if(NOT SDL_BUILDING_LIBRARY)
     if(SDLMAIN_LIBRARY)
       set(SDL_LIBRARY_TEMP ${SDLMAIN_LIBRARY} ${SDL_LIBRARY_TEMP})
-    endif(SDLMAIN_LIBRARY)
-  endif(NOT SDL_BUILDING_LIBRARY)
+    endif()
+  endif()
 
   # For OS X, SDL uses Cocoa as a backend so it must link to Cocoa.
   # CMake doesn't display the -framework Cocoa string in the UI even
@@ -147,25 +147,25 @@ if(SDL_LIBRARY_TEMP)
   # "real" variable in one-shot.
   if(APPLE)
     set(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} "-framework Cocoa")
-  endif(APPLE)
+  endif()
 
   # For threads, as mentioned Apple doesn't need this.
   # In fact, there seems to be a problem if I used the Threads package
   # and try using this line, so I'm just skipping it entirely for OS X.
   if(NOT APPLE)
     set(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
-  endif(NOT APPLE)
+  endif()
 
   # For MinGW library
   if(MINGW)
     set(SDL_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL_LIBRARY_TEMP})
-  endif(MINGW)
+  endif()
 
   # Set the final string here so the GUI reflects the final state.
   set(SDL_LIBRARY ${SDL_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found")
   # Set the temp variable to INTERNAL so it is not seen in the CMake GUI
   set(SDL_LIBRARY_TEMP "${SDL_LIBRARY_TEMP}" CACHE INTERNAL "")
-endif(SDL_LIBRARY_TEMP)
+endif()
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 
diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake
index 06ae203ad..368595695 100644
--- a/Modules/FindSDL_sound.cmake
+++ b/Modules/FindSDL_sound.cmake
@@ -172,7 +172,7 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
    set(TMP_TRY_LIBS)
    foreach(lib ${SDL_SOUND_LIBRARY} ${SDL_LIBRARY})
      set(TMP_TRY_LIBS "${TMP_TRY_LIBS} \"${lib}\"")
-   endforeach(lib)
+   endforeach()
 
    # message("TMP_TRY_LIBS ${TMP_TRY_LIBS}")
 
@@ -225,8 +225,8 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
        )
        if(MIKMOD_LIBRARY)
          set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${MIKMOD_LIBRARY})
-       endif(MIKMOD_LIBRARY)
-     endif("${MY_OUTPUT}" MATCHES "MikMod_")
+       endif()
+     endif()
 
      # Find ModPlug
      if("${MY_OUTPUT}" MATCHES "MODPLUG_")
@@ -246,8 +246,8 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
        )
        if(MODPLUG_LIBRARY)
          set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${MODPLUG_LIBRARY})
-       endif(MODPLUG_LIBRARY)
-     endif("${MY_OUTPUT}" MATCHES "MODPLUG_")
+       endif()
+     endif()
 
 
      # Find Ogg and Vorbis
@@ -270,7 +270,7 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
          )
        if(VORBIS_LIBRARY)
          set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${VORBIS_LIBRARY})
-       endif(VORBIS_LIBRARY)
+       endif()
 
        find_library(OGG_LIBRARY
          NAMES ogg Ogg OGG
@@ -290,8 +290,8 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
          )
        if(OGG_LIBRARY)
          set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${OGG_LIBRARY})
-       endif(OGG_LIBRARY)
-     endif("${MY_OUTPUT}" MATCHES "ov_")
+       endif()
+     endif()
 
 
      # Find SMPEG
@@ -312,8 +312,8 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
          )
        if(SMPEG_LIBRARY)
          set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${SMPEG_LIBRARY})
-       endif(SMPEG_LIBRARY)
-     endif("${MY_OUTPUT}" MATCHES "SMPEG_")
+       endif()
+     endif()
 
 
      # Find FLAC
@@ -334,8 +334,8 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
          )
        if(FLAC_LIBRARY)
          set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${FLAC_LIBRARY})
-       endif(FLAC_LIBRARY)
-     endif("${MY_OUTPUT}" MATCHES "FLAC_")
+       endif()
+     endif()
 
 
      # Hmmm...Speex seems to depend on Ogg. This might be a problem if
@@ -359,7 +359,7 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
          )
        if(SPEEX_LIBRARY)
          set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${SPEEX_LIBRARY})
-       endif(SPEEX_LIBRARY)
+       endif()
 
        # Find OGG (needed for Speex)
      # We might have already found Ogg for Vorbis, so skip it if so.
@@ -384,16 +384,16 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
            )
          if(OGG_LIBRARY)
            set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${OGG_LIBRARY})
-         endif(OGG_LIBRARY)
-       endif(NOT OGG_LIBRARY)
-     endif("${MY_OUTPUT}" MATCHES "speex_")
+         endif()
+       endif()
+     endif()
 
-   else(NOT MY_RESULT)
+   else()
      set(SDL_SOUND_LIBRARIES "${SDL_SOUND_EXTRAS} ${SDL_SOUND_LIBRARY}" CACHE INTERNAL "SDL_sound and dependent libraries")
-   endif(NOT MY_RESULT)
+   endif()
 
    set(SDL_SOUND_LIBRARIES "${SDL_SOUND_EXTRAS} ${SDL_SOUND_LIBRARIES_TMP}" CACHE INTERNAL "SDL_sound and dependent libraries")
- endif(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
+ endif()
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 
diff --git a/Modules/FindSWIG.cmake b/Modules/FindSWIG.cmake
index 33cf9d16d..db60b888c 100644
--- a/Modules/FindSWIG.cmake
+++ b/Modules/FindSWIG.cmake
@@ -38,10 +38,10 @@ if(SWIG_EXECUTABLE)
   if(SWIG_swiglib_result)
     if(SWIG_FIND_REQUIRED)
       message(SEND_ERROR "Command \"${SWIG_EXECUTABLE} -swiglib\" failed with output:\n${SWIG_swiglib_error}")
-    else(SWIG_FIND_REQUIRED)
+    else()
       message(STATUS "Command \"${SWIG_EXECUTABLE} -swiglib\" failed with output:\n${SWIG_swiglib_error}")
-    endif(SWIG_FIND_REQUIRED)
-  else(SWIG_swiglib_result)
+    endif()
+  else()
     string(REGEX REPLACE "[\n\r]+" ";" SWIG_swiglib_output ${SWIG_swiglib_output})
     # force the path to be computed each time in case SWIG_EXECUTABLE has changed.
     set(SWIG_DIR SWIG_DIR-NOTFOUND)
@@ -54,14 +54,14 @@ if(SWIG_EXECUTABLE)
         RESULT_VARIABLE SWIG_version_result)
       if(SWIG_version_result)
         message(SEND_ERROR "Command \"${SWIG_EXECUTABLE} -version\" failed with output:\n${SWIG_version_output}")
-      else(SWIG_version_result)
+      else()
         string(REGEX REPLACE ".*SWIG Version[^0-9.]*\([0-9.]+\).*" "\\1"
           SWIG_version_output "${SWIG_version_output}")
         set(SWIG_VERSION ${SWIG_version_output} CACHE STRING "Swig version" FORCE)
-      endif(SWIG_version_result)
-    endif(SWIG_DIR)
-  endif(SWIG_swiglib_result)
-endif(SWIG_EXECUTABLE)
+      endif()
+    endif()
+  endif()
+endif()
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(SWIG  REQUIRED_VARS SWIG_EXECUTABLE SWIG_DIR
diff --git a/Modules/FindSelfPackers.cmake b/Modules/FindSelfPackers.cmake
index 7d446616c..7726dce41 100644
--- a/Modules/FindSelfPackers.cmake
+++ b/Modules/FindSelfPackers.cmake
@@ -49,18 +49,18 @@ mark_as_advanced(
 if (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx")
   set (SELF_PACKER_FOR_EXECUTABLE_FLAGS "-q" CACHE STRING
        "Flags for the executable self-packer.")
-else (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx")
+else ()
   set (SELF_PACKER_FOR_EXECUTABLE_FLAGS "" CACHE STRING
        "Flags for the executable self-packer.")
-endif (SELF_PACKER_FOR_EXECUTABLE MATCHES "upx")
+endif ()
 
 if (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx")
   set (SELF_PACKER_FOR_SHARED_LIB_FLAGS "-q" CACHE STRING
        "Flags for the shared lib self-packer.")
-else (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx")
+else ()
   set (SELF_PACKER_FOR_SHARED_LIB_FLAGS "" CACHE STRING
        "Flags for the shared lib self-packer.")
-endif (SELF_PACKER_FOR_SHARED_LIB MATCHES "upx")
+endif ()
 
 mark_as_advanced(
   SELF_PACKER_FOR_EXECUTABLE_FLAGS
diff --git a/Modules/FindSquish.cmake b/Modules/FindSquish.cmake
index 0127edccc..b44ba7093 100644
--- a/Modules/FindSquish.cmake
+++ b/Modules/FindSquish.cmake
@@ -20,7 +20,7 @@
 #  find_package(Squish)
 #  if (SQUISH_FOUND)
 #    SQUISH_ADD_TEST(myTestName myApplication testSuiteName testCaseName)
-#  endif (SQUISH_FOUND)
+#  endif ()
 #
 
 #=============================================================================
@@ -49,7 +49,7 @@ if(NOT SQUISH_INSTALL_DIR)
   set(SQUISH_INSTALL_DIR_SEARCH "")
   foreach(dir ${SQUISH_INSTALL_DIR_SEARCH2})
     set(SQUISH_INSTALL_DIR_SEARCH ${SQUISH_INSTALL_DIR_SEARCH} "${dir}/../lib/fltk")
-  endforeach(dir)
+  endforeach()
   string(REPLACE "//" "/" SQUISH_INSTALL_DIR_SEARCH "${SQUISH_INSTALL_DIR_SEARCH}")
 
   # Look for an installation
@@ -65,7 +65,7 @@ if(NOT SQUISH_INSTALL_DIR)
 
     DOC "The ${SQUISH_INSTALL_DIR_STRING}"
     )
-endif(NOT SQUISH_INSTALL_DIR)
+endif()
 
 # search for the executables
 if(SQUISH_INSTALL_DIR)
@@ -74,37 +74,37 @@ if(SQUISH_INSTALL_DIR)
   # find the client program
   if(NOT SQUISH_CLIENT_EXECUTABLE)
     find_program(SQUISH_CLIENT_EXECUTABLE ${SQUISH_INSTALL_DIR}/bin/squishrunner DOC "The ${SQUISH_CLIENT_EXECUTABLE_STRING}")
-  endif(NOT SQUISH_CLIENT_EXECUTABLE)
+  endif()
 
   # find the server program
   if(NOT SQUISH_SERVER_EXECUTABLE)
     find_program(SQUISH_SERVER_EXECUTABLE ${SQUISH_INSTALL_DIR}/bin/squishserver DOC "The ${SQUISH_SERVER_EXECUTABLE_STRING}")
-  endif(NOT SQUISH_SERVER_EXECUTABLE)
+  endif()
 
-else(SQUISH_INSTALL_DIR)
+else()
   set(SQUISH_INSTALL_DIR_FOUND 0)
-endif(SQUISH_INSTALL_DIR)
+endif()
 
 # record if executables are set
 if(SQUISH_CLIENT_EXECUTABLE)
   set(SQUISH_CLIENT_EXECUTABLE_FOUND 1)
-else(SQUISH_CLIENT_EXECUTABLE)
+else()
   set(SQUISH_CLIENT_EXECUTABLE_FOUND 0)
-endif(SQUISH_CLIENT_EXECUTABLE)
+endif()
 
 if(SQUISH_SERVER_EXECUTABLE)
   set(SQUISH_SERVER_EXECUTABLE_FOUND 1)
-else(SQUISH_SERVER_EXECUTABLE)
+else()
   set(SQUISH_SERVER_EXECUTABLE_FOUND 0)
-endif(SQUISH_SERVER_EXECUTABLE)
+endif()
 
 # record if Squish was found
 set(SQUISH_FOUND 1)
 foreach(var SQUISH_INSTALL_DIR_FOUND SQUISH_CLIENT_EXECUTABLE_FOUND SQUISH_SERVER_EXECUTABLE_FOUND)
   if(NOT ${var})
     set(SQUISH_FOUND 0)
-  endif(NOT ${var})
-endforeach(var)
+  endif()
+endforeach()
 
 macro(SQUISH_ADD_TEST testName testAUT testCase envVars testWraper)
   add_test(${testName}
@@ -121,5 +121,5 @@ macro(SQUISH_ADD_TEST testName testAUT testCase envVars testWraper)
   set_tests_properties(${testName}
     PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED;ERROR;FATAL"
     )
-endmacro(SQUISH_ADD_TEST)
+endmacro()
 
diff --git a/Modules/FindSubversion.cmake b/Modules/FindSubversion.cmake
index 85c51059c..f1bfc75bc 100644
--- a/Modules/FindSubversion.cmake
+++ b/Modules/FindSubversion.cmake
@@ -31,7 +31,7 @@
 #    message("Current revision is ${Project_WC_REVISION}")
 #    Subversion_WC_LOG(${PROJECT_SOURCE_DIR} Project)
 #    message("Last changed log is ${Project_LAST_CHANGED_LOG}")
-#  endif(SUBVERSION_FOUND)
+#  endif()
 
 #=============================================================================
 # Copyright 2006-2009 Kitware, Inc.
@@ -81,7 +81,7 @@ if(Subversion_SVN_EXECUTABLE)
 
     if(NOT ${Subversion_svn_info_result} EQUAL 0)
       message(SEND_ERROR "Command \"${Subversion_SVN_EXECUTABLE} info ${dir}\" failed with output:\n${Subversion_svn_info_error}")
-    else(NOT ${Subversion_svn_info_result} EQUAL 0)
+    else()
 
       string(REGEX REPLACE "^(.*\n)?URL: ([^\n]+).*"
         "\\2" ${prefix}_WC_URL "${${prefix}_WC_INFO}")
@@ -96,12 +96,12 @@ if(Subversion_SVN_EXECUTABLE)
       string(REGEX REPLACE "^(.*\n)?Last Changed Date: ([^\n]+).*"
         "\\2" ${prefix}_WC_LAST_CHANGED_DATE "${${prefix}_WC_INFO}")
 
-    endif(NOT ${Subversion_svn_info_result} EQUAL 0)
+    endif()
 
     # restore the previous LC_ALL
     set(ENV{LC_ALL} ${_Subversion_SAVED_LC_ALL})
 
-  endmacro(Subversion_WC_INFO)
+  endmacro()
 
   macro(Subversion_WC_LOG dir prefix)
     # This macro can block if the certificate is not signed:
@@ -117,10 +117,10 @@ if(Subversion_SVN_EXECUTABLE)
 
     if(NOT ${Subversion_svn_log_result} EQUAL 0)
       message(SEND_ERROR "Command \"${Subversion_SVN_EXECUTABLE} log -r BASE ${dir}\" failed with output:\n${Subversion_svn_log_error}")
-    endif(NOT ${Subversion_svn_log_result} EQUAL 0)
-  endmacro(Subversion_WC_LOG)
+    endif()
+  endmacro()
 
-endif(Subversion_SVN_EXECUTABLE)
+endif()
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Subversion REQUIRED_VARS Subversion_SVN_EXECUTABLE
diff --git a/Modules/FindTCL.cmake b/Modules/FindTCL.cmake
index 9fe2c7aeb..0d20da59a 100644
--- a/Modules/FindTCL.cmake
+++ b/Modules/FindTCL.cmake
@@ -50,12 +50,12 @@ include(FindWish)
 
 if(TCLSH_VERSION_STRING)
   set(TCL_TCLSH_VERSION "${TCLSH_VERSION_STRING}")
-else(TCLSH_VERSION_STRING)
+else()
   get_filename_component(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
   get_filename_component(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH)
   string(REGEX REPLACE
     "^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}")
-endif(TCLSH_VERSION_STRING)
+endif()
 
 get_filename_component(TK_WISH_PATH "${TK_WISH}" PATH)
 get_filename_component(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH)
@@ -101,7 +101,7 @@ if(WIN32)
     "C:/Program Files/Tcl/lib"
     "C:/Tcl/lib"
     )
-endif(WIN32)
+endif()
 
 find_library(TCL_LIBRARY
   NAMES
@@ -137,9 +137,9 @@ if(Tcl_FRAMEWORKS)
   if(NOT TCL_INCLUDE_PATH)
     foreach(dir ${Tcl_FRAMEWORKS})
       set(TCL_FRAMEWORK_INCLUDES ${TCL_FRAMEWORK_INCLUDES} ${dir}/Headers)
-    endforeach(dir)
-  endif(NOT TCL_INCLUDE_PATH)
-endif(Tcl_FRAMEWORKS)
+    endforeach()
+  endif()
+endif()
 
 set(TK_FRAMEWORK_INCLUDES)
 if(Tk_FRAMEWORKS)
@@ -147,9 +147,9 @@ if(Tk_FRAMEWORKS)
     foreach(dir ${Tk_FRAMEWORKS})
       set(TK_FRAMEWORK_INCLUDES ${TK_FRAMEWORK_INCLUDES}
         ${dir}/Headers ${dir}/PrivateHeaders)
-    endforeach(dir)
-  endif(NOT TK_INCLUDE_PATH)
-endif(Tk_FRAMEWORKS)
+    endforeach()
+  endif()
+endif()
 
 set(TCLTK_POSSIBLE_INCLUDE_PATHS
   "${TCL_LIBRARY_PATH_PARENT}/include"
@@ -183,7 +183,7 @@ if(WIN32)
     "C:/Program Files/Tcl/include"
     "C:/Tcl/include"
     )
-endif(WIN32)
+endif()
 
 find_path(TCL_INCLUDE_PATH
   NAMES tcl.h
diff --git a/Modules/FindTIFF.cmake b/Modules/FindTIFF.cmake
index c09c4c947..b48fb0e1d 100644
--- a/Modules/FindTIFF.cmake
+++ b/Modules/FindTIFF.cmake
@@ -43,6 +43,6 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(TIFF
 
 if(TIFF_FOUND)
   set( TIFF_LIBRARIES ${TIFF_LIBRARY} )
-endif(TIFF_FOUND)
+endif()
 
 mark_as_advanced(TIFF_INCLUDE_DIR TIFF_LIBRARY)
diff --git a/Modules/FindTclStub.cmake b/Modules/FindTclStub.cmake
index cb7727121..e66f7bc21 100644
--- a/Modules/FindTclStub.cmake
+++ b/Modules/FindTclStub.cmake
@@ -85,7 +85,7 @@ if(WIN32)
     "C:/Program Files/Tcl/lib"
     "C:/Tcl/lib"
     )
-endif(WIN32)
+endif()
 
 find_library(TCL_STUB_LIBRARY
   NAMES
diff --git a/Modules/FindTclsh.cmake b/Modules/FindTclsh.cmake
index 1e356f526..0f091e60d 100644
--- a/Modules/FindTclsh.cmake
+++ b/Modules/FindTclsh.cmake
@@ -22,7 +22,7 @@
 
 if(CYGWIN)
   find_program(TCL_TCLSH NAMES cygtclsh83 cygtclsh80)
-endif(CYGWIN)
+endif()
 
 get_filename_component(TK_WISH_PATH "${TK_WISH}" PATH)
 get_filename_component(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH)
@@ -64,7 +64,7 @@ if(WIN32)
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/bin"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/bin"
     )
-endif(WIN32)
+endif()
 
 set(TCL_TCLSH_NAMES
   tclsh
@@ -88,7 +88,7 @@ if(TCL_TCLSH)
                    OUTPUT_VARIABLE TCLSH_VERSION_STRING
                    ERROR_QUIET
                    OUTPUT_STRIP_TRAILING_WHITESPACE)
-endif(TCL_TCLSH)
+endif()
 
 # handle the QUIETLY and REQUIRED arguments and set TIFF_FOUND to TRUE if
 # all listed variables are TRUE
diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake
index 22bffef4a..5d7677791 100644
--- a/Modules/FindThreads.cmake
+++ b/Modules/FindThreads.cmake
@@ -78,9 +78,9 @@ else()
             set(CMAKE_HAVE_THREADS_LIBRARY 1)
             set(Threads_FOUND TRUE)
           endif()
-        endif(CMAKE_SYSTEM MATCHES "SunOS.*")
-      endif(NOT CMAKE_HAVE_THREADS_LIBRARY)
-    endif(NOT THREADS_HAVE_PTHREAD_ARG)
+        endif()
+      endif()
+    endif()
 
     if(NOT CMAKE_HAVE_THREADS_LIBRARY)
       # If we did not found -lpthread, -lpthread, or -lthread, look for -pthread
@@ -109,15 +109,15 @@ else()
             "Determining if compiler accepts -pthread failed with the following output:\n${OUTPUT}\n\n")
         endif()
 
-      endif("THREADS_HAVE_PTHREAD_ARG" MATCHES "^THREADS_HAVE_PTHREAD_ARG")
+      endif()
 
       if(THREADS_HAVE_PTHREAD_ARG)
         set(Threads_FOUND TRUE)
         set(CMAKE_THREAD_LIBS_INIT "-pthread")
       endif()
 
-    endif(NOT CMAKE_HAVE_THREADS_LIBRARY)
-  endif(CMAKE_HAVE_PTHREAD_H)
+    endif()
+  endif()
 endif()
 
 if(CMAKE_THREAD_LIBS_INIT OR CMAKE_HAVE_LIBC_CREATE)
@@ -145,7 +145,7 @@ if(CMAKE_USE_PTHREADS_INIT)
       set(CMAKE_THREAD_LIBS_INIT "-lcma")
       set(CMAKE_HP_PTHREADS_INIT 1)
       set(Threads_FOUND TRUE)
-    endif(CMAKE_HAVE_HP_CMA)
+    endif()
     set(CMAKE_USE_PTHREADS_INIT 1)
   endif()
 
@@ -160,7 +160,7 @@ if(CMAKE_USE_PTHREADS_INIT)
     set(CMAKE_THREAD_LIBS_INIT )
     set(CMAKE_USE_WIN32_THREADS_INIT 0)
   endif()
-endif(CMAKE_USE_PTHREADS_INIT)
+endif()
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Threads DEFAULT_MSG Threads_FOUND)
diff --git a/Modules/FindVTK.cmake b/Modules/FindVTK.cmake
index a6257f5e6..b60845d85 100644
--- a/Modules/FindVTK.cmake
+++ b/Modules/FindVTK.cmake
@@ -80,11 +80,11 @@ if(_VTK_40_ALLOW AND NOT VTK_DIR)
   set(VTK_DIR_SEARCH_LEGACY "")
   if(VTK_BINARY_PATH AND USE_BUILT_VTK)
     set(VTK_DIR_SEARCH_LEGACY ${VTK_DIR_SEARCH_LEGACY} ${VTK_BINARY_PATH})
-  endif(VTK_BINARY_PATH AND USE_BUILT_VTK)
+  endif()
   if(VTK_INSTALL_PATH AND USE_INSTALLED_VTK)
     set(VTK_DIR_SEARCH_LEGACY ${VTK_DIR_SEARCH_LEGACY}
         ${VTK_INSTALL_PATH}/lib/vtk)
-  endif(VTK_INSTALL_PATH AND USE_INSTALLED_VTK)
+  endif()
 
   # Look for UseVTK.cmake in build trees or under <prefix>/include/vtk.
   find_path(VTK_DIR
@@ -129,13 +129,13 @@ endif()
 if(VTK_FOUND)
   # Set USE_VTK_FILE for backward-compatability.
   set(USE_VTK_FILE ${VTK_USE_FILE})
-else(VTK_FOUND)
+else()
   # VTK not found, explain to the user how to specify its location.
   if(VTK_FIND_REQUIRED)
     message(FATAL_ERROR ${VTK_DIR_MESSAGE})
-  else(VTK_FIND_REQUIRED)
+  else()
     if(NOT VTK_FIND_QUIETLY)
       message(STATUS ${VTK_DIR_MESSAGE})
-    endif(NOT VTK_FIND_QUIETLY)
-  endif(VTK_FIND_REQUIRED)
-endif(VTK_FOUND)
+    endif()
+  endif()
+endif()
diff --git a/Modules/FindWish.cmake b/Modules/FindWish.cmake
index 5f1789066..11b29f249 100644
--- a/Modules/FindWish.cmake
+++ b/Modules/FindWish.cmake
@@ -22,7 +22,7 @@
 
 if(UNIX)
   find_program(TK_WISH cygwish80 )
-endif(UNIX)
+endif()
 
 get_filename_component(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
 get_filename_component(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH)
@@ -64,7 +64,7 @@ if(WIN32)
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/bin"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/bin"
     )
-endif(WIN32)
+endif()
 
 set(TK_WISH_NAMES
   wish
diff --git a/Modules/FindX11.cmake b/Modules/FindX11.cmake
index 1c16af573..0b63bc9bd 100644
--- a/Modules/FindX11.cmake
+++ b/Modules/FindX11.cmake
@@ -151,184 +151,184 @@ if (UNIX)
   set(X11_LIBRARY_DIR "")
   if(X11_X11_LIB)
     get_filename_component(X11_LIBRARY_DIR ${X11_X11_LIB} PATH)
-  endif(X11_X11_LIB)
+  endif()
 
   set(X11_INCLUDE_DIR) # start with empty list
   if(X11_X11_INCLUDE_PATH)
     set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_X11_INCLUDE_PATH})
-  endif(X11_X11_INCLUDE_PATH)
+  endif()
 
   if(X11_Xlib_INCLUDE_PATH)
     set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xlib_INCLUDE_PATH})
-  endif(X11_Xlib_INCLUDE_PATH)
+  endif()
 
   if(X11_Xutil_INCLUDE_PATH)
     set(X11_Xutil_FOUND TRUE)
     set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xutil_INCLUDE_PATH})
-  endif(X11_Xutil_INCLUDE_PATH)
+  endif()
 
   if(X11_Xshape_INCLUDE_PATH)
     set(X11_Xshape_FOUND TRUE)
     set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xshape_INCLUDE_PATH})
-  endif(X11_Xshape_INCLUDE_PATH)
+  endif()
 
   set(X11_LIBRARIES) # start with empty list
   if(X11_X11_LIB)
     set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_X11_LIB})
-  endif(X11_X11_LIB)
+  endif()
 
   if(X11_Xext_LIB)
     set(X11_Xext_FOUND TRUE)
     set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xext_LIB})
-  endif(X11_Xext_LIB)
+  endif()
 
   if(X11_Xt_LIB AND X11_Xt_INCLUDE_PATH)
     set(X11_Xt_FOUND TRUE)
-  endif(X11_Xt_LIB AND X11_Xt_INCLUDE_PATH)
+  endif()
 
   if(X11_Xft_LIB AND X11_Xft_INCLUDE_PATH)
     set(X11_Xft_FOUND TRUE)
     set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xft_INCLUDE_PATH})
-  endif(X11_Xft_LIB AND X11_Xft_INCLUDE_PATH)
+  endif()
 
   if(X11_Xv_LIB AND X11_Xv_INCLUDE_PATH)
     set(X11_Xv_FOUND TRUE)
     set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xv_INCLUDE_PATH})
-  endif(X11_Xv_LIB AND X11_Xv_INCLUDE_PATH)
+  endif()
 
   if (X11_Xau_LIB AND X11_Xau_INCLUDE_PATH)
     set(X11_Xau_FOUND TRUE)
-  endif (X11_Xau_LIB AND X11_Xau_INCLUDE_PATH)
+  endif ()
 
   if (X11_Xdmcp_INCLUDE_PATH AND X11_Xdmcp_LIB)
       set(X11_Xdmcp_FOUND TRUE)
       set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xdmcp_INCLUDE_PATH})
-  endif (X11_Xdmcp_INCLUDE_PATH AND X11_Xdmcp_LIB)
+  endif ()
 
   if (X11_Xaccessrules_INCLUDE_PATH AND X11_Xaccessstr_INCLUDE_PATH)
       set(X11_Xaccess_FOUND TRUE)
       set(X11_Xaccess_INCLUDE_PATH ${X11_Xaccessstr_INCLUDE_PATH})
       set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xaccess_INCLUDE_PATH})
-  endif (X11_Xaccessrules_INCLUDE_PATH AND X11_Xaccessstr_INCLUDE_PATH)
+  endif ()
 
   if (X11_Xpm_INCLUDE_PATH AND X11_Xpm_LIB)
       set(X11_Xpm_FOUND TRUE)
       set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xpm_INCLUDE_PATH})
-  endif (X11_Xpm_INCLUDE_PATH AND X11_Xpm_LIB)
+  endif ()
 
   if (X11_Xcomposite_INCLUDE_PATH AND X11_Xcomposite_LIB)
      set(X11_Xcomposite_FOUND TRUE)
      set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xcomposite_INCLUDE_PATH})
-  endif (X11_Xcomposite_INCLUDE_PATH AND X11_Xcomposite_LIB)
+  endif ()
 
   if (X11_Xdamage_INCLUDE_PATH AND X11_Xdamage_LIB)
      set(X11_Xdamage_FOUND TRUE)
      set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xdamage_INCLUDE_PATH})
-  endif (X11_Xdamage_INCLUDE_PATH AND X11_Xdamage_LIB)
+  endif ()
 
   if (X11_XShm_INCLUDE_PATH)
      set(X11_XShm_FOUND TRUE)
      set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XShm_INCLUDE_PATH})
-  endif (X11_XShm_INCLUDE_PATH)
+  endif ()
 
   if (X11_XTest_INCLUDE_PATH AND X11_XTest_LIB)
       set(X11_XTest_FOUND TRUE)
       set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XTest_INCLUDE_PATH})
-  endif (X11_XTest_INCLUDE_PATH AND X11_XTest_LIB)
+  endif ()
 
   if (X11_Xi_INCLUDE_PATH AND X11_Xi_LIB)
      set(X11_Xi_FOUND TRUE)
      set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xi_INCLUDE_PATH})
-  endif (X11_Xi_INCLUDE_PATH  AND X11_Xi_LIB)
+  endif ()
 
   if (X11_Xinerama_INCLUDE_PATH AND X11_Xinerama_LIB)
      set(X11_Xinerama_FOUND TRUE)
      set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinerama_INCLUDE_PATH})
-  endif (X11_Xinerama_INCLUDE_PATH  AND X11_Xinerama_LIB)
+  endif ()
 
   if (X11_Xfixes_INCLUDE_PATH AND X11_Xfixes_LIB)
      set(X11_Xfixes_FOUND TRUE)
      set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xfixes_INCLUDE_PATH})
-  endif (X11_Xfixes_INCLUDE_PATH AND X11_Xfixes_LIB)
+  endif ()
 
   if (X11_Xrender_INCLUDE_PATH AND X11_Xrender_LIB)
      set(X11_Xrender_FOUND TRUE)
      set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrender_INCLUDE_PATH})
-  endif (X11_Xrender_INCLUDE_PATH AND X11_Xrender_LIB)
+  endif ()
 
   if (X11_XRes_INCLUDE_PATH AND X11_XRes_LIB)
      set(X11_XRes_FOUND TRUE)
      set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XRes_INCLUDE_PATH})
-  endif (X11_XRes_INCLUDE_PATH AND X11_XRes_LIB)
+  endif ()
 
   if (X11_Xrandr_INCLUDE_PATH AND X11_Xrandr_LIB)
      set(X11_Xrandr_FOUND TRUE)
      set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrandr_INCLUDE_PATH})
-  endif (X11_Xrandr_INCLUDE_PATH AND X11_Xrandr_LIB)
+  endif ()
 
   if (X11_xf86misc_INCLUDE_PATH AND X11_Xxf86misc_LIB)
      set(X11_xf86misc_FOUND TRUE)
      set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86misc_INCLUDE_PATH})
-  endif (X11_xf86misc_INCLUDE_PATH  AND X11_Xxf86misc_LIB)
+  endif ()
 
   if (X11_xf86vmode_INCLUDE_PATH AND X11_Xxf86vm_LIB)
      set(X11_xf86vmode_FOUND TRUE)
      set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86vmode_INCLUDE_PATH})
-  endif (X11_xf86vmode_INCLUDE_PATH AND X11_Xxf86vm_LIB)
+  endif ()
 
   if (X11_Xcursor_INCLUDE_PATH AND X11_Xcursor_LIB)
      set(X11_Xcursor_FOUND TRUE)
      set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xcursor_INCLUDE_PATH})
-  endif (X11_Xcursor_INCLUDE_PATH AND X11_Xcursor_LIB)
+  endif ()
 
   if (X11_Xscreensaver_INCLUDE_PATH AND X11_Xscreensaver_LIB)
      set(X11_Xscreensaver_FOUND TRUE)
      set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xscreensaver_INCLUDE_PATH})
-  endif (X11_Xscreensaver_INCLUDE_PATH AND X11_Xscreensaver_LIB)
+  endif ()
 
   if (X11_dpms_INCLUDE_PATH)
      set(X11_dpms_FOUND TRUE)
      set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_dpms_INCLUDE_PATH})
-  endif (X11_dpms_INCLUDE_PATH)
+  endif ()
 
   if (X11_Xkb_INCLUDE_PATH AND X11_Xkblib_INCLUDE_PATH AND X11_Xlib_INCLUDE_PATH)
      set(X11_Xkb_FOUND TRUE)
      set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkb_INCLUDE_PATH} )
-  endif (X11_Xkb_INCLUDE_PATH AND X11_Xkblib_INCLUDE_PATH AND X11_Xlib_INCLUDE_PATH)
+  endif ()
 
   if (X11_Xkbfile_INCLUDE_PATH AND X11_Xkbfile_LIB AND X11_Xlib_INCLUDE_PATH)
      set(X11_Xkbfile_FOUND TRUE)
      set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkbfile_INCLUDE_PATH} )
-  endif (X11_Xkbfile_INCLUDE_PATH AND X11_Xkbfile_LIB AND X11_Xlib_INCLUDE_PATH)
+  endif ()
 
   if (X11_Xmu_INCLUDE_PATH AND X11_Xmu_LIB)
      set(X11_Xmu_FOUND TRUE)
      set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xmu_INCLUDE_PATH})
-  endif (X11_Xmu_INCLUDE_PATH AND X11_Xmu_LIB)
+  endif ()
 
   if (X11_Xinput_INCLUDE_PATH AND X11_Xinput_LIB)
      set(X11_Xinput_FOUND TRUE)
      set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinput_INCLUDE_PATH})
-  endif (X11_Xinput_INCLUDE_PATH AND X11_Xinput_LIB)
+  endif ()
 
   if (X11_XSync_INCLUDE_PATH)
      set(X11_XSync_FOUND TRUE)
      set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XSync_INCLUDE_PATH})
-  endif (X11_XSync_INCLUDE_PATH)
+  endif ()
 
   if(X11_ICE_LIB AND X11_ICE_INCLUDE_PATH)
      set(X11_ICE_FOUND TRUE)
-  endif(X11_ICE_LIB AND X11_ICE_INCLUDE_PATH)
+  endif()
 
   if(X11_SM_LIB AND X11_SM_INCLUDE_PATH)
      set(X11_SM_FOUND TRUE)
-  endif(X11_SM_LIB AND X11_SM_INCLUDE_PATH)
+  endif()
 
 
   # Deprecated variable for backwards compatibility with CMake 1.4
   if (X11_X11_INCLUDE_PATH AND X11_LIBRARIES)
     set(X11_FOUND 1)
-  endif (X11_X11_INCLUDE_PATH AND X11_LIBRARIES)
+  endif ()
 
   if(X11_FOUND)
     include(CheckFunctionExists)
@@ -338,7 +338,7 @@ if (UNIX)
     # See libs.m4 in autoconf's m4 directory.
     if($ENV{ISC} MATCHES "^yes$")
       set(X11_X_EXTRA_LIBS -lnsl_s -linet)
-    else($ENV{ISC} MATCHES "^yes$")
+    else()
       set(X11_X_EXTRA_LIBS "")
 
       # See if XOpenDisplay in X11 works by itself.
@@ -348,13 +348,13 @@ if (UNIX)
         CHECK_LIBRARY_EXISTS("dnet" "dnet_ntoa" "" X11_LIB_DNET_HAS_DNET_NTOA)
         if (X11_LIB_DNET_HAS_DNET_NTOA)
           set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet)
-        else (X11_LIB_DNET_HAS_DNET_NTOA)
+        else ()
           CHECK_LIBRARY_EXISTS("dnet_stub" "dnet_ntoa" "" X11_LIB_DNET_STUB_HAS_DNET_NTOA)
           if (X11_LIB_DNET_STUB_HAS_DNET_NTOA)
             set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet_stub)
-          endif (X11_LIB_DNET_STUB_HAS_DNET_NTOA)
-        endif (X11_LIB_DNET_HAS_DNET_NTOA)
-      endif(NOT X11_LIB_X11_SOLO)
+          endif ()
+        endif ()
+      endif()
 
       # Find library needed for gethostbyname.
       CHECK_FUNCTION_EXISTS("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME)
@@ -362,13 +362,13 @@ if (UNIX)
         CHECK_LIBRARY_EXISTS("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
         if (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
           set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl)
-        else (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
+        else ()
           CHECK_LIBRARY_EXISTS("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
           if (CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
             set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd)
-          endif (CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
-        endif (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
-      endif(NOT CMAKE_HAVE_GETHOSTBYNAME)
+          endif ()
+        endif ()
+      endif()
 
       # Find library needed for connect.
       CHECK_FUNCTION_EXISTS("connect" CMAKE_HAVE_CONNECT)
@@ -376,8 +376,8 @@ if (UNIX)
         CHECK_LIBRARY_EXISTS("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT)
         if (CMAKE_LIB_SOCKET_HAS_CONNECT)
           set (X11_X_EXTRA_LIBS -lsocket ${X11_X_EXTRA_LIBS})
-        endif (CMAKE_LIB_SOCKET_HAS_CONNECT)
-      endif(NOT CMAKE_HAVE_CONNECT)
+        endif ()
+      endif()
 
       # Find library needed for remove.
       CHECK_FUNCTION_EXISTS("remove" CMAKE_HAVE_REMOVE)
@@ -385,8 +385,8 @@ if (UNIX)
         CHECK_LIBRARY_EXISTS("posix" "remove" "" CMAKE_LIB_POSIX_HAS_REMOVE)
         if (CMAKE_LIB_POSIX_HAS_REMOVE)
           set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lposix)
-        endif (CMAKE_LIB_POSIX_HAS_REMOVE)
-      endif(NOT CMAKE_HAVE_REMOVE)
+        endif ()
+      endif()
 
       # Find library needed for shmat.
       CHECK_FUNCTION_EXISTS("shmat" CMAKE_HAVE_SHMAT)
@@ -394,9 +394,9 @@ if (UNIX)
         CHECK_LIBRARY_EXISTS("ipc" "shmat" "" CMAKE_LIB_IPS_HAS_SHMAT)
         if (CMAKE_LIB_IPS_HAS_SHMAT)
           set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lipc)
-        endif (CMAKE_LIB_IPS_HAS_SHMAT)
-      endif(NOT CMAKE_HAVE_SHMAT)
-    endif($ENV{ISC} MATCHES "^yes$")
+        endif ()
+      endif()
+    endif()
 
     if (X11_ICE_FOUND)
       CHECK_LIBRARY_EXISTS("ICE" "IceConnectionNumber" "${X11_LIBRARY_DIR}"
@@ -405,9 +405,9 @@ if (UNIX)
         set (X11_X_PRE_LIBS ${X11_ICE_LIB})
         if(X11_SM_LIB)
           set (X11_X_PRE_LIBS ${X11_SM_LIB} ${X11_X_PRE_LIBS})
-        endif(X11_SM_LIB)
-      endif(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
-    endif (X11_ICE_FOUND)
+        endif()
+      endif()
+    endif ()
 
     # Build the final list of libraries.
     set(X11_LIBRARIES ${X11_X_PRE_LIBS} ${X11_LIBRARIES} ${X11_X_EXTRA_LIBS})
@@ -415,11 +415,11 @@ if (UNIX)
     include(FindPackageMessage)
     FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
       "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
-  else (X11_FOUND)
+  else ()
     if (X11_FIND_REQUIRED)
       message(FATAL_ERROR "Could not find X11")
-    endif (X11_FIND_REQUIRED)
-  endif (X11_FOUND)
+    endif ()
+  endif ()
 
   mark_as_advanced(
     X11_X11_INCLUDE_PATH
@@ -487,6 +487,6 @@ if (UNIX)
     X11_XSync_INCLUDE_PATH
   )
   set(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_SAVE})
-endif (UNIX)
+endif ()
 
 # X11_FIND_REQUIRED_<component> could be checked too
diff --git a/Modules/FindXMLRPC.cmake b/Modules/FindXMLRPC.cmake
index 0fae1d718..6bb578b46 100644
--- a/Modules/FindXMLRPC.cmake
+++ b/Modules/FindXMLRPC.cmake
@@ -31,9 +31,9 @@ find_program(XMLRPC_C_CONFIG NAMES xmlrpc-c-config)
 # Check whether we found anything.
 if(XMLRPC_C_CONFIG)
   set(XMLRPC_FOUND 1)
-else(XMLRPC_C_CONFIG)
+else()
   set(XMLRPC_FOUND 0)
-endif(XMLRPC_C_CONFIG)
+endif()
 
 # Lookup the include directories needed for the components requested.
 if(XMLRPC_FOUND)
@@ -45,12 +45,12 @@ if(XMLRPC_FOUND)
       OUTPUT_STRIP_TRAILING_WHITESPACE
       RESULT_VARIABLE XMLRPC_C_CONFIG_RESULT
       )
-  else(COMMAND EXECUTE_PROCESS)
+  else()
     exec_program(${XMLRPC_C_CONFIG} ARGS "${XMLRPC_FIND_COMPONENTS} --cflags"
       OUTPUT_VARIABLE XMLRPC_C_CONFIG_CFLAGS
       RETURN_VALUE XMLRPC_C_CONFIG_RESULT
       )
-  endif(COMMAND EXECUTE_PROCESS)
+  endif()
 
   # Parse the include flags.
   if("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
@@ -65,13 +65,13 @@ if(XMLRPC_FOUND)
         string(REGEX REPLACE "^-I" "" DIR "${flag}")
         file(TO_CMAKE_PATH "${DIR}" DIR)
         set(XMLRPC_INCLUDE_DIRS ${XMLRPC_INCLUDE_DIRS} "${DIR}")
-      endif("${flag}" MATCHES "^-I")
-    endforeach(flag)
-  else("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
+      endif()
+    endforeach()
+  else()
     message("Error running ${XMLRPC_C_CONFIG}: [${XMLRPC_C_CONFIG_RESULT}]")
     set(XMLRPC_FOUND 0)
-  endif("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
-endif(XMLRPC_FOUND)
+  endif()
+endif()
 
 # Lookup the libraries needed for the components requested.
 if(XMLRPC_FOUND)
@@ -83,12 +83,12 @@ if(XMLRPC_FOUND)
       OUTPUT_STRIP_TRAILING_WHITESPACE
       RESULT_VARIABLE XMLRPC_C_CONFIG_RESULT
       )
-  else(COMMAND EXECUTE_PROCESS)
+  else()
     exec_program(${XMLRPC_C_CONFIG} ARGS "${XMLRPC_FIND_COMPONENTS} --libs"
       OUTPUT_VARIABLE XMLRPC_C_CONFIG_LIBS
       RETURN_VALUE XMLRPC_C_CONFIG_RESULT
       )
-  endif(COMMAND EXECUTE_PROCESS)
+  endif()
 
   # Parse the library names and directories.
   if("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
@@ -106,8 +106,8 @@ if(XMLRPC_FOUND)
       elseif("${flag}" MATCHES "^-l")
         string(REGEX REPLACE "^-l" "" NAME "${flag}")
         set(XMLRPC_LIBRARY_NAMES ${XMLRPC_LIBRARY_NAMES} "${NAME}")
-      endif("${flag}" MATCHES "^-L")
-    endforeach(flag)
+      endif()
+    endforeach()
 
     # Search for each library needed using the directories given.
     foreach(name ${XMLRPC_LIBRARY_NAMES})
@@ -121,16 +121,16 @@ if(XMLRPC_FOUND)
       # If any library is not found then the whole package is not found.
       if(NOT XMLRPC_${name}_LIBRARY)
         set(XMLRPC_FOUND 0)
-      endif(NOT XMLRPC_${name}_LIBRARY)
+      endif()
 
       # Build an ordered list of all the libraries needed.
       set(XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES} "${XMLRPC_${name}_LIBRARY}")
-    endforeach(name)
-  else("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
+    endforeach()
+  else()
     message("Error running ${XMLRPC_C_CONFIG}: [${XMLRPC_C_CONFIG_RESULT}]")
     set(XMLRPC_FOUND 0)
-  endif("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
-endif(XMLRPC_FOUND)
+  endif()
+endif()
 
 # Report the results.
 if(NOT XMLRPC_FOUND)
@@ -138,9 +138,9 @@ if(NOT XMLRPC_FOUND)
     "XMLRPC was not found. Make sure the entries XMLRPC_* are set.")
   if(NOT XMLRPC_FIND_QUIETLY)
     message(STATUS "${XMLRPC_DIR_MESSAGE}")
-  else(NOT XMLRPC_FIND_QUIETLY)
+  else()
     if(XMLRPC_FIND_REQUIRED)
       message(FATAL_ERROR "${XMLRPC_DIR_MESSAGE}")
-    endif(XMLRPC_FIND_REQUIRED)
-  endif(NOT XMLRPC_FIND_QUIETLY)
-endif(NOT XMLRPC_FOUND)
+    endif()
+  endif()
+endif()
diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake
index 6b3c4cf94..00b9c64da 100644
--- a/Modules/FindZLIB.cmake
+++ b/Modules/FindZLIB.cmake
@@ -72,7 +72,7 @@ if(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
     if( "${ZLIB_H}" MATCHES "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$")
         set(ZLIB_VERSION_TWEAK "${CMAKE_MATCH_1}")
         set(ZLIB_VERSION_STRING "${ZLIB_VERSION_STRING}.${ZLIB_VERSION_TWEAK}")
-    endif( "${ZLIB_H}" MATCHES "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$")
+    endif()
 
     set(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}")
     set(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}")
diff --git a/Modules/Findosg_functions.cmake b/Modules/Findosg_functions.cmake
index 3a40a0997..30c08761c 100644
--- a/Modules/Findosg_functions.cmake
+++ b/Modules/Findosg_functions.cmake
@@ -38,7 +38,7 @@ function(OSG_FIND_PATH module header)
             /opt
             /usr/freeware
    )
-endfunction(OSG_FIND_PATH module header)
+endfunction()
 
 
 #
@@ -91,7 +91,7 @@ function(OSG_FIND_LIBRARY module library)
           PARENT_SCOPE
       )
    endif()
-endfunction(OSG_FIND_LIBRARY module library)
+endfunction()
 
 #
 # OSG_MARK_AS_ADVANCED
diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake
index b1a17a89a..c186eb59e 100644
--- a/Modules/FindwxWidgets.cmake
+++ b/Modules/FindwxWidgets.cmake
@@ -67,7 +67,7 @@
 #     include(${wxWidgets_USE_FILE})
 #     # and for each of your dependent executable/library targets:
 #     target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
-#   endif(wxWidgets_FOUND)
+#   endif()
 #
 # If wxWidgets is required (i.e., not an optional part):
 #   find_package(wxWidgets REQUIRED net gl core base)
@@ -146,11 +146,11 @@
 macro(DBG_MSG _MSG)
 #  message(STATUS
 #    "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}")
-endmacro(DBG_MSG)
+endmacro()
 macro(DBG_MSG_V _MSG)
 #  message(STATUS
 #    "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}")
-endmacro(DBG_MSG_V)
+endmacro()
 
 # Clear return values in case the module is loaded more than once.
 set(wxWidgets_FOUND FALSE)
@@ -179,7 +179,7 @@ endif()
 # - else set wxWidgets_FIND_COMPONENTS to wxWidgets_USE_LIBS
 if(wxWidgets_USE_LIBS AND NOT wxWidgets_FIND_COMPONENTS)
   set(wxWidgets_FIND_COMPONENTS ${wxWidgets_USE_LIBS})
-endif(wxWidgets_USE_LIBS AND NOT wxWidgets_FIND_COMPONENTS)
+endif()
 DBG_MSG("wxWidgets_FIND_COMPONENTS : ${wxWidgets_FIND_COMPONENTS}")
 
 # Add the convenience use file if available.
@@ -195,19 +195,19 @@ get_filename_component(
 if(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
   set(wxWidgets_USE_FILE
     "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
-else(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
+else()
   set(wxWidgets_USE_FILE UsewxWidgets)
-endif(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
+endif()
 
 #=====================================================================
 #=====================================================================
 if(WIN32 AND NOT CYGWIN AND NOT MSYS)
   set(wxWidgets_FIND_STYLE "win32")
-else(WIN32 AND NOT CYGWIN AND NOT MSYS)
+else()
   if(UNIX OR MSYS)
     set(wxWidgets_FIND_STYLE "unix")
-  endif(UNIX OR MSYS)
-endif(WIN32 AND NOT CYGWIN AND NOT MSYS)
+  endif()
+endif()
 
 #=====================================================================
 # WIN32_FIND_STYLE
@@ -220,17 +220,17 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
   if(NOT wxWidgets_FIND_COMPONENTS)
     if(wxWidgets_USE_MONOLITHIC)
       set(wxWidgets_FIND_COMPONENTS mono)
-    else(wxWidgets_USE_MONOLITHIC)
+    else()
       set(wxWidgets_FIND_COMPONENTS core base) # this is default
-    endif(wxWidgets_USE_MONOLITHIC)
-  endif(NOT wxWidgets_FIND_COMPONENTS)
+    endif()
+  endif()
 
   # Add the common (usually required libs) unless
   # wxWidgets_EXCLUDE_COMMON_LIBRARIES has been set.
   if(NOT wxWidgets_EXCLUDE_COMMON_LIBRARIES)
     list(APPEND wxWidgets_FIND_COMPONENTS
       ${wxWidgets_COMMON_LIBRARIES})
-  endif(NOT wxWidgets_EXCLUDE_COMMON_LIBRARIES)
+  endif()
 
   #-------------------------------------------------------------------
   # WIN32: Helper MACROS
@@ -245,9 +245,9 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
     string(REGEX REPLACE "msw.*(u)[d]*$" "u" ${_UCD} "${_CONFIGURATION}")
     if(${_UCD} STREQUAL ${_CONFIGURATION})
       set(${_UCD} "")
-    endif(${_UCD} STREQUAL ${_CONFIGURATION})
+    endif()
     string(REGEX MATCH "d$" ${_DBG} "${_CONFIGURATION}")
-  endmacro(WX_GET_NAME_COMPONENTS)
+  endmacro()
 
   #
   # Find libraries associated to a configuration.
@@ -269,7 +269,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
         NO_DEFAULT_PATH
         )
       mark_as_advanced(WX_${LIB}${_DBG})
-    endforeach(LIB)
+    endforeach()
 
     # Find wxWidgets multilib base libraries.
     find_library(WX_base${_DBG}
@@ -295,7 +295,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
         NO_DEFAULT_PATH
         )
       mark_as_advanced(WX_${LIB}${_DBG})
-    endforeach(LIB)
+    endforeach()
 
     # Find wxWidgets monolithic library.
     find_library(WX_mono${_DBG}
@@ -324,8 +324,8 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
         NO_DEFAULT_PATH
         )
       mark_as_advanced(WX_${LIB}${_DBG})
-    endforeach(LIB)
-  endmacro(WX_FIND_LIBS)
+    endforeach()
+  endmacro()
 
   #
   # Clear all library paths, so that FIND_LIBRARY refinds them.
@@ -335,19 +335,19 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
     set(${_LIB} "${_LIB}-NOTFOUND" CACHE FILEPATH "Cleared." FORCE)
     set(${_LIB}_FOUND FALSE)
     mark_as_advanced(${_LIB})
-  endmacro(WX_CLEAR_LIB)
+  endmacro()
   # Clear all debug or release library paths (arguments are "d" or "").
   macro(WX_CLEAR_ALL_LIBS _DBG)
     # Clear wxWidgets common libraries.
     foreach(LIB ${wxWidgets_COMMON_LIBRARIES} scintilla)
       WX_CLEAR_LIB(WX_${LIB}${_DBG})
-    endforeach(LIB)
+    endforeach()
 
     # Clear wxWidgets multilib base libraries.
     WX_CLEAR_LIB(WX_base${_DBG})
     foreach(LIB net odbc xml)
       WX_CLEAR_LIB(WX_${LIB}${_DBG})
-    endforeach(LIB)
+    endforeach()
 
     # Clear wxWidgets monolithic library.
     WX_CLEAR_LIB(WX_mono${_DBG})
@@ -356,16 +356,16 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
     foreach(LIB core adv aui html media xrc dbgrid gl qa richtext
                 stc ribbon propgrid)
       WX_CLEAR_LIB(WX_${LIB}${_DBG})
-    endforeach(LIB)
-  endmacro(WX_CLEAR_ALL_LIBS)
+    endforeach()
+  endmacro()
   # Clear all wxWidgets debug libraries.
   macro(WX_CLEAR_ALL_DBG_LIBS)
     WX_CLEAR_ALL_LIBS("d")
-  endmacro(WX_CLEAR_ALL_DBG_LIBS)
+  endmacro()
   # Clear all wxWidgets release libraries.
   macro(WX_CLEAR_ALL_REL_LIBS)
     WX_CLEAR_ALL_LIBS("")
-  endmacro(WX_CLEAR_ALL_REL_LIBS)
+  endmacro()
 
   #
   # Set the wxWidgets_LIBRARIES variable.
@@ -383,35 +383,35 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
           list(APPEND wxWidgets_LIBRARIES
             debug ${WX_${LIB}d} optimized ${WX_${LIB}}
             )
-        else(WX_${LIB} AND WX_${LIB}d)
+        else()
           DBG_MSG_V("- not found due to missing WX_${LIB}=${WX_${LIB}} or WX_${LIB}d=${WX_${LIB}d}")
           set(wxWidgets_FOUND FALSE)
-        endif(WX_${LIB} AND WX_${LIB}d)
-      endforeach(LIB)
-    else(WX_USE_REL_AND_DBG)
+        endif()
+      endforeach()
+    else()
       foreach(LIB ${${_LIBS}})
         DBG_MSG_V("Searching for ${LIB}${_DBG}")
         DBG_MSG_V("WX_${LIB}${_DBG} : ${WX_${LIB}${_DBG}}")
         if(WX_${LIB}${_DBG})
           DBG_MSG_V("Found ${LIB}${_DBG}")
           list(APPEND wxWidgets_LIBRARIES ${WX_${LIB}${_DBG}})
-        else(WX_${LIB}${_DBG})
+        else()
           DBG_MSG_V(
             "- not found due to missing WX_${LIB}${_DBG}=${WX_${LIB}${_DBG}}")
           set(wxWidgets_FOUND FALSE)
-        endif(WX_${LIB}${_DBG})
-      endforeach(LIB)
-    endif(WX_USE_REL_AND_DBG)
+        endif()
+      endforeach()
+    endif()
 
     DBG_MSG_V("OpenGL")
     list(FIND ${_LIBS} gl WX_USE_GL)
     if(NOT WX_USE_GL EQUAL -1)
       DBG_MSG_V("- is required.")
       list(APPEND wxWidgets_LIBRARIES opengl32 glu32)
-    endif(NOT WX_USE_GL EQUAL -1)
+    endif()
 
     list(APPEND wxWidgets_LIBRARIES winmm comctl32 rpcrt4 wsock32)
-  endmacro(WX_SET_LIBRARIES)
+  endmacro()
 
   #-------------------------------------------------------------------
   # WIN32: Start actual work.
@@ -467,7 +467,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
         CACHE INTERNAL "wxWidgets_ROOT_DIR")
     set(wxWidgets_LIB_DIR "wxWidgets_LIB_DIR-NOTFOUND"
         CACHE PATH "Cleared." FORCE)
-  endif(NOT WX_ROOT_DIR STREQUAL wxWidgets_ROOT_DIR)
+  endif()
 
   if(WX_ROOT_DIR)
     # Select one default tree inside the already determined wx tree.
@@ -475,9 +475,9 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
     # settings.
     if(MINGW)
       set(WX_LIB_DIR_PREFIX gcc)
-    else(MINGW)
+    else()
       set(WX_LIB_DIR_PREFIX vc)
-    endif(MINGW)
+    endif()
     if(BUILD_SHARED_LIBS)
       find_path(wxWidgets_LIB_DIR
         NAMES
@@ -495,7 +495,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
         DOC "Path to wxWidgets libraries?"
         NO_DEFAULT_PATH
         )
-    else(BUILD_SHARED_LIBS)
+    else()
       find_path(wxWidgets_LIB_DIR
         NAMES
           msw/wx/setup.h
@@ -512,21 +512,21 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
         DOC "Path to wxWidgets libraries?"
         NO_DEFAULT_PATH
         )
-    endif(BUILD_SHARED_LIBS)
+    endif()
 
     # If wxWidgets_LIB_DIR changed, clear all libraries.
     if(NOT WX_LIB_DIR STREQUAL wxWidgets_LIB_DIR)
       set(WX_LIB_DIR ${wxWidgets_LIB_DIR} CACHE INTERNAL "wxWidgets_LIB_DIR")
       WX_CLEAR_ALL_DBG_LIBS()
       WX_CLEAR_ALL_REL_LIBS()
-    endif(NOT WX_LIB_DIR STREQUAL wxWidgets_LIB_DIR)
+    endif()
 
     if(WX_LIB_DIR)
       # If building shared libs, define WXUSINGDLL to use dllimport.
       if(WX_LIB_DIR MATCHES ".*[dD][lL][lL].*")
         set(wxWidgets_DEFINITIONS WXUSINGDLL)
         DBG_MSG_V("detected SHARED/DLL tree WX_LIB_DIR=${WX_LIB_DIR}")
-      endif(WX_LIB_DIR MATCHES ".*[dD][lL][lL].*")
+      endif()
 
       # Search for available configuration types.
       foreach(CFG mswunivud mswunivd mswud mswd mswunivu mswuniv mswu msw)
@@ -535,8 +535,8 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
           list(APPEND WX_CONFIGURATION_LIST ${CFG})
           set(WX_${CFG}_FOUND TRUE)
           set(WX_CONFIGURATION ${CFG})
-        endif(EXISTS ${WX_LIB_DIR}/${CFG})
-      endforeach(CFG)
+        endif()
+      endforeach()
       DBG_MSG_V("WX_CONFIGURATION_LIST=${WX_CONFIGURATION_LIST}")
 
       if(WX_CONFIGURATION)
@@ -549,24 +549,24 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
         if(NOT WX_${wxWidgets_CONFIGURATION}_FOUND)
           set(wxWidgets_CONFIGURATION ${WX_CONFIGURATION} CACHE STRING
             "Set wxWidgets configuration (${WX_CONFIGURATION_LIST})" FORCE)
-        else(NOT WX_${wxWidgets_CONFIGURATION}_FOUND)
+        else()
           set(wxWidgets_CONFIGURATION ${wxWidgets_CONFIGURATION} CACHE STRING
             "Set wxWidgets configuration (${WX_CONFIGURATION_LIST})" FORCE)
-        endif(NOT WX_${wxWidgets_CONFIGURATION}_FOUND)
+        endif()
 
         # If release config selected, and both release/debug exist.
         if(WX_${wxWidgets_CONFIGURATION}d_FOUND)
           option(wxWidgets_USE_REL_AND_DBG
             "Use release and debug configurations?" TRUE)
           set(WX_USE_REL_AND_DBG ${wxWidgets_USE_REL_AND_DBG})
-        else(WX_${wxWidgets_CONFIGURATION}d_FOUND)
+        else()
           # If the option exists (already in cache), force it false.
           if(wxWidgets_USE_REL_AND_DBG)
             set(wxWidgets_USE_REL_AND_DBG FALSE CACHE BOOL
               "No ${wxWidgets_CONFIGURATION}d found." FORCE)
-          endif(wxWidgets_USE_REL_AND_DBG)
+          endif()
           set(WX_USE_REL_AND_DBG FALSE)
-        endif(WX_${wxWidgets_CONFIGURATION}d_FOUND)
+        endif()
 
         # Get configuration parameters from the name.
         WX_GET_NAME_COMPONENTS(${wxWidgets_CONFIGURATION} UNV UCD DBG)
@@ -575,24 +575,24 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
         if(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h)
           set(wxWidgets_INCLUDE_DIRS
             ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION})
-        else(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h)
+        else()
           DBG_MSG("wxWidgets_FOUND FALSE because ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h does not exists.")
           set(wxWidgets_FOUND FALSE)
-        endif(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h)
+        endif()
 
         # Set wxWidgets main include directory.
         if(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h)
           list(APPEND wxWidgets_INCLUDE_DIRS ${WX_ROOT_DIR}/include)
-        else(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h)
+        else()
           DBG_MSG("wxWidgets_FOUND FALSE because WX_ROOT_DIR=${WX_ROOT_DIR} has no ${WX_ROOT_DIR}/include/wx/wx.h")
           set(wxWidgets_FOUND FALSE)
-        endif(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h)
+        endif()
 
         # Find wxWidgets libraries.
         WX_FIND_LIBS("${UNV}" "${UCD}" "${DBG}")
         if(WX_USE_REL_AND_DBG)
           WX_FIND_LIBS("${UNV}" "${UCD}" "d")
-        endif(WX_USE_REL_AND_DBG)
+        endif()
 
         # Settings for requested libs (i.e., include dir, libraries, etc.).
         WX_SET_LIBRARIES(wxWidgets_FIND_COMPONENTS "${DBG}")
@@ -600,19 +600,19 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
         # Add necessary definitions for unicode builds
         if("${UCD}" STREQUAL "u")
           list(APPEND wxWidgets_DEFINITIONS UNICODE _UNICODE)
-        endif("${UCD}" STREQUAL "u")
+        endif()
 
         # Add necessary definitions for debug builds
         set(wxWidgets_DEFINITIONS_DEBUG _DEBUG __WXDEBUG__)
 
-      endif(WX_CONFIGURATION)
-    endif(WX_LIB_DIR)
-  endif(WX_ROOT_DIR)
+      endif()
+    endif()
+  endif()
 
 #=====================================================================
 # UNIX_FIND_STYLE
 #=====================================================================
-else(wxWidgets_FIND_STYLE STREQUAL "win32")
+else()
   if(wxWidgets_FIND_STYLE STREQUAL "unix")
     #-----------------------------------------------------------------
     # UNIX: Helper MACROS
@@ -633,16 +633,16 @@ else(wxWidgets_FIND_STYLE STREQUAL "win32")
           string(TOUPPER ${_opt_name} _upper_opt_name)
           if(_wx_selected_config MATCHES ".*${_opt_name}.*")
             set(wxWidgets_DEFAULT_${_upper_opt_name} ON)
-          else(_wx_selected_config MATCHES ".*${_opt_name}.*")
+          else()
             set(wxWidgets_DEFAULT_${_upper_opt_name} OFF)
-          endif(_wx_selected_config MATCHES ".*${_opt_name}.*")
-        endforeach(_opt_name)
-      else(_wx_result EQUAL 0)
+          endif()
+        endforeach()
+      else()
         foreach(_upper_opt_name DEBUG STATIC UNICODE UNIVERSAL)
           set(wxWidgets_DEFAULT_${_upper_opt_name} OFF)
-        endforeach(_upper_opt_name)
-      endif(_wx_result EQUAL 0)
-    endmacro(WX_CONFIG_SELECT_GET_DEFAULT)
+        endforeach()
+      endif()
+    endmacro()
 
     #
     # Query a boolean configuration option to determine if the system
@@ -668,17 +668,17 @@ else(wxWidgets_FIND_STYLE STREQUAL "win32")
       if(_wx_result_yes EQUAL 0 AND _wx_result_no EQUAL 0)
         option(wxWidgets_USE_${_UPPER_OPT_NAME}
           ${_OPT_HELP} ${wxWidgets_DEFAULT_${_UPPER_OPT_NAME}})
-      else(_wx_result_yes EQUAL 0 AND _wx_result_no EQUAL 0)
+      else()
         # If option exists (already in cache), force to available one.
         if(DEFINED wxWidgets_USE_${_UPPER_OPT_NAME})
           if(_wx_result_yes EQUAL 0)
             set(wxWidgets_USE_${_UPPER_OPT_NAME} ON  CACHE BOOL ${_OPT_HELP} FORCE)
-          else(_wx_result_yes EQUAL 0)
+          else()
             set(wxWidgets_USE_${_UPPER_OPT_NAME} OFF CACHE BOOL ${_OPT_HELP} FORCE)
-          endif(_wx_result_yes EQUAL 0)
-        endif(DEFINED wxWidgets_USE_${_UPPER_OPT_NAME})
-      endif(_wx_result_yes EQUAL 0 AND _wx_result_no EQUAL 0)
-    endmacro(WX_CONFIG_SELECT_QUERY_BOOL)
+          endif()
+        endif()
+      endif()
+    endmacro()
 
     #
     # Set wxWidgets_SELECT_OPTIONS to wx-config options for selecting
@@ -691,12 +691,12 @@ else(wxWidgets_FIND_STYLE STREQUAL "win32")
         if(DEFINED wxWidgets_USE_${_upper_opt_name})
           if(wxWidgets_USE_${_upper_opt_name})
             list(APPEND wxWidgets_SELECT_OPTIONS --${_opt_name}=yes)
-          else(wxWidgets_USE_${_upper_opt_name})
+          else()
             list(APPEND wxWidgets_SELECT_OPTIONS --${_opt_name}=no)
-          endif(wxWidgets_USE_${_upper_opt_name})
-        endif(DEFINED wxWidgets_USE_${_upper_opt_name})
-      endforeach(_opt_name)
-    endmacro(WX_CONFIG_SELECT_SET_OPTIONS)
+          endif()
+        endif()
+      endforeach()
+    endmacro()
 
     #-----------------------------------------------------------------
     # UNIX: Start actual work.
@@ -759,11 +759,11 @@ else(wxWidgets_FIND_STYLE STREQUAL "win32")
         DBG_MSG_V("wxWidgets_INCLUDE_DIRS=${wxWidgets_INCLUDE_DIRS}")
         DBG_MSG_V("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}")
 
-      else(RET EQUAL 0)
+      else()
         set(wxWidgets_FOUND FALSE)
         DBG_MSG_V(
           "${wxWidgets_CONFIG_EXECUTABLE} --cxxflags FAILED with RET=${RET}")
-      endif(RET EQUAL 0)
+      endif()
 
       # run the wx-config program to get the libs
       # - NOTE: wx-config doesn't verify that the libs requested exist
@@ -797,25 +797,25 @@ else(wxWidgets_FIND_STYLE STREQUAL "win32")
         DBG_MSG_V("wxWidgets_LIBRARIES=${wxWidgets_LIBRARIES}")
         DBG_MSG_V("wxWidgets_LIBRARY_DIRS=${wxWidgets_LIBRARY_DIRS}")
 
-      else(RET EQUAL 0)
+      else()
         set(wxWidgets_FOUND FALSE)
         DBG_MSG("${wxWidgets_CONFIG_EXECUTABLE} --libs ${wxWidgets_FIND_COMPONENTS} FAILED with RET=${RET}")
-      endif(RET EQUAL 0)
-    endif(wxWidgets_CONFIG_EXECUTABLE)
+      endif()
+    endif()
 
 #=====================================================================
 # Neither UNIX_FIND_STYLE, nor WIN32_FIND_STYLE
 #=====================================================================
-  else(wxWidgets_FIND_STYLE STREQUAL "unix")
+  else()
     if(NOT wxWidgets_FIND_QUIETLY)
       message(STATUS
         "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): \n"
         "  Platform unknown/unsupported. It's neither WIN32 nor UNIX "
         "find style."
         )
-    endif(NOT wxWidgets_FIND_QUIETLY)
-  endif(wxWidgets_FIND_STYLE STREQUAL "unix")
-endif(wxWidgets_FIND_STYLE STREQUAL "win32")
+    endif()
+  endif()
+endif()
 
 # Debug output:
 DBG_MSG("wxWidgets_FOUND           : ${wxWidgets_FOUND}")
@@ -855,7 +855,7 @@ find_program(wxWidgets_wxrc_EXECUTABLE wxrc
 #  function(WXWIDGETS_ADD_RESOURCES outfiles)
 #    WX_SPLIT_ARGUMENTS_ON(OPTIONS wxrc_files wxrc_options ${ARGN})
 #    ...
-#  endfunction(WXWIDGETS_ADD_RESOURCES)
+#  endfunction()
 #
 #  WXWIDGETS_ADD_RESOURCES(sources ${xrc_files} OPTIONS -e -o file.C)
 #
@@ -877,18 +877,18 @@ function(WX_SPLIT_ARGUMENTS_ON _keyword _leftvar _rightvar)
   foreach(element ${ARGN})
     if("${element}" STREQUAL "${_keyword}")
       set(_doing_right TRUE)
-    else("${element}" STREQUAL "${_keyword}")
+    else()
       if(_doing_right)
         list(APPEND ${_rightvar} "${element}")
-      else(_doing_right)
+      else()
         list(APPEND ${_leftvar} "${element}")
-      endif(_doing_right)
-    endif("${element}" STREQUAL "${_keyword}")
-  endforeach(element)
+      endif()
+    endif()
+  endforeach()
 
   set(${_leftvar}  ${${_leftvar}}  PARENT_SCOPE)
   set(${_rightvar} ${${_rightvar}} PARENT_SCOPE)
-endfunction(WX_SPLIT_ARGUMENTS_ON)
+endfunction()
 
 #
 # WX_GET_DEPENDENCIES_FROM_XML(
@@ -920,14 +920,14 @@ function(WX_GET_DEPENDENCIES_FROM_XML
     # make the file have an absolute path
     if(NOT IS_ABSOLUTE "${dep_file}")
       set(dep_file "${${_depends_path}}/${dep_file}")
-    endif(NOT IS_ABSOLUTE "${dep_file}")
+    endif()
 
     # append file to dependency list
     list(APPEND ${_depends} "${dep_file}")
-  endforeach(dep_file)
+  endforeach()
 
   set(${_depends} ${${_depends}} PARENT_SCOPE)
-endfunction(WX_GET_DEPENDENCIES_FROM_XML)
+endfunction()
 
 #
 # WXWIDGETS_ADD_RESOURCES(<sources> <xrc_files>
@@ -982,7 +982,7 @@ function(WXWIDGETS_ADD_RESOURCES _outfiles)
       rc_file_contents
       depends_path
       )
-  endforeach(rc_file)
+  endforeach()
 
   #
   # Parse options.
@@ -994,11 +994,11 @@ function(WXWIDGETS_ADD_RESOURCES _outfiles)
     list(APPEND rc_options --cpp-code)
     # wxrc's default output filename for cpp code.
     set(outfile resource.cpp)
-  else(index EQUAL -1)
+  else()
     list(REMOVE_AT rc_options ${index})
     # wxrc's default output filename for xrs file.
     set(outfile resource.xrs)
-  endif(index EQUAL -1)
+  endif()
 
   # Get output name for use in ADD_CUSTOM_COMMAND.
   # - short option scanning
@@ -1007,18 +1007,18 @@ function(WXWIDGETS_ADD_RESOURCES _outfiles)
     math(EXPR filename_index "${index} + 1")
     list(GET rc_options ${filename_index} outfile)
     #list(REMOVE_AT rc_options ${index} ${filename_index})
-  endif(NOT index EQUAL -1)
+  endif()
   # - long option scanning
   string(REGEX MATCH "--output=[^;]*" outfile_opt "${rc_options}")
   if(outfile_opt)
     string(REPLACE "--output=" "" outfile "${outfile_opt}")
-  endif(outfile_opt)
+  endif()
   #string(REGEX REPLACE "--output=[^;]*;?" "" rc_options "${rc_options}")
   #string(REGEX REPLACE ";$" "" rc_options "${rc_options}")
 
   if(NOT IS_ABSOLUTE "${outfile}")
     set(outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}")
-  endif(NOT IS_ABSOLUTE "${outfile}")
+  endif()
   add_custom_command(
     OUTPUT "${outfile}"
     COMMAND ${wxWidgets_wxrc_EXECUTABLE} ${rc_options} ${rc_file_list_abs}
@@ -1035,10 +1035,10 @@ function(WXWIDGETS_ADD_RESOURCES _outfiles)
     set_source_files_properties(
       "${outfile_header}" PROPERTIES GENERATED TRUE
       )
-  endif(NOT short_index EQUAL -1 OR NOT long_index EQUAL -1)
+  endif()
 
   # Add generated file to output file list.
   list(APPEND ${_outfiles} "${outfile}")
 
   set(${_outfiles} ${${_outfiles}} PARENT_SCOPE)
-endfunction(WXWIDGETS_ADD_RESOURCES)
+endfunction()
diff --git a/Modules/FindwxWindows.cmake b/Modules/FindwxWindows.cmake
index 66373cdcc..06db75102 100644
--- a/Modules/FindwxWindows.cmake
+++ b/Modules/FindwxWindows.cmake
@@ -85,14 +85,14 @@
 
 if(WIN32)
   set(WIN32_STYLE_FIND 1)
-endif(WIN32)
+endif()
 if(MINGW)
   set(WIN32_STYLE_FIND 0)
   set(UNIX_STYLE_FIND 1)
-endif(MINGW)
+endif()
 if(UNIX)
   set(UNIX_STYLE_FIND 1)
-endif(UNIX)
+endif()
 
 
 if(WIN32_STYLE_FIND)
@@ -283,7 +283,7 @@ if(WIN32_STYLE_FIND)
       DOC "wxWindows shared debug build GL library" )
 
 
-  else (WXWINDOWS_USE_MONOLITHIC)
+  else ()
     ## WX is built as multiple small pieces libraries instead of monolithic
 
     ## DEPECATED (jw) replaced by more general WXWINDOWS_USE_MONOLITHIC ON/OFF
@@ -346,7 +346,7 @@ if(WIN32_STYLE_FIND)
       rpcrt4
       wsock32
       )
-  endif (WXWINDOWS_USE_MONOLITHIC)
+  endif ()
 
 
   ##
@@ -361,7 +361,7 @@ if(WIN32_STYLE_FIND)
     option(WXWINDOWS_USE_SHARED_LIBS
       "Use shared versions (dll) of wxWindows libraries?" OFF)
     mark_as_advanced(WXWINDOWS_USE_SHARED_LIBS)
-  endif(WXWINDOWS_SHARED_LIBRARY OR WXWINDOWS_SHARED_DEBUG_LIBRARY)
+  endif()
 
   ## add system libraries wxwindows always seems to depend on
   set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
@@ -380,7 +380,7 @@ if(WIN32_STYLE_FIND)
       debug ${WXWINDOWS_STATIC_DEBUG_LIBRARY_JPEG}   optimized ${WXWINDOWS_STATIC_LIBRARY_JPEG}
       debug ${WXWINDOWS_STATIC_DEBUG_LIBRARY_TIFF}   optimized ${WXWINDOWS_STATIC_LIBRARY_TIFF}
       )
-  endif (NOT WXWINDOWS_USE_SHARED_LIBS)
+  endif ()
 
   ## opengl/glu: TODO/FIXME: better use FindOpenGL.cmake here
   ## assume release versions of glu an dopengl, here.
@@ -388,7 +388,7 @@ if(WIN32_STYLE_FIND)
     set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
       opengl32
       glu32 )
-  endif (WXWINDOWS_USE_GL)
+  endif ()
 
   ##
   ## select between use of  shared or static wxWindows lib then set libs to use
@@ -419,8 +419,8 @@ if(WIN32_STYLE_FIND)
         set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
           debug     ${WXWINDOWS_SHARED_DEBUG_LIBRARY_GL}
           optimized ${WXWINDOWS_SHARED_LIBRARY_GL} )
-      endif (WXWINDOWS_USE_GL)
-    endif(WXWINDOWS_SHARED_DEBUG_LIBRARY AND WXWINDOWS_SHARED_LIBRARY)
+      endif ()
+    endif()
 
     ## shared: only debug wx lib found?
     if(WXWINDOWS_SHARED_DEBUG_LIBRARY)
@@ -434,9 +434,9 @@ if(WIN32_STYLE_FIND)
         if (WXWINDOWS_USE_GL)
           set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
             ${WXWINDOWS_SHARED_DEBUG_LIBRARY_GL} )
-        endif (WXWINDOWS_USE_GL)
-      endif(NOT WXWINDOWS_SHARED_LIBRARY)
-    endif(WXWINDOWS_SHARED_DEBUG_LIBRARY)
+        endif ()
+      endif()
+    endif()
 
     ## shared: only release wx lib found?
     if(NOT WXWINDOWS_SHARED_DEBUG_LIBRARY)
@@ -450,20 +450,20 @@ if(WIN32_STYLE_FIND)
         if (WXWINDOWS_USE_GL)
           set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
             ${WXWINDOWS_SHARED_DEBUG_LIBRARY_GL} )
-        endif (WXWINDOWS_USE_GL)
-      endif(WXWINDOWS_SHARED_LIBRARY)
-    endif(NOT WXWINDOWS_SHARED_DEBUG_LIBRARY)
+        endif ()
+      endif()
+    endif()
 
     ## shared: none found?
     if(NOT WXWINDOWS_SHARED_DEBUG_LIBRARY)
       if(NOT WXWINDOWS_SHARED_LIBRARY)
         message(STATUS
           "No shared wxWindows lib found, but WXWINDOWS_USE_SHARED_LIBS=${WXWINDOWS_USE_SHARED_LIBS}.")
-      endif(NOT WXWINDOWS_SHARED_LIBRARY)
-    endif(NOT WXWINDOWS_SHARED_DEBUG_LIBRARY)
+      endif()
+    endif()
 
     #########################################################################################
-  else(WXWINDOWS_USE_SHARED_LIBS)
+  else()
 
     ##jw: DEPRECATED if(NOT WXWINDOWS_SEPARATE_LIBS_BUILD)
 
@@ -483,8 +483,8 @@ if(WIN32_STYLE_FIND)
         set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
           debug     ${WXWINDOWS_STATIC_DEBUG_LIBRARY_GL}
           optimized ${WXWINDOWS_STATIC_LIBRARY_GL} )
-      endif (WXWINDOWS_USE_GL)
-    endif(WXWINDOWS_STATIC_DEBUG_LIBRARY AND WXWINDOWS_STATIC_LIBRARY)
+      endif ()
+    endif()
 
     ## static: only debug wx lib found?
     if(WXWINDOWS_STATIC_DEBUG_LIBRARY)
@@ -498,9 +498,9 @@ if(WIN32_STYLE_FIND)
         if (WXWINDOWS_USE_GL)
           set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
             ${WXWINDOWS_STATIC_DEBUG_LIBRARY_GL} )
-        endif (WXWINDOWS_USE_GL)
-      endif(NOT WXWINDOWS_STATIC_LIBRARY)
-    endif(WXWINDOWS_STATIC_DEBUG_LIBRARY)
+        endif ()
+      endif()
+    endif()
 
     ## static: only release wx lib found?
     if(NOT WXWINDOWS_STATIC_DEBUG_LIBRARY)
@@ -514,18 +514,18 @@ if(WIN32_STYLE_FIND)
         if (WXWINDOWS_USE_GL)
           set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES}
             ${WXWINDOWS_STATIC_LIBRARY_GL} )
-        endif (WXWINDOWS_USE_GL)
-      endif(WXWINDOWS_STATIC_LIBRARY)
-    endif(NOT WXWINDOWS_STATIC_DEBUG_LIBRARY)
+        endif ()
+      endif()
+    endif()
 
     ## static: none found?
     if(NOT WXWINDOWS_STATIC_DEBUG_LIBRARY AND NOT WXWINDOWS_SEPARATE_LIBS_BUILD)
       if(NOT WXWINDOWS_STATIC_LIBRARY)
         message(STATUS
           "No static wxWindows lib found, but WXWINDOWS_USE_SHARED_LIBS=${WXWINDOWS_USE_SHARED_LIBS}.")
-      endif(NOT WXWINDOWS_STATIC_LIBRARY)
-    endif(NOT WXWINDOWS_STATIC_DEBUG_LIBRARY AND NOT WXWINDOWS_SEPARATE_LIBS_BUILD)
-  endif(WXWINDOWS_USE_SHARED_LIBS)
+      endif()
+    endif()
+  endif()
 
 
   ## not neccessary in wxWindows 2.4.1 and 2.6.2
@@ -535,10 +535,10 @@ if(WIN32_STYLE_FIND)
   mark_as_advanced(WXWINDOWS_SET_DEFINITIONS)
   if (WXWINDOWS_SET_DEFINITIONS)
     set(WXWINDOWS_DEFINITIONS "-DWINVER=0x400")
-  else (WXWINDOWS_SET_DEFINITIONS)
+  else ()
     # clear:
     set(WXWINDOWS_DEFINITIONS "")
-  endif (WXWINDOWS_SET_DEFINITIONS)
+  endif ()
 
 
 
@@ -550,7 +550,7 @@ if(WIN32_STYLE_FIND)
   ## append the build specific include dir for wx/setup.h:
   if (WXWINDOWS_INCLUDE_DIR_SETUPH)
     set(WXWINDOWS_INCLUDE_DIR ${WXWINDOWS_INCLUDE_DIR} ${WXWINDOWS_INCLUDE_DIR_SETUPH} )
-  endif (WXWINDOWS_INCLUDE_DIR_SETUPH)
+  endif ()
 
 
 
@@ -579,7 +579,7 @@ if(WIN32_STYLE_FIND)
     )
 
 
-else(WIN32_STYLE_FIND)
+else()
 
   if (UNIX_STYLE_FIND)
     ## ######################################################################
@@ -613,14 +613,14 @@ else(WIN32_STYLE_FIND)
       # linking, just link *against* static .a libs)
       if(WXWINDOWS_USE_SHARED_LIBS)
         set(WX_CONFIG_ARGS_LIBS "--libs")
-      else(WXWINDOWS_USE_SHARED_LIBS)
+      else()
         set(WX_CONFIG_ARGS_LIBS "--static --libs")
-      endif(WXWINDOWS_USE_SHARED_LIBS)
+      endif()
 
       # do we need additionial wx GL stuff like GLCanvas ?
       if(WXWINDOWS_USE_GL)
         set(WX_CONFIG_ARGS_LIBS "${WX_CONFIG_ARGS_LIBS} --gl-libs" )
-      endif(WXWINDOWS_USE_GL)
+      endif()
       ##message("DBG: WX_CONFIG_ARGS_LIBS=${WX_CONFIG_ARGS_LIBS}===")
 
       # set CXXFLAGS to be fed into CMAKE_CXX_FLAGS by the user:
@@ -629,12 +629,12 @@ else(WIN32_STYLE_FIND)
                 if(CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX )
             if (CMAKE_CXX_COMPILER MATCHES g\\+\\+)
               set(CMAKE_WXWINDOWS_CXX_FLAGS "`${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} --cxxflags|sed -e s/-I/-isystem/g`")
-            else(CMAKE_CXX_COMPILER MATCHES g\\+\\+)
+            else()
               set(CMAKE_WXWINDOWS_CXX_FLAGS "`${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} --cxxflags`")
-            endif(CMAKE_CXX_COMPILER MATCHES g\\+\\+)
-                endif(CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX )
-              endif (NOT APPLE)
-      endif (HAVE_ISYSTEM)
+            endif()
+                endif()
+              endif ()
+      endif ()
       ##message("DBG: for compilation:
       ##CMAKE_WXWINDOWS_CXX_FLAGS=${CMAKE_WXWINDOWS_CXX_FLAGS}===")
 
@@ -661,7 +661,7 @@ else(WIN32_STYLE_FIND)
       if(WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX)
         string(REGEX REPLACE "[-][L]" ";" WXWINDOWS_LINK_DIRECTORIES ${WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX} )
         # message("DBG  WXWINDOWS_LINK_DIRECTORIES=${WXWINDOWS_LINK_DIRECTORIES}")
-      endif(WXWINDOWS_LINK_DIRECTORIES_WITH_PREFIX)
+      endif()
 
 
       ## replace space separated string by semicolon separated vector to make it
@@ -677,17 +677,17 @@ else(WIN32_STYLE_FIND)
 
 
       ## we really need wx-config...
-    else(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE)
+    else()
       message(STATUS "Cannot find wx-config anywhere on the system. Please put the file into your path or specify it in CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE.")
       mark_as_advanced(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE)
-    endif(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE)
+    endif()
 
 
 
-  else(UNIX_STYLE_FIND)
+  else()
     message(STATUS "FindwxWindows.cmake:  Platform unknown/unsupported by FindwxWindows.cmake. It's neither WIN32 nor UNIX")
-  endif(UNIX_STYLE_FIND)
-endif(WIN32_STYLE_FIND)
+  endif()
+endif()
 
 
 if(WXWINDOWS_LIBRARIES)
@@ -702,5 +702,5 @@ if(WXWINDOWS_LIBRARIES)
     set(WXWINDOWS_LINK_DIRECTORIES ${WXWINDOWS_LINK_DIRECTORIES})
     set(CMAKE_WX_CXX_FLAGS     ${CMAKE_WXWINDOWS_CXX_FLAGS})
 
-  endif(WXWINDOWS_INCLUDE_DIR OR CMAKE_WXWINDOWS_CXX_FLAGS)
-endif(WXWINDOWS_LIBRARIES)
+  endif()
+endif()
diff --git a/Modules/FortranCInterface.cmake b/Modules/FortranCInterface.cmake
index 2455c5f8b..aafecb4c3 100644
--- a/Modules/FortranCInterface.cmake
+++ b/Modules/FortranCInterface.cmake
@@ -215,7 +215,7 @@ ${_desc_${macro}}
         message(AUTHOR_WARNING "No FortranCInterface mangling known for ${f}")
       endif()
     endif()
-  endforeach(f)
+  endforeach()
 
   # Store the content.
   configure_file(${FortranCInterface_SOURCE_DIR}/Macro.h.in ${FILE} @ONLY)
diff --git a/Modules/FortranCInterface/Detect.cmake b/Modules/FortranCInterface/Detect.cmake
index 2ea43d132..798c44caa 100644
--- a/Modules/FortranCInterface/Detect.cmake
+++ b/Modules/FortranCInterface/Detect.cmake
@@ -174,7 +174,7 @@ file(APPEND ${FortranCInterface_BINARY_DIR}/Output.cmake "\n")
 if(FortranCInterface_GLOBAL_FOUND)
   if(FortranCInterface_MODULE_FOUND)
     set(_result "Found GLOBAL and MODULE mangling")
-  else(FortranCInterface_MODULE_FOUND)
+  else()
     set(_result "Found GLOBAL but not MODULE mangling")
   endif()
 elseif(NOT _result)
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index d215685dd..e51055f3e 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -126,13 +126,13 @@ function(gp_append_unique list_var value)
     if("${item}" STREQUAL "${value}")
       set(contains 1)
       break()
-    endif("${item}" STREQUAL "${value}")
-  endforeach(item)
+    endif()
+  endforeach()
 
   if(NOT contains)
     set(${list_var} ${${list_var}} "${value}" PARENT_SCOPE)
-  endif(NOT contains)
-endfunction(gp_append_unique)
+  endif()
+endfunction()
 
 
 function(is_file_executable file result_var)
@@ -150,13 +150,13 @@ function(is_file_executable file result_var)
     if("${file_full_lower}" MATCHES "\\.exe$")
       set(${result_var} 1 PARENT_SCOPE)
       return()
-    endif("${file_full_lower}" MATCHES "\\.exe$")
+    endif()
 
     # A clause could be added here that uses output or return value of dumpbin
     # to determine ${result_var}. In 99%+? practical cases, the exe name
     # match will be sufficient...
     #
-  endif(WIN32 AND NOT UNIX)
+  endif()
 
   # Use the information returned from the Unix shell command "file" to
   # determine if ${file_full} should be considered an executable file...
@@ -168,7 +168,7 @@ function(is_file_executable file result_var)
   if(UNIX)
     if(NOT file_cmd)
       find_program(file_cmd "file")
-    endif(NOT file_cmd)
+    endif()
 
     if(file_cmd)
       execute_process(COMMAND "${file_cmd}" "${file_full}"
@@ -190,11 +190,11 @@ function(is_file_executable file result_var)
         #message(STATUS "executable!")
         if("${file_ov}" MATCHES "text")
           #message(STATUS "but text, so *not* a binary executable!")
-        else("${file_ov}" MATCHES "text")
+        else()
           set(${result_var} 1 PARENT_SCOPE)
           return()
-        endif("${file_ov}" MATCHES "text")
-      endif("${file_ov}" MATCHES "executable")
+        endif()
+      endif()
 
       # Also detect position independent executables on Linux,
       # where "file" gives "shared object ... (uses shared libraries)"
@@ -203,11 +203,11 @@ function(is_file_executable file result_var)
         return()
       endif()
 
-    else(file_cmd)
+    else()
       message(STATUS "warning: No 'file' command, skipping execute_process...")
-    endif(file_cmd)
-  endif(UNIX)
-endfunction(is_file_executable)
+    endif()
+  endif()
+endfunction()
 
 
 function(gp_item_default_embedded_path item default_embedded_path_var)
@@ -240,7 +240,7 @@ function(gp_item_default_embedded_path item default_embedded_path_var)
     if(item MATCHES "\\.dylib$")
       set(path "@executable_path/../MacOS")
       set(overridden 1)
-    endif(item MATCHES "\\.dylib$")
+    endif()
 
     # Embed frameworks in the embedded "Frameworks" directory (sibling of MacOS):
     #
@@ -248,8 +248,8 @@ function(gp_item_default_embedded_path item default_embedded_path_var)
       if(item MATCHES "[^/]+\\.framework/")
         set(path "@executable_path/../Frameworks")
         set(overridden 1)
-      endif(item MATCHES "[^/]+\\.framework/")
-    endif(NOT overridden)
+      endif()
+    endif()
   endif()
 
   # Provide a hook so that projects can override the default embedded location
@@ -257,10 +257,10 @@ function(gp_item_default_embedded_path item default_embedded_path_var)
   #
   if(COMMAND gp_item_default_embedded_path_override)
     gp_item_default_embedded_path_override("${item}" path)
-  endif(COMMAND gp_item_default_embedded_path_override)
+  endif()
 
   set(${default_embedded_path_var} "${path}" PARENT_SCOPE)
-endfunction(gp_item_default_embedded_path)
+endfunction()
 
 
 function(gp_resolve_item context item exepath dirs resolved_item_var)
@@ -271,7 +271,7 @@ function(gp_resolve_item context item exepath dirs resolved_item_var)
   #
   if(IS_ABSOLUTE "${resolved_item}" AND EXISTS "${resolved_item}")
     set(resolved 1)
-  endif(IS_ABSOLUTE "${resolved_item}" AND EXISTS "${resolved_item}")
+  endif()
 
   if(NOT resolved)
     if(item MATCHES "@executable_path")
@@ -285,11 +285,11 @@ function(gp_resolve_item context item exepath dirs resolved_item_var)
         #message(STATUS "info: embedded item exists (${ri})")
         set(resolved 1)
         set(resolved_item "${ri}")
-      else(EXISTS "${ri}")
+      else()
         message(STATUS "warning: embedded item does not exist '${ri}'")
-      endif(EXISTS "${ri}")
-    endif(item MATCHES "@executable_path")
-  endif(NOT resolved)
+      endif()
+    endif()
+  endif()
 
   if(NOT resolved)
     if(item MATCHES "@loader_path")
@@ -305,11 +305,11 @@ function(gp_resolve_item context item exepath dirs resolved_item_var)
         #message(STATUS "info: embedded item exists (${ri})")
         set(resolved 1)
         set(resolved_item "${ri}")
-      else(EXISTS "${ri}")
+      else()
         message(STATUS "warning: embedded item does not exist '${ri}'")
-      endif(EXISTS "${ri}")
-    endif(item MATCHES "@loader_path")
-  endif(NOT resolved)
+      endif()
+    endif()
+  endif()
 
   if(NOT resolved)
     if(item MATCHES "@rpath")
@@ -326,10 +326,10 @@ function(gp_resolve_item context item exepath dirs resolved_item_var)
         set(resolved 1)
         set(resolved_item "${ri}")
         set(ri "ri-NOTFOUND")
-      endif(ri)
+      endif()
 
-    endif(item MATCHES "@rpath")
-  endif(NOT resolved)
+    endif()
+  endif()
 
   if(NOT resolved)
     set(ri "ri-NOTFOUND")
@@ -340,8 +340,8 @@ function(gp_resolve_item context item exepath dirs resolved_item_var)
       set(resolved 1)
       set(resolved_item "${ri}")
       set(ri "ri-NOTFOUND")
-    endif(ri)
-  endif(NOT resolved)
+    endif()
+  endif()
 
   if(NOT resolved)
     if(item MATCHES "[^/]+\\.framework/")
@@ -356,9 +356,9 @@ function(gp_resolve_item context item exepath dirs resolved_item_var)
         set(resolved 1)
         set(resolved_item "${fw}")
         set(fw "fw-NOTFOUND")
-      endif(fw)
-    endif(item MATCHES "[^/]+\\.framework/")
-  endif(NOT resolved)
+      endif()
+    endif()
+  endif()
 
   # Using find_program on Windows will find dll files that are in the PATH.
   # (Converting simple file names into full path names if found.)
@@ -373,16 +373,16 @@ function(gp_resolve_item context item exepath dirs resolved_item_var)
       set(resolved 1)
       set(resolved_item "${ri}")
       set(ri "ri-NOTFOUND")
-    endif(ri)
-  endif(NOT resolved)
-  endif(WIN32 AND NOT UNIX)
+    endif()
+  endif()
+  endif()
 
   # Provide a hook so that projects can override item resolution
   # by whatever logic they choose:
   #
   if(COMMAND gp_resolve_item_override)
     gp_resolve_item_override("${context}" "${item}" "${exepath}" "${dirs}" resolved_item resolved)
-  endif(COMMAND gp_resolve_item_override)
+  endif()
 
   if(NOT resolved)
     message(STATUS "
@@ -409,10 +409,10 @@ warning: cannot resolve item '${item}'
 #    resolved_item_var='${resolved_item_var}'
 #******************************************************************************
 #")
-  endif(NOT resolved)
+  endif()
 
   set(${resolved_item_var} "${resolved_item}" PARENT_SCOPE)
-endfunction(gp_resolve_item)
+endfunction()
 
 
 function(gp_resolved_file_type original_file file exepath dirs type_var)
@@ -480,9 +480,9 @@ function(gp_resolved_file_type original_file file exepath dirs type_var)
           if(lower MATCHES "^(${sysroot}/sys(tem|wow)|${windir}/sys(tem|wow)|(.*/)*msvc[^/]+dll)")
             set(is_system 1)
           endif()
-        endif(CYGPATH_EXECUTABLE)
-      endif(UNIX)
-    endif(WIN32)
+        endif()
+      endif()
+    endif()
 
     if(NOT is_system)
       get_filename_component(original_path "${original_lower}" PATH)
@@ -551,7 +551,7 @@ function(gp_file_type original_file file type_var)
   gp_resolved_file_type("${original_file}" "${file}" "${exepath}" "" type)
 
   set(${type_var} "${type}" PARENT_SCOPE)
-endfunction(gp_file_type)
+endfunction()
 
 
 function(get_prerequisites target prerequisites_var exclude_system recurse exepath dirs)
@@ -560,11 +560,11 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
 
   if(NOT IS_ABSOLUTE "${target}")
     message("warning: target '${target}' is not absolute...")
-  endif(NOT IS_ABSOLUTE "${target}")
+  endif()
 
   if(NOT EXISTS "${target}")
     message("warning: target '${target}' does not exist...")
-  endif(NOT EXISTS "${target}")
+  endif()
 
   # <setup-gp_tool-vars>
   #
@@ -575,11 +575,11 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
     set(gp_tool "ldd")
     if(APPLE)
       set(gp_tool "otool")
-    endif(APPLE)
+    endif()
     if(WIN32 AND NOT UNIX) # This is how to check for cygwin, har!
       set(gp_tool "dumpbin")
-    endif(WIN32 AND NOT UNIX)
-  endif("${gp_tool}" STREQUAL "")
+    endif()
+  endif()
 
   set(gp_tool_known 0)
 
@@ -590,7 +590,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
     set(gp_regex_fallback "^[\t ]*([^\t ]+) => ([^\t ]+).*${eol_char}$")
     set(gp_regex_cmp_count 1)
     set(gp_tool_known 1)
-  endif("${gp_tool}" STREQUAL "ldd")
+  endif()
 
   if("${gp_tool}" STREQUAL "otool")
     set(gp_cmd_args "-L")
@@ -599,7 +599,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
     set(gp_regex_fallback "")
     set(gp_regex_cmp_count 3)
     set(gp_tool_known 1)
-  endif("${gp_tool}" STREQUAL "otool")
+  endif()
 
   if("${gp_tool}" STREQUAL "dumpbin")
     set(gp_cmd_args "/dependents")
@@ -609,14 +609,14 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
     set(gp_regex_cmp_count 1)
     set(gp_tool_known 1)
     set(ENV{VS_UNICODE_OUTPUT} "") # Block extra output from inside VS IDE.
-  endif("${gp_tool}" STREQUAL "dumpbin")
+  endif()
 
   if(NOT gp_tool_known)
     message(STATUS "warning: gp_tool='${gp_tool}' is an unknown tool...")
     message(STATUS "CMake function get_prerequisites needs more code to handle '${gp_tool}'")
     message(STATUS "Valid gp_tool values are dumpbin, ldd and otool.")
     return()
-  endif(NOT gp_tool_known)
+  endif()
 
   set(gp_cmd_paths ${gp_cmd_paths}
     "C:/Program Files/Microsoft Visual Studio 9.0/VC/bin"
@@ -634,7 +634,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
   if(NOT gp_cmd)
     message(STATUS "warning: could not find '${gp_tool}' - cannot analyze prerequisites...")
     return()
-  endif(NOT gp_cmd)
+  endif()
 
   if("${gp_tool}" STREQUAL "dumpbin")
     # When running dumpbin, it also needs the "Common7/IDE" directory in the
@@ -654,14 +654,14 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
         if("${gp_env_path_element}" STREQUAL "${gp_cmd_dlls_dir}")
           set(gp_found_cmd_dlls_dir 1)
         endif()
-      endforeach(gp_env_path_element)
+      endforeach()
 
       if(NOT gp_found_cmd_dlls_dir)
         file(TO_NATIVE_PATH "${gp_cmd_dlls_dir}" gp_cmd_dlls_dir)
         set(ENV{PATH} "$ENV{PATH};${gp_cmd_dlls_dir}")
       endif()
-    endif(EXISTS "${gp_cmd_dlls_dir}")
-  endif("${gp_tool}" STREQUAL "dumpbin")
+    endif()
+  endif()
   #
   # </setup-gp_tool-vars>
 
@@ -669,8 +669,8 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
     set(old_ld_env "$ENV{LD_LIBRARY_PATH}")
     foreach(dir ${exepath} ${dirs})
       set(ENV{LD_LIBRARY_PATH} "${dir}:$ENV{LD_LIBRARY_PATH}")
-    endforeach(dir)
-  endif("${gp_tool}" STREQUAL "ldd")
+    endforeach()
+  endif()
 
 
   # Track new prerequisites at each new level of recursion. Start with an
@@ -687,13 +687,13 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
 
   if("${gp_tool}" STREQUAL "ldd")
     set(ENV{LD_LIBRARY_PATH} "${old_ld_env}")
-  endif("${gp_tool}" STREQUAL "ldd")
+  endif()
 
   if(verbose)
     message(STATUS "<RawOutput cmd='${gp_cmd} ${gp_cmd_args} ${target}'>")
     message(STATUS "gp_cmd_ov='${gp_cmd_ov}'")
     message(STATUS "</RawOutput>")
-  endif(verbose)
+  endif()
 
   get_filename_component(target_dir "${target}" PATH)
 
@@ -716,8 +716,8 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
       # trim
       string(REGEX MATCH "[^\n ].*[^\n ]" gp_install_id "${gp_install_id}")
       #message("INSTALL ID is \"${gp_install_id}\"")
-    endif(gp_install_id)
-  endif("${gp_tool}" STREQUAL "otool")
+    endif()
+  endif()
 
   # Analyze each line for file names that match the regular expression:
   #
@@ -727,23 +727,23 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
     # Extract information from each candidate:
     if(gp_regex_error AND "${candidate}" MATCHES "${gp_regex_error}")
       string(REGEX REPLACE "${gp_regex_fallback}" "\\1" raw_item "${candidate}")
-    else(gp_regex_error AND "${candidate}" MATCHES "${gp_regex_error}")
+    else()
       string(REGEX REPLACE "${gp_regex}" "\\1" raw_item "${candidate}")
-    endif(gp_regex_error AND "${candidate}" MATCHES "${gp_regex_error}")
+    endif()
 
     if(gp_regex_cmp_count GREATER 1)
       string(REGEX REPLACE "${gp_regex}" "\\2" raw_compat_version "${candidate}")
       string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\1" compat_major_version "${raw_compat_version}")
       string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\2" compat_minor_version "${raw_compat_version}")
       string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\3" compat_patch_version "${raw_compat_version}")
-    endif(gp_regex_cmp_count GREATER 1)
+    endif()
 
     if(gp_regex_cmp_count GREATER 2)
       string(REGEX REPLACE "${gp_regex}" "\\3" raw_current_version "${candidate}")
       string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\1" current_major_version "${raw_current_version}")
       string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\2" current_minor_version "${raw_current_version}")
       string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\3" current_patch_version "${raw_current_version}")
-    endif(gp_regex_cmp_count GREATER 2)
+    endif()
 
     # Use the raw_item as the list entries returned by this function. Use the
     # gp_resolve_item function to resolve it to an actual full path file if
@@ -757,7 +757,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
 
     if("${item}" STREQUAL "${gp_install_id}")
       set(add_item 0)
-    endif("${item}" STREQUAL "${gp_install_id}")
+    endif()
 
     if(add_item AND ${exclude_system})
       set(type "")
@@ -765,8 +765,8 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
 
       if("${type}" STREQUAL "system")
         set(add_item 0)
-      endif("${type}" STREQUAL "system")
-    endif(add_item AND ${exclude_system})
+      endif()
+    endif()
 
     if(add_item)
       list(LENGTH ${prerequisites_var} list_length_before_append)
@@ -784,49 +784,49 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
         if(NOT list_length_before_append EQUAL list_length_after_append)
           gp_resolve_item("${target}" "${item}" "${exepath}" "${dirs}" resolved_item)
           set(unseen_prereqs ${unseen_prereqs} "${resolved_item}")
-        endif(NOT list_length_before_append EQUAL list_length_after_append)
-      endif(${recurse})
-    endif(add_item)
-  else("${candidate}" MATCHES "${gp_regex}")
+        endif()
+      endif()
+    endif()
+  else()
     if(verbose)
       message(STATUS "ignoring non-matching line: '${candidate}'")
-    endif(verbose)
-  endif("${candidate}" MATCHES "${gp_regex}")
-  endforeach(candidate)
+    endif()
+  endif()
+  endforeach()
 
   list(LENGTH ${prerequisites_var} prerequisites_var_length)
   if(prerequisites_var_length GREATER 0)
     list(SORT ${prerequisites_var})
-  endif(prerequisites_var_length GREATER 0)
+  endif()
   if(${recurse})
     set(more_inputs ${unseen_prereqs})
     foreach(input ${more_inputs})
       get_prerequisites("${input}" ${prerequisites_var} ${exclude_system} ${recurse} "${exepath}" "${dirs}")
-    endforeach(input)
-  endif(${recurse})
+    endforeach()
+  endif()
 
   set(${prerequisites_var} ${${prerequisites_var}} PARENT_SCOPE)
-endfunction(get_prerequisites)
+endfunction()
 
 
 function(list_prerequisites target)
   if("${ARGV1}" STREQUAL "")
     set(all 1)
-  else("${ARGV1}" STREQUAL "")
+  else()
     set(all "${ARGV1}")
-  endif("${ARGV1}" STREQUAL "")
+  endif()
 
   if("${ARGV2}" STREQUAL "")
     set(exclude_system 0)
-  else("${ARGV2}" STREQUAL "")
+  else()
     set(exclude_system "${ARGV2}")
-  endif("${ARGV2}" STREQUAL "")
+  endif()
 
   if("${ARGV3}" STREQUAL "")
     set(verbose 0)
-  else("${ARGV3}" STREQUAL "")
+  else()
     set(verbose "${ARGV3}")
-  endif("${ARGV3}" STREQUAL "")
+  endif()
 
   set(count 0)
   set(count_str "")
@@ -842,23 +842,23 @@ function(list_prerequisites target)
 
   if(print_target)
     message(STATUS "File '${target}' depends on:")
-  endif(print_target)
+  endif()
 
   foreach(d ${prereqs})
     math(EXPR count "${count} + 1")
 
     if(print_count)
       set(count_str "${count}. ")
-    endif(print_count)
+    endif()
 
     if(print_prerequisite_type)
       gp_file_type("${target}" "${d}" type)
       set(type_str " (${type})")
-    endif(print_prerequisite_type)
+    endif()
 
     message(STATUS "${count_str}${d}${type_str}")
-  endforeach(d)
-endfunction(list_prerequisites)
+  endforeach()
+endfunction()
 
 
 function(list_prerequisites_by_glob glob_arg glob_exp)
@@ -872,6 +872,6 @@ function(list_prerequisites_by_glob glob_arg glob_exp)
       message(STATUS "=============================================================================")
       list_prerequisites("${f}" ${ARGN})
       message(STATUS "")
-    endif(is_f_executable)
-  endforeach(f)
-endfunction(list_prerequisites_by_glob)
+    endif()
+  endforeach()
+endfunction()
diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake
index f6b185f14..19b06d5c4 100644
--- a/Modules/InstallRequiredSystemLibraries.cmake
+++ b/Modules/InstallRequiredSystemLibraries.cmake
@@ -47,9 +47,9 @@ if(MSVC)
       # VS 9 and earlier:
       set(CMAKE_MSVC_ARCH amd64)
     endif()
-  else(CMAKE_CL_64)
+  else()
     set(CMAKE_MSVC_ARCH x86)
-  endif(CMAKE_CL_64)
+  endif()
 
   get_filename_component(devenv_dir "${CMAKE_MAKE_PROGRAM}" PATH)
   get_filename_component(base_dir "${devenv_dir}/../.." ABSOLUTE)
@@ -59,14 +59,14 @@ if(MSVC)
       "${SYSTEMROOT}/system32/msvcp70.dll"
       "${SYSTEMROOT}/system32/msvcr70.dll"
       )
-  endif(MSVC70)
+  endif()
 
   if(MSVC71)
     set(__install__libs
       "${SYSTEMROOT}/system32/msvcp71.dll"
       "${SYSTEMROOT}/system32/msvcr71.dll"
       )
-  endif(MSVC71)
+  endif()
 
   if(MSVC80)
     # Find the runtime library redistribution directory.
@@ -89,7 +89,7 @@ if(MSVC)
         "${MSVC80_CRT_DIR}/msvcp80.dll"
         "${MSVC80_CRT_DIR}/msvcr80.dll"
         )
-    endif(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+    endif()
 
     if(CMAKE_INSTALL_DEBUG_LIBRARIES)
       set(MSVC80_CRT_DIR
@@ -100,8 +100,8 @@ if(MSVC)
         "${MSVC80_CRT_DIR}/msvcp80d.dll"
         "${MSVC80_CRT_DIR}/msvcr80d.dll"
         )
-    endif(CMAKE_INSTALL_DEBUG_LIBRARIES)
-  endif(MSVC80)
+    endif()
+  endif()
 
   if(MSVC90)
     # Find the runtime library redistribution directory.
@@ -127,7 +127,7 @@ if(MSVC)
         "${MSVC90_CRT_DIR}/msvcp90.dll"
         "${MSVC90_CRT_DIR}/msvcr90.dll"
         )
-    endif(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+    endif()
 
     if(CMAKE_INSTALL_DEBUG_LIBRARIES)
       set(MSVC90_CRT_DIR
@@ -138,8 +138,8 @@ if(MSVC)
         "${MSVC90_CRT_DIR}/msvcp90d.dll"
         "${MSVC90_CRT_DIR}/msvcr90d.dll"
         )
-    endif(CMAKE_INSTALL_DEBUG_LIBRARIES)
-  endif(MSVC90)
+    endif()
+  endif()
 
   macro(MSVCRT_FILES_FOR_VERSION version)
     set(v "${version}")
@@ -162,7 +162,7 @@ if(MSVC)
         "${MSVC${v}_CRT_DIR}/msvcp${v}0.dll"
         "${MSVC${v}_CRT_DIR}/msvcr${v}0.dll"
         )
-    endif(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+    endif()
 
     if(CMAKE_INSTALL_DEBUG_LIBRARIES)
       set(MSVC${v}_CRT_DIR
@@ -171,7 +171,7 @@ if(MSVC)
         "${MSVC${v}_CRT_DIR}/msvcp${v}0d.dll"
         "${MSVC${v}_CRT_DIR}/msvcr${v}0d.dll"
         )
-    endif(CMAKE_INSTALL_DEBUG_LIBRARIES)
+    endif()
   endmacro()
 
   if(MSVC10)
@@ -187,13 +187,13 @@ if(MSVC)
       set(__install__libs ${__install__libs}
         "${SYSTEMROOT}/system32/mfc70.dll"
         )
-    endif(MSVC70)
+    endif()
 
     if(MSVC71)
       set(__install__libs ${__install__libs}
         "${SYSTEMROOT}/system32/mfc71.dll"
         )
-    endif(MSVC71)
+    endif()
 
     if(MSVC80)
       if(CMAKE_INSTALL_DEBUG_LIBRARIES)
@@ -206,7 +206,7 @@ if(MSVC)
           "${MSVC80_MFC_DIR}/mfcm80d.dll"
           "${MSVC80_MFC_DIR}/mfcm80ud.dll"
           )
-      endif(CMAKE_INSTALL_DEBUG_LIBRARIES)
+      endif()
 
       set(MSVC80_MFC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFC")
       # Install the manifest that allows DLLs to be loaded from the
@@ -219,7 +219,7 @@ if(MSVC)
           "${MSVC80_MFC_DIR}/mfcm80.dll"
           "${MSVC80_MFC_DIR}/mfcm80u.dll"
           )
-      endif(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+      endif()
 
       # include the language dll's for vs8 as well as the actuall dll's
       set(MSVC80_MFCLOC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFCLOC")
@@ -237,7 +237,7 @@ if(MSVC)
         "${MSVC80_MFCLOC_DIR}/mfc80jpn.dll"
         "${MSVC80_MFCLOC_DIR}/mfc80kor.dll"
         )
-    endif(MSVC80)
+    endif()
 
     if(MSVC90)
       if(CMAKE_INSTALL_DEBUG_LIBRARIES)
@@ -250,7 +250,7 @@ if(MSVC)
           "${MSVC90_MFC_DIR}/mfcm90d.dll"
           "${MSVC90_MFC_DIR}/mfcm90ud.dll"
           )
-      endif(CMAKE_INSTALL_DEBUG_LIBRARIES)
+      endif()
 
       set(MSVC90_MFC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFC")
       # Install the manifest that allows DLLs to be loaded from the
@@ -263,7 +263,7 @@ if(MSVC)
           "${MSVC90_MFC_DIR}/mfcm90.dll"
           "${MSVC90_MFC_DIR}/mfcm90u.dll"
           )
-      endif(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+      endif()
 
       # include the language dll's for vs9 as well as the actuall dll's
       set(MSVC90_MFCLOC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFCLOC")
@@ -281,7 +281,7 @@ if(MSVC)
         "${MSVC90_MFCLOC_DIR}/mfc90jpn.dll"
         "${MSVC90_MFCLOC_DIR}/mfc90kor.dll"
         )
-    endif(MSVC90)
+    endif()
 
     macro(MFC_FILES_FOR_VERSION version)
       set(v "${version}")
@@ -295,7 +295,7 @@ if(MSVC)
           "${MSVC${v}_MFC_DIR}/mfcm${v}0d.dll"
           "${MSVC${v}_MFC_DIR}/mfcm${v}0ud.dll"
           )
-      endif(CMAKE_INSTALL_DEBUG_LIBRARIES)
+      endif()
 
       set(MSVC${v}_MFC_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.MFC")
       if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
@@ -305,7 +305,7 @@ if(MSVC)
           "${MSVC${v}_MFC_DIR}/mfcm${v}0.dll"
           "${MSVC${v}_MFC_DIR}/mfcm${v}0u.dll"
           )
-      endif(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+      endif()
 
       # include the language dll's as well as the actuall dll's
       set(MSVC${v}_MFCLOC_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.MFCLOC")
@@ -329,7 +329,7 @@ if(MSVC)
     if(MSVC11)
       MFC_FILES_FOR_VERSION(11)
     endif()
-  endif(CMAKE_INSTALL_MFC_LIBRARIES)
+  endif()
 
   foreach(lib
       ${__install__libs}
@@ -337,7 +337,7 @@ if(MSVC)
     if(EXISTS ${lib})
       set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
         ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
-    else(EXISTS ${lib})
+    else()
       if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
         message(WARNING "system runtime library file does not exist: '${lib}'")
         # This warning indicates an incomplete Visual Studio installation
@@ -346,9 +346,9 @@ if(MSVC)
         # set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including
         # this file.
       endif()
-    endif(EXISTS ${lib})
-  endforeach(lib)
-endif(MSVC)
+    endif()
+  endforeach()
+endif()
 
 if(WATCOM)
   get_filename_component( CompilerPath ${CMAKE_C_COMPILER} PATH )
@@ -391,11 +391,11 @@ if(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
     if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION)
       if(WIN32)
         set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION bin)
-      else(WIN32)
+      else()
         set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION lib)
-      endif(WIN32)
-    endif(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION)
+      endif()
+    endif()
     install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
       DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION})
-  endif(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
-endif(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
+  endif()
+endif()
diff --git a/Modules/KDE3Macros.cmake b/Modules/KDE3Macros.cmake
index 858b7d63f..6d6cdb0d2 100644
--- a/Modules/KDE3Macros.cmake
+++ b/Modules/KDE3Macros.cmake
@@ -54,7 +54,7 @@ macro(KDE3_ADD_DCOP_SKELS _sources)
           DEPENDS ${_tmp_FILE}
          )
 
-       endif (NOT HAVE_${_basename}_KIDL_RULE)
+       endif ()
 
       if (NOT HAVE_${_basename}_SKEL_RULE)
         set(HAVE_${_basename}_SKEL_RULE ON)
@@ -65,13 +65,13 @@ macro(KDE3_ADD_DCOP_SKELS _sources)
           DEPENDS ${_kidl}
           )
 
-      endif (NOT HAVE_${_basename}_SKEL_RULE)
+      endif ()
 
       set(${_sources} ${${_sources}} ${_skel})
 
-   endforeach (_current_FILE)
+   endforeach ()
 
-endmacro(KDE3_ADD_DCOP_SKELS)
+endmacro()
 
 
 macro(KDE3_ADD_DCOP_STUBS _sources)
@@ -94,7 +94,7 @@ macro(KDE3_ADD_DCOP_STUBS _sources)
            DEPENDS ${_tmp_FILE}
            )
 
-      endif (NOT HAVE_${_basename}_KIDL_RULE)
+      endif ()
 
 
       if (NOT HAVE_${_basename}_STUB_RULE)
@@ -106,13 +106,13 @@ macro(KDE3_ADD_DCOP_STUBS _sources)
            DEPENDS ${_kidl}
          )
 
-      endif (NOT HAVE_${_basename}_STUB_RULE)
+      endif ()
 
       set(${_sources} ${${_sources}} ${_stub_CPP})
 
-   endforeach (_current_FILE)
+   endforeach ()
 
-endmacro(KDE3_ADD_DCOP_STUBS)
+endmacro()
 
 
 macro(KDE3_ADD_KCFG_FILES _sources)
@@ -135,9 +135,9 @@ macro(KDE3_ADD_KCFG_FILES _sources)
 
       set(${_sources} ${${_sources}} ${_src_FILE})
 
-   endforeach (_current_FILE)
+   endforeach ()
 
-endmacro(KDE3_ADD_KCFG_FILES)
+endmacro()
 
 
 #create the moc files and add them to the list of sources
@@ -158,8 +158,8 @@ macro(KDE3_ADD_MOC_FILES _sources)
 
       set(${_sources} ${${_sources}} ${_moc})
 
-   endforeach (_current_FILE)
-endmacro(KDE3_ADD_MOC_FILES)
+   endforeach ()
+endmacro()
 
 
 get_filename_component( KDE3_MODULE_DIR  ${CMAKE_CURRENT_LIST_FILE} PATH)
@@ -202,8 +202,8 @@ macro(KDE3_ADD_UI_FILES _sources )
 
       set(${_sources} ${${_sources}} ${_src} ${_moc} )
 
-   endforeach (_current_FILE)
-endmacro(KDE3_ADD_UI_FILES)
+   endforeach ()
+endmacro()
 
 
 macro(KDE3_AUTOMOC)
@@ -245,12 +245,12 @@ macro(KDE3_AUTOMOC)
 
                ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc})
 
-            endforeach (_current_MOC_INC)
-         endif(_match)
+            endforeach ()
+         endif()
 
-      endif (EXISTS ${_abs_FILE} AND NOT _skip)
-   endforeach (_current_FILE)
-endmacro(KDE3_AUTOMOC)
+      endif ()
+   endforeach ()
+endmacro()
 
 # only used internally by KDE3_INSTALL_ICONS
 macro (_KDE3_ADD_ICON_INSTALL_RULE _install_SCRIPT _install_PATH _group _orig_NAME _install_NAME)
@@ -261,29 +261,29 @@ macro (_KDE3_ADD_ICON_INSTALL_RULE _install_SCRIPT _install_PATH _group _orig_NA
 
       if (${_group} STREQUAL "mime")
          set(_icon_GROUP  "mimetypes")
-      endif (${_group} STREQUAL "mime")
+      endif ()
 
       if (${_group} STREQUAL "filesys")
          set(_icon_GROUP  "filesystems")
-      endif (${_group} STREQUAL "filesys")
+      endif ()
 
       if (${_group} STREQUAL "device")
          set(_icon_GROUP  "devices")
-      endif (${_group} STREQUAL "device")
+      endif ()
 
       if (${_group} STREQUAL "app")
          set(_icon_GROUP  "apps")
-      endif (${_group} STREQUAL "app")
+      endif ()
 
       if (${_group} STREQUAL "action")
          set(_icon_GROUP  "actions")
-      endif (${_group} STREQUAL "action")
+      endif ()
 
 #      message(STATUS "icon: ${_current_ICON} size: ${_size} group: ${_group} name: ${_name}" )
    install(FILES ${_orig_NAME} DESTINATION ${_install_PATH}/${_icon_GROUP}/ RENAME ${_install_NAME} )
-   endif (NOT ${_group} STREQUAL ${_install_NAME} )
+   endif ()
 
-endmacro (_KDE3_ADD_ICON_INSTALL_RULE)
+endmacro ()
 
 
 macro (KDE3_INSTALL_ICONS _theme )
@@ -297,7 +297,7 @@ macro (KDE3_INSTALL_ICONS _theme )
       _KDE3_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake
          ${_defaultpath}/${_theme}/${_size}x${_size}
          ${_group} ${_current_ICON} ${_name})
-   endforeach (_current_ICON)
+   endforeach ()
 
    # and now the svg icons
    file(GLOB _icons *.svgz)
@@ -307,9 +307,9 @@ macro (KDE3_INSTALL_ICONS _theme )
       _KDE3_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake
                                  ${_defaultpath}/${_theme}/scalable
                                  ${_group} ${_current_ICON} ${_name})
-   endforeach (_current_ICON)
+   endforeach ()
 
-endmacro (KDE3_INSTALL_ICONS)
+endmacro ()
 
 macro(KDE3_INSTALL_LIBTOOL_FILE _target)
    get_target_property(_target_location ${_target} LOCATION)
@@ -324,9 +324,9 @@ macro(KDE3_INSTALL_LIBTOOL_FILE _target)
    file(APPEND ${_laname} "# Names of this library\n")
    if(CYGWIN)
      file(APPEND ${_laname} "library_names='${_soname}'\n")
-   else(CYGWIN)
+   else()
      file(APPEND ${_laname} "library_names='${_soname} ${_soname} ${_soname}'\n")
-   endif(CYGWIN)
+   endif()
    file(APPEND ${_laname} "# The name of the static archive\n")
    file(APPEND ${_laname} "old_library=''\n")
    file(APPEND ${_laname} "# Libraries that this one depends upon.\n")
@@ -340,16 +340,16 @@ macro(KDE3_INSTALL_LIBTOOL_FILE _target)
    file(APPEND ${_laname} "libdir='${CMAKE_INSTALL_PREFIX}/lib/kde3'\n")
 
    install_files(${KDE3_LIBTOOL_DIR} FILES ${_laname})
-endmacro(KDE3_INSTALL_LIBTOOL_FILE)
+endmacro()
 
 
 macro(KDE3_CREATE_FINAL_FILE _filename)
    file(WRITE ${_filename} "//autogenerated file\n")
    foreach (_current_FILE ${ARGN})
       file(APPEND ${_filename} "#include \"${_current_FILE}\"\n")
-   endforeach (_current_FILE)
+   endforeach ()
 
-endmacro(KDE3_CREATE_FINAL_FILE)
+endmacro()
 
 
 # option(KDE3_ENABLE_FINAL "Enable final all-in-one compilation")
@@ -360,24 +360,24 @@ macro(KDE3_ADD_KPART _target_NAME _with_PREFIX)
 #is the first argument is "WITH_PREFIX" then keep the standard "lib" prefix, otherwise SET the prefix empty
    if (${_with_PREFIX} STREQUAL "WITH_PREFIX")
       set(_first_SRC)
-   else (${_with_PREFIX} STREQUAL "WITH_PREFIX")
+   else ()
       set(_first_SRC ${_with_PREFIX})
-   endif (${_with_PREFIX} STREQUAL "WITH_PREFIX")
+   endif ()
 
 #    if (KDE3_ENABLE_FINAL)
 #       KDE3_CREATE_FINAL_FILE(${_target_NAME}_final.cpp ${_first_SRC} ${ARGN})
 #       add_library(${_target_NAME} MODULE  ${_target_NAME}_final.cpp)
-#    else (KDE3_ENABLE_FINAL)
+#    else ()
    add_library(${_target_NAME} MODULE ${_first_SRC} ${ARGN})
-#    endif (KDE3_ENABLE_FINAL)
+#    endif ()
 
    if(_first_SRC)
       set_target_properties(${_target_NAME} PROPERTIES PREFIX "")
-   endif(_first_SRC)
+   endif()
 
    KDE3_INSTALL_LIBTOOL_FILE(${_target_NAME})
 
-endmacro(KDE3_ADD_KPART)
+endmacro()
 
 
 macro(KDE3_ADD_KDEINIT_EXECUTABLE _target_NAME )
@@ -385,16 +385,16 @@ macro(KDE3_ADD_KDEINIT_EXECUTABLE _target_NAME )
 #    if (KDE3_ENABLE_FINAL)
 #       KDE3_CREATE_FINAL_FILE(${_target_NAME}_final.cpp ${ARGN})
 #       add_library(kdeinit_${_target_NAME} SHARED  ${_target_NAME}_final.cpp)
-#    else (KDE3_ENABLE_FINAL)
+#    else ()
    add_library(kdeinit_${_target_NAME} SHARED ${ARGN} )
-#    endif (KDE3_ENABLE_FINAL)
+#    endif ()
 
    configure_file(${KDE3_MODULE_DIR}/kde3init_dummy.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp)
 
    add_executable( ${_target_NAME} ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp )
    target_link_libraries( ${_target_NAME} kdeinit_${_target_NAME} )
 
-endmacro(KDE3_ADD_KDEINIT_EXECUTABLE)
+endmacro()
 
 
 macro(KDE3_ADD_EXECUTABLE _target_NAME )
@@ -402,10 +402,10 @@ macro(KDE3_ADD_EXECUTABLE _target_NAME )
 #    if (KDE3_ENABLE_FINAL)
 #       KDE3_CREATE_FINAL_FILE(${_target_NAME}_final.cpp ${ARGN})
 #       add_executable(${_target_NAME} ${_target_NAME}_final.cpp)
-#    else (KDE3_ENABLE_FINAL)
+#    else ()
    add_executable(${_target_NAME} ${ARGN} )
-#    endif (KDE3_ENABLE_FINAL)
+#    endif ()
 
-endmacro(KDE3_ADD_EXECUTABLE)
+endmacro()
 
 
diff --git a/Modules/MacroAddFileDependencies.cmake b/Modules/MacroAddFileDependencies.cmake
index 5ed5b8d90..d0605a114 100644
--- a/Modules/MacroAddFileDependencies.cmake
+++ b/Modules/MacroAddFileDependencies.cmake
@@ -24,10 +24,10 @@ macro (MACRO_ADD_FILE_DEPENDENCIES _file)
    get_source_file_property(_deps ${_file} OBJECT_DEPENDS)
    if (_deps)
       set(_deps ${_deps} ${ARGN})
-   else (_deps)
+   else ()
       set(_deps ${ARGN})
-   endif (_deps)
+   endif ()
 
    set_source_files_properties(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}")
 
-endmacro (MACRO_ADD_FILE_DEPENDENCIES)
+endmacro ()
diff --git a/Modules/Platform/AIX.cmake b/Modules/Platform/AIX.cmake
index 78221b04f..58c648319 100644
--- a/Modules/Platform/AIX.cmake
+++ b/Modules/Platform/AIX.cmake
@@ -24,6 +24,6 @@ set_property(GLOBAL PROPERTY TARGET_ARCHIVES_MAY_BE_SHARED_LIBS 1)
 #foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
 #  set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-bstatic")
 #  set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-bdynamic")
-#endforeach(type)
+#endforeach()
 
 include(Platform/UnixPaths)
diff --git a/Modules/Platform/BlueGeneL.cmake b/Modules/Platform/BlueGeneL.cmake
index b2158f5d7..082e46cae 100644
--- a/Modules/Platform/BlueGeneL.cmake
+++ b/Modules/Platform/BlueGeneL.cmake
@@ -24,17 +24,17 @@ include(Platform/UnixPaths)
 if(CMAKE_COMPILER_IS_GNUCC)
   set(CMAKE_C_LINK_EXECUTABLE
     "<CMAKE_C_COMPILER> -Wl,-relax <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS>  -o <TARGET> <LINK_LIBRARIES> -Wl,-lgcc,-lc -lnss_files -lnss_dns -lresolv")
-else(CMAKE_COMPILER_IS_GNUCC)
+else()
   # when using IBM xlc we probably don't want to link to -lgcc
   set(CMAKE_C_LINK_EXECUTABLE
     "<CMAKE_C_COMPILER> -Wl,-relax <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS>  -o <TARGET> <LINK_LIBRARIES> -Wl,-lc -lnss_files -lnss_dns -lresolv")
-endif(CMAKE_COMPILER_IS_GNUCC)
+endif()
 
 if(CMAKE_COMPILER_IS_GNUCXX)
   set(CMAKE_CXX_LINK_EXECUTABLE
     "<CMAKE_CXX_COMPILER> -Wl,-relax <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS>  -o <TARGET> <LINK_LIBRARIES> -Wl,-lstdc++,-lgcc,-lc -lnss_files -lnss_dns -lresolv")
-else(CMAKE_COMPILER_IS_GNUCXX)
+else()
   # when using the IBM xlC we probably don't want to link to -lgcc
   set(CMAKE_CXX_LINK_EXECUTABLE
     "<CMAKE_CXX_COMPILER> -Wl,-relax <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS>  -o <TARGET> <LINK_LIBRARIES> -Wl,-lstdc++,-lc -lnss_files -lnss_dns -lresolv")
-endif(CMAKE_COMPILER_IS_GNUCXX)
+endif()
diff --git a/Modules/Platform/CYGWIN-GNU.cmake b/Modules/Platform/CYGWIN-GNU.cmake
index 2ec22191d..fe25ab214 100644
--- a/Modules/Platform/CYGWIN-GNU.cmake
+++ b/Modules/Platform/CYGWIN-GNU.cmake
@@ -47,7 +47,7 @@ macro(__cygwin_compiler_gnu lang)
   foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
     set(CMAKE_${type}_LINK_STATIC_${lang}_FLAGS "-Wl,-Bstatic")
     set(CMAKE_${type}_LINK_DYNAMIC_${lang}_FLAGS "-Wl,-Bdynamic")
-  endforeach(type)
+  endforeach()
 
   set(CMAKE_EXE_EXPORTS_${lang}_FLAG "-Wl,--export-all-symbols")
   # TODO: Is -Wl,--enable-auto-import now always default?
diff --git a/Modules/Platform/Darwin-icc.cmake b/Modules/Platform/Darwin-icc.cmake
index b8e1bdfba..6a46f8e02 100644
--- a/Modules/Platform/Darwin-icc.cmake
+++ b/Modules/Platform/Darwin-icc.cmake
@@ -13,7 +13,7 @@ if ( _OSX_VERSION MATCHES "^10.4" )
     set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -gdwarf-2")
     set (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
     set (CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
- # endif(CMAKE_COMPILER_IS_GNUCC)
+ # endif()
 
 #  if(CMAKE_COMPILER_IS_GNUCXX)
     set (CMAKE_CXX_FLAGS_INIT "")
@@ -23,8 +23,8 @@ if ( _OSX_VERSION MATCHES "^10.4" )
     set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -gdwarf-2")
     set (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
     set (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
-#  endif(CMAKE_COMPILER_IS_GNUCXX)
-endif ( _OSX_VERSION MATCHES "^10.4" )
+#  endif()
+endif ()
 
 
 set(CMAKE_SHARED_LIBRARY_PREFIX "lib")
@@ -54,17 +54,17 @@ if(EXISTS /Developer/SDKs/MacOSX10.4u.sdk)
   # if it is set.
   if(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
     set(_CMAKE_OSX_MACHINE "$ENV{CMAKE_OSX_ARCHITECTURES}")
-  endif(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
+  endif()
   # now put _CMAKE_OSX_MACHINE into the cache
   set(CMAKE_OSX_ARCHITECTURES ${_CMAKE_OSX_MACHINE}
     CACHE STRING "Build architectures for OSX")
-endif(EXISTS /Developer/SDKs/MacOSX10.4u.sdk)
+endif()
 
 
 if("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$")
   set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
     "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -flat_namespace -undefined suppress")
-endif("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$")
+endif()
 
 if(NOT XCODE)
   # Enable shared library versioning.  This flag is not actually referenced
@@ -73,13 +73,13 @@ if(NOT XCODE)
   set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name")
   set(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-install_name")
   set(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG "-install_name")
-endif(NOT XCODE)
+endif()
 
 # Xcode does not support -isystem yet.
 if(XCODE)
   set(CMAKE_INCLUDE_SYSTEM_FLAG_C)
   set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
-endif(XCODE)
+endif()
 
 set(CMAKE_MacOSX_Content_COMPILE_OBJECT "\"${CMAKE_COMMAND}\" -E copy_if_different <SOURCE> <OBJECT>")
 
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index 8e665d1cd..2a5f3cf30 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -17,8 +17,8 @@ if(NOT DEFINED HAVE_FLAG_SEARCH_PATHS_FIRST)
   set(HAVE_FLAG_SEARCH_PATHS_FIRST 0)
   if("${DARWIN_MAJOR_VERSION}" GREATER 6)
     set(HAVE_FLAG_SEARCH_PATHS_FIRST 1)
-  endif("${DARWIN_MAJOR_VERSION}" GREATER 6)
-endif(NOT DEFINED HAVE_FLAG_SEARCH_PATHS_FIRST)
+  endif()
+endif()
 # More desirable, but does not work:
   #include(CheckCXXCompilerFlag)
   #CHECK_CXX_COMPILER_FLAG("-Wl,-search_paths_first" HAVE_FLAG_SEARCH_PATHS_FIRST)
@@ -41,7 +41,7 @@ set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names")
 if(HAVE_FLAG_SEARCH_PATHS_FIRST)
   set(CMAKE_C_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}")
   set(CMAKE_CXX_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}")
-endif(HAVE_FLAG_SEARCH_PATHS_FIRST)
+endif()
 
 set(CMAKE_PLATFORM_HAS_INSTALLNAME 1)
 set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names")
@@ -57,7 +57,7 @@ set(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a")
 if(NOT DEFINED CMAKE_INSTALL_NAME_TOOL)
   find_program(CMAKE_INSTALL_NAME_TOOL install_name_tool)
   mark_as_advanced(CMAKE_INSTALL_NAME_TOOL)
-endif(NOT DEFINED CMAKE_INSTALL_NAME_TOOL)
+endif()
 
 # Set the assumed (Pre 10.5 or Default) location of the developer tools
 set(OSX_DEVELOPER_ROOT "/Developer")
@@ -69,7 +69,7 @@ if(CMAKE_XCODE_SELECT)
   execute_process(COMMAND ${CMAKE_XCODE_SELECT} "-print-path"
     OUTPUT_VARIABLE OSX_DEVELOPER_ROOT
     OUTPUT_STRIP_TRAILING_WHITESPACE)
-endif(CMAKE_XCODE_SELECT)
+endif()
 
 # Find installed SDKs
 # Start with Xcode-4.3+ default SDKs directory
@@ -81,7 +81,7 @@ file(GLOB _CMAKE_OSX_SDKS "${_CMAKE_OSX_SDKS_DIR}/*")
 if(NOT _CMAKE_OSX_SDKS)
 set(_CMAKE_OSX_SDKS_DIR "${OSX_DEVELOPER_ROOT}/SDKs")
   file(GLOB _CMAKE_OSX_SDKS "${_CMAKE_OSX_SDKS_DIR}/*")
-endif(NOT _CMAKE_OSX_SDKS)
+endif()
 
 execute_process(COMMAND sw_vers -productVersion
   OUTPUT_VARIABLE CURRENT_OSX_VERSION
@@ -100,7 +100,7 @@ string(REGEX REPLACE "^([0-9]+\\.[0-9]+).*$" "\\1"
 if(_CURRENT_OSX_VERSION VERSION_GREATER 10.3)
   set(CMAKE_OSX_DEPLOYMENT_TARGET "$ENV{MACOSX_DEPLOYMENT_TARGET}" CACHE STRING
     "Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value.")
-endif(_CURRENT_OSX_VERSION VERSION_GREATER 10.3)
+endif()
 
 #----------------------------------------------------------------------------
 # CMAKE_OSX_SYSROOT
@@ -117,19 +117,19 @@ set(CMAKE_OSX_SYSROOT_DEFAULT
 if(_CURRENT_OSX_VERSION STREQUAL "10.4")
   set(CMAKE_OSX_SYSROOT_DEFAULT
     "${_CMAKE_OSX_SDKS_DIR}/MacOSX10.4u.sdk")
-endif(_CURRENT_OSX_VERSION STREQUAL "10.4")
+endif()
 
 if(_CURRENT_OSX_VERSION STREQUAL "10.3")
   set(CMAKE_OSX_SYSROOT_DEFAULT
     "${_CMAKE_OSX_SDKS_DIR}/MacOSX10.3.9.sdk")
-endif(_CURRENT_OSX_VERSION STREQUAL "10.3")
+endif()
 
 # Use environment or default as initial cache value:
 if(NOT ENV_SDKROOT STREQUAL "")
   set(CMAKE_OSX_SYSROOT_VALUE ${ENV_SDKROOT})
-else(NOT ENV_SDKROOT STREQUAL "")
+else()
   set(CMAKE_OSX_SYSROOT_VALUE ${CMAKE_OSX_SYSROOT_DEFAULT})
-endif(NOT ENV_SDKROOT STREQUAL "")
+endif()
 
 # Set cache variable - end user may change this during ccmake or cmake-gui configure.
 set(CMAKE_OSX_SYSROOT ${CMAKE_OSX_SYSROOT_VALUE} CACHE PATH
@@ -149,7 +149,7 @@ function(SanityCheckSDKAndDeployTarget _sdk_path _deploy)
   if(_deploy GREATER "${SDK}")
     message(FATAL_ERROR "CMAKE_OSX_DEPLOYMENT_TARGET (${_deploy}) is greater than CMAKE_OSX_SYSROOT SDK (${_sdk_path}). Please set CMAKE_OSX_DEPLOYMENT_TARGET to ${SDK} or lower")
   endif()
-endfunction(SanityCheckSDKAndDeployTarget)
+endfunction()
 #----------------------------------------------------------------------------
 
 # Make sure the combination of SDK and Deployment Target are allowed
@@ -163,15 +163,15 @@ execute_process(COMMAND uname -m
 # check for Power PC and change to ppc
 if(_CMAKE_OSX_MACHINE MATCHES "Power")
   set(_CMAKE_OSX_MACHINE ppc)
-endif(_CMAKE_OSX_MACHINE MATCHES "Power")
+endif()
 
 # check for environment variable CMAKE_OSX_ARCHITECTURES
 # if it is set.
 if(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
   set(CMAKE_OSX_ARCHITECTURES_VALUE "$ENV{CMAKE_OSX_ARCHITECTURES}")
-else(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
+else()
   set(CMAKE_OSX_ARCHITECTURES_VALUE "")
-endif(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
+endif()
 
 # now put _CMAKE_OSX_MACHINE into the cache
 set(CMAKE_OSX_ARCHITECTURES ${CMAKE_OSX_ARCHITECTURES_VALUE} CACHE STRING
@@ -181,20 +181,20 @@ set(CMAKE_OSX_ARCHITECTURES ${CMAKE_OSX_ARCHITECTURES_VALUE} CACHE STRING
 if("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$")
   set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
     "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -flat_namespace -undefined suppress")
-endif("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$")
+endif()
 
 if(NOT XCODE)
   # Enable shared library versioning.  This flag is not actually referenced
   # but the fact that the setting exists will cause the generators to support
   # soname computation.
   set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name")
-endif(NOT XCODE)
+endif()
 
 # Xcode does not support -isystem yet.
 if(XCODE)
   set(CMAKE_INCLUDE_SYSTEM_FLAG_C)
   set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
-endif(XCODE)
+endif()
 
 if("${_CURRENT_OSX_VERSION}" VERSION_LESS "10.5")
   # Need to list dependent shared libraries on link line.  When building
diff --git a/Modules/Platform/FreeBSD.cmake b/Modules/Platform/FreeBSD.cmake
index b5779023f..cf1850110 100644
--- a/Modules/Platform/FreeBSD.cmake
+++ b/Modules/Platform/FreeBSD.cmake
@@ -10,7 +10,7 @@ if(EXISTS /usr/include/dlfcn.h)
   set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
   set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
   set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
-endif(EXISTS /usr/include/dlfcn.h)
+endif()
 
 # Shared libraries with no builtin soname may not be linked safely by
 # specifying the file path.
@@ -23,6 +23,6 @@ set(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
 foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
   set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
   set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
-endforeach(type)
+endforeach()
 
 include(Platform/UnixPaths)
diff --git a/Modules/Platform/Generic-ADSP-Common.cmake b/Modules/Platform/Generic-ADSP-Common.cmake
index 9120eed11..026f83c48 100644
--- a/Modules/Platform/Generic-ADSP-Common.cmake
+++ b/Modules/Platform/Generic-ADSP-Common.cmake
@@ -18,66 +18,66 @@ if(NOT ADSP)
   # assume that this is the processor name to use for the compiler
   if(CMAKE_SYSTEM_PROCESSOR AND NOT ADSP_PROCESSOR)
     set(ADSP_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR})
-  endif(CMAKE_SYSTEM_PROCESSOR AND NOT ADSP_PROCESSOR)
+  endif()
 
   # if ADSP_PROCESSOR_SILICIUM_REVISION has not been set, use "none"
   if(NOT ADSP_PROCESSOR_SILICIUM_REVISION)
     set(ADSP_PROCESSOR_SILICIUM_REVISION "none")
-  endif(NOT ADSP_PROCESSOR_SILICIUM_REVISION)
+  endif()
 
   # this file is included from the C and CXX files, so handle both here
 
   get_filename_component(_ADSP_DIR "${CMAKE_C_COMPILER}" PATH)
   if(NOT _ADSP_DIR)
     get_filename_component(_ADSP_DIR "${CMAKE_CXX_COMPILER}" PATH)
-  endif(NOT _ADSP_DIR)
+  endif()
   if(NOT _ADSP_DIR)
     get_filename_component(_ADSP_DIR "${CMAKE_ASM_COMPILER}" PATH)
-  endif(NOT _ADSP_DIR)
+  endif()
 
   # detect architecture
 
   if(CMAKE_C_COMPILER MATCHES ccblkfn OR CMAKE_CXX_COMPILER MATCHES ccblkfn OR CMAKE_ASM_COMPILER MATCHES easmBLKFN)
     if(NOT ADSP_PROCESSOR)
       set(ADSP_PROCESSOR "ADSP-BF561")
-    endif(NOT ADSP_PROCESSOR)
+    endif()
     set(ADSP_BLACKFIN TRUE)
     set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/Blackfin")
-  endif(CMAKE_C_COMPILER MATCHES ccblkfn OR CMAKE_CXX_COMPILER MATCHES ccblkfn OR CMAKE_ASM_COMPILER MATCHES easmBLKFN)
+  endif()
 
   if(CMAKE_C_COMPILER MATCHES ccts OR CMAKE_CXX_COMPILER MATCHES ccts OR CMAKE_ASM_COMPILER MATCHES easmTS)
     if(NOT ADSP_PROCESSOR)
       set(ADSP_PROCESSOR "ADSP-TS101")
-    endif(NOT ADSP_PROCESSOR)
+    endif()
     set(ADSP_TS TRUE)
     set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/TS")
-  endif(CMAKE_C_COMPILER MATCHES ccts OR CMAKE_CXX_COMPILER MATCHES ccts OR CMAKE_ASM_COMPILER MATCHES easmTS)
+  endif()
 
   if(CMAKE_C_COMPILER MATCHES cc21k OR CMAKE_CXX_COMPILER MATCHES cc21k OR CMAKE_ASM_COMPILER MATCHES easm21k)
     if(NOT ADSP_PROCESSOR)
       set(ADSP_PROCESSOR "ADSP-21060")
-    endif(NOT ADSP_PROCESSOR)
+    endif()
     set(ADSP_21K TRUE)
 
     set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/21k")  # default if nothing matches
     if   (ADSP_PROCESSOR MATCHES "210..$")
       set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/21k")
-    endif(ADSP_PROCESSOR MATCHES "210..$")
+    endif()
 
     if   (ADSP_PROCESSOR MATCHES "211..$")
       set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/211k")
-    endif(ADSP_PROCESSOR MATCHES "211..$")
+    endif()
 
     if   (ADSP_PROCESSOR MATCHES "212..$")
       set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/212k")
-    endif(ADSP_PROCESSOR MATCHES "212..$")
+    endif()
 
     if   (ADSP_PROCESSOR MATCHES "213..$")
       set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/213k")
-    endif(ADSP_PROCESSOR MATCHES "213..$")
+    endif()
 
     set(_ADSP_FAMILY_DIR "${_ADSP_DIR}/21k")
-  endif(CMAKE_C_COMPILER MATCHES cc21k OR CMAKE_CXX_COMPILER MATCHES cc21k OR CMAKE_ASM_COMPILER MATCHES easm21k)
+  endif()
 
 
   link_directories("${_ADSP_FAMILY_DIR}/lib")
@@ -91,7 +91,7 @@ if(NOT ADSP)
       COMMAND ${ADSP_VDKGEN_EXECUTABLE} ${VDK_KERNEL_SUPPORT_FILE} -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -MM
       DEPENDS ${VDK_KERNEL_SUPPORT_FILE}
       )
-  endmacro(ADSP_GENERATE_VDK VDK_GENERATED_HEADER VDK_GENERATED_SOURCE VDK_KERNEL_SUPPORT_FILE)
+  endmacro()
 
   # loader support
   find_program( ADSP_ELFLOADER_EXECUTABLE elfloader "${_ADSP_FAMILY_DIR}" )
@@ -106,7 +106,7 @@ if(NOT ADSP)
       COMMAND ${ADSP_ELFLOADER_EXECUTABLE} ${EXECUTABLE_OUTPUT_PATH}/${TARGET_NAME}.dxe -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -b ${BOOT_MODE} -f ${FORMAT} -width ${WIDTH} -o ${EXECUTABLE_OUTPUT_PATH}/${TARGET_NAME}.ldr
       COMMENT "Building the loader file"
       )
-  endmacro(ADSP_CREATE_LOADER_FILE TARGET_NAME BOOT_MODE FORMAT WIDTH)
+  endmacro()
 
   macro(ADSP_CREATE_LOADER_FILE_INIT TARGET_NAME BOOT_MODE FORMAT WIDTH INITIALIZATION_FILE)
     add_custom_command(
@@ -115,6 +115,6 @@ if(NOT ADSP)
       COMMAND ${ADSP_ELFLOADER_EXECUTABLE} ${EXECUTABLE_OUTPUT_PATH}/${TARGET_NAME}.dxe -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -b ${BOOT_MODE} -f ${FORMAT} -width ${WIDTH} -o ${EXECUTABLE_OUTPUT_PATH}/${TARGET_NAME}.ldr -init ${INITIALIZATION_FILE}
       COMMENT "Building the loader file"
       )
-  endmacro(ADSP_CREATE_LOADER_FILE_INIT TARGET_NAME BOOT_MODE FORMAT WIDTH INITIALIZATION_FILE)
+  endmacro()
 
-endif(NOT ADSP)
+endif()
diff --git a/Modules/Platform/Generic-SDCC-C.cmake b/Modules/Platform/Generic-SDCC-C.cmake
index fc7eb42b8..588bf32d9 100644
--- a/Modules/Platform/Generic-SDCC-C.cmake
+++ b/Modules/Platform/Generic-SDCC-C.cmake
@@ -31,11 +31,11 @@ set(CMAKE_AR "${SDCCLIB_EXECUTABLE}" CACHE FILEPATH "The sdcc librarian" FORCE)
 # CMAKE_C_FLAGS_INIT and CMAKE_EXE_LINKER_FLAGS_INIT should be set in a CMAKE_SYSTEM_PROCESSOR file
 if(NOT DEFINED CMAKE_C_FLAGS_INIT)
   set(CMAKE_C_FLAGS_INIT "-mmcs51 --model-small")
-endif(NOT DEFINED CMAKE_C_FLAGS_INIT)
+endif()
 
 if(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_INIT)
   set (CMAKE_EXE_LINKER_FLAGS_INIT --model-small)
-endif(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_INIT)
+endif()
 
 # compile a C file into an object file
 set(CMAKE_C_COMPILE_OBJECT  "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
diff --git a/Modules/Platform/HP-UX.cmake b/Modules/Platform/HP-UX.cmake
index 33257f973..65cc7310d 100644
--- a/Modules/Platform/HP-UX.cmake
+++ b/Modules/Platform/HP-UX.cmake
@@ -38,13 +38,13 @@ list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
 foreach(type SHARED_LIBRARY SHARED_MODULE)
   set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-a archive")
   set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-a default")
-endforeach(type)
+endforeach()
 foreach(type EXE)
   set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-a,archive")
   set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-a,default")
-endforeach(type)
+endforeach()
 foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
   set(CMAKE_${type}_LINK_STATIC_CXX_FLAGS "-Wl,-a,archive")
   set(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS "-Wl,-a,default")
-endforeach(type)
+endforeach()
 
diff --git a/Modules/Platform/Haiku.cmake b/Modules/Platform/Haiku.cmake
index ec0b8fafb..8987783ff 100644
--- a/Modules/Platform/Haiku.cmake
+++ b/Modules/Platform/Haiku.cmake
@@ -21,4 +21,4 @@ list(APPEND CMAKE_SYSTEM_LIBRARY_PATH /boot/develop/lib/x86)
 if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
   set(CMAKE_INSTALL_PREFIX "/boot/common" CACHE PATH
     "Install path prefix, prepended onto install directories." FORCE)
-endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+endif()
diff --git a/Modules/Platform/IRIX.cmake b/Modules/Platform/IRIX.cmake
index 221a61df6..03e98ccfd 100644
--- a/Modules/Platform/IRIX.cmake
+++ b/Modules/Platform/IRIX.cmake
@@ -11,7 +11,7 @@ if(NOT CMAKE_COMPILER_IS_GNUCXX)
   set (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
   set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
   set (CMAKE_C_FLAGS_INIT "")
-endif(NOT CMAKE_COMPILER_IS_GNUCXX)
+endif()
 # set flags for gcc support
 include(Platform/UnixPaths)
 
@@ -21,7 +21,7 @@ if(NOT CMAKE_COMPILER_IS_GNUCC)
     "<CMAKE_C_COMPILER> <FLAGS> -S <SOURCE>"
     "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
     )
-endif(NOT CMAKE_COMPILER_IS_GNUCC)
+endif()
 
 if(NOT CMAKE_COMPILER_IS_GNUCXX)
   set (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
@@ -29,7 +29,7 @@ if(NOT CMAKE_COMPILER_IS_GNUCXX)
     "<CMAKE_CXX_COMPILER> <FLAGS> -S <SOURCE>"
     "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
     )
-endif(NOT CMAKE_COMPILER_IS_GNUCXX)
+endif()
 
 # Initialize C link type selection flags.  These flags are used when
 # building a shared library, shared module, or executable that links
@@ -38,7 +38,7 @@ endif(NOT CMAKE_COMPILER_IS_GNUCXX)
 foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
   set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
   set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
-endforeach(type)
+endforeach()
 
 # The IRIX linker needs to find transitive shared library dependencies
 # in the -L path.
diff --git a/Modules/Platform/IRIX64.cmake b/Modules/Platform/IRIX64.cmake
index 191dfcc20..5acbd81fa 100644
--- a/Modules/Platform/IRIX64.cmake
+++ b/Modules/Platform/IRIX64.cmake
@@ -14,13 +14,13 @@ if(NOT CMAKE_COMPILER_IS_GNUCC)
 
   # If no -o32, -n32, or -64 flag is given, set a reasonable default.
   if("$ENV{CFLAGS} $ENV{CXXFLAGS} $ENV{LDFLAGS}" MATCHES "-([no]32|64)")
-  else("$ENV{CFLAGS} $ENV{CXXFLAGS} $ENV{LDFLAGS}" MATCHES "-([no]32|64)")
+  else()
     # Check if this is a 64-bit CMake.
     if(CMAKE_FILE_SELF MATCHES "^CMAKE_FILE_SELF$")
       exec_program(file ARGS ${CMAKE_COMMAND} OUTPUT_VARIABLE CMAKE_FILE_SELF)
       set(CMAKE_FILE_SELF "${CMAKE_FILE_SELF}" CACHE INTERNAL
         "Output of file command on ${CMAKE_COMMAND}.")
-    endif(CMAKE_FILE_SELF MATCHES "^CMAKE_FILE_SELF$")
+    endif()
 
     # Set initial flags to match cmake executable.
     if(CMAKE_FILE_SELF MATCHES " 64-bit ")
@@ -30,8 +30,8 @@ if(NOT CMAKE_COMPILER_IS_GNUCC)
       set(CMAKE_EXE_LINKER_FLAGS_INIT "-64")
       set(CMAKE_SHARED_LINKER_FLAGS_INIT "-64")
       set(CMAKE_MODULE_LINKER_FLAGS_INIT "-64")
-    endif(CMAKE_FILE_SELF MATCHES " 64-bit ")
-  endif("$ENV{CFLAGS} $ENV{CXXFLAGS} $ENV{LDFLAGS}" MATCHES "-([no]32|64)")
+    endif()
+  endif()
 
   # Set remaining defaults.
   set(CMAKE_CXX_CREATE_STATIC_LIBRARY
@@ -40,7 +40,7 @@ if(NOT CMAKE_COMPILER_IS_GNUCC)
   set (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O3 -DNDEBUG")
   set (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
   set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
-endif(NOT CMAKE_COMPILER_IS_GNUCC)
+endif()
 include(Platform/UnixPaths)
 
 if(NOT CMAKE_COMPILER_IS_GNUCC)
@@ -49,7 +49,7 @@ if(NOT CMAKE_COMPILER_IS_GNUCC)
     "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE>"
     "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
     )
-endif(NOT CMAKE_COMPILER_IS_GNUCC)
+endif()
 
 if(NOT CMAKE_COMPILER_IS_GNUCXX)
   set (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
@@ -57,7 +57,7 @@ if(NOT CMAKE_COMPILER_IS_GNUCXX)
     "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -S <SOURCE>"
     "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
     )
-endif(NOT CMAKE_COMPILER_IS_GNUCXX)
+endif()
 
 # Initialize C link type selection flags.  These flags are used when
 # building a shared library, shared module, or executable that links
@@ -66,7 +66,7 @@ endif(NOT CMAKE_COMPILER_IS_GNUCXX)
 foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
   set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
   set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
-endforeach(type)
+endforeach()
 
 # The IRIX linker needs to find transitive shared library dependencies
 # in the -L path.
diff --git a/Modules/Platform/Linux-Intel.cmake b/Modules/Platform/Linux-Intel.cmake
index 47bf24659..2394f1050 100644
--- a/Modules/Platform/Linux-Intel.cmake
+++ b/Modules/Platform/Linux-Intel.cmake
@@ -28,7 +28,7 @@ if(NOT XIAR)
   endforeach()
   find_program(XIAR NAMES xiar HINTS ${_intel_xiar_hints})
   mark_as_advanced(XIAR)
-endif(NOT XIAR)
+endif()
 
 macro(__linux_compiler_intel lang)
   set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC")
diff --git a/Modules/Platform/Linux.cmake b/Modules/Platform/Linux.cmake
index c1dc6420b..fe8e0039f 100644
--- a/Modules/Platform/Linux.cmake
+++ b/Modules/Platform/Linux.cmake
@@ -16,7 +16,7 @@ set(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
 foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
   set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
   set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
-endforeach(type)
+endforeach()
 
 # Debian policy requires that shared libraries be installed without
 # executable permission.  Fedora policy requires that shared libraries
@@ -31,7 +31,7 @@ if(DEFINED CMAKE_INSTALL_SO_NO_EXE)
   # setting the user provides on the command line.
   set(CMAKE_INSTALL_SO_NO_EXE "${CMAKE_INSTALL_SO_NO_EXE}" CACHE INTERNAL
     "Install .so files without execute permission.")
-else(DEFINED CMAKE_INSTALL_SO_NO_EXE)
+else()
   # Store the decision variable as an internal cache entry to avoid
   # checking the platform every time.  This option is advanced enough
   # that only package maintainers should need to adjust it.  They are
@@ -39,11 +39,11 @@ else(DEFINED CMAKE_INSTALL_SO_NO_EXE)
   if(EXISTS "/etc/debian_version")
     set(CMAKE_INSTALL_SO_NO_EXE 1 CACHE INTERNAL
       "Install .so files without execute permission.")
-  else(EXISTS "/etc/debian_version")
+  else()
     set(CMAKE_INSTALL_SO_NO_EXE 0 CACHE INTERNAL
       "Install .so files without execute permission.")
-  endif(EXISTS "/etc/debian_version")
-endif(DEFINED CMAKE_INSTALL_SO_NO_EXE)
+  endif()
+endif()
 
 # Match multiarch library directory names.
 set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-linux-gnu[a-z0-9_]*")
@@ -54,4 +54,4 @@ include(Platform/UnixPaths)
 # searched.
 if(EXISTS "/etc/debian_version")
   set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
-endif(EXISTS "/etc/debian_version")
+endif()
diff --git a/Modules/Platform/MP-RAS.cmake b/Modules/Platform/MP-RAS.cmake
index ae5fa612e..fe8d81a1b 100644
--- a/Modules/Platform/MP-RAS.cmake
+++ b/Modules/Platform/MP-RAS.cmake
@@ -2,12 +2,12 @@ if(CMAKE_SYSTEM MATCHES "MP-RAS-02*.")
   set(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC)
   set(CMAKE_C_COMPILE_OPTIONS_PIE -K PIE)
   set(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
-else(CMAKE_SYSTEM MATCHES "MP-RAS-02*.")
+else()
   set(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC)
   set(CMAKE_C_COMPILE_OPTIONS_PIE -K PIE)
   set(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
   set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-Bexport")
-endif(CMAKE_SYSTEM MATCHES "MP-RAS-02*.")
+endif()
 
 include(Platform/UnixPaths)
 
diff --git a/Modules/Platform/NetBSD.cmake b/Modules/Platform/NetBSD.cmake
index 24dd15c7a..731827599 100644
--- a/Modules/Platform/NetBSD.cmake
+++ b/Modules/Platform/NetBSD.cmake
@@ -10,6 +10,6 @@ if(EXISTS /usr/include/dlfcn.h)
   set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
   set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
   set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
-endif(EXISTS /usr/include/dlfcn.h)
+endif()
 
 include(Platform/UnixPaths)
diff --git a/Modules/Platform/OSF1.cmake b/Modules/Platform/OSF1.cmake
index e720e4061..9c3255e36 100644
--- a/Modules/Platform/OSF1.cmake
+++ b/Modules/Platform/OSF1.cmake
@@ -1,14 +1,14 @@
 set(CMAKE_DL_LIBS "")
 
 if(CMAKE_SYSTEM MATCHES "OSF1-1.[012]")
-endif(CMAKE_SYSTEM MATCHES "OSF1-1.[012]")
+endif()
 if(CMAKE_SYSTEM MATCHES "OSF1-1.*")
   # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
   set(CMAKE_C_COMPILE_OPTIONS_PIC "-fpic")
   set(CMAKE_C_COMPILE_OPTIONS_PIE "-fpie")
   set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fpic")     # -pic
   set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-fpic")   # -pic
-endif(CMAKE_SYSTEM MATCHES "OSF1-1.*")
+endif()
 
 
 
@@ -16,22 +16,22 @@ if(CMAKE_SYSTEM MATCHES "OSF1-V.*")
   set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-expect_unresolved,\\*")       # -shared
   if(CMAKE_COMPILER_IS_GNUCXX)
     set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-Wl,-rpath,")
-  else(CMAKE_COMPILER_IS_GNUCXX)
+  else()
     set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-rpath ")
-  endif(CMAKE_COMPILER_IS_GNUCXX)
+  endif()
   if(CMAKE_COMPILER_IS_GNUCC)
     set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
-  else(CMAKE_COMPILER_IS_GNUCC)
+  else()
     set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-rpath ")
-  endif(CMAKE_COMPILER_IS_GNUCC)
+  endif()
   set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
-endif(CMAKE_SYSTEM MATCHES "OSF1-V.*")
+endif()
 
 set(CMAKE_MAKE_INCLUDE_FROM_ROOT 1) # include $(CMAKE_BINARY_DIR)/...
 
 if(CMAKE_COMPILER_IS_GNUCXX)
   # include the gcc flags
-else (CMAKE_COMPILER_IS_GNUCXX)
+else ()
   # use default OSF compiler flags
   set (CMAKE_C_FLAGS_INIT "")
   set (CMAKE_C_FLAGS_DEBUG_INIT "-g")
@@ -43,5 +43,5 @@ else (CMAKE_COMPILER_IS_GNUCXX)
   set (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O2 -DNDEBUG")
   set (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
   set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
-endif(CMAKE_COMPILER_IS_GNUCXX)
+endif()
 include(Platform/UnixPaths)
diff --git a/Modules/Platform/QNX.cmake b/Modules/Platform/QNX.cmake
index fedc0b41b..2598411cd 100644
--- a/Modules/Platform/QNX.cmake
+++ b/Modules/Platform/QNX.cmake
@@ -25,7 +25,7 @@ set(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
 foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
   set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
   set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
-endforeach(type)
+endforeach()
 # force the language to be c++ since qnx only has gcc and not g++ and c++?
 set(CMAKE_CXX_COMPILE_OBJECT
   "<CMAKE_CXX_COMPILER> -x c++ <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
diff --git a/Modules/Platform/SunOS.cmake b/Modules/Platform/SunOS.cmake
index a1fc72f20..da20f97a1 100644
--- a/Modules/Platform/SunOS.cmake
+++ b/Modules/Platform/SunOS.cmake
@@ -5,23 +5,23 @@ if(CMAKE_SYSTEM MATCHES "SunOS-4.*")
    set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-r")
    set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-R")
    set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
-endif(CMAKE_SYSTEM MATCHES "SunOS-4.*")
+endif()
 
 if(CMAKE_COMPILER_IS_GNUCXX)
   if(CMAKE_COMPILER_IS_GNUCC)
     set(CMAKE_CXX_CREATE_SHARED_LIBRARY
         "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS>  <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
-  else(CMAKE_COMPILER_IS_GNUCC)
+  else()
     # Take default rule from CMakeDefaultMakeRuleVariables.cmake.
-  endif(CMAKE_COMPILER_IS_GNUCC)
-endif(CMAKE_COMPILER_IS_GNUCXX)
+  endif()
+endif()
 include(Platform/UnixPaths)
 
 # Add the compiler's implicit link directories.
 if("${CMAKE_C_COMPILER_ID} ${CMAKE_CXX_COMPILER_ID}" MATCHES SunPro)
   list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
     /opt/SUNWspro/lib /opt/SUNWspro/prod/lib /usr/ccs/lib)
-endif("${CMAKE_C_COMPILER_ID} ${CMAKE_CXX_COMPILER_ID}" MATCHES SunPro)
+endif()
 
 # The Sun linker needs to find transitive shared library dependencies
 # in the -L path.
diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake
index 4a37eca87..50ba80ba6 100644
--- a/Modules/Platform/Windows-GNU.cmake
+++ b/Modules/Platform/Windows-GNU.cmake
@@ -74,7 +74,7 @@ macro(__windows_compiler_gnu lang)
     foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
       set(CMAKE_${type}_LINK_STATIC_${lang}_FLAGS "-Wl,-Bstatic")
       set(CMAKE_${type}_LINK_DYNAMIC_${lang}_FLAGS "-Wl,-Bdynamic")
-    endforeach(type)
+    endforeach()
   endif()
 
   # No -fPIC on Windows
diff --git a/Modules/Platform/Windows-Intel.cmake b/Modules/Platform/Windows-Intel.cmake
index ec78886e1..337055742 100644
--- a/Modules/Platform/Windows-Intel.cmake
+++ b/Modules/Platform/Windows-Intel.cmake
@@ -27,9 +27,9 @@ set(CMAKE_LINK_LIBRARY_FLAG "")
 set(WIN32 1)
 if(CMAKE_VERBOSE_MAKEFILE)
   set(CMAKE_CL_NOLOGO)
-else(CMAKE_VERBOSE_MAKEFILE)
+else()
   set(CMAKE_CL_NOLOGO "/nologo")
-endif(CMAKE_VERBOSE_MAKEFILE)
+endif()
 set(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
 set(CMAKE_CREATE_WIN32_EXE /subsystem:windows)
 set(CMAKE_CREATE_CONSOLE_EXE /subsystem:console)
@@ -69,15 +69,15 @@ if(NOT _INTEL_XILINK_TEST_RUN)
     OUTPUT_VARIABLE _XILINK_HELP)
   if(_XILINK_HELP MATCHES MANIFEST)
     set(_INTEL_COMPILER_SUPPORTS_MANIFEST 1)
-  endif(_XILINK_HELP MATCHES MANIFEST)
+  endif()
   if(NOT  EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake")
     file(WRITE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake
       "
 set(_INTEL_XILINK_TEST_RUN 1)
 set(_INTEL_COMPILER_SUPPORTS_MANIFEST ${_INTEL_COMPILER_SUPPORTS_MANIFEST})
 ")
-  endif(NOT  EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake")
-endif(NOT _INTEL_XILINK_TEST_RUN)
+  endif()
+endif()
 
 macro(__windows_compiler_intel lang)
   set(CMAKE_${lang}_COMPILE_OBJECT
diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake
index 216419f78..05df9467a 100644
--- a/Modules/Platform/Windows-cl.cmake
+++ b/Modules/Platform/Windows-cl.cmake
@@ -12,17 +12,17 @@ set(CMAKE_CREATE_CONSOLE_EXE /subsystem:console)
 
 if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
    set (CMAKE_NO_BUILD_TYPE 1)
-endif(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(NOT CMAKE_NO_BUILD_TYPE AND CMAKE_GENERATOR MATCHES "Visual Studio")
+endif()
 # does the compiler support pdbtype and is it the newer compiler
 if(CMAKE_GENERATOR MATCHES  "Visual Studio 8")
   set(CMAKE_COMPILER_2005 1)
-endif(CMAKE_GENERATOR MATCHES  "Visual Studio 8")
+endif()
 
 # make sure to enable languages after setting configuration types
 enable_language(RC)
@@ -48,7 +48,7 @@ if(CMAKE_GENERATOR MATCHES "Makefiles" OR CMAKE_GENERATOR MATCHES "Ninja")
     set(CMAKE_TEST_COMPILER ${CMAKE_C_COMPILER})
     if (NOT CMAKE_C_COMPILER)
       set(CMAKE_TEST_COMPILER ${CMAKE_CXX_COMPILER})
-    endif(NOT CMAKE_C_COMPILER)
+    endif()
     exec_program(${CMAKE_TEST_COMPILER}
       ARGS /nologo -EP \"${testNmakeCLVersionFile}\"
       OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT
@@ -70,32 +70,32 @@ if(CMAKE_GENERATOR MATCHES "Makefiles" OR CMAKE_GENERATOR MATCHES "Ninja")
       if("${compilerVersion}" LESS 1300)
         set(MSVC60 1)
         set(CMAKE_COMPILER_SUPPORTS_PDBTYPE 1)
-      endif("${compilerVersion}" LESS 1300)
+      endif()
       if("${compilerVersion}" EQUAL 1300)
         set(MSVC70 1)
         set(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0)
-      endif("${compilerVersion}" EQUAL 1300)
+      endif()
       if("${compilerVersion}" EQUAL 1310)
         set(MSVC71 1)
         set(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0)
-      endif("${compilerVersion}" EQUAL 1310)
+      endif()
       if("${compilerVersion}" EQUAL 1400)
         set(MSVC80 1)
         set(CMAKE_COMPILER_2005 1)
-      endif("${compilerVersion}" EQUAL 1400)
+      endif()
       if("${compilerVersion}" EQUAL 1500)
         set(MSVC90 1)
-      endif("${compilerVersion}" EQUAL 1500)
+      endif()
       if("${compilerVersion}" EQUAL 1600)
         set(MSVC10 1)
-      endif("${compilerVersion}" EQUAL 1600)
+      endif()
       set(MSVC_VERSION "${compilerVersion}")
-    else(NOT CMAKE_COMPILER_RETURN)
+    else()
       message(STATUS "Check for CL compiler version - failed")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining the version of compiler failed with the following output:\n"
         "${CMAKE_COMPILER_OUTPUT}\n\n")
-    endif(NOT CMAKE_COMPILER_RETURN)
+    endif()
     # try to figure out if we are running the free command line
     # tools from Microsoft.  These tools do not provide debug libraries,
     # so the link flags used have to be different.
@@ -116,25 +116,25 @@ if(CMAKE_GENERATOR MATCHES "Makefiles" OR CMAKE_GENERATOR MATCHES "Ninja")
         "${CMAKE_COMPILER_OUTPUT}\n\n")
       message(STATUS "Check if this is a free VC compiler - yes")
       set(CMAKE_USING_VC_FREE_TOOLS 1)
-    else(CMAKE_COMPILER_RETURN)
+    else()
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if this is a free VC compiler passed with the following output:\n"
         "${CMAKE_COMPILER_OUTPUT}\n\n")
       message(STATUS "Check if this is a free VC compiler - no")
       set(CMAKE_USING_VC_FREE_TOOLS 0)
-    endif(CMAKE_COMPILER_RETURN)
+    endif()
     make_directory("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3")
-  endif(NOT CMAKE_VC_COMPILER_TESTS_RUN)
-endif(CMAKE_GENERATOR MATCHES "Makefiles" OR CMAKE_GENERATOR MATCHES "Ninja")
+  endif()
+endif()
 
 if(MSVC_C_ARCHITECTURE_ID MATCHES 64)
   set(CMAKE_CL_64 1)
-else(MSVC_C_ARCHITECTURE_ID MATCHES 64)
+else()
   set(CMAKE_CL_64 0)
-endif(MSVC_C_ARCHITECTURE_ID MATCHES 64)
+endif()
 if(CMAKE_FORCE_WIN64 OR CMAKE_FORCE_IA64)
   set(CMAKE_CL_64 1)
-endif(CMAKE_FORCE_WIN64 OR CMAKE_FORCE_IA64)
+endif()
 
 if("${MSVC_VERSION}" GREATER 1599)
   set(MSVC_INCREMENTAL_DEFAULT ON)
@@ -165,7 +165,7 @@ if(MSVC_VERSION GREATER 1310)
   set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
   set (CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ")
   set (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT}")
-else(MSVC_VERSION GREATER 1310)
+else()
   if(CMAKE_USING_VC_FREE_TOOLS)
     message(STATUS "Using FREE VC TOOLS, NO DEBUG available")
     set(CMAKE_BUILD_TYPE_INIT Release)
@@ -179,7 +179,7 @@ else(MSVC_VERSION GREATER 1310)
     set (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MT /O1 /Ob1 /D NDEBUG")
     set (CMAKE_C_FLAGS_RELEASE_INIT "/MT /O2 /Ob2 /D NDEBUG")
     set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2 /Ob1 /D NDEBUG")
-  else(CMAKE_USING_VC_FREE_TOOLS)
+  else()
     set(CMAKE_BUILD_TYPE_INIT Debug)
     set (CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR")
     set (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi  /Ob0 /Od /GZ")
@@ -191,9 +191,9 @@ else(MSVC_VERSION GREATER 1310)
     set (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
     set (CMAKE_C_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
     set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
-  endif(CMAKE_USING_VC_FREE_TOOLS)
+  endif()
   set (CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib")
-endif(MSVC_VERSION GREATER 1310)
+endif()
 
 set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
 
@@ -203,7 +203,7 @@ set (CMAKE_LINK_DEF_FILE_FLAG "/DEF:")
 set(_MACHINE_ARCH_FLAG ${MSVC_C_ARCHITECTURE_ID})
 if(NOT _MACHINE_ARCH_FLAG)
   set(_MACHINE_ARCH_FLAG ${MSVC_CXX_ARCHITECTURE_ID})
-endif(NOT _MACHINE_ARCH_FLAG)
+endif()
 set (CMAKE_EXE_LINKER_FLAGS_INIT
     "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:${_MACHINE_ARCH_FLAG}")
 
@@ -219,10 +219,10 @@ endif()
 if (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
   set (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /pdbtype:sept ${MSVC_INCREMENTAL_YES_FLAG}")
   set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /pdbtype:sept ${MSVC_INCREMENTAL_YES_FLAG}")
-else (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
+else ()
   set (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug ${MSVC_INCREMENTAL_YES_FLAG}")
   set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug ${MSVC_INCREMENTAL_YES_FLAG}")
-endif (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
+endif ()
 # for release and minsize release default to no incremental linking
 set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT "/INCREMENTAL:NO")
 set(CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT "/INCREMENTAL:NO")
@@ -245,9 +245,9 @@ set (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT ${CMAKE_EXE_LINKER_FLAGS_MINSIZER
 if(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake")
   configure_file(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake.in
     ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCPlatform.cmake IMMEDIATE)
-endif(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake")
+endif()
 
 if(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake")
   configure_file(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake.in
                ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXPlatform.cmake IMMEDIATE)
-endif(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake")
+endif()
diff --git a/Modules/Platform/Windows-df.cmake b/Modules/Platform/Windows-df.cmake
index dff58c575..9a87be177 100644
--- a/Modules/Platform/Windows-df.cmake
+++ b/Modules/Platform/Windows-df.cmake
@@ -6,9 +6,9 @@ set(CMAKE_LINK_LIBRARY_FLAG "")
 set(WIN32 1)
 if(CMAKE_VERBOSE_MAKEFILE)
   set(CMAKE_CL_NOLOGO)
-else(CMAKE_VERBOSE_MAKEFILE)
+else()
   set(CMAKE_CL_NOLOGO "/nologo")
-endif(CMAKE_VERBOSE_MAKEFILE)
+endif()
 
 set(CMAKE_Fortran_MODDIR_FLAG "-module:")
 
@@ -34,12 +34,12 @@ set(CMAKE_CREATE_CONSOLE_EXE )
 
 if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
    set (CMAKE_NO_BUILD_TYPE 1)
-endif(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(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8")
+endif()
 # does the compiler support pdbtype and is it the newer compiler
 
 set(CMAKE_BUILD_TYPE_INIT Debug)
@@ -57,10 +57,10 @@ set (CMAKE_EXE_LINKER_FLAGS_INIT " /INCREMENTAL:YES")
 if (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
   set (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /pdbtype:sept")
   set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /pdbtype:sept")
-else (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
+else ()
   set (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug")
   set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug")
-endif (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
+endif ()
 
 set (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT})
 set (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
diff --git a/Modules/Platform/Windows-wcl386.cmake b/Modules/Platform/Windows-wcl386.cmake
index 977531d44..8a03b2972 100644
--- a/Modules/Platform/Windows-wcl386.cmake
+++ b/Modules/Platform/Windows-wcl386.cmake
@@ -6,11 +6,11 @@ if(CMAKE_VERBOSE_MAKEFILE)
   set(CMAKE_WCL_QUIET)
   set(CMAKE_WLINK_QUIET)
   set(CMAKE_LIB_QUIET)
-else(CMAKE_VERBOSE_MAKEFILE)
+else()
   set(CMAKE_WCL_QUIET "-zq")
   set(CMAKE_WLINK_QUIET "option quiet")
   set(CMAKE_LIB_QUIET "-q")
-endif(CMAKE_VERBOSE_MAKEFILE)
+endif()
 
 set(CMAKE_CREATE_WIN32_EXE "system nt_win" )
 set(CMAKE_CREATE_CONSOLE_EXE "system nt" )
diff --git a/Modules/Platform/Windows.cmake b/Modules/Platform/Windows.cmake
index 9481baa8e..b158a9dfb 100644
--- a/Modules/Platform/Windows.cmake
+++ b/Modules/Platform/Windows.cmake
@@ -18,14 +18,14 @@ set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
 if(CMAKE_GENERATOR MATCHES "Borland")
   set(CMAKE_START_TEMP_FILE "@&&|\n")
   set(CMAKE_END_TEMP_FILE "\n|")
-endif(CMAKE_GENERATOR MATCHES "Borland")
+endif()
 
 # for nmake make long command lines are redirected to a file
 # with the following syntax, see Windows-bcc32.cmake for use
 if(CMAKE_GENERATOR MATCHES "NMake")
   set(CMAKE_START_TEMP_FILE "@<<\n")
   set(CMAKE_END_TEMP_FILE "\n<<")
-endif(CMAKE_GENERATOR MATCHES "NMake")
+endif()
 
 include(Platform/WindowsPaths)
 
diff --git a/Modules/Platform/cl.cmake b/Modules/Platform/cl.cmake
index c8dc02563..9e4d6070e 100644
--- a/Modules/Platform/cl.cmake
+++ b/Modules/Platform/cl.cmake
@@ -8,13 +8,13 @@ set(MSVC 1)
 # hardcode CMAKE_LINKER here to link, so it behaves as it did before, Alex
 if(NOT DEFINED CMAKE_LINKER)
    set(CMAKE_LINKER link)
-endif(NOT DEFINED CMAKE_LINKER)
+endif()
 
 if(CMAKE_VERBOSE_MAKEFILE)
   set(CMAKE_CL_NOLOGO)
-else(CMAKE_VERBOSE_MAKEFILE)
+else()
   set(CMAKE_CL_NOLOGO "/nologo")
-endif(CMAKE_VERBOSE_MAKEFILE)
+endif()
 # create a shared C++ library
 set(CMAKE_CXX_CREATE_SHARED_LIBRARY
   "<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
diff --git a/Modules/Platform/eCos.cmake b/Modules/Platform/eCos.cmake
index c839b0ebb..a20382692 100644
--- a/Modules/Platform/eCos.cmake
+++ b/Modules/Platform/eCos.cmake
@@ -30,10 +30,10 @@ include(Platform/UnixPaths)
 get_property(_IN_TC GLOBAL PROPERTY IN_TRY_COMPILE)
 if(CMAKE_C_COMPILER AND NOT  "${CMAKE_C_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC)
   message(FATAL_ERROR "GNU gcc is required for eCos")
-endif(CMAKE_C_COMPILER AND NOT  "${CMAKE_C_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC)
+endif()
 if(CMAKE_CXX_COMPILER AND NOT  "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC)
   message(FATAL_ERROR "GNU g++ is required for eCos")
-endif(CMAKE_CXX_COMPILER AND NOT  "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC)
+endif()
 
 # find eCos system files
 find_path(ECOS_SYSTEM_CONFIG_HEADER_PATH NAMES pkgconf/system.h)
@@ -41,11 +41,11 @@ find_library(ECOS_SYSTEM_TARGET_LIBRARY NAMES libtarget.a)
 
 if(NOT ECOS_SYSTEM_CONFIG_HEADER_PATH)
   message(FATAL_ERROR "Could not find eCos pkgconf/system.h. Build eCos first and set up CMAKE_FIND_ROOT_PATH correctly.")
-endif(NOT ECOS_SYSTEM_CONFIG_HEADER_PATH)
+endif()
 
 if(NOT ECOS_SYSTEM_TARGET_LIBRARY)
   message(FATAL_ERROR "Could not find eCos \"libtarget.a\". Build eCos first and set up CMAKE_FIND_ROOT_PATH correctly.")
-endif(NOT ECOS_SYSTEM_TARGET_LIBRARY)
+endif()
 
 get_filename_component(ECOS_LIBTARGET_DIRECTORY "${ECOS_SYSTEM_TARGET_LIBRARY}" PATH)
 include_directories(${ECOS_SYSTEM_CONFIG_HEADER_PATH})
diff --git a/Modules/Platform/gas.cmake b/Modules/Platform/gas.cmake
index 6ac3b559f..7d2bc8454 100644
--- a/Modules/Platform/gas.cmake
+++ b/Modules/Platform/gas.cmake
@@ -1,8 +1,8 @@
 if(UNIX)
   set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .o)
-else(UNIX)
+else()
   set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .obj)
-endif(UNIX)
+endif()
 
 set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> -o <OBJECT> <SOURCE>")
 
diff --git a/Modules/Platform/syllable.cmake b/Modules/Platform/syllable.cmake
index 50c695f66..69c108db0 100644
--- a/Modules/Platform/syllable.cmake
+++ b/Modules/Platform/syllable.cmake
@@ -25,7 +25,7 @@ set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
 foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
   set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
   set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
-endforeach(type)
+endforeach()
 
 include(Platform/UnixPaths)
 
diff --git a/Modules/Qt4ConfigDependentSettings.cmake b/Modules/Qt4ConfigDependentSettings.cmake
index 2a7a1ce7d..6db5da18a 100644
--- a/Modules/Qt4ConfigDependentSettings.cmake
+++ b/Modules/Qt4ConfigDependentSettings.cmake
@@ -38,31 +38,31 @@ if(Q_WS_WIN)
   # On Windows, qconfig.pri has "shared" for shared library builds
   if(NOT QT_CONFIG MATCHES "shared")
     set(QT_IS_STATIC 1)
-  endif(NOT QT_CONFIG MATCHES "shared")
-else(Q_WS_WIN)
+  endif()
+else()
   # On other platforms, check file extension to know if its static
   if(QT_QTCORE_LIBRARY_RELEASE)
     get_filename_component(qtcore_lib_ext "${QT_QTCORE_LIBRARY_RELEASE}" EXT)
     if("${qtcore_lib_ext}" STREQUAL "${CMAKE_STATIC_LIBRARY_SUFFIX}")
       set(QT_IS_STATIC 1)
-    endif("${qtcore_lib_ext}" STREQUAL "${CMAKE_STATIC_LIBRARY_SUFFIX}")
-  endif(QT_QTCORE_LIBRARY_RELEASE)
+    endif()
+  endif()
   if(QT_QTCORE_LIBRARY_DEBUG)
     get_filename_component(qtcore_lib_ext "${QT_QTCORE_LIBRARY_DEBUG}" EXT)
     if(${qtcore_lib_ext} STREQUAL ${CMAKE_STATIC_LIBRARY_SUFFIX})
       set(QT_IS_STATIC 1)
-    endif(${qtcore_lib_ext} STREQUAL ${CMAKE_STATIC_LIBRARY_SUFFIX})
-  endif(QT_QTCORE_LIBRARY_DEBUG)
-endif(Q_WS_WIN)
+    endif()
+  endif()
+endif()
 
 # build using shared Qt needs -DQT_DLL on Windows
 if(Q_WS_WIN  AND  NOT QT_IS_STATIC)
   set(QT_DEFINITIONS ${QT_DEFINITIONS} -DQT_DLL)
-endif(Q_WS_WIN  AND  NOT QT_IS_STATIC)
+endif()
 
 if(NOT QT_IS_STATIC)
   return()
-endif(NOT QT_IS_STATIC)
+endif()
 
 # QtOpenGL dependencies
 find_package(OpenGL)
@@ -73,86 +73,86 @@ set (QT_QTOPENGL_LIB_DEPENDENCIES ${OPENGL_glu_LIBRARY} ${OPENGL_gl_LIBRARY})
 if(QT_QCONFIG MATCHES "system-png")
   find_package(PNG)
   set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${PNG_LIBRARY})
-endif(QT_QCONFIG MATCHES "system-png")
+endif()
 
 ## system jpeg
 if(QT_QCONFIG MATCHES "system-jpeg")
   find_package(JPEG)
   set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${JPEG_LIBRARIES})
-endif(QT_QCONFIG MATCHES "system-jpeg")
+endif()
 
 ## system tiff
 if(QT_QCONFIG MATCHES "system-tiff")
   find_package(TIFF)
   set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${TIFF_LIBRARIES})
-endif(QT_QCONFIG MATCHES "system-tiff")
+endif()
 
 ## system mng
 if(QT_QCONFIG MATCHES "system-mng")
   find_library(MNG_LIBRARY NAMES mng)
   set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${MNG_LIBRARY})
-endif(QT_QCONFIG MATCHES "system-mng")
+endif()
 
 # for X11, get X11 library directory
 if(Q_WS_X11)
   find_package(X11)
-endif(Q_WS_X11)
+endif()
 
 
 ## X11 SM
 if(QT_QCONFIG MATCHES "x11sm")
   if(X11_SM_LIB AND X11_ICE_LIB)
     set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_SM_LIB} ${X11_ICE_LIB})
-  endif(X11_SM_LIB AND X11_ICE_LIB)
-endif(QT_QCONFIG MATCHES "x11sm")
+  endif()
+endif()
 
 
 ## Xi
 if(QT_QCONFIG MATCHES "tablet")
   if(X11_Xi_LIB)
     set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xi_LIB})
-  endif(X11_Xi_LIB)
-endif(QT_QCONFIG MATCHES "tablet")
+  endif()
+endif()
 
 
 ## Xrender
 if(QT_QCONFIG MATCHES "xrender")
   if(X11_Xrender_LIB)
     set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xrender_LIB})
-  endif(X11_Xrender_LIB)
-endif(QT_QCONFIG MATCHES "xrender")
+  endif()
+endif()
 
 
 ## Xrandr
 if(QT_QCONFIG MATCHES "xrandr")
   if(X11_Xrandr_LIB)
     set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xrandr_LIB})
-  endif(X11_Xrandr_LIB)
-endif(QT_QCONFIG MATCHES "xrandr")
+  endif()
+endif()
 
 
 ## Xcursor
 if(QT_QCONFIG MATCHES "xcursor")
   if(X11_Xcursor_LIB)
     set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xcursor_LIB})
-  endif(X11_Xcursor_LIB)
-endif(QT_QCONFIG MATCHES "xcursor")
+  endif()
+endif()
 
 
 ## Xinerama
 if(QT_QCONFIG MATCHES "xinerama")
   if(X11_Xinerama_LIB)
     set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xinerama_LIB})
-  endif(X11_Xinerama_LIB)
-endif(QT_QCONFIG MATCHES "xinerama")
+  endif()
+endif()
 
 
 ## Xfixes
 if(QT_QCONFIG MATCHES "xfixes")
   if(X11_Xfixes_LIB)
     set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xfixes_LIB})
-  endif(X11_Xfixes_LIB)
-endif(QT_QCONFIG MATCHES "xfixes")
+  endif()
+endif()
 
 
 ## fontconfig
@@ -161,8 +161,8 @@ if(QT_QCONFIG MATCHES "fontconfig")
   mark_as_advanced(QT_FONTCONFIG_LIBRARY)
   if(QT_FONTCONFIG_LIBRARY)
     set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_FONTCONFIG_LIBRARY})
-  endif(QT_FONTCONFIG_LIBRARY)
-endif(QT_QCONFIG MATCHES "fontconfig")
+  endif()
+endif()
 
 
 ## system-freetype
@@ -170,15 +170,15 @@ if(QT_QCONFIG MATCHES "system-freetype")
   find_package(Freetype)
   if(FREETYPE_LIBRARIES)
     set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${FREETYPE_LIBRARIES})
-  endif(FREETYPE_LIBRARIES)
-endif(QT_QCONFIG MATCHES "system-freetype")
+  endif()
+endif()
 
 
 ## system-zlib
 if(QT_QCONFIG MATCHES "system-zlib")
   find_package(ZLIB)
   set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${ZLIB_LIBRARIES})
-endif(QT_QCONFIG MATCHES "system-zlib")
+endif()
 
 
 ## openssl
@@ -186,17 +186,17 @@ if(NOT Q_WS_WIN)
   set(_QT_NEED_OPENSSL 0)
   if(QT_VERSION_MINOR LESS 4 AND QT_QCONFIG MATCHES "openssl")
     set(_QT_NEED_OPENSSL 1)
-  endif(QT_VERSION_MINOR LESS 4 AND QT_QCONFIG MATCHES "openssl")
+  endif()
   if(QT_VERSION_MINOR GREATER 3 AND QT_QCONFIG MATCHES "openssl-linked")
     set(_QT_NEED_OPENSSL 1)
-  endif(QT_VERSION_MINOR GREATER 3 AND QT_QCONFIG MATCHES "openssl-linked")
+  endif()
   if(_QT_NEED_OPENSSL)
     find_package(OpenSSL)
     if(OPENSSL_LIBRARIES)
       set(QT_QTNETWORK_LIB_DEPENDENCIES ${QT_QTNETWORK_LIB_DEPENDENCIES} ${OPENSSL_LIBRARIES})
-    endif(OPENSSL_LIBRARIES)
-  endif(_QT_NEED_OPENSSL)
-endif(NOT Q_WS_WIN)
+    endif()
+  endif()
+endif()
 
 
 ## dbus
@@ -205,10 +205,10 @@ if(QT_QCONFIG MATCHES "dbus")
   find_library(QT_DBUS_LIBRARY NAMES dbus-1 )
   if(QT_DBUS_LIBRARY)
     set(QT_QTDBUS_LIB_DEPENDENCIES ${QT_QTDBUS_LIB_DEPENDENCIES} ${QT_DBUS_LIBRARY})
-  endif(QT_DBUS_LIBRARY)
+  endif()
   mark_as_advanced(QT_DBUS_LIBRARY)
 
-endif(QT_QCONFIG MATCHES "dbus")
+endif()
 
 
 ## glib
@@ -223,7 +223,7 @@ if(QT_QCONFIG MATCHES "glib")
   if(QT_GLIB_LIBRARY AND QT_GTHREAD_LIBRARY)
     set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES}
         ${QT_GTHREAD_LIBRARY} ${QT_GLIB_LIBRARY})
-  endif(QT_GLIB_LIBRARY AND QT_GTHREAD_LIBRARY)
+  endif()
 
 
   # Qt 4.5+ also links to gobject-2.0
@@ -234,10 +234,10 @@ if(QT_QCONFIG MATCHES "glib")
      if(QT_GOBJECT_LIBRARY)
        set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES}
            ${QT_GOBJECT_LIBRARY})
-     endif(QT_GOBJECT_LIBRARY)
-  endif(QT_VERSION_MINOR GREATER 4)
+     endif()
+  endif()
 
-endif(QT_QCONFIG MATCHES "glib")
+endif()
 
 
 ## clock-monotonic, just see if we need to link with rt
@@ -251,9 +251,9 @@ if(QT_QCONFIG MATCHES "clock-monotonic")
     mark_as_advanced(QT_RT_LIBRARY)
     if(QT_RT_LIBRARY)
       set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${QT_RT_LIBRARY})
-    endif(QT_RT_LIBRARY)
-  endif(QT_POSIX_TIMERS)
-endif(QT_QCONFIG MATCHES "clock-monotonic")
+    endif()
+  endif()
+endif()
 
 
 if(Q_WS_X11)
@@ -264,17 +264,17 @@ if(Q_WS_X11)
   find_package(Threads)
   if(CMAKE_USE_PTHREADS_INIT)
     set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${CMAKE_THREAD_LIBS_INIT})
-  endif(CMAKE_USE_PTHREADS_INIT)
+  endif()
 
   set (QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${CMAKE_DL_LIBS})
 
-endif(Q_WS_X11)
+endif()
 
 
 if(Q_WS_WIN)
   set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} imm32 winmm)
   set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ws2_32)
-endif(Q_WS_WIN)
+endif()
 
 
 if(Q_WS_MAC)
@@ -283,13 +283,13 @@ if(Q_WS_MAC)
   # Qt 4.0, 4.1, 4.2 use QuickTime
   if(QT_VERSION_MINOR LESS 3)
     set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-framework QuickTime")
-  endif(QT_VERSION_MINOR LESS 3)
+  endif()
 
   # Qt 4.2+ use AppKit
   if(QT_VERSION_MINOR GREATER 1)
     set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-framework AppKit")
-  endif(QT_VERSION_MINOR GREATER 1)
+  endif()
 
   set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} "-framework ApplicationServices")
-endif(Q_WS_MAC)
+endif()
 
diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake
index 1e19ff292..4324347e5 100644
--- a/Modules/Qt4Macros.cmake
+++ b/Modules/Qt4Macros.cmake
@@ -28,15 +28,15 @@ macro (QT4_EXTRACT_OPTIONS _qt4_files _qt4_options)
   foreach(_currentArg ${ARGN})
     if ("${_currentArg}" STREQUAL "OPTIONS")
       set(_QT4_DOING_OPTIONS TRUE)
-    else ("${_currentArg}" STREQUAL "OPTIONS")
+    else ()
       if(_QT4_DOING_OPTIONS)
         list(APPEND ${_qt4_options} "${_currentArg}")
-      else(_QT4_DOING_OPTIONS)
+      else()
         list(APPEND ${_qt4_files} "${_currentArg}")
-      endif(_QT4_DOING_OPTIONS)
-    endif ("${_currentArg}" STREQUAL "OPTIONS")
-  endforeach(_currentArg)
-endmacro (QT4_EXTRACT_OPTIONS)
+      endif()
+    endif ()
+  endforeach()
+endmacro ()
 
 
 # macro used to create the names of output files preserving relative dirs
@@ -48,22 +48,22 @@ macro (QT4_MAKE_OUTPUT_FILE infile prefix ext outfile )
     string(SUBSTRING "${infile}" 0 ${_binlength} _checkinfile)
     if(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
       file(RELATIVE_PATH rel ${CMAKE_CURRENT_BINARY_DIR} ${infile})
-    else(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
+    else()
       file(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
-    endif(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
-  else(_infileLength GREATER _binlength)
+    endif()
+  else()
     file(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
-  endif(_infileLength GREATER _binlength)
+  endif()
   if(WIN32 AND rel MATCHES "^[a-zA-Z]:") # absolute path
     string(REGEX REPLACE "^([a-zA-Z]):(.*)$" "\\1_\\2" rel "${rel}")
-  endif(WIN32 AND rel MATCHES "^[a-zA-Z]:")
+  endif()
   set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}")
   string(REPLACE ".." "__" _outfile ${_outfile})
   get_filename_component(outpath ${_outfile} PATH)
   get_filename_component(_outfile ${_outfile} NAME_WE)
   file(MAKE_DIRECTORY ${outpath})
   set(${outfile} ${outpath}/${prefix}${_outfile}.${ext})
-endmacro (QT4_MAKE_OUTPUT_FILE )
+endmacro ()
 
 
 macro (QT4_GET_MOC_FLAGS _moc_flags)
@@ -74,21 +74,21 @@ macro (QT4_GET_MOC_FLAGS _moc_flags)
     if("${_current}" MATCHES "\\.framework/?$")
       string(REGEX REPLACE "/[^/]+\\.framework" "" framework_path "${_current}")
       set(${_moc_flags} ${${_moc_flags}} "-F${framework_path}")
-    else("${_current}" MATCHES "\\.framework/?$")
+    else()
       set(${_moc_flags} ${${_moc_flags}} "-I${_current}")
-    endif("${_current}" MATCHES "\\.framework/?$")
-  endforeach(_current ${_inc_DIRS})
+    endif()
+  endforeach()
 
   get_directory_property(_defines COMPILE_DEFINITIONS)
   foreach(_current ${_defines})
     set(${_moc_flags} ${${_moc_flags}} "-D${_current}")
-  endforeach(_current ${_defines})
+  endforeach()
 
   if(Q_WS_WIN)
     set(${_moc_flags} ${${_moc_flags}} -DWIN32)
-  endif(Q_WS_WIN)
+  endif()
 
-endmacro(QT4_GET_MOC_FLAGS)
+endmacro()
 
 
 # helper macro to set up a moc rule
@@ -104,7 +104,7 @@ macro (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options)
     get_filename_component(_moc_outfile_dir "${outfile}" PATH)
     if(_moc_outfile_dir)
       set(_moc_working_dir WORKING_DIRECTORY ${_moc_outfile_dir})
-    endif(_moc_outfile_dir)
+    endif()
     set (_moc_parameters_file ${outfile}_parameters)
     set (_moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}")
     string (REPLACE ";" "\n" _moc_parameters "${_moc_parameters}")
@@ -114,13 +114,13 @@ macro (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options)
                        DEPENDS ${infile}
                        ${_moc_working_dir}
                        VERBATIM)
-  else (WIN32)
+  else ()
     add_custom_command(OUTPUT ${outfile}
                        COMMAND ${QT_MOC_EXECUTABLE}
                        ARGS ${moc_flags} ${moc_options} -o ${outfile} ${infile}
                        DEPENDS ${infile} VERBATIM)
-  endif (WIN32)
-endmacro (QT4_CREATE_MOC_COMMAND)
+  endif ()
+endmacro ()
 
 
 macro (QT4_GENERATE_MOC infile outfile )
@@ -130,10 +130,10 @@ macro (QT4_GENERATE_MOC infile outfile )
    set(_outfile "${outfile}")
    if(NOT IS_ABSOLUTE "${outfile}")
      set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}")
-   endif(NOT IS_ABSOLUTE "${outfile}")
+   endif()
    QT4_CREATE_MOC_COMMAND(${abs_infile} ${_outfile} "${moc_flags}" "")
    set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC TRUE)  # dont run automoc on this file
-endmacro (QT4_GENERATE_MOC)
+endmacro ()
 
 
 # QT4_WRAP_CPP(outfiles inputfile ... )
@@ -148,9 +148,9 @@ macro (QT4_WRAP_CPP outfiles )
     QT4_MAKE_OUTPUT_FILE(${it} moc_ cxx outfile)
     QT4_CREATE_MOC_COMMAND(${it} ${outfile} "${moc_flags}" "${moc_options}")
     set(${outfiles} ${${outfiles}} ${outfile})
-  endforeach(it)
+  endforeach()
 
-endmacro (QT4_WRAP_CPP)
+endmacro ()
 
 
 # QT4_WRAP_UI(outfiles inputfile ... )
@@ -167,9 +167,9 @@ macro (QT4_WRAP_UI outfiles )
       ARGS ${ui_options} -o ${outfile} ${infile}
       MAIN_DEPENDENCY ${infile} VERBATIM)
     set(${outfiles} ${${outfiles}} ${outfile})
-  endforeach (it)
+  endforeach ()
 
-endmacro (QT4_WRAP_UI)
+endmacro ()
 
 
 # QT4_ADD_RESOURCES(outfiles inputfile ... )
@@ -193,19 +193,19 @@ macro (QT4_ADD_RESOURCES outfiles )
         string(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}")
         if(NOT IS_ABSOLUTE "${_RC_FILE}")
           set(_RC_FILE "${rc_path}/${_RC_FILE}")
-        endif(NOT IS_ABSOLUTE "${_RC_FILE}")
+        endif()
         set(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}")
-      endforeach(_RC_FILE)
+      endforeach()
       # Since this cmake macro is doing the dependency scanning for these files,
       # let's make a configured file and add it as a dependency so cmake is run
       # again when dependencies need to be recomputed.
       QT4_MAKE_OUTPUT_FILE("${infile}" "" "qrc.depends" out_depends)
       configure_file("${infile}" "${out_depends}" COPY_ONLY)
-    else(EXISTS "${infile}")
+    else()
       # The .qrc file does not exist (yet). Let's add a dependency and hope
       # that it will be generated later
       set(out_depends)
-    endif(EXISTS "${infile}")
+    endif()
 
     add_custom_command(OUTPUT ${outfile}
       COMMAND ${QT_RCC_EXECUTABLE}
@@ -213,9 +213,9 @@ macro (QT4_ADD_RESOURCES outfiles )
       MAIN_DEPENDENCY ${infile}
       DEPENDS ${_RC_DEPENDS} "${out_depends}" VERBATIM)
     set(${outfiles} ${${outfiles}} ${outfile})
-  endforeach (it)
+  endforeach ()
 
-endmacro (QT4_ADD_RESOURCES)
+endmacro ()
 
 
 macro(QT4_ADD_DBUS_INTERFACE _sources _interface _basename)
@@ -227,19 +227,19 @@ macro(QT4_ADD_DBUS_INTERFACE _sources _interface _basename)
   get_source_file_property(_nonamespace ${_interface} NO_NAMESPACE)
   if(_nonamespace)
     set(_params -N -m)
-  else(_nonamespace)
+  else()
     set(_params -m)
-  endif(_nonamespace)
+  endif()
 
   get_source_file_property(_classname ${_interface} CLASSNAME)
   if(_classname)
     set(_params ${_params} -c ${_classname})
-  endif(_classname)
+  endif()
 
   get_source_file_property(_include ${_interface} INCLUDE)
   if(_include)
     set(_params ${_params} -i ${_include})
-  endif(_include)
+  endif()
 
   add_custom_command(OUTPUT "${_impl}" "${_header}"
       COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} ${_params} -p ${_basename} ${_infile}
@@ -252,7 +252,7 @@ macro(QT4_ADD_DBUS_INTERFACE _sources _interface _basename)
   list(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}")
   MACRO_ADD_FILE_DEPENDENCIES("${_impl}" "${_moc}")
 
-endmacro(QT4_ADD_DBUS_INTERFACE)
+endmacro()
 
 
 macro(QT4_ADD_DBUS_INTERFACES _sources)
@@ -263,8 +263,8 @@ macro(QT4_ADD_DBUS_INTERFACES _sources)
     string(TOLOWER ${_basename} _basename)
     string(REGEX REPLACE "(.*\\.)?([^\\.]+)\\.xml" "\\2" _basename ${_basename})
     QT4_ADD_DBUS_INTERFACE(${_sources} ${_infile} ${_basename}interface)
-  endforeach (_current_FILE)
-endmacro(QT4_ADD_DBUS_INTERFACES)
+  endforeach ()
+endmacro()
 
 
 macro(QT4_GENERATE_DBUS_INTERFACE _header) # _customName OPTIONS -some -options )
@@ -283,15 +283,15 @@ macro(QT4_GENERATE_DBUS_INTERFACE _header) # _customName OPTIONS -some -options
     else()
       set(_target ${CMAKE_CURRENT_BINARY_DIR}/${_customName})
     endif()
-  else (_customName)
+  else ()
     set(_target ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.xml)
-  endif (_customName)
+  endif ()
 
   add_custom_command(OUTPUT ${_target}
       COMMAND ${QT_DBUSCPP2XML_EXECUTABLE} ${_qt4_dbus_options} ${_in_file} -o ${_target}
       DEPENDS ${_in_file} VERBATIM
   )
-endmacro(QT4_GENERATE_DBUS_INTERFACE)
+endmacro()
 
 
 macro(QT4_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # _optionalBasename _optionalClassName)
@@ -300,10 +300,10 @@ macro(QT4_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # _optional
   set(_optionalBasename "${ARGV4}")
   if (_optionalBasename)
     set(_basename ${_optionalBasename} )
-  else (_optionalBasename)
+  else ()
     string(REGEX REPLACE "(.*[/\\.])?([^\\.]+)\\.xml" "\\2adaptor" _basename ${_infile})
     string(TOLOWER ${_basename} _basename)
-  endif (_optionalBasename)
+  endif ()
 
   set(_optionalClassName "${ARGV5}")
   set(_header "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h")
@@ -315,19 +315,19 @@ macro(QT4_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # _optional
        COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -c ${_optionalClassName} -i ${_include} -l ${_parentClass} ${_infile}
        DEPENDS ${_infile} VERBATIM
     )
-  else(_optionalClassName)
+  else()
     add_custom_command(OUTPUT "${_impl}" "${_header}"
        COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -i ${_include} -l ${_parentClass} ${_infile}
        DEPENDS ${_infile} VERBATIM
      )
-  endif(_optionalClassName)
+  endif()
 
   QT4_GENERATE_MOC("${_header}" "${_moc}")
   set_source_files_properties("${_impl}" PROPERTIES SKIP_AUTOMOC TRUE)
   MACRO_ADD_FILE_DEPENDENCIES("${_impl}" "${_moc}")
 
   list(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}")
-endmacro(QT4_ADD_DBUS_ADAPTOR)
+endmacro()
 
 
 macro(QT4_AUTOMOC)
@@ -360,17 +360,17 @@ macro(QT4_AUTOMOC)
           get_filename_component(_basename ${_current_MOC} NAME_WE)
           if(EXISTS ${_abs_PATH}/${_basename}.hpp)
             set(_header ${_abs_PATH}/${_basename}.hpp)
-          else(EXISTS ${_abs_PATH}/${_basename}.hpp)
+          else()
             set(_header ${_abs_PATH}/${_basename}.h)
-          endif(EXISTS ${_abs_PATH}/${_basename}.hpp)
+          endif()
           set(_moc    ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC})
           QT4_CREATE_MOC_COMMAND(${_header} ${_moc} "${_moc_INCS}" "")
           MACRO_ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc})
-        endforeach (_current_MOC_INC)
-      endif(_match)
-    endif ( NOT _skip AND EXISTS ${_abs_FILE} )
-  endforeach (_current_FILE)
-endmacro(QT4_AUTOMOC)
+        endforeach ()
+      endif()
+    endif ()
+  endforeach ()
+endmacro()
 
 
 macro(QT4_CREATE_TRANSLATION _qm_files)
@@ -384,14 +384,14 @@ macro(QT4_CREATE_TRANSLATION _qm_files)
      get_filename_component(_abs_FILE ${_file} ABSOLUTE)
      if(_ext MATCHES "ts")
        list(APPEND _my_tsfiles ${_abs_FILE})
-     else(_ext MATCHES "ts")
+     else()
        if(NOT _ext)
          list(APPEND _my_dirs ${_abs_FILE})
-       else(NOT _ext)
+       else()
          list(APPEND _my_sources ${_abs_FILE})
-       endif(NOT _ext)
-     endif(_ext MATCHES "ts")
-   endforeach(_file)
+       endif()
+     endif()
+   endforeach()
    foreach(_ts_file ${_my_tsfiles})
      if(_my_sources)
        # make a .pro file to call lupdate on, so we don't make our commands too
@@ -401,22 +401,22 @@ macro(QT4_CREATE_TRANSLATION _qm_files)
        set(_pro_srcs)
        foreach(_pro_src ${_my_sources})
          set(_pro_srcs "${_pro_srcs} \"${_pro_src}\"")
-       endforeach(_pro_src ${_my_sources})
+       endforeach()
        set(_pro_includes)
        get_directory_property(_inc_DIRS INCLUDE_DIRECTORIES)
        foreach(_pro_include ${_inc_DIRS})
          get_filename_component(_abs_include "${_pro_include}" ABSOLUTE)
          set(_pro_includes "${_pro_includes} \"${_abs_include}\"")
-       endforeach(_pro_include ${CMAKE_CXX_INCLUDE_PATH})
+       endforeach()
        file(WRITE ${_ts_pro} "SOURCES = ${_pro_srcs}\nINCLUDEPATH = ${_pro_includes}\n")
-     endif(_my_sources)
+     endif()
      add_custom_command(OUTPUT ${_ts_file}
         COMMAND ${QT_LUPDATE_EXECUTABLE}
         ARGS ${_lupdate_options} ${_ts_pro} ${_my_dirs} -ts ${_ts_file}
         DEPENDS ${_my_sources} ${_ts_pro} VERBATIM)
-   endforeach(_ts_file)
+   endforeach()
    QT4_ADD_TRANSLATION(${_qm_files} ${_my_tsfiles})
-endmacro(QT4_CREATE_TRANSLATION)
+endmacro()
 
 
 macro(QT4_ADD_TRANSLATION _qm_files)
@@ -427,9 +427,9 @@ macro(QT4_ADD_TRANSLATION _qm_files)
     if(output_location)
       file(MAKE_DIRECTORY "${output_location}")
       set(qm "${output_location}/${qm}.qm")
-    else(output_location)
+    else()
       set(qm "${CMAKE_CURRENT_BINARY_DIR}/${qm}.qm")
-    endif(output_location)
+    endif()
 
     add_custom_command(OUTPUT ${qm}
        COMMAND ${QT_LRELEASE_EXECUTABLE}
@@ -437,5 +437,5 @@ macro(QT4_ADD_TRANSLATION _qm_files)
        DEPENDS ${_abs_FILE} VERBATIM
     )
     set(${_qm_files} ${${_qm_files}} ${qm})
-  endforeach (_current_FILE)
-endmacro(QT4_ADD_TRANSLATION)
+  endforeach ()
+endmacro()
diff --git a/Modules/SelectLibraryConfigurations.cmake b/Modules/SelectLibraryConfigurations.cmake
index e4df3eb97..82bb17357 100644
--- a/Modules/SelectLibraryConfigurations.cmake
+++ b/Modules/SelectLibraryConfigurations.cmake
@@ -38,8 +38,8 @@ macro( _set_library_name basename GOOD BAD )
         set( ${basename}_LIBRARY_${BAD} ${${basename}_LIBRARY_${GOOD}} )
         set( ${basename}_LIBRARY ${${basename}_LIBRARY_${GOOD}} )
         set( ${basename}_LIBRARIES ${${basename}_LIBRARY_${GOOD}} )
-    endif( ${basename}_LIBRARY_${GOOD} AND NOT ${basename}_LIBRARY_${BAD} )
-endmacro( _set_library_name )
+    endif()
+endmacro()
 
 macro( select_library_configurations basename )
     # if only the release version was found, set the debug to be the release
@@ -61,12 +61,12 @@ macro( select_library_configurations basename )
                 list( APPEND ${basename}_LIBRARY debug "${_libname}" )
             endforeach()
             set( ${basename}_LIBRARIES "${${basename}_LIBRARY}" )
-        else( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
+        else()
             # If there are no configuration types or build type, just use
             # the release version
             set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} )
             set( ${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE} )
-        endif( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
+        endif()
     endif()
 
     set( ${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH
@@ -74,10 +74,10 @@ macro( select_library_configurations basename )
 
     if( ${basename}_LIBRARY )
         set( ${basename}_FOUND TRUE )
-    endif( ${basename}_LIBRARY )
+    endif()
 
     mark_as_advanced( ${basename}_LIBRARY
         ${basename}_LIBRARY_RELEASE
         ${basename}_LIBRARY_DEBUG
     )
-endmacro( select_library_configurations )
+endmacro()
diff --git a/Modules/SquishTestScript.cmake b/Modules/SquishTestScript.cmake
index 9eac9707f..5cdd2123c 100644
--- a/Modules/SquishTestScript.cmake
+++ b/Modules/SquishTestScript.cmake
@@ -46,7 +46,7 @@ endforeach()
 if (QT4_INSTALLED)
   # record qt lib directory
   set ( ENV{${SQUISH_LIBQTDIR}} ${squish_libqtdir} )
-endif (QT4_INSTALLED)
+endif ()
 
 # run the test
 if (WIN32)
@@ -54,19 +54,19 @@ if (WIN32)
     COMMAND ${CMAKE_ROOT}/Modules/SquishRunTestCase.bat ${squish_server_executable} ${squish_client_executable} ${squish_test_case} ${squish_wrapper} ${squish_aut}
     RESULT_VARIABLE test_rv
     )
-endif (WIN32)
+endif ()
 
 if (UNIX)
   execute_process(
     COMMAND ${CMAKE_ROOT}/Modules/SquishRunTestCase.sh ${squish_server_executable} ${squish_client_executable} ${squish_test_case} ${squish_wrapper} ${squish_aut}
     RESULT_VARIABLE test_rv
     )
-endif (UNIX)
+endif ()
 
 # check for an error with running the test
 if(NOT "${test_rv}" STREQUAL "0")
   message(FATAL_ERROR "Error running Squish test")
-endif(NOT "${test_rv}" STREQUAL "0")
+endif()
 
 
 
diff --git a/Modules/SystemInformation.cmake b/Modules/SystemInformation.cmake
index 73674e6fa..fa8507106 100644
--- a/Modules/SystemInformation.cmake
+++ b/Modules/SystemInformation.cmake
@@ -32,7 +32,7 @@ file(APPEND "${RESULT_FILE}"
 get_cmake_property(res VARIABLES)
 foreach(var ${res})
   file(APPEND "${RESULT_FILE}" "${var} \"${${var}}\"\n")
-endforeach(var ${res})
+endforeach()
 
 file(APPEND "${RESULT_FILE}"
   "\n=================================================================\n")
@@ -43,7 +43,7 @@ file(APPEND "${RESULT_FILE}"
 get_cmake_property(res COMMANDS)
 foreach(var ${res})
   file(APPEND "${RESULT_FILE}" "${var}\n")
-endforeach(var ${res})
+endforeach()
 
 file(APPEND "${RESULT_FILE}"
   "\n=================================================================\n")
@@ -55,7 +55,7 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt "")
 get_cmake_property(res MACROS)
 foreach(var ${res})
   file(APPEND "${RESULT_FILE}" "${var}\n")
-endforeach(var ${res})
+endforeach()
 
 file(APPEND "${RESULT_FILE}"
   "\n=================================================================\n")
@@ -66,12 +66,12 @@ file(APPEND "${RESULT_FILE}"
 get_directory_property(res INCLUDE_DIRECTORIES)
 foreach(var ${res})
   file(APPEND "${RESULT_FILE}" "INCLUDE_DIRECTORY: ${var}\n")
-endforeach(var)
+endforeach()
 
 get_directory_property(res LINK_DIRECTORIES)
 foreach(var ${res})
   file(APPEND "${RESULT_FILE}" "LINK_DIRECTORIES: ${var}\n")
-endforeach(var)
+endforeach()
 
 get_directory_property(res INCLUDE_REGULAR_EXPRESSION)
 file(APPEND "${RESULT_FILE}" "INCLUDE_REGULAR_EXPRESSION: ${res}\n")
@@ -89,8 +89,8 @@ macro(DUMP_FILE THE_FILE)
 
     file(READ "${THE_FILE}" FILE_CONTENTS LIMIT 50000)
     file(APPEND "${RESULT_FILE}" "${FILE_CONTENTS}")
-  endif (EXISTS "${THE_FILE}")
-endmacro(DUMP_FILE)
+  endif ()
+endmacro()
 
 DUMP_FILE("../CMakeCache.txt")
 DUMP_FILE("../CMakeFiles/CMakeOutput.log")
@@ -99,5 +99,5 @@ DUMP_FILE("../CMakeFiles/CMakeSystem.cmake")
 
 foreach (EXTRA_FILE ${EXTRA_DUMP_FILES})
   DUMP_FILE("${EXTRA_FILE}")
-endforeach (EXTRA_FILE)
+endforeach ()
 
diff --git a/Modules/TestBigEndian.cmake b/Modules/TestBigEndian.cmake
index d162f13e7..193df8fda 100644
--- a/Modules/TestBigEndian.cmake
+++ b/Modules/TestBigEndian.cmake
@@ -28,25 +28,25 @@ macro(TEST_BIG_ENDIAN VARIABLE)
     if(CMAKE_SIZEOF_UNSIGNED_SHORT EQUAL 2)
       message(STATUS "Using unsigned short")
       set(CMAKE_16BIT_TYPE "unsigned short")
-    else(CMAKE_SIZEOF_UNSIGNED_SHORT EQUAL 2)
+    else()
       CHECK_TYPE_SIZE("unsigned int"   CMAKE_SIZEOF_UNSIGNED_INT)
       if(CMAKE_SIZEOF_UNSIGNED_INT)
         message(STATUS "Using unsigned int")
         set(CMAKE_16BIT_TYPE "unsigned int")
 
-      else(CMAKE_SIZEOF_UNSIGNED_INT)
+      else()
 
         CHECK_TYPE_SIZE("unsigned long"  CMAKE_SIZEOF_UNSIGNED_LONG)
         if(CMAKE_SIZEOF_UNSIGNED_LONG)
           message(STATUS "Using unsigned long")
           set(CMAKE_16BIT_TYPE "unsigned long")
-        else(CMAKE_SIZEOF_UNSIGNED_LONG)
+        else()
           message(FATAL_ERROR "no suitable type found")
-        endif(CMAKE_SIZEOF_UNSIGNED_LONG)
+        endif()
 
-      endif(CMAKE_SIZEOF_UNSIGNED_INT)
+      endif()
 
-    endif(CMAKE_SIZEOF_UNSIGNED_SHORT EQUAL 2)
+    endif()
 
 
     configure_file("${CMAKE_ROOT}/Modules/TestEndianess.c.in"
@@ -76,37 +76,37 @@ macro(TEST_BIG_ENDIAN VARIABLE)
           if(CMAKE_SYSTEM_PROCESSOR MATCHES powerpc)
             set(CMAKE_TEST_ENDIANESS_STRINGS_BE TRUE)
             set(CMAKE_TEST_ENDIANESS_STRINGS_LE FALSE)
-          else(CMAKE_SYSTEM_PROCESSOR MATCHES powerpc)
+          else()
             set(CMAKE_TEST_ENDIANESS_STRINGS_BE FALSE)
             set(CMAKE_TEST_ENDIANESS_STRINGS_LE TRUE)
-          endif(CMAKE_SYSTEM_PROCESSOR MATCHES powerpc)
+          endif()
           message(STATUS "TEST_BIG_ENDIAN found different results, consider setting CMAKE_OSX_ARCHITECTURES or CMAKE_TRY_COMPILE_OSX_ARCHITECTURES to one or no architecture !")
-        endif(CMAKE_TEST_ENDIANESS_STRINGS_BE  AND  CMAKE_TEST_ENDIANESS_STRINGS_LE)
+        endif()
 
         if(CMAKE_TEST_ENDIANESS_STRINGS_LE)
           set(${VARIABLE} 0 CACHE INTERNAL "Result of TEST_BIG_ENDIAN" FORCE)
           message(STATUS "Check if the system is big endian - little endian")
-        endif(CMAKE_TEST_ENDIANESS_STRINGS_LE)
+        endif()
 
         if(CMAKE_TEST_ENDIANESS_STRINGS_BE)
           set(${VARIABLE} 1 CACHE INTERNAL "Result of TEST_BIG_ENDIAN" FORCE)
           message(STATUS "Check if the system is big endian - big endian")
-        endif(CMAKE_TEST_ENDIANESS_STRINGS_BE)
+        endif()
 
         if(NOT CMAKE_TEST_ENDIANESS_STRINGS_BE  AND  NOT CMAKE_TEST_ENDIANESS_STRINGS_LE)
           message(SEND_ERROR "TEST_BIG_ENDIAN found no result!")
-        endif(NOT CMAKE_TEST_ENDIANESS_STRINGS_BE  AND  NOT CMAKE_TEST_ENDIANESS_STRINGS_LE)
+        endif()
 
         file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
           "Determining if the system is big endian passed with the following output:\n${OUTPUT}\nTestEndianess.c:\n${TEST_ENDIANESS_FILE_CONTENT}\n\n")
 
-      else(HAVE_${VARIABLE})
+      else()
         message(STATUS "Check if the system is big endian - failed")
         file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
           "Determining if the system is big endian failed with the following output:\n${OUTPUT}\nTestEndianess.c:\n${TEST_ENDIANESS_FILE_CONTENT}\n\n")
         set(${VARIABLE})
-      endif(HAVE_${VARIABLE})
-  endif("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
-endmacro(TEST_BIG_ENDIAN)
+      endif()
+  endif()
+endmacro()
 
 
diff --git a/Modules/TestCXXAcceptsFlag.cmake b/Modules/TestCXXAcceptsFlag.cmake
index 58623f8c4..2694737ef 100644
--- a/Modules/TestCXXAcceptsFlag.cmake
+++ b/Modules/TestCXXAcceptsFlag.cmake
@@ -33,11 +33,11 @@ macro(CHECK_CXX_ACCEPTS_FLAG FLAGS  VARIABLE)
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if the CXX compiler accepts the flag ${FLAGS} passed with "
         "the following output:\n${OUTPUT}\n\n")
-    else(${VARIABLE})
+    else()
       message(STATUS "Checking to see if CXX compiler accepts flag ${FLAGS} - no")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if the CXX compiler accepts the flag ${FLAGS} failed with "
         "the following output:\n${OUTPUT}\n\n")
-    endif(${VARIABLE})
-  endif(NOT DEFINED ${VARIABLE})
-endmacro(CHECK_CXX_ACCEPTS_FLAG)
+    endif()
+  endif()
+endmacro()
diff --git a/Modules/TestForANSIForScope.cmake b/Modules/TestForANSIForScope.cmake
index d7e2c926f..9b4d51cda 100644
--- a/Modules/TestForANSIForScope.cmake
+++ b/Modules/TestForANSIForScope.cmake
@@ -28,15 +28,15 @@ if("CMAKE_ANSI_FOR_SCOPE" MATCHES "^CMAKE_ANSI_FOR_SCOPE$")
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining if the CXX compiler understands ansi for scopes passed with "
       "the following output:\n${OUTPUT}\n\n")
-  else (CMAKE_ANSI_FOR_SCOPE)
+  else ()
     message(STATUS "Check for ANSI scope - not found")
     set (CMAKE_NO_ANSI_FOR_SCOPE 1 CACHE INTERNAL
       "Does the compiler support ansi for scope.")
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
       "Determining if the CXX compiler understands ansi for scopes failed with "
       "the following output:\n${OUTPUT}\n\n")
-  endif (CMAKE_ANSI_FOR_SCOPE)
-endif("CMAKE_ANSI_FOR_SCOPE" MATCHES "^CMAKE_ANSI_FOR_SCOPE$")
+  endif ()
+endif()
 
 
 
diff --git a/Modules/TestForANSIStreamHeaders.cmake b/Modules/TestForANSIStreamHeaders.cmake
index 1ed532ed5..4aa4023e7 100644
--- a/Modules/TestForANSIStreamHeaders.cmake
+++ b/Modules/TestForANSIStreamHeaders.cmake
@@ -23,12 +23,12 @@ if(NOT CMAKE_NO_ANSI_STREAM_HEADERS)
   if (CMAKE_ANSI_STREAM_HEADERS)
     set (CMAKE_NO_ANSI_STREAM_HEADERS 0 CACHE INTERNAL
          "Does the compiler support headers like iostream.")
-  else (CMAKE_ANSI_STREAM_HEADERS)
+  else ()
     set (CMAKE_NO_ANSI_STREAM_HEADERS 1 CACHE INTERNAL
        "Does the compiler support headers like iostream.")
-  endif (CMAKE_ANSI_STREAM_HEADERS)
+  endif ()
 
   mark_as_advanced(CMAKE_NO_ANSI_STREAM_HEADERS)
-endif(NOT CMAKE_NO_ANSI_STREAM_HEADERS)
+endif()
 
 
diff --git a/Modules/TestForSSTREAM.cmake b/Modules/TestForSSTREAM.cmake
index cdd809111..db39c1e70 100644
--- a/Modules/TestForSSTREAM.cmake
+++ b/Modules/TestForSSTREAM.cmake
@@ -28,15 +28,15 @@ if("CMAKE_HAS_ANSI_STRING_STREAM" MATCHES "^CMAKE_HAS_ANSI_STRING_STREAM$")
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining if the CXX compiler has sstream passed with "
       "the following output:\n${OUTPUT}\n\n")
-  else (CMAKE_HAS_ANSI_STRING_STREAM)
+  else ()
     message(STATUS "Check for sstream - not found")
     set (CMAKE_NO_ANSI_STRING_STREAM 1 CACHE INTERNAL
        "Does the compiler support sstream")
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
       "Determining if the CXX compiler has sstream failed with "
       "the following output:\n${OUTPUT}\n\n")
-  endif (CMAKE_HAS_ANSI_STRING_STREAM)
-endif("CMAKE_HAS_ANSI_STRING_STREAM" MATCHES "^CMAKE_HAS_ANSI_STRING_STREAM$")
+  endif ()
+endif()
 
 
 
diff --git a/Modules/TestForSTDNamespace.cmake b/Modules/TestForSTDNamespace.cmake
index 848aa8722..6a7564445 100644
--- a/Modules/TestForSTDNamespace.cmake
+++ b/Modules/TestForSTDNamespace.cmake
@@ -28,15 +28,15 @@ if("CMAKE_STD_NAMESPACE" MATCHES "^CMAKE_STD_NAMESPACE$")
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining if the CXX compiler has std namespace passed with "
       "the following output:\n${OUTPUT}\n\n")
-  else (CMAKE_STD_NAMESPACE)
+  else ()
     message(STATUS "Check for STD namespace - not found")
     set (CMAKE_NO_STD_NAMESPACE 1 CACHE INTERNAL
        "Does the compiler support std::.")
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
       "Determining if the CXX compiler has std namespace failed with "
       "the following output:\n${OUTPUT}\n\n")
-  endif (CMAKE_STD_NAMESPACE)
-endif("CMAKE_STD_NAMESPACE" MATCHES "^CMAKE_STD_NAMESPACE$")
+  endif ()
+endif()
 
 
 
diff --git a/Modules/UseEcos.cmake b/Modules/UseEcos.cmake
index e3e7798d8..028df8202 100644
--- a/Modules/UseEcos.cmake
+++ b/Modules/UseEcos.cmake
@@ -33,24 +33,24 @@
 find_program(ECOSCONFIG_EXECUTABLE NAMES ecosconfig)
 if(NOT ECOSCONFIG_EXECUTABLE)
    message(SEND_ERROR "ecosconfig was not found. Either include it in the system path or set it manually using ccmake.")
-else(NOT ECOSCONFIG_EXECUTABLE)
+else()
    message(STATUS "Found ecosconfig: ${ECOSCONFIG_EXECUTABLE}")
-endif(NOT ECOSCONFIG_EXECUTABLE)
+endif()
 
 # check that ECOS_REPOSITORY is set correctly
 if (NOT EXISTS $ENV{ECOS_REPOSITORY}/ecos.db)
    message(SEND_ERROR "The environment variable ECOS_REPOSITORY is not set correctly. Set it to the directory which contains the file ecos.db")
-else (NOT EXISTS $ENV{ECOS_REPOSITORY}/ecos.db)
+else ()
    message(STATUS "ECOS_REPOSITORY is set to $ENV{ECOS_REPOSITORY}")
-endif (NOT EXISTS $ENV{ECOS_REPOSITORY}/ecos.db)
+endif ()
 
 # check that tclsh (coming with TCL) is available, otherwise ecosconfig doesn't work
 find_package(Tclsh)
 if (NOT TCL_TCLSH)
    message(SEND_ERROR "The TCL tclsh was not found. Please install TCL, it is required for building eCos applications.")
-else (NOT TCL_TCLSH)
+else ()
    message(STATUS "tlcsh found: ${TCL_TCLSH}")
-endif (NOT TCL_TCLSH)
+endif ()
 
 #add the globale include-diretories
 #usage: ECOS_ADD_INCLUDE_DIRECTORIES()
@@ -58,14 +58,14 @@ macro(ECOS_ADD_INCLUDE_DIRECTORIES)
 #check for ProjectSources.txt one level higher
    if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../ProjectSources.txt)
       include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../)
-   else (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../ProjectSources.txt)
+   else ()
       include_directories(${CMAKE_CURRENT_SOURCE_DIR}/)
-   endif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../ProjectSources.txt)
+   endif ()
 
 #the ecos include directory
    include_directories(${CMAKE_CURRENT_BINARY_DIR}/ecos/install/include/)
 
-endmacro(ECOS_ADD_INCLUDE_DIRECTORIES)
+endmacro()
 
 
 #we want to compile for the xscale processor, in this case the following macro has to be called
@@ -82,7 +82,7 @@ macro (ECOS_USE_ARM_ELF_TOOLS)
    add_definitions(-mcpu=xscale -mapcs-frame)
 #for the obj-tools
    set(ECOS_ARCH_PREFIX "arm-elf-")
-endmacro (ECOS_USE_ARM_ELF_TOOLS)
+endmacro ()
 
 #usage: ECOS_USE_PPC_EABI_TOOLS()
 macro (ECOS_USE_PPC_EABI_TOOLS)
@@ -97,7 +97,7 @@ macro (ECOS_USE_PPC_EABI_TOOLS)
    add_definitions()
 #for the obj-tools
    set(ECOS_ARCH_PREFIX "powerpc-eabi-")
-endmacro (ECOS_USE_PPC_EABI_TOOLS)
+endmacro ()
 
 #usage: ECOS_USE_I386_ELF_TOOLS()
 macro (ECOS_USE_I386_ELF_TOOLS)
@@ -112,7 +112,7 @@ macro (ECOS_USE_I386_ELF_TOOLS)
    add_definitions()
 #for the obj-tools
    set(ECOS_ARCH_PREFIX "i386-elf-")
-endmacro (ECOS_USE_I386_ELF_TOOLS)
+endmacro ()
 
 
 #since the actual sources are located one level upwards
@@ -126,10 +126,10 @@ macro(ECOS_ADJUST_DIRECTORY _target_FILES )
       get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE)
       if (NOT ${_abs_FILE} STREQUAL ${_current_FILE})
          get_filename_component(_abs_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../${_current_FILE} ABSOLUTE)
-      endif (NOT ${_abs_FILE} STREQUAL ${_current_FILE})
+      endif ()
       list(APPEND ${_target_FILES} ${_abs_FILE})
-   endforeach (_current_FILE)
-endmacro(ECOS_ADJUST_DIRECTORY)
+   endforeach ()
+endmacro()
 
 # the default ecos config file name
 # maybe in the future also out-of-source builds may be possible
@@ -141,7 +141,7 @@ macro(ECOS_ADD_TARGET_LIB)
 # when building out-of-source, create the ecos/ subdir
     if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/ecos)
         file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ecos)
-    endif(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/ecos)
+    endif()
 
 #sources depend on target.ld
    set_source_files_properties(
@@ -162,7 +162,7 @@ macro(ECOS_ADD_TARGET_LIB)
    )
 
    add_custom_target( ecos make -C ${CMAKE_CURRENT_BINARY_DIR}/ecos/ DEPENDS  ${CMAKE_CURRENT_BINARY_DIR}/ecos/makefile )
-endmacro(ECOS_ADD_TARGET_LIB)
+endmacro()
 
 # get the directory of the current file, used later on in the file
 get_filename_component( ECOS_CMAKE_MODULE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
@@ -232,5 +232,5 @@ macro(ECOS_ADD_EXECUTABLE _exe_NAME )
       COMMAND echo -e \"\\n--- Full assembly listing ---\\n\" >> ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst
       COMMAND ${ECOS_ARCH_PREFIX}objdump -S -x -d -C ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.elf >> ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst )
 
-endmacro(ECOS_ADD_EXECUTABLE)
+endmacro()
 
diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake
index 0b2d1b833..1b823a8e9 100644
--- a/Modules/UseJava.cmake
+++ b/Modules/UseJava.cmake
@@ -198,7 +198,7 @@ function (__java_copy_file src dest comment)
                 ${dest}
         DEPENDS ${src}
         COMMENT ${comment})
-endfunction (__java_copy_file src dest comment)
+endfunction ()
 
 # define helper scripts
 set(_JAVA_CLASS_FILELIST_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/UseJavaClassFilelist.cmake)
@@ -209,18 +209,18 @@ function(add_jar _TARGET_NAME)
 
     if (NOT DEFINED CMAKE_JAVA_TARGET_OUTPUT_DIR)
       set(CMAKE_JAVA_TARGET_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
-    endif(NOT DEFINED CMAKE_JAVA_TARGET_OUTPUT_DIR)
+    endif()
 
     if (CMAKE_JAVA_JAR_ENTRY_POINT)
       set(_ENTRY_POINT_OPTION e)
       set(_ENTRY_POINT_VALUE ${CMAKE_JAVA_JAR_ENTRY_POINT})
-    endif (CMAKE_JAVA_JAR_ENTRY_POINT)
+    endif ()
 
     if (LIBRARY_OUTPUT_PATH)
         set(CMAKE_JAVA_LIBRARY_OUTPUT_PATH ${LIBRARY_OUTPUT_PATH})
-    else (LIBRARY_OUTPUT_PATH)
+    else ()
         set(CMAKE_JAVA_LIBRARY_OUTPUT_PATH ${CMAKE_JAVA_TARGET_OUTPUT_DIR})
-    endif (LIBRARY_OUTPUT_PATH)
+    endif ()
 
     set(CMAKE_JAVA_INCLUDE_PATH
         ${CMAKE_JAVA_INCLUDE_PATH}
@@ -231,13 +231,13 @@ function(add_jar _TARGET_NAME)
 
     if (WIN32 AND NOT CYGWIN)
         set(CMAKE_JAVA_INCLUDE_FLAG_SEP ";")
-    else (WIN32 AND NOT CYGWIN)
+    else ()
         set(CMAKE_JAVA_INCLUDE_FLAG_SEP ":")
-    endif(WIN32 AND NOT CYGWIN)
+    endif()
 
     foreach (JAVA_INCLUDE_DIR ${CMAKE_JAVA_INCLUDE_PATH})
        set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}")
-    endforeach(JAVA_INCLUDE_DIR)
+    endforeach()
 
     set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${CMAKE_JAVA_TARGET_OUTPUT_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir")
 
@@ -250,7 +250,7 @@ function(add_jar _TARGET_NAME)
         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")
-    endif (CMAKE_JAVA_TARGET_OUTPUT_NAME AND CMAKE_JAVA_TARGET_VERSION)
+    endif ()
     # reset
     set(CMAKE_JAVA_TARGET_OUTPUT_NAME)
 
@@ -270,9 +270,9 @@ function(add_jar _TARGET_NAME)
         string(LENGTH ${_JAVA_REL_SOURCE_PATH} _SRC_LEN)
         if (${_BIN_LEN} LESS ${_SRC_LEN})
             set(_JAVA_REL_PATH ${_JAVA_REL_BINARY_PATH})
-        else (${_BIN_LEN} LESS ${_SRC_LEN})
+        else ()
             set(_JAVA_REL_PATH ${_JAVA_REL_SOURCE_PATH})
-        endif (${_BIN_LEN} LESS ${_SRC_LEN})
+        endif ()
         get_filename_component(_JAVA_REL_PATH ${_JAVA_REL_PATH} PATH)
 
         if (_JAVA_EXT MATCHES ".java")
@@ -290,13 +290,13 @@ function(add_jar _TARGET_NAME)
             list(APPEND CMAKE_JAVA_INCLUDE_PATH ${JAVA_JAR_TARGET_${_JAVA_SOURCE_FILE}} ${JAVA_JAR_TARGET_${_JAVA_SOURCE_FILE}_CLASSPATH})
             list(APPEND _JAVA_DEPENDS ${JAVA_JAR_TARGET_${_JAVA_SOURCE_FILE}})
 
-        else (_JAVA_EXT MATCHES ".java")
+        else ()
             __java_copy_file(${CMAKE_CURRENT_SOURCE_DIR}/${_JAVA_SOURCE_FILE}
                              ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/${_JAVA_SOURCE_FILE}
                              "Copying ${_JAVA_SOURCE_FILE} to the build directory")
             list(APPEND _JAVA_RESOURCE_FILES ${_JAVA_SOURCE_FILE})
-        endif (_JAVA_EXT MATCHES ".java")
-    endforeach(_JAVA_SOURCE_FILE)
+        endif ()
+    endforeach()
 
     # create an empty java_class_filelist
     if (NOT EXISTS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist)
@@ -327,7 +327,7 @@ function(add_jar _TARGET_NAME)
             DEPENDS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_compiled_${_TARGET_NAME}
             WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
         )
-    endif (_JAVA_COMPILE_FILES)
+    endif ()
 
     # create the jar file
     set(_JAVA_JAR_OUTPUT_PATH
@@ -367,7 +367,7 @@ function(add_jar _TARGET_NAME)
             DEPENDS ${_JAVA_RESOURCE_FILES} ${_JAVA_DEPENDS} ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist
             COMMENT "Creating Java archive ${_JAVA_TARGET_OUTPUT_NAME}"
         )
-    endif (CMAKE_JNI_TARGET)
+    endif ()
 
     # Add the target and make sure we have the latest resource files.
     add_custom_target(${_TARGET_NAME} ALL DEPENDS ${_JAVA_JAR_OUTPUT_PATH})
@@ -398,8 +398,8 @@ function(add_jar _TARGET_NAME)
                     JNI_SYMLINK
                         ${CMAKE_JAVA_TARGET_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_LINK}
             )
-        endif (CMAKE_JNI_TARGET)
-    endif (_JAVA_TARGET_OUTPUT_LINK)
+        endif ()
+    endif ()
 
     set_property(
         TARGET
@@ -417,7 +417,7 @@ function(add_jar _TARGET_NAME)
                 ${CMAKE_JAVA_CLASS_OUTPUT_PATH}
     )
 
-endfunction(add_jar)
+endfunction()
 
 function(INSTALL_JAR _TARGET_NAME _DESTINATION)
     get_property(__FILES
@@ -434,10 +434,10 @@ function(INSTALL_JAR _TARGET_NAME _DESTINATION)
             DESTINATION
                 ${_DESTINATION}
         )
-    else (__FILES)
+    else ()
         message(SEND_ERROR "The target ${_TARGET_NAME} is not known in this scope.")
-    endif (__FILES)
-endfunction(INSTALL_JAR _TARGET_NAME _DESTINATION)
+    endif ()
+endfunction()
 
 function(INSTALL_JNI_SYMLINK _TARGET_NAME _DESTINATION)
     get_property(__SYMLINK
@@ -454,10 +454,10 @@ function(INSTALL_JNI_SYMLINK _TARGET_NAME _DESTINATION)
             DESTINATION
                 ${_DESTINATION}
         )
-    else (__SYMLINK)
+    else ()
         message(SEND_ERROR "The target ${_TARGET_NAME} is not known in this scope.")
-    endif (__SYMLINK)
-endfunction(INSTALL_JNI_SYMLINK _TARGET_NAME _DESTINATION)
+    endif ()
+endfunction()
 
 function (find_jar VARIABLE)
     set(_jar_names)
@@ -481,12 +481,12 @@ function (find_jar VARIABLE)
                 set(_state "paths")
             elseif (${arg} STREQUAL "DOC")
                 set(_state "doc")
-            else (${arg} STREQUAL "NAMES")
+            else ()
                 set(_jar_names ${arg})
                 if (_jar_doc STREQUAL "NOTSET")
                     set(_jar_doc "Finding ${arg} jar")
-                endif (_jar_doc STREQUAL "NOTSET")
-            endif (${arg} STREQUAL "VERSIONS")
+                endif ()
+            endif ()
         elseif (${_state} STREQUAL "versions")
             if (${arg} STREQUAL "NAMES")
                 set(_state "names")
@@ -494,9 +494,9 @@ function (find_jar VARIABLE)
                 set(_state "paths")
             elseif (${arg} STREQUAL "DOC")
                 set(_state "doc")
-            else (${arg} STREQUAL "NAMES")
+            else ()
                 set(_jar_versions ${_jar_versions} ${arg})
-            endif (${arg} STREQUAL "NAMES")
+            endif ()
         elseif (${_state} STREQUAL "names")
             if (${arg} STREQUAL "VERSIONS")
                 set(_state "versions")
@@ -504,12 +504,12 @@ function (find_jar VARIABLE)
                 set(_state "paths")
             elseif (${arg} STREQUAL "DOC")
                 set(_state "doc")
-            else (${arg} STREQUAL "VERSIONS")
+            else ()
                 set(_jar_names ${_jar_names} ${arg})
                 if (_jar_doc STREQUAL "NOTSET")
                     set(_jar_doc "Finding ${arg} jar")
-                endif (_jar_doc STREQUAL "NOTSET")
-            endif (${arg} STREQUAL "VERSIONS")
+                endif ()
+            endif ()
         elseif (${_state} STREQUAL "paths")
             if (${arg} STREQUAL "VERSIONS")
                 set(_state "versions")
@@ -517,9 +517,9 @@ function (find_jar VARIABLE)
                 set(_state "names")
             elseif (${arg} STREQUAL "DOC")
                 set(_state "doc")
-            else (${arg} STREQUAL "VERSIONS")
+            else ()
                 set(_jar_paths ${_jar_paths} ${arg})
-            endif (${arg} STREQUAL "VERSIONS")
+            endif ()
         elseif (${_state} STREQUAL "doc")
             if (${arg} STREQUAL "VERSIONS")
                 set(_state "versions")
@@ -527,29 +527,29 @@ function (find_jar VARIABLE)
                 set(_state "names")
             elseif (${arg} STREQUAL "PATHS")
                 set(_state "paths")
-            else (${arg} STREQUAL "VERSIONS")
+            else ()
                 set(_jar_doc ${arg})
-            endif (${arg} STREQUAL "VERSIONS")
-        endif (${_state} STREQUAL "name")
-    endforeach (arg ${ARGN})
+            endif ()
+        endif ()
+    endforeach ()
 
     if (NOT _jar_names)
         message(FATAL_ERROR "find_jar: No name to search for given")
-    endif (NOT _jar_names)
+    endif ()
 
     foreach (jar_name ${_jar_names})
         foreach (version ${_jar_versions})
             set(_jar_files ${_jar_files} ${jar_name}-${version}.jar)
-        endforeach (version ${_jar_versions})
+        endforeach ()
         set(_jar_files ${_jar_files} ${jar_name}.jar)
-    endforeach (jar_name ${_jar_names})
+    endforeach ()
 
     find_file(${VARIABLE}
         NAMES   ${_jar_files}
         PATHS   ${_jar_paths}
         DOC     ${_jar_doc}
         NO_DEFAULT_PATH)
-endfunction (find_jar VARIABLE)
+endfunction ()
 
 function(create_javadoc _target)
     set(_javadoc_packages)
@@ -815,8 +815,8 @@ function(create_javadoc _target)
             else ()
                 set(_javadoc_version ${arg})
             endif ()
-        endif (${_state} STREQUAL "package")
-    endforeach (arg ${ARGN})
+        endif ()
+    endforeach ()
 
     set(_javadoc_builddir ${CMAKE_CURRENT_BINARY_DIR}/javadoc/${_target})
     set(_javadoc_options -d ${_javadoc_builddir})
@@ -827,12 +827,12 @@ function(create_javadoc _target)
             if (_start)
                 set(_sourcepath ${_path})
                 set(_start FALSE)
-            else (_start)
+            else ()
                 set(_sourcepath ${_sourcepath}:${_path})
-            endif (_start)
-        endforeach(_path ${_javadoc_sourcepath})
+            endif ()
+        endforeach()
         set(_javadoc_options ${_javadoc_options} -sourcepath ${_sourcepath})
-    endif (_javadoc_sourcepath)
+    endif ()
 
     if (_javadoc_classpath)
         set(_start TRUE)
@@ -840,32 +840,32 @@ function(create_javadoc _target)
             if (_start)
                 set(_classpath ${_path})
                 set(_start FALSE)
-            else (_start)
+            else ()
                 set(_classpath ${_classpath}:${_path})
-            endif (_start)
-        endforeach(_path ${_javadoc_classpath})
+            endif ()
+        endforeach()
         set(_javadoc_options ${_javadoc_options} -classpath "${_classpath}")
-    endif (_javadoc_classpath)
+    endif ()
 
     if (_javadoc_doctitle)
         set(_javadoc_options ${_javadoc_options} -doctitle '${_javadoc_doctitle}')
-    endif (_javadoc_doctitle)
+    endif ()
 
     if (_javadoc_windowtitle)
         set(_javadoc_options ${_javadoc_options} -windowtitle '${_javadoc_windowtitle}')
-    endif (_javadoc_windowtitle)
+    endif ()
 
     if (_javadoc_author)
         set(_javadoc_options ${_javadoc_options} -author)
-    endif (_javadoc_author)
+    endif ()
 
     if (_javadoc_use)
         set(_javadoc_options ${_javadoc_options} -use)
-    endif (_javadoc_use)
+    endif ()
 
     if (_javadoc_version)
         set(_javadoc_options ${_javadoc_options} -version)
-    endif (_javadoc_version)
+    endif ()
 
     add_custom_target(${_target}_javadoc ALL
         COMMAND ${Java_JAVADOC_EXECUTABLE} ${_javadoc_options}
@@ -878,4 +878,4 @@ function(create_javadoc _target)
         DIRECTORY ${_javadoc_builddir}
         DESTINATION ${_javadoc_installpath}
     )
-endfunction(create_javadoc)
+endfunction()
diff --git a/Modules/UseJavaClassFilelist.cmake b/Modules/UseJavaClassFilelist.cmake
index c842bf71a..6f3a4e7a9 100644
--- a/Modules/UseJavaClassFilelist.cmake
+++ b/Modules/UseJavaClassFilelist.cmake
@@ -28,25 +28,25 @@ if (CMAKE_JAVA_CLASS_OUTPUT_PATH)
                 file(GLOB_RECURSE _JAVA_GLOBBED_TMP_FILES "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/${JAR_CLASS_PREFIX}/*.class")
                 if (_JAVA_GLOBBED_TMP_FILES)
                     list(APPEND _JAVA_GLOBBED_FILES ${_JAVA_GLOBBED_TMP_FILES})
-                endif (_JAVA_GLOBBED_TMP_FILES)
-            endforeach(JAR_CLASS_PREFIX ${CMAKE_JAR_CLASSES_PREFIX})
+                endif ()
+            endforeach()
         else()
             file(GLOB_RECURSE _JAVA_GLOBBED_FILES "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/*.class")
-        endif (CMAKE_JAR_CLASSES_PREFIX)
+        endif ()
 
         set(_JAVA_CLASS_FILES)
         # file(GLOB_RECURSE foo RELATIVE) is broken so we need this.
         foreach(_JAVA_GLOBBED_FILE ${_JAVA_GLOBBED_FILES})
             file(RELATIVE_PATH _JAVA_CLASS_FILE ${CMAKE_JAVA_CLASS_OUTPUT_PATH} ${_JAVA_GLOBBED_FILE})
             set(_JAVA_CLASS_FILES ${_JAVA_CLASS_FILES}${_JAVA_CLASS_FILE}\n)
-        endforeach(_JAVA_GLOBBED_FILE ${_JAVA_GLOBBED_FILES})
+        endforeach()
 
         # write to file
         file(WRITE ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist ${_JAVA_CLASS_FILES})
 
-    else (EXISTS "${CMAKE_JAVA_CLASS_OUTPUT_PATH}")
+    else ()
         message(SEND_ERROR "FATAL: Java class output path doesn't exist")
-    endif (EXISTS "${CMAKE_JAVA_CLASS_OUTPUT_PATH}")
-else (CMAKE_JAVA_CLASS_OUTPUT_PATH)
+    endif ()
+else ()
     message(SEND_ERROR "FATAL: Can't find CMAKE_JAVA_CLASS_OUTPUT_PATH")
-endif (CMAKE_JAVA_CLASS_OUTPUT_PATH)
+endif ()
diff --git a/Modules/UseJavaSymlinks.cmake b/Modules/UseJavaSymlinks.cmake
index c66ee1ea1..88dd7689c 100644
--- a/Modules/UseJavaSymlinks.cmake
+++ b/Modules/UseJavaSymlinks.cmake
@@ -26,7 +26,7 @@ if (UNIX AND _JAVA_TARGET_OUTPUT_LINK)
             COMMAND ${LN_EXECUTABLE} -sf "${_JAVA_TARGET_OUTPUT_NAME}" "${_JAVA_TARGET_OUTPUT_LINK}"
             WORKING_DIRECTORY ${_JAVA_TARGET_DIR}
         )
-    else (_JAVA_TARGET_OUTPUT_NAME)
+    else ()
         message(SEND_ERROR "FATAL: Can't find _JAVA_TARGET_OUTPUT_NAME")
-    endif (_JAVA_TARGET_OUTPUT_NAME)
-endif (UNIX AND _JAVA_TARGET_OUTPUT_LINK)
+    endif ()
+endif ()
diff --git a/Modules/UsePkgConfig.cmake b/Modules/UsePkgConfig.cmake
index b4517f75f..b1569f9da 100644
--- a/Modules/UsePkgConfig.cmake
+++ b/Modules/UsePkgConfig.cmake
@@ -60,19 +60,19 @@ macro(PKGCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags)
         OUTPUT_VARIABLE ${_cflags} )
       string(REGEX REPLACE "[\r\n]" " " ${_cflags} "${${_cflags}}")
 
-    else( NOT _return_VALUE)
+    else()
 
       message(STATUS "PKGCONFIG() indicates that ${_package} is not installed (install the package which contains ${_package}.pc if you want to support this feature)")
 
-    endif(NOT _return_VALUE)
+    endif()
 
   # if pkg-config has NOT been found, INFORM the user
-  else(PKGCONFIG_EXECUTABLE)
+  else()
 
     message(STATUS "WARNING: PKGCONFIG() indicates that the tool pkg-config has not been found on your system. You should install it.")
 
-  endif(PKGCONFIG_EXECUTABLE)
+  endif()
 
-endmacro(PKGCONFIG _include_DIR _link_DIR _link_FLAGS _cflags)
+endmacro()
 
 mark_as_advanced(PKGCONFIG_EXECUTABLE)
diff --git a/Modules/UseQt4.cmake b/Modules/UseQt4.cmake
index 260c3cd29..e8166f4fc 100644
--- a/Modules/UseQt4.cmake
+++ b/Modules/UseQt4.cmake
@@ -33,24 +33,24 @@ set(QT_LIBRARIES_PLUGINS "")
 if (QT_USE_QTMAIN)
   if (Q_WS_WIN)
     set(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY})
-  endif (Q_WS_WIN)
-endif (QT_USE_QTMAIN)
+  endif ()
+endif ()
 
 if(QT_DONT_USE_QTGUI)
   set(QT_USE_QTGUI 0)
-else(QT_DONT_USE_QTGUI)
+else()
   set(QT_USE_QTGUI 1)
-endif(QT_DONT_USE_QTGUI)
+endif()
 
 if(QT_DONT_USE_QTCORE)
   set(QT_USE_QTCORE 0)
-else(QT_DONT_USE_QTCORE)
+else()
   set(QT_USE_QTCORE 1)
-endif(QT_DONT_USE_QTCORE)
+endif()
 
 if (QT_USE_QT3SUPPORT)
   add_definitions(-DQT3_SUPPORT)
-endif (QT_USE_QT3SUPPORT)
+endif ()
 
 # list dependent modules, so dependent libraries are added
 set(QT_QT3SUPPORT_MODULE_DEPENDS QTGUI QTSQL QTXML QTNETWORK QTCORE)
@@ -59,9 +59,9 @@ set(QT_QTUITOOLS_MODULE_DEPENDS QTGUI QTXML QTCORE)
 set(QT_QTHELP_MODULE_DEPENDS QTGUI QTSQL QTXML QTNETWORK QTCORE)
 if(QT_QTDBUS_FOUND)
   set(QT_PHONON_MODULE_DEPENDS QTGUI QTDBUS QTCORE)
-else(QT_QTDBUS_FOUND)
+else()
   set(QT_PHONON_MODULE_DEPENDS QTGUI QTCORE)
-endif(QT_QTDBUS_FOUND)
+endif()
 set(QT_QTDBUS_MODULE_DEPENDS QTXML QTCORE)
 set(QT_QTXMLPATTERNS_MODULE_DEPENDS QTNETWORK QTCORE)
 set(QT_QAXCONTAINER_MODULE_DEPENDS QTGUI QTCORE)
@@ -90,19 +90,19 @@ foreach(module QT3SUPPORT QTOPENGL QTASSISTANT QTDESIGNER QTMOTIF QTNSPLUGIN
         string(REPLACE "QT" "" qt_module_def "${module}")
         add_definitions(-DQT_${qt_module_def}_LIB)
         include_directories(${QT_${module}_INCLUDE_DIR})
-      endif(QT_USE_${module})
+      endif()
       set(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIBRARY})
       set(QT_LIBRARIES_PLUGINS ${QT_LIBRARIES_PLUGINS} ${QT_${module}_PLUGINS})
       if(QT_IS_STATIC)
         set(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIB_DEPENDENCIES})
-      endif(QT_IS_STATIC)
+      endif()
       foreach(depend_module ${QT_${module}_MODULE_DEPENDS})
         set(QT_USE_${depend_module}_DEPENDS 1)
-      endforeach(depend_module ${QT_${module}_MODULE_DEPENDS})
-    else (QT_${module}_FOUND)
+      endforeach()
+    else ()
       message("Qt ${module} library not found.")
-    endif (QT_${module}_FOUND)
-  endif (QT_USE_${module} OR QT_USE_${module}_DEPENDS)
+    endif ()
+  endif ()
 
-endforeach(module)
+endforeach()
 
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index e4e72c2aa..2a095854c 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -58,7 +58,7 @@ macro(SWIG_MODULE_INITIALIZE name language)
   elseif("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "PERL")
     set(SWIG_MODULE_${name}_EXTRA_FLAGS "-shadow")
   endif()
-endmacro(SWIG_MODULE_INITIALIZE)
+endmacro()
 
 #
 # For a given language, input file, and output file, determine extra files that
@@ -71,12 +71,12 @@ macro(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile)
     ${infile} SWIG_MODULE_NAME)
   if(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename STREQUAL "NOTFOUND")
     get_filename_component(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename "${infile}" NAME_WE)
-  endif(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename STREQUAL "NOTFOUND")
+  endif()
   foreach(it ${SWIG_${language}_EXTRA_FILE_EXTENSION})
     set(${outfiles} ${${outfiles}}
       "${generatedpath}/${SWIG_GET_EXTRA_OUTPUT_FILES_module_basename}.${it}")
-  endforeach(it)
-endmacro(SWIG_GET_EXTRA_OUTPUT_FILES)
+  endforeach()
+endmacro()
 
 #
 # Take swig (*.i) file and add proper custom commands for it
@@ -90,42 +90,42 @@ macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
   get_source_file_property(swig_source_file_flags ${infile} SWIG_FLAGS)
   if("${swig_source_file_flags}" STREQUAL "NOTFOUND")
     set(swig_source_file_flags "")
-  endif("${swig_source_file_flags}" STREQUAL "NOTFOUND")
+  endif()
   set(swig_source_file_fullname "${infile}")
   if(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}")
     string(REGEX REPLACE
       "^${CMAKE_CURRENT_SOURCE_DIR}" ""
       swig_source_file_relative_path
       "${swig_source_file_path}")
-  else(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}")
+  else()
     if(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_BINARY_DIR}")
       string(REGEX REPLACE
         "^${CMAKE_CURRENT_BINARY_DIR}" ""
         swig_source_file_relative_path
         "${swig_source_file_path}")
       set(swig_source_file_generated 1)
-    else(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_BINARY_DIR}")
+    else()
       set(swig_source_file_relative_path "${swig_source_file_path}")
       if(swig_source_file_generated)
         set(swig_source_file_fullname "${CMAKE_CURRENT_BINARY_DIR}/${infile}")
-      else(swig_source_file_generated)
+      else()
         set(swig_source_file_fullname "${CMAKE_CURRENT_SOURCE_DIR}/${infile}")
-      endif(swig_source_file_generated)
-    endif(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_BINARY_DIR}")
-  endif(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}")
+      endif()
+    endif()
+  endif()
 
   set(swig_generated_file_fullname
     "${CMAKE_CURRENT_BINARY_DIR}")
   if(swig_source_file_relative_path)
     set(swig_generated_file_fullname
       "${swig_generated_file_fullname}/${swig_source_file_relative_path}")
-  endif(swig_source_file_relative_path)
+  endif()
   # If CMAKE_SWIG_OUTDIR was specified then pass it to -outdir
   if(CMAKE_SWIG_OUTDIR)
     set(swig_outdir ${CMAKE_SWIG_OUTDIR})
-  else(CMAKE_SWIG_OUTDIR)
+  else()
     set(swig_outdir ${CMAKE_CURRENT_BINARY_DIR})
-  endif(CMAKE_SWIG_OUTDIR)
+  endif()
   SWIG_GET_EXTRA_OUTPUT_FILES(${SWIG_MODULE_${name}_LANGUAGE}
     swig_extra_generated_files
     "${swig_outdir}"
@@ -140,10 +140,10 @@ macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
   if(swig_source_file_cplusplus)
     set(swig_generated_file_fullname
       "${swig_generated_file_fullname}.${SWIG_CXX_EXTENSION}")
-  else(swig_source_file_cplusplus)
+  else()
     set(swig_generated_file_fullname
       "${swig_generated_file_fullname}.c")
-  endif(swig_source_file_cplusplus)
+  endif()
 
   #message("Full path to source file: ${swig_source_file_fullname}")
   #message("Full path to the output file: ${swig_generated_file_fullname}")
@@ -151,17 +151,17 @@ macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
   set(swig_include_dirs)
   foreach(it ${cmake_include_directories})
     set(swig_include_dirs ${swig_include_dirs} "-I${it}")
-  endforeach(it)
+  endforeach()
 
   set(swig_special_flags)
   # default is c, so add c++ flag if it is c++
   if(swig_source_file_cplusplus)
     set(swig_special_flags ${swig_special_flags} "-c++")
-  endif(swig_source_file_cplusplus)
+  endif()
   set(swig_extra_flags)
   if(SWIG_MODULE_${name}_EXTRA_FLAGS)
     set(swig_extra_flags ${swig_extra_flags} ${SWIG_MODULE_${name}_EXTRA_FLAGS})
-  endif(SWIG_MODULE_${name}_EXTRA_FLAGS)
+  endif()
   add_custom_command(
     OUTPUT "${swig_generated_file_fullname}" ${swig_extra_generated_files}
     # Let's create the ${swig_outdir} at execution time, in case dir contains $(OutDir)
@@ -182,7 +182,7 @@ macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
   set_source_files_properties("${swig_generated_file_fullname}" ${swig_extra_generated_files}
     PROPERTIES GENERATED 1)
   set(${outfiles} "${swig_generated_file_fullname}" ${swig_extra_generated_files})
-endmacro(SWIG_ADD_SOURCE_TO_MODULE)
+endmacro()
 
 #
 # Create Swig module
@@ -194,16 +194,16 @@ macro(SWIG_ADD_MODULE name language)
   foreach(it ${ARGN})
     if(${it} MATCHES ".*\\.i$")
       set(swig_dot_i_sources ${swig_dot_i_sources} "${it}")
-    else(${it} MATCHES ".*\\.i$")
+    else()
       set(swig_other_sources ${swig_other_sources} "${it}")
-    endif(${it} MATCHES ".*\\.i$")
-  endforeach(it)
+    endif()
+  endforeach()
 
   set(swig_generated_sources)
   foreach(it ${swig_dot_i_sources})
     SWIG_ADD_SOURCE_TO_MODULE(${name} swig_generated_source ${it})
     set(swig_generated_sources ${swig_generated_sources} "${swig_generated_source}")
-  endforeach(it)
+  endforeach()
   get_directory_property(swig_extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES)
   set_directory_properties(PROPERTIES
     ADDITIONAL_MAKE_CLEAN_FILES "${swig_extra_clean_files};${swig_generated_sources}")
@@ -221,8 +221,8 @@ macro(SWIG_ADD_MODULE name language)
         #   Windows: LIBRARY.dll
         #   Linux  : libLIBRARY.so
         set_target_properties (${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".jnilib")
-      endif (APPLE)
-  endif ("${swig_lowercase_language}" STREQUAL "java")
+      endif ()
+  endif ()
   if ("${swig_lowercase_language}" STREQUAL "python")
     # this is only needed for the python case where a _modulename.so is generated
     set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES PREFIX "")
@@ -236,9 +236,9 @@ macro(SWIG_ADD_MODULE name language)
     # </quote>
     if(WIN32 AND NOT CYGWIN)
       set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".pyd")
-    endif(WIN32 AND NOT CYGWIN)
-  endif ("${swig_lowercase_language}" STREQUAL "python")
-endmacro(SWIG_ADD_MODULE)
+    endif()
+  endif ()
+endmacro()
 
 #
 # Like TARGET_LINK_LIBRARIES but for swig modules
@@ -246,8 +246,8 @@ endmacro(SWIG_ADD_MODULE)
 macro(SWIG_LINK_LIBRARIES name)
   if(SWIG_MODULE_${name}_REAL_NAME)
     target_link_libraries(${SWIG_MODULE_${name}_REAL_NAME} ${ARGN})
-  else(SWIG_MODULE_${name}_REAL_NAME)
+  else()
     message(SEND_ERROR "Cannot find Swig library \"${name}\".")
-  endif(SWIG_MODULE_${name}_REAL_NAME)
-endmacro(SWIG_LINK_LIBRARIES name)
+  endif()
+endmacro()
 
diff --git a/Modules/UseVTKConfig40.cmake b/Modules/UseVTKConfig40.cmake
index 549a792e3..554b8c447 100644
--- a/Modules/UseVTKConfig40.cmake
+++ b/Modules/UseVTKConfig40.cmake
@@ -160,28 +160,28 @@ set(VTK_WRAP_TCL ${VTK40_VTK_WRAP_TCL})
 set(VTK_KITS COMMON FILTERING GRAPHICS IMAGING IO)
 if(VTK_USE_RENDERING)
   set(VTK_KITS ${VTK_KITS} RENDERING)
-endif(VTK_USE_RENDERING)
+endif()
 if(VTK_USE_HYBRID)
   set(VTK_KITS ${VTK_KITS} HYBRID)
-endif(VTK_USE_HYBRID)
+endif()
 if(VTK_USE_PARALLEL)
   set(VTK_KITS ${VTK_KITS} PARALLEL)
-endif(VTK_USE_PARALLEL)
+endif()
 if(VTK_USE_PATENTED)
   set(VTK_KITS ${VTK_KITS} PATENTED)
-endif(VTK_USE_PATENTED)
+endif()
 
 # Create the list of available languages.
 set(VTK_LANGUAGES "")
 if(VTK_WRAP_TCL)
   set(VTK_LANGUAGES ${VTK_LANGUAGES} TCL)
-endif(VTK_WRAP_TCL)
+endif()
 if(VTK_WRAP_PYTHON)
   set(VTK_LANGUAGES ${VTK_LANGUAGES} PYTHON)
-endif(VTK_WRAP_PYTHON)
+endif()
 if(VTK_WRAP_JAVA)
   set(VTK_LANGUAGES ${VTK_LANGUAGES} JAVA)
-endif(VTK_WRAP_JAVA)
+endif()
 
 # Include directories for other projects installed on the system and
 # used by VTK.
@@ -192,40 +192,40 @@ if(VTK_USE_RENDERING)
   if(VTK_USE_X)
     set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
         ${VTK40_CMAKE_Xlib_INCLUDE_PATH} ${VTK40_CMAKE_Xutil_INCLUDE_PATH})
-  endif(VTK_USE_X)
-endif(VTK_USE_RENDERING)
+  endif()
+endif()
 
 if(VTK_OPENGL_HAS_OSMESA)
   set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
       ${VTK40_OSMESA_INCLUDE_PATH})
-endif(VTK_OPENGL_HAS_OSMESA)
+endif()
 
 if(VTK_USE_MPI)
   set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_MPI_INCLUDE_PATH})
-endif(VTK_USE_MPI)
+endif()
 
 if(VTK_WRAP_TCL)
   set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_TCL_INCLUDE_PATH})
-endif(VTK_WRAP_TCL)
+endif()
 
 if(VTK_WRAP_PYTHON)
   set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS} ${VTK40_PYTHON_INCLUDE_PATH})
-endif(VTK_WRAP_PYTHON)
+endif()
 
 if(VTK_WRAP_JAVA)
   set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
       ${VTK40_JAVA_INCLUDE_PATH} ${VTK40_JAVA_INCLUDE_PATH2})
-endif(VTK_WRAP_JAVA)
+endif()
 
 if(VTK_HAVE_VG500)
   set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
       ${VTK40_VLI_INCLUDE_PATH_FOR_VG500})
-endif(VTK_HAVE_VG500)
+endif()
 
 if(VTK_HAVE_VP1000)
   set(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
       ${VTK40_VLI_INCLUDE_PATH_FOR_VP1000})
-endif(VTK_HAVE_VP1000)
+endif()
 
 # See if this is a build tree or install tree.
 if(EXISTS ${VTK_DIR}/Common)
@@ -237,16 +237,16 @@ if(EXISTS ${VTK_DIR}/Common)
   set(VTK_INCLUDE_DIRS ${VTK40_VTK_BINARY_DIR})
   if(VTK_USE_PARALLEL)
     set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Parallel)
-  endif(VTK_USE_PARALLEL)
+  endif()
   if(VTK_USE_HYBRID)
     set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Hybrid)
-  endif(VTK_USE_HYBRID)
+  endif()
   if(VTK_USE_PATENTED)
     set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Patented)
-  endif(VTK_USE_PATENTED)
+  endif()
   if(VTK_USE_RENDERING)
     set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK40_VTK_SOURCE_DIR}/Rendering)
-  endif(VTK_USE_RENDERING)
+  endif()
 
   # These directories are always needed.
   set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS}
@@ -268,16 +268,16 @@ if(EXISTS ${VTK_DIR}/Common)
     set(VTK_TCL_EXE ${VTK40_EXECUTABLE_OUTPUT_PATH}/vtk)
     set(VTK_WRAP_TCL_EXE ${VTK40_VTK_WRAP_TCL_EXE})
     set(VTK_TCL_HOME ${VTK40_VTK_SOURCE_DIR}/Wrapping/Tcl)
-  endif(VTK_WRAP_TCL)
+  endif()
   if(VTK_WRAP_PYTHON)
     set(VTK_WRAP_PYTHON_EXE ${VTK40_VTK_WRAP_PYTHON_EXE})
-  endif(VTK_WRAP_PYTHON)
+  endif()
   if(VTK_WRAP_JAVA)
     set(VTK_PARSE_JAVA_EXE ${VTK40_VTK_PARSE_JAVA_EXE})
     set(VTK_WRAP_JAVA_EXE ${VTK40_VTK_WRAP_JAVA_EXE})
-  endif(VTK_WRAP_JAVA)
+  endif()
 
-else(EXISTS ${VTK_DIR}/Common)
+else()
   # This is a VTK 4.0 install tree.
 
   set(VTK_INCLUDE_DIRS ${VTK_DIR})
@@ -288,15 +288,15 @@ else(EXISTS ${VTK_DIR}/Common)
     set(VTK_TCL_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtk)
     set(VTK_WRAP_TCL_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkWrapTcl)
     set(VTK_TCL_HOME ${VTK40_CMAKE_INSTALL_PREFIX}/lib/vtk/tcl)
-  endif(VTK_WRAP_TCL)
+  endif()
   if(VTK_WRAP_PYTHON)
     set(VTK_WRAP_PYTHON_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkWrapPython)
-  endif(VTK_WRAP_PYTHON)
+  endif()
   if(VTK_WRAP_JAVA)
     set(VTK_PARSE_JAVA_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkParseJava)
     set(VTK_WRAP_JAVA_EXE ${VTK40_CMAKE_INSTALL_PREFIX}/bin/vtkWrapJava)
-  endif(VTK_WRAP_JAVA)
-endif(EXISTS ${VTK_DIR}/Common)
+  endif()
+endif()
 
 # Add the system include directories last.
 set(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK_INCLUDE_DIRS_SYS})
@@ -307,23 +307,23 @@ if(CMAKE_COMPILER_IS_GNUCXX)
     # The platform is gcc on cygwin.
     set(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} -mwin32")
     set(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} -mwin32")
-  endif(WIN32)
-else(CMAKE_COMPILER_IS_GNUCXX)
+  endif()
+else()
   if(CMAKE_ANSI_CFLAGS)
     set(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
-  endif(CMAKE_ANSI_CFLAGS)
+  endif()
   if(CMAKE_SYSTEM MATCHES "OSF1-V.*")
      set(VTK_REQUIRED_CXX_FLAGS
          "${VTK_REQUIRED_CXX_FLAGS} -timplicit_local -no_implicit_include")
-  endif(CMAKE_SYSTEM MATCHES "OSF1-V.*")
-endif(CMAKE_COMPILER_IS_GNUCXX)
+  endif()
+endif()
 
 if(VTK_USE_X)
   if(CMAKE_X_CFLAGS)
     set(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} ${CMAKE_X_CFLAGS}")
     set(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} ${CMAKE_X_CFLAGS}")
-  endif(CMAKE_X_CFLAGS)
-endif(VTK_USE_X)
+  endif()
+endif()
 
 # Copy library dependencies.
 set(vtkCommonJava_LIB_DEPENDS "${VTK40_vtkCommonJava_LIB_DEPENDS}")
diff --git a/Modules/Use_wxWindows.cmake b/Modules/Use_wxWindows.cmake
index 681fe28e3..6c95681e2 100644
--- a/Modules/Use_wxWindows.cmake
+++ b/Modules/Use_wxWindows.cmake
@@ -45,20 +45,20 @@ if(WXWINDOWS_FOUND)
 
  if(WXWINDOWS_INCLUDE_DIR)
     include_directories(${WXWINDOWS_INCLUDE_DIR})
-  endif(WXWINDOWS_INCLUDE_DIR)
+  endif()
  if(WXWINDOWS_LINK_DIRECTORIES)
     link_directories(${WXWINDOWS_LINK_DIRECTORIES})
-  endif(WXWINDOWS_LINK_DIRECTORIES)
+  endif()
   if(WXWINDOWS_LIBRARIES)
     link_libraries(${WXWINDOWS_LIBRARIES})
-  endif(WXWINDOWS_LIBRARIES)
+  endif()
   if (CMAKE_WXWINDOWS_CXX_FLAGS)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_WXWINDOWS_CXX_FLAGS}")
-  endif(CMAKE_WXWINDOWS_CXX_FLAGS)
+  endif()
   if(WXWINDOWS_DEFINITIONS)
     add_definitions(${WXWINDOWS_DEFINITIONS})
-  endif(WXWINDOWS_DEFINITIONS)
-else(WXWINDOWS_FOUND)
+  endif()
+else()
   message(SEND_ERROR "wxWindows not found by Use_wxWindows.cmake")
-endif(WXWINDOWS_FOUND)
+endif()
 
diff --git a/Modules/UsewxWidgets.cmake b/Modules/UsewxWidgets.cmake
index 82a008513..bb8c29b3e 100644
--- a/Modules/UsewxWidgets.cmake
+++ b/Modules/UsewxWidgets.cmake
@@ -33,11 +33,11 @@
 # comment these out for distribution
 if    (NOT LOGFILE )
   #  set(LOGFILE "${PROJECT_BINARY_DIR}/CMakeOutput.log")
-endif (NOT LOGFILE )
+endif ()
 macro(MSG _MSG)
   #  file(APPEND ${LOGFILE} "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}):   ${_MSG}\n")
   #  message(STATUS "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}")
-endmacro(MSG)
+endmacro()
 
 
 MSG("wxWidgets_FOUND=${wxWidgets_FOUND}")
@@ -45,33 +45,33 @@ if   (wxWidgets_FOUND)
   if   (wxWidgets_INCLUDE_DIRS)
     if(wxWidgets_INCLUDE_DIRS_NO_SYSTEM)
       include_directories(${wxWidgets_INCLUDE_DIRS})
-    else(wxWidgets_INCLUDE_DIRS_NO_SYSTEM)
+    else()
       include_directories(SYSTEM ${wxWidgets_INCLUDE_DIRS})
-    endif(wxWidgets_INCLUDE_DIRS_NO_SYSTEM)
+    endif()
     MSG("wxWidgets_INCLUDE_DIRS=${wxWidgets_INCLUDE_DIRS}")
-  endif(wxWidgets_INCLUDE_DIRS)
+  endif()
 
   if   (wxWidgets_LIBRARY_DIRS)
     link_directories(${wxWidgets_LIBRARY_DIRS})
     MSG("wxWidgets_LIBRARY_DIRS=${wxWidgets_LIBRARY_DIRS}")
-  endif(wxWidgets_LIBRARY_DIRS)
+  endif()
 
   if   (wxWidgets_DEFINITIONS)
     set_property(DIRECTORY APPEND
       PROPERTY COMPILE_DEFINITIONS ${wxWidgets_DEFINITIONS})
     MSG("wxWidgets_DEFINITIONS=${wxWidgets_DEFINITIONS}")
-  endif(wxWidgets_DEFINITIONS)
+  endif()
 
   if   (wxWidgets_DEFINITIONS_DEBUG)
     set_property(DIRECTORY APPEND
       PROPERTY COMPILE_DEFINITIONS_DEBUG ${wxWidgets_DEFINITIONS_DEBUG})
     MSG("wxWidgets_DEFINITIONS_DEBUG=${wxWidgets_DEFINITIONS_DEBUG}")
-  endif(wxWidgets_DEFINITIONS_DEBUG)
+  endif()
 
   if   (wxWidgets_CXX_FLAGS)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${wxWidgets_CXX_FLAGS}")
     MSG("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}")
-  endif(wxWidgets_CXX_FLAGS)
+  endif()
 
   # DEPRECATED JW
   # just for backward compatibility: add deps to all targets
@@ -81,9 +81,9 @@ if   (wxWidgets_FOUND)
   #  # BUG: str too long:  MSG("wxWidgets_LIBRARIES=${wxWidgets_LIBRARIES}")
   #  if(LOGFILE)
   #    file(APPEND ${LOGFILE} "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}):   ${wxWidgets_LIBRARIES}\n")
-  #  endif(LOGFILE)
-  #endif(wxWidgets_LIBRARIES)
+  #  endif()
+  #endif()
 
-else (wxWidgets_FOUND)
+else ()
   message("wxWidgets requested but not found.")
-endif(wxWidgets_FOUND)
+endif()
diff --git a/Modules/VTKCompatibility.cmake b/Modules/VTKCompatibility.cmake
index e1abfbb9f..b33bf2e16 100644
--- a/Modules/VTKCompatibility.cmake
+++ b/Modules/VTKCompatibility.cmake
@@ -21,7 +21,7 @@ if(APPLE)
   string( REGEX REPLACE "CMAKE_C_COMPILER"
     CMAKE_CXX_COMPILER CMAKE_CXX_CREATE_SHARED_LIBRARY
     "${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
-endif(APPLE)
+endif()
 
 set(VTKFTGL_BINARY_DIR "${VTK_BINARY_DIR}/Utilities/ftgl"
   CACHE INTERNAL "")
@@ -48,5 +48,5 @@ set(TIFF_RIGHT_VERSION 1)
 # for very old VTK (versions prior to 4.2)
 macro(SOURCE_FILES)
   message (FATAL_ERROR "You are trying to build a very old version of VTK (prior to VTK 4.2). To do this you need to use CMake 2.0 as it was the last version of CMake to support VTK 4.0.")
-endmacro(SOURCE_FILES)
+endmacro()
 
diff --git a/Modules/WriteBasicConfigVersionFile.cmake b/Modules/WriteBasicConfigVersionFile.cmake
index 038cb5798..4466cd797 100644
--- a/Modules/WriteBasicConfigVersionFile.cmake
+++ b/Modules/WriteBasicConfigVersionFile.cmake
@@ -28,7 +28,7 @@ function(WRITE_BASIC_CONFIG_VERSION_FILE _filename)
 
   if(CVF_UNPARSED_ARGUMENTS)
     message(FATAL_ERROR "Unknown keywords given to WRITE_BASIC_CONFIG_VERSION_FILE(): \"${CVF_UNPARSED_ARGUMENTS}\"")
-  endif(CVF_UNPARSED_ARGUMENTS)
+  endif()
 
   set(versionTemplateFile "${CMAKE_ROOT}/Modules/BasicConfigVersion-${CVF_COMPATIBILITY}.cmake.in")
   if(NOT EXISTS "${versionTemplateFile}")
@@ -41,4 +41,4 @@ function(WRITE_BASIC_CONFIG_VERSION_FILE _filename)
 
   configure_file("${versionTemplateFile}" "${_filename}" @ONLY)
 
-endfunction(WRITE_BASIC_CONFIG_VERSION_FILE)
+endfunction()
diff --git a/Modules/ecos_clean.cmake b/Modules/ecos_clean.cmake
index 7a563ae23..37a1f93c2 100644
--- a/Modules/ecos_clean.cmake
+++ b/Modules/ecos_clean.cmake
@@ -21,6 +21,6 @@ foreach(_entry ${_files})
       get_filename_component(dir ${_entry} NAME)
       if(${dir} MATCHES "^[a-z]+$")
          file(REMOVE_RECURSE ${_entry})
-      endif(${dir} MATCHES "^[a-z]+$")
-   endif(IS_DIRECTORY ${_entry})
-endforeach(_entry)
+      endif()
+   endif()
+endforeach()
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 106e78f12..e79689b08 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -14,9 +14,9 @@ include(CheckIncludeFile)
 CHECK_INCLUDE_FILE("elf.h" HAVE_ELF_H)
 if(HAVE_ELF_H)
   set(CMAKE_USE_ELF_PARSER 1)
-else(HAVE_ELF_H)
+else()
   set(CMAKE_USE_ELF_PARSER)
-endif(HAVE_ELF_H)
+endif()
 
 set(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR})
 
@@ -65,7 +65,7 @@ if(CMAKE_REGENERATE_YACCLEX)
     set(BISON_FLAGS)
     if(YACC_EXECUTABLE MATCHES "bison")
       set(BISON_FLAGS "--yacc")
-    endif(YACC_EXECUTABLE MATCHES "bison")
+    endif()
     set(yacc_files)
     foreach(name ${parsersLexers})
       set(src "${CMAKE_CURRENT_SOURCE_DIR}/${name}Parser.y")
@@ -79,9 +79,9 @@ if(CMAKE_REGENERATE_YACCLEX)
         --name-prefix=${name}_yy --defines=${hdr} -o${dst} ${src}
         )
       set(yacc_files ${yacc_files} "${dst}")
-    endforeach(name)
+    endforeach()
     add_custom_target(RerunYacc DEPENDS ${yacc_files})
-  endif(YACC_EXECUTABLE)
+  endif()
   if(FLEX_EXECUTABLE)
     set(lex_files)
     foreach(name ${parsersLexers})
@@ -96,16 +96,16 @@ if(CMAKE_REGENERATE_YACCLEX)
         --prefix=${name}_yy --header-file=${hdr} -o${dst} ${src}
         )
       set(lex_files ${lex_files} "${dst}")
-    endforeach(name)
+    endforeach()
     add_custom_target(RerunLex DEPENDS ${lex_files})
-  endif(FLEX_EXECUTABLE)
+  endif()
 
-endif(CMAKE_REGENERATE_YACCLEX)
+endif()
 
 # Check if we can build the ELF parser.
 if(CMAKE_USE_ELF_PARSER)
   set(ELF_SRCS cmELF.h cmELF.cxx)
-endif(CMAKE_USE_ELF_PARSER)
+endif()
 
 #
 # Sources for CMakeLib
@@ -277,7 +277,7 @@ set(SRCS
 # Kdevelop only works on UNIX and not windows
 if(UNIX)
   set(SRCS ${SRCS} cmGlobalKdevelopGenerator.cxx)
-endif(UNIX)
+endif()
 
 # Xcode only works on Apple
 if(APPLE)
@@ -288,7 +288,7 @@ if(APPLE)
     cmGlobalXCodeGenerator.h
     cmLocalXCodeGenerator.cxx
     cmLocalXCodeGenerator.h)
-endif(APPLE)
+endif()
 
 
 if (WIN32)
@@ -356,8 +356,8 @@ if (WIN32)
       cmWin32ProcessExecution.cxx
       cmWin32ProcessExecution.h
       )
-  endif(NOT UNIX)
-endif (WIN32)
+  endif()
+endif ()
 
 # Ninja support
 set(SRCS ${SRCS}
@@ -390,12 +390,12 @@ target_link_libraries(CMakeLib cmsys
 # On Apple we need CoreFoundation
 if(APPLE)
   target_link_libraries(CMakeLib "-framework CoreFoundation")
-endif(APPLE)
+endif()
 
 # On some platforms we need the rpcrt4 library for the VS 7 generators.
 if(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW)
   target_link_libraries(CMakeLib rpcrt4)
-endif(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW)
+endif()
 
 #
 # CTestLib
@@ -488,14 +488,14 @@ if(CYGWIN)
     CPack/cmCPackCygwinBinaryGenerator.cxx
     CPack/cmCPackCygwinSourceGenerator.cxx
     )
-endif(CYGWIN)
+endif()
 
 if(UNIX)
   set(CPACK_SRCS ${CPACK_SRCS}
     CPack/cmCPackDebGenerator.cxx
     CPack/cmCPackRPMGenerator.cxx
     )
-endif(UNIX)
+endif()
 
 if(APPLE)
   set(CPACK_SRCS ${CPACK_SRCS}
@@ -504,7 +504,7 @@ if(APPLE)
     CPack/cmCPackOSXX11Generator.cxx
     CPack/cmCPackPackageMakerGenerator.cxx
     )
-endif(APPLE)
+endif()
 
 # Build CPackLib
 add_library(CPackLib ${CPACK_SRCS})
@@ -517,7 +517,7 @@ if(APPLE)
     CPack/OSXScriptLauncher.cxx)
   target_link_libraries(OSXScriptLauncher cmsys)
   target_link_libraries(OSXScriptLauncher "-framework CoreFoundation")
-endif(APPLE)
+endif()
 
 # Build CMake executable
 add_executable(cmake cmakemain.cxx)
@@ -529,8 +529,8 @@ if(WIN32)
     add_executable(cmw9xcom cmw9xcom.cxx)
     target_link_libraries(cmw9xcom CMakeLib)
     install_targets(/bin cmw9xcom)
-  endif(NOT UNIX)
-endif(WIN32)
+  endif()
+endif()
 
 # Build CTest executable
 add_executable(ctest ctest.cxx)
@@ -543,13 +543,13 @@ target_link_libraries(cpack CPackLib)
 # Curses GUI
 if(BUILD_CursesDialog)
   include(${CMake_SOURCE_DIR}/Source/CursesDialog/CMakeLists.txt)
-endif(BUILD_CursesDialog)
+endif()
 
 # Qt GUI
 option(BUILD_QtDialog "Build Qt dialog for CMake" FALSE)
 if(BUILD_QtDialog)
   subdirs(QtDialog)
-endif(BUILD_QtDialog)
+endif()
 
 include (${CMake_BINARY_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
 include (${CMake_SOURCE_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
@@ -559,6 +559,6 @@ install_targets(/bin ctest)
 install_targets(/bin cpack)
 if(APPLE)
   install_targets(/bin cmakexbuild)
-endif(APPLE)
+endif()
 
 install_files(${CMAKE_DATA_DIR}/include cmCPluginAPI.h)
diff --git a/Source/CursesDialog/form/CMakeLists.txt b/Source/CursesDialog/form/CMakeLists.txt
index d5cc1bd07..4e07fa0ff 100644
--- a/Source/CursesDialog/form/CMakeLists.txt
+++ b/Source/CursesDialog/form/CMakeLists.txt
@@ -63,4 +63,4 @@ add_library(cmForm ${FORM_SRCS} )
 target_link_libraries(cmForm ${CURSES_LIBRARY})
 if(CURSES_EXTRA_LIBRARY)
   target_link_libraries(cmForm ${CURSES_EXTRA_LIBRARY})
-endif(CURSES_EXTRA_LIBRARY)
+endif()
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index d962d8d41..0969aea01 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -15,7 +15,7 @@ find_package(Qt4 REQUIRED)
 
 if(NOT QT4_FOUND)
   message(SEND_ERROR "Failed to find Qt 4.4 or greater.")
-else(NOT QT4_FOUND)
+else()
 
   include(${QT_USE_FILE})
   set(CMAKE_PACKAGE_QTGUI TRUE)
@@ -58,13 +58,13 @@ else(NOT QT4_FOUND)
   set(SRCS ${SRCS} ${UI_SRCS} ${MOC_SRCS} ${RC_SRCS})
   if(Q_WS_WIN)
     set(SRCS ${SRCS} CMakeSetup.rc)
-  endif(Q_WS_WIN)
+  endif()
   if(Q_WS_MAC)
     set(SRCS ${SRCS} CMakeSetup.icns)
     set(MACOSX_BUNDLE_ICON_FILE CMakeSetup.icns)
     set_source_files_properties(CMakeSetup.icns PROPERTIES
       MACOSX_PACKAGE_LOCATION Resources)
-  endif(Q_WS_MAC)
+  endif()
 
   include_directories(${CMAKE_CURRENT_BINARY_DIR})
   include_directories(${CMAKE_CURRENT_SOURCE_DIR})
@@ -75,10 +75,10 @@ else(NOT QT4_FOUND)
     if(APPLE)
       set_target_properties(cmake-gui PROPERTIES
        OUTPUT_NAME ${CMAKE_BUNDLE_NAME})
-    endif(APPLE)
+    endif()
     set(CMAKE_INSTALL_DESTINATION_ARGS
       BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}")
-  endif(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4)
+  endif()
 
   install(TARGETS cmake-gui RUNTIME DESTINATION bin ${CMAKE_INSTALL_DESTINATION_ARGS})
 
@@ -88,7 +88,7 @@ else(NOT QT4_FOUND)
     install(FILES CMake.desktop DESTINATION share/applications )
     install(FILES CMakeSetup32.png DESTINATION share/pixmaps )
     install(FILES cmakecache.xml DESTINATION share/mime/packages )
-  endif(UNIX)
+  endif()
 
   if(APPLE)
     set(CMAKE_POSTFLIGHT_SCRIPT
@@ -101,7 +101,7 @@ else(NOT QT4_FOUND)
       "${CMake_BINARY_DIR}/Source/QtDialog/postupgrade.sh")
     install(CODE "execute_process(COMMAND ln -s \"../MacOS/${CMAKE_BUNDLE_NAME}\" cmake-gui
                   WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin)")
-  endif(APPLE)
+  endif()
 
   if(APPLE OR WIN32)
     # install rules for including 3rd party libs such as Qt
@@ -109,15 +109,15 @@ else(NOT QT4_FOUND)
     set(fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin/cmake-gui${CMAKE_EXECUTABLE_SUFFIX}")
     if(APPLE)
       set(fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/MacOS/${CMAKE_BUNDLE_NAME}")
-    endif(APPLE)
+    endif()
     install(CODE "
       include(\"${CMake_SOURCE_DIR}/Modules/BundleUtilities.cmake\")
       set(BU_CHMOD_BUNDLE_ITEMS ON)
       fixup_bundle(\"${fixup_exe}\" \"\" \"${QT_LIBRARY_DIR};${QT_BINARY_DIR}\")
     ")
-  endif(APPLE OR WIN32)
+  endif()
 
   configure_file("${QtDialog_SOURCE_DIR}/QtDialogCPack.cmake.in"
     "${QtDialog_BINARY_DIR}/QtDialogCPack.cmake" @ONLY)
-endif(NOT QT4_FOUND)
+endif()
 
diff --git a/Source/QtDialog/QtDialogCPack.cmake.in b/Source/QtDialog/QtDialogCPack.cmake.in
index f43e1c33d..3196471d7 100644
--- a/Source/QtDialog/QtDialogCPack.cmake.in
+++ b/Source/QtDialog/QtDialogCPack.cmake.in
@@ -12,7 +12,7 @@ if(CMAKE_PACKAGE_QTGUI)
     # we also want to run post install stuff to setup command line
     set(CPACK_POSTFLIGHT_SCRIPT "@CMAKE_POSTFLIGHT_SCRIPT@")
     set(CPACK_POSTUPGRADE_SCRIPT "@CMAKE_POSTUPGRADE_SCRIPT@")
-  endif(IS_APPLE)
-endif(CMAKE_PACKAGE_QTGUI)
+  endif()
+endif()
 
 
diff --git a/Tests/ArgumentExpansion/CMakeLists.txt b/Tests/ArgumentExpansion/CMakeLists.txt
index a24636f58..173540067 100644
--- a/Tests/ArgumentExpansion/CMakeLists.txt
+++ b/Tests/ArgumentExpansion/CMakeLists.txt
@@ -8,7 +8,7 @@ function (argument_tester expected expected_len)
 
     if (NOT ${expected_received_len} EQUAL ${expected_len})
         message(STATUS "Unexpected: Expanding expected values isn't working")
-    endif (NOT ${expected_received_len} EQUAL ${expected_len})
+    endif ()
 
     if (${argn_len} EQUAL ${expected_len})
         set(i 0)
@@ -23,13 +23,13 @@ function (argument_tester expected expected_len)
             endif ()
 
             math(EXPR i "${i} + 1")
-        endwhile (i LESS ${argn_len})
-    else (${argn_len} EQUAL ${expected_len})
+        endwhile ()
+    else ()
         message(STATUS "Unexpected: Lengths of arguments don't match")
         message(STATUS "    Expected: ${expected_len}")
         message(STATUS "    Received: ${argn_len}")
-    endif (${argn_len} EQUAL ${expected_len})
-endfunction (argument_tester expected)
+    endif ()
+endfunction ()
 
 set(empty_test)
 message(STATUS "Test: Empty arguments")
diff --git a/Tests/Assembler/CMakeLists.txt b/Tests/Assembler/CMakeLists.txt
index 456e4961f..5f71036e4 100644
--- a/Tests/Assembler/CMakeLists.txt
+++ b/Tests/Assembler/CMakeLists.txt
@@ -18,16 +18,16 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile")
       DEPENDS main.c
       VERBATIM
       )
-  endif(("${CMAKE_C_COMPILER_ID}" MATCHES "^(GNU|HP|SunPro|XL)$") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel"  AND  UNIX))
-endif("${CMAKE_GENERATOR}" MATCHES "Makefile")
+  endif()
+endif()
 
 
 if(SRCS)
   set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS}")
   enable_language(ASM OPTIONAL)
-else(SRCS)
+else()
   message(STATUS "No assembler enabled, using C")
   set(SRCS main.c)
-endif(SRCS)
+endif()
 
 add_executable(HelloAsm ${SRCS})
diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt
index 045acb8c0..d3b1f3c0d 100644
--- a/Tests/BuildDepends/CMakeLists.txt
+++ b/Tests/BuildDepends/CMakeLists.txt
@@ -15,7 +15,7 @@ set(CMAKE_SUPPRESS_REGENERATION 1)
 # Xcode needs some help with the fancy dependencies in this test.
 if("${CMAKE_GENERATOR}" MATCHES "Xcode")
   set(HELP_XCODE 1)
-endif("${CMAKE_GENERATOR}" MATCHES "Xcode")
+endif()
 function(help_xcode_depends)
   if(HELP_XCODE)
     file(GLOB_RECURSE MACRO_OBJS
@@ -24,9 +24,9 @@ function(help_xcode_depends)
     if(MACRO_OBJS)
       message("Helping Xcode by removing objects [${MACRO_OBJS}]")
       file(REMOVE ${MACRO_OBJS})
-    endif(MACRO_OBJS)
-  endif(HELP_XCODE)
-endfunction(help_xcode_depends)
+    endif()
+  endif()
+endfunction()
 
 if("${CMAKE_GENERATOR}" MATCHES "Ninja")
   set(HELP_NINJA 1) # TODO Why is this needed?
@@ -80,12 +80,12 @@ if(HELP_XCODE)
     ${BuildDepends_SOURCE_DIR}/Project
     testRebuild
     OUTPUT_VARIABLE OUTPUT)
-endif(HELP_XCODE)
+endif()
 
 message("Output from first build:\n${OUTPUT}")
 if(NOT RESULT)
   message(SEND_ERROR "Could not build test project (1)!")
-endif(NOT RESULT)
+endif()
 
 set(bar ${BuildDepends_BINARY_DIR}/Project/bar${CMAKE_EXECUTABLE_SUFFIX})
 if(EXISTS
@@ -111,9 +111,9 @@ message("Run result: ${runResult} Output: \"${out}\"")
 
 if("${out}" STREQUAL "foo ")
   message("Worked!")
-else("${out}" STREQUAL "foo ")
+else()
   message(SEND_ERROR "Project did not initially build properly: ${out}")
-endif("${out}" STREQUAL "foo ")
+endif()
 
 message("Running ${zot}  ")
 execute_process(COMMAND ${zot} OUTPUT_VARIABLE out RESULT_VARIABLE runResult)
@@ -123,9 +123,9 @@ message("Run result: ${runResult} Output: \"${out}\"")
 set(VALUE_UNCHANGED "[zot] [zot_custom] [zot_macro_dir] [zot_macro_tgt] ")
 if("${out}" STREQUAL "${VALUE_UNCHANGED}")
   message("Worked!")
-else("${out}" STREQUAL "${VALUE_UNCHANGED}")
+else()
   message(SEND_ERROR "Project did not initially build properly: ${out}")
-endif("${out}" STREQUAL "${VALUE_UNCHANGED}")
+endif()
 
 message("Waiting 3 seconds...")
 # any additional argument will cause ${bar} to wait forever
@@ -174,7 +174,7 @@ endif()
 message("Output from second build:\n${OUTPUT}")
 if(NOT RESULT)
   message(SEND_ERROR "Could not build test project (2)!")
-endif(NOT RESULT)
+endif()
 if(EXISTS
     "${BuildDepends_BINARY_DIR}/Project/Debug/bar${CMAKE_EXECUTABLE_SUFFIX}" )
   message("found debug")
@@ -193,9 +193,9 @@ message("Run result: ${runResult} Output: \"${out}\"")
 
 if("${out}" STREQUAL "foo changed ")
   message("Worked!")
-else("${out}" STREQUAL "foo changed ")
+else()
   message(SEND_ERROR "Project did not rebuild properly!")
-endif("${out}" STREQUAL "foo changed ")
+endif()
 
 message("Running ${zot}  ")
 execute_process(COMMAND ${zot} OUTPUT_VARIABLE out RESULT_VARIABLE runResult)
@@ -207,9 +207,9 @@ set(VALUE_CHANGED
   )
 if("${out}" STREQUAL "${VALUE_CHANGED}")
   message("Worked!")
-else("${out}" STREQUAL "${VALUE_CHANGED}")
+else()
   message(SEND_ERROR "Project did not rebuild properly!")
-endif("${out}" STREQUAL "${VALUE_CHANGED}")
+endif()
 
 if(TEST_LINK_DEPENDS)
   set(linkdep ${BuildDepends_BINARY_DIR}/Project/linkdep${CMAKE_EXECUTABLE_SUFFIX})
diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt
index a258de239..01f5f6267 100644
--- a/Tests/BuildDepends/Project/CMakeLists.txt
+++ b/Tests/BuildDepends/Project/CMakeLists.txt
@@ -27,7 +27,7 @@ if(APPLE)
       set(CMAKE_OSX_ARCHITECTURES i386 x86_64)
     endif()
   endif()
-endif(APPLE)
+endif()
 
 add_library(foo STATIC ${testRebuild_BINARY_DIR}/foo.cxx)
 set_target_properties(foo PROPERTIES OUTPUT_NAME "foolib")
@@ -65,11 +65,11 @@ if("${CMAKE_GENERATOR}" MATCHES "Make")
   set(ZOT_DEPENDS IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/dep.cxx)
   set(ZOT_CUSTOM_DEP
     IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/dep_custom.cxx)
-else("${CMAKE_GENERATOR}" MATCHES "Make")
+else()
   # No IMPLICIT_DEPENDS...just depend directly.
   set(ZOT_DEPENDS DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/zot.hxx.in)
   set(ZOT_CUSTOM_DEP DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/zot_custom.hxx.in)
-endif("${CMAKE_GENERATOR}" MATCHES "Make")
+endif()
 add_custom_command(
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zot.hxx
   COMMAND ${CMAKE_COMMAND} -E copy
diff --git a/Tests/BundleTest/CMakeLists.txt b/Tests/BundleTest/CMakeLists.txt
index 4fb65bfa6..de69d7555 100644
--- a/Tests/BundleTest/CMakeLists.txt
+++ b/Tests/BundleTest/CMakeLists.txt
@@ -61,7 +61,7 @@ set_target_properties(BundleTest PROPERTIES OUTPUT_NAME BundleTestExe)
 # Test executable versioning if it is supported.
 if(NOT XCODE)
   set_target_properties(BundleTest PROPERTIES VERSION 1)
-endif(NOT XCODE)
+endif()
 
 # Make sure the executable can find its installed library.
 set_target_properties(BundleTestLib PROPERTIES
@@ -77,26 +77,26 @@ if(EXISTS /usr/lib/libtcl.dylib
   message("frame: ${TCL}")
   if(NOT "${TCL}" MATCHES .framework)
     message(FATAL_ERROR "Could not find tcl framework, found ${TCL}")
-  endif(NOT "${TCL}" MATCHES .framework)
+  endif()
   set(TCL NOTFOUND)
   set(CMAKE_FIND_FRAMEWORK LAST)
   find_library(TCL tcl)
   if("${TCL}" MATCHES .framework)
     message(FATAL_ERROR "Found framework and should have found dylib ${TCL}")
-  endif("${TCL}" MATCHES .framework)
+  endif()
   set(TCL NOTFOUND)
   set(CMAKE_FIND_FRAMEWORK NEVER)
   find_library(TCL tcl)
   if("${TCL}" MATCHES .framework)
     message(FATAL_ERROR "Found framework and should have found dylib ${TCL}")
-  endif("${TCL}" MATCHES .framework)
+  endif()
   message("not frame: ${TCL}")
   set(TCL NOTFOUND)
   set(CMAKE_FIND_FRAMEWORK FIRST)
   find_library(TCL tcl)
   if(NOT "${TCL}" MATCHES .framework)
     message(FATAL_ERROR "Could not find tcl framework, found ${TCL}")
-  endif(NOT "${TCL}" MATCHES .framework)
+  endif()
   message("frame: ${TCL}")
 endif(EXISTS /usr/lib/libtcl.dylib
   AND EXISTS /System/Library/Frameworks/Tcl.framework)
diff --git a/Tests/BundleUtilities/bundleutils.cmake b/Tests/BundleUtilities/bundleutils.cmake
index 46765e733..cc89347ad 100644
--- a/Tests/BundleUtilities/bundleutils.cmake
+++ b/Tests/BundleUtilities/bundleutils.cmake
@@ -31,7 +31,7 @@ configure_file("${MODULE}" "${OUTPUT_MODULE}" COPYONLY)
 # this shouldn't be necessary except for the non-bundle case on Mac
 function(gp_item_default_embedded_path_override item path)
   set(path "@executable_path" PARENT_SCOPE)
-endfunction(gp_item_default_embedded_path_override)
+endfunction()
 
 include(BundleUtilities)
 fixup_bundle("${OUTPUT}" "${OUTPUT_MODULE}" "${INPUTDIR}")
@@ -42,4 +42,4 @@ execute_process(COMMAND "${OUTPUT}" RESULT_VARIABLE result OUTPUT_VARIABLE out E
 
 if(NOT result STREQUAL "0")
   message(FATAL_ERROR " failed to execute test program\n${out}")
-endif(NOT result STREQUAL "0")
+endif()
diff --git a/Tests/CMakeBuildTest.cmake.in b/Tests/CMakeBuildTest.cmake.in
index 02206deba..195f107a2 100644
--- a/Tests/CMakeBuildTest.cmake.in
+++ b/Tests/CMakeBuildTest.cmake.in
@@ -16,7 +16,7 @@ execute_process(COMMAND "${CMAKE_COMMAND}"
   RESULT_VARIABLE RESULT)
 if(RESULT)
   message(FATAL_ERROR "Error running cmake command")
-endif(RESULT)
+endif()
 
 # Now use the --build option to build the project
 message("running: ${CMAKE_COMMAND} --build")
@@ -25,7 +25,7 @@ execute_process(COMMAND "${CMAKE_COMMAND}"
   RESULT_VARIABLE RESULT)
 if(RESULT)
   message(FATAL_ERROR "Error running cmake --build")
-endif(RESULT)
+endif()
 
 # check for configuration types
 set(CMAKE_CONFIGURATION_TYPES @CMAKE_CONFIGURATION_TYPES@)
@@ -33,15 +33,15 @@ set(CMAKE_CONFIGURATION_TYPES @CMAKE_CONFIGURATION_TYPES@)
 # are configuration types
 if(CMAKE_CONFIGURATION_TYPES)
   set(RUN_TEST "@CMAKE_BUILD_TEST_BINARY_DIR@/Debug/@CMAKE_BUILD_TEST_EXE@")
-else(CMAKE_CONFIGURATION_TYPES)
+else()
   set(RUN_TEST "@CMAKE_BUILD_TEST_BINARY_DIR@/@CMAKE_BUILD_TEST_EXE@")
-endif(CMAKE_CONFIGURATION_TYPES)
+endif()
 # run the test results
 message("running [${RUN_TEST}]")
 execute_process(COMMAND "${RUN_TEST}" RESULT_VARIABLE RESULT)
 if(RESULT)
   message(FATAL_ERROR "Error running test @CMAKE_BUILD_TEST_EXE@")
-endif(RESULT)
+endif()
 
 # build it again with clean and only @CMAKE_BUILD_TEST_EXE@ target
 execute_process(COMMAND "${CMAKE_COMMAND}"
@@ -50,10 +50,10 @@ execute_process(COMMAND "${CMAKE_COMMAND}"
   RESULT_VARIABLE RESULT)
 if(RESULT)
   message(FATAL_ERROR "Error running cmake --build")
-endif(RESULT)
+endif()
 
 # run it again after clean
 execute_process(COMMAND "${RUN_TEST}" RESULT_VARIABLE RESULT)
 if(RESULT)
   message(FATAL_ERROR "Error running test @CMAKE_BUILD_TEST_EXE@ after clean ")
-endif(RESULT)
+endif()
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 70d4171fb..651e1b98b 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -14,12 +14,12 @@ macro(ADD_TEST_MACRO NAME COMMAND)
     ${${NAME}_EXTRA_OPTIONS}
     --test-command ${COMMAND} ${ARGN})
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${dir}")
-endmacro(ADD_TEST_MACRO)
+endmacro()
 
 macro(REGEX_ESCAPE_STRING _OUT _IN)
     # Escape special regex metacharacters with a backslash
     string(REGEX REPLACE "([$^.[|*+?()]|])" "\\\\\\1" ${_OUT} "${_IN}")
-endmacro(REGEX_ESCAPE_STRING _OUT _IN)
+endmacro()
 
 include(${CMAKE_CURRENT_SOURCE_DIR}/CheckFortran.cmake)
 
@@ -75,7 +75,7 @@ if(BUILD_TESTING)
       "Should the KDE4 stable branch test be run?"
       OFF)
     mark_as_advanced(TEST_KDE4_STABLE_BRANCH)
-  endif (CMAKE_RUN_LONG_TESTS)
+  endif ()
 
   # Should tests that use CVS be run?
   #
@@ -83,19 +83,19 @@ if(BUILD_TESTING)
 
   if(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake)
     find_package(CVS QUIET)
-  else(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake)
+  else()
     find_program(CVS_EXECUTABLE NAMES cvs)
-  endif(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake)
+  endif()
 
   if(CVS_EXECUTABLE)
     set(do_cvs_tests 1)
-  endif(CVS_EXECUTABLE)
+  endif()
 
   if(do_cvs_tests AND NOT UNIX)
     if("${CVS_EXECUTABLE}" MATCHES "cygwin")
       set(do_cvs_tests 0)
-    endif("${CVS_EXECUTABLE}" MATCHES "cygwin")
-  endif(do_cvs_tests AND NOT UNIX)
+    endif()
+  endif()
 
   # Should CPack tests be run? By default, yes, but...
   #
@@ -123,20 +123,20 @@ if(BUILD_TESTING)
       message(STATUS "Forcing CTEST_TEST_CPACK=OFF on OSX < 10.4")
       message(STATUS "OSX_VERSION='${OSX_VERSION}'")
       set(CTEST_TEST_CPACK OFF)
-    else(OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]")
+    else()
       set(CTEST_TEST_OSX_ARCH 1)
-    endif(OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]")
-  endif(APPLE)
+    endif()
+  endif()
 
   # Use 1500 or CTEST_TEST_TIMEOUT for long test timeout value,
   # whichever is greater.
   set(CMAKE_LONG_TEST_TIMEOUT 1500)
   if(CTEST_TEST_TIMEOUT)
     set(CMAKE_LONG_TEST_TIMEOUT ${CTEST_TEST_TIMEOUT})
-  endif(CTEST_TEST_TIMEOUT)
+  endif()
   if(CMAKE_LONG_TEST_TIMEOUT LESS 1500)
     set(CMAKE_LONG_TEST_TIMEOUT 1500)
-  endif(CMAKE_LONG_TEST_TIMEOUT LESS 1500)
+  endif()
 
   # add a bunch of standard build-and-test style tests
   ADD_TEST_MACRO(CommandLineTest CommandLineTest)
@@ -225,18 +225,18 @@ if(BUILD_TESTING)
     PASS_REGULAR_EXPRESSION "TRY_RUN.. invoked in cross-compiling mode")
   if("${CMAKE_TEST_GENERATOR}" MATCHES "Make")
     ADD_TEST_MACRO(Policy0002 Policy0002)
-  endif("${CMAKE_TEST_GENERATOR}" MATCHES "Make")
+  endif()
   if(CTEST_TEST_OSX_ARCH)
     ADD_TEST_MACRO(Architecture Architecture)
     set_tests_properties(Architecture PROPERTIES
       PASS_REGULAR_EXPRESSION "(file is not of required architecture|does not match cputype|not the architecture being linked)")
-  endif(CTEST_TEST_OSX_ARCH)
+  endif()
 
   list(APPEND TEST_BUILD_DIRS ${CMake_TEST_INSTALL_PREFIX})
 
   if(NOT QT4_FOUND)
     find_package(Qt4)
-  endif(NOT QT4_FOUND)
+  endif()
 
   if(QT4_FOUND)
     # test whether the Qt4 which has been found works, on some machines
@@ -380,7 +380,7 @@ if(BUILD_TESTING)
          --build-project Simple
          --test-command Simple)
       list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_EclipseGenerator")
-    endif ("${cmakeOutput}" MATCHES Eclipse)
+    endif ()
 
     # check for the CodeBlocks generator
     if ("${cmakeOutput}" MATCHES CodeBlocks)
@@ -394,7 +394,7 @@ if(BUILD_TESTING)
          --build-project Simple
          --test-command Simple)
       list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator")
-    endif ("${cmakeOutput}" MATCHES CodeBlocks)
+    endif ()
     # check for the KDevelop3 generator
     if ("${cmakeOutput}" MATCHES KDevelop3)
       add_test(Simple_KDevelop3Generator ${CMAKE_CTEST_COMMAND}
@@ -407,9 +407,9 @@ if(BUILD_TESTING)
          --build-project Simple
          --test-command Simple)
       list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_KDevelop3Generator")
-    endif ("${cmakeOutput}" MATCHES KDevelop3)
+    endif ()
 
-  endif(${CMAKE_TEST_GENERATOR} MATCHES "Unix Makefiles"  OR  ${CMAKE_TEST_GENERATOR} MATCHES "KDevelop")
+  endif()
 
   # test for correct sub-project generation
   # not implemented in VS6 or Xcode
@@ -454,11 +454,11 @@ if(BUILD_TESTING)
       )
     set_tests_properties ( SubProject-Stage2 PROPERTIES DEPENDS SubProject)
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubProject")
-  endif(NOT MSVC60 AND NOT XCODE AND NOT MSVC70)
+  endif()
 
   if (CMAKE_STRICT)
     ADD_TEST_MACRO(DocTest DocTest)
-  endif (CMAKE_STRICT)
+  endif ()
   # macro to add a test that will build a nightly release
   # of CMake for given platform using the release scripts
   macro(ADD_NIGHTLY_BUILD_TEST name script)
@@ -472,8 +472,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     add_test(${name} /bin/sh ${_TEST_DIR}/nightly-cmake.sh)
     if(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY)
       set_tests_properties (${name} PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT})
-    endif(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY)
-  endmacro(ADD_NIGHTLY_BUILD_TEST)
+    endif()
+  endmacro()
   if(CMAKE_BUILD_NIGHTLY_RELEASES)
     ADD_NIGHTLY_BUILD_TEST(CMakeNightlyWindows
       dash2win64_release.cmake)
@@ -483,7 +483,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       dashmacmini5_release.cmake)
     ADD_NIGHTLY_BUILD_TEST(CMakeNightlyLinux
       magrathea_release.cmake)
-  endif(CMAKE_BUILD_NIGHTLY_RELEASES)
+  endif()
 
   # add tests with more complex invocations
   add_test(Framework ${CMAKE_CTEST_COMMAND}
@@ -663,11 +663,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
 
   if (CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*")
     find_program(RPMBUILD NAMES rpmbuild)
-  endif(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*")
+  endif()
   # Do not try to build RPM
   if (NOT RPMBUILD)
     set(CPACK_BINARY_RPM OFF)
-  endif(NOT RPMBUILD)
+  endif()
 
   find_program(NSIS_MAKENSIS_EXECUTABLE NAMES makensis
     PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS]
@@ -680,21 +680,21 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
   if(WIN32)
     if(NSIS_MAKENSIS_EXECUTABLE)
       set(CTEST_RUN_CPackComponents ON)
-    else(NSIS_MAKENSIS_EXECUTABLE)
+    else()
       set(CTEST_RUN_CPackComponents OFF)
       set(CTEST_package_X11_TEST OFF)
-    endif(NSIS_MAKENSIS_EXECUTABLE)
-  endif(WIN32)
+    endif()
+  endif()
 
   if(CTEST_RUN_CPackComponents)
     set(CPackComponents_EXTRA_OPTIONS)
     if(APPLE)
       set(CPackComponents_EXTRA_OPTIONS -DCPACK_BINARY_DRAGNDROP:BOOL=ON)
-    endif(APPLE)
+    endif()
     if(NSIS_MAKENSIS_EXECUTABLE)
       set(CPackComponents_EXTRA_OPTIONS ${CPackComponents_EXTRA_OPTIONS}
         -DCPACK_BINARY_NSIS:BOOL=ON)
-    endif(NSIS_MAKENSIS_EXECUTABLE)
+    endif()
 
     add_test(CPackComponents ${CMAKE_CTEST_COMMAND}
       --build-and-test
@@ -714,7 +714,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         "-DCPackComponents_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackComponents"
         -P "${CMake_SOURCE_DIR}/Tests/CPackComponents/VerifyResult.cmake")
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponents")
-  endif(CTEST_RUN_CPackComponents)
+  endif()
 
   if(CTEST_RUN_CPackComponentsForAll)
     # Check whether if rpmbuild command is found
@@ -722,13 +722,13 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     find_program(RPMBUILD_EXECUTABLE NAMES rpmbuild)
     if(RPMBUILD_EXECUTABLE)
       list(APPEND ACTIVE_CPACK_GENERATORS RPM)
-    endif(RPMBUILD_EXECUTABLE)
+    endif()
     # Check whether if dpkg command is found
     # before adding DEB tests
     find_program(DPKG_EXECUTABLE NAMES dpkg)
     if(DPKG_EXECUTABLE)
       list(APPEND ACTIVE_CPACK_GENERATORS DEB)
-    endif(DPKG_EXECUTABLE)
+    endif()
 
     # ACTIVE_CPACK_GENERATORS variable
     # now contains the list of 'active generators'
@@ -738,17 +738,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     list(APPEND GENLST "ZIP")
     if(APPLE)
       list(APPEND GENLST "DragNDrop")
-    endif(APPLE)
+    endif()
     if (NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*")
       list(FIND ACTIVE_CPACK_GENERATORS "RPM" RPM_ACTIVE)
       if (NOT ${RPM_ACTIVE} EQUAL -1)
         list(APPEND GENLST "RPM")
-      endif(NOT ${RPM_ACTIVE} EQUAL -1)
-    endif(NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*")
+      endif()
+    endif()
     list(FIND ACTIVE_CPACK_GENERATORS "DEB" DEB_ACTIVE)
     if (NOT ${DEB_ACTIVE} EQUAL -1)
       list(APPEND GENLST "DEB")
-    endif(NOT ${DEB_ACTIVE} EQUAL -1)
+    endif()
 
     # set up list of component packaging ways
     list(APPEND CWAYLST "default")
@@ -778,9 +778,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
             "${CPackRun_CPackComponentWay}"
             -P "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake")
         list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}")
-      endforeach(CPackComponentWay)
-    endforeach(CPackGen)
-  endif(CTEST_RUN_CPackComponentsForAll)
+      endforeach()
+    endforeach()
+  endif()
 
   # By default, turn this test off (because it takes a long time...)
   #
@@ -797,7 +797,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     endif(CMAKE_CXX_FLAGS MATCHES "-ftest-coverage" OR
       NOT "$ENV{COVFILE}" STREQUAL "" OR
       CMAKE_RUN_LONG_TESTS)
-  endif(NOT DEFINED CTEST_RUN_CPackTestAllGenerators)
+  endif()
 
   if(CTEST_RUN_CPackTestAllGenerators)
     add_test(CPackTestAllGenerators ${CMAKE_CTEST_COMMAND}
@@ -814,13 +814,13 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         -P ${CMake_SOURCE_DIR}/Tests/CPackTestAllGenerators/RunCPack.cmake
       )
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators")
-  endif(CTEST_RUN_CPackTestAllGenerators)
+  endif()
 
   if(CTEST_package_X11_TEST)
     set(X11_build_target_arg --build-target package)
-  else(CTEST_package_X11_TEST)
+  else()
     set(X11_build_target_arg)
-  endif(CTEST_package_X11_TEST)
+  endif()
 
   add_test(X11 ${CMAKE_CTEST_COMMAND}
     --build-and-test
@@ -836,7 +836,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
 
   if(NOT DEFINED CTEST_RUN_CMakeTestAllGenerators)
     set(CTEST_RUN_CMakeTestAllGenerators ON)
-  endif(NOT DEFINED CTEST_RUN_CMakeTestAllGenerators)
+  endif()
 
   if(CTEST_RUN_CMakeTestAllGenerators)
     add_test(CMakeTestAllGenerators ${CMAKE_CMAKE_COMMAND}
@@ -846,11 +846,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       )
     list(APPEND TEST_BUILD_DIRS
       "${CMake_BINARY_DIR}/Tests/CMakeTestAllGenerators")
-  endif(CTEST_RUN_CMakeTestAllGenerators)
+  endif()
 
   if(NOT DEFINED CTEST_RUN_CMakeTestBadCommandLines)
     set(CTEST_RUN_CMakeTestBadCommandLines ON)
-  endif(NOT DEFINED CTEST_RUN_CMakeTestBadCommandLines)
+  endif()
 
   if(CTEST_RUN_CMakeTestBadCommandLines)
     add_test(CMakeTestBadCommandLines ${CMAKE_CMAKE_COMMAND}
@@ -861,11 +861,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       )
     list(APPEND TEST_BUILD_DIRS
       "${CMake_BINARY_DIR}/Tests/CMakeTestBadCommandLines")
-  endif(CTEST_RUN_CMakeTestBadCommandLines)
+  endif()
 
   if(NOT DEFINED CTEST_RUN_CMakeTestMultipleConfigures)
     set(CTEST_RUN_CMakeTestMultipleConfigures ON)
-  endif(NOT DEFINED CTEST_RUN_CMakeTestMultipleConfigures)
+  endif()
 
   if(CTEST_RUN_CMakeTestMultipleConfigures)
     add_test(CMakeTestMultipleConfigures ${CMAKE_CMAKE_COMMAND}
@@ -876,7 +876,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       )
     list(APPEND TEST_BUILD_DIRS
       "${CMake_BINARY_DIR}/Tests/CMakeTestMultipleConfigures")
-  endif(CTEST_RUN_CMakeTestMultipleConfigures)
+  endif()
 
   add_test(LoadedCommandOneConfig  ${CMAKE_CTEST_COMMAND}
     --build-and-test
@@ -987,7 +987,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
       --build-project Tutorial
       --test-command Tutorial 25.0)
-  endforeach(STP)
+  endforeach()
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Tutorial")
 
   add_test(testing ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE}
@@ -1081,12 +1081,12 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     set(_DLL_PATH "$ENV{DLL_PATH}")
     if(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.(:.*)?$")
       message(FATAL_ERROR "In order to successfully run the CMake test suite on Syllable you need to add \"\\@bindir\\@/.\" to the DLL_PATH environment variable")
-    endif(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.(:.*)?$")
+    endif()
     if(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.\\./lib(:.*)?$")
       message(FATAL_ERROR "In order to successfully run the CMake test suite on Syllable you need to add \"\\@bindir\\@/../lib\" to the DLL_PATH environment variable")
-    endif(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.\\./lib(:.*)?$")
+    endif()
 
-  else("${CMAKE_SYSTEM_NAME}" MATCHES syllable)
+  else()
 
     add_test(JumpWithLibOut  ${CMAKE_CTEST_COMMAND}
       --build-and-test
@@ -1127,8 +1127,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
 
     if(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG)
       ADD_TEST_MACRO(RuntimePath RuntimePath)
-    endif(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG)
-  endif("${CMAKE_SYSTEM_NAME}" MATCHES syllable)
+    endif()
+  endif()
 
   add_test(linkorder1 ${CMAKE_CTEST_COMMAND}
     --build-and-test
@@ -1184,7 +1184,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --test-command kwsysTestsCxx testIOS
       )
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/kwsys")
-  endif(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
+  endif()
   set(MAKE_IS_GNU )
   if(${CMAKE_TEST_MAKEPROGRAM} MATCHES make)
     exec_program(
@@ -1194,9 +1194,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     if("${res}" EQUAL 0)
       if("${out}" MATCHES "GNU")
         set(MAKE_IS_GNU 1)
-      endif("${out}" MATCHES "GNU")
-    endif("${res}" EQUAL 0)
-  endif(${CMAKE_TEST_MAKEPROGRAM} MATCHES make)
+      endif()
+    endif()
+  endif()
 
   # only add this test on platforms that support it
   # some old versions of make simply cannot handle spaces in paths
@@ -1234,7 +1234,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere"
       "${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.obj"
       )
-  else (WIN32)
+  else ()
     add_test(SubDir ${CMAKE_CTEST_COMMAND}
       --build-and-test
       "${CMake_SOURCE_DIR}/Tests/SubDir"
@@ -1247,7 +1247,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere"
       "${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.o"
       )
-  endif (WIN32)
+  endif ()
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDir")
 
   if(CMAKE_TEST_MSVC)
@@ -1273,7 +1273,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --test-command check_clean
       )
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MakeClean")
-  endif("${CMAKE_TEST_GENERATOR}" MATCHES "Makefile")
+  endif()
 
   if(NOT DEFINED CTEST_RUN_MFC)
     set(CTEST_RUN_MFC OFF)
@@ -1383,7 +1383,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
   if(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio")
     if(NOT MSVC60)
       ADD_TEST_MACRO(SBCS SBCS)
-    endif(NOT MSVC60)
+    endif()
 
     add_test(VSExternalInclude ${CMAKE_CTEST_COMMAND}
       --build-and-test
@@ -1406,7 +1406,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
       --test-command VSMidl)
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSMidl")
-  endif(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio")
+  endif()
 
   if (APPLE)
     if (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
@@ -1444,8 +1444,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CFBundleTest")
 
       ADD_TEST_MACRO(ObjC++ ObjC++)
-    endif (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
-  endif (APPLE)
+    endif ()
+  endif ()
 
   if(APPLE AND CTEST_TEST_CPACK)
     add_test(BundleGeneratorTest ${CMAKE_CTEST_COMMAND}
@@ -1460,7 +1460,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/BundleGeneratorTest/InstallDirectory"
       )
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest")
-  endif(APPLE AND CTEST_TEST_CPACK)
+  endif()
 
   add_test(WarnUnusedUnusedViaSet ${CMAKE_CTEST_COMMAND}
     --build-and-test
@@ -1570,8 +1570,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       mark_as_advanced(Subversion_SVNADMIN_EXECUTABLE)
       if(NOT Subversion_SVNADMIN_EXECUTABLE)
         set(Subversion_FOUND FALSE)
-      endif(NOT Subversion_SVNADMIN_EXECUTABLE)
-    endif(Subversion_FOUND)
+      endif()
+    endif()
     if(Subversion_FOUND)
       set(CTestUpdateSVN_DIR "CTest UpdateSVN")
       configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateSVN.cmake.in"
@@ -1580,22 +1580,22 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         -P "${CMake_BINARY_DIR}/Tests/CTestUpdateSVN.cmake"
         )
       list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateSVN_DIR}")
-    endif(Subversion_FOUND)
+    endif()
 
     # Test CTest Update with CVS
     if(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake)
       find_package(CVS QUIET)
-    else(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake)
+    else()
       find_program(CVS_EXECUTABLE NAMES cvs)
       set(CVS_FOUND ${CVS_EXECUTABLE})
-    endif(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake)
+    endif()
     set(CTEST_TEST_UPDATE_CVS ${CVS_FOUND})
     if(CTEST_TEST_UPDATE_CVS AND NOT UNIX)
       if("${CVS_EXECUTABLE}" MATCHES "cygwin")
         message(STATUS "No CTest.UpdateCVS test with cygwin cvs.exe outside cygwin!")
         set(CTEST_TEST_UPDATE_CVS 0)
-      endif("${CVS_EXECUTABLE}" MATCHES "cygwin")
-    endif(CTEST_TEST_UPDATE_CVS AND NOT UNIX)
+      endif()
+    endif()
     if(CTEST_TEST_UPDATE_CVS)
       set(CTestUpdateCVS_DIR "CTest UpdateCVS")
       configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateCVS.cmake.in"
@@ -1604,7 +1604,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         -P "${CMake_BINARY_DIR}/Tests/CTestUpdateCVS.cmake"
         )
       list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateCVS_DIR}")
-    endif(CTEST_TEST_UPDATE_CVS)
+    endif()
 
     # Test CTest Update with BZR
     find_program(BZR_EXECUTABLE NAMES bzr)
@@ -1613,8 +1613,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     if(BZR_EXECUTABLE)
       if(NOT "${BZR_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
         set(CTEST_TEST_UPDATE_BZR 1)
-      endif(NOT "${BZR_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
-    endif(BZR_EXECUTABLE)
+      endif()
+    endif()
     if(CTEST_TEST_UPDATE_BZR)
       # Check if xmloutput plugin is there
       execute_process(COMMAND ${BZR_EXECUTABLE} xmlplugins RESULT_VARIABLE xmlplugres
@@ -1635,8 +1635,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
           )
         set_tests_properties(CTest.UpdateBZR.CLocale PROPERTIES ENVIRONMENT LC_ALL=C)
         list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateBZR_DIR}")
-      endif( NOT ${xmlplugres} )
-    endif(CTEST_TEST_UPDATE_BZR)
+      endif()
+    endif()
 
     # Test CTest Update with GIT
     find_program(GIT_EXECUTABLE NAMES git)
@@ -1645,8 +1645,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     if(GIT_EXECUTABLE)
       if(NOT "${GIT_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
         set(CTEST_TEST_UPDATE_GIT 1)
-      endif(NOT "${GIT_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
-    endif(GIT_EXECUTABLE)
+      endif()
+    endif()
     if(CTEST_TEST_UPDATE_GIT)
       set(CTestUpdateGIT_DIR "CTest UpdateGIT")
       configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateGIT.cmake.in"
@@ -1655,7 +1655,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         -P "${CMake_BINARY_DIR}/Tests/CTestUpdateGIT.cmake"
         )
       list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateGIT_DIR}")
-    endif(CTEST_TEST_UPDATE_GIT)
+    endif()
 
     # Test CTest Update with HG
     find_program(HG_EXECUTABLE NAMES hg)
@@ -1664,8 +1664,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     if(HG_EXECUTABLE)
       if(NOT "${HG_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
         set(CTEST_TEST_UPDATE_HG 1)
-      endif(NOT "${HG_EXECUTABLE}" MATCHES "cygwin" OR UNIX)
-    endif(HG_EXECUTABLE)
+      endif()
+    endif()
     if(CTEST_TEST_UPDATE_HG)
       set(CTestUpdateHG_DIR "CTest UpdateHG")
       configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateHG.cmake.in"
@@ -1674,8 +1674,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         -P "${CMake_BINARY_DIR}/Tests/CTestUpdateHG.cmake"
         )
       list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateHG_DIR}")
-    endif(CTEST_TEST_UPDATE_HG)
-  endif(CTEST_TEST_UPDATE)
+    endif()
+  endif()
 
   configure_file(
     "${CMake_SOURCE_DIR}/Tests/CTestTestFailure/testNoBuild.cmake.in"
@@ -1841,10 +1841,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
   if(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake")
     set_tests_properties(CTestTestCrash PROPERTIES
       PASS_REGULAR_EXPRESSION "Failed")
-  else(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake")
+  else()
     set_tests_properties(CTestTestCrash PROPERTIES
       PASS_REGULAR_EXPRESSION "(Illegal|SegFault)")
-  endif(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake")
+  endif()
 
   configure_file(
     "${CMake_SOURCE_DIR}/Tests/CTestTestBadExe/test.cmake.in"
@@ -2055,14 +2055,14 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       set(protocol "${CMAKE_MATCH_1}")
       set(server "${CMAKE_MATCH_2}")
       set(path "${CMAKE_MATCH_3}")
-    else ("${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}")
+    else ()
       set(protocol "http")
       set(server "www.cdash.org")
       set(path "/CDash")
       message("warning: CMAKE_TESTS_CDASH_SERVER does not match expected regex...")
       message("         ...using default url='${protocol}://${server}${path}' for CTestTest[23]")
-    endif ("${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}")
-  endif (CMAKE_TESTS_CDASH_SERVER)
+    endif ()
+  endif ()
 
 
   if (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS AND CMAKE_TESTS_CDASH_SERVER)
@@ -2097,40 +2097,40 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     if ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
       set_tests_properties ( CTestTest
         PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT})
-    endif ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
+    endif ()
 
     get_test_property(CTestTest2 TIMEOUT PREVIOUS_TIMEOUT)
     if ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
       set_tests_properties ( CTestTest2
         PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT})
-    endif ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
-  endif (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS AND CMAKE_TESTS_CDASH_SERVER)
+    endif ()
+  endif ()
 
   if (CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH)
     if(UNIX)
       if(NOT QT4_FOUND)
          find_package(Qt4)
-      endif(NOT QT4_FOUND)
+      endif()
 
       set(TRY_BUILD_KDE4 TRUE)
       if(QT4_FOUND)
         # check whether it's Qt 4.5 in a cmake 2.4. compatible way:
         if(NOT EXISTS "${QT_QTNETWORK_INCLUDE_DIR}/QAbstractNetworkCache")
           set(TRY_BUILD_KDE4 FALSE)
-        endif(NOT EXISTS "${QT_QTNETWORK_INCLUDE_DIR}/QAbstractNetworkCache")
-      else(QT4_FOUND)
+        endif()
+      else()
         set(TRY_BUILD_KDE4 FALSE)
-      endif(QT4_FOUND)
+      endif()
 
       find_package(Perl)
       if(NOT PERL_FOUND)
         set(TRY_BUILD_KDE4 FALSE)
-      endif(NOT PERL_FOUND)
+      endif()
 
       find_package(ZLIB)
       if(NOT ZLIB_FOUND)
         set(TRY_BUILD_KDE4 FALSE)
-      endif(NOT ZLIB_FOUND)
+      endif()
 
       if(TRY_BUILD_KDE4)
         file(MAKE_DIRECTORY ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest)
@@ -2138,18 +2138,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         configure_file(${CMake_SOURCE_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh.in ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh @ONLY)
         execute_process(COMMAND chmod 755 ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh )
         add_test(KDE4StableBranchTest ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh)
-      endif(TRY_BUILD_KDE4)
+      endif()
 
-    endif(UNIX)
-  endif (CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH)
+    endif()
+  endif ()
 
   if("${CMAKE_TEST_GENERATOR}" MATCHES Xcode)
     set(CMAKE_SKIP_BOOTSTRAP_TEST 1)
-  endif("${CMAKE_TEST_GENERATOR}" MATCHES Xcode)
+  endif()
   if(EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt")
     # If there is CMakeLists.txt in the binary tree, assume in-source build
     set(CMAKE_SKIP_BOOTSTRAP_TEST 1)
-  endif(EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt")
+  endif()
   set(bootstrap "")
   if(CMAKE_RUN_LONG_TESTS AND NOT CMAKE_SKIP_BOOTSTRAP_TEST)
     if(UNIX)
@@ -2180,7 +2180,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     if ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
       set_tests_properties ( BootstrapTest
         PROPERTIES TIMEOUT 5400)
-    endif ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
+    endif ()
   endif()
 
   if(CMAKE_Fortran_COMPILER)
@@ -2237,7 +2237,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
           --build-run-dir "${CMake_BINARY_DIR}/Tests/Java/"
           --test-command ${JAVA_RUNTIME} -classpath hello.jar HelloWorld)
         list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Java")
-      endif("${JNI_FILE}" MATCHES "JDK1_2")
+      endif()
     endif()
   endif()
 
@@ -2259,7 +2259,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         "-DCMAKE_SYSTEM_NAME=Generic"
         "-DCMAKE_C_COMPILER=${SDCC_EXECUTABLE}")
       list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc")
-    endif(SDCC_EXECUTABLE)
+    endif()
 
     # If a Linux -> MinGW cross compiler is found then try it
     find_program(MINGW_CC_LINUX2WIN_EXECUTABLE i586-mingw32msvc-gcc)
@@ -2282,7 +2282,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         )
       list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win")
     endif()
-  endif(CMAKE_TEST_GENERATOR MATCHES "Makefiles" OR CMAKE_TEST_GENERATOR MATCHES "KDevelop")
+  endif()
 
   if(UNIX)
     string(COMPARE EQUAL "${CMAKE_INSTALL_PREFIX}" "${CMake_BINARY_DIR}/Tests/TestShellInstall/Prefix"
@@ -2294,36 +2294,36 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         @ONLY IMMEDIATE
         )
       add_test(ShellInstall /bin/sh ${CMake_BINARY_DIR}/Tests/TestShellInstall/TestShellInstall.sh)
-    endif(PREFIX_IS_FOR_TEST)
-  endif(UNIX)
+    endif()
+  endif()
 
   if(CMAKE_TEST_PROJECT_CSE_DIR)
     set(script "${CMAKE_TEST_PROJECT_CSE_DIR}/BuildProjectCSE.cmake")
     if(NOT EXISTS "${script}")
       set(script "${CMAKE_TEST_PROJECT_CSE_DIR}/cse_build.cmake")
-    endif(NOT EXISTS "${script}")
+    endif()
     if(NOT EXISTS "${script}")
       message("warning: CMAKE_TEST_PROJECT_CSE_DIR set, but no build script found...")
-    endif(NOT EXISTS "${script}")
+    endif()
 
     add_test(BuildCSE ${CMAKE_CTEST_COMMAND} -V -S "${script}")
     set_tests_properties(BuildCSE PROPERTIES TIMEOUT 5400)
-  endif(CMAKE_TEST_PROJECT_CSE_DIR)
+  endif()
 
   if(CMAKE_TEST_PLPLOT_DIR)
     add_test(plplot ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_PLPLOT_DIR}/../../EasyDashboardScripts/plplot.cmake )
     set_tests_properties ( plplot PROPERTIES TIMEOUT 5400)
-  endif(CMAKE_TEST_PLPLOT_DIR)
+  endif()
 
   if(CMAKE_TEST_CHICKEN_DIR)
     add_test(Chicken ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_CHICKEN_DIR}/../../EasyDashboardScripts/Chicken.cmake )
     set_tests_properties ( Chicken PROPERTIES TIMEOUT 5400)
-  endif(CMAKE_TEST_CHICKEN_DIR)
+  endif()
 
   if(CMAKE_TEST_KDELIBS_ALPHA_1_DIR)
     add_test(KDELibsAlpha1 ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_KDELIBS_ALPHA_1_DIR}/../../EasyDashboardScripts/kdelibs.cmake )
     set_tests_properties ( KDELibsAlpha1 PROPERTIES TIMEOUT 5400)
-  endif(CMAKE_TEST_KDELIBS_ALPHA_1_DIR)
+  endif()
 
   # If this is not an in-source build, provide a target to wipe out
   # all the test build directories.
@@ -2334,7 +2334,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       COMMAND ${CMAKE_COMMAND} -P ${CMake_BINARY_DIR}/Tests/test_clean.cmake
       COMMENT "Removing test build directories."
       )
-  endif(NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt")
+  endif()
 
   add_test(CMakeWizardTest ${CMAKE_CMAKE_COMMAND}
     -D build_dir:STRING=${CMAKE_CURRENT_BINARY_DIR}/CMakeWizardTest
@@ -2399,6 +2399,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     set_tests_properties(KWStyle PROPERTIES
       WORKING_DIRECTORY ${CMake_BINARY_DIR}/Utilities/KWStyle)
   endif()
-endif(BUILD_TESTING)
+endif()
 
 subdirs(CMakeTests)
diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
index 551cee3bc..fb0bd1548 100644
--- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
+++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
@@ -13,7 +13,7 @@ file(GLOB FIND_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../Modules/Find*.cmake
 macro(do_find MODULE_NAME)
     message(STATUS "   Checking Find${MODULE_NAME}")
     find_package(${MODULE_NAME})
-endmacro(do_find)
+endmacro()
 
 # It is only possible to use either Qt3 or Qt4 in one project.
 # Since FindQt will complain if both are found we explicitly request Qt4 here
@@ -35,15 +35,15 @@ foreach(FIND_MODULE ${FIND_MODULES})
         do_find(${MODULE_NAME})
     endif ()
 
-endforeach(FIND_MODULE)
+endforeach()
 
 # Qt4 is not present, so we can check Qt3
 if (NOT QT4_FOUND)
     set(DESIRED_QT_VERSION 3)
     foreach(FIND_MODULE ${NO_QT4_MODULES} "Qt")
         do_find(${FIND_MODULE})
-    endforeach(FIND_MODULE)
-endif (NOT QT4_FOUND)
+    endforeach()
+endif ()
 
 macro(check_version_string MODULE_NAME VERSION_VAR)
     if (${MODULE_NAME}_FOUND)
@@ -65,7 +65,7 @@ macro(check_version_string MODULE_NAME VERSION_VAR)
             message(SEND_ERROR "${MODULE_NAME}_FOUND is set but version number variable ${VERSION_VAR} is NOT DEFINED")
         endif()
     endif ()
-endmacro(check_version_string)
+endmacro()
 
 # If any of these modules reported that it was found a version number should have been
 # reported.
@@ -73,12 +73,12 @@ endmacro(check_version_string)
 foreach(VTEST ALSA ARMADILLO BZIP2 CUPS CURL EXPAT FREETYPE GETTEXT GIT HSPELL
         JASPER LIBLZMA LIBXML2 LIBXSLT PERL PKG_CONFIG PostgreSQL TIFF ZLIB)
     check_version_string(${VTEST} ${VTEST}_VERSION_STRING)
-endforeach(VTEST)
+endforeach()
 
 foreach(VTEST BISON Boost CUDA DOXYGEN FLEX GIF GTK2 LibArchive OPENSCENEGRAPH
         RUBY SWIG)
     check_version_string(${VTEST} ${VTEST}_VERSION)
-endforeach(VTEST)
+endforeach()
 
 check_version_string(PYTHONINTERP PYTHON_VERSION_STRING)
 check_version_string(SUBVERSION Subversion_VERSION_SVN)
diff --git a/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt b/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt
index 70c186cc2..9528aa357 100644
--- a/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt
+++ b/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt
@@ -23,7 +23,7 @@ foreach(_config_type Release RelWithDebInfo MinSizeRel Debug)
 
   if (CSE_RESULT_${_config_type})
     message(SEND_ERROR "CheckCXXSymbolExists reported a nonexistent symbol as existing in configuration ${_config_type}")
-  endif (CSE_RESULT_${_config_type})
+  endif ()
 endforeach()
 
 set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE})
@@ -42,12 +42,12 @@ if (NOT CSE_RESULT_ERRNO_CERRNO)
 
   if (NOT CSE_RESULT_ERRNO_ERRNOH)
     message(SEND_ERROR "CheckCXXSymbolExists did not find errno in <cerrno> and <errno.h>")
-  else (NOT CSE_RESULT_ERRNO_ERRNOH)
+  else ()
     message(STATUS "errno found in <errno.h>")
-  endif (NOT CSE_RESULT_ERRNO_ERRNOH)
-else (NOT CSE_RESULT_ERRNO_CERRNO)
+  endif ()
+else ()
   message(STATUS "errno found in <cerrno>")
-endif (NOT CSE_RESULT_ERRNO_CERRNO)
+endif ()
 
 if (CMAKE_COMPILER_IS_GNUCXX)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
@@ -58,5 +58,5 @@ if (CMAKE_COMPILER_IS_GNUCXX)
 
   if (CSE_RESULT_O3)
     message(SEND_ERROR "CheckCXXSymbolExists reported a nonexistent symbol as existing with optimization -O3")
-  endif (CSE_RESULT_O3)
-endif (CMAKE_COMPILER_IS_GNUCXX)
+  endif ()
+endif ()
diff --git a/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt b/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt
index acf0d2df3..765657712 100644
--- a/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt
+++ b/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt
@@ -24,7 +24,7 @@ foreach(_config_type Release RelWithDebInfo MinSizeRel Debug)
 
   if (CSE_RESULT_${_config_type})
     message(SEND_ERROR "CheckSymbolExists reported a nonexistent symbol as existing in configuration ${_config_type}")
-  endif (CSE_RESULT_${_config_type})
+  endif ()
 endforeach()
 
 set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE})
@@ -34,9 +34,9 @@ check_symbol_exists(errno "errno.h" CSE_RESULT_ERRNO)
 
 if (NOT CSE_RESULT_ERRNO)
   message(SEND_ERROR "CheckSymbolExists did not find errno in <errno.h>")
-else (NOT CSE_RESULT_ERRNO)
+else ()
   message(STATUS "errno found as expected")
-endif (NOT CSE_RESULT_ERRNO)
+endif ()
 
 if (CMAKE_COMPILER_IS_GNUCC)
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
@@ -47,5 +47,5 @@ if (CMAKE_COMPILER_IS_GNUCC)
 
   if (CSE_RESULT_O3)
     message(SEND_ERROR "CheckSymbolExists reported a nonexistent symbol as existing with optimization -O3")
-  endif (CSE_RESULT_O3)
-endif (CMAKE_COMPILER_IS_GNUCC)
+  endif ()
+endif ()
diff --git a/Tests/CMakeTestMultipleConfigures/RunCMake.cmake b/Tests/CMakeTestMultipleConfigures/RunCMake.cmake
index 19391d7f1..96326646b 100644
--- a/Tests/CMakeTestMultipleConfigures/RunCMake.cmake
+++ b/Tests/CMakeTestMultipleConfigures/RunCMake.cmake
@@ -143,7 +143,7 @@ function(analyze_directory_diffs d1 d2 diff_count_var)
   endif()
 
   set(${diff_count_var} ${diffs} PARENT_SCOPE)
-endfunction(analyze_directory_diffs)
+endfunction()
 
 
 # Analyze diffs between b1:b2, b2:b3, b3:b4, b4:b5 ... bN-1:bN.
diff --git a/Tests/CMakeTests/CMakeLists.txt b/Tests/CMakeTests/CMakeLists.txt
index fadcc1e2a..d34d4a618 100644
--- a/Tests/CMakeTests/CMakeLists.txt
+++ b/Tests/CMakeTests/CMakeLists.txt
@@ -6,7 +6,7 @@ macro(AddCMakeTest TestName PreArgs)
     "${CMAKE_CURRENT_BINARY_DIR}/${TestName}Test.cmake" @ONLY IMMEDIATE)
   add_test(CMake.${TestName} ${CMAKE_EXECUTABLE} ${PreArgs}
     -P "${CMAKE_CURRENT_BINARY_DIR}/${TestName}Test.cmake" ${ARGN})
-endmacro(AddCMakeTest)
+endmacro()
 
 
 AddCMakeTest(List "")
diff --git a/Tests/CMakeTests/FindBaseTest.cmake.in b/Tests/CMakeTests/FindBaseTest.cmake.in
index 47c1692db..658b35022 100644
--- a/Tests/CMakeTests/FindBaseTest.cmake.in
+++ b/Tests/CMakeTests/FindBaseTest.cmake.in
@@ -12,7 +12,7 @@ set(_HEADER_FULL_A "${MY_SOURCE_DIR}/A/include/${_HEADER}")
 find_file(FOO_H_1 ${_HEADER})
 if(FOO_H_1)
    message(FATAL_ERROR "${_HEADER} found: ${FOO_H_1}, it should not exist !")
-endif(FOO_H_1)
+endif()
 
 # The HINTS option should override the system but the PATHS option
 # should not.
@@ -21,10 +21,10 @@ find_file(TEST_H_1 ${_HEADER} HINTS ${MY_SOURCE_DIR}/A/include)
 find_file(TEST_H_2 ${_HEADER} PATHS ${MY_SOURCE_DIR}/A/include)
 if(NOT "${TEST_H_1}" STREQUAL "${_HEADER_FULL_A}")
    message(FATAL_ERROR "Did not find \"${_HEADER_FULL_A}\"\ngot \"${TEST_H_1}\" instead!")
-endif(NOT "${TEST_H_1}" STREQUAL "${_HEADER_FULL_A}")
+endif()
 if(NOT "${TEST_H_2}" STREQUAL "${_HEADER_FULL}")
    message(FATAL_ERROR "Did not find \"${_HEADER_FULL}\"\ngot \"${TEST_H_2}\" instead!")
-endif(NOT "${TEST_H_2}" STREQUAL "${_HEADER_FULL}")
+endif()
 set(CMAKE_SYSTEM_PREFIX_PATH)
 
 # with this it still should not be found, since the include/ subdir is still missing
@@ -32,20 +32,20 @@ set(CMAKE_INCLUDE_PATH "${MY_SOURCE_DIR}")
 find_file(FOO_H_2 ${_HEADER})
 if(FOO_H_2)
    message(FATAL_ERROR "${_HEADER} found: ${FOO_H_2}, it should not exist !")
-endif(FOO_H_2)
+endif()
 
 # now with the PATH_SUFFIX it should be found
 find_file(FOO_H_3 NAMES ${_HEADER} PATH_SUFFIXES include )
 if(NOT "${FOO_H_3}" STREQUAL "${_HEADER_FULL}")
    message(FATAL_ERROR "Did not find \"${_HEADER_FULL}\"\ngot ${FOO_H_3} instead !")
-endif(NOT "${FOO_H_3}" STREQUAL "${_HEADER_FULL}")
+endif()
 
 # without PATH_SUFFIX, but with a CMAKE_INCLUDE_PATH it should not be found
 set(CMAKE_INCLUDE_PATH /include)
 find_file(FOO_H_4 ${_HEADER})
 if(FOO_H_4)
    message(FATAL_ERROR "${_HEADER} found: ${FOO_H_4}, it should not exist !")
-endif(FOO_H_4)
+endif()
 
 # when setting CMAKE_FIND_ROOT_PATH to the current source dir,
 # together with the CMAKE_INCLUDE_PATH it should be found
@@ -53,10 +53,10 @@ set(CMAKE_FIND_ROOT_PATH blub "${MY_SOURCE_DIR}")
 find_file(FOO_H_5 ${_HEADER})
 if(NOT "${FOO_H_5}" STREQUAL "${_HEADER_FULL}")
    message(FATAL_ERROR "Did not find \"${_HEADER_FULL}\"\ngot ${FOO_H_5} instead !")
-endif(NOT "${FOO_H_5}" STREQUAL "${_HEADER_FULL}")
+endif()
 
 # by explicitly disabling CMAKE_FIND_ROOT_PATH again it shouldn't be found
 find_file(FOO_H_6 ${_HEADER} NO_CMAKE_FIND_ROOT_PATH)
 if(FOO_H_6)
    message(FATAL_ERROR "${_HEADER} found: ${FOO_H_6}, it should not exist !")
-endif(FOO_H_6)
+endif()
diff --git a/Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in b/Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in
index 7adc240f0..22f6afd3b 100644
--- a/Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in
+++ b/Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in
@@ -66,7 +66,7 @@ if(UNIX)
         if(EXISTS file1 OR EXISTS file2)
            message(FATAL_ERROR "removal of file1 or file2 failed")
         endif()
-    endif(LN)
+    endif()
 
     file(REMOVE ${bindir}/file3)
 endif()
diff --git a/Tests/CMakeTests/GetPrerequisitesTest.cmake.in b/Tests/CMakeTests/GetPrerequisitesTest.cmake.in
index daf467bcc..89ca735d3 100644
--- a/Tests/CMakeTests/GetPrerequisitesTest.cmake.in
+++ b/Tests/CMakeTests/GetPrerequisitesTest.cmake.in
@@ -58,7 +58,7 @@ function(stresstest_list_prerequisites file)
 
   message(STATUS "=============================================================================")
   message(STATUS "")
-endfunction(stresstest_list_prerequisites)
+endfunction()
 
 
 function(test_cmake_executables)
@@ -68,7 +68,7 @@ function(test_cmake_executables)
 
   get_filename_component(cmake_bin_dir "${CMAKE_COMMAND}" PATH)
   list_prerequisites_by_glob(GLOB "${cmake_bin_dir}/*" 0 0 1)
-endfunction(test_cmake_executables)
+endfunction()
 
 
 message(STATUS "=============================================================================")
@@ -93,7 +93,7 @@ if(do_testdefaults)
   message(STATUS "")
   list_prerequisites("${CMAKE_COMMAND}")
   message(STATUS "")
-endif(do_testdefaults)
+endif()
 
 
 set(do_stresstest 0)
@@ -103,7 +103,7 @@ if(do_stresstest)
   message(STATUS "")
   stresstest_list_prerequisites("${CMAKE_COMMAND}")
   message(STATUS "")
-endif(do_stresstest)
+endif()
 
 
 test_cmake_executables()
@@ -141,7 +141,7 @@ message(STATUS "")
 get_cmake_property(vs VARIABLES)
 foreach(v ${vs})
   message(STATUS "${v}='${${v}}'")
-endforeach(v)
+endforeach()
 message(STATUS "")
 
 message(STATUS "=============================================================================")
diff --git a/Tests/CMakeTests/IncludeTest.cmake.in b/Tests/CMakeTests/IncludeTest.cmake.in
index eca679b4a..985333c4b 100644
--- a/Tests/CMakeTests/IncludeTest.cmake.in
+++ b/Tests/CMakeTests/IncludeTest.cmake.in
@@ -9,18 +9,18 @@ set(fileTwo "${CMAKE_ROOT}/Modules/CMake.cmake")
 if(WIN32)
   string(TOLOWER "${fileOne}" fileOne)
   string(TOLOWER "${fileTwo}" fileTwo)
-endif(WIN32)
+endif()
 
 if(NOT "${fileOne}"   STREQUAL "${fileTwo}")
    message(FATAL_ERROR "Wrong CMake.cmake was included: \"${fileOne}\" expected \"${fileTwo}\"")
-endif(NOT "${fileOne}"   STREQUAL "${fileTwo}")
+endif()
 
 # this one must return NOTFOUND in _includedFile
 include(I_do_not_exist OPTIONAL RESULT_VARIABLE _includedFile)
 
 if(_includedFile)
    message(FATAL_ERROR "File \"I_do_not_exist\" was included, although it shouldn't exist,\nIncluded file is \"${_includedFile}\"")
-endif(_includedFile)
+endif()
 
 # and this one must succeed too
 include(CMake OPTIONAL RESULT_VARIABLE _includedFile)
@@ -29,11 +29,11 @@ set(fileTwo "${CMAKE_ROOT}/Modules/CMake.cmake")
 if(WIN32)
   string(TOLOWER "${fileOne}" fileOne)
   string(TOLOWER "${fileTwo}" fileTwo)
-endif(WIN32)
+endif()
 
 if(NOT "${fileOne}"   STREQUAL "${fileTwo}")
    message(FATAL_ERROR "Wrong CMake.cmake was included: \"${fileOne}\" expected \"${fileTwo}\"")
-endif(NOT "${fileOne}"   STREQUAL "${fileTwo}")
+endif()
 
 # Check that CMAKE_CURRENT_LIST_DIR is working:
 # Needs to be a file in the build tree, which is correct cmake script
diff --git a/Tests/CMakeTests/ListTest.cmake.in b/Tests/CMakeTests/ListTest.cmake.in
index 5db171c3a..07fc7c6d0 100644
--- a/Tests/CMakeTests/ListTest.cmake.in
+++ b/Tests/CMakeTests/ListTest.cmake.in
@@ -1,10 +1,10 @@
 macro(TEST command expected)
   if("x${result}" STREQUAL "x${expected}")
     #message("TEST \"${command}\" success: \"${result}\" expected: \"${expected}\"")
-  else("x${result}" STREQUAL "x${expected}")
+  else()
     message(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"")
-  endif("x${result}" STREQUAL "x${expected}")
-endmacro(TEST command expected)
+  endif()
+endmacro()
 
 set(mylist andy bill ken brad)
 
diff --git a/Tests/CMakeTests/StringTestScript.cmake b/Tests/CMakeTests/StringTestScript.cmake
index 7a264a0e2..a562e71d3 100644
--- a/Tests/CMakeTests/StringTestScript.cmake
+++ b/Tests/CMakeTests/StringTestScript.cmake
@@ -236,42 +236,42 @@ elseif(testname STREQUAL string_find_with_no_possible_result) # pass
   message(STATUS "v='${v}'")
   if(NOT(-1 EQUAL ${v}))
     message(SEND_ERROR "FIND sub-command should return -1 but returned ${v}.")
-  endif(NOT(-1 EQUAL ${v}))
+  endif()
 
 elseif(testname STREQUAL string_find_reverse_with_no_possible_result) # pass
   string(FIND "CMake is a great application." "z" v REVERSE)
   message(STATUS "v='${v}'")
   if(NOT(-1 EQUAL ${v}))
     message(SEND_ERROR "FIND REVERSE sub-command should return -1 but returned ${v}.")
-  endif(NOT(-1 EQUAL ${v}))
+  endif()
 
 elseif(testname STREQUAL string_find_with_required_result) # pass
   string(FIND "CMake is a great application." "g" v)
   message(STATUS "v='${v}'")
   if(NOT(11 EQUAL ${v}))
     message(SEND_ERROR "FIND sub-command should return 11 but returned ${v}.")
-  endif(NOT(11 EQUAL ${v}))
+  endif()
 
 elseif(testname STREQUAL string_find_reverse_with_required_result) # pass
   string(FIND "CMake is a great application." "e" v REVERSE)
   message(STATUS "v='${v}'")
   if(NOT(13 EQUAL ${v}))
     message(SEND_ERROR "FIND REVERSE sub-command should return 13 but returned ${v}.")
-  endif(NOT(13 EQUAL ${v}))
+  endif()
 
 elseif(testname STREQUAL string_find_word_reverse_with_required_result) # pass
   string(FIND "The command should find REVERSE in this string. Or maybe this REVERSE?!" "REVERSE" v)
   message(STATUS "v='${v}'")
   if(NOT(24 EQUAL ${v}))
     message(SEND_ERROR "FIND sub-command should return 24 but returned ${v}.")
-  endif(NOT(24 EQUAL ${v}))
+  endif()
 
 elseif(testname STREQUAL string_find_reverse_word_reverse_with_required_result) # pass
   string(FIND "The command should find REVERSE in this string. Or maybe this REVERSE?!" "REVERSE" v REVERSE)
   message(STATUS "v='${v}'")
   if(NOT(62 EQUAL ${v}))
     message(SEND_ERROR "FIND sub-command should return 62 but returned ${v}.")
-  endif(NOT(62 EQUAL ${v}))
+  endif()
 
 else() # fail
   message(FATAL_ERROR "testname='${testname}' - error: no such test in '${CMAKE_CURRENT_LIST_FILE}'")
diff --git a/Tests/CMakeTests/ToolchainTest.cmake.in b/Tests/CMakeTests/ToolchainTest.cmake.in
index cd258db72..c010fca7c 100644
--- a/Tests/CMakeTests/ToolchainTest.cmake.in
+++ b/Tests/CMakeTests/ToolchainTest.cmake.in
@@ -4,7 +4,7 @@
 # overwrite mark_as_advanced(), since this is used in CMakeDetermineCCompiler.cmake
 # which will complain that it can"t be used in script mode
 macro(MARK_AS_ADVANCED)
-endmacro(MARK_AS_ADVANCED)
+endmacro()
 # set this to a place where we are allowed to write
 set(CMAKE_PLATFORM_ROOT_BIN "${CMAKE_CURRENT_BINARY_DIR}")
 
@@ -21,19 +21,19 @@ include(CMakeDetermineSystem)
 # check that CMAKE_SYSTEM_XXX and CMAKE_HOST_SYSTEM_xxx are identical
 if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "${CMAKE_HOST_SYSTEM_NAME}")
    message(FATAL_ERROR "CMAKE_SYSTEM_NAME and CMAKE_HOST_SYSTEM_NAME not identical: \"${CMAKE_SYSTEM_NAME}\" vs. \"${CMAKE_HOST_SYSTEM_NAME}\"")
-endif(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "${CMAKE_HOST_SYSTEM_NAME}")
+endif()
 
 if(NOT "${CMAKE_SYSTEM}" STREQUAL "${CMAKE_HOST_SYSTEM}")
    message(FATAL_ERROR "CMAKE_SYSTEM and CMAKE_HOST_SYSTEM not identical: \"${CMAKE_SYSTEM}\" vs. \"${CMAKE_HOST_SYSTEM}\"")
-endif(NOT "${CMAKE_SYSTEM}" STREQUAL "${CMAKE_HOST_SYSTEM}")
+endif()
 
 if(NOT "${CMAKE_SYSTEM_VERSION}" STREQUAL "${CMAKE_HOST_SYSTEM_VERSION}")
    message(FATAL_ERROR "CMAKE_SYSTEM_VERSION and CMAKE_HOST_SYSTEM_VERSION not identical: \"${CMAKE_SYSTEM_VERSION}\" vs. \"${CMAKE_HOST_SYSTEM_VERSION}\"")
-endif(NOT "${CMAKE_SYSTEM_VERSION}" STREQUAL "${CMAKE_HOST_SYSTEM_VERSION}")
+endif()
 
 if(NOT "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "${CMAKE_HOST_SYSTEM_PROCESSOR}")
    message(FATAL_ERROR "CMAKE_SYSTEM_PROCESSOR and CMAKE_HOST_SYSTEM_PROCESSOR not identical: \"${CMAKE_SYSTEM_PROCESSOR}\" vs. \"${CMAKE_HOST_SYSTEM_PROCESSOR}\"")
-endif(NOT "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "${CMAKE_HOST_SYSTEM_PROCESSOR}")
+endif()
 
 # save the values so we can compare them to CMAKE_HOST_SYSTEM_XXX in the toolchain case
 
@@ -73,35 +73,35 @@ include(CMakeDetermineCXXCompiler)
 
 if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Dumdidum")
    message(FATAL_ERROR "CMAKE_SYSTEM_NAME overwritten: \"${CMAKE_SYSTEM_NAME}\", was: \"Dumdidum\"")
-endif(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Dumdidum")
+endif()
 
 if(NOT "${CMAKE_SYSTEM}" STREQUAL "Dumdidum-1.0")
    message(FATAL_ERROR "CMAKE_SYSTEM wrong: \"${CMAKE_SYSTEM}\", expected: \"Dumdidum-1.0\"")
-endif(NOT "${CMAKE_SYSTEM}" STREQUAL "Dumdidum-1.0")
+endif()
 set(fileOne "${_INCLUDED_TOOLCHAIN_FILE}")
 set(fileTwo "${MY_SOURCE_DIR}/DummyToolchain.cmake")
 if(WIN32)
   string(TOLOWER "${fileOne}" fileOne)
   string(TOLOWER "${fileTwo}" fileTwo)
-endif(WIN32)
+endif()
 
 if(NOT "${fileOne}"   STREQUAL "${fileTwo}")
    message(FATAL_ERROR "Wrong toolchain was loaded: \"${fileOne}\" expected \"${fileTwo}\"")
-endif(NOT "${fileOne}"   STREQUAL "${fileTwo}")
+endif()
 
 # check that CMAKE_HOST_SYSTEM_XXX and _SYSTEM_xxx detected above are identical
 if(NOT "${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "${NATIVE_SYSTEM_NAME}")
    message(FATAL_ERROR "CMAKE_HOST_SYSTEM_NAME and NATIVE_SYSTEM_NAME not identical: \"${CMAKE_HOST_SYSTEM_NAME}\" vs. \"${NATIVE_SYSTEM_NAME}\"")
-endif(NOT "${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "${NATIVE_SYSTEM_NAME}")
+endif()
 if(NOT "${CMAKE_HOST_SYSTEM}" STREQUAL "${NATIVE_SYSTEM}")
    message(FATAL_ERROR "CMAKE_HOST_SYSTEM and NATIVE_SYSTEM not identical: \"${CMAKE_HOST_SYSTEM}\" vs. \"${NATIVE_SYSTEM}\"")
-endif(NOT "${CMAKE_HOST_SYSTEM}" STREQUAL "${NATIVE_SYSTEM}")
+endif()
 if(NOT "${CMAKE_HOST_SYSTEM_VERSION}" STREQUAL "${NATIVE_SYSTEM_VERSION}")
    message(FATAL_ERROR "CMAKE_HOST_SYSTEM_VERSION and NATIVE_SYSTEM_VERSION not identical: \"${CMAKE_HOST_SYSTEM_VERSION}\" vs. \"${NATIVE_SYSTEM_VERSION}\"")
-endif(NOT "${CMAKE_HOST_SYSTEM_VERSION}" STREQUAL "${NATIVE_SYSTEM_VERSION}")
+endif()
 if(NOT "${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "${NATIVE_SYSTEM_PROCESSOR}")
    message(FATAL_ERROR "CMAKE_HOST_SYSTEM_PROCESSOR and NATIVE_SYSTEM_PROCESSOR not identical: \"${CMAKE_HOST_SYSTEM_PROCESSOR}\" vs. \"${NATIVE_SYSTEM_PROCESSOR}\"")
-endif(NOT "${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "${NATIVE_SYSTEM_PROCESSOR}")
+endif()
 
 #############################################################
 
@@ -109,15 +109,15 @@ endif(NOT "${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "${NATIVE_SYSTEM_PROCESSOR}"
 
 if(NOT "${_CMAKE_TOOLCHAIN_PREFIX}" STREQUAL "arm-elf-")
    message(FATAL_ERROR "wrong toolchain prefix detected: \"${_CMAKE_TOOLCHAIN_PREFIX}\", expected: \"arm-elf-\"")
-endif(NOT "${_CMAKE_TOOLCHAIN_PREFIX}" STREQUAL "arm-elf-")
+endif()
 
 if(NOT "${_CMAKE_USER_C_COMPILER_PATH}" STREQUAL "/opt/foo/bin")
    message(FATAL_ERROR "wrong C compiler location detected: \"${_CMAKE_USER_C_COMPILER_PATH}\", expected: \"/opt/foo/bin\"")
-endif(NOT "${_CMAKE_USER_C_COMPILER_PATH}" STREQUAL "/opt/foo/bin")
+endif()
 
 if(NOT "${CMAKE_C_OUTPUT_EXTENSION}" STREQUAL ".foo")
    message(FATAL_ERROR "C output extension overwritten: \"${CMAKE_C_OUTPUT_EXTENSION}\", was: \".foo\"")
-endif(NOT "${CMAKE_C_OUTPUT_EXTENSION}" STREQUAL ".foo")
+endif()
 
 #############################################################
 
@@ -125,11 +125,11 @@ endif(NOT "${CMAKE_C_OUTPUT_EXTENSION}" STREQUAL ".foo")
 
 if(NOT "${_CMAKE_USER_CXX_COMPILER_PATH}" STREQUAL "/opt/bar/bin")
    message(FATAL_ERROR "wrong CXX compiler location detected: \"${_CMAKE_USER_CXX_COMPILER_PATH}\", expected: \"/opt/bar/bin\"")
-endif(NOT "${_CMAKE_USER_CXX_COMPILER_PATH}" STREQUAL "/opt/bar/bin")
+endif()
 
 if(NOT "${CMAKE_CXX_OUTPUT_EXTENSION}" STREQUAL ".bar")
    message(FATAL_ERROR "C output extension overwritten: \"${CMAKE_CXX_OUTPUT_EXTENSION}\", was: \".bar\"")
-endif(NOT "${CMAKE_CXX_OUTPUT_EXTENSION}" STREQUAL ".bar")
+endif()
 
 message(STATUS "CMAKE_SYSTEM: \"${CMAKE_SYSTEM}\"")
 message(STATUS "_CMAKE_TOOLCHAIN_PREFIX: \"${_CMAKE_TOOLCHAIN_PREFIX}\"")
diff --git a/Tests/CMakeTests/VariableWatchTest.cmake.in b/Tests/CMakeTests/VariableWatchTest.cmake.in
index 3d290d614..0c084fde8 100644
--- a/Tests/CMakeTests/VariableWatchTest.cmake.in
+++ b/Tests/CMakeTests/VariableWatchTest.cmake.in
@@ -7,7 +7,7 @@ macro(testwatch var access file stack)
   message("There was a ${access} access done on the variable: ${var} in file ${file}")
   message("List file stack is: ${stack}")
   set(${var}_watched 1)
-endmacro(testwatch)
+endmacro()
 
 variable_watch(somevar testwatch)
 
diff --git a/Tests/CMakeTests/WhileTest.cmake.in b/Tests/CMakeTests/WhileTest.cmake.in
index 4693f2d8f..4cec291a0 100644
--- a/Tests/CMakeTests/WhileTest.cmake.in
+++ b/Tests/CMakeTests/WhileTest.cmake.in
@@ -10,7 +10,7 @@ while(COUNT LESS 200)
         set(NUMBERS "${NUMBERS} ${NCOUNT}")
         set(NCOUNT "${NCOUNT}0")
     endwhile()
-endwhile(COUNT LESS 200)
+endwhile()
 
 if(NOT NUMBERS STREQUAL " 0 3 30 20 3 30")
     message(SEND_ERROR "while loop nesting error, result: '${NUMBERS}'")
diff --git a/Tests/COnly/CMakeLists.txt b/Tests/COnly/CMakeLists.txt
index 5ef0f1eea..b3cc43813 100644
--- a/Tests/COnly/CMakeLists.txt
+++ b/Tests/COnly/CMakeLists.txt
@@ -10,14 +10,14 @@ target_link_libraries(COnly testc1 testc2)
 if(MSVC_VERSION)
   set_target_properties(COnly PROPERTIES
     LINK_FLAGS " /NODEFAULTLIB:\"libcdg.lib\" /NODEFAULTLIB:\"libcmtg.lib\" /NODEFAULTLIB:\"foomsvcrt.lib\" /NODEFAULTLIB:\"libbar.lib\" /NODEFAULTLIB:\"libfooba.lib\"")
-endif(MSVC_VERSION)
+endif()
 string(ASCII 35 32 67 77 97 107 101 ASCII_STRING)
 message(STATUS "String: ${ASCII_STRING}")
 get_source_file_property(LANG conly.c LANGUAGE)
 if("${LANG}" STREQUAL "C")
   message("Language is C")
-else("${LANG}" STREQUAL "C")
+else()
   message(FATAL_ERROR "Bad language for file conly.c")
-endif("${LANG}" STREQUAL "C")
+endif()
 
 add_library(testCModule MODULE testCModule.c)
diff --git a/Tests/CPackComponents/VerifyResult.cmake b/Tests/CPackComponents/VerifyResult.cmake
index 850ec0022..c7c24fde1 100644
--- a/Tests/CPackComponents/VerifyResult.cmake
+++ b/Tests/CPackComponents/VerifyResult.cmake
@@ -4,7 +4,7 @@ message(STATUS "")
 
 if(NOT CPackComponents_BINARY_DIR)
   message(FATAL_ERROR "CPackComponents_BINARY_DIR not set")
-endif(NOT CPackComponents_BINARY_DIR)
+endif()
 
 set(expected_file_mask "")
 
@@ -18,15 +18,15 @@ if(WIN32)
     )
   if(NSIS_MAKENSIS_EXECUTABLE)
     set(expected_file_mask "${CPackComponents_BINARY_DIR}/MyLib-*.exe")
-  endif(NSIS_MAKENSIS_EXECUTABLE)
-endif(WIN32)
+  endif()
+endif()
 
 if(APPLE)
   # Always expect the *.dmg installer - PackageMaker should always
   # be installed on a development Mac:
   #
   set(expected_file_mask "${CPackComponents_BINARY_DIR}/MyLib-*.dmg")
-endif(APPLE)
+endif()
 
 if(expected_file_mask)
   set(expected_count 1)
@@ -38,11 +38,11 @@ if(expected_file_mask)
 
   if(NOT expected_file)
     message(FATAL_ERROR "error: expected_file does not exist: CPackComponents test fails.")
-  endif(NOT expected_file)
+  endif()
 
   list(LENGTH expected_file actual_count)
   message(STATUS "actual_count='${actual_count}'")
   if(NOT actual_count EQUAL expected_count)
     message(FATAL_ERROR "error: expected_count does not match actual_count: CPackComponents test fails.")
-  endif(NOT actual_count EQUAL expected_count)
-endif(expected_file_mask)
+  endif()
+endif()
diff --git a/Tests/CPackComponentsForAll/CMakeLists.txt b/Tests/CPackComponentsForAll/CMakeLists.txt
index 5449d09dc..8162f0c2a 100644
--- a/Tests/CPackComponentsForAll/CMakeLists.txt
+++ b/Tests/CPackComponentsForAll/CMakeLists.txt
@@ -118,6 +118,6 @@ if (NOT ("${CPackComponentWay}" STREQUAL "default"))
     ${CPackComponentsForAll_BINARY_DIR}/MyLibCPackConfig-${CPackComponentWay}.cmake
     @ONLY)
   set(CPACK_PROJECT_CONFIG_FILE ${CPackComponentsForAll_BINARY_DIR}/MyLibCPackConfig-${CPackComponentWay}.cmake)
-endif (NOT ("${CPackComponentWay}" STREQUAL "default"))
+endif ()
 # Include CPack to introduce the appropriate targets
 include(CPack)
\ No newline at end of file
diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-AllInOne.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-AllInOne.cmake.in
index 1d203c8d8..0bfbf1467 100644
--- a/Tests/CPackComponentsForAll/MyLibCPackConfig-AllInOne.cmake.in
+++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-AllInOne.cmake.in
@@ -3,15 +3,15 @@
 #
 if(CPACK_GENERATOR MATCHES "ZIP")
    set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON")
-endif(CPACK_GENERATOR MATCHES "ZIP")
+endif()
 
 if(CPACK_GENERATOR MATCHES "RPM")
    set(CPACK_RPM_COMPONENT_INSTALL "ON")
-endif(CPACK_GENERATOR MATCHES "RPM")
+endif()
 
 if(CPACK_GENERATOR MATCHES "DEB")
    set(CPACK_DEB_COMPONENT_INSTALL "ON")
-endif(CPACK_GENERATOR MATCHES "DEB")
+endif()
 
 #
 # Choose grouping way
diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in
index 9444a1473..450c2047e 100644
--- a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in
+++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in
@@ -3,16 +3,16 @@
 #
 if(CPACK_GENERATOR MATCHES "ZIP")
    set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON")
-endif(CPACK_GENERATOR MATCHES "ZIP")
+endif()
 
 if(CPACK_GENERATOR MATCHES "RPM")
    set(CPACK_RPM_COMPONENT_INSTALL "ON")
    set(CPACK_RPM_applications_PACKAGE_REQUIRES "mylib-libraries")
-endif(CPACK_GENERATOR MATCHES "RPM")
+endif()
 
 if(CPACK_GENERATOR MATCHES "DEB")
    set(CPACK_DEB_COMPONENT_INSTALL "ON")
-endif(CPACK_GENERATOR MATCHES "DEB")
+endif()
 
 #
 # Choose grouping way
diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in
index 2d251b363..60bdd06be 100644
--- a/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in
+++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in
@@ -3,20 +3,20 @@
 #
 if(CPACK_GENERATOR MATCHES "ZIP")
    set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON")
-endif(CPACK_GENERATOR MATCHES "ZIP")
+endif()
 
 if(CPACK_GENERATOR MATCHES "RPM")
    set(CPACK_RPM_COMPONENT_INSTALL "ON")
    set(CPACK_RPM_Development_PACKAGE_REQUIRES "mylib-Runtime")
-endif(CPACK_GENERATOR MATCHES "RPM")
+endif()
 
 if(CPACK_GENERATOR MATCHES "DEB")
    set(CPACK_DEB_COMPONENT_INSTALL "ON")
-endif(CPACK_GENERATOR MATCHES "DEB")
+endif()
 
 if(CPACK_GENERATOR MATCHES "DragNDrop")
    set(CPACK_COMPONENTS_GROUPING "ONE_PER_GROUP")
-endif(CPACK_GENERATOR MATCHES "DragNDrop")
+endif()
 
 #
 # Choose grouping way
diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
index e2d343d9f..9a022c580 100644
--- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
+++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
@@ -4,21 +4,21 @@ message(STATUS "")
 
 if(NOT CPackComponentsForAll_BINARY_DIR)
   message(FATAL_ERROR "CPackComponentsForAll_BINARY_DIR not set")
-endif(NOT CPackComponentsForAll_BINARY_DIR)
+endif()
 
 if(NOT CPackGen)
   message(FATAL_ERROR "CPackGen not set")
-endif(NOT CPackGen)
+endif()
 get_filename_component(CPACK_LOCATION ${CMAKE_COMMAND} PATH)
 set(CPackCommand "${CPACK_LOCATION}/cpack")
 message("cpack = ${CPackCommand}")
 if(NOT CPackCommand)
   message(FATAL_ERROR "CPackCommand not set")
-endif(NOT CPackCommand)
+endif()
 
 if(NOT CPackComponentWay)
   message(FATAL_ERROR "CPackComponentWay not set")
-endif(NOT CPackComponentWay)
+endif()
 
 set(expected_file_mask "")
 # The usual default behavior is to expect a single file
@@ -30,7 +30,7 @@ set(config_type $ENV{CMAKE_CONFIG_TYPE})
 set(config_args )
 if(config_type)
   set(config_args -C ${config_type})
-endif(config_type)
+endif()
 set(config_verbose )
 
 if(CPackGen MATCHES "ZIP")
@@ -80,15 +80,15 @@ if(CPackGen MATCHES "DragNDrop")
     elseif (${CPackComponentWay} STREQUAL "AllInOne")
         set(expected_count 1)
     endif ()
-endif(CPackGen MATCHES "DragNDrop")
+endif()
 
 # clean-up previously CPack generated files
 if(expected_file_mask)
   file(GLOB expected_file "${expected_file_mask}")
   if (expected_file)
     file(REMOVE ${expected_file})
-  endif(expected_file)
-endif(expected_file_mask)
+  endif()
+endif()
 
 message("config_args = ${config_args}")
 message("config_verbose = ${config_verbose}")
@@ -100,9 +100,9 @@ execute_process(COMMAND ${CPackCommand} ${config_verbose} -G ${CPackGen} ${confi
 
 if (CPack_result)
   message(FATAL_ERROR "error: CPack execution went wrong!, CPack_output=${CPack_output}, CPack_error=${CPack_error}")
-else (CPack_result)
+else ()
   message(STATUS "CPack_output=${CPack_output}")
-endif(CPack_result)
+endif()
 
 # Now verify if the number of expected file is OK
 # - using expected_file_mask and
@@ -116,11 +116,11 @@ if(expected_file_mask)
 
   if(NOT expected_file)
     message(FATAL_ERROR "error: expected_file=${expected_file} does not exist: CPackComponentsForAll test fails. (CPack_output=${CPack_output}, CPack_error=${CPack_error}")
-  endif(NOT expected_file)
+  endif()
 
   list(LENGTH expected_file actual_count)
   message(STATUS "actual_count='${actual_count}'")
   if(NOT actual_count EQUAL expected_count)
     message(FATAL_ERROR "error: expected_count=${expected_count} does not match actual_count=${actual_count}: CPackComponents test fails. (CPack_output=${CPack_output}, CPack_error=${CPack_error})")
-  endif(NOT actual_count EQUAL expected_count)
-endif(expected_file_mask)
+  endif()
+endif()
diff --git a/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in b/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in
index 7731710b4..45f0e3710 100644
--- a/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in
+++ b/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in
@@ -5,7 +5,7 @@ set(CMAKE_CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@")
 
 if (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "${CMAKE_CMAKE_SYSTEM_NAME}")
    message(FATAL_ERROR "Error: CMAKE_SYSTEM_NAME is \"${CMAKE_SYSTEM_NAME}\", but should be \"@CMAKE_SYSTEM_NAME@\"")
-endif(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "${CMAKE_CMAKE_SYSTEM_NAME}")
+endif()
 
 # this seems to be necessary, otherwise ctest complains that these
 # variables are not set:
diff --git a/Tests/CTestTestCostSerial/CMakeLists.txt b/Tests/CTestTestCostSerial/CMakeLists.txt
index 29d2983e8..d3344cfab 100644
--- a/Tests/CTestTestCostSerial/CMakeLists.txt
+++ b/Tests/CTestTestCostSerial/CMakeLists.txt
@@ -6,7 +6,7 @@ add_executable (Sleep sleep.c)
 
 foreach (index RANGE 1 3)
   add_test (TestSleep${index} Sleep)
-endforeach (index RANGE 1 3)
+endforeach ()
 
 set_tests_properties(TestSleep1 PROPERTIES COST -500)
 set_tests_properties(TestSleep2 PROPERTIES COST 12)
diff --git a/Tests/CTestTestCostSerial/test.cmake.in b/Tests/CTestTestCostSerial/test.cmake.in
index 3f0f6f8e8..8661767d6 100644
--- a/Tests/CTestTestCostSerial/test.cmake.in
+++ b/Tests/CTestTestCostSerial/test.cmake.in
@@ -18,7 +18,7 @@ set(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIP
 # Remove old cost data file if it exists
 if(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt")
   file(REMOVE "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt")
-endif(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt")
+endif()
 
 CTEST_START(Experimental)
 CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestScheduler/CMakeLists.txt b/Tests/CTestTestScheduler/CMakeLists.txt
index d2b3bb45a..ccd7b2cbb 100644
--- a/Tests/CTestTestScheduler/CMakeLists.txt
+++ b/Tests/CTestTestScheduler/CMakeLists.txt
@@ -6,4 +6,4 @@ add_executable (Sleep sleep.c)
 
 foreach (time RANGE 1 4)
   add_test (TestSleep${time} Sleep ${time})
-endforeach (time RANGE 1 4)
+endforeach ()
diff --git a/Tests/CTestTestScheduler/test.cmake.in b/Tests/CTestTestScheduler/test.cmake.in
index 87a390a64..9115a6193 100644
--- a/Tests/CTestTestScheduler/test.cmake.in
+++ b/Tests/CTestTestScheduler/test.cmake.in
@@ -18,7 +18,7 @@ set(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIP
 # Remove old cost data file if it exists
 if(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt")
   file(REMOVE "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt")
-endif(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt")
+endif()
 
 CTEST_START(Experimental)
 CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestStopTime/GetDate.cmake b/Tests/CTestTestStopTime/GetDate.cmake
index ac8f65df9..60f1e0c74 100644
--- a/Tests/CTestTestStopTime/GetDate.cmake
+++ b/Tests/CTestTestStopTime/GetDate.cmake
@@ -37,17 +37,17 @@ macro(GET_DATE)
   set(GD_PREFIX "GD_")
   if(NOT "${ARGV0}" STREQUAL "")
     set(GD_PREFIX "${ARGV0}")
-  endif(NOT "${ARGV0}" STREQUAL "")
+  endif()
   if(NOT "${GD_PREFIX}" STREQUAL "GD_")
     set(${GD_PREFIX}PREFIX "${GD_PREFIX}")
-  endif(NOT "${GD_PREFIX}" STREQUAL "GD_")
+  endif()
 
   # If there's an ARGV1, use it as ${GD_PREFIX}VERBOSE:
   #
   set(${GD_PREFIX}VERBOSE "0")
   if(NOT "${ARGV1}" STREQUAL "")
     set(${GD_PREFIX}VERBOSE "${ARGV1}")
-  endif(NOT "${ARGV1}" STREQUAL "")
+  endif()
 
   # Retrieve the current date and time in the format:
   #
@@ -65,13 +65,13 @@ macro(GET_DATE)
     #
     set(${GD_PREFIX}CMD "cmd")
     set(${GD_PREFIX}ARGS "/c echo %DATE% %TIME%")
-  else(WIN32)
+  else()
     #
     # Match the format returned by default in US English Windows:
     #
     set(${GD_PREFIX}CMD "date")
     set(${GD_PREFIX}ARGS "\"+%a %m/%d/%Y %H:%M:%S.00\"")
-  endif(WIN32)
+  endif()
 
   exec_program("${${GD_PREFIX}CMD}" "." ARGS "${${GD_PREFIX}ARGS}"
     OUTPUT_VARIABLE ${GD_PREFIX}OV RETURN_VALUE ${GD_PREFIX}RV
@@ -84,7 +84,7 @@ macro(GET_DATE)
     message(STATUS "GD_PREFIX='${GD_PREFIX}'")
     if(NOT "${GD_PREFIX}" STREQUAL "GD_")
       message(STATUS "${GD_PREFIX}PREFIX='${${GD_PREFIX}PREFIX}'")
-    endif(NOT "${GD_PREFIX}" STREQUAL "GD_")
+    endif()
     message(STATUS "${GD_PREFIX}VERBOSE='${${GD_PREFIX}VERBOSE}'")
     message(STATUS "")
     message(STATUS "${GD_PREFIX}CMD='${${GD_PREFIX}CMD}'")
@@ -92,7 +92,7 @@ macro(GET_DATE)
     message(STATUS "${GD_PREFIX}OV='${${GD_PREFIX}OV}'")
     message(STATUS "${GD_PREFIX}RV='${${GD_PREFIX}RV}'")
     message(STATUS "")
-  endif(${GD_PREFIX}VERBOSE)
+  endif()
 
   if("${${GD_PREFIX}RV}" STREQUAL "0")
     #
@@ -119,59 +119,59 @@ macro(GET_DATE)
     #
     if(NOT "${${GD_PREFIX}YEAR}" MATCHES "^[0-9][0-9][0-9][0-9]$")
       message(STATUS "WARNING: Extracted ${GD_PREFIX}YEAR='${${GD_PREFIX}YEAR}' is not a four digit number...")
-    endif(NOT "${${GD_PREFIX}YEAR}" MATCHES "^[0-9][0-9][0-9][0-9]$")
+    endif()
 
     # Expecting month to be <= 12:
     #
     if(${${GD_PREFIX}MONTH} GREATER 12)
       message(STATUS "WARNING: Extracted ${GD_PREFIX}MONTH='${${GD_PREFIX}MONTH}' is greater than 12!")
-    endif(${${GD_PREFIX}MONTH} GREATER 12)
+    endif()
 
     # Expecting day to be <= 31:
     #
     if(${${GD_PREFIX}DAY} GREATER 31)
       message(STATUS "WARNING: Extracted ${GD_PREFIX}DAY='${${GD_PREFIX}DAY}' is greater than 31!")
-    endif(${${GD_PREFIX}DAY} GREATER 31)
+    endif()
 
     # Expecting hour to be <= 23:
     #
     if(${${GD_PREFIX}HOUR} GREATER 23)
       message(STATUS "WARNING: Extracted ${GD_PREFIX}HOUR='${${GD_PREFIX}HOUR}' is greater than 23!")
-    endif(${${GD_PREFIX}HOUR} GREATER 23)
+    endif()
 
     # Expecting minute to be <= 59:
     #
     if(${${GD_PREFIX}MINUTE} GREATER 59)
       message(STATUS "WARNING: Extracted ${GD_PREFIX}MINUTE='${${GD_PREFIX}MINUTE}' is greater than 59!")
-    endif(${${GD_PREFIX}MINUTE} GREATER 59)
+    endif()
 
     # Expecting second to be <= 59:
     #
     if(${${GD_PREFIX}SECOND} GREATER 59)
       message(STATUS "WARNING: Extracted ${GD_PREFIX}SECOND='${${GD_PREFIX}SECOND}' is greater than 59!")
-    endif(${${GD_PREFIX}SECOND} GREATER 59)
+    endif()
 
     # If individual components are single digit,
     # prepend a leading zero:
     #
     if("${${GD_PREFIX}YEAR}" MATCHES "^[0-9]$")
       set(${GD_PREFIX}YEAR "0${${GD_PREFIX}YEAR}")
-    endif("${${GD_PREFIX}YEAR}" MATCHES "^[0-9]$")
+    endif()
     if("${${GD_PREFIX}MONTH}" MATCHES "^[0-9]$")
       set(${GD_PREFIX}MONTH "0${${GD_PREFIX}MONTH}")
-    endif("${${GD_PREFIX}MONTH}" MATCHES "^[0-9]$")
+    endif()
     if("${${GD_PREFIX}DAY}" MATCHES "^[0-9]$")
       set(${GD_PREFIX}DAY "0${${GD_PREFIX}DAY}")
-    endif("${${GD_PREFIX}DAY}" MATCHES "^[0-9]$")
+    endif()
     if("${${GD_PREFIX}HOUR}" MATCHES "^[0-9]$")
       set(${GD_PREFIX}HOUR "0${${GD_PREFIX}HOUR}")
-    endif("${${GD_PREFIX}HOUR}" MATCHES "^[0-9]$")
+    endif()
     if("${${GD_PREFIX}MINUTE}" MATCHES "^[0-9]$")
       set(${GD_PREFIX}MINUTE "0${${GD_PREFIX}MINUTE}")
-    endif("${${GD_PREFIX}MINUTE}" MATCHES "^[0-9]$")
+    endif()
     if("${${GD_PREFIX}SECOND}" MATCHES "^[0-9]$")
       set(${GD_PREFIX}SECOND "0${${GD_PREFIX}SECOND}")
-    endif("${${GD_PREFIX}SECOND}" MATCHES "^[0-9]$")
+    endif()
 
     if(${GD_PREFIX}VERBOSE)
       message(STATUS "${GD_PREFIX}REGEX='${${GD_PREFIX}REGEX}'")
@@ -192,16 +192,16 @@ macro(GET_DATE)
       message(STATUS "             monthly : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}")
       message(STATUS "            annually : ${${GD_PREFIX}YEAR}")
       message(STATUS "")
-    endif(${GD_PREFIX}VERBOSE)
-  else("${${GD_PREFIX}RV}" STREQUAL "0")
+    endif()
+  else()
     message(SEND_ERROR "ERROR: macro(GET_DATE) failed. ${GD_PREFIX}CMD='${${GD_PREFIX}CMD}' ${GD_PREFIX}ARGS='${${GD_PREFIX}ARGS}' ${GD_PREFIX}OV='${${GD_PREFIX}OV}' ${GD_PREFIX}RV='${${GD_PREFIX}RV}'")
-  endif("${${GD_PREFIX}RV}" STREQUAL "0")
+  endif()
 
   if(${GD_PREFIX}VERBOSE)
     message(STATUS "</GET_DATE>")
     message(STATUS "")
-  endif(${GD_PREFIX}VERBOSE)
-endmacro(GET_DATE)
+  endif()
+endmacro()
 
 macro(ADD_SECONDS sec)
   set(new_min ${${GD_PREFIX}MINUTE})
@@ -230,4 +230,4 @@ macro(ADD_SECONDS sec)
   if(${hr_len} EQUAL 1)
     set(new_hr "0${new_hr}")
   endif()
-endmacro(ADD_SECONDS)
+endmacro()
diff --git a/Tests/CTestUpdateBZR.cmake.in b/Tests/CTestUpdateBZR.cmake.in
index c654f477a..8fb1d3483 100644
--- a/Tests/CTestUpdateBZR.cmake.in
+++ b/Tests/CTestUpdateBZR.cmake.in
@@ -74,7 +74,7 @@ if(dirs_added)
     WORKING_DIRECTORY ${TOP}/user-source
     COMMAND ${BZR} add ${dirs_added}
     )
-endif(dirs_added)
+endif()
 run_child(
   WORKING_DIRECTORY ${TOP}/user-source
   COMMAND ${BZR} add ${files_added}
diff --git a/Tests/CTestUpdateCVS.cmake.in b/Tests/CTestUpdateCVS.cmake.in
index f7f5db65d..1699c3f1f 100644
--- a/Tests/CTestUpdateCVS.cmake.in
+++ b/Tests/CTestUpdateCVS.cmake.in
@@ -91,7 +91,7 @@ if(dirs_added)
     WORKING_DIRECTORY ${TOP}/user-source
     COMMAND ${CVSCMD} add ${dirs_added}
     )
-endif(dirs_added)
+endif()
 run_child(
   WORKING_DIRECTORY ${TOP}/user-source
   COMMAND ${CVSCMD} add ${files_added}
diff --git a/Tests/CTestUpdateCommon.cmake b/Tests/CTestUpdateCommon.cmake
index 335d09e7e..aaf88a8d1 100644
--- a/Tests/CTestUpdateCommon.cmake
+++ b/Tests/CTestUpdateCommon.cmake
@@ -12,8 +12,8 @@ function(run_child)
     string(REGEX REPLACE "\n" "\n  " OUTPUT "${OUTPUT}")
     message(FATAL_ERROR "Child failed (${FAILED}), output is\n  ${OUTPUT}\n"
       "Command = [${ARGN}]\n")
-  endif(FAILED)
-endfunction(run_child)
+  endif()
+endfunction()
 
 #-----------------------------------------------------------------------------
 # Function to find the Update.xml file and check for expected entries.
@@ -26,7 +26,7 @@ function(check_updates build)
     )
   if(NOT UPDATE_XML_FILE)
     message(FATAL_ERROR "Cannot find Update.xml with pattern\n  ${PATTERN}")
-  endif(NOT UPDATE_XML_FILE)
+  endif()
   message(" found ${UPDATE_XML_FILE}")
 
   set(max_update_xml_size 16384)
@@ -73,11 +73,11 @@ function(check_updates build)
     set(MSG "${MSG}Update.xml is missing expected entries:\n")
     foreach(f ${MISSING})
       set(MSG "${MSG}  ${f}\n")
-    endforeach(f)
-  else(MISSING)
+    endforeach()
+  else()
     # Success
     message(" no entries missing from Update.xml")
-  endif(MISSING)
+  endif()
 
   # Report the result
   if(EXTRA)
@@ -85,11 +85,11 @@ function(check_updates build)
     set(MSG "${MSG}Update.xml has extra unexpected entries:\n")
     foreach(f ${EXTRA})
       set(MSG "${MSG}  ${f}\n")
-    endforeach(f)
-  else(EXTRA)
+    endforeach()
+  else()
     # Success
     message(" no extra entries in Update.xml")
-  endif(EXTRA)
+  endif()
 
   if(MSG)
     # Provide the log file
@@ -99,14 +99,14 @@ function(check_updates build)
       file(READ ${UPDATE_LOG_FILE} UPDATE_LOG LIMIT ${max_update_xml_size})
       string(REGEX REPLACE "\n" "\n  " UPDATE_LOG "${UPDATE_LOG}")
       set(MSG "${MSG}Update log:\n  ${UPDATE_LOG}")
-    else(UPDATE_LOG_FILE)
+    else()
       set(MSG "${MSG}No update log found!")
-    endif(UPDATE_LOG_FILE)
+    endif()
 
     # Display the error message
     message(FATAL_ERROR "${MSG}")
-  endif(MSG)
-endfunction(check_updates)
+  endif()
+endfunction()
 
 #-----------------------------------------------------------------------------
 # Function to create initial content.
@@ -123,7 +123,7 @@ set(CTEST_NIGHTLY_START_TIME \"21:00:00 EDT\")
   # Some other files.
   file(WRITE ${TOP}/${dir}/foo.txt "foo\n")
   file(WRITE ${TOP}/${dir}/bar.txt "bar\n")
-endfunction(create_content)
+endfunction()
 
 #-----------------------------------------------------------------------------
 # Function to update content.
@@ -137,20 +137,20 @@ function(update_content dir added_var removed_var dirs_var)
   set(${dirs_var} subdir PARENT_SCOPE)
   set(${added_var} zot.txt subdir/foo.txt subdir/bar.txt PARENT_SCOPE)
   set(${removed_var} bar.txt PARENT_SCOPE)
-endfunction(update_content)
+endfunction()
 
 #-----------------------------------------------------------------------------
 # Function to change existing files
 function(change_content dir)
   file(APPEND ${TOP}/${dir}/foo.txt "foo line 3\n")
   file(APPEND ${TOP}/${dir}/subdir/foo.txt "foo line 2\n")
-endfunction(change_content)
+endfunction()
 
 #-----------------------------------------------------------------------------
 # Function to create local modifications before update
 function(modify_content dir)
   file(APPEND ${TOP}/${dir}/CTestConfig.cmake "# local modification\n")
-endfunction(modify_content)
+endfunction()
 
 #-----------------------------------------------------------------------------
 # Function to write CTestConfiguration.ini content.
@@ -163,7 +163,7 @@ BuildDirectory: ${TOP}/${bin_dir}
 Site: test.site
 BuildName: user-test
 ")
-endfunction(create_build_tree)
+endfunction()
 
 #-----------------------------------------------------------------------------
 # Function to write the dashboard test script.
@@ -181,7 +181,7 @@ ${custom_text}
 ctest_start(Experimental)
 ctest_update(SOURCE \${CTEST_SOURCE_DIRECTORY})
 ")
-endfunction(create_dashboard_script)
+endfunction()
 
 #-----------------------------------------------------------------------------
 # Function to run the dashboard through the command line
@@ -205,7 +205,7 @@ function(run_dashboard_command_line bin_dir)
     Updated{subdir/bar.txt}
     ${_modified}
     )
-endfunction(run_dashboard_command_line)
+endfunction()
 
 #-----------------------------------------------------------------------------
 # Function to run the dashboard through a script
@@ -224,11 +224,11 @@ function(run_dashboard_script bin_dir)
     Updated{subdir/foo.txt}
     Updated{subdir/bar.txt}
     )
-endfunction(run_dashboard_script)
+endfunction()
 
 #-----------------------------------------------------------------------------
 # Function to initialize the testing directory.
 function(init_testing)
   file(REMOVE_RECURSE ${TOP})
   file(MAKE_DIRECTORY ${TOP})
-endfunction(init_testing)
+endfunction()
diff --git a/Tests/CTestUpdateGIT.cmake.in b/Tests/CTestUpdateGIT.cmake.in
index eb9f987c6..0c01291e7 100644
--- a/Tests/CTestUpdateGIT.cmake.in
+++ b/Tests/CTestUpdateGIT.cmake.in
@@ -159,7 +159,7 @@ if(dirs_added)
     WORKING_DIRECTORY ${TOP}/user-source
     COMMAND ${GIT} add ${dirs_added}
     )
-endif(dirs_added)
+endif()
 run_child(
   WORKING_DIRECTORY ${TOP}/user-source
   COMMAND ${GIT} add ${files_added}
@@ -221,7 +221,7 @@ macro(rewind_source src_dir)
     WORKING_DIRECTORY ${TOP}/${src_dir}
     COMMAND ${GIT} submodule update
     )
-endmacro(rewind_source)
+endmacro()
 rewind_source(user-source)
 
 # Make sure pull does not try to rebase (which does not work with
diff --git a/Tests/CTestUpdateHG.cmake.in b/Tests/CTestUpdateHG.cmake.in
index 640d2c6f3..c5440f954 100644
--- a/Tests/CTestUpdateHG.cmake.in
+++ b/Tests/CTestUpdateHG.cmake.in
@@ -70,7 +70,7 @@ if(dirs_added)
     WORKING_DIRECTORY ${TOP}/user-source
     COMMAND ${HG} add ${dirs_added}
     )
-endif(dirs_added)
+endif()
 run_child(
   WORKING_DIRECTORY ${TOP}/user-source
   COMMAND ${HG} add ${files_added}
diff --git a/Tests/CTestUpdateSVN.cmake.in b/Tests/CTestUpdateSVN.cmake.in
index 15b833b10..b5728fd67 100644
--- a/Tests/CTestUpdateSVN.cmake.in
+++ b/Tests/CTestUpdateSVN.cmake.in
@@ -74,7 +74,7 @@ if(dirs_added)
     WORKING_DIRECTORY ${TOP}/user-source
     COMMAND ${SVNCMD} add ${depth_empty} ${dirs_added}
     )
-endif(dirs_added)
+endif()
 run_child(
   WORKING_DIRECTORY ${TOP}/user-source
   COMMAND ${SVNCMD} add ${files_added}
diff --git a/Tests/CommandLineTest/CMakeLists.txt b/Tests/CommandLineTest/CMakeLists.txt
index 8a4b4f4a8..96aac104c 100644
--- a/Tests/CommandLineTest/CMakeLists.txt
+++ b/Tests/CommandLineTest/CMakeLists.txt
@@ -6,8 +6,8 @@ macro(EXEC_CMAKE_COMMAND CMAKE_ARGS)
   exec_program("${CMAKE_COMMAND}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET)
   if(${RET})
     message(SEND_ERROR "CMake command failed with arguments \"${CMAKE_ARGS}\"")
-  endif(${RET})
-endmacro(EXEC_CMAKE_COMMAND)
+  endif()
+endmacro()
 
 EXEC_CMAKE_COMMAND("-E chdir \"${CMAKE_CURRENT_SOURCE_DIR}\" \"${CMAKE_COMMAND}\" -E echo \"Hello World\"")
 EXEC_CMAKE_COMMAND("-E time \"${CMAKE_COMMAND} -N -L ${CommandLineTest_SOURCE_DIR}\"")
@@ -32,14 +32,14 @@ macro(EXEC_CTEST_COMMAND CMAKE_ARGS)
   exec_program("${CTEST_COMMAND}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET)
   if(${RET})
     message(SEND_ERROR "CTest command failed with arguments \"${CMAKE_ARGS}\"")
-  endif(${RET})
-endmacro(EXEC_CTEST_COMMAND)
+  endif()
+endmacro()
 macro(EXEC_CTEST_COMMAND_WITH_DIR DIR CMAKE_ARGS)
   exec_program("${CTEST_COMMAND}" "${DIR}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET)
   if(${RET})
     message(SEND_ERROR "CTest command failed with arguments \"${CMAKE_ARGS}\"")
-  endif(${RET})
-endmacro(EXEC_CTEST_COMMAND_WITH_DIR)
+  endif()
+endmacro()
 
 EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.."  "-N")
 EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.."  "-R complex -N")
@@ -59,21 +59,21 @@ if(THIS_SHOULD_BE_SET)
   message(STATUS "***************************")
   message(STATUS "PreLoad.cmake works fine.")
   message(STATUS "***************************")
-else(THIS_SHOULD_BE_SET)
+else()
   message("***************************")
   message(FATAL_ERROR "PreLoad.cmake does not work.")
-endif(THIS_SHOULD_BE_SET)
+endif()
 
 if(DEFINED ENV{TEST_ENVIRONMENT_VARIABLE_NOTSET})
   message(SEND_ERROR "Environment variable definition test broken!")
-endif(DEFINED ENV{TEST_ENVIRONMENT_VARIABLE_NOTSET})
+endif()
 
 set(ENV{TEST_ENVIRONMENT_VARIABLE} "Environment variable set")
 if("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set")
   message(STATUS "Environment variable set to: $ENV{TEST_ENVIRONMENT_VARIABLE}")
   if(NOT DEFINED ENV{TEST_ENVIRONMENT_VARIABLE})
     message(SEND_ERROR "Environment variable definition test failed!")
-  endif(NOT DEFINED ENV{TEST_ENVIRONMENT_VARIABLE})
-else("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set")
+  endif()
+else()
   message(SEND_ERROR "Environment variable setting is broken")
-endif("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set")
+endif()
diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt
index 45ea9019a..048f966f6 100644
--- a/Tests/Complex/CMakeLists.txt
+++ b/Tests/Complex/CMakeLists.txt
@@ -11,8 +11,8 @@ if(POLICY CMP0003)
   cmake_policy(GET CMP0003 P3)
   if(NOT "${P3}" STREQUAL "NEW")
     message(FATAL_ERROR "cmake_policy(GET) did not report NEW!")
-  endif(NOT "${P3}" STREQUAL "NEW")
-endif(POLICY CMP0003)
+  endif()
+endif()
 
 # Test building without per-rule echo lines in Makefiles.
 set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
@@ -25,8 +25,8 @@ set(CPACK_SOURCE_IGNORE_FILES "~$;\\.cvsignore$;^C:/hoffman/My Builds/testcase.*
 macro(ASSERT value msg)
   if (NOT ${value})
     message ("Assertion failure:" ${msg} )
-  endif (NOT ${value})
-endmacro(ASSERT)
+  endif ()
+endmacro()
 
 # invoke the macro
 ASSERT(Complex_BINARY_DIR "The PROJECT command is broken")
@@ -38,8 +38,8 @@ macro(TEST_ARGC value1 value2)
   add_definitions(${value1} ${value2})
   if (${ARGC} MATCHES 4)
     add_definitions(${ARGV2} ${ARGV3})
-  endif (${ARGC} MATCHES 4)
-endmacro(TEST_ARGC)
+  endif ()
+endmacro()
 
 # invoke the macro
 TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4)
@@ -47,34 +47,34 @@ TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4)
 macro(TEST_VAR_ARG fa)
   if("${ARGV}" MATCHES "^1;2;3$")
     message(STATUS "ARGV works")
-  else("${ARGV}" MATCHES "^1;2;3$")
+  else()
     message(FATAL_ERROR "ARGV does not work; got \"${ARGV}\" instead of \"1;2;3\"")
-  endif("${ARGV}" MATCHES "^1;2;3$")
+  endif()
   if("${ARGN}" MATCHES "^2;3$")
     message(STATUS "ARGN works")
-  else("${ARGN}" MATCHES "^2;3$")
+  else()
     message(FATAL_ERROR "ARGV does not work; got \"${ARGN}\" instead of \"2;3\"")
-  endif("${ARGN}" MATCHES "^2;3$")
-endmacro(TEST_VAR_ARG)
+  endif()
+endmacro()
 
 TEST_VAR_ARG(1 2 3)
 
 # Floating-point comparison test.
 if(2.4 LESS 2.4)
   message(FATAL_ERROR "Failed: 2.4 LESS 2.4")
-endif(2.4 LESS 2.4)
+endif()
 if(2.4 GREATER 2.4)
   message(FATAL_ERROR "Failed: 2.4 GREATER 2.4")
-endif(2.4 GREATER 2.4)
+endif()
 if(NOT 2.4 EQUAL 2.4)
   message(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4")
-endif(NOT 2.4 EQUAL 2.4)
+endif()
 
 if(CMAKE_SYSTEM MATCHES "OSF1-V.*")
   if(NOT CMAKE_COMPILER_IS_GNUCXX)
      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ")
-  endif(NOT CMAKE_COMPILER_IS_GNUCXX)
-endif(CMAKE_SYSTEM MATCHES "OSF1-V.*")
+  endif()
+endif()
 
 
 add_definitions(-DCMAKE_IS_FUN)
@@ -93,7 +93,7 @@ separate_arguments(TEST_SEP)
 #
 if (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
   include(${Complex_SOURCE_DIR}/VarTests.cmake)
-endif (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
+endif ()
 include(fileshouldnotbehere OPTIONAL)
 load_cache(${Complex_SOURCE_DIR}/Cache
            EXCLUDE
@@ -104,9 +104,9 @@ load_cache(${Complex_SOURCE_DIR}/Cache
 load_cache(${Complex_SOURCE_DIR}/Cache READ_WITH_PREFIX foo CACHE_TEST_VAR2)
 if(${fooCACHE_TEST_VAR2} MATCHES bar)
   message("Load cache worked: ${fooCACHE_TEST_VAR2}")
-else(${fooCACHE_TEST_VAR2} MATCHES bar)
+else()
   message(FATAL_ERROR "Load cache with prefix failed: ${fooCACHE_TEST_VAR2}")
-endif(${fooCACHE_TEST_VAR2} MATCHES bar)
+endif()
 
 
 
@@ -151,9 +151,9 @@ message("\nIgnore this message")
 option(NO_EXEC_PROGRAM "Do not test EXEC_PROGRAM" 0)
 if (NOT NO_EXEC_PROGRAM)
   exec_program(${CMAKE_COMMAND} ARGS -E echo NO_EXEC_PROGRAM "${Complex_BINARY_DIR}")
-else (NOT NO_EXEC_PROGRAM)
+else ()
   message("Set this option ON")
-endif (NOT NO_EXEC_PROGRAM)
+endif ()
 
 mark_as_advanced(NO_EXEC_PROGRAM)
 mark_as_advanced(CLEAR NO_EXEC_PROGRAM)
@@ -164,9 +164,9 @@ execute_process(
   OUTPUT_VARIABLE TEST_OUT
   )
 if("${TEST_OUT}" MATCHES "^ABCDEFG\n$")
-else("${TEST_OUT}" MATCHES "^ABCDEFG\n$")
+else()
   message(SEND_ERROR "EXECUTE_PROCESS output test failed: [${TEST_OUT}]")
-endif("${TEST_OUT}" MATCHES "^ABCDEFG\n$")
+endif()
 
 # This test has some problems on UNIX systems.  Disabling for now.
 #
@@ -180,9 +180,9 @@ endif("${TEST_OUT}" MATCHES "^ABCDEFG\n$")
 # if("${RESULT}" MATCHES "^0$")
 #   message(SEND_ERROR
 #     "EXECUTE_PROCESS result test failed with RESULT=[${RESULT}]")
-# else("${RESULT}" MATCHES "^0$")
+# else()
 #   message(STATUS "EXECUTE_PROCESS result test passed with RESULT=[${RESULT}]")
-# endif("${RESULT}" MATCHES "^0$")
+# endif()
 
 #
 # Create directory.
@@ -206,7 +206,7 @@ foreach (ext ${CMAKE_SHLIB_SUFFIX};.so;.a;.sl
     ${Complex_SOURCE_DIR}/Library/dummy
     ${Complex_BINARY_DIR}/Library/libdummylib${ext}
     COPYONLY IMMEDIATE)
-endforeach (ext)
+endforeach ()
 
 find_library(FIND_DUMMY_LIB
              dummylib
@@ -288,8 +288,8 @@ if (WIN32)
       "[${hkey}]" DOC "Registry_Test_Path")
     exec_program(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"")
     exec_program(${CMAKE_COMMAND} ARGS "-E remove \"${dir}/${file}\"")
-  endif (NOT UNIX)
-endif (WIN32)
+  endif ()
+endif ()
 
 #
 # Test a set and a remove
@@ -305,17 +305,17 @@ foreach(x "a")
   if(${x} MATCHES "a")
     # Should always execute.
     set(IF_INSIDE_FOREACH_THEN_EXECUTED 1)
-  else(${x} MATCHES "a")
+  else()
     # Should never execute.
     set(IF_INSIDE_FOREACH_ELSE_EXECUTED 1)
-  endif(${x} MATCHES "a")
-endforeach(x)
+  endif()
+endforeach()
 
 # test WHILE command
 set (while_var 1)
 while (while_var LESS 1000)
   set(while_var ${while_var}0)
-endwhile(while_var LESS 1000)
+endwhile()
 
 set(SHOULD_BE_ZERO )
 set(SHOULD_BE_ONE 1)
@@ -328,7 +328,7 @@ if (RESULT EQUAL 1)
     set (ELSEIF_RESULT 1)
   elseif (RESULT EQUAL 3)
     set (ELSEIF_RESULT 1)
-  endif (RESULT EQUAL 2)
+  endif ()
 elseif (RESULT EQUAL 2)
   set (ELSEIF_RESULT 1)
 elseif (RESULT EQUAL 3)
@@ -337,25 +337,25 @@ elseif (RESULT EQUAL 3)
   elseif (RESULT EQUAL 3)
     if (NOT ELSEIF_RESULT EQUAL 1)
       set (ELSEIF_RESULT 2)
-    endif (NOT ELSEIF_RESULT EQUAL 1)
-  endif (RESULT EQUAL 2)
+    endif ()
+  endif ()
 elseif (RESULT EQUAL 4)
   if (RESULT EQUAL 2)
     set (ELSEIF_RESULT 1)
   elseif (RESULT EQUAL 3)
     set (ELSEIF_RESULT 1)
-  endif (RESULT EQUAL 2)
-else (RESULT  EQUAL 1)
+  endif ()
+else ()
   if (RESULT EQUAL 2)
     set (ELSEIF_RESULT 1)
   elseif (RESULT EQUAL 3)
     set (ELSEIF_RESULT 1)
-  endif (RESULT EQUAL 2)
-endif (RESULT EQUAL 1)
+  endif ()
+endif ()
 
 if (NOT ELSEIF_RESULT EQUAL 2)
   set (ELSEIF_RESULT 0)
-endif (NOT ELSEIF_RESULT EQUAL 2)
+endif ()
 
 # test handling of parenthetical groups in conditionals
 if (2 GREATER 1 AND (4 LESS 3 OR 5 LESS 6) AND NOT (7 GREATER 8))
@@ -381,19 +381,19 @@ configure_file(
 string(REGEX MATCH "b" RESULT "abc")
 if(NOT RESULT)
   message(SEND_ERROR "string(REGEX MATCH ... ) test failed.")
-endif(NOT RESULT)
+endif()
 string(REGEX MATCHALL "b" RESULT "abcb")
 if(NOT RESULT)
   message(SEND_ERROR "string(REGEX MATCHALL ... ) test failed.")
-endif(NOT RESULT)
+endif()
 string(REGEX REPLACE ".([bd])." "[\\1]" RESULT "a(b)c(d)e")
 if("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$")
   set(STRING_REGEX_PASSED 1)
-endif("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$")
+endif()
 if(NOT STRING_REGEX_PASSED)
   message(SEND_ERROR
     "string(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")")
-endif(NOT STRING_REGEX_PASSED)
+endif()
 
 
 #
diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt
index 413883551..432dbf890 100644
--- a/Tests/Complex/Executable/CMakeLists.txt
+++ b/Tests/Complex/Executable/CMakeLists.txt
@@ -11,16 +11,16 @@ add_library(ExeImportedTarget UNKNOWN IMPORTED)
 # Test if(TARGET) command.
 if(NOT TARGET CMakeTestLibrary)
   message(FATAL_ERROR "if(NOT TARGET CMakeTestLibrary) returned true!")
-endif(NOT TARGET CMakeTestLibrary)
+endif()
 if(NOT TARGET ExeImportedTarget)
   message(FATAL_ERROR "if(NOT TARGET ExeImportedTarget) returned true!")
-endif(NOT TARGET ExeImportedTarget)
+endif()
 if(TARGET LibImportedTarget)
   message(FATAL_ERROR "if(TARGET LibImportedTarget) returned true!")
-endif(TARGET LibImportedTarget)
+endif()
 if(TARGET NotATarget)
   message(FATAL_ERROR "if(TARGET NotATarget) returned true!")
-endif(TARGET NotATarget)
+endif()
 
   # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to
 set(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared)
@@ -46,37 +46,37 @@ add_executable(complex.file complex.file.cxx complex_nobuild.cxx
 
 if (UNIX)
   target_link_libraries(complex ${CMAKE_DL_LIBS})
-else(UNIX)
+else()
   if (NOT BORLAND)
     if(NOT MINGW)
       target_link_libraries(complex rpcrt4.lib)
-    endif(NOT MINGW)
-  endif(NOT BORLAND)
-endif (UNIX)
+    endif()
+  endif()
+endif ()
 
 # Test linking to static lib when a shared lib has the same name.
 if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
   add_definitions(-DCOMPLEX_TEST_LINK_STATIC)
   target_link_libraries(complex CMakeTestLinkStatic)
-endif(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
+endif()
 
 # can we get the path to a source file
 get_source_file_property(A_LOCATION A.cxx LOCATION)
 if ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx")
   add_definitions(-DCMAKE_FOUND_ACXX)
-endif ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx")
+endif ()
 
 # get the directory parent
 get_directory_property(P_VALUE PARENT_DIRECTORY)
 if ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}")
   add_definitions(-DCMAKE_FOUND_PARENT)
-endif ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}")
+endif ()
 
 # get the stack of listfiles
 include(Included.cmake)
 if ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake")
   add_definitions(-DCMAKE_FOUND_LISTFILE_STACK)
-endif ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake")
+endif ()
 
 # Test add/remove definitions.
 add_definitions(
@@ -128,7 +128,7 @@ target_link_libraries(notInAllExe notInAllLib)
 if(MSVC)
   set_target_properties(notInAllExe PROPERTIES
     LINK_FLAGS "/NODEFAULTLIB:LIBC;LIBCMT;MSVCRT")
-endif(MSVC)
+endif()
 
 # Test creating a custom target that builds not-in-all targets.
 add_custom_target(notInAllCustom)
@@ -146,7 +146,7 @@ add_subdirectory(Temp)
 if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
   add_executable(testSystemDir testSystemDir.cxx)
   set_target_properties(testSystemDir PROPERTIES COMPILE_FLAGS "-Werror")
-endif(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
+endif()
 
 #
 # Extra coverage.Not used.
diff --git a/Tests/Complex/Library/CMakeLists.txt b/Tests/Complex/Library/CMakeLists.txt
index 41faeba4d..5c430523e 100644
--- a/Tests/Complex/Library/CMakeLists.txt
+++ b/Tests/Complex/Library/CMakeLists.txt
@@ -33,10 +33,10 @@ if(WIN32)
         target_link_libraries(CMakeTestLibrary
           optimized
           kernel32.lib)
-      endif(NOT MINGW)
-    endif(NOT BORLAND)
-  endif(NOT CYGWIN)
-endif(WIN32)
+      endif()
+    endif()
+  endif()
+endif()
 
 #
 # Create shared library
@@ -53,12 +53,12 @@ define_property(
 set_target_properties(CMakeTestCLibraryShared PROPERTIES FOO BAR)
 if(NOT BEOS AND NOT WIN32)  # No libm on BeOS.
   set_target_properties(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm")
-endif(NOT BEOS AND NOT WIN32)
+endif()
 get_target_property(FOO_BAR_VAR CMakeTestCLibraryShared FOO)
 if(${FOO_BAR_VAR} MATCHES "BAR")
-else(${FOO_BAR_VAR} MATCHES "BAR")
+else()
   message(SEND_ERROR "SET_TARGET_PROPERTIES or GET_TARGET_PROPERTY failed, FOO_BAR_VAR should be BAR, but is ${FOO_BAR_VAR}")
-endif(${FOO_BAR_VAR} MATCHES "BAR")
+endif()
 
 # Create static and shared lib of same name.
 if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
@@ -66,7 +66,7 @@ if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
   add_library(CMakeTestLinkShared SHARED TestLink.c)
   set_target_properties(CMakeTestLinkStatic CMakeTestLinkShared
     PROPERTIES OUTPUT_NAME CMakeTestLink)
-endif(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
+endif()
 
 #
 # Attach pre-build/pre-link/post-build custom-commands to the lib.
@@ -127,7 +127,7 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM)
     if(ARCH_COUNT GREATER 1)
       # OSX does not support preprocessing more than one architecture.
       set(MAYBE_ALL)
-    endif(ARCH_COUNT GREATER 1)
+    endif()
 
     # Custom target to try preprocessing invocation.
     add_custom_target(test_preprocess ${MAYBE_ALL}
@@ -136,5 +136,5 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM)
       COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/test_preprocess.cmake
       WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
       )
-  endif(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE)
-endif("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM)
+  endif()
+endif()
diff --git a/Tests/Complex/Library/test_preprocess.cmake b/Tests/Complex/Library/test_preprocess.cmake
index 885c61330..4c8ec2174 100644
--- a/Tests/Complex/Library/test_preprocess.cmake
+++ b/Tests/Complex/Library/test_preprocess.cmake
@@ -2,6 +2,6 @@ set(TEST_FILE CMakeFiles/create_file.dir/create_file.i)
 file(READ ${TEST_FILE} CONTENTS)
 if("${CONTENTS}" MATCHES "Unable to close")
   message(STATUS "${TEST_FILE} created successfully!")
-else("${CONTENTS}" MATCHES "Unable to close")
+else()
   message(FATAL_ERROR "${TEST_FILE} creation failed!")
-endif("${CONTENTS}" MATCHES "Unable to close")
+endif()
diff --git a/Tests/Complex/VarTests.cmake b/Tests/Complex/VarTests.cmake
index 7e968fd62..52ec1fc8e 100644
--- a/Tests/Complex/VarTests.cmake
+++ b/Tests/Complex/VarTests.cmake
@@ -6,9 +6,9 @@ set (ZERO_VAR2 0)
 
 if(ZERO_VAR)
   add_definitions(-DSHOULD_NOT_BE_DEFINED)
-else(ZERO_VAR)
+else()
   add_definitions(-DSHOULD_BE_DEFINED)
-endif(ZERO_VAR)
+endif()
 
 set(ONE_VAR 1)
 set(ONE_VAR2 1)
@@ -25,83 +25,83 @@ variable_requires(ONE_VAR
 #
 if(NOT ZERO_VAR)
   add_definitions(-DSHOULD_BE_DEFINED_NOT)
-else(NOT ZERO_VAR)
+else()
   add_definitions(-DSHOULD_NOT_BE_DEFINED_NOT)
-endif(NOT ZERO_VAR)
+endif()
 
 if(NOT ONE_VAR)
   add_definitions(-DSHOULD_NOT_BE_DEFINED_NOT2)
-else(NOT ONE_VAR)
+else()
   add_definitions(-DSHOULD_BE_DEFINED_NOT2)
-endif(NOT ONE_VAR)
+endif()
 
 if(ONE_VAR AND ONE_VAR2)
   add_definitions(-DSHOULD_BE_DEFINED_AND)
-else(ONE_VAR AND ONE_VAR2)
+else()
   add_definitions(-DSHOULD_NOT_BE_DEFINED_AND)
-endif(ONE_VAR AND ONE_VAR2)
+endif()
 
 if(ONE_VAR AND ZERO_VAR)
   add_definitions(-DSHOULD_NOT_BE_DEFINED_AND2)
-else(ONE_VAR AND ZERO_VAR)
+else()
   add_definitions(-DSHOULD_BE_DEFINED_AND2)
-endif(ONE_VAR AND ZERO_VAR)
+endif()
 
 if(ZERO_VAR OR ONE_VAR2)
   add_definitions(-DSHOULD_BE_DEFINED_OR)
-else(ZERO_VAR OR ONE_VAR2)
+else()
   add_definitions(-DSHOULD_NOT_BE_DEFINED_OR)
-endif(ZERO_VAR OR ONE_VAR2)
+endif()
 
 if(ZERO_VAR OR ZERO_VAR2)
   add_definitions(-DSHOULD_NOT_BE_DEFINED_OR2)
-else(ZERO_VAR OR ZERO_VAR2)
+else()
   add_definitions(-DSHOULD_BE_DEFINED_OR2)
-endif(ZERO_VAR OR ZERO_VAR2)
+endif()
 
 if(STRING_VAR MATCHES "^CMake")
   add_definitions(-DSHOULD_BE_DEFINED_MATCHES)
-else(STRING_VAR MATCHES "^CMake")
+else()
   add_definitions(-DSHOULD_NOT_BE_DEFINED_MATCHES)
-endif(STRING_VAR MATCHES "^CMake")
+endif()
 
 if(STRING_VAR MATCHES "^foo")
   add_definitions(-DSHOULD_NOT_BE_DEFINED_MATCHES2)
-else(STRING_VAR MATCHES "^foo")
+else()
   add_definitions(-DSHOULD_BE_DEFINED_MATCHES2)
-endif(STRING_VAR MATCHES "^foo")
+endif()
 
 if(COMMAND "IF")
   add_definitions(-DSHOULD_BE_DEFINED_COMMAND)
-else(COMMAND "IF")
+else()
   add_definitions(-DSHOULD_NOT_BE_DEFINED_COMMAND)
-endif(COMMAND "IF")
+endif()
 
 if(COMMAND "ROQUEFORT")
   add_definitions(-DSHOULD_NOT_BE_DEFINED_COMMAND2)
-else(COMMAND "ROQUEFORT")
+else()
   add_definitions(-DSHOULD_BE_DEFINED_COMMAND2)
-endif(COMMAND "ROQUEFORT")
+endif()
 
 if (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
   add_definitions(-DSHOULD_BE_DEFINED_EXISTS)
-else(EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
+else()
   add_definitions(-DSHOULD_NOT_BE_DEFINED_EXISTS)
-endif (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
+endif ()
 
 if (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt)
   add_definitions(-DSHOULD_NOT_BE_DEFINED_EXISTS2)
-else(EXISTS ${Complex_SOURCE_DIR}/roquefort.txt)
+else()
   add_definitions(-DSHOULD_BE_DEFINED_EXISTS2)
-endif (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt)
+endif ()
 
 if (IS_DIRECTORY ${Complex_SOURCE_DIR})
   add_definitions(-DSHOULD_BE_DEFINED_IS_DIRECTORY)
-endif (IS_DIRECTORY ${Complex_SOURCE_DIR})
+endif ()
 
 if (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake)
   add_definitions(-DSHOULD_BE_DEFINED_IS_DIRECTORY2)
-endif (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake)
+endif ()
 
 set (SNUM1_VAR "1")
 set (SNUM2_VAR "2")
@@ -110,78 +110,78 @@ set (SNUM3_VAR "1")
 
 if (SNUM1_VAR LESS SNUM2_VAR)
   add_definitions(-DSHOULD_BE_DEFINED_LESS)
-else (SNUM1_VAR LESS SNUM2_VAR)
+else ()
   add_definitions(-DSHOULD_NOT_BE_DEFINED_LESS)
-endif (SNUM1_VAR LESS SNUM2_VAR)
+endif ()
 
 if (SNUM2_VAR LESS SNUM1_VAR)
   add_definitions(-DSHOULD_NOT_BE_DEFINED_LESS2)
-else (SNUM2_VAR LESS SNUM1_VAR)
+else ()
   add_definitions(-DSHOULD_BE_DEFINED_LESS2)
-endif (SNUM2_VAR LESS SNUM1_VAR)
+endif ()
 
 if (SNUM2_VAR GREATER SNUM1_VAR)
   add_definitions(-DSHOULD_BE_DEFINED_GREATER)
-else (SNUM2_VAR GREATER SNUM1_VAR)
+else ()
   add_definitions(-DSHOULD_NOT_BE_DEFINED_GREATER)
-endif (SNUM2_VAR GREATER SNUM1_VAR)
+endif ()
 
 if (SNUM2_VAR EQUAL SNUM1_VAR)
   add_definitions(-DSHOULD_NOT_BE_DEFINED_EQUAL)
-else (SNUM2_VAR EQUAL SNUM1_VAR)
+else ()
   add_definitions(-DSHOULD_BE_DEFINED_EQUAL)
-endif (SNUM2_VAR EQUAL SNUM1_VAR)
+endif ()
 
 if (SNUM3_VAR EQUAL SNUM1_VAR)
   add_definitions(-DSHOULD_BE_DEFINED_EQUAL)
-else (SNUM3_VAR EQUAL SNUM1_VAR)
+else ()
   add_definitions(-DSHOULD_NOT_BE_DEFINED_EQUAL)
-endif (SNUM3_VAR EQUAL SNUM1_VAR)
+endif ()
 
 if (SNUM1_VAR GREATER SNUM2_VAR)
   add_definitions(-DSHOULD_NOT_BE_DEFINED_GREATER2)
-else (SNUM1_VAR GREATER SNUM2_VAR)
+else ()
   add_definitions(-DSHOULD_BE_DEFINED_GREATER2)
-endif (SNUM1_VAR GREATER SNUM2_VAR)
+endif ()
 
 set (SSTR1_VAR "abc")
 set (SSTR2_VAR "bcd")
 
 if (SSTR1_VAR STRLESS SSTR2_VAR)
   add_definitions(-DSHOULD_BE_DEFINED_STRLESS)
-else (SSTR1_VAR STRLESS SSTR2_VAR)
+else ()
   add_definitions(-DSHOULD_NOT_BE_DEFINED_STRLESS)
-endif (SSTR1_VAR STRLESS SSTR2_VAR)
+endif ()
 
 if (SSTR2_VAR STRLESS SSTR1_VAR)
   add_definitions(-DSHOULD_NOT_BE_DEFINED_STRLESS2)
-else (SSTR2_VAR STRLESS SSTR1_VAR)
+else ()
   add_definitions(-DSHOULD_BE_DEFINED_STRLESS2)
-endif (SSTR2_VAR STRLESS SSTR1_VAR)
+endif ()
 
 if (SSTR2_VAR STRGREATER SSTR1_VAR)
   add_definitions(-DSHOULD_BE_DEFINED_STRGREATER)
-else (SSTR2_VAR STRGREATER SSTR1_VAR)
+else ()
   add_definitions(-DSHOULD_NOT_BE_DEFINED_STRGREATER)
-endif (SSTR2_VAR STRGREATER SSTR1_VAR)
+endif ()
 
 if (SSTR1_VAR STRGREATER SSTR2_VAR)
   add_definitions(-DSHOULD_NOT_BE_DEFINED_STRGREATER2)
-else (SSTR1_VAR STRGREATER SSTR2_VAR)
+else ()
   add_definitions(-DSHOULD_BE_DEFINED_STRGREATER2)
-endif (SSTR1_VAR STRGREATER SSTR2_VAR)
+endif ()
 
 #
 # Test FOREACH
 #
 foreach (INDEX 1 2)
   set(FOREACH_VAR${INDEX} "VALUE${INDEX}")
-endforeach(INDEX)
+endforeach()
 
 set(FOREACH_CONCAT "")
 foreach (INDEX a;b;c;d;e;f;g)
   set(FOREACH_CONCAT "${FOREACH_CONCAT}${INDEX}")
-endforeach(INDEX)
+endforeach()
 
 #
 # Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations
diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt
index 108093384..b0748fe3d 100644
--- a/Tests/ComplexOneConfig/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/CMakeLists.txt
@@ -11,8 +11,8 @@ if(POLICY CMP0003)
   cmake_policy(GET CMP0003 P3)
   if(NOT "${P3}" STREQUAL "NEW")
     message(FATAL_ERROR "cmake_policy(GET) did not report NEW!")
-  endif(NOT "${P3}" STREQUAL "NEW")
-endif(POLICY CMP0003)
+  endif()
+endif()
 
 # Test building without per-rule echo lines in Makefiles.
 set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
@@ -25,8 +25,8 @@ set(CPACK_SOURCE_IGNORE_FILES "~$;\\.cvsignore$;^C:/hoffman/My Builds/testcase.*
 macro(ASSERT value msg)
   if (NOT ${value})
     message ("Assertion failure:" ${msg} )
-  endif (NOT ${value})
-endmacro(ASSERT)
+  endif ()
+endmacro()
 
 # invoke the macro
 ASSERT(Complex_BINARY_DIR "The PROJECT command is broken")
@@ -38,8 +38,8 @@ macro(TEST_ARGC value1 value2)
   add_definitions(${value1} ${value2})
   if (${ARGC} MATCHES 4)
     add_definitions(${ARGV2} ${ARGV3})
-  endif (${ARGC} MATCHES 4)
-endmacro(TEST_ARGC)
+  endif ()
+endmacro()
 
 # invoke the macro
 TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4)
@@ -47,34 +47,34 @@ TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4)
 macro(TEST_VAR_ARG fa)
   if("${ARGV}" MATCHES "^1;2;3$")
     message(STATUS "ARGV works")
-  else("${ARGV}" MATCHES "^1;2;3$")
+  else()
     message(FATAL_ERROR "ARGV does not work; got \"${ARGV}\" instead of \"1;2;3\"")
-  endif("${ARGV}" MATCHES "^1;2;3$")
+  endif()
   if("${ARGN}" MATCHES "^2;3$")
     message(STATUS "ARGN works")
-  else("${ARGN}" MATCHES "^2;3$")
+  else()
     message(FATAL_ERROR "ARGV does not work; got \"${ARGN}\" instead of \"2;3\"")
-  endif("${ARGN}" MATCHES "^2;3$")
-endmacro(TEST_VAR_ARG)
+  endif()
+endmacro()
 
 TEST_VAR_ARG(1 2 3)
 
 # Floating-point comparison test.
 if(2.4 LESS 2.4)
   message(FATAL_ERROR "Failed: 2.4 LESS 2.4")
-endif(2.4 LESS 2.4)
+endif()
 if(2.4 GREATER 2.4)
   message(FATAL_ERROR "Failed: 2.4 GREATER 2.4")
-endif(2.4 GREATER 2.4)
+endif()
 if(NOT 2.4 EQUAL 2.4)
   message(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4")
-endif(NOT 2.4 EQUAL 2.4)
+endif()
 
 if(CMAKE_SYSTEM MATCHES "OSF1-V.*")
   if(NOT CMAKE_COMPILER_IS_GNUCXX)
      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ")
-  endif(NOT CMAKE_COMPILER_IS_GNUCXX)
-endif(CMAKE_SYSTEM MATCHES "OSF1-V.*")
+  endif()
+endif()
 
 
 add_definitions(-DCMAKE_IS_FUN)
@@ -93,7 +93,7 @@ separate_arguments(TEST_SEP)
 #
 if (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
   include(${Complex_SOURCE_DIR}/VarTests.cmake)
-endif (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
+endif ()
 include(fileshouldnotbehere OPTIONAL)
 load_cache(${Complex_SOURCE_DIR}/Cache
            EXCLUDE
@@ -104,9 +104,9 @@ load_cache(${Complex_SOURCE_DIR}/Cache
 load_cache(${Complex_SOURCE_DIR}/Cache READ_WITH_PREFIX foo CACHE_TEST_VAR2)
 if(${fooCACHE_TEST_VAR2} MATCHES bar)
   message("Load cache worked: ${fooCACHE_TEST_VAR2}")
-else(${fooCACHE_TEST_VAR2} MATCHES bar)
+else()
   message(FATAL_ERROR "Load cache with prefix failed: ${fooCACHE_TEST_VAR2}")
-endif(${fooCACHE_TEST_VAR2} MATCHES bar)
+endif()
 
 
 
@@ -151,9 +151,9 @@ message("\nIgnore this message")
 option(NO_EXEC_PROGRAM "Do not test EXEC_PROGRAM" 0)
 if (NOT NO_EXEC_PROGRAM)
   exec_program(${CMAKE_COMMAND} ARGS -E echo NO_EXEC_PROGRAM "${Complex_BINARY_DIR}")
-else (NOT NO_EXEC_PROGRAM)
+else ()
   message("Set this option ON")
-endif (NOT NO_EXEC_PROGRAM)
+endif ()
 
 mark_as_advanced(NO_EXEC_PROGRAM)
 mark_as_advanced(CLEAR NO_EXEC_PROGRAM)
@@ -164,9 +164,9 @@ execute_process(
   OUTPUT_VARIABLE TEST_OUT
   )
 if("${TEST_OUT}" MATCHES "^ABCDEFG\n$")
-else("${TEST_OUT}" MATCHES "^ABCDEFG\n$")
+else()
   message(SEND_ERROR "EXECUTE_PROCESS output test failed: [${TEST_OUT}]")
-endif("${TEST_OUT}" MATCHES "^ABCDEFG\n$")
+endif()
 
 # This test has some problems on UNIX systems.  Disabling for now.
 #
@@ -180,9 +180,9 @@ endif("${TEST_OUT}" MATCHES "^ABCDEFG\n$")
 # if("${RESULT}" MATCHES "^0$")
 #   message(SEND_ERROR
 #     "EXECUTE_PROCESS result test failed with RESULT=[${RESULT}]")
-# else("${RESULT}" MATCHES "^0$")
+# else()
 #   message(STATUS "EXECUTE_PROCESS result test passed with RESULT=[${RESULT}]")
-# endif("${RESULT}" MATCHES "^0$")
+# endif()
 
 #
 # Create directory.
@@ -204,7 +204,7 @@ foreach (ext ${CMAKE_SHLIB_SUFFIX};.so;.a;.sl)
     ${Complex_SOURCE_DIR}/Library/dummy
     ${Complex_BINARY_DIR}/Library/libdummylib${ext}
     COPYONLY IMMEDIATE)
-endforeach (ext)
+endforeach ()
 
 find_library(FIND_DUMMY_LIB
              dummylib
@@ -258,8 +258,8 @@ if (WIN32)
       "[${hkey}]" DOC "Registry_Test_Path")
     exec_program(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"")
     exec_program(${CMAKE_COMMAND} ARGS "-E remove \"${dir}/${file}\"")
-  endif (NOT UNIX)
-endif (WIN32)
+  endif ()
+endif ()
 
 #
 # Test a set and a remove
@@ -275,17 +275,17 @@ foreach(x "a")
   if(${x} MATCHES "a")
     # Should always execute.
     set(IF_INSIDE_FOREACH_THEN_EXECUTED 1)
-  else(${x} MATCHES "a")
+  else()
     # Should never execute.
     set(IF_INSIDE_FOREACH_ELSE_EXECUTED 1)
-  endif(${x} MATCHES "a")
-endforeach(x)
+  endif()
+endforeach()
 
 # test WHILE command
 set (while_var 1)
 while (while_var LESS 1000)
   set(while_var ${while_var}0)
-endwhile(while_var LESS 1000)
+endwhile()
 
 set(SHOULD_BE_ZERO )
 set(SHOULD_BE_ONE 1)
@@ -298,7 +298,7 @@ if (RESULT EQUAL 1)
     set (ELSEIF_RESULT 1)
   elseif (RESULT EQUAL 3)
     set (ELSEIF_RESULT 1)
-  endif (RESULT EQUAL 2)
+  endif ()
 elseif (RESULT EQUAL 2)
   set (ELSEIF_RESULT 1)
 elseif (RESULT EQUAL 3)
@@ -307,25 +307,25 @@ elseif (RESULT EQUAL 3)
   elseif (RESULT EQUAL 3)
     if (NOT ELSEIF_RESULT EQUAL 1)
       set (ELSEIF_RESULT 2)
-    endif (NOT ELSEIF_RESULT EQUAL 1)
-  endif (RESULT EQUAL 2)
+    endif ()
+  endif ()
 elseif (RESULT EQUAL 4)
   if (RESULT EQUAL 2)
     set (ELSEIF_RESULT 1)
   elseif (RESULT EQUAL 3)
     set (ELSEIF_RESULT 1)
-  endif (RESULT EQUAL 2)
-else (RESULT  EQUAL 1)
+  endif ()
+else ()
   if (RESULT EQUAL 2)
     set (ELSEIF_RESULT 1)
   elseif (RESULT EQUAL 3)
     set (ELSEIF_RESULT 1)
-  endif (RESULT EQUAL 2)
-endif (RESULT EQUAL 1)
+  endif ()
+endif ()
 
 if (NOT ELSEIF_RESULT EQUAL 2)
   set (ELSEIF_RESULT 0)
-endif (NOT ELSEIF_RESULT EQUAL 2)
+endif ()
 
 # test handling of parenthetical groups in conditionals
 if (2 GREATER 1 AND (4 LESS 3 OR 5 LESS 6) AND NOT (7 GREATER 8))
@@ -351,19 +351,19 @@ configure_file(
 string(REGEX MATCH "b" RESULT "abc")
 if(NOT RESULT)
   message(SEND_ERROR "string(REGEX MATCH ... ) test failed.")
-endif(NOT RESULT)
+endif()
 string(REGEX MATCHALL "b" RESULT "abcb")
 if(NOT RESULT)
   message(SEND_ERROR "string(REGEX MATCHALL ... ) test failed.")
-endif(NOT RESULT)
+endif()
 string(REGEX REPLACE ".([bd])." "[\\1]" RESULT "a(b)c(d)e")
 if("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$")
   set(STRING_REGEX_PASSED 1)
-endif("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$")
+endif()
 if(NOT STRING_REGEX_PASSED)
   message(SEND_ERROR
     "string(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")")
-endif(NOT STRING_REGEX_PASSED)
+endif()
 
 
 #
diff --git a/Tests/ComplexOneConfig/Executable/CMakeLists.txt b/Tests/ComplexOneConfig/Executable/CMakeLists.txt
index 413883551..432dbf890 100644
--- a/Tests/ComplexOneConfig/Executable/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/Executable/CMakeLists.txt
@@ -11,16 +11,16 @@ add_library(ExeImportedTarget UNKNOWN IMPORTED)
 # Test if(TARGET) command.
 if(NOT TARGET CMakeTestLibrary)
   message(FATAL_ERROR "if(NOT TARGET CMakeTestLibrary) returned true!")
-endif(NOT TARGET CMakeTestLibrary)
+endif()
 if(NOT TARGET ExeImportedTarget)
   message(FATAL_ERROR "if(NOT TARGET ExeImportedTarget) returned true!")
-endif(NOT TARGET ExeImportedTarget)
+endif()
 if(TARGET LibImportedTarget)
   message(FATAL_ERROR "if(TARGET LibImportedTarget) returned true!")
-endif(TARGET LibImportedTarget)
+endif()
 if(TARGET NotATarget)
   message(FATAL_ERROR "if(TARGET NotATarget) returned true!")
-endif(TARGET NotATarget)
+endif()
 
   # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to
 set(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared)
@@ -46,37 +46,37 @@ add_executable(complex.file complex.file.cxx complex_nobuild.cxx
 
 if (UNIX)
   target_link_libraries(complex ${CMAKE_DL_LIBS})
-else(UNIX)
+else()
   if (NOT BORLAND)
     if(NOT MINGW)
       target_link_libraries(complex rpcrt4.lib)
-    endif(NOT MINGW)
-  endif(NOT BORLAND)
-endif (UNIX)
+    endif()
+  endif()
+endif ()
 
 # Test linking to static lib when a shared lib has the same name.
 if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
   add_definitions(-DCOMPLEX_TEST_LINK_STATIC)
   target_link_libraries(complex CMakeTestLinkStatic)
-endif(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
+endif()
 
 # can we get the path to a source file
 get_source_file_property(A_LOCATION A.cxx LOCATION)
 if ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx")
   add_definitions(-DCMAKE_FOUND_ACXX)
-endif ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx")
+endif ()
 
 # get the directory parent
 get_directory_property(P_VALUE PARENT_DIRECTORY)
 if ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}")
   add_definitions(-DCMAKE_FOUND_PARENT)
-endif ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}")
+endif ()
 
 # get the stack of listfiles
 include(Included.cmake)
 if ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake")
   add_definitions(-DCMAKE_FOUND_LISTFILE_STACK)
-endif ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake")
+endif ()
 
 # Test add/remove definitions.
 add_definitions(
@@ -128,7 +128,7 @@ target_link_libraries(notInAllExe notInAllLib)
 if(MSVC)
   set_target_properties(notInAllExe PROPERTIES
     LINK_FLAGS "/NODEFAULTLIB:LIBC;LIBCMT;MSVCRT")
-endif(MSVC)
+endif()
 
 # Test creating a custom target that builds not-in-all targets.
 add_custom_target(notInAllCustom)
@@ -146,7 +146,7 @@ add_subdirectory(Temp)
 if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
   add_executable(testSystemDir testSystemDir.cxx)
   set_target_properties(testSystemDir PROPERTIES COMPILE_FLAGS "-Werror")
-endif(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
+endif()
 
 #
 # Extra coverage.Not used.
diff --git a/Tests/ComplexOneConfig/Library/CMakeLists.txt b/Tests/ComplexOneConfig/Library/CMakeLists.txt
index 41faeba4d..5c430523e 100644
--- a/Tests/ComplexOneConfig/Library/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/Library/CMakeLists.txt
@@ -33,10 +33,10 @@ if(WIN32)
         target_link_libraries(CMakeTestLibrary
           optimized
           kernel32.lib)
-      endif(NOT MINGW)
-    endif(NOT BORLAND)
-  endif(NOT CYGWIN)
-endif(WIN32)
+      endif()
+    endif()
+  endif()
+endif()
 
 #
 # Create shared library
@@ -53,12 +53,12 @@ define_property(
 set_target_properties(CMakeTestCLibraryShared PROPERTIES FOO BAR)
 if(NOT BEOS AND NOT WIN32)  # No libm on BeOS.
   set_target_properties(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm")
-endif(NOT BEOS AND NOT WIN32)
+endif()
 get_target_property(FOO_BAR_VAR CMakeTestCLibraryShared FOO)
 if(${FOO_BAR_VAR} MATCHES "BAR")
-else(${FOO_BAR_VAR} MATCHES "BAR")
+else()
   message(SEND_ERROR "SET_TARGET_PROPERTIES or GET_TARGET_PROPERTY failed, FOO_BAR_VAR should be BAR, but is ${FOO_BAR_VAR}")
-endif(${FOO_BAR_VAR} MATCHES "BAR")
+endif()
 
 # Create static and shared lib of same name.
 if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
@@ -66,7 +66,7 @@ if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
   add_library(CMakeTestLinkShared SHARED TestLink.c)
   set_target_properties(CMakeTestLinkStatic CMakeTestLinkShared
     PROPERTIES OUTPUT_NAME CMakeTestLink)
-endif(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
+endif()
 
 #
 # Attach pre-build/pre-link/post-build custom-commands to the lib.
@@ -127,7 +127,7 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM)
     if(ARCH_COUNT GREATER 1)
       # OSX does not support preprocessing more than one architecture.
       set(MAYBE_ALL)
-    endif(ARCH_COUNT GREATER 1)
+    endif()
 
     # Custom target to try preprocessing invocation.
     add_custom_target(test_preprocess ${MAYBE_ALL}
@@ -136,5 +136,5 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM)
       COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/test_preprocess.cmake
       WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
       )
-  endif(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE)
-endif("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM)
+  endif()
+endif()
diff --git a/Tests/ComplexOneConfig/Library/test_preprocess.cmake b/Tests/ComplexOneConfig/Library/test_preprocess.cmake
index 885c61330..4c8ec2174 100644
--- a/Tests/ComplexOneConfig/Library/test_preprocess.cmake
+++ b/Tests/ComplexOneConfig/Library/test_preprocess.cmake
@@ -2,6 +2,6 @@ set(TEST_FILE CMakeFiles/create_file.dir/create_file.i)
 file(READ ${TEST_FILE} CONTENTS)
 if("${CONTENTS}" MATCHES "Unable to close")
   message(STATUS "${TEST_FILE} created successfully!")
-else("${CONTENTS}" MATCHES "Unable to close")
+else()
   message(FATAL_ERROR "${TEST_FILE} creation failed!")
-endif("${CONTENTS}" MATCHES "Unable to close")
+endif()
diff --git a/Tests/ComplexOneConfig/VarTests.cmake b/Tests/ComplexOneConfig/VarTests.cmake
index 7e968fd62..52ec1fc8e 100644
--- a/Tests/ComplexOneConfig/VarTests.cmake
+++ b/Tests/ComplexOneConfig/VarTests.cmake
@@ -6,9 +6,9 @@ set (ZERO_VAR2 0)
 
 if(ZERO_VAR)
   add_definitions(-DSHOULD_NOT_BE_DEFINED)
-else(ZERO_VAR)
+else()
   add_definitions(-DSHOULD_BE_DEFINED)
-endif(ZERO_VAR)
+endif()
 
 set(ONE_VAR 1)
 set(ONE_VAR2 1)
@@ -25,83 +25,83 @@ variable_requires(ONE_VAR
 #
 if(NOT ZERO_VAR)
   add_definitions(-DSHOULD_BE_DEFINED_NOT)
-else(NOT ZERO_VAR)
+else()
   add_definitions(-DSHOULD_NOT_BE_DEFINED_NOT)
-endif(NOT ZERO_VAR)
+endif()
 
 if(NOT ONE_VAR)
   add_definitions(-DSHOULD_NOT_BE_DEFINED_NOT2)
-else(NOT ONE_VAR)
+else()
   add_definitions(-DSHOULD_BE_DEFINED_NOT2)
-endif(NOT ONE_VAR)
+endif()
 
 if(ONE_VAR AND ONE_VAR2)
   add_definitions(-DSHOULD_BE_DEFINED_AND)
-else(ONE_VAR AND ONE_VAR2)
+else()
   add_definitions(-DSHOULD_NOT_BE_DEFINED_AND)
-endif(ONE_VAR AND ONE_VAR2)
+endif()
 
 if(ONE_VAR AND ZERO_VAR)
   add_definitions(-DSHOULD_NOT_BE_DEFINED_AND2)
-else(ONE_VAR AND ZERO_VAR)
+else()
   add_definitions(-DSHOULD_BE_DEFINED_AND2)
-endif(ONE_VAR AND ZERO_VAR)
+endif()
 
 if(ZERO_VAR OR ONE_VAR2)
   add_definitions(-DSHOULD_BE_DEFINED_OR)
-else(ZERO_VAR OR ONE_VAR2)
+else()
   add_definitions(-DSHOULD_NOT_BE_DEFINED_OR)
-endif(ZERO_VAR OR ONE_VAR2)
+endif()
 
 if(ZERO_VAR OR ZERO_VAR2)
   add_definitions(-DSHOULD_NOT_BE_DEFINED_OR2)
-else(ZERO_VAR OR ZERO_VAR2)
+else()
   add_definitions(-DSHOULD_BE_DEFINED_OR2)
-endif(ZERO_VAR OR ZERO_VAR2)
+endif()
 
 if(STRING_VAR MATCHES "^CMake")
   add_definitions(-DSHOULD_BE_DEFINED_MATCHES)
-else(STRING_VAR MATCHES "^CMake")
+else()
   add_definitions(-DSHOULD_NOT_BE_DEFINED_MATCHES)
-endif(STRING_VAR MATCHES "^CMake")
+endif()
 
 if(STRING_VAR MATCHES "^foo")
   add_definitions(-DSHOULD_NOT_BE_DEFINED_MATCHES2)
-else(STRING_VAR MATCHES "^foo")
+else()
   add_definitions(-DSHOULD_BE_DEFINED_MATCHES2)
-endif(STRING_VAR MATCHES "^foo")
+endif()
 
 if(COMMAND "IF")
   add_definitions(-DSHOULD_BE_DEFINED_COMMAND)
-else(COMMAND "IF")
+else()
   add_definitions(-DSHOULD_NOT_BE_DEFINED_COMMAND)
-endif(COMMAND "IF")
+endif()
 
 if(COMMAND "ROQUEFORT")
   add_definitions(-DSHOULD_NOT_BE_DEFINED_COMMAND2)
-else(COMMAND "ROQUEFORT")
+else()
   add_definitions(-DSHOULD_BE_DEFINED_COMMAND2)
-endif(COMMAND "ROQUEFORT")
+endif()
 
 if (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
   add_definitions(-DSHOULD_BE_DEFINED_EXISTS)
-else(EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
+else()
   add_definitions(-DSHOULD_NOT_BE_DEFINED_EXISTS)
-endif (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
+endif ()
 
 if (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt)
   add_definitions(-DSHOULD_NOT_BE_DEFINED_EXISTS2)
-else(EXISTS ${Complex_SOURCE_DIR}/roquefort.txt)
+else()
   add_definitions(-DSHOULD_BE_DEFINED_EXISTS2)
-endif (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt)
+endif ()
 
 if (IS_DIRECTORY ${Complex_SOURCE_DIR})
   add_definitions(-DSHOULD_BE_DEFINED_IS_DIRECTORY)
-endif (IS_DIRECTORY ${Complex_SOURCE_DIR})
+endif ()
 
 if (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake)
   add_definitions(-DSHOULD_BE_DEFINED_IS_DIRECTORY2)
-endif (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake)
+endif ()
 
 set (SNUM1_VAR "1")
 set (SNUM2_VAR "2")
@@ -110,78 +110,78 @@ set (SNUM3_VAR "1")
 
 if (SNUM1_VAR LESS SNUM2_VAR)
   add_definitions(-DSHOULD_BE_DEFINED_LESS)
-else (SNUM1_VAR LESS SNUM2_VAR)
+else ()
   add_definitions(-DSHOULD_NOT_BE_DEFINED_LESS)
-endif (SNUM1_VAR LESS SNUM2_VAR)
+endif ()
 
 if (SNUM2_VAR LESS SNUM1_VAR)
   add_definitions(-DSHOULD_NOT_BE_DEFINED_LESS2)
-else (SNUM2_VAR LESS SNUM1_VAR)
+else ()
   add_definitions(-DSHOULD_BE_DEFINED_LESS2)
-endif (SNUM2_VAR LESS SNUM1_VAR)
+endif ()
 
 if (SNUM2_VAR GREATER SNUM1_VAR)
   add_definitions(-DSHOULD_BE_DEFINED_GREATER)
-else (SNUM2_VAR GREATER SNUM1_VAR)
+else ()
   add_definitions(-DSHOULD_NOT_BE_DEFINED_GREATER)
-endif (SNUM2_VAR GREATER SNUM1_VAR)
+endif ()
 
 if (SNUM2_VAR EQUAL SNUM1_VAR)
   add_definitions(-DSHOULD_NOT_BE_DEFINED_EQUAL)
-else (SNUM2_VAR EQUAL SNUM1_VAR)
+else ()
   add_definitions(-DSHOULD_BE_DEFINED_EQUAL)
-endif (SNUM2_VAR EQUAL SNUM1_VAR)
+endif ()
 
 if (SNUM3_VAR EQUAL SNUM1_VAR)
   add_definitions(-DSHOULD_BE_DEFINED_EQUAL)
-else (SNUM3_VAR EQUAL SNUM1_VAR)
+else ()
   add_definitions(-DSHOULD_NOT_BE_DEFINED_EQUAL)
-endif (SNUM3_VAR EQUAL SNUM1_VAR)
+endif ()
 
 if (SNUM1_VAR GREATER SNUM2_VAR)
   add_definitions(-DSHOULD_NOT_BE_DEFINED_GREATER2)
-else (SNUM1_VAR GREATER SNUM2_VAR)
+else ()
   add_definitions(-DSHOULD_BE_DEFINED_GREATER2)
-endif (SNUM1_VAR GREATER SNUM2_VAR)
+endif ()
 
 set (SSTR1_VAR "abc")
 set (SSTR2_VAR "bcd")
 
 if (SSTR1_VAR STRLESS SSTR2_VAR)
   add_definitions(-DSHOULD_BE_DEFINED_STRLESS)
-else (SSTR1_VAR STRLESS SSTR2_VAR)
+else ()
   add_definitions(-DSHOULD_NOT_BE_DEFINED_STRLESS)
-endif (SSTR1_VAR STRLESS SSTR2_VAR)
+endif ()
 
 if (SSTR2_VAR STRLESS SSTR1_VAR)
   add_definitions(-DSHOULD_NOT_BE_DEFINED_STRLESS2)
-else (SSTR2_VAR STRLESS SSTR1_VAR)
+else ()
   add_definitions(-DSHOULD_BE_DEFINED_STRLESS2)
-endif (SSTR2_VAR STRLESS SSTR1_VAR)
+endif ()
 
 if (SSTR2_VAR STRGREATER SSTR1_VAR)
   add_definitions(-DSHOULD_BE_DEFINED_STRGREATER)
-else (SSTR2_VAR STRGREATER SSTR1_VAR)
+else ()
   add_definitions(-DSHOULD_NOT_BE_DEFINED_STRGREATER)
-endif (SSTR2_VAR STRGREATER SSTR1_VAR)
+endif ()
 
 if (SSTR1_VAR STRGREATER SSTR2_VAR)
   add_definitions(-DSHOULD_NOT_BE_DEFINED_STRGREATER2)
-else (SSTR1_VAR STRGREATER SSTR2_VAR)
+else ()
   add_definitions(-DSHOULD_BE_DEFINED_STRGREATER2)
-endif (SSTR1_VAR STRGREATER SSTR2_VAR)
+endif ()
 
 #
 # Test FOREACH
 #
 foreach (INDEX 1 2)
   set(FOREACH_VAR${INDEX} "VALUE${INDEX}")
-endforeach(INDEX)
+endforeach()
 
 set(FOREACH_CONCAT "")
 foreach (INDEX a;b;c;d;e;f;g)
   set(FOREACH_CONCAT "${FOREACH_CONCAT}${INDEX}")
-endforeach(INDEX)
+endforeach()
 
 #
 # Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations
diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt
index 58408d7fe..d3ced3ff9 100644
--- a/Tests/CustomCommand/CMakeLists.txt
+++ b/Tests/CustomCommand/CMakeLists.txt
@@ -337,7 +337,7 @@ if(NOT MINGW)
   # *  # MinGW programs on windows always expands the wildcard!
   # /  # MSys make converts a leading slash to the mingw home directory
   list(APPEND CHECK_ARGS * /)
-endif(NOT MINGW)
+endif()
 
 # The windows command shell does not support a double quote by itself:
 #   double\"quote
@@ -359,7 +359,7 @@ foreach(arg ${CHECK_ARGS} "")
   set(EXPECTED_ARGUMENTS
     "${EXPECTED_ARGUMENTS}  \"${ARG}\",
 ")
-endforeach(arg)
+endforeach()
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/check_command_line.c.in
                ${CMAKE_CURRENT_BINARY_DIR}/check_command_line.c
                @ONLY IMMEDIATE)
diff --git a/Tests/CustomCommand/check_mark.cmake b/Tests/CustomCommand/check_mark.cmake
index f8638d4ac..1f47fd0bd 100644
--- a/Tests/CustomCommand/check_mark.cmake
+++ b/Tests/CustomCommand/check_mark.cmake
@@ -1,5 +1,5 @@
 if(EXISTS "${MARK_FILE}")
   message(FATAL_ERROR "Custom command run more than once!")
-else(EXISTS "${MARK_FILE}")
+else()
   file(WRITE "${MARK_FILE}" "check for running custom command twice\n")
-endif(EXISTS "${MARK_FILE}")
+endif()
diff --git a/Tests/EnforceConfig.cmake.in b/Tests/EnforceConfig.cmake.in
index 27ee1fdd9..8c0817cd6 100644
--- a/Tests/EnforceConfig.cmake.in
+++ b/Tests/EnforceConfig.cmake.in
@@ -1,9 +1,9 @@
 # Choose a configuration with which to drive CTest tests.
 if(CTEST_CONFIGURATION_TYPE)
   set(CTestTest_CONFIG "${CTEST_CONFIGURATION_TYPE}")
-else(CTEST_CONFIGURATION_TYPE)
+else()
   set(CTestTest_CONFIG "@CTestTest_CONFIG@")
-endif(CTEST_CONFIGURATION_TYPE)
+endif()
 
 # Choose a configuration that was built if none is given.
 if(NOT CTEST_CONFIGURATION_TYPE)
@@ -14,13 +14,13 @@ if(NOT CTEST_CONFIGURATION_TYPE)
     if(NOT CTEST_CONFIGURATION_TYPE)
       if(EXISTS "${CTEST_DIR}/${cfg}/${CTEST_EXE}")
         set(CTEST_CONFIGURATION_TYPE ${cfg})
-      endif(EXISTS "${CTEST_DIR}/${cfg}/${CTEST_EXE}")
-    endif(NOT CTEST_CONFIGURATION_TYPE)
-  endforeach(cfg)
+      endif()
+    endif()
+  endforeach()
   if(NOT CTEST_CONFIGURATION_TYPE)
     set(CTEST_CONFIGURATION_TYPE NoConfig)
-  endif(NOT CTEST_CONFIGURATION_TYPE)
+  endif()
   message("Guessing configuration ${CTEST_CONFIGURATION_TYPE}")
-endif(NOT CTEST_CONFIGURATION_TYPE)
+endif()
 
 @TEST_HOME_ENV_CODE@
diff --git a/Tests/ExportImport/CMakeLists.txt b/Tests/ExportImport/CMakeLists.txt
index ccfb8940c..d6593e824 100644
--- a/Tests/ExportImport/CMakeLists.txt
+++ b/Tests/ExportImport/CMakeLists.txt
@@ -14,13 +14,13 @@ set_property(
 
 if(CMAKE_CONFIGURATION_TYPES)
   set(NESTED_CONFIG_TYPE -C "${CMAKE_CFG_INTDIR}")
-else(CMAKE_CONFIGURATION_TYPES)
+else()
   if(CMAKE_BUILD_TYPE)
     set(NESTED_CONFIG_TYPE -C "${CMAKE_BUILD_TYPE}")
-  else(CMAKE_BUILD_TYPE)
+  else()
     set(NESTED_CONFIG_TYPE)
-  endif(CMAKE_BUILD_TYPE)
-endif(CMAKE_CONFIGURATION_TYPES)
+  endif()
+endif()
 
 if(MINGW OR MSYS)
   # Test CMAKE_GNUtoMS whether we have VS or not.
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index f06a4659f..f118c30de 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -56,7 +56,7 @@ add_library(testLib6 STATIC testLib6.cxx testLib6c.c)
 set(VS6)
 if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
   set(VS6 1)
-endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
+endif()
 
 # Test using the target_link_libraries command to set the
 # LINK_INTERFACE_LIBRARIES* properties.  We construct two libraries
@@ -129,7 +129,7 @@ install(EXPORT exp NAMESPACE exp_ DESTINATION lib/exp)
 # Install testLib5.dll outside the export.
 if(WIN32)
   install(TARGETS testLib5 RUNTIME DESTINATION bin)
-endif(WIN32)
+endif()
 
 # Export from build tree.
 export(TARGETS testExe1 testLib1 testLib2 testLib3
diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt
index a21e1b0f8..650af6adf 100644
--- a/Tests/ExportImport/Import/A/CMakeLists.txt
+++ b/Tests/ExportImport/Import/A/CMakeLists.txt
@@ -73,7 +73,7 @@ target_link_libraries(imp_mod1b bld_testExe2)
 foreach(c DEBUG RELWITHDEBINFO)
   set_property(TARGET imp_testExe1 PROPERTY COMPILE_DEFINITIONS_${c} EXE_DBG)
   set_property(TARGET imp_testExe1b PROPERTY COMPILE_DEFINITIONS_${c} EXE_DBG)
-endforeach(c)
+endforeach()
 
 #-----------------------------------------------------------------------------
 # Create a custom target to generate a header for the libraries below.
diff --git a/Tests/ExternalOBJ/CMakeLists.txt b/Tests/ExternalOBJ/CMakeLists.txt
index 542bfab94..458c88bfd 100644
--- a/Tests/ExternalOBJ/CMakeLists.txt
+++ b/Tests/ExternalOBJ/CMakeLists.txt
@@ -7,9 +7,9 @@ if(APPLE)
   # check for Power PC and change to ppc
   if("${_CMAKE_OSX_MACHINE}" MATCHES "Power")
     set(_CMAKE_OSX_MACHINE ppc)
-  endif("${_CMAKE_OSX_MACHINE}" MATCHES "Power")
+  endif()
   set(CMAKE_OSX_ARCHITECTURES ${_CMAKE_OSX_MACHINE})
-endif(APPLE)
+endif()
 
 # Build the external object file.
 try_compile(EXTERNAL_OBJECT_BUILT
@@ -24,12 +24,12 @@ if(EXTERNAL_OBJECT_BUILT)
     "Building external_object.cxx succeeded with the following output:\n"
     "[${OUTPUT}]"
     )
-else(EXTERNAL_OBJECT_BUILT)
+else()
   message(FATAL_ERROR
     "Building external_object.cxx failed with the following output:\n"
     "[${OUTPUT}]"
     )
-endif(EXTERNAL_OBJECT_BUILT)
+endif()
 
 # Find the external object file.
 set(DIR ${ExternalOBJ_BINARY_DIR}/Object)
@@ -38,9 +38,9 @@ file(GLOB_RECURSE EXTERNAL_OBJECT
 if(EXTERNAL_OBJECT)
   list (GET EXTERNAL_OBJECT 0 EXTERNAL_OBJECT)
   message("Found \"${EXTERNAL_OBJECT}\".")
-else(EXTERNAL_OBJECT)
+else()
   message(FATAL_ERROR "Could not find external object.")
-endif(EXTERNAL_OBJECT)
+endif()
 
 # Test creation of external objects by custom commands.
 set(CUSTOM_OBJECT
diff --git a/Tests/ExternalOBJ/Object/CMakeLists.txt b/Tests/ExternalOBJ/Object/CMakeLists.txt
index b24e91b9a..dbfe09ee6 100644
--- a/Tests/ExternalOBJ/Object/CMakeLists.txt
+++ b/Tests/ExternalOBJ/Object/CMakeLists.txt
@@ -6,8 +6,8 @@ if(APPLE)
   # check for Power PC and change to ppc
   if("${_CMAKE_OSX_MACHINE}" MATCHES "Power")
     set(_CMAKE_OSX_MACHINE ppc)
-  endif("${_CMAKE_OSX_MACHINE}" MATCHES "Power")
+  endif()
   set(CMAKE_OSX_ARCHITECTURES ${_CMAKE_OSX_MACHINE})
-endif(APPLE)
+endif()
 
 add_executable(external external_object.cxx external_main.cxx)
diff --git a/Tests/ExternalProject/TryCheckout.cmake b/Tests/ExternalProject/TryCheckout.cmake
index de069ebe4..6a396c339 100644
--- a/Tests/ExternalProject/TryCheckout.cmake
+++ b/Tests/ExternalProject/TryCheckout.cmake
@@ -25,7 +25,7 @@ function(try_cvs_checkout repository module dir result_var)
 
     message(STATUS "try_cvs_checkout -- done")
   endif()
-endfunction(try_cvs_checkout)
+endfunction()
 
 
 function(try_svn_checkout repository dir result_var)
@@ -51,4 +51,4 @@ function(try_svn_checkout repository dir result_var)
 
     message(STATUS "try_svn_checkout -- done")
   endif()
-endfunction(try_svn_checkout)
+endfunction()
diff --git a/Tests/FindModulesExecuteAll/CMakeLists.txt b/Tests/FindModulesExecuteAll/CMakeLists.txt
index df5162652..21b9d3897 100644
--- a/Tests/FindModulesExecuteAll/CMakeLists.txt
+++ b/Tests/FindModulesExecuteAll/CMakeLists.txt
@@ -23,8 +23,8 @@ foreach(module ${all_modules})
 # disabled for now, since too many modules break:
 #  if(NOT DEFINED ${packageNameUpper}_FOUND)
 #    message(SEND_ERROR "${packageNameUpper}_FOUND not defined !")
-#  endif(NOT DEFINED ${packageNameUpper}_FOUND)
+#  endif()
 
-endforeach(module ${all_modules})
+endforeach()
 
 add_executable(FindModulesExecuteAll main.c)
diff --git a/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake b/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake
index 61db4166d..979bbdf18 100644
--- a/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake	
+++ b/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake	
@@ -3,6 +3,6 @@ if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1)
   set(PACKAGE_VERSION_COMPATIBLE 1)
   if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1)
     set(PACKAGE_VERSION_EXACT 1)
-  endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1)
-endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1)
+  endif()
+endif()
 
diff --git a/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake b/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake
index e0042d5e6..17caaa728 100644
--- a/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake	
+++ b/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake	
@@ -3,6 +3,6 @@ if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1)
   set(PACKAGE_VERSION_COMPATIBLE 1)
   if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2)
     set(PACKAGE_VERSION_EXACT 1)
-  endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2)
-endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1)
+  endif()
+endif()
 
diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt
index d3446497d..bca149bea 100644
--- a/Tests/FindPackageTest/CMakeLists.txt
+++ b/Tests/FindPackageTest/CMakeLists.txt
@@ -30,7 +30,7 @@ find_path(FOO_DIR foo.h)
 if(NOT FOO_DIR)
   message(FATAL_ERROR "Did not find foo.h which is in ${CMAKE_CURRENT_SOURCE_DIR}/include
   CMAKE_PREFIX_PATH = ${CMAKE_PREFIX_PATH}")
-endif(NOT FOO_DIR)
+endif()
 
 find_package(VersionTestA 1)
 find_package(VersionTestB 1.2)
@@ -93,7 +93,7 @@ set(PACKAGES
   )
 foreach(p ${PACKAGES})
   set(${p}_DIR "" CACHE FILEPATH "Wipe out find results for testing." FORCE)
-endforeach(p)
+endforeach()
 
 # Enable framework and bundle searching.  Make sure bundles are found
 # before unix-syle packages.
@@ -238,58 +238,58 @@ foreach(p ${PACKAGES})
     # Debugging output.
     if(CMAKE_FIND_DEBUG_MODE)
       message("Package ${p} found [${REL_${p}_CONFIG}]")
-    endif(CMAKE_FIND_DEBUG_MODE)
+    endif()
 
     # Check and report failure.
     if(NOT "${REL_${p}_CONFIG}" STREQUAL "${${p}_EXPECTED}")
       message(SEND_ERROR
         "Package ${p} should have been [${${p}_EXPECTED}] but "
         "was [${REL_${p}_CONFIG}]")
-    endif(NOT "${REL_${p}_CONFIG}" STREQUAL "${${p}_EXPECTED}")
+    endif()
   else()
     message(SEND_ERROR "Package ${p} not found!")
   endif()
-endforeach(p)
+endforeach()
 
 # Check that version information was extracted.
 if(NOT "${VersionedA_VERSION}" STREQUAL "2.0")
   message(SEND_ERROR
     "Package VersionedA is version [${VersionedA_VERSION}], not [2.0]")
-endif(NOT "${VersionedA_VERSION}" STREQUAL "2.0")
+endif()
 if(NOT "${VersionedA_VERSION_MAJOR}" STREQUAL "2")
   message(SEND_ERROR
     "Package VersionedA is major version [${VersionedA_VERSION_MAJOR}], not [2]")
-endif(NOT "${VersionedA_VERSION_MAJOR}" STREQUAL "2")
+endif()
 if(NOT "${VersionedA_VERSION_MINOR}" STREQUAL "0")
   message(SEND_ERROR
     "Package VersionedA is minor version [${VersionedA_VERSION_MINOR}], not [0]")
-endif(NOT "${VersionedA_VERSION_MINOR}" STREQUAL "0")
+endif()
 
 if(NOT "${VersionedB_VERSION}" STREQUAL "3.1")
   message(SEND_ERROR
     "Package VersionedB is version [${VersionedB_VERSION}], not [3.1]")
-endif(NOT "${VersionedB_VERSION}" STREQUAL "3.1")
+endif()
 if(NOT "${VersionedB_VERSION_MAJOR}" STREQUAL "3")
   message(SEND_ERROR
     "Package VersionedB is major version [${VersionedB_VERSION_MAJOR}], not [3]")
-endif(NOT "${VersionedB_VERSION_MAJOR}" STREQUAL "3")
+endif()
 if(NOT "${VersionedB_VERSION_MINOR}" STREQUAL "1")
   message(SEND_ERROR
     "Package VersionedB is minor version [${VersionedB_VERSION_MINOR}], not [1]")
-endif(NOT "${VersionedB_VERSION_MINOR}" STREQUAL "1")
+endif()
 
 if(NOT "${Special_VERSION}" STREQUAL "1.2")
   message(SEND_ERROR
     "Package Special is version [${Special_VERSION}], not [1.2]")
-endif(NOT "${Special_VERSION}" STREQUAL "1.2")
+endif()
 if(NOT "${Special_VERSION_MAJOR}" STREQUAL "1")
   message(SEND_ERROR
     "Package Special is major version [${Special_VERSION_MAJOR}], not [1]")
-endif(NOT "${Special_VERSION_MAJOR}" STREQUAL "1")
+endif()
 if(NOT "${Special_VERSION_MINOR}" STREQUAL "2")
   message(SEND_ERROR
     "Package Special is minor version [${Special_VERSION_MINOR}], not [2]")
-endif(NOT "${Special_VERSION_MINOR}" STREQUAL "2")
+endif()
 
 # Test version number comparison.
 if(NOT "1.2.3.4" VERSION_LESS "1.2.3.5")
diff --git a/Tests/FindPackageTest/FindVersionTestA.cmake b/Tests/FindPackageTest/FindVersionTestA.cmake
index c6031d9dc..982859382 100644
--- a/Tests/FindPackageTest/FindVersionTestA.cmake
+++ b/Tests/FindPackageTest/FindVersionTestA.cmake
@@ -1,18 +1,18 @@
 if(NOT "${VersionTestA_FIND_VERSION}" STREQUAL "1")
   message(SEND_ERROR "VersionTestA_FIND_VERSION=${VersionTestA_FIND_VERSION} is not 1")
-endif(NOT "${VersionTestA_FIND_VERSION}" STREQUAL "1")
+endif()
 if(NOT "${VersionTestA_FIND_VERSION_MAJOR}" STREQUAL "1")
   message(SEND_ERROR "VersionTestA_FIND_VERSION_MAJOR=${VersionTestA_FIND_VERSION_MAJOR} is not 1")
-endif(NOT "${VersionTestA_FIND_VERSION_MAJOR}" STREQUAL "1")
+endif()
 if(NOT "${VersionTestA_FIND_VERSION_MINOR}" STREQUAL "0")
   message(SEND_ERROR "VersionTestA_FIND_VERSION_MINOR=${VersionTestA_FIND_VERSION_MINOR} is not 0")
-endif(NOT "${VersionTestA_FIND_VERSION_MINOR}" STREQUAL "0")
+endif()
 if(NOT "${VersionTestA_FIND_VERSION_PATCH}" STREQUAL "0")
   message(SEND_ERROR "VersionTestA_FIND_VERSION_PATCH=${VersionTestA_FIND_VERSION_PATCH} is not 0")
-endif(NOT "${VersionTestA_FIND_VERSION_PATCH}" STREQUAL "0")
+endif()
 if(NOT "${VersionTestA_FIND_VERSION_TWEAK}" STREQUAL "0")
   message(SEND_ERROR "VersionTestA_FIND_VERSION_TWEAK=${VersionTestA_FIND_VERSION_TWEAK} is not 0")
-endif(NOT "${VersionTestA_FIND_VERSION_TWEAK}" STREQUAL "0")
+endif()
 if(NOT "${VersionTestA_FIND_VERSION_COUNT}" STREQUAL "1")
   message(SEND_ERROR "VersionTestA_FIND_VERSION_COUNT=${VersionTestA_FIND_VERSION_COUNT} is not 1")
-endif(NOT "${VersionTestA_FIND_VERSION_COUNT}" STREQUAL "1")
+endif()
diff --git a/Tests/FindPackageTest/FindVersionTestB.cmake b/Tests/FindPackageTest/FindVersionTestB.cmake
index 914d5a732..1ebb82302 100644
--- a/Tests/FindPackageTest/FindVersionTestB.cmake
+++ b/Tests/FindPackageTest/FindVersionTestB.cmake
@@ -1,18 +1,18 @@
 if(NOT "${VersionTestB_FIND_VERSION}" STREQUAL "1.2")
   message(SEND_ERROR "VersionTestB_FIND_VERSION=${VersionTestB_FIND_VERSION} is not 1.2")
-endif(NOT "${VersionTestB_FIND_VERSION}" STREQUAL "1.2")
+endif()
 if(NOT "${VersionTestB_FIND_VERSION_MAJOR}" STREQUAL "1")
   message(SEND_ERROR "VersionTestB_FIND_VERSION_MAJOR=${VersionTestB_FIND_VERSION_MAJOR} is not 1")
-endif(NOT "${VersionTestB_FIND_VERSION_MAJOR}" STREQUAL "1")
+endif()
 if(NOT "${VersionTestB_FIND_VERSION_MINOR}" STREQUAL "2")
   message(SEND_ERROR "VersionTestB_FIND_VERSION_MINOR=${VersionTestB_FIND_VERSION_MINOR} is not 2")
-endif(NOT "${VersionTestB_FIND_VERSION_MINOR}" STREQUAL "2")
+endif()
 if(NOT "${VersionTestB_FIND_VERSION_PATCH}" STREQUAL "0")
   message(SEND_ERROR "VersionTestB_FIND_VERSION_PATCH=${VersionTestB_FIND_VERSION_PATCH} is not 0")
-endif(NOT "${VersionTestB_FIND_VERSION_PATCH}" STREQUAL "0")
+endif()
 if(NOT "${VersionTestB_FIND_VERSION_TWEAK}" STREQUAL "0")
   message(SEND_ERROR "VersionTestB_FIND_VERSION_TWEAK=${VersionTestB_FIND_VERSION_TWEAK} is not 0")
-endif(NOT "${VersionTestB_FIND_VERSION_TWEAK}" STREQUAL "0")
+endif()
 if(NOT "${VersionTestB_FIND_VERSION_COUNT}" STREQUAL "2")
   message(SEND_ERROR "VersionTestB_FIND_VERSION_COUNT=${VersionTestB_FIND_VERSION_COUNT} is not 2")
-endif(NOT "${VersionTestB_FIND_VERSION_COUNT}" STREQUAL "2")
+endif()
diff --git a/Tests/FindPackageTest/FindVersionTestC.cmake b/Tests/FindPackageTest/FindVersionTestC.cmake
index 66e07ea95..450c2e914 100644
--- a/Tests/FindPackageTest/FindVersionTestC.cmake
+++ b/Tests/FindPackageTest/FindVersionTestC.cmake
@@ -1,18 +1,18 @@
 if(NOT "${VersionTestC_FIND_VERSION}" STREQUAL "1.2.3")
   message(SEND_ERROR "VersionTestC_FIND_VERSION=${VersionTestC_FIND_VERSION} is not 1.2.3")
-endif(NOT "${VersionTestC_FIND_VERSION}" STREQUAL "1.2.3")
+endif()
 if(NOT "${VersionTestC_FIND_VERSION_MAJOR}" STREQUAL "1")
   message(SEND_ERROR "VersionTestC_FIND_VERSION_MAJOR=${VersionTestC_FIND_VERSION_MAJOR} is not 1")
-endif(NOT "${VersionTestC_FIND_VERSION_MAJOR}" STREQUAL "1")
+endif()
 if(NOT "${VersionTestC_FIND_VERSION_MINOR}" STREQUAL "2")
   message(SEND_ERROR "VersionTestC_FIND_VERSION_MINOR=${VersionTestC_FIND_VERSION_MINOR} is not 2")
-endif(NOT "${VersionTestC_FIND_VERSION_MINOR}" STREQUAL "2")
+endif()
 if(NOT "${VersionTestC_FIND_VERSION_PATCH}" STREQUAL "3")
   message(SEND_ERROR "VersionTestC_FIND_VERSION_PATCH=${VersionTestC_FIND_VERSION_PATCH} is not 3")
-endif(NOT "${VersionTestC_FIND_VERSION_PATCH}" STREQUAL "3")
+endif()
 if(NOT "${VersionTestC_FIND_VERSION_TWEAK}" STREQUAL "0")
   message(SEND_ERROR "VersionTestC_FIND_VERSION_TWEAK=${VersionTestC_FIND_VERSION_TWEAK} is not 0")
-endif(NOT "${VersionTestC_FIND_VERSION_TWEAK}" STREQUAL "0")
+endif()
 if(NOT "${VersionTestC_FIND_VERSION_COUNT}" STREQUAL "3")
   message(SEND_ERROR "VersionTestC_FIND_VERSION_COUNT=${VersionTestC_FIND_VERSION_COUNT} is not 3")
-endif(NOT "${VersionTestC_FIND_VERSION_COUNT}" STREQUAL "3")
+endif()
diff --git a/Tests/FindPackageTest/FindVersionTestD.cmake b/Tests/FindPackageTest/FindVersionTestD.cmake
index 88d92999c..9f2db72e4 100644
--- a/Tests/FindPackageTest/FindVersionTestD.cmake
+++ b/Tests/FindPackageTest/FindVersionTestD.cmake
@@ -1,18 +1,18 @@
 if(NOT "${VersionTestD_FIND_VERSION}" STREQUAL "1.2.3.4")
   message(SEND_ERROR "VersionTestD_FIND_VERSION=${VersionTestD_FIND_VERSION} is not 1.2.3.4")
-endif(NOT "${VersionTestD_FIND_VERSION}" STREQUAL "1.2.3.4")
+endif()
 if(NOT "${VersionTestD_FIND_VERSION_MAJOR}" STREQUAL "1")
   message(SEND_ERROR "VersionTestD_FIND_VERSION_MAJOR=${VersionTestD_FIND_VERSION_MAJOR} is not 1")
-endif(NOT "${VersionTestD_FIND_VERSION_MAJOR}" STREQUAL "1")
+endif()
 if(NOT "${VersionTestD_FIND_VERSION_MINOR}" STREQUAL "2")
   message(SEND_ERROR "VersionTestD_FIND_VERSION_MINOR=${VersionTestD_FIND_VERSION_MINOR} is not 2")
-endif(NOT "${VersionTestD_FIND_VERSION_MINOR}" STREQUAL "2")
+endif()
 if(NOT "${VersionTestD_FIND_VERSION_PATCH}" STREQUAL "3")
   message(SEND_ERROR "VersionTestD_FIND_VERSION_PATCH=${VersionTestD_FIND_VERSION_PATCH} is not 3")
-endif(NOT "${VersionTestD_FIND_VERSION_PATCH}" STREQUAL "3")
+endif()
 if(NOT "${VersionTestD_FIND_VERSION_TWEAK}" STREQUAL "4")
   message(SEND_ERROR "VersionTestD_FIND_VERSION_TWEAK=${VersionTestD_FIND_VERSION_TWEAK} is not 4")
-endif(NOT "${VersionTestD_FIND_VERSION_TWEAK}" STREQUAL "4")
+endif()
 if(NOT "${VersionTestD_FIND_VERSION_COUNT}" STREQUAL "4")
   message(SEND_ERROR "VersionTestD_FIND_VERSION_COUNT=${VersionTestD_FIND_VERSION_COUNT} is not 4")
-endif(NOT "${VersionTestD_FIND_VERSION_COUNT}" STREQUAL "4")
+endif()
diff --git a/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake
index 514e830f3..822b44966 100644
--- a/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake
+++ b/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake
@@ -3,5 +3,5 @@ if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4)
   set(PACKAGE_VERSION_COMPATIBLE 1)
   if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0)
     set(PACKAGE_VERSION_EXACT 1)
-  endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0)
-endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4)
+  endif()
+endif()
diff --git a/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake b/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake
index 59fe59d3f..31573b90a 100644
--- a/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake
+++ b/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake
@@ -3,5 +3,5 @@ if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3)
   set(PACKAGE_VERSION_COMPATIBLE 1)
   if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1)
     set(PACKAGE_VERSION_EXACT 1)
-  endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1)
-endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3)
+  endif()
+endif()
diff --git a/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake
index 7afcc9b8c..bcefcd746 100644
--- a/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake
+++ b/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake
@@ -3,6 +3,6 @@ if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4)
   set(PACKAGE_VERSION_COMPATIBLE 1)
   if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0)
     set(PACKAGE_VERSION_EXACT 1)
-  endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0)
-endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4)
+  endif()
+endif()
 
diff --git a/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake b/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake
index 4e8ee8284..b37bc8e22 100644
--- a/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake
+++ b/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake
@@ -3,5 +3,5 @@ if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1)
   set(PACKAGE_VERSION_COMPATIBLE 1)
   if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2)
     set(PACKAGE_VERSION_EXACT 1)
-  endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2)
-endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1)
+  endif()
+endif()
diff --git a/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake
index 78e41a5fa..db3a8a40c 100644
--- a/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake
+++ b/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake
@@ -1,5 +1,5 @@
 set(PACKAGE_VERSION 2.0)
 if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 2)
   set(PACKAGE_VERSION_COMPATIBLE 1)
-endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 2)
+endif()
 
diff --git a/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake
index 8e3daff25..dd9c939c5 100644
--- a/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake
+++ b/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake
@@ -1,5 +1,5 @@
 set(PACKAGE_VERSION 3.0)
 if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3)
   set(PACKAGE_VERSION_COMPATIBLE 1)
-endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3)
+endif()
 
diff --git a/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake
index b09c00883..8fa767ea1 100644
--- a/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake
+++ b/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake
@@ -3,6 +3,6 @@ if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3)
   set(PACKAGE_VERSION_COMPATIBLE 1)
   if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1)
     set(PACKAGE_VERSION_EXACT 1)
-  endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1)
-endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3)
+  endif()
+endif()
 
diff --git a/Tests/FindPackageTest/lib/zot/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot/zot-config-version.cmake
index 5674f70d7..430f009e1 100644
--- a/Tests/FindPackageTest/lib/zot/zot-config-version.cmake
+++ b/Tests/FindPackageTest/lib/zot/zot-config-version.cmake
@@ -5,6 +5,6 @@ if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3)
   set(PACKAGE_VERSION_COMPATIBLE 1)
   if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1)
     set(PACKAGE_VERSION_EXACT 1)
-  endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1)
-endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3)
+  endif()
+endif()
 
diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt
index 679ec8324..6e78f4228 100644
--- a/Tests/Fortran/CMakeLists.txt
+++ b/Tests/Fortran/CMakeLists.txt
@@ -167,7 +167,7 @@ if(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
   add_executable(test_preprocess test_preprocess.F90)
 
   set(TEST_MODULE_DEPENDS 1)
-endif(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
+endif()
 
 if(TEST_MODULE_DEPENDS)
   # Build the external project separately using a custom target.
@@ -175,10 +175,10 @@ if(TEST_MODULE_DEPENDS)
   if(CMAKE_CONFIGURATION_TYPES)
     set(External_CONFIG_TYPE -C "${CMAKE_CFG_INTDIR}")
     set(External_BUILD_TYPE)
-  else(CMAKE_CONFIGURATION_TYPES)
+  else()
     set(External_CONFIG_TYPE)
     set(External_BUILD_TYPE -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE})
-  endif(CMAKE_CONFIGURATION_TYPES)
+  endif()
   set(External_SOURCE_DIR "${testf_SOURCE_DIR}/External")
   set(External_BINARY_DIR "${testf_BINARY_DIR}/External")
   if("${testf_BINARY_DIR}" MATCHES " ")
@@ -211,10 +211,10 @@ if(TEST_MODULE_DEPENDS)
   # Test module output directory if available.
   if(CMAKE_Fortran_MODDIR_FLAG)
     set(Library_MODDIR "${testf_BINARY_DIR}/Library/modules")
-  else(CMAKE_Fortran_MODDIR_FLAG)
+  else()
     set(Library_MODDIR "${testf_BINARY_DIR}/Library")
-  endif(CMAKE_Fortran_MODDIR_FLAG)
+  endif()
 
   add_subdirectory(Library)
   add_subdirectory(Executable)
-endif(TEST_MODULE_DEPENDS)
+endif()
diff --git a/Tests/Fortran/Library/CMakeLists.txt b/Tests/Fortran/Library/CMakeLists.txt
index 6e39cda1f..17438cafb 100644
--- a/Tests/Fortran/Library/CMakeLists.txt
+++ b/Tests/Fortran/Library/CMakeLists.txt
@@ -8,4 +8,4 @@ if(CMAKE_Fortran_MODDIR_FLAG)
   set_target_properties(subdir_mods PROPERTIES
     Fortran_MODULE_DIRECTORY modules
     )
-endif(CMAKE_Fortran_MODDIR_FLAG)
+endif()
diff --git a/Tests/FunctionTest/CMakeLists.txt b/Tests/FunctionTest/CMakeLists.txt
index 204a8243c..d1fada495 100644
--- a/Tests/FunctionTest/CMakeLists.txt
+++ b/Tests/FunctionTest/CMakeLists.txt
@@ -4,63 +4,63 @@ project (FunctionTest)
 
 function(FAILED testname)
   message(SEND_ERROR "${testname} failed ${ARGN}")
-endfunction(FAILED)
+endfunction()
 
 function(PASS testname)
   message("${testname} passed ${ARGN}")
-endfunction(PASS)
+endfunction()
 
 
 # test scope
 set(COUNT 3)
 function(scope_test)
   set(COUNT 4)
-endfunction(scope_test)
+endfunction()
 scope_test()
 if(COUNT EQUAL "3")
   PASS("scope")
-else(COUNT EQUAL "3")
+else()
   FAILED("COUNT Got: ${COUNT}")
-endif(COUNT EQUAL "3")
+endif()
 
 # test ARGC
 function(weird_name)
   if("${ARGC}" EQUAL "3")
     PASS("ARGC")
-  else("${ARGC}" EQUAL "3")
+  else()
     FAILED("ARGC" "Got: ${ARGC}")
-  endif("${ARGC}" EQUAL "3")
-endfunction(weird_name)
+  endif()
+endfunction()
 WeIrD_nAmE(a1 a2 a3)
 
 # test ARGN
 function(test_argn_function argument)
   if("${ARGN}" EQUAL "3")
     PASS("ARGN")
-  else("${ARGN}" EQUAL "3")
+  else()
     FAILED("ARGN" "Got: ${ARGN}")
-  endif("${ARGN}" EQUAL "3")
-endfunction(test_argn_function)
+  endif()
+endfunction()
 Test_Argn_Function(ignored 3)
 
 # test argument naming and raise scope
 function(track_find_variable cache_variable is_changed)
  set("${is_changed}" changed PARENT_SCOPE)
-endfunction(track_find_variable)
+endfunction()
 track_find_variable(testvar is_changed)
 if ("${is_changed}" STREQUAL changed)
   pass("same argument name test")
-else ("${is_changed}" STREQUAL changed)
+else ()
   pass("same argument name test")
-endif ("${is_changed}" STREQUAL changed)
+endif ()
 
 include("Util.cmake")
 tester()
 if (tester_res STREQUAL "${CMAKE_CURRENT_LIST_FILE}")
   pass("CMAKE_CURRENT_LIST_FILE test")
-else (tester_res STREQUAL "${CMAKE_CURRENT_LIST_FILE}")
+else ()
   pass("CMAKE_CURRENT_LIST_FILE test")
-endif (tester_res STREQUAL "${CMAKE_CURRENT_LIST_FILE}")
+endif ()
 
 
 
@@ -68,67 +68,67 @@ endif (tester_res STREQUAL "${CMAKE_CURRENT_LIST_FILE}")
 function (factorial argument result)
   if (argument LESS 2)
     set (lresult 1)
-  else (argument LESS 2)
+  else ()
     math (EXPR temp "${argument} - 1")
     factorial (${temp} tresult)
     math (EXPR lresult "${argument}*${tresult}")
-  endif (argument LESS 2)
+  endif ()
   set ("${result}" "${lresult}" PARENT_SCOPE)
-endfunction (factorial)
+endfunction ()
 
 factorial (5 fresult)
 if (fresult EQUAL 120)
   pass("factorial")
-else (fresult EQUAL 120)
+else ()
   failed ("factorial, computed ${fresult} instead of 120")
-endif (fresult EQUAL 120)
+endif ()
 
 
 
 # case test
 function(strange_function m)
   set("${m}" strange_function PARENT_SCOPE)
-endfunction(strange_function m)
+endfunction()
 
 STRANGE_FUNCTION(var)
 set(second_var "second_var")
 if("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var")
   PASS("Case Test" "(${var} ${second_var})")
-else("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var")
+else()
   FAILED("Case test" "(${var} ${second_var})")
-endif("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var")
+endif()
 
 # test backing up command
 function(ADD_EXECUTABLE exec)
   _ADD_EXECUTABLE(mini${exec} ${ARGN})
-endfunction(ADD_EXECUTABLE)
+endfunction()
 
 # var undef case
 function(undef_var m)
   set("${m}" PARENT_SCOPE)
-endfunction(undef_var)
+endfunction()
 
 set(FUNCTION_UNDEFINED 1)
 undef_var(FUNCTION_UNDEFINED)
 if(DEFINED FUNCTION_UNDEFINED)
   FAILED("Function Undefine Test" "(${FUNCTION_UNDEFINED})")
-else(DEFINED FUNCTION_UNDEFINED)
+else()
   PASS("Function Undefine Test" "(${FUNCTION_UNDEFINED})")
-endif(DEFINED FUNCTION_UNDEFINED)
+endif()
 
 # Subdirectory scope raise.
 set(SUBDIR_UNDEFINED 1)
 add_subdirectory(SubDirScope)
 if(DEFINED SUBDIR_UNDEFINED)
   FAILED("Subdir Undefine Test" "(${SUBDIR_UNDEFINED})")
-else(DEFINED SUBDIR_UNDEFINED)
+else()
   PASS("Subdir Undefine Test" "(${SUBDIR_UNDEFINED})")
-endif(DEFINED SUBDIR_UNDEFINED)
+endif()
 if(DEFINED SUBDIR_DEFINED)
   PASS("Subdir Define Test" "(${SUBDIR_DEFINED})")
-else(DEFINED SUBDIR_DEFINED)
+else()
   FAILED("Subdir Define Test" "(${SUBDIR_DEFINED})")
-endif(DEFINED SUBDIR_DEFINED)
+endif()
 
 # Test function-scoped directory.
 function(ADD_SUBDIR2 dir)
@@ -136,15 +136,15 @@ function(ADD_SUBDIR2 dir)
   # The parent scope sets in the subdir should be visible here.
   if(DEFINED SUBDIR_UNDEFINED)
     FAILED("Subdir Function Undefine Test 1" "(${SUBDIR_UNDEFINED})")
-  else(DEFINED SUBDIR_UNDEFINED)
+  else()
     PASS("Subdir Function Undefine Test 1" "(${SUBDIR_UNDEFINED})")
-  endif(DEFINED SUBDIR_UNDEFINED)
+  endif()
   if(DEFINED SUBDIR_DEFINED)
     PASS("Subdir Function Define Test 1" "(${SUBDIR_DEFINED})")
-  else(DEFINED SUBDIR_DEFINED)
+  else()
     FAILED("Subdir Function Define Test 1" "(${SUBDIR_DEFINED})")
-  endif(DEFINED SUBDIR_DEFINED)
-endfunction(ADD_SUBDIR2)
+  endif()
+endfunction()
 
 # Reset test variables.
 set(SUBDIR_UNDEFINED 1)
@@ -156,14 +156,14 @@ ADD_SUBDIR2(SubDirScope)
 # The parent scope sets in the subdir should not be visible here.
 if(DEFINED SUBDIR_UNDEFINED)
   PASS("Subdir Function Undefine Test 2" "(${SUBDIR_UNDEFINED})")
-else(DEFINED SUBDIR_UNDEFINED)
+else()
   FAILED("Subdir Function Undefine Test 2" "(${SUBDIR_UNDEFINED})")
-endif(DEFINED SUBDIR_UNDEFINED)
+endif()
 if(DEFINED SUBDIR_DEFINED)
   FAILED("Subdir Function Define Test 2" "(${SUBDIR_DEFINED})")
-else(DEFINED SUBDIR_DEFINED)
+else()
   PASS("Subdir Function Define Test 2" "(${SUBDIR_DEFINED})")
-endif(DEFINED SUBDIR_DEFINED)
+endif()
 
 add_executable(FunctionTest functionTest.c)
 
diff --git a/Tests/FunctionTest/SubDirScope/CMakeLists.txt b/Tests/FunctionTest/SubDirScope/CMakeLists.txt
index c40fadb72..c1a3cfb37 100644
--- a/Tests/FunctionTest/SubDirScope/CMakeLists.txt
+++ b/Tests/FunctionTest/SubDirScope/CMakeLists.txt
@@ -4,11 +4,11 @@ set(SUBDIR_UNDEFINED PARENT_SCOPE)
 # The above sets should not affect the current scope.
 if(DEFINED SUBDIR_UNDEFINED)
   PASS("SubdirScope Undefine Test" "(${SUBDIR_UNDEFINED})")
-else(DEFINED SUBDIR_UNDEFINED)
+else()
   FAILED("SubdirScope Undefine Test" "(${SUBDIR_UNDEFINED})")
-endif(DEFINED SUBDIR_UNDEFINED)
+endif()
 if(DEFINED SUBDIR_DEFINED)
   FAILED("SubdirScope Define Test" "(${SUBDIR_DEFINED})")
-else(DEFINED SUBDIR_DEFINED)
+else()
   PASS("SubdirScope Define Test" "(${SUBDIR_DEFINED})")
-endif(DEFINED SUBDIR_DEFINED)
+endif()
diff --git a/Tests/FunctionTest/Util.cmake b/Tests/FunctionTest/Util.cmake
index f0c73b5da..846abd78a 100644
--- a/Tests/FunctionTest/Util.cmake
+++ b/Tests/FunctionTest/Util.cmake
@@ -1,3 +1,3 @@
 function(tester)
  set (tester_res "${CMAKE_CURRENT_LIST_FILE}" PARENT_SCOPE)
-endfunction(tester)
+endfunction()
diff --git a/Tests/JCTest/CMakeLists.txt b/Tests/JCTest/CMakeLists.txt
index 17cea0f08..31dcc3abf 100644
--- a/Tests/JCTest/CMakeLists.txt
+++ b/Tests/JCTest/CMakeLists.txt
@@ -6,4 +6,4 @@ add_executable(TestTime TestTime.cxx)
 foreach(f 1 2 3 4 5 6 7 8 9 10 11 12 12 14 15 16 17 18 19
 20 21 22 23 24 25 26 27 28 29 30)
   add_test(TestTime${f} TestTime 50000000)
-endforeach(f)
+endforeach()
diff --git a/Tests/Jump/Executable/CMakeLists.txt b/Tests/Jump/Executable/CMakeLists.txt
index a09bac739..bc6731ff1 100644
--- a/Tests/Jump/Executable/CMakeLists.txt
+++ b/Tests/Jump/Executable/CMakeLists.txt
@@ -1,6 +1,6 @@
 if(NOT LIBRARY_OUTPUT_PATH)
   link_directories(${Jump_BINARY_DIR}/Library/Static
                    ${Jump_BINARY_DIR}/Library/Shared)
-endif(NOT LIBRARY_OUTPUT_PATH)
+endif()
 add_executable(jumpExecutable jumpExecutable.cxx)
 target_link_libraries(jumpExecutable jumpStatic jumpShared)
diff --git a/Tests/Jump/Library/Shared/CMakeLists.txt b/Tests/Jump/Library/Shared/CMakeLists.txt
index 87d40e54d..a37299a79 100644
--- a/Tests/Jump/Library/Shared/CMakeLists.txt
+++ b/Tests/Jump/Library/Shared/CMakeLists.txt
@@ -6,7 +6,7 @@ endif()
 
 if(APPLE)
   set(SHARED_MUST_BE_IN_EXE_DIR 1)
-endif(APPLE)
+endif()
 
 if(SHARED_MUST_BE_IN_EXE_DIR)
   set(LIB_NAME
@@ -14,13 +14,13 @@ if(SHARED_MUST_BE_IN_EXE_DIR)
   set(EXE_DIR ${Jump_BINARY_DIR}/Executable)
   if(EXECUTABLE_OUTPUT_PATH)
     set(EXE_DIR ${EXECUTABLE_OUTPUT_PATH})
-  endif(EXECUTABLE_OUTPUT_PATH)
+  endif()
   set(LIB_DIR ${Jump_BINARY_DIR}/Library/Shared)
   if(LIBRARY_OUTPUT_PATH)
     set(LIB_DIR ${LIBRARY_OUTPUT_PATH})
-  endif(LIBRARY_OUTPUT_PATH)
+  endif()
   add_custom_command(TARGET jumpShared
     POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy
     ${LIB_DIR}/${CMAKE_CFG_INTDIR}/${LIB_NAME}
     ${EXE_DIR}/${CMAKE_CFG_INTDIR}/${LIB_NAME})
-endif(SHARED_MUST_BE_IN_EXE_DIR)
+endif()
diff --git a/Tests/LibName/CMakeLists.txt b/Tests/LibName/CMakeLists.txt
index b3ad31114..3ac125fb9 100644
--- a/Tests/LibName/CMakeLists.txt
+++ b/Tests/LibName/CMakeLists.txt
@@ -13,7 +13,7 @@ add_executable(foobar foobar.c)
 target_link_libraries(foobar foo)
 if(UNIX)
   target_link_libraries(foobar -L/usr/local/lib)
-endif(UNIX)
+endif()
 
 
 # check with lib version
diff --git a/Tests/LoadCommand/CMakeCommands/CMakeLists.txt b/Tests/LoadCommand/CMakeCommands/CMakeLists.txt
index 276fdb681..99b1aba82 100644
--- a/Tests/LoadCommand/CMakeCommands/CMakeLists.txt
+++ b/Tests/LoadCommand/CMakeCommands/CMakeLists.txt
@@ -3,7 +3,7 @@ project(CMAKE_LOADED_COMMANDS)
 
 if (MUDSLIDE_TYPE MATCHES MUCHO)
   add_definitions(-DMUCHO_MUDSLIDE)
-endif (MUDSLIDE_TYPE MATCHES MUCHO)
+endif ()
 
 include_directories(${CMAKE_ROOT}/include ${CMAKE_ROOT}/Source)
 
@@ -11,4 +11,4 @@ add_library(cmCMAKE_TEST_COMMAND MODULE cmTestCommand.c)
 
 if(WATCOM)
   target_link_libraries(cmCMAKE_TEST_COMMAND clbsdll.lib)
-endif(WATCOM)
+endif()
diff --git a/Tests/LoadCommand/CMakeLists.txt b/Tests/LoadCommand/CMakeLists.txt
index 9787f83ad..c9337987a 100644
--- a/Tests/LoadCommand/CMakeLists.txt
+++ b/Tests/LoadCommand/CMakeLists.txt
@@ -20,7 +20,7 @@ include_directories(${LoadCommand_BINARY_DIR})
 # try to compile the command
 # make sure it is not already loaded
 if(COMMAND CMAKE_TEST_COMMAND)
-else(COMMAND CMAKE_TEST_COMMAND)
+else()
   try_compile(COMPILE_OK
     ${LoadCommand_BINARY_DIR}/CMakeCommands
     ${LoadCommand_SOURCE_DIR}/CMakeCommands
@@ -33,7 +33,7 @@ else(COMMAND CMAKE_TEST_COMMAND)
     ${LoadCommand_SOURCE_DIR}/CMakeCommands
     CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO
     OUTPUT_VARIABLE OUTPUT )
-endif(COMMAND CMAKE_TEST_COMMAND)
+endif()
 
 message("Output from try compile: ${OUTPUT}")
 
@@ -51,13 +51,13 @@ if (COMPILE_OK)
       "${LoadCommand_BINARY_DIR}/LoadedCommand2.cxx.in"
       "${LoadCommand_BINARY_DIR}/LoadedCommand3.cxx"
       )
-  endif (COMMAND CMAKE_TEST_COMMAND)
-else (COMPILE_OK)
+  endif ()
+else ()
   message("failed to compile CMAKE_LOADED_COMMANDS")
-endif (COMPILE_OK)
+endif ()
 
 # TEST_DEF is set by the loaded command cmTestCommand.c
 if (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC)
   add_definitions(-DCMAKE_IS_FUN)
-endif (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC)
+endif ()
 
diff --git a/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt b/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt
index 2d96b0413..5ee2ed0f1 100644
--- a/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt
+++ b/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt
@@ -3,15 +3,15 @@ project(CMAKE_LOADED_COMMANDS)
 
 if (MUDSLIDE_TYPE MATCHES MUCHO)
   add_definitions(-DMUCHO_MUDSLIDE)
-endif (MUDSLIDE_TYPE MATCHES MUCHO)
+endif ()
 
 if(WATCOM)
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
-endif(WATCOM)
+endif()
 include_directories(${CMAKE_ROOT}/include ${CMAKE_ROOT}/Source)
 
 add_library(cmCMAKE_TEST_COMMAND MODULE cmTestCommand.c)
 
 if(WATCOM)
   target_link_libraries(cmCMAKE_TEST_COMMAND clbsdll.lib)
-endif(WATCOM)
+endif()
diff --git a/Tests/LoadCommandOneConfig/CMakeLists.txt b/Tests/LoadCommandOneConfig/CMakeLists.txt
index a443605f2..a75ad5aa5 100644
--- a/Tests/LoadCommandOneConfig/CMakeLists.txt
+++ b/Tests/LoadCommandOneConfig/CMakeLists.txt
@@ -26,7 +26,7 @@ include_directories(${LoadCommand_BINARY_DIR})
 # try to compile the command
 # make sure it is not already loaded
 if(COMMAND CMAKE_TEST_COMMAND)
-else(COMMAND CMAKE_TEST_COMMAND)
+else()
   try_compile(COMPILE_OK
     ${LoadCommand_BINARY_DIR}/CMakeCommands
     ${LoadCommand_SOURCE_DIR}/CMakeCommands
@@ -39,7 +39,7 @@ else(COMMAND CMAKE_TEST_COMMAND)
     ${LoadCommand_SOURCE_DIR}/CMakeCommands
     CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO
     OUTPUT_VARIABLE OUTPUT )
-endif(COMMAND CMAKE_TEST_COMMAND)
+endif()
 
 message("Output from try compile: ${OUTPUT}")
 
@@ -57,13 +57,13 @@ if (COMPILE_OK)
       "${LoadCommand_BINARY_DIR}/LoadedCommand2.cxx.in"
       "${LoadCommand_BINARY_DIR}/LoadedCommand3.cxx"
       )
-  endif (COMMAND CMAKE_TEST_COMMAND)
-else (COMPILE_OK)
+  endif ()
+else ()
   message("failed to compile CMAKE_LOADED_COMMANDS")
-endif (COMPILE_OK)
+endif ()
 
 # TEST_DEF is set by the loaded command cmTestCommand.c
 if (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC)
   add_definitions(-DCMAKE_IS_FUN)
-endif (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC)
+endif ()
 
diff --git a/Tests/MacroTest/CMakeLists.txt b/Tests/MacroTest/CMakeLists.txt
index 9d189b92a..02bb31f20 100644
--- a/Tests/MacroTest/CMakeLists.txt
+++ b/Tests/MacroTest/CMakeLists.txt
@@ -4,48 +4,48 @@ project (MacroTest)
 
 macro(FAILED testname)
   message(SEND_ERROR "${testname} failed ${ARGN}")
-endmacro(FAILED)
+endmacro()
 
 macro(PASS testname)
   message("${testname} passed ${ARGN}")
-endmacro(PASS)
+endmacro()
 
 # test ARGC
 macro(weird_name)
   if("${ARGC}" EQUAL "3")
     PASS("ARGC")
-  else("${ARGC}" EQUAL "3")
+  else()
     FAILED("ARGC" "Got: ${ARGC}")
-  endif("${ARGC}" EQUAL "3")
-endmacro(weird_name)
+  endif()
+endmacro()
 WeIrD_nAmE(a1 a2 a3)
 
 # test ARGN
 macro(test_argn_macro argument)
   if("${ARGN}" EQUAL "3")
     PASS("ARGN")
-  else("${ARGN}" EQUAL "3")
+  else()
     FAILED("ARGN" "Got: ${ARGN}")
-  endif("${ARGN}" EQUAL "3")
-endmacro(test_argn_macro)
+  endif()
+endmacro()
 Test_Argn_Macro(ignored 3)
 
 # case test
 macro(strange_macro m)
   set("${m}" strange_macro)
-endmacro(strange_macro m)
+endmacro()
 STRANGE_MACRO(var)
 set(second_var "second_var")
 if("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var")
   PASS("Case Test" "(${var} ${second_var})")
-else("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var")
+else()
   FAILED("Case test" "(${var} ${second_var})")
-endif("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var")
+endif()
 
 # test backing up command
 macro(ADD_EXECUTABLE exec)
   _ADD_EXECUTABLE("mini${exec}" ${ARGN})
-endmacro(ADD_EXECUTABLE)
+endmacro()
 
 include(CheckCSourceCompiles)
 Check_C_Source_Compiles(
@@ -64,9 +64,9 @@ int main(int ac, char*av[]){
 SOME_CHECK)
 if(SOME_CHECK)
   message("CheckCSourceCompiles works")
-else(SOME_CHECK)
+else()
   message(FATAL_ERROR "CheckCSourceCompiles does not work")
-endif(SOME_CHECK)
+endif()
 
 include(CheckCXXSourceCompiles)
 Check_CXX_Source_Compiles(
@@ -79,13 +79,13 @@ int main(int ac, char*av[]){
 SOME_CHECK)
 if(SOME_CHECK)
   message("CheckCXXSourceCompiles works")
-else(SOME_CHECK)
+else()
   message(FATAL_ERROR "CheckCXXSourceCompiles does not work")
-endif(SOME_CHECK)
+endif()
 
 add_executable(MacroTest macroTest.c)
 
 macro(GET_CURRENT_FILE var)
   set(${var} ${CMAKE_CURRENT_LIST_FILE})
-endmacro(GET_CURRENT_FILE)
+endmacro()
 include(context.cmake)
diff --git a/Tests/MacroTest/context.cmake b/Tests/MacroTest/context.cmake
index 82eb4856b..f7350d771 100644
--- a/Tests/MacroTest/context.cmake
+++ b/Tests/MacroTest/context.cmake
@@ -7,4 +7,4 @@ if(NOT "${current_file}" STREQUAL "${CMAKE_CURRENT_LIST_FILE}")
     "  ${current_file}\n"
     "from the macro."
     )
-endif(NOT "${current_file}" STREQUAL "${CMAKE_CURRENT_LIST_FILE}")
+endif()
diff --git a/Tests/MakeClean/CMakeLists.txt b/Tests/MakeClean/CMakeLists.txt
index 74007542c..13348a28b 100644
--- a/Tests/MakeClean/CMakeLists.txt
+++ b/Tests/MakeClean/CMakeLists.txt
@@ -13,12 +13,12 @@ if(TOCLEAN_BUILT)
     "Building ToClean succeeded with the following output:\n"
     "[${OUTPUT}]"
     )
-else(TOCLEAN_BUILT)
+else()
   message(FATAL_ERROR
     "Building ToClean failed with the following output:\n"
     "[${OUTPUT}]"
     )
-endif(TOCLEAN_BUILT)
+endif()
 
 # Get the set of files to check from the ToClean project.
 include(${MakeClean_BINARY_DIR}/ToClean/ToCleanFiles.cmake)
@@ -26,16 +26,16 @@ include(${MakeClean_BINARY_DIR}/ToClean/ToCleanFiles.cmake)
 # Check for the existence of the files.
 foreach(f ${TOCLEAN_FILES})
   if(EXISTS "${f}")
-  else(EXISTS "${f}")
+  else()
     message(FATAL_ERROR "File \"${f}\" does not exist!")
-  endif(EXISTS "${f}")
-endforeach(f)
+  endif()
+endforeach()
 
 # Configure an executable to check that all the files are missing.
 set(CHECK_FILES)
 foreach(f ${TOCLEAN_FILES})
   set(CHECK_FILES "${CHECK_FILES}      \"${f}\",\n")
-endforeach(f)
+endforeach()
 configure_file(${MakeClean_SOURCE_DIR}/check_clean.c.in
                ${MakeClean_BINARY_DIR}/check_clean.c @ONLY IMMEDIATE)
 add_executable(check_clean ${MakeClean_BINARY_DIR}/check_clean.c)
diff --git a/Tests/MathTest/CMakeLists.txt b/Tests/MathTest/CMakeLists.txt
index 44d4aae15..34beaa0aa 100644
--- a/Tests/MathTest/CMakeLists.txt
+++ b/Tests/MathTest/CMakeLists.txt
@@ -17,7 +17,7 @@ foreach(expression
     ${expressions})
   math(EXPR expr "${expression}")
   set(FILE_EXPRESSIONS "${FILE_EXPRESSIONS}TEST_EXPRESSION(${expression}, ${expr})\n")
-endforeach(expression)
+endforeach()
 
 configure_file(
   "${CMAKE_CURRENT_SOURCE_DIR}/MathTestTests.h.in"
diff --git a/Tests/OutOfSource/CMakeLists.txt b/Tests/OutOfSource/CMakeLists.txt
index 420310f5f..de1603a55 100644
--- a/Tests/OutOfSource/CMakeLists.txt
+++ b/Tests/OutOfSource/CMakeLists.txt
@@ -8,7 +8,7 @@ get_directory_property(ANIMAL DIRECTORY OutOfSourceSubdir DEFINITION WEASELS)
 get_directory_property(ANIMALREL DIRECTORY SubDir/../OutOfSourceSubdir DEFINITION WEASELS)
 if(NOT "${ANIMAL}" STREQUAL "${ANIMALREL}")
   message(FATAL_ERROR "GET_DIRECTORY_PROPERTY does not seem to collapse paths.")
-endif(NOT "${ANIMAL}" STREQUAL "${ANIMALREL}")
+endif()
 
 configure_file(
   ${OutOfSource_SOURCE_DIR}/testdp.h.in
diff --git a/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt b/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt
index d4188098f..10a2f59d1 100644
--- a/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt
+++ b/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt
@@ -36,7 +36,7 @@ if ("${PROJECT_SOURCE_DIR}" STREQUAL "${ANOTHER_PROJ_SOURCE_DIR}")
   while("${DEEPDIR_LEN}" LESS "${MAXPATH}")
     set(DEEPDIR ${DEEPDIR}/and/deeper)
     string(LENGTH "${DEEPDIR}" DEEPDIR_LEN)
-  endwhile("${DEEPDIR_LEN}" LESS "${MAXPATH}")
+  endwhile()
   set(DEEPSRC ${DEEPDIR}/simple.cxx)
   string(LENGTH "${DEEPSRC}" DEEPSRC_LEN)
   configure_file(simple.cxx.in ${DEEPSRC} COPYONLY)
@@ -46,12 +46,12 @@ if ("${PROJECT_SOURCE_DIR}" STREQUAL "${ANOTHER_PROJ_SOURCE_DIR}")
   if(${CMAKE_GENERATOR} MATCHES "Watcom WMake")
     set(DEEPSRC "")
     add_definitions(-DNO_DEEPSRC)
-  endif(${CMAKE_GENERATOR} MATCHES "Watcom WMake")
+  endif()
 
   add_library(testlib testlib.cxx)
   add_executable (simple simple.cxx ../simple.cxx ${DEEPSRC})
   target_link_libraries(simple testlib outlib)
-endif ("${PROJECT_SOURCE_DIR}" STREQUAL "${ANOTHER_PROJ_SOURCE_DIR}")
+endif ()
 
 # test getting a definition from a subdir
 set (WEASELS SIZZLING)
@@ -59,4 +59,4 @@ set (WEASELS SIZZLING)
 get_directory_property(incDirs INCLUDE_DIRECTORIES)
 if(NOT incDirs)
    message(FATAL_ERROR "get_directory_property(INCLUDE_DIRECTORIES) returned empty list")
-endif(NOT incDirs)
+endif()
diff --git a/Tests/PolicyScope/CMakeLists.txt b/Tests/PolicyScope/CMakeLists.txt
index e6f2edc07..413195a5c 100644
--- a/Tests/PolicyScope/CMakeLists.txt
+++ b/Tests/PolicyScope/CMakeLists.txt
@@ -7,7 +7,7 @@ function(check msg lhs rhs)
   if(NOT "${lhs}" STREQUAL "${rhs}")
     message(FATAL_ERROR "${msg}: expected [${lhs}], got [${rhs}]")
   endif()
-endfunction(check)
+endfunction()
 
 #-----------------------------------------------------------------------------
 # Test using a development framework that sets policies for us.
@@ -52,7 +52,7 @@ if(1)
     # CMP0002 should be changed when this function is invoked
     cmake_policy(GET CMP0002 cmp)
     check(CMP0002 "OLD" "${cmp}")
-  endfunction(func1)
+  endfunction()
 
   # Unset CMP0002
   cmake_policy(VERSION 2.4)
@@ -65,8 +65,8 @@ if(1)
     cmake_policy(SET CMP0002 OLD)
     cmake_policy(GET CMP0002 cmp)
     check(CMP0002 "OLD" "${cmp}")
-  endmacro(macro1)
-endif(1)
+  endmacro()
+endif()
 cmake_policy(POP)
 
 # CMP0002 should still be NEW in this context.
diff --git a/Tests/PrecompiledHeader/CMakeLists.txt b/Tests/PrecompiledHeader/CMakeLists.txt
index e5ac6d347..6958131bf 100644
--- a/Tests/PrecompiledHeader/CMakeLists.txt
+++ b/Tests/PrecompiledHeader/CMakeLists.txt
@@ -12,28 +12,28 @@ if(CMAKE_CONFIGURATION_TYPES)
   foreach(cfg ${CMAKE_CONFIGURATION_TYPES})
     file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/PCH/${cfg})
   endforeach()
-else(CMAKE_CONFIGURATION_TYPES)
+else()
   set(PCH_DIR "${CMAKE_CURRENT_BINARY_DIR}/PCH")
   file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/PCH)
-endif(CMAKE_CONFIGURATION_TYPES)
+endif()
 
 # The VS6 IDE does not support renaming .pch files with /Fp.
 if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
   set(PCH_USE_INCLUDE_DIR 1)
   set(PCH_FILE)
-else("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
+else()
   set(PCH_USE_INCLUDE_DIR 0)
   set(PCH_FILE "\"/Fp${PCH_DIR}/foo_precompiled.pch\"")
-endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
+endif()
 
 # Choose between an explicit include path and using /I during
 # precompilation.  The /I form is used to test that the PCH is
 # actually used.  In practice the include path form would be used.
 if(PCH_USE_INCLUDE_DIR)
   include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
-else(PCH_USE_INCLUDE_DIR)
+else()
   set(PCH_INCLUDE_DIR "\"/I${CMAKE_CURRENT_SOURCE_DIR}/include\"")
-endif(PCH_USE_INCLUDE_DIR)
+endif()
 
 # Create a target that will use a precompiled header.
 set(foo_SRCS foo1.c foo2.c)
@@ -56,4 +56,4 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile" OR
   # These source files use the precompiled header.
   set_source_files_properties(${foo_SRCS} PROPERTIES
     OBJECT_DEPENDS "${PCH_DIR}/foo_precompiled.pch")
-endif("${CMAKE_GENERATOR}" MATCHES "Makefile")
+endif()
diff --git a/Tests/Preprocess/CMakeLists.txt b/Tests/Preprocess/CMakeLists.txt
index 1ed7b83ac..78746e7b8 100644
--- a/Tests/Preprocess/CMakeLists.txt
+++ b/Tests/Preprocess/CMakeLists.txt
@@ -9,37 +9,37 @@ project(Preprocess)
 # to work with each tool and documents those known to not work.
 if("${CMAKE_GENERATOR}" MATCHES "Xcode")
   set(PP_XCODE 1)
-endif("${CMAKE_GENERATOR}" MATCHES "Xcode")
+endif()
 if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
   set(PP_VS6 1)
-endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
+endif()
 if("${CMAKE_GENERATOR}" MATCHES "Unix Makefiles")
   set(PP_UMAKE 1)
-endif("${CMAKE_GENERATOR}" MATCHES "Unix Makefiles")
+endif()
 if("${CMAKE_GENERATOR}" MATCHES "NMake Makefiles")
   set(PP_NMAKE 1)
-endif("${CMAKE_GENERATOR}" MATCHES "NMake Makefiles")
+endif()
 if("${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles")
   set(PP_MINGW 1)
-endif("${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles")
+endif()
 if("${CMAKE_GENERATOR}" MATCHES "Borland Makefiles")
   set(PP_BORLAND 1)
-endif("${CMAKE_GENERATOR}" MATCHES "Borland Makefiles")
+endif()
 if("${CMAKE_GENERATOR}" MATCHES "Watcom WMake")
   set(PP_WATCOM 1)
-endif("${CMAKE_GENERATOR}" MATCHES "Watcom WMake")
+endif()
 if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 7$")
   set(PP_VS70 1)
-endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 7$")
+endif()
 if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
   set(PP_VS 1)
-endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
+endif()
 if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 10")
   set(PP_VS100 1)
-endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 10")
+endif()
 if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 11")
   set(PP_VS110 1)
-endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 11")
+endif()
 
 # Some tests below check the PP_* variables set above.  They are meant
 # to test the case that the build tool is at fault.  Other tests below
@@ -80,8 +80,8 @@ if(NOT PP_VS6)
     # trouble passing to other tools, and the compiler may be directly
     # invoked from the command line.
     set(STRING_EXTRA "${STRING_EXTRA} ")
-  endif(NOT PP_BORLAND AND NOT PP_WATCOM)
-endif(NOT PP_VS6)
+  endif()
+endif()
 
 if(NOT PP_VS)
   # VS: ,
@@ -89,21 +89,21 @@ if(NOT PP_VS)
   # The comma-separated list of PreprocessorDefinitions in the project
   # file seems to be parsed before the content of entries is examined.
   set(STRING_EXTRA "${STRING_EXTRA},")
-endif(NOT PP_VS)
+endif()
 
 if(NOT PP_MINGW)
   # MinGW: &
   # When inside -D"FOO=\"a & b\"" MinGW make wants -D"FOO=\"a "&" b\""
   # but it does not like quoted ampersand elsewhere.
   set(STRING_EXTRA "${STRING_EXTRA}&")
-endif(NOT PP_MINGW)
+endif()
 
 if(NOT PP_MINGW)
   # MinGW: |
   # When inside -D"FOO=\"a | b\"" MinGW make wants -D"FOO=\"a "|" b\""
   # but it does not like quoted pipe elsewhere.
   set(STRING_EXTRA "${STRING_EXTRA}|")
-endif(NOT PP_MINGW)
+endif()
 
 if(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE)
   # Borland, NMake, MinGW: ^
@@ -111,13 +111,13 @@ if(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE)
   # but do not like quoted carrot elsewhere.  In NMake the non-quoted
   # syntax works when the flags are not in a make variable.
   set(STRING_EXTRA "${STRING_EXTRA}^")
-endif(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE)
+endif()
 
 if(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE)
   # Borland, MinGW: < >
   # Angle-brackets have funny behavior that is hard to escape.
   set(STRING_EXTRA "${STRING_EXTRA}<>")
-endif(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE)
+endif()
 
 set(EXPR_OP1 "/")
 if((NOT MSVC OR PP_NMAKE) AND
@@ -150,7 +150,7 @@ endif()
 #  - NMake is okay with just \\\"
 if(PP_NMAKE OR PP_UMAKE)
   set(STRING_EXTRA "${STRING_EXTRA}\\\"")
-endif(PP_NMAKE OR PP_UMAKE)
+endif()
 
 # General: #
 # MSVC will not accept a # in the value of a string definition on the
@@ -187,7 +187,7 @@ set(EXPR "x*y+!(x==(y+1*2))*f(x${EXPR_OP1}2)")
 if(NOT WATCOM)
   # Watcom does not support - or / because it parses them as options.
   set(EXPR "${EXPR} + y/x-x")
-endif(NOT WATCOM)
+endif()
 
 #-----------------------------------------------------------------------------
 
@@ -199,11 +199,11 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DPREPROCESS_DEBUG")
 # Inform the test if it built from Xcode or VS6 IDE.
 if(PP_XCODE)
   set(PREPROCESS_XCODE 1)
-endif(PP_XCODE)
+endif()
 if(PP_VS6)
   set(PREPROCESS_VS6 1)
   set(VS6 _vs6)
-endif(PP_VS6)
+endif()
 
 # Test old-style definitions.
 add_definitions(-DOLD_DEF -DOLD_EXPR=2)
@@ -213,7 +213,7 @@ set(OLD_DEFS_EXPECTED "OLD_DEF;OLD_EXPR=2")
 get_property(OLD_DEFS DIRECTORY PROPERTY COMPILE_DEFINITIONS)
 if(NOT "${OLD_DEFS}" STREQUAL "${OLD_DEFS_EXPECTED}")
   message(SEND_ERROR "add_definitions not converted to directory property!")
-endif(NOT "${OLD_DEFS}" STREQUAL "${OLD_DEFS_EXPECTED}")
+endif()
 
 add_executable(Preprocess preprocess.c preprocess${VS6}.cxx)
 
@@ -234,14 +234,14 @@ foreach(c "" "_DEBUG" "_RELEASE")
     SOURCE preprocess.c preprocess${VS6}.cxx
     PROPERTY COMPILE_DEFINITIONS${c} "FILE_DEF${c}"
     )
-endforeach(c)
+endforeach()
 
 # Add definitions with values.
 if(NOT PREPROCESS_VS6)
   # The path might have spaces, which VS6 does not support.
   set(DEF_TARGET_PATH "TARGET_PATH=\"${TARGET_PATH}\"")
   set(DEF_FILE_PATH "FILE_PATH=\"${FILE_PATH}\"")
-endif(NOT PREPROCESS_VS6)
+endif()
 set_property(
   TARGET Preprocess
   APPEND PROPERTY COMPILE_DEFINITIONS
@@ -263,7 +263,7 @@ add_custom_target(drive COMMAND Preprocess)
 # Configure the header file with the desired string value.
 if(SEMICOLON)
   set(STRING_VALUE "${STRING_VALUE};")
-endif(SEMICOLON)
+endif()
 configure_file(${Preprocess_SOURCE_DIR}/preprocess.h.in
                ${Preprocess_BINARY_DIR}/preprocess.h)
 include_directories(${Preprocess_BINARY_DIR})
diff --git a/Tests/Properties/CMakeLists.txt b/Tests/Properties/CMakeLists.txt
index ed6d2d49e..7bf9c2dcc 100644
--- a/Tests/Properties/CMakeLists.txt
+++ b/Tests/Properties/CMakeLists.txt
@@ -27,7 +27,7 @@ get_property(GLOBALRESULT GLOBAL PROPERTY GLOBALTEST DEFINED)
 if (GLOBALRESULT)
     message(SEND_ERROR "Error: global prop defined when it should not be, "
             "result is GLOBALRESULT=${GLOBALRESULT}")
-endif (GLOBALRESULT)
+endif ()
 
 define_property(GLOBAL PROPERTY GLOBALTEST
   BRIEF_DOCS "A test property"
@@ -38,7 +38,7 @@ get_property(GLOBALRESULT GLOBAL PROPERTY GLOBALTEST DEFINED)
 if (NOT GLOBALRESULT)
     message(SEND_ERROR "Error: global prop not defined "
             "result is GLOBALRESULT=${GLOBALRESULT}")
-endif (NOT GLOBALRESULT)
+endif ()
 
 set_property(GLOBAL PROPERTY GLOBALTEST 1)
 set_property(DIRECTORY PROPERTY DIRECTORYTEST 1)
@@ -69,7 +69,7 @@ get_property(TARGETRESULT TARGET Properties PROPERTY TARGETTEST)
 if (NOT TARGETRESULT)
     message(SEND_ERROR
       "Error: target result is TARGETRESULT=${TARGETRESULT}")
-endif (NOT TARGETRESULT)
+endif ()
 
 # test APPEND and APPEND_STRING set_property()
 set_property(TARGET Properties PROPERTY FOO foo)
@@ -94,7 +94,7 @@ get_property(TARGETRESULT TARGET Properties PROPERTY TARGETTEST SET)
 if (NOT TARGETRESULT)
     message(SEND_ERROR
       "Error: target prop not set, result is TARGETRESULT=${TARGETRESULT}")
-endif (NOT TARGETRESULT)
+endif ()
 
 # test unsetting a property
 set_property(TARGET Properties PROPERTY TARGETTEST)
@@ -102,7 +102,7 @@ get_property(TARGETRESULT TARGET Properties PROPERTY TARGETTEST SET)
 if (TARGETRESULT)
     message(SEND_ERROR "Error: target prop not unset, "
             "result is TARGETRESULT=${TARGETRESULT}")
-endif (TARGETRESULT)
+endif ()
 
 
 
@@ -114,7 +114,7 @@ if(NOT RESULT4)
   message(SEND_ERROR "Error: target result is"
     " RESULT4=${RESULT4}"
     " Properties_SOURCES=[${Properties_SOURCES}]")
-endif(NOT RESULT4)
+endif()
 
 # test CACHE properties
 macro(check_cache_props)
@@ -123,8 +123,8 @@ macro(check_cache_props)
     if(NOT "x${result}" STREQUAL "x${expect_${prop}}")
       message(SEND_ERROR "CACHE property ${prop} is [${result}], not [${expect_${prop}}]")
     endif()
-  endforeach(prop)
-endmacro(check_cache_props)
+  endforeach()
+endmacro()
 set(expect_VALUE "ON")
 set(expect_TYPE "BOOL")
 set(expect_HELPSTRING "sample cache entry")
diff --git a/Tests/ReturnTest/CMakeLists.txt b/Tests/ReturnTest/CMakeLists.txt
index a08855ec1..3bd7ce099 100644
--- a/Tests/ReturnTest/CMakeLists.txt
+++ b/Tests/ReturnTest/CMakeLists.txt
@@ -4,24 +4,24 @@ project (ReturnTest)
 
 function (FAILED testname)
   message (SEND_ERROR "${testname} failed ${ARGN}")
-endfunction (FAILED)
+endfunction ()
 
 function (PASS testname)
   message ("${testname} passed ${ARGN}")
-endfunction (PASS)
+endfunction ()
 
 # test simple return
 function (simple)
   set(simpleResult 1 PARENT_SCOPE)
   return()
   set(simpleResult 0 PARENT_SCOPE)
-endfunction (simple)
+endfunction ()
 simple()
 if ("${simpleResult}")
   pass ("simple")
-else ("${simpleResult}")
+else ()
   failed ("simple got: ${simpleResult}")
-endif ("${simpleResult}")
+endif ()
 
 #test return in an if statement
 set (simple2IF 1)
@@ -29,15 +29,15 @@ function (simple2)
   set(simple2Result 1 PARENT_SCOPE)
   if (simple2IF)
     return()
-  endif (simple2IF)
+  endif ()
   set(simple2Result 0 PARENT_SCOPE)
-endfunction (simple2)
+endfunction ()
 simple2()
 if ("${simple2Result}")
   pass ("simple2")
-else ("${simple2Result}")
+else ()
   failed ("simple2 got: ${simple2Result}")
-endif ("${simple2Result}")
+endif ()
 
 #test return in a foreach loop
 function (looptest)
@@ -45,15 +45,15 @@ function (looptest)
     set (looptestResult "${iter}" PARENT_SCOPE)
     if ("${iter}" EQUAL 3)
       return ()
-    endif ("${iter}" EQUAL 3)
-  endforeach (iter)
-endfunction (looptest)
+    endif ()
+  endforeach ()
+endfunction ()
 looptest()
 if ("${looptestResult}" EQUAL 3)
   pass ("looptest")
-else ("${looptestResult}" EQUAL 3)
+else ()
   failed ("looptest got: ${looptestResult}")
-endif ("${looptestResult}" EQUAL 3)
+endif ()
 
 #test return in a while loop
 function (whiletest)
@@ -62,58 +62,58 @@ function (whiletest)
     set (whiletestResult "${iter}" PARENT_SCOPE)
     if ("${iter}" STREQUAL "aaa")
       return ()
-    endif ("${iter}" STREQUAL "aaa")
+    endif ()
     set (iter "${iter}a")
-  endwhile(NOT "${iter}" STREQUAL "aaaaa")
-endfunction (whiletest)
+  endwhile()
+endfunction ()
 whiletest()
 if ("${whiletestResult}" STREQUAL "aaa")
   pass ("whiletest")
-else ("${whiletestResult}" STREQUAL "aaa")
+else ()
   failed ("whiletest got: ${whiletestResult}")
-endif ("${whiletestResult}" STREQUAL "aaa")
+endif ()
 
 # check subdir return
 add_subdirectory(subdir)
 get_directory_property(subdirResult DIRECTORY subdir DEFINITION subdirreturn)
 if ("${subdirResult}" EQUAL 1)
   pass ("subdir")
-else ("${subdirResult}" EQUAL 1)
+else ()
   failed ("subdir got: ${subdirResult}")
-endif ("${subdirResult}" EQUAL 1)
+endif ()
 
 # check return from a file
 include(include_return.cmake)
 if ("${include_returnResult}" EQUAL 1)
   pass ("include_return")
-else ("${include_returnResult}" EQUAL 1)
+else ()
   failed ("include_return got: ${include_returnResult}")
-endif ("${include_returnResult}" EQUAL 1)
+endif ()
 
 # check return from within a macro
 macro (mymacro)
   set (foo 1)
   if (foo)
     return()
-  endif (foo)
-endmacro(mymacro)
+  endif ()
+endmacro()
 
 # test simple return
 function (simple3)
   set (bar 0)
   set(simple3Result 1 PARENT_SCOPE)
   if (bar)
-  else (bar)
+  else ()
     mymacro()
-  endif(bar)
+  endif()
   set(simple3Result 0 PARENT_SCOPE)
-endfunction (simple3)
+endfunction ()
 simple3()
 if ("${simple3Result}")
   pass ("macrotest")
-else ("${simple3Result}")
+else ()
   failed ("macrotest got: ${simple3Result}")
-endif ("${simple3Result}")
+endif ()
 
 
 # test break command now in a foreach
@@ -121,27 +121,27 @@ foreach (iter RANGE 1 5)
   set (break1 "${iter}")
   if ("${iter}" EQUAL 3)
     break ()
-  endif ("${iter}" EQUAL 3)
-endforeach (iter)
+  endif ()
+endforeach ()
 if ("${break1}" EQUAL 3)
   pass ("break in foreach")
-else ("${break1}" EQUAL 3)
+else ()
   failed ("break in foreach got: ${break1}")
-endif ("${break1}" EQUAL 3)
+endif ()
 
 # test break in a while loop
 set (iter "a")
 while(NOT "${iter}" STREQUAL "aaaaa")
   if ("${iter}" STREQUAL "aaa")
     break ()
-  endif ("${iter}" STREQUAL "aaa")
+  endif ()
   set (iter "${iter}a")
-endwhile(NOT "${iter}" STREQUAL "aaaaa")
+endwhile()
 if ("${iter}" STREQUAL "aaa")
   pass ("break in a while")
-else ("${iter}" STREQUAL "aaa")
+else ()
   failed ("break in a whi;e got: ${whiletestResult}")
-endif ("${iter}" STREQUAL "aaa")
+endif ()
 
 
 add_executable (ReturnTest returnTest.c)
diff --git a/Tests/RunCMake/include_external_msproject/check_utils.cmake b/Tests/RunCMake/include_external_msproject/check_utils.cmake
index 7d6b8f8ea..7f5ef5394 100644
--- a/Tests/RunCMake/include_external_msproject/check_utils.cmake
+++ b/Tests/RunCMake/include_external_msproject/check_utils.cmake
@@ -8,8 +8,8 @@ macro(check_line_exists TARGET_FILE REG_EXP_REF)
 
   if(_VAR_LEN GREATER 0)
     set(IS_FOUND "TRUE")
-  endif(_VAR_LEN GREATER 0)
-endmacro(check_line_exists TARGET_FILE REG_EXP_REF)
+  endif()
+endmacro()
 
 # Search and parse project section line by project name.
 # If search was successful stores found type and guid into FOUND_TYPE and FOUND_GUID variables respectively.
@@ -20,13 +20,13 @@ macro(parse_project_section TARGET_FILE PROJECT_NAME)
   check_line_exists(${TARGET_FILE} REG_EXP)
   if(NOT IS_FOUND)
     return()
-  endif(NOT IS_FOUND)
+  endif()
 
   string(REGEX REPLACE "${REG_EXP}" "\\1;\\2" _GUIDS "${FOUND_LINE}")
 
   list(GET _GUIDS 0 FOUND_TYPE)
   list(GET _GUIDS 1 FOUND_GUID)
-endmacro(parse_project_section TARGET_FILE PROJECT_NAME)
+endmacro()
 
 # Search project section line by project name and type.
 # Returns TRUE if found and FALSE otherwise
@@ -36,8 +36,8 @@ function(check_project_type TARGET_FILE PROJECT_NAME PROJECT_TYPE RESULT)
   parse_project_section(${TARGET_FILE} ${PROJECT_NAME})
   if(IS_FOUND AND FOUND_TYPE STREQUAL PROJECT_TYPE)
     set(${RESULT} "TRUE" PARENT_SCOPE)
-  endif(IS_FOUND AND FOUND_TYPE STREQUAL PROJECT_TYPE)
-endfunction(check_project_type TARGET_FILE PROJECT_NAME PROJECT_TYPE RESULT)
+  endif()
+endfunction()
 
 
 # Search project section line by project name and id.
@@ -48,8 +48,8 @@ function(check_project_guid TARGET_FILE PROJECT_NAME PROJECT_GUID RESULT)
   parse_project_section(${TARGET_FILE} ${PROJECT_NAME})
   if(IS_FOUND AND FOUND_GUID STREQUAL PROJECT_GUID)
     set(${RESULT} "TRUE" PARENT_SCOPE)
-  endif(IS_FOUND AND FOUND_GUID STREQUAL PROJECT_GUID)
-endfunction(check_project_guid TARGET_FILE PROJECT_NAME PROJECT_GUID RESULT)
+  endif()
+endfunction()
 
 
 # Search project's build configuration line by project name and target platform name.
@@ -61,7 +61,7 @@ function(check_custom_platform TARGET_FILE PROJECT_NAME PLATFORM_NAME RESULT)
   parse_project_section(${TARGET_FILE} ${PROJECT_NAME})
   if(NOT IS_FOUND)
     return()
-  endif(NOT IS_FOUND)
+  endif()
 
   # probably whould be better to use configuration name
   # extracted from CMAKE_CONFIGURATION_TYPES than just hardcoded "Debug" instead
@@ -69,7 +69,7 @@ function(check_custom_platform TARGET_FILE PROJECT_NAME PLATFORM_NAME RESULT)
   check_line_exists(${TARGET_FILE} REG_EXP)
 
   set(${RESULT} ${IS_FOUND} PARENT_SCOPE)
-endfunction(check_custom_platform TARGET_FILE PLATFORM_NAME RESULT)
+endfunction()
 
 # RunCMake test check helper
 function(check_project test name guid type platform)
diff --git a/Tests/RuntimePath/CMakeLists.txt b/Tests/RuntimePath/CMakeLists.txt
index 2164cdb8d..6583a8712 100644
--- a/Tests/RuntimePath/CMakeLists.txt
+++ b/Tests/RuntimePath/CMakeLists.txt
@@ -30,4 +30,4 @@ if(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG)
   set_property(TARGET bar2 PROPERTY OUTPUT_NAME bar)
   set_property(TARGET bar2 PROPERTY LIBRARY_OUTPUT_DIRECTORY A)
   target_link_libraries(bar2 foo2)
-endif(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG)
+endif()
diff --git a/Tests/Simple/CMakeLists.txt b/Tests/Simple/CMakeLists.txt
index 20d970565..a951c2da2 100644
--- a/Tests/Simple/CMakeLists.txt
+++ b/Tests/Simple/CMakeLists.txt
@@ -14,4 +14,4 @@ target_link_libraries (Simple simpleLib)
 # make sure optimized libs are not used by debug builds
 if(CMAKE_BUILD_TYPE MATCHES Debug)
   target_link_libraries(Simple optimized c:/not/here.lib )
-endif(CMAKE_BUILD_TYPE MATCHES Debug)
+endif()
diff --git a/Tests/SimpleCOnly/CMakeLists.txt b/Tests/SimpleCOnly/CMakeLists.txt
index d0ed651b1..fb247790f 100644
--- a/Tests/SimpleCOnly/CMakeLists.txt
+++ b/Tests/SimpleCOnly/CMakeLists.txt
@@ -14,4 +14,4 @@ message(STATUS "sizeof(float): ${SIZE_FLOAT}")
 # make sure optimized libs are not used by debug builds
 if(CMAKE_BUILD_TYPE MATCHES Debug)
   target_link_libraries(Simple optimized c:/not/here.lib )
-endif(CMAKE_BUILD_TYPE MATCHES Debug)
+endif()
diff --git a/Tests/SimpleExclude/run.cmake.in b/Tests/SimpleExclude/run.cmake.in
index 8f83380c8..d31d2e51b 100644
--- a/Tests/SimpleExclude/run.cmake.in
+++ b/Tests/SimpleExclude/run.cmake.in
@@ -8,6 +8,6 @@ message("T9 ${t9_name} resulted ${t9_var}")
 
 if ( "${t4_var}" EQUAL "0" AND "${t9_var}" EQUAL "0" )
   message("Everything is good, Yoshimi won...")
-else ( "${t4_var}" EQUAL "0" AND "${t9_var}" EQUAL "0" )
+else ()
   message(FATAL_ERROR "Yoshimi lost... The evil pink robots will take over the world")
-endif ( "${t4_var}" EQUAL "0" AND "${t9_var}" EQUAL "0" )
+endif ()
diff --git a/Tests/SimpleInstall/CMakeLists.txt b/Tests/SimpleInstall/CMakeLists.txt
index f05587eb2..479d6ec36 100644
--- a/Tests/SimpleInstall/CMakeLists.txt
+++ b/Tests/SimpleInstall/CMakeLists.txt
@@ -40,13 +40,13 @@ if(STAGE2)
   include(${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake OPTIONAL)
   if(CMAKE_INSTALL_SCRIPT_DID_RUN)
     message(STATUS "Stage 1 did run install script 2.")
-  else(CMAKE_INSTALL_SCRIPT_DID_RUN)
+  else()
     message(SEND_ERROR "Stage 1 did not run install script 2.")
-  endif(CMAKE_INSTALL_SCRIPT_DID_RUN)
+  endif()
 
   if(CYGWIN OR MINGW)
     set(LIBPATHS ${LIBPATHS} "${CMAKE_INSTALL_PREFIX}/MyTest/bin")
-  endif(CYGWIN OR MINGW)
+  endif()
   message("Search for library in: ${LIBPATHS}")
 
   set(TEST1_LIBRARY "TEST1_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE)
@@ -77,44 +77,44 @@ if(STAGE2)
 
   if("${TEST1_LIBRARY}" MATCHES "static")
     message(STATUS "test1 correctly found in lib/static")
-  else("${TEST1_LIBRARY}" MATCHES "static")
+  else()
     message(SEND_ERROR "test1 not found in lib/static!")
-  endif("${TEST1_LIBRARY}" MATCHES "static")
+  endif()
 
   # Check for failure of configuration-specific installation.
   if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h")
     message(FATAL_ERROR "Debug-configuration file installed for Release!")
-  endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h")
+  endif()
   if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h")
     message(FATAL_ERROR "Release-configuration file installed for Debug!")
-  endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h")
+  endif()
 
   # Check for failure of directory installation.
   if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h")
     message(FATAL_ERROR "Directory installation did not install TSD.h")
-  endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h")
+  endif()
   if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS")
     message(FATAL_ERROR "Directory installation installed CVS directory.")
-  endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS")
+  endif()
   if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS")
     message(FATAL_ERROR "Directory installation installed CVS directory.")
-  endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS")
+  endif()
   if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt")
     message(FATAL_ERROR "Directory installation installed CMakeLists.txt.")
-  endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt")
+  endif()
   if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h")
     message(FATAL_ERROR "Directory installation did not install alternate TSD.h")
-  endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h")
+  endif()
   if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx")
     message(FATAL_ERROR "Directory installation installed alternate TSD.cxx")
-  endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx")
+  endif()
 
   # Check that scripts properly installed.
   if(WIN32 AND NOT CYGWIN)
     set(BAT .bat)
-  else(WIN32 AND NOT CYGWIN)
+  else()
     set(BAT)
-  endif(WIN32 AND NOT CYGWIN)
+  endif()
   foreach(loc share share/old1 share/old2 share/old3 share/alt)
     set(CUR_SCRIPT "${CMAKE_INSTALL_PREFIX}/MyTest/${loc}/sample_script${BAT}")
     execute_process(
@@ -125,21 +125,21 @@ if(STAGE2)
     if(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$")
       message(FATAL_ERROR
         "Sample script [${CUR_SCRIPT}] failed: [${SAMPLE_SCRIPT_RESULT}]")
-    endif(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$")
+    endif()
     if(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output")
       message(FATAL_ERROR
         "Bad sample script [${CUR_SCRIPT}] output: [${SAMPLE_SCRIPT_OUTPUT}]")
-    endif(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output")
-  endforeach(loc)
+    endif()
+  endforeach()
 
   # Check for failure of empty directory installation.
   if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty")
     message(FATAL_ERROR "Empty directory installation did not install.")
-  endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty")
+  endif()
   file(GLOB EMPTY_FILES "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty/*")
   if(EMPTY_FILES)
     message(FATAL_ERROR "Empty directory installed [${EMPTY_FILES}].")
-  endif(EMPTY_FILES)
+  endif()
 
   # Make sure the test executable can run from the install tree.
   set_target_properties(SimpleInstExeS2 PROPERTIES
@@ -153,9 +153,9 @@ if(STAGE2)
   get_target_property(simpleInstallImported S1_SimpleInstall IMPORTED)
   if(NOT simpleInstallImported)
     message(FATAL_ERROR "Target S1_SimpleInstall could not be imported")
-  endif(NOT simpleInstallImported)
+  endif()
 
-else(STAGE2)
+else()
   # Wipe out the install directory to do a fresh test.
   file(REMOVE_RECURSE ${CMAKE_INSTALL_PREFIX}/MyTest)
 
@@ -177,7 +177,7 @@ else(STAGE2)
   # Disable VERSION test until it is implemented in the Xcode generator.
   if(NOT XCODE)
     set_target_properties(SimpleInstall PROPERTIES VERSION 1.2)
-  endif(NOT XCODE)
+  endif()
 
   # Make sure the test executable can run from the install tree.
   set_target_properties(SimpleInstall PROPERTIES
@@ -190,7 +190,7 @@ else(STAGE2)
   if(CMAKE_GENERATOR MATCHES "Makefiles")
     add_subdirectory(TestSubDir)
     add_dependencies(SimpleInstall TSD)
-  endif(CMAKE_GENERATOR MATCHES "Makefiles")
+  endif()
 
   add_dependencies(SimpleInstall test3)
   add_dependencies(test2 test3)
@@ -305,13 +305,13 @@ else(STAGE2)
     ${CMAKE_CURRENT_SOURCE_DIR}/PostInstall.cmake)
   set_target_properties(test4 PROPERTIES VERSION 1.2 SOVERSION 3
         INSTALL_NAME_DIR @executable_path/../lib)
-endif(STAGE2)
+endif()
 
 if(CMAKE_CONFIGURATION_TYPES)
   set(SI_CONFIG -C ${CMAKE_CFG_INTDIR})
-else(CMAKE_CONFIGURATION_TYPES)
+else()
   set(SI_CONFIG)
-endif(CMAKE_CONFIGURATION_TYPES)
+endif()
 
 # Dummy test of CPack
 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Test of packaging with cpack")
@@ -325,8 +325,8 @@ if(WIN32 AND NOT UNIX)
     )
   if(NOT NSIS_MAKENSIS)
     set(CPACK_GENERATOR TGZ)
-  endif(NOT NSIS_MAKENSIS)
-endif(WIN32 AND NOT UNIX)
+  endif()
+endif()
 if(UNIX AND NOT APPLE)
   set(CPACK_GENERATOR "TGZ;STGZ;TZ")
   #  find_program(found_compress
@@ -335,31 +335,31 @@ if(UNIX AND NOT APPLE)
   #    find_program(file_command NAMES file)
   #    if(NOT file_command)
   #      set(file_command file)
-  #    endif(NOT file_command)
+  #    endif()
   #    execute_process(COMMAND ${file_command} ${found_compress}
   #      OUTPUT_VARIABLE output)
   #    set(SKIP_TZ FALSE)
   #    if("${output}" MATCHES "script")
   #      set(SKIP_TZ TRUE)
-  #    endif("${output}" MATCHES "script")
+  #    endif()
   #    if("${output}" MATCHES "dummy.sh")
   #      set(SKIP_TZ TRUE)
-  #    endif("${output}" MATCHES "dummy.sh")
+  #    endif()
   #    if(NOT SKIP_TZ)
   #      message("compress found and it was not a script")
   #      message("output from file command: [${output}]")
   #      set(CPACK_GENERATOR "${CPACK_GENERATOR};TZ")
-  #    else(NOT SKIP_TZ)
+  #    else()
   #      message("compress found, but it was a script so dont use it")
   #      message("output from file command: [${output}]")
-  #    endif(NOT SKIP_TZ)
-  #  endif(found_compress)
+  #    endif()
+  #  endif()
   find_program(found_bz2
     NAMES bzip2)
   if(found_bz2)
     set(CPACK_GENERATOR "${CPACK_GENERATOR};TBZ2")
-  endif(found_bz2)
-endif(UNIX AND NOT APPLE)
+  endif()
+endif()
 
 set(CPACK_PACKAGE_EXECUTABLES "SimpleInstall" "Simple Install")
 set(CMAKE_INSTALL_MFC_LIBRARIES 1)
@@ -374,9 +374,9 @@ if(CTEST_TEST_CPACK)
   #
   set(CPACK_BINARY_ZIP OFF)
   set(CPACK_MONOLITHIC_INSTALL ON)
-else(CTEST_TEST_CPACK)
+else()
   set(PACKAGE_TARGET)
-endif(CTEST_TEST_CPACK)
+endif()
 
 include(CPack)
 
diff --git a/Tests/SimpleInstall/InstallScript1.cmake b/Tests/SimpleInstall/InstallScript1.cmake
index 85465bfed..ef9da5761 100644
--- a/Tests/SimpleInstall/InstallScript1.cmake
+++ b/Tests/SimpleInstall/InstallScript1.cmake
@@ -2,4 +2,4 @@ message("This is install script 1.")
 set(INSTALL_SCRIPT_1_DID_RUN 1)
 if(INSTALL_CODE_DID_RUN)
   message(FATAL_ERROR "Install script 1 did not run before install code.")
-endif(INSTALL_CODE_DID_RUN)
+endif()
diff --git a/Tests/SimpleInstall/InstallScript2.cmake b/Tests/SimpleInstall/InstallScript2.cmake
index a675df7ea..c1d20a3a6 100644
--- a/Tests/SimpleInstall/InstallScript2.cmake
+++ b/Tests/SimpleInstall/InstallScript2.cmake
@@ -1,14 +1,14 @@
 message("This is install script 2.")
 if(INSTALL_SCRIPT_1_DID_RUN)
   message("Install script ordering works.")
-else(INSTALL_SCRIPT_1_DID_RUN)
+else()
   message(FATAL_ERROR "Install script 1 did not run before install script 2.")
-endif(INSTALL_SCRIPT_1_DID_RUN)
+endif()
 if(INSTALL_CODE_DID_RUN)
   message("Install code ordering works.")
-else(INSTALL_CODE_DID_RUN)
+else()
   message(FATAL_ERROR "Install script 2 did not run after install code.")
-endif(INSTALL_CODE_DID_RUN)
+endif()
 file(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake"
   "set(CMAKE_INSTALL_SCRIPT_DID_RUN 1)\n"
   )
diff --git a/Tests/SimpleInstall/InstallScript3.cmake b/Tests/SimpleInstall/InstallScript3.cmake
index a955be146..64851564d 100644
--- a/Tests/SimpleInstall/InstallScript3.cmake
+++ b/Tests/SimpleInstall/InstallScript3.cmake
@@ -2,11 +2,11 @@ message("This is install script 3.")
 set(INSTALL_SCRIPT_3_DID_RUN 1)
 if(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
   message(FATAL_ERROR "Install script 3 did not run before install code with component.")
-endif(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
+endif()
 
 if(CMAKE_INSTALL_COMPONENT)
 if(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
   message("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"")
   message(FATAL_ERROR "Install script 3 should only run for \"Development\" INSTALL COMPONENT.")
-endif(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
-endif(CMAKE_INSTALL_COMPONENT)
+endif()
+endif()
diff --git a/Tests/SimpleInstall/InstallScript4.cmake b/Tests/SimpleInstall/InstallScript4.cmake
index 0bbd9d2c8..34d0a73bb 100644
--- a/Tests/SimpleInstall/InstallScript4.cmake
+++ b/Tests/SimpleInstall/InstallScript4.cmake
@@ -1,21 +1,21 @@
 message("This is install script 4.")
 if(INSTALL_SCRIPT_3_DID_RUN)
   message("Install script ordering works.")
-else(INSTALL_SCRIPT_3_DID_RUN)
+else()
   message(FATAL_ERROR "Install script 3 did not run before install script 4.")
-endif(INSTALL_SCRIPT_3_DID_RUN)
+endif()
 if(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
   message("Install code ordering works.")
-else(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
+else()
   message(FATAL_ERROR "Install script 4 did not run after install with component code.")
-endif(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
+endif()
 
 if(CMAKE_INSTALL_COMPONENT)
 if(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
   message("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"")
   message(FATAL_ERROR "Install script 4 should only run for \"Development\" INSTALL COMPONENT.")
-endif(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
-endif(CMAKE_INSTALL_COMPONENT)
+endif()
+endif()
 
 file(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScript4Out.cmake"
   "set(CMAKE_INSTALL_SCRIPT_4_DID_RUN 1)\n"
diff --git a/Tests/SimpleInstall/PackageScript.cmake b/Tests/SimpleInstall/PackageScript.cmake
index be07f89cc..53b790932 100644
--- a/Tests/SimpleInstall/PackageScript.cmake
+++ b/Tests/SimpleInstall/PackageScript.cmake
@@ -6,5 +6,5 @@ get_cmake_property(res VARIABLES)
 foreach(var ${res})
   file(APPEND ${CMAKE_INSTALL_PREFIX}/AllVariables.txt
              "${var} \"${${var}}\"\n")
-endforeach(var ${res})
+endforeach()
 
diff --git a/Tests/SimpleInstall/PostInstall.cmake b/Tests/SimpleInstall/PostInstall.cmake
index 222cc5ae9..d616221ef 100644
--- a/Tests/SimpleInstall/PostInstall.cmake
+++ b/Tests/SimpleInstall/PostInstall.cmake
@@ -1,6 +1,6 @@
 message("In post install")
 if(PRE_INSTALL_DID_RUN)
   message("Pre and post install work fine")
-else(PRE_INSTALL_DID_RUN)
+else()
   message(FATAL_ERROR "Pre install did not run before post install")
-endif(PRE_INSTALL_DID_RUN)
+endif()
diff --git a/Tests/SimpleInstallS2/CMakeLists.txt b/Tests/SimpleInstallS2/CMakeLists.txt
index f05587eb2..479d6ec36 100644
--- a/Tests/SimpleInstallS2/CMakeLists.txt
+++ b/Tests/SimpleInstallS2/CMakeLists.txt
@@ -40,13 +40,13 @@ if(STAGE2)
   include(${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake OPTIONAL)
   if(CMAKE_INSTALL_SCRIPT_DID_RUN)
     message(STATUS "Stage 1 did run install script 2.")
-  else(CMAKE_INSTALL_SCRIPT_DID_RUN)
+  else()
     message(SEND_ERROR "Stage 1 did not run install script 2.")
-  endif(CMAKE_INSTALL_SCRIPT_DID_RUN)
+  endif()
 
   if(CYGWIN OR MINGW)
     set(LIBPATHS ${LIBPATHS} "${CMAKE_INSTALL_PREFIX}/MyTest/bin")
-  endif(CYGWIN OR MINGW)
+  endif()
   message("Search for library in: ${LIBPATHS}")
 
   set(TEST1_LIBRARY "TEST1_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE)
@@ -77,44 +77,44 @@ if(STAGE2)
 
   if("${TEST1_LIBRARY}" MATCHES "static")
     message(STATUS "test1 correctly found in lib/static")
-  else("${TEST1_LIBRARY}" MATCHES "static")
+  else()
     message(SEND_ERROR "test1 not found in lib/static!")
-  endif("${TEST1_LIBRARY}" MATCHES "static")
+  endif()
 
   # Check for failure of configuration-specific installation.
   if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h")
     message(FATAL_ERROR "Debug-configuration file installed for Release!")
-  endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h")
+  endif()
   if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h")
     message(FATAL_ERROR "Release-configuration file installed for Debug!")
-  endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h")
+  endif()
 
   # Check for failure of directory installation.
   if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h")
     message(FATAL_ERROR "Directory installation did not install TSD.h")
-  endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h")
+  endif()
   if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS")
     message(FATAL_ERROR "Directory installation installed CVS directory.")
-  endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS")
+  endif()
   if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS")
     message(FATAL_ERROR "Directory installation installed CVS directory.")
-  endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS")
+  endif()
   if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt")
     message(FATAL_ERROR "Directory installation installed CMakeLists.txt.")
-  endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt")
+  endif()
   if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h")
     message(FATAL_ERROR "Directory installation did not install alternate TSD.h")
-  endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h")
+  endif()
   if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx")
     message(FATAL_ERROR "Directory installation installed alternate TSD.cxx")
-  endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx")
+  endif()
 
   # Check that scripts properly installed.
   if(WIN32 AND NOT CYGWIN)
     set(BAT .bat)
-  else(WIN32 AND NOT CYGWIN)
+  else()
     set(BAT)
-  endif(WIN32 AND NOT CYGWIN)
+  endif()
   foreach(loc share share/old1 share/old2 share/old3 share/alt)
     set(CUR_SCRIPT "${CMAKE_INSTALL_PREFIX}/MyTest/${loc}/sample_script${BAT}")
     execute_process(
@@ -125,21 +125,21 @@ if(STAGE2)
     if(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$")
       message(FATAL_ERROR
         "Sample script [${CUR_SCRIPT}] failed: [${SAMPLE_SCRIPT_RESULT}]")
-    endif(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$")
+    endif()
     if(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output")
       message(FATAL_ERROR
         "Bad sample script [${CUR_SCRIPT}] output: [${SAMPLE_SCRIPT_OUTPUT}]")
-    endif(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output")
-  endforeach(loc)
+    endif()
+  endforeach()
 
   # Check for failure of empty directory installation.
   if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty")
     message(FATAL_ERROR "Empty directory installation did not install.")
-  endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty")
+  endif()
   file(GLOB EMPTY_FILES "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty/*")
   if(EMPTY_FILES)
     message(FATAL_ERROR "Empty directory installed [${EMPTY_FILES}].")
-  endif(EMPTY_FILES)
+  endif()
 
   # Make sure the test executable can run from the install tree.
   set_target_properties(SimpleInstExeS2 PROPERTIES
@@ -153,9 +153,9 @@ if(STAGE2)
   get_target_property(simpleInstallImported S1_SimpleInstall IMPORTED)
   if(NOT simpleInstallImported)
     message(FATAL_ERROR "Target S1_SimpleInstall could not be imported")
-  endif(NOT simpleInstallImported)
+  endif()
 
-else(STAGE2)
+else()
   # Wipe out the install directory to do a fresh test.
   file(REMOVE_RECURSE ${CMAKE_INSTALL_PREFIX}/MyTest)
 
@@ -177,7 +177,7 @@ else(STAGE2)
   # Disable VERSION test until it is implemented in the Xcode generator.
   if(NOT XCODE)
     set_target_properties(SimpleInstall PROPERTIES VERSION 1.2)
-  endif(NOT XCODE)
+  endif()
 
   # Make sure the test executable can run from the install tree.
   set_target_properties(SimpleInstall PROPERTIES
@@ -190,7 +190,7 @@ else(STAGE2)
   if(CMAKE_GENERATOR MATCHES "Makefiles")
     add_subdirectory(TestSubDir)
     add_dependencies(SimpleInstall TSD)
-  endif(CMAKE_GENERATOR MATCHES "Makefiles")
+  endif()
 
   add_dependencies(SimpleInstall test3)
   add_dependencies(test2 test3)
@@ -305,13 +305,13 @@ else(STAGE2)
     ${CMAKE_CURRENT_SOURCE_DIR}/PostInstall.cmake)
   set_target_properties(test4 PROPERTIES VERSION 1.2 SOVERSION 3
         INSTALL_NAME_DIR @executable_path/../lib)
-endif(STAGE2)
+endif()
 
 if(CMAKE_CONFIGURATION_TYPES)
   set(SI_CONFIG -C ${CMAKE_CFG_INTDIR})
-else(CMAKE_CONFIGURATION_TYPES)
+else()
   set(SI_CONFIG)
-endif(CMAKE_CONFIGURATION_TYPES)
+endif()
 
 # Dummy test of CPack
 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Test of packaging with cpack")
@@ -325,8 +325,8 @@ if(WIN32 AND NOT UNIX)
     )
   if(NOT NSIS_MAKENSIS)
     set(CPACK_GENERATOR TGZ)
-  endif(NOT NSIS_MAKENSIS)
-endif(WIN32 AND NOT UNIX)
+  endif()
+endif()
 if(UNIX AND NOT APPLE)
   set(CPACK_GENERATOR "TGZ;STGZ;TZ")
   #  find_program(found_compress
@@ -335,31 +335,31 @@ if(UNIX AND NOT APPLE)
   #    find_program(file_command NAMES file)
   #    if(NOT file_command)
   #      set(file_command file)
-  #    endif(NOT file_command)
+  #    endif()
   #    execute_process(COMMAND ${file_command} ${found_compress}
   #      OUTPUT_VARIABLE output)
   #    set(SKIP_TZ FALSE)
   #    if("${output}" MATCHES "script")
   #      set(SKIP_TZ TRUE)
-  #    endif("${output}" MATCHES "script")
+  #    endif()
   #    if("${output}" MATCHES "dummy.sh")
   #      set(SKIP_TZ TRUE)
-  #    endif("${output}" MATCHES "dummy.sh")
+  #    endif()
   #    if(NOT SKIP_TZ)
   #      message("compress found and it was not a script")
   #      message("output from file command: [${output}]")
   #      set(CPACK_GENERATOR "${CPACK_GENERATOR};TZ")
-  #    else(NOT SKIP_TZ)
+  #    else()
   #      message("compress found, but it was a script so dont use it")
   #      message("output from file command: [${output}]")
-  #    endif(NOT SKIP_TZ)
-  #  endif(found_compress)
+  #    endif()
+  #  endif()
   find_program(found_bz2
     NAMES bzip2)
   if(found_bz2)
     set(CPACK_GENERATOR "${CPACK_GENERATOR};TBZ2")
-  endif(found_bz2)
-endif(UNIX AND NOT APPLE)
+  endif()
+endif()
 
 set(CPACK_PACKAGE_EXECUTABLES "SimpleInstall" "Simple Install")
 set(CMAKE_INSTALL_MFC_LIBRARIES 1)
@@ -374,9 +374,9 @@ if(CTEST_TEST_CPACK)
   #
   set(CPACK_BINARY_ZIP OFF)
   set(CPACK_MONOLITHIC_INSTALL ON)
-else(CTEST_TEST_CPACK)
+else()
   set(PACKAGE_TARGET)
-endif(CTEST_TEST_CPACK)
+endif()
 
 include(CPack)
 
diff --git a/Tests/SimpleInstallS2/InstallScript1.cmake b/Tests/SimpleInstallS2/InstallScript1.cmake
index 85465bfed..ef9da5761 100644
--- a/Tests/SimpleInstallS2/InstallScript1.cmake
+++ b/Tests/SimpleInstallS2/InstallScript1.cmake
@@ -2,4 +2,4 @@ message("This is install script 1.")
 set(INSTALL_SCRIPT_1_DID_RUN 1)
 if(INSTALL_CODE_DID_RUN)
   message(FATAL_ERROR "Install script 1 did not run before install code.")
-endif(INSTALL_CODE_DID_RUN)
+endif()
diff --git a/Tests/SimpleInstallS2/InstallScript2.cmake b/Tests/SimpleInstallS2/InstallScript2.cmake
index a675df7ea..c1d20a3a6 100644
--- a/Tests/SimpleInstallS2/InstallScript2.cmake
+++ b/Tests/SimpleInstallS2/InstallScript2.cmake
@@ -1,14 +1,14 @@
 message("This is install script 2.")
 if(INSTALL_SCRIPT_1_DID_RUN)
   message("Install script ordering works.")
-else(INSTALL_SCRIPT_1_DID_RUN)
+else()
   message(FATAL_ERROR "Install script 1 did not run before install script 2.")
-endif(INSTALL_SCRIPT_1_DID_RUN)
+endif()
 if(INSTALL_CODE_DID_RUN)
   message("Install code ordering works.")
-else(INSTALL_CODE_DID_RUN)
+else()
   message(FATAL_ERROR "Install script 2 did not run after install code.")
-endif(INSTALL_CODE_DID_RUN)
+endif()
 file(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake"
   "set(CMAKE_INSTALL_SCRIPT_DID_RUN 1)\n"
   )
diff --git a/Tests/SimpleInstallS2/InstallScript3.cmake b/Tests/SimpleInstallS2/InstallScript3.cmake
index a955be146..64851564d 100644
--- a/Tests/SimpleInstallS2/InstallScript3.cmake
+++ b/Tests/SimpleInstallS2/InstallScript3.cmake
@@ -2,11 +2,11 @@ message("This is install script 3.")
 set(INSTALL_SCRIPT_3_DID_RUN 1)
 if(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
   message(FATAL_ERROR "Install script 3 did not run before install code with component.")
-endif(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
+endif()
 
 if(CMAKE_INSTALL_COMPONENT)
 if(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
   message("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"")
   message(FATAL_ERROR "Install script 3 should only run for \"Development\" INSTALL COMPONENT.")
-endif(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
-endif(CMAKE_INSTALL_COMPONENT)
+endif()
+endif()
diff --git a/Tests/SimpleInstallS2/InstallScript4.cmake b/Tests/SimpleInstallS2/InstallScript4.cmake
index 0bbd9d2c8..34d0a73bb 100644
--- a/Tests/SimpleInstallS2/InstallScript4.cmake
+++ b/Tests/SimpleInstallS2/InstallScript4.cmake
@@ -1,21 +1,21 @@
 message("This is install script 4.")
 if(INSTALL_SCRIPT_3_DID_RUN)
   message("Install script ordering works.")
-else(INSTALL_SCRIPT_3_DID_RUN)
+else()
   message(FATAL_ERROR "Install script 3 did not run before install script 4.")
-endif(INSTALL_SCRIPT_3_DID_RUN)
+endif()
 if(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
   message("Install code ordering works.")
-else(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
+else()
   message(FATAL_ERROR "Install script 4 did not run after install with component code.")
-endif(INSTALL_CODE_WITH_COMPONENT_DID_RUN)
+endif()
 
 if(CMAKE_INSTALL_COMPONENT)
 if(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
   message("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"")
   message(FATAL_ERROR "Install script 4 should only run for \"Development\" INSTALL COMPONENT.")
-endif(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development")
-endif(CMAKE_INSTALL_COMPONENT)
+endif()
+endif()
 
 file(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScript4Out.cmake"
   "set(CMAKE_INSTALL_SCRIPT_4_DID_RUN 1)\n"
diff --git a/Tests/SimpleInstallS2/PackageScript.cmake b/Tests/SimpleInstallS2/PackageScript.cmake
index be07f89cc..53b790932 100644
--- a/Tests/SimpleInstallS2/PackageScript.cmake
+++ b/Tests/SimpleInstallS2/PackageScript.cmake
@@ -6,5 +6,5 @@ get_cmake_property(res VARIABLES)
 foreach(var ${res})
   file(APPEND ${CMAKE_INSTALL_PREFIX}/AllVariables.txt
              "${var} \"${${var}}\"\n")
-endforeach(var ${res})
+endforeach()
 
diff --git a/Tests/SimpleInstallS2/PostInstall.cmake b/Tests/SimpleInstallS2/PostInstall.cmake
index 222cc5ae9..d616221ef 100644
--- a/Tests/SimpleInstallS2/PostInstall.cmake
+++ b/Tests/SimpleInstallS2/PostInstall.cmake
@@ -1,6 +1,6 @@
 message("In post install")
 if(PRE_INSTALL_DID_RUN)
   message("Pre and post install work fine")
-else(PRE_INSTALL_DID_RUN)
+else()
   message(FATAL_ERROR "Pre install did not run before post install")
-endif(PRE_INSTALL_DID_RUN)
+endif()
diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt
index 0af11f75b..6d798b067 100644
--- a/Tests/StringFileTest/CMakeLists.txt
+++ b/Tests/StringFileTest/CMakeLists.txt
@@ -10,9 +10,9 @@ file(READ "${CMAKE_CURRENT_SOURCE_DIR}/test.bin" hexContents HEX)
 
 if("${hexContents}" STREQUAL "0001027700")
   message("file(READ HEX) correctly read [${hexContents}]")
-else("${hexContents}" STREQUAL "0001027700")
+else()
   message(SEND_ERROR "file(READ HEX) incorrectly read [${hexContents}], but expected was [0001027700]")
-endif("${hexContents}" STREQUAL "0001027700")
+endif()
 
 # file(STRINGS) test
 file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in" infile_strings
@@ -21,17 +21,17 @@ file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in" infile_strings
 set(infile_strings_goal "#include \"includefile\"\n")
 if("${infile_strings}" STREQUAL "${infile_strings_goal}")
   message("file(STRINGS) correctly read [${infile_strings}]")
-else("${infile_strings}" STREQUAL "${infile_strings_goal}")
+else()
   message(SEND_ERROR
     "file(STRINGS) incorrectly read [${infile_strings}]")
-endif("${infile_strings}" STREQUAL "${infile_strings_goal}")
+endif()
 
 # test reading a file and getting its binary data as hex string
 file(READ "${CMAKE_CURRENT_SOURCE_DIR}/main.srec" infilehex LIMIT 4 HEX)
 if(NOT "${infilehex}" STREQUAL "53313036")
   message(SEND_ERROR
     "file(READ ... HEX) error, read: \"${infilehex}\", expected \"53313036\"")
-endif(NOT "${infilehex}" STREQUAL "53313036")
+endif()
 
 
 # test that file(STRINGS) also work with Intel hex and Motorola S-record files
@@ -40,20 +40,20 @@ file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/main.ihx" infile_strings REGEX INFO)
 set(infile_strings_goal "INFO:compiler\\[SDCC-HEX\\]")
 if("${infile_strings}" MATCHES "${infile_strings_goal}")
   message("file(STRINGS) correctly read from hex file [${infile_strings}]")
-else("${infile_strings}" MATCHES "${infile_strings_goal}")
+else()
   message(SEND_ERROR
     "file(STRINGS) incorrectly read from hex file [${infile_strings}]")
-endif("${infile_strings}" MATCHES "${infile_strings_goal}")
+endif()
 
 # this file has been created with "sdcc main.c --out-fmt-s19"
 file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/main.srec" infile_strings REGEX INFO)
 set(infile_strings_goal "INFO:compiler\\[SDCC-SREC\\]")
 if("${infile_strings}" MATCHES "${infile_strings_goal}")
   message("file(STRINGS) correctly read from srec file [${infile_strings}]")
-else("${infile_strings}" MATCHES "${infile_strings_goal}")
+else()
   message(SEND_ERROR
     "file(STRINGS) incorrectly read from srec file [${infile_strings}]")
-endif("${infile_strings}" MATCHES "${infile_strings_goal}")
+endif()
 
 # String test
 string(REGEX MATCH "[cC][mM][aA][kK][eE]" rmvar "CMake is great")
@@ -75,35 +75,35 @@ string(REPLACE "Autoconf" "CMake" repvar "People should use Autoconf")
 
 if("abc" STREQUAL "xyz")
   message(SEND_ERROR "Problem with the if(STREQUAL), \"abc\" and \"xyz\" considered equal")
-endif("abc" STREQUAL "xyz")
+endif()
 
 if("CMake is cool" MATCHES "(CMake) (is).+")
   if(NOT "${CMAKE_MATCH_0}" STREQUAL "CMake is cool")
     message(SEND_ERROR "CMAKE_MATCH_0 wrong: \"${CMAKE_MATCH_0}\", expected \"CMake is cool\"")
-  endif(NOT "${CMAKE_MATCH_0}" STREQUAL "CMake is cool")
+  endif()
   if(NOT "${CMAKE_MATCH_1}" STREQUAL "CMake")
     message(SEND_ERROR "CMAKE_MATCH_1 wrong: \"${CMAKE_MATCH_1}\", expected \"CMake\"")
-  endif(NOT "${CMAKE_MATCH_1}" STREQUAL "CMake")
+  endif()
   if(NOT "${CMAKE_MATCH_2}" STREQUAL "is")
     message(SEND_ERROR "CMAKE_MATCH_2 wrong: \"${CMAKE_MATCH_2}\", expected \"is\"")
-  endif(NOT "${CMAKE_MATCH_2}" STREQUAL "is")
-else("CMake is cool" MATCHES "(CMake) (is).+")
+  endif()
+else()
   message(SEND_ERROR "Problem with the if(MATCHES), no match found")
-endif("CMake is cool" MATCHES "(CMake) (is).+")
+endif()
 
 string(REGEX MATCH "(People).+CMake" matchResultVar "People should use CMake")
 if(NOT "${matchResultVar}" STREQUAL "People should use CMake")
   message(SEND_ERROR "string(REGEX MATCH) problem: \"${matchResultVar}\", expected \"People should use CMake\"")
-endif(NOT "${matchResultVar}" STREQUAL "People should use CMake")
+endif()
 if(NOT "${CMAKE_MATCH_0}" STREQUAL "People should use CMake")
   message(SEND_ERROR "CMAKE_MATCH_0 wrong: \"${CMAKE_MATCH_0}\", expected \"People should use CMake\"")
-endif(NOT "${CMAKE_MATCH_0}" STREQUAL "People should use CMake")
+endif()
 if(NOT "${CMAKE_MATCH_1}" STREQUAL "People")
   message(SEND_ERROR "CMAKE_MATCH_1 wrong: \"${CMAKE_MATCH_1}\", expected \"People\"")
-endif(NOT "${CMAKE_MATCH_1}" STREQUAL "People")
+endif()
 if(NOT "${CMAKE_MATCH_2}" STREQUAL "")
   message(SEND_ERROR "CMAKE_MATCH_2 wrong: \"${CMAKE_MATCH_2}\", expected empty string")
-endif(NOT "${CMAKE_MATCH_2}" STREQUAL "")
+endif()
 
 
 string(STRIP "
@@ -115,10 +115,10 @@ string(STRIP "  ST3" ST3)
 foreach(var ST1 ST2 ST3)
   if("${var}" STREQUAL "${${var}}")
     message("[${var}] == [${${var}}]")
-  else("${var}" STREQUAL "${${var}}")
+  else()
     message(SEND_ERROR "Problem with the STRIP command for ${var}: [${${var}}]")
-  endif("${var}" STREQUAL "${${var}}")
-endforeach(var)
+  endif()
+endforeach()
 
 string(SUBSTRING "People should use Autoconf" 7 10 substringres)
 set(substringres "Everybody ${substringres} CMake")
@@ -139,7 +139,7 @@ message("Output: [${var}]")
 string(COMPARE EQUAL "${var}" "$(VAR1)$(VAR2)/$(VAR3)" result)
 if(NOT result)
   message(SEND_ERROR "Unquoted $(VAR) syntax is broken.")
-endif(NOT result)
+endif()
 
 # Obscure environment variable name
 set("ENV{x+(y)}" "Obscure environment variable value")
@@ -178,12 +178,12 @@ foreach(var
     tuvar
     tlvar)
   file(APPEND "${file}" "#define ${var} \"${${var}}\"\n")
-endforeach(var)
+endforeach()
 
 # Verify that the file was created recently.
 if(NOT "${file}" IS_NEWER_THAN "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in")
   message(FATAL_ERROR "if(FILE_IS_NEWER) does not seem to work.")
-endif(NOT "${file}" IS_NEWER_THAN "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in")
+endif()
 
 # Test configuration of the string
 set(TEST_DEFINED 123)
@@ -225,13 +225,13 @@ macro(TEST_RANGE ARGS CHECK)
   set(r)
   foreach(a RANGE ${ARGS})
     set(r ${r} ${a})
-  endforeach(a)
+  endforeach()
   message("FOREACH with RANGE ${ARGS} produces ${r}")
   if("x${r}x" MATCHES "^x${CHECK}x$")
-  else("x${r}x" MATCHES "^x${CHECK}x$")
+  else()
     message(SEND_ERROR "The range resulted in: ${r} should be ${CHECK}")
-  endif("x${r}x" MATCHES "^x${CHECK}x$")
-endmacro(TEST_RANGE)
+  endif()
+endmacro()
 TEST_RANGE("5" "0;1;2;3;4;5")
 TEST_RANGE("3;5" "3;4;5")
 TEST_RANGE("5;3" "5;4;3")
@@ -246,7 +246,7 @@ set(var_a)
 set(var_b)
 foreach(item IN LISTS list1 list2 ITEMS "" a "")
   set(var_${item} "${var_${item}}x")
-endforeach(item)
+endforeach()
 if(NOT "${var_}" STREQUAL "xxxxx")
   message(FATAL_ERROR "count incorrect for \"\": [${var_}]")
 endif()
@@ -267,16 +267,16 @@ string(SUBSTRING ${ST_INPUTSTRING} 9 -1 ST_NINE)
 
 if(ST_EMPTY)
   message(SEND_ERROR "SUBSTRING with length 0 does not return an empty string")
-endif(ST_EMPTY)
+endif()
 if(NOT ST_ONE STREQUAL "1")
   message(SEND_ERROR "SUBSTING command does not cut the correct selected character, was \"" ${ST_ONE} "\", should be \"1\"")
-endif(NOT ST_ONE STREQUAL "1")
+endif()
 if(NOT ST_INPUTSTRING STREQUAL ST_ALL)
   message(SEND_ERROR "SUBSTRING does not return the whole string when selected with length")
-endif(NOT ST_INPUTSTRING STREQUAL ST_ALL)
+endif()
 if(NOT ST_INPUTSTRING STREQUAL ST_ALL_MINUS)
   message(SEND_ERROR "SUBSTRING does not return the whole string when selected with -1")
-endif(NOT ST_INPUTSTRING STREQUAL ST_ALL_MINUS)
+endif()
 if(NOT ST_NINE STREQUAL "9")
   message(SEND_ERROR "SUBSTRING does not return the tail when selected with -1")
-endif(NOT ST_NINE STREQUAL "9")
+endif()
diff --git a/Tests/SubDir/CMakeLists.txt b/Tests/SubDir/CMakeLists.txt
index 2aec95635..6822e6bd9 100644
--- a/Tests/SubDir/CMakeLists.txt
+++ b/Tests/SubDir/CMakeLists.txt
@@ -7,11 +7,11 @@ if(WATCOM)
   set(PLUS_NAME_FILES
     AnotherSubdir/pair_int.int.c
     vcl_algorithm_vcl_pair_double.foo.c)
-else(WATCOM)
+else()
     set(PLUS_NAME_FILES
     AnotherSubdir/pair+int.int.c
     vcl_algorithm+vcl_pair+double.foo.c)
-endif(WATCOM)
+endif()
 
 add_executable(TestFromSubdir
   AnotherSubdir/testfromsubdir.c
@@ -23,24 +23,24 @@ aux_source_directory(ThirdSubDir SOURCES)
 if(WATCOM)
   foreach(f ${SOURCES})
     if("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
-    else("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
+    else()
       set(SOURCES2 ${f} ${SOURCES2})
-    endif("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
-  endforeach(f)
+    endif()
+  endforeach()
   set(SOURCES ${SOURCES2})
   set(SOURCES ${SOURCES}
     vcl_algorithm_vcl_pair_double.foo.c)
-else(WATCOM)
+else()
   foreach(f ${SOURCES})
     if("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
-    else("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
+    else()
       set(SOURCES2 ${f} ${SOURCES2})
       message("${f}")
-    endif("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
-  endforeach(f)
+    endif()
+  endforeach()
   set(SOURCES ${SOURCES2})
   set(SOURCES ${SOURCES}
     vcl_algorithm+vcl_pair+double.foo.c)
-endif(WATCOM)
+endif()
 message("Sources: ${SOURCES}")
 add_executable(TestWithAuxSourceDir ${SOURCES})
diff --git a/Tests/SubDirSpaces/CMakeLists.txt b/Tests/SubDirSpaces/CMakeLists.txt
index f1ace0f79..69f1d6833 100644
--- a/Tests/SubDirSpaces/CMakeLists.txt
+++ b/Tests/SubDirSpaces/CMakeLists.txt
@@ -4,7 +4,7 @@ project(SUBDIR)
 # Some systems do not seem to support rpath with spaces.
 if("${CMAKE_SYSTEM}" MATCHES "IRIX|QNX")
   set(CMAKE_SKIP_BUILD_RPATH 1)
-endif("${CMAKE_SYSTEM}" MATCHES "IRIX|QNX")
+endif()
 
 # be able to see output from make on dashboards
 set(CMAKE_VERBOSE_MAKEFILE 1)
@@ -26,9 +26,9 @@ endif()
 if(CMAKE_PAREN)
   add_definitions(-DCMAKE_PAREN=1)
   subdirs("Executable Sources" "Some(x86) Sources" EXCLUDE_FROM_ALL "Some Examples")
-else(CMAKE_PAREN)
+else()
   subdirs("Executable Sources" EXCLUDE_FROM_ALL "Some Examples")
-endif(CMAKE_PAREN)
+endif()
 
 write_file(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.")
 #WATCOM WMAKE does not support + in the name of a file!
@@ -36,11 +36,11 @@ if(WATCOM)
   set(PLUS_NAME_FILES
     "Another Subdir/pair_int.int.c"
     vcl_algorithm_vcl_pair_double.foo.c)
-else(WATCOM)
+else()
     set(PLUS_NAME_FILES
     "Another Subdir/pair+int.int.c"
     vcl_algorithm+vcl_pair+double.foo.c)
-endif(WATCOM)
+endif()
 
 add_executable(TestFromSubdir
   "Another Subdir/testfromsubdir.c"
@@ -52,26 +52,26 @@ aux_source_directory(ThirdSubDir SOURCES)
 if(WATCOM)
   foreach(f ${SOURCES})
     if("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
-    else("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
+    else()
       set(SOURCES2 ${f} ${SOURCES2})
-    endif("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
-  endforeach(f)
+    endif()
+  endforeach()
   set(SOURCES ${SOURCES2})
   set(SOURCES ${SOURCES}
     vcl_algorithm_vcl_pair_double.foo.c)
-else(WATCOM)
+else()
   foreach(f ${SOURCES})
     if("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
-    else("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
+    else()
       set(SOURCES2 ${f} ${SOURCES2})
-    endif("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
-  endforeach(f)
+    endif()
+  endforeach()
   set(SOURCES ${SOURCES2})
   set(SOURCES ${SOURCES}
     vcl_algorithm+vcl_pair+double.foo.c)
-endif(WATCOM)
+endif()
 add_executable(TestWithAuxSourceDir ${SOURCES})
 if(CMAKE_PAREN)
   target_link_libraries(TestWithAuxSourceDir testOddPath)
-endif(CMAKE_PAREN)
+endif()
 
diff --git a/Tests/SwigTest/CMakeLists.txt b/Tests/SwigTest/CMakeLists.txt
index b3017f1ab..17a502d7e 100644
--- a/Tests/SwigTest/CMakeLists.txt
+++ b/Tests/SwigTest/CMakeLists.txt
@@ -11,33 +11,33 @@ if(${language} MATCHES python)
   find_package(PythonLibs)
   include_directories(${PYTHON_INCLUDE_PATH})
   set(SWIG_LANG_LIBRARIES ${PYTHON_LIBRARIES})
-endif(${language} MATCHES python)
+endif()
 if(${language} MATCHES perl)
   find_package(PerlLibs)
   include_directories(${PERL_INCLUDE_PATH})
   add_definitions(${PERL_EXTRA_C_FLAGS})
   set(SWIG_LANG_LIBRARIES ${PERL_LIBRARY})
-endif(${language} MATCHES perl)
+endif()
 if(${language} MATCHES tcl)
   find_package(TCL)
   include_directories(${TCL_INCLUDE_PATH})
   set(SWIG_LANG_LIBRARIES ${TCL_LIBRARY})
-endif(${language} MATCHES tcl)
+endif()
 if(${language} MATCHES ruby)
   find_package(Ruby)
   include_directories(${RUBY_INCLUDE_PATH})
   set(SWIG_LANG_LIBRARIES ${RUBY_LIBRARY})
-endif(${language} MATCHES ruby)
+endif()
 if(${language} MATCHES php4)
   find_package(PHP4)
   include_directories(${PHP4_INCLUDE_PATH})
   set(SWIG_LANG_LIBRARIES ${PHP4_LIBRARY})
-endif(${language} MATCHES php4)
+endif()
 if(${language} MATCHES pike)
   find_package(Pike)
   include_directories(${PIKE_INCLUDE_PATH})
   set(SWIG_LANG_LIBRARIES ${PIKE_LIBRARY})
-endif(${language} MATCHES pike)
+endif()
 
 include_directories(${CMAKE_CURRENT_SOURCE_DIR})
 
diff --git a/Tests/SystemInformation/CMakeLists.txt b/Tests/SystemInformation/CMakeLists.txt
index c29f3e863..838fd4aa1 100644
--- a/Tests/SystemInformation/CMakeLists.txt
+++ b/Tests/SystemInformation/CMakeLists.txt
@@ -16,7 +16,7 @@ add_executable(SystemInformation DumpInformation.cxx)
 
 macro(FOO args)
   message("Test macro")
-endmacro(FOO)
+endmacro()
 
 FOO(lala)
 
@@ -25,34 +25,34 @@ get_cmake_property(res VARIABLES)
 foreach(var ${res})
   file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt
              "${var} \"${${var}}\"\n")
-endforeach(var ${res})
+endforeach()
 
 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllCommands.txt "")
 get_cmake_property(res COMMANDS)
 foreach(var ${res})
   file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllCommands.txt
              "${var}\n")
-endforeach(var ${res})
+endforeach()
 
 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt "")
 get_cmake_property(res MACROS)
 foreach(var ${res})
   file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt
              "${var}\n")
-endforeach(var ${res})
+endforeach()
 
 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt "")
 get_directory_property(res INCLUDE_DIRECTORIES)
 foreach(var ${res})
   file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt
     "INCLUDE_DIRECTORY: ${var}\n")
-endforeach(var)
+endforeach()
 
 get_directory_property(res LINK_DIRECTORIES)
 foreach(var ${res})
   file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt
     "LINK_DIRECTORIES: ${var}\n")
-endforeach(var)
+endforeach()
 
 get_directory_property(res INCLUDE_REGULAR_EXPRESSION)
 file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt
diff --git a/Tests/TarTest/CMakeLists.txt b/Tests/TarTest/CMakeLists.txt
index b1f1c6dc3..bcc340bb3 100644
--- a/Tests/TarTest/CMakeLists.txt
+++ b/Tests/TarTest/CMakeLists.txt
@@ -6,15 +6,15 @@ macro(EXEC_TAR_COMMAND DIR ARGS)
   exec_program("${CMAKE_COMMAND}" "${DIR}" ARGS "-E tar ${ARGS}" RETURN_VALUE RET)
   if(${RET})
     message(FATAL_ERROR "CMake tar command failed with arguments \"${ARGS}\"")
-  endif(${RET})
-endmacro(EXEC_TAR_COMMAND)
+  endif()
+endmacro()
 
 # Create a directory structure
 set(CHECK_FILES)
 macro(COPY F1 F2)
   configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${F1}" "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${F2}" COPYONLY)
   set(CHECK_FILES ${CHECK_FILES} "${F2}")
-endmacro(COPY)
+endmacro()
 COPY("CMakeLists.txt" "f1.txt")
 COPY("CMakeLists.txt" "d1/f1.txt")
 COPY("CMakeLists.txt" "d 2/f1.txt")
@@ -26,7 +26,7 @@ COPY("CMakeLists.txt" "My Special Directory/f1.txt")
 if(UNIX)
   exec_program("ln" ARGS "-sf f1.txt \"${CMAKE_CURRENT_BINARY_DIR}/tar_dir/d1/f2.txt\"")
   set(CHECK_FILES ${CHECK_FILES} "d1/f2.txt")
-endif(UNIX)
+endif()
 
 # cleanup first in case there are files left from previous runs
 # if the umask is odd on the machine it might create files that
@@ -54,14 +54,14 @@ macro(CHECK_DIR_STRUCTURE DIR)
     set(rfile "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${file}")
     if(NOT EXISTS "${sfile}")
       message(SEND_ERROR "Cannot find file ${sfile}")
-    else(NOT EXISTS "${sfile}")
+    else()
       exec_program("${CMAKE_COMMAND}" ARGS "-E compare_files \"${sfile}\" \"${rfile}\"" RETURN_VALUE ret)
       if(${ret})
         message(SEND_ERROR "Files \"${sfile}\" \"${rfile}\" are different")
-      endif(${ret})
-    endif(NOT EXISTS "${sfile}")
-  endforeach(file)
-endmacro(CHECK_DIR_STRUCTURE)
+      endif()
+    endif()
+  endforeach()
+endmacro()
 
 CHECK_DIR_STRUCTURE("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar/tar_dir")
 
diff --git a/Tests/TargetName/scripts/CMakeLists.txt b/Tests/TargetName/scripts/CMakeLists.txt
index a693e403e..58af64d65 100644
--- a/Tests/TargetName/scripts/CMakeLists.txt
+++ b/Tests/TargetName/scripts/CMakeLists.txt
@@ -10,4 +10,4 @@ if(NOT CMAKE_BINARY_DIR STREQUAL "${CMAKE_SOURCE_DIR}")
   DEPENDS #hello_world
   ${CMAKE_CURRENT_BINARY_DIR}/hello_world
   )
-endif(NOT CMAKE_BINARY_DIR STREQUAL "${CMAKE_SOURCE_DIR}")
+endif()
diff --git a/Tests/Testing/CMakeLists.txt b/Tests/Testing/CMakeLists.txt
index 20af09bfa..8f69cbe44 100644
--- a/Tests/Testing/CMakeLists.txt
+++ b/Tests/Testing/CMakeLists.txt
@@ -20,9 +20,9 @@ set (EXECUTABLE_OUTPUT_PATH
 #
 if (EXECUTABLE_OUTPUT_PATH)
   set (CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
-else (EXECUTABLE_OUTPUT_PATH)
+else ()
   set (CXX_TEST_PATH .)
-endif (EXECUTABLE_OUTPUT_PATH)
+endif ()
 
 #
 # Include Dart
diff --git a/Tests/TryCompile/CMakeLists.txt b/Tests/TryCompile/CMakeLists.txt
index 90f878e7b..b6b66d8ee 100644
--- a/Tests/TryCompile/CMakeLists.txt
+++ b/Tests/TryCompile/CMakeLists.txt
@@ -4,26 +4,26 @@ project(TryCompile)
 macro(TEST_ASSERT value msg)
   if (NOT ${value})
     message (SEND_ERROR "Assertion failure:" ${msg} )
-  endif (NOT ${value})
-endmacro(TEST_ASSERT)
+  endif ()
+endmacro()
 
 macro(TEST_FAIL value msg)
   if (${value})
     message (SEND_ERROR "Failing test succeeded:" ${msg} )
-  endif (${value})
-endmacro(TEST_FAIL)
+  endif ()
+endmacro()
 
 macro(TEST_EXPECT_EXACT command expected)
   if(NOT "x${result}" STREQUAL "x${expected}")
     message(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"")
-  endif(NOT "x${result}" STREQUAL "x${expected}")
-endmacro(TEST_EXPECT_EXACT command expected)
+  endif()
+endmacro()
 
 macro(TEST_EXPECT_CONTAINS command expected)
   if(NOT "${result}" MATCHES "${expected}")
     message(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"")
-  endif(NOT "${result}" MATCHES "${expected}")
-endmacro(TEST_EXPECT_CONTAINS command expected)
+  endif()
+endmacro()
 
 
 # try to compile a file that should compile
@@ -37,12 +37,12 @@ try_compile(SHOULD_PASS
 
 if(NOT SHOULD_PASS)
   message(SEND_ERROR "should pass failed ${TRY_OUT}")
-endif(NOT SHOULD_PASS)
+endif()
 if(NOT EXISTS "${TryCompile_BINARY_DIR}/CopyOfPass")
    message(SEND_ERROR "COPY_FILE to \"${TryCompile_BINARY_DIR}/CopyOfPass\" failed")
-else(NOT EXISTS "${TryCompile_BINARY_DIR}/CopyOfPass")
+else()
    file(REMOVE "${TryCompile_BINARY_DIR}/CopyOfPass")
-endif(NOT EXISTS "${TryCompile_BINARY_DIR}/CopyOfPass")
+endif()
 
 # try to compile a file that should not compile
 try_compile(SHOULD_FAIL
@@ -51,7 +51,7 @@ try_compile(SHOULD_FAIL
     OUTPUT_VARIABLE TRY_OUT)
 if(SHOULD_FAIL)
    message(SEND_ERROR "Should fail passed ${TRY_OUT}")
-endif(SHOULD_FAIL)
+endif()
 
 # try to compile a file that should compile
 try_compile(SHOULD_PASS
@@ -60,7 +60,7 @@ try_compile(SHOULD_PASS
     OUTPUT_VARIABLE TRY_OUT)
 if(NOT SHOULD_PASS)
   message(SEND_ERROR "should pass failed ${TRY_OUT}")
-endif(NOT SHOULD_PASS)
+endif()
 
 # try to compile a file that should not compile
 try_compile(SHOULD_FAIL
@@ -69,42 +69,42 @@ try_compile(SHOULD_FAIL
     OUTPUT_VARIABLE TRY_OUT)
 if(SHOULD_FAIL)
    message(SEND_ERROR "Should fail passed ${TRY_OUT}")
-endif(SHOULD_FAIL)
+endif()
 
 if(NOT SHOULD_FAIL)
   if(SHOULD_PASS)
     message("All Tests passed, ignore all previous output.")
-  else(SHOULD_PASS)
+  else()
     message("Test failed")
-  endif(SHOULD_PASS)
-else(NOT SHOULD_FAIL)
+  endif()
+else()
   message("Test failed")
-endif(NOT SHOULD_FAIL)
+endif()
 try_compile(CMAKE_ANSI_FOR_SCOPE
   ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
     ${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx OUTPUT_VARIABLE OUT)
 if (CMAKE_ANSI_FOR_SCOPE)
    message("Compiler supports ansi for")
-else(CMAKE_ANSI_FOR_SCOPE)
+else()
    message("Compiler does not support ansi for scope")
-endif(CMAKE_ANSI_FOR_SCOPE)
+endif()
 
 try_compile(CMAKE_ANSI_FOR_SCOPE
   ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
     ${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx OUTPUT_VARIABLE OUT)
 if (CMAKE_ANSI_FOR_SCOPE)
    message("Compiler supports ansi for")
-else(CMAKE_ANSI_FOR_SCOPE)
+else()
    message("Compiler does not support ansi for scope")
-endif(CMAKE_ANSI_FOR_SCOPE)
+endif()
 
 message("use the module now")
 include(${CMAKE_ROOT}/Modules/TestForANSIForScope.cmake)
 if (CMAKE_ANSI_FOR_SCOPE)
    message("Compiler supports ansi for")
-else(CMAKE_ANSI_FOR_SCOPE)
+else()
    message("Compiler does not support ansi for scope")
-endif(CMAKE_ANSI_FOR_SCOPE)
+endif()
 
 message("Testing try_compile project mode")
 try_compile(TEST_INNER
@@ -129,18 +129,18 @@ try_run(SHOULD_RUN SHOULD_COMPILE
     OUTPUT_VARIABLE TRY_OUT)
 if(NOT SHOULD_COMPILE)
   message(SEND_ERROR "exit_success failed compiling: ${TRY_OUT}")
-endif(NOT SHOULD_COMPILE)
+endif()
 if(NOT "${SHOULD_RUN}" STREQUAL "0")
   message(SEND_ERROR "exit_success failed running with exit code ${SHOULD_RUN}")
-endif(NOT "${SHOULD_RUN}" STREQUAL "0")
+endif()
 # check the compile output for the filename
 if(NOT "${TRY_OUT}" MATCHES "exit_success")
   message(SEND_ERROR " TRY_OUT didn't contain \"exit_success\": \"${TRY_OUT}\"")
-endif(NOT "${TRY_OUT}" MATCHES "exit_success")
+endif()
 # check the run output
 if(NOT "${TRY_OUT}" MATCHES "hello world")
   message(SEND_ERROR " TRY_OUT didn't contain \"hello world\": \"${TRY_OUT}\"")
-endif(NOT "${TRY_OUT}" MATCHES "hello world")
+endif()
 
 try_run(ARG_TEST_RUN ARG_TEST_COMPILE
     ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
@@ -149,10 +149,10 @@ try_run(ARG_TEST_RUN ARG_TEST_COMPILE
     ARGS arg1 arg2)
 if(NOT ARG_TEST_COMPILE)
   message(SEND_ERROR "expect_arg failed compiling: ${TRY_OUT}")
-endif(NOT ARG_TEST_COMPILE)
+endif()
 if(NOT "${ARG_TEST_RUN}" STREQUAL "0")
   message(SEND_ERROR "expect_arg failed running with exit code ${ARG_TEST_RUN} ${TRY_OUT}")
-endif(NOT "${ARG_TEST_RUN}" STREQUAL "0")
+endif()
 
 # try to run a file that should compile and run, but return an error
 try_run(SHOULD_EXIT_WITH_ERROR SHOULD_COMPILE
@@ -163,23 +163,23 @@ try_run(SHOULD_EXIT_WITH_ERROR SHOULD_COMPILE
 
 if(NOT SHOULD_COMPILE)
   message(STATUS " exit_with_error failed compiling: ${COMPILE_OUTPUT}")
-endif(NOT SHOULD_COMPILE)
+endif()
 if("${SHOULD_EXIT_WITH_ERROR}" STREQUAL "0")
   message(SEND_ERROR " exit_with_error passed with exit code ${SHOULD_EXIT_WITH_ERROR}")
-endif("${SHOULD_EXIT_WITH_ERROR}" STREQUAL "0")
+endif()
 
 # check the compile output, it should contain the filename
 if(NOT "${COMPILE_OUTPUT}" MATCHES "exit_with_error")
   message(SEND_ERROR " COMPILE_OUT didn't contain \"exit_with_error\": \"${COMPILE_OUTPUT}\"")
-endif(NOT "${COMPILE_OUTPUT}" MATCHES "exit_with_error")
+endif()
 #... but not the run time output
 if("${COMPILE_OUTPUT}" MATCHES "hello world")
   message(SEND_ERROR " COMPILE_OUT contains the run output: \"${COMPILE_OUTPUT}\"")
-endif("${COMPILE_OUTPUT}" MATCHES "hello world")
+endif()
 # check the run output, it should stdout
 if(NOT "${RUN_OUTPUT}" MATCHES "hello world")
   message(SEND_ERROR " RUN_OUTPUT didn't contain \"hello world\": \"${RUN_OUTPUT}\"")
-endif(NOT "${RUN_OUTPUT}" MATCHES "hello world")
+endif()
 
 #######################################################################
 #
diff --git a/Tests/Tutorial/Step2/CMakeLists.txt b/Tests/Tutorial/Step2/CMakeLists.txt
index c82b7df98..cf1d30ee2 100644
--- a/Tests/Tutorial/Step2/CMakeLists.txt
+++ b/Tests/Tutorial/Step2/CMakeLists.txt
@@ -24,7 +24,7 @@ if (USE_MYMATH)
   include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions")
   add_subdirectory (MathFunctions)
   set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions)
-endif (USE_MYMATH)
+endif ()
 
 # add the executable
 add_executable (Tutorial tutorial.cxx)
diff --git a/Tests/Tutorial/Step3/CMakeLists.txt b/Tests/Tutorial/Step3/CMakeLists.txt
index 22d715041..762302bc5 100644
--- a/Tests/Tutorial/Step3/CMakeLists.txt
+++ b/Tests/Tutorial/Step3/CMakeLists.txt
@@ -24,7 +24,7 @@ if (USE_MYMATH)
   include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions")
   add_subdirectory (MathFunctions)
   set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions)
-endif (USE_MYMATH)
+endif ()
 
 # add the executable
 add_executable (Tutorial tutorial.cxx)
diff --git a/Tests/Tutorial/Step4/CMakeLists.txt b/Tests/Tutorial/Step4/CMakeLists.txt
index fbceedbcb..6994aa1ce 100644
--- a/Tests/Tutorial/Step4/CMakeLists.txt
+++ b/Tests/Tutorial/Step4/CMakeLists.txt
@@ -29,7 +29,7 @@ if (USE_MYMATH)
   include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions")
   add_subdirectory (MathFunctions)
   set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions)
-endif (USE_MYMATH)
+endif ()
 
 # add the executable
 add_executable (Tutorial tutorial.cxx)
@@ -59,7 +59,7 @@ macro (do_test arg result)
   set_tests_properties (TutorialComp${arg}
     PROPERTIES PASS_REGULAR_EXPRESSION ${result}
     )
-endmacro (do_test)
+endmacro ()
 
 # do a bunch of result based tests
 do_test (25 "25 is 5")
diff --git a/Tests/Tutorial/Step5/CMakeLists.txt b/Tests/Tutorial/Step5/CMakeLists.txt
index dcd735bd2..e40b676b4 100644
--- a/Tests/Tutorial/Step5/CMakeLists.txt
+++ b/Tests/Tutorial/Step5/CMakeLists.txt
@@ -29,7 +29,7 @@ if (USE_MYMATH)
   include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions")
   add_subdirectory (MathFunctions)
   set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions)
-endif (USE_MYMATH)
+endif ()
 
 # add the executable
 add_executable (Tutorial tutorial.cxx)
@@ -59,7 +59,7 @@ macro (do_test arg result)
   set_tests_properties (TutorialComp${arg}
     PROPERTIES PASS_REGULAR_EXPRESSION ${result}
     )
-endmacro (do_test)
+endmacro ()
 
 # do a bunch of result based tests
 do_test (4 "4 is 2")
diff --git a/Tests/Tutorial/Step6/CMakeLists.txt b/Tests/Tutorial/Step6/CMakeLists.txt
index 92a29fa37..0fb7cac5f 100644
--- a/Tests/Tutorial/Step6/CMakeLists.txt
+++ b/Tests/Tutorial/Step6/CMakeLists.txt
@@ -29,7 +29,7 @@ if (USE_MYMATH)
   include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions")
   add_subdirectory (MathFunctions)
   set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions)
-endif (USE_MYMATH)
+endif ()
 
 # add the executable
 add_executable (Tutorial tutorial.cxx)
@@ -59,7 +59,7 @@ macro (do_test arg result)
   set_tests_properties (TutorialComp${arg}
     PROPERTIES PASS_REGULAR_EXPRESSION ${result}
     )
-endmacro (do_test)
+endmacro ()
 
 # do a bunch of result based tests
 do_test (4 "4 is 2")
diff --git a/Tests/Tutorial/Step7/CMakeLists.txt b/Tests/Tutorial/Step7/CMakeLists.txt
index 898723ab9..d9a92fbef 100644
--- a/Tests/Tutorial/Step7/CMakeLists.txt
+++ b/Tests/Tutorial/Step7/CMakeLists.txt
@@ -29,7 +29,7 @@ if (USE_MYMATH)
   include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions")
   add_subdirectory (MathFunctions)
   set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions)
-endif (USE_MYMATH)
+endif ()
 
 # add the executable
 add_executable (Tutorial tutorial.cxx)
@@ -59,7 +59,7 @@ macro (do_test arg result)
   set_tests_properties (TutorialComp${arg}
     PROPERTIES PASS_REGULAR_EXPRESSION ${result}
     )
-endmacro (do_test)
+endmacro ()
 
 # do a bunch of result based tests
 do_test (4 "4 is 2")
diff --git a/Tests/Unset/CMakeLists.txt b/Tests/Unset/CMakeLists.txt
index bacb6d21f..781da3fa6 100644
--- a/Tests/Unset/CMakeLists.txt
+++ b/Tests/Unset/CMakeLists.txt
@@ -5,51 +5,51 @@ project(Unset C)
 set(x 42)
 if(NOT x EQUAL 42)
   message(FATAL_ERROR "x!=42")
-endif(NOT x EQUAL 42)
+endif()
 
 if(NOT DEFINED x)
   message(FATAL_ERROR "x should be defined!")
-endif(NOT DEFINED x)
+endif()
 
 unset(x)
 if(DEFINED x)
   message(FATAL_ERROR "x should be undefined now!")
-endif(DEFINED x)
+endif()
 
 # Local variable test unset via set()
 set(x 43)
 if(NOT x EQUAL 43)
   message(FATAL_ERROR "x!=43")
-endif(NOT x EQUAL 43)
+endif()
 set(x)
 if(DEFINED x)
   message(FATAL_ERROR "x should be undefined now!")
-endif(DEFINED x)
+endif()
 
 # Cache variable
 set(BAR "test" CACHE STRING "documentation")
 if(NOT DEFINED BAR)
   message(FATAL_ERROR "BAR not defined")
-endif(NOT DEFINED BAR)
+endif()
 
 # Test interaction of cache entries with variables.
 set(BAR "test-var")
 if(NOT "$CACHE{BAR}" STREQUAL "test")
   message(FATAL_ERROR "\$CACHE{BAR} changed by variable BAR")
-endif(NOT "$CACHE{BAR}" STREQUAL "test")
+endif()
 if(NOT "${BAR}" STREQUAL "test-var")
   message(FATAL_ERROR "\${BAR} not separate from \$CACHE{BAR}")
-endif(NOT "${BAR}" STREQUAL "test-var")
+endif()
 unset(BAR)
 if(NOT "${BAR}" STREQUAL "test")
   message(FATAL_ERROR "\${BAR} does not fall through to \$CACHE{BAR}")
-endif(NOT "${BAR}" STREQUAL "test")
+endif()
 
 # Test unsetting of CACHE entry.
 unset(BAR CACHE)
 if(DEFINED BAR)
   message(FATAL_ERROR "BAR still defined")
-endif(DEFINED BAR)
+endif()
 
 
 add_executable(Unset unset.c)
diff --git a/Tests/VSExternalInclude/CMakeLists.txt b/Tests/VSExternalInclude/CMakeLists.txt
index af0b18f2c..399ac6997 100644
--- a/Tests/VSExternalInclude/CMakeLists.txt
+++ b/Tests/VSExternalInclude/CMakeLists.txt
@@ -3,9 +3,9 @@ project(VSExternalInclude)
 
 if(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
   set(PROJECT_EXT dsp)
-else(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
+else()
   set(PROJECT_EXT vcproj)
-endif(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
+endif()
 if(${CMAKE_GENERATOR} MATCHES "Visual Studio 1[01]")
   set(PROJECT_EXT vcxproj)
 endif()
diff --git a/Tests/Wrapping/CMakeLists.txt b/Tests/Wrapping/CMakeLists.txt
index 344b11de2..22233df6f 100644
--- a/Tests/Wrapping/CMakeLists.txt
+++ b/Tests/Wrapping/CMakeLists.txt
@@ -24,9 +24,9 @@ set (EXECUTABLE_OUTPUT_PATH
 #
 if (EXECUTABLE_OUTPUT_PATH)
   set (CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
-else (EXECUTABLE_OUTPUT_PATH)
+else ()
   set (CXX_TEST_PATH .)
-endif (EXECUTABLE_OUTPUT_PATH)
+endif ()
 
 #
 # Add exe
@@ -36,7 +36,7 @@ add_executable (wrapping wrapping.cxx)
 add_executable (Wrap Wrap.c)
 if(WIN32)
   set(EXE_EXT ".exe")
-endif(WIN32)
+endif()
 set(WRAP ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/Wrap${EXE_EXT})
 
 #
@@ -75,9 +75,9 @@ if (QT_FOUND AND QT_WRAP_UI)
   target_link_libraries(qtwrapping myqtlib)
 
   target_link_libraries( qtwrapping ${QT_LIBRARIES} )
-else (QT_FOUND AND QT_WRAP_UI)
+else ()
   add_executable (qtwrapping qtnoqtmain.cxx)
-endif (QT_FOUND AND QT_WRAP_UI)
+endif ()
 
 #
 # FLTK Wrappers
diff --git a/Tests/X11/CMakeLists.txt b/Tests/X11/CMakeLists.txt
index 33ee27720..76ae58c74 100644
--- a/Tests/X11/CMakeLists.txt
+++ b/Tests/X11/CMakeLists.txt
@@ -16,9 +16,9 @@ if(APPLE)
     if(NOT EXISTS /usr/X11R6/lib//libSM.6.dylib)
       set(X11_FOUND FALSE)
       message("disable X11, because of universal binary and sysroot")
-    endif(NOT EXISTS /usr/X11R6/lib//libSM.6.dylib)
-  endif(NUMARCH GREATER 1)
-endif(APPLE)
+    endif()
+  endif()
+endif()
 
 if(X11_FOUND)
   add_definitions(-DCMAKE_HAS_X)
@@ -33,8 +33,8 @@ if(X11_FOUND)
     set(CPACK_BINARY_PACKAGEMAKER OFF CACHE BOOL "" FORCE )
     set(CPACK_PACKAGE_NAME HelloWorldX11Package)
     set(CPACK_PACKAGE_EXECUTABLES HelloWorldX11 HelloWorldX11)
-  endif(APPLE)
-endif(X11_FOUND)
+  endif()
+endif()
 
 # build a CPack driven installer package
 include(CPack)
diff --git a/Utilities/CMakeLists.txt b/Utilities/CMakeLists.txt
index 98c1cfdf5..c39be8ba8 100644
--- a/Utilities/CMakeLists.txt
+++ b/Utilities/CMakeLists.txt
@@ -68,8 +68,8 @@ macro(ADD_DOCS target dependency)
       ${CMake_BINARY_DIR}/Docs/${target}.docbook
       )
     list(APPEND HTML_FILES ${CMake_BINARY_DIR}/Docs/${target}.html)
-  endif(CMD)
-endmacro(ADD_DOCS target dependency)
+  endif()
+endmacro()
 
 # Help cmake-gui find the Qt DLLs on Windows.
 set(WIN_SHELL_GENS "Visual Studio|NMake|MinGW|Watcom|Borland")
@@ -80,7 +80,7 @@ if(BUILD_QtDialog AND "${CMAKE_GENERATOR}" MATCHES "${WIN_SHELL_GENS}"
     # Tell the macro to set the path before running cmake-gui.
     string(REPLACE ";" "\\;" _PATH "PATH=${Qt_BIN_DIR};%PATH%")
     set(cmake-gui-PATH COMMAND set "${_PATH}")
-  endif(EXISTS "${Qt_BIN_DIR}/QtCore4.dll")
+  endif()
 endif(BUILD_QtDialog AND "${CMAKE_GENERATOR}" MATCHES "${WIN_SHELL_GENS}"
   AND EXISTS "${QT_QMAKE_EXECUTABLE}" AND NOT CMAKE_NO_AUTO_QT_ENV)
 
diff --git a/Utilities/Doxygen/CMakeLists.txt b/Utilities/Doxygen/CMakeLists.txt
index ab40fdf8c..813e34daf 100644
--- a/Utilities/Doxygen/CMakeLists.txt
+++ b/Utilities/Doxygen/CMakeLists.txt
@@ -22,7 +22,7 @@ if (BUILD_DOCUMENTATION)
   #
   if(NOT DOT_PATH)
     get_filename_component(DOT_PATH ${DOT} PATH)
-  endif(NOT DOT_PATH)
+  endif()
 
   configure_file(
     ${CMake_SOURCE_DIR}/Utilities/Doxygen/doxyfile.in
@@ -36,4 +36,4 @@ if (BUILD_DOCUMENTATION)
     ${BASH}
     ${CMake_BINARY_DIR}/Utilities/Doxygen/doc_makeall.sh)
 
-endif (BUILD_DOCUMENTATION)
+endif ()
diff --git a/Utilities/KWStyle/CMakeLists.txt b/Utilities/KWStyle/CMakeLists.txt
index b08dbde6f..b2c798c0f 100644
--- a/Utilities/KWStyle/CMakeLists.txt
+++ b/Utilities/KWStyle/CMakeLists.txt
@@ -47,11 +47,11 @@ if(CMAKE_USE_KWSTYLE)
 
   if(KWSTYLE_USE_VIM_FORMAT)
     set(KWSTYLE_ARGUMENTS -vim ${KWSTYLE_ARGUMENTS})
-  endif(KWSTYLE_USE_VIM_FORMAT)
+  endif()
 
   if(KWSTYLE_USE_MSVC_FORMAT)
     set(KWSTYLE_ARGUMENTS -msvc ${KWSTYLE_ARGUMENTS})
-  endif(KWSTYLE_USE_MSVC_FORMAT)
+  endif()
 
   configure_file(${CMake_SOURCE_DIR}/Utilities/KWStyle/CMake.kws.xml.in
                ${CMake_BINARY_DIR}/CMake.kws.xml)
@@ -75,4 +75,4 @@ if(CMAKE_USE_KWSTYLE)
     )
 
   add_custom_target(StyleCheck DEPENDS ${CMake_BINARY_DIR}/KWStyleReport.txt)
-endif(CMAKE_USE_KWSTYLE)
+endif()
diff --git a/Utilities/Release/Cygwin/CMakeLists.txt b/Utilities/Release/Cygwin/CMakeLists.txt
index 6a453615f..c59a6fa94 100644
--- a/Utilities/Release/Cygwin/CMakeLists.txt
+++ b/Utilities/Release/Cygwin/CMakeLists.txt
@@ -5,9 +5,9 @@ foreach(f ${INSTALLED_CURSES})
     string(REGEX REPLACE ".*-([0-9]*).dll" "\\1" NUMBER "${f}")
     if(NUMBER GREATER MAX)
       set(MAX ${NUMBER})
-    endif(NUMBER GREATER MAX)
-  endif(NOT "${f}" MATCHES "\\+")
-endforeach(f)
+    endif()
+  endif()
+endforeach()
 string(REGEX REPLACE "/usr/bin/" "\\1" NUMBER "${f}")
 set(CMAKE_NCURSES_VERSION "libncurses${MAX}")
 message(STATUS "Using curses version: libncurses${MAX}")
diff --git a/Utilities/Release/create-cmake-release.cmake b/Utilities/Release/create-cmake-release.cmake
index c304e6777..37e223d28 100644
--- a/Utilities/Release/create-cmake-release.cmake
+++ b/Utilities/Release/create-cmake-release.cmake
@@ -32,7 +32,7 @@ ${CMAKE_COMMAND} -DCMAKE_CREATE_VERSION=${CMAKE_CREATE_VERSION} -P ${CMAKE_ROOT}
 xterm -geometry 64x6+${x}+${y} -sb -sl 2000 -T ${f}-${CMAKE_CREATE_VERSION}.log -e tail -f  ${CMAKE_CURRENT_SOURCE_DIR}/logs/${f}-${CMAKE_CREATE_VERSION}.log&
 ")
     math(EXPR i "${i}+1")
-  endforeach(f)
+  endforeach()
   execute_process(COMMAND chmod a+x ${filename})
 endfunction()
 
diff --git a/Utilities/Release/release_cmake.cmake b/Utilities/Release/release_cmake.cmake
index 04ec2e5e6..f351ac8c0 100644
--- a/Utilities/Release/release_cmake.cmake
+++ b/Utilities/Release/release_cmake.cmake
@@ -3,31 +3,31 @@ get_filename_component(SCRIPT_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH)
 # default to self extracting tgz, tgz, and tar.Z
 if(NOT DEFINED CPACK_BINARY_GENERATORS)
   set(CPACK_BINARY_GENERATORS "STGZ TGZ TZ")
-endif(NOT DEFINED CPACK_BINARY_GENERATORS)
+endif()
 if(DEFINED EXTRA_COPY)
   set(HAS_EXTRA_COPY 1)
-endif(DEFINED EXTRA_COPY)
+endif()
 if(NOT DEFINED CMAKE_RELEASE_DIRECTORY)
   set(CMAKE_RELEASE_DIRECTORY "~/CMakeReleaseDirectory")
-endif(NOT DEFINED CMAKE_RELEASE_DIRECTORY)
+endif()
 if(NOT DEFINED SCRIPT_NAME)
   set(SCRIPT_NAME "${HOST}")
-endif(NOT DEFINED SCRIPT_NAME)
+endif()
 if(NOT DEFINED MAKE_PROGRAM)
   message(FATAL_ERROR "MAKE_PROGRAM must be set")
-endif(NOT DEFINED MAKE_PROGRAM)
+endif()
 if(NOT DEFINED MAKE)
   set(MAKE "${MAKE_PROGRAM}")
-endif(NOT DEFINED MAKE)
+endif()
 if(NOT DEFINED RUN_SHELL)
   set(RUN_SHELL "/bin/sh")
-endif(NOT DEFINED RUN_SHELL)
+endif()
 if(NOT DEFINED PROCESSORS)
   set(PROCESSORS 1)
-endif(NOT DEFINED PROCESSORS)
+endif()
 if(NOT DEFINED CMAKE_CREATE_VERSION)
   message(FATAL_ERROR "CMAKE_CREATE_VERSION not defined")
-endif(NOT DEFINED CMAKE_CREATE_VERSION)
+endif()
 if(NOT DEFINED GIT_COMMAND)
   set(GIT_COMMAND git)
 endif()
@@ -40,14 +40,14 @@ endif()
 
 if(NOT DEFINED FINAL_PATH )
   set(FINAL_PATH ${CMAKE_RELEASE_DIRECTORY}/${CMAKE_CREATE_VERSION}-build)
-endif(NOT DEFINED FINAL_PATH )
+endif()
 
 if(NOT HOST)
   message(FATAL_ERROR "HOST must be specified with -DHOST=host")
-endif(NOT HOST)
+endif()
 if(NOT DEFINED MAKE)
   message(FATAL_ERROR "MAKE must be specified with -DMAKE=\"make -j2\"")
-endif(NOT DEFINED MAKE)
+endif()
 
 message("Creating CMake release ${CMAKE_CREATE_VERSION} on ${HOST} with parallel = ${PROCESSORS}")
 
@@ -57,14 +57,14 @@ macro(remote_command comment command)
   if(${ARGC} GREATER 2)
     message("ssh ${HOST} ${EXTRA_HOP} ${command}")
     execute_process(COMMAND ssh ${HOST} ${EXTRA_HOP} ${command} RESULT_VARIABLE result INPUT_FILE ${ARGV2})
-  else(${ARGC} GREATER 2)
+  else()
     message("ssh ${HOST} ${EXTRA_HOP} ${command}")
     execute_process(COMMAND ssh ${HOST} ${EXTRA_HOP} ${command} RESULT_VARIABLE result)
-  endif(${ARGC} GREATER 2)
+  endif()
   if(${result} GREATER 0)
     message(FATAL_ERROR "Error running command: ${command}, return value = ${result}")
-  endif(${result} GREATER 0)
-endmacro(remote_command)
+  endif()
+endmacro()
 
 # set this so configure file will work from script mode
 # create the script specific for the given host
@@ -75,10 +75,10 @@ configure_file(${SCRIPT_PATH}/release_cmake.sh.in ${SCRIPT_FILE} @ONLY)
 # then using the script file as input to the shell
 if(RUN_LOCAL)
   message(FATAL_ERROR "run this command: ${RUN_SHELL} ${SCRIPT_FILE}")
-else(RUN_LOCAL)
+else()
   remote_command("run release_cmake-${HOST}.sh on server"
     "${RUN_SHELL}" ${SCRIPT_FILE})
-endif(RUN_LOCAL)
+endif()
 
 # now figure out which types of packages were created
 set(generators ${CPACK_BINARY_GENERATORS} ${CPACK_SOURCE_GENERATORS})
@@ -86,30 +86,30 @@ separate_arguments(generators)
 foreach(gen ${generators})
   if("${gen}" STREQUAL "TGZ")
     set(SUFFIXES ${SUFFIXES} "*.tar.gz")
-  endif("${gen}" STREQUAL "TGZ")
+  endif()
   if("${gen}" STREQUAL "STGZ")
     set(SUFFIXES ${SUFFIXES} "*.sh")
-  endif("${gen}" STREQUAL "STGZ")
+  endif()
   if("${gen}" STREQUAL "PackageMaker")
     set(SUFFIXES ${SUFFIXES} "*.dmg")
-  endif("${gen}" STREQUAL "PackageMaker")
+  endif()
   if("${gen}" STREQUAL "TBZ2")
     set(SUFFIXES ${SUFFIXES} "*.tar.bz2")
-  endif("${gen}" STREQUAL "TBZ2")
+  endif()
   if("${gen}" MATCHES "Cygwin")
     set(SUFFIXES ${SUFFIXES} "*.tar.bz2")
     set(extra_files setup.hint)
-  endif("${gen}" MATCHES "Cygwin")
+  endif()
   if("${gen}" STREQUAL "TZ")
     set(SUFFIXES ${SUFFIXES} "*.tar.Z")
-  endif("${gen}" STREQUAL "TZ")
+  endif()
   if("${gen}" STREQUAL "ZIP")
     set(SUFFIXES ${SUFFIXES} "*.zip")
-  endif("${gen}" STREQUAL "ZIP")
+  endif()
   if("${gen}" STREQUAL "NSIS")
     set(SUFFIXES ${SUFFIXES} "*.exe")
-  endif("${gen}" STREQUAL "NSIS")
-endforeach(gen)
+  endif()
+endforeach()
 # copy all the files over from the remote machine
 set(PROJECT_PREFIX cmake-)
 foreach(suffix ${SUFFIXES})
@@ -119,8 +119,8 @@ foreach(suffix ${SUFFIXES})
     RESULT_VARIABLE result)
   if(${result} GREATER 0)
     message("error getting file back scp ${HOST}:${FINAL_PATH}/${PROJECT_PREFIX}${suffix} .")
-  endif(${result} GREATER 0)
-endforeach(suffix)
+  endif()
+endforeach()
 
 # if there are extra files to copy get them as well
 if(extra_files)
@@ -131,6 +131,6 @@ if(extra_files)
       RESULT_VARIABLE result)
     if(${result} GREATER 0)
       message("error getting file back scp ${HOST}:${FINAL_PATH}/${f} .")
-    endif(${result} GREATER 0)
-  endforeach(f)
-endif(extra_files)
+    endif()
+  endforeach()
+endif()
diff --git a/Utilities/Release/upload_release.cmake b/Utilities/Release/upload_release.cmake
index 827e683fd..9bf35236d 100644
--- a/Utilities/Release/upload_release.cmake
+++ b/Utilities/Release/upload_release.cmake
@@ -34,7 +34,7 @@ foreach(file ${FILES})
 
     math(EXPR count "${count} + 1")
   endif()
-endforeach(file)
+endforeach()
 if(${count} EQUAL 0)
    message(FATAL_ERROR "Error no files uploaded.")
 endif()
diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in
index 0005d9ef2..7cd7fc1c9 100644
--- a/cmake_uninstall.cmake.in
+++ b/cmake_uninstall.cmake.in
@@ -1,6 +1,6 @@
 if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
   message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
-endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+endif()
 
 file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
 string(REGEX REPLACE "\n" ";" files "${files}")
@@ -13,10 +13,10 @@ foreach(file ${files})
       RETURN_VALUE rm_retval
       )
     if("${rm_retval}" STREQUAL 0)
-    else("${rm_retval}" STREQUAL 0)
+    else()
       message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
-    endif("${rm_retval}" STREQUAL 0)
-  else(EXISTS "$ENV{DESTDIR}${file}")
+    endif()
+  else()
     message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
-  endif(EXISTS "$ENV{DESTDIR}${file}")
-endforeach(file)
+  endif()
+endforeach()

From 6c2c483ef9ca8e7238df07b6230e714c314e40eb Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Tue, 14 Aug 2012 07:43:11 -0400
Subject: [PATCH 5/7] Remove trailing TAB from NSIS.template.in

This was missed by commit 7bbaa428 (Remove trailing whitespace from most
CMake and C/C++ code, 2012-08-13) which only removed trailing spaces,
not TABs.
---
 Modules/NSIS.template.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Modules/NSIS.template.in b/Modules/NSIS.template.in
index 7adfe1481..9e8a6d94f 100644
--- a/Modules/NSIS.template.in
+++ b/Modules/NSIS.template.in
@@ -481,7 +481,7 @@ Loop:
 	StrCmp "$R2" "$\r" RTrim
 	StrCmp "$R2" ";" RTrim
 	GoTo Done
-RTrim:	
+RTrim:
 	StrCpy $R1 "$R1" -1
 	Goto Loop
 Done:

From 3c0488d7d3557ac3840bd6f72ba18415699b1b44 Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Tue, 14 Aug 2012 08:02:34 -0400
Subject: [PATCH 6/7] Fix WarnUnusedUnusedViaUnset test pass/fail regex

After conversion of Modules .cmake files to lower case the
FAIL_REGULAR_EXPRESSION for this test matched warnings in modules other
than the test line itself.  Make the pass and fail regular expressions
specific to the file containing the lines they are testing.
---
 Tests/CMakeLists.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 651e1b98b..9512ea6e6 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1487,9 +1487,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-project WarnUnusedUnusedViaUnset
     --build-options "--warn-unused-vars")
   set_tests_properties(WarnUnusedUnusedViaUnset PROPERTIES
-    PASS_REGULAR_EXPRESSION "CMake Warning .*:7 \\(set\\):")
+    PASS_REGULAR_EXPRESSION "CMake Warning .*VariableUnusedViaUnset.CMakeLists.txt:7 \\(set\\):")
   set_tests_properties(WarnUnusedUnusedViaUnset PROPERTIES
-    FAIL_REGULAR_EXPRESSION "CMake Warning .*:5 \\(set\\):")
+    FAIL_REGULAR_EXPRESSION "CMake Warning .*VariableUnusedViaUnset.CMakeLists.txt:5 \\(set\\):")
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaUnset")
 
   add_test(WarnUnusedCliUnused ${CMAKE_CTEST_COMMAND}

From a05eba57b50fa3224ed7579a604f9a84c44c6d02 Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Tue, 14 Aug 2012 08:25:07 -0400
Subject: [PATCH 7/7] CMakeVersion.bash: Update sed expression for lower-case
 'set'

Since commit 77543bde (Convert CMake-language commands to lower case,
2012-08-13) the CMakeVersion.cmake file contains lower-case 'set'
commands.  Teach CMakeVersion.bash to replace the lower-case name
instead of the old upper-case 'SET'.
---
 Source/CMakeVersion.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Source/CMakeVersion.bash b/Source/CMakeVersion.bash
index 126adba8e..4794e608d 100755
--- a/Source/CMakeVersion.bash
+++ b/Source/CMakeVersion.bash
@@ -3,5 +3,5 @@
 if test "x$1" = "x-f"; then shift ; n='*' ; else n='\{8\}' ; fi
 if test "$#" -gt 0; then echo 1>&2 "usage: CMakeVersion.bash [-f]"; exit 1; fi
 sed -i -e '
-s/\(^SET(CMake_VERSION_TWEAK\) [0-9]'"$n"'\(.*\)/\1 '"$(date +%Y%m%d)"'\2/
+s/\(^set(CMake_VERSION_TWEAK\) [0-9]'"$n"'\(.*\)/\1 '"$(date +%Y%m%d)"'\2/
 ' "${BASH_SOURCE%/*}/CMakeVersion.cmake"