소스 검색

Merge topic 'rst-block-comments'

75f73dde0f Utilities/Scripts: Remove temporary block-style comment conversion script
df4ed1e9ff Help: Convert remaining modules to block-style comments
7115aa6c22 Utilities/Scripts: Add temporary block-style comment conversion script

Acked-by: Kitware Robot <[email protected]>
Merge-request: !2510
Brad King 7 년 전
부모
커밋
afd928f85a
100개의 변경된 파일4870개의 추가작업 그리고 4770개의 파일을 삭제
  1. 12 11
      Modules/AddFileDependencies.cmake
  2. 41 40
      Modules/CMakeAddFortranSubdirectory.cmake
  3. 15 14
      Modules/CMakeBackwardCompatibilityCXX.cmake
  4. 22 21
      Modules/CMakeDependentOption.cmake
  5. 30 29
      Modules/CMakeDetermineVSServicePack.cmake
  6. 36 35
      Modules/CMakeExpandImportedTargets.cmake
  7. 10 9
      Modules/CMakeFindFrameworks.cmake
  8. 28 27
      Modules/CMakeFindPackageMode.cmake
  9. 64 63
      Modules/CMakeForceCompiler.cmake
  10. 120 119
      Modules/CMakeGraphVizOptions.cmake
  11. 204 203
      Modules/CMakePackageConfigHelpers.cmake
  12. 9 8
      Modules/CMakeParseArguments.cmake
  13. 38 37
      Modules/CMakePrintHelpers.cmake
  14. 9 8
      Modules/CMakePrintSystemInformation.cmake
  15. 35 34
      Modules/CMakePushCheckState.cmake
  16. 17 16
      Modules/CMakeVerifyManifest.cmake
  17. 308 307
      Modules/CPackComponent.cmake
  18. 27 26
      Modules/CPackIFWConfigureFile.cmake
  19. 64 63
      Modules/CTestCoverageCollectGCOV.cmake
  20. 8 7
      Modules/CTestScriptMode.cmake
  21. 27 26
      Modules/CTestUseLaunchers.cmake
  22. 36 35
      Modules/CheckCXXSymbolExists.cmake
  23. 23 22
      Modules/CheckFortranFunctionExists.cmake
  24. 42 41
      Modules/CheckFunctionExists.cmake
  25. 35 34
      Modules/CheckIncludeFile.cmake
  26. 34 33
      Modules/CheckIncludeFileCXX.cmake
  27. 40 39
      Modules/CheckIncludeFiles.cmake
  28. 30 29
      Modules/CheckLanguage.cmake
  29. 28 27
      Modules/CheckLibraryExists.cmake
  30. 38 37
      Modules/CheckPrototypeDefinition.cmake
  31. 37 36
      Modules/CheckStructHasMember.cmake
  32. 67 66
      Modules/CheckTypeSize.cmake
  33. 31 30
      Modules/CheckVariableExists.cmake
  34. 22 21
      Modules/Dart.cmake
  35. 9 8
      Modules/Documentation.cmake
  36. 39 38
      Modules/FindALSA.cmake
  37. 16 15
      Modules/FindASPELL.cmake
  38. 18 17
      Modules/FindAVIFile.cmake
  39. 30 29
      Modules/FindArmadillo.cmake
  40. 80 79
      Modules/FindBISON.cmake
  41. 69 68
      Modules/FindBLAS.cmake
  42. 36 35
      Modules/FindBZip2.cmake
  43. 36 35
      Modules/FindBacktrace.cmake
  44. 232 231
      Modules/FindBoost.cmake
  45. 34 33
      Modules/FindBullet.cmake
  46. 22 21
      Modules/FindCABLE.cmake
  47. 376 375
      Modules/FindCUDA.cmake
  48. 29 28
      Modules/FindCURL.cmake
  49. 22 21
      Modules/FindCVS.cmake
  50. 17 16
      Modules/FindCoin3D.cmake
  51. 17 16
      Modules/FindCups.cmake
  52. 41 40
      Modules/FindCurses.cmake
  53. 137 136
      Modules/FindCxxTest.cmake
  54. 6 5
      Modules/FindCygwin.cmake
  55. 77 76
      Modules/FindDCMTK.cmake
  56. 9 8
      Modules/FindDart.cmake
  57. 30 29
      Modules/FindDevIL.cmake
  58. 27 26
      Modules/FindEXPAT.cmake
  59. 95 94
      Modules/FindFLEX.cmake
  60. 77 76
      Modules/FindFLTK.cmake
  61. 24 23
      Modules/FindFLTK2.cmake
  62. 40 39
      Modules/FindFreetype.cmake
  63. 14 13
      Modules/FindGCCXML.cmake
  64. 24 23
      Modules/FindGDAL.cmake
  65. 23 22
      Modules/FindGIF.cmake
  66. 23 22
      Modules/FindGLEW.cmake
  67. 33 32
      Modules/FindGLUT.cmake
  68. 55 54
      Modules/FindGSL.cmake
  69. 13 12
      Modules/FindGTK.cmake
  70. 97 96
      Modules/FindGTK2.cmake
  71. 72 71
      Modules/FindGTest.cmake
  72. 56 55
      Modules/FindGettext.cmake
  73. 22 21
      Modules/FindGit.cmake
  74. 17 16
      Modules/FindGnuTLS.cmake
  75. 20 19
      Modules/FindGnuplot.cmake
  76. 104 103
      Modules/FindHDF5.cmake
  77. 23 22
      Modules/FindHSPELL.cmake
  78. 14 13
      Modules/FindHTMLHelp.cmake
  79. 40 39
      Modules/FindHg.cmake
  80. 84 83
      Modules/FindICU.cmake
  81. 141 140
      Modules/FindIce.cmake
  82. 15 14
      Modules/FindIcotool.cmake
  83. 82 81
      Modules/FindImageMagick.cmake
  84. 28 27
      Modules/FindIntl.cmake
  85. 48 47
      Modules/FindJPEG.cmake
  86. 15 14
      Modules/FindJasper.cmake
  87. 74 73
      Modules/FindJava.cmake
  88. 136 135
      Modules/FindKDE3.cmake
  89. 24 23
      Modules/FindKDE4.cmake
  90. 43 42
      Modules/FindLAPACK.cmake
  91. 51 50
      Modules/FindLATEX.cmake
  92. 32 31
      Modules/FindLTTngUST.cmake
  93. 15 14
      Modules/FindLibArchive.cmake
  94. 21 20
      Modules/FindLibLZMA.cmake
  95. 42 41
      Modules/FindLibXml2.cmake
  96. 24 23
      Modules/FindLibXslt.cmake
  97. 35 34
      Modules/FindLua.cmake
  98. 31 30
      Modules/FindLua50.cmake
  99. 32 31
      Modules/FindLua51.cmake
  100. 15 14
      Modules/FindMFC.cmake

+ 12 - 11
Modules/AddFileDependencies.cmake

@@ -1,17 +1,18 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# AddFileDependencies
-# -------------------
-#
-# Add dependencies to a source file.
-#
-# .. code-block:: cmake
-#
-#   ADD_FILE_DEPENDENCIES(<source> <files>)
-#
-# Adds the given ``<files>`` to the dependencies of file ``<source>``.
+#[=======================================================================[.rst:
+AddFileDependencies
+-------------------
+
+Add dependencies to a source file.
+
+.. code-block:: cmake
+
+  ADD_FILE_DEPENDENCIES(<source> <files>)
+
+Adds the given ``<files>`` to the dependencies of file ``<source>``.
+#]=======================================================================]
 
 macro(ADD_FILE_DEPENDENCIES _file)
 

+ 41 - 40
Modules/CMakeAddFortranSubdirectory.cmake

@@ -1,46 +1,47 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CMakeAddFortranSubdirectory
-# ---------------------------
-#
-# Use MinGW gfortran from VS if a fortran compiler is not found.
-#
-# The 'add_fortran_subdirectory' function adds a subdirectory to a
-# project that contains a fortran only sub-project.  The module will
-# check the current compiler and see if it can support fortran.  If no
-# fortran compiler is found and the compiler is MSVC, then this module
-# will find the MinGW gfortran.  It will then use an external project to
-# build with the MinGW tools.  It will also create imported targets for
-# the libraries created.  This will only work if the fortran code is
-# built into a dll, so BUILD_SHARED_LIBS is turned on in the project.
-# In addition the CMAKE_GNUtoMS option is set to on, so that the MS .lib
-# files are created.  Usage is as follows:
-#
-# ::
-#
-#   cmake_add_fortran_subdirectory(
-#    <subdir>                # name of subdirectory
-#    PROJECT <project_name>  # project name in subdir top CMakeLists.txt
-#    ARCHIVE_DIR <dir>       # dir where project places .lib files
-#    RUNTIME_DIR <dir>       # dir where project places .dll files
-#    LIBRARIES <lib>...      # names of library targets to import
-#    LINK_LIBRARIES          # link interface libraries for LIBRARIES
-#     [LINK_LIBS <lib> <dep>...]...
-#    CMAKE_COMMAND_LINE ...  # extra command line flags to pass to cmake
-#    NO_EXTERNAL_INSTALL     # skip installation of external project
-#    )
-#
-# Relative paths in ARCHIVE_DIR and RUNTIME_DIR are interpreted with
-# respect to the build directory corresponding to the source directory
-# in which the function is invoked.
-#
-# Limitations:
-#
-# NO_EXTERNAL_INSTALL is required for forward compatibility with a
-# future version that supports installation of the external project
-# binaries during "make install".
+#[=======================================================================[.rst:
+CMakeAddFortranSubdirectory
+---------------------------
+
+Use MinGW gfortran from VS if a fortran compiler is not found.
+
+The 'add_fortran_subdirectory' function adds a subdirectory to a
+project that contains a fortran only sub-project.  The module will
+check the current compiler and see if it can support fortran.  If no
+fortran compiler is found and the compiler is MSVC, then this module
+will find the MinGW gfortran.  It will then use an external project to
+build with the MinGW tools.  It will also create imported targets for
+the libraries created.  This will only work if the fortran code is
+built into a dll, so BUILD_SHARED_LIBS is turned on in the project.
+In addition the CMAKE_GNUtoMS option is set to on, so that the MS .lib
+files are created.  Usage is as follows:
+
+::
+
+  cmake_add_fortran_subdirectory(
+   <subdir>                # name of subdirectory
+   PROJECT <project_name>  # project name in subdir top CMakeLists.txt
+   ARCHIVE_DIR <dir>       # dir where project places .lib files
+   RUNTIME_DIR <dir>       # dir where project places .dll files
+   LIBRARIES <lib>...      # names of library targets to import
+   LINK_LIBRARIES          # link interface libraries for LIBRARIES
+    [LINK_LIBS <lib> <dep>...]...
+   CMAKE_COMMAND_LINE ...  # extra command line flags to pass to cmake
+   NO_EXTERNAL_INSTALL     # skip installation of external project
+   )
+
+Relative paths in ARCHIVE_DIR and RUNTIME_DIR are interpreted with
+respect to the build directory corresponding to the source directory
+in which the function is invoked.
+
+Limitations:
+
+NO_EXTERNAL_INSTALL is required for forward compatibility with a
+future version that supports installation of the external project
+binaries during "make install".
+#]=======================================================================]
 
 set(_MS_MINGW_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR})
 include(CheckLanguage)

+ 15 - 14
Modules/CMakeBackwardCompatibilityCXX.cmake

@@ -1,20 +1,21 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CMakeBackwardCompatibilityCXX
-# -----------------------------
-#
-# 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)
+#[=======================================================================[.rst:
+CMakeBackwardCompatibilityCXX
+-----------------------------
+
+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)
+#]=======================================================================]
 
 if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
   # check for some ANSI flags in the CXX compiler if it is not gnu

+ 22 - 21
Modules/CMakeDependentOption.cmake

@@ -1,27 +1,28 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CMakeDependentOption
-# --------------------
-#
-# Macro to provide an option dependent on other options.
-#
-# This macro presents an option to the user only if a set of other
-# conditions are true.  When the option is not presented a default value
-# is used, but any value set by the user is preserved for when the
-# option is presented again.  Example invocation:
-#
-# ::
-#
-#   CMAKE_DEPENDENT_OPTION(USE_FOO "Use Foo" ON
-#                          "USE_BAR;NOT USE_ZOT" OFF)
-#
-# If USE_BAR is true and USE_ZOT is false, this provides an option
-# called USE_FOO that defaults to ON.  Otherwise, it sets USE_FOO to
-# OFF.  If the status of USE_BAR or USE_ZOT ever changes, any value for
-# the USE_FOO option is saved so that when the option is re-enabled it
-# retains its old value.
+#[=======================================================================[.rst:
+CMakeDependentOption
+--------------------
+
+Macro to provide an option dependent on other options.
+
+This macro presents an option to the user only if a set of other
+conditions are true.  When the option is not presented a default value
+is used, but any value set by the user is preserved for when the
+option is presented again.  Example invocation:
+
+::
+
+  CMAKE_DEPENDENT_OPTION(USE_FOO "Use Foo" ON
+                         "USE_BAR;NOT USE_ZOT" OFF)
+
+If USE_BAR is true and USE_ZOT is false, this provides an option
+called USE_FOO that defaults to ON.  Otherwise, it sets USE_FOO to
+OFF.  If the status of USE_BAR or USE_ZOT ever changes, any value for
+the USE_FOO option is saved so that when the option is re-enabled it
+retains its old value.
+#]=======================================================================]
 
 macro(CMAKE_DEPENDENT_OPTION option doc default depends force)
   if(${option}_ISSET MATCHES "^${option}_ISSET$")

+ 30 - 29
Modules/CMakeDetermineVSServicePack.cmake

@@ -1,35 +1,36 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CMakeDetermineVSServicePack
-# ---------------------------
-#
-# Deprecated.  Do not use.
-#
-# The functionality of this module has been superseded by the
-# :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable that contains
-# the compiler version number.
-#
-# Determine the Visual Studio service pack of the 'cl' in use.
-#
-# Usage::
-#
-#   if(MSVC)
-#     include(CMakeDetermineVSServicePack)
-#     DetermineVSServicePack( my_service_pack )
-#     if( my_service_pack )
-#       message(STATUS "Detected: ${my_service_pack}")
-#     endif()
-#   endif()
-#
-# Function DetermineVSServicePack sets the given variable to one of the
-# following values or an empty string if unknown::
-#
-#   vc80, vc80sp1
-#   vc90, vc90sp1
-#   vc100, vc100sp1
-#   vc110, vc110sp1, vc110sp2, vc110sp3, vc110sp4
+#[=======================================================================[.rst:
+CMakeDetermineVSServicePack
+---------------------------
+
+Deprecated.  Do not use.
+
+The functionality of this module has been superseded by the
+:variable:`CMAKE_<LANG>_COMPILER_VERSION` variable that contains
+the compiler version number.
+
+Determine the Visual Studio service pack of the 'cl' in use.
+
+Usage::
+
+  if(MSVC)
+    include(CMakeDetermineVSServicePack)
+    DetermineVSServicePack( my_service_pack )
+    if( my_service_pack )
+      message(STATUS "Detected: ${my_service_pack}")
+    endif()
+  endif()
+
+Function DetermineVSServicePack sets the given variable to one of the
+following values or an empty string if unknown::
+
+  vc80, vc80sp1
+  vc90, vc90sp1
+  vc100, vc100sp1
+  vc110, vc110sp1, vc110sp2, vc110sp3, vc110sp4
+#]=======================================================================]
 
 if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.8)
   message(DEPRECATION

+ 36 - 35
Modules/CMakeExpandImportedTargets.cmake

@@ -1,41 +1,42 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CMakeExpandImportedTargets
-# --------------------------
-#
-# Deprecated.  Do not use.
-#
-# This module was once needed to expand imported targets to the underlying
-# libraries they reference on disk for use with the :command:`try_compile`
-# and :command:`try_run` commands.  These commands now support imported
-# libraries in their ``LINK_LIBRARIES`` options (since CMake 2.8.11
-# for :command:`try_compile` and since CMake 3.2 for :command:`try_run`).
-#
-# This module does not support the policy :policy:`CMP0022` ``NEW``
-# behavior or use of the :prop_tgt:`INTERFACE_LINK_LIBRARIES` property
-# because :manual:`generator expressions <cmake-generator-expressions(7)>`
-# cannot be evaluated during configuration.
-#
-# ::
-#
-#  CMAKE_EXPAND_IMPORTED_TARGETS(<var> LIBRARIES lib1 lib2...libN
-#                                [CONFIGURATION <config>])
-#
-# CMAKE_EXPAND_IMPORTED_TARGETS() takes a list of libraries and replaces
-# all imported targets contained in this list with their actual file
-# paths of the referenced libraries on disk, including the libraries
-# from their link interfaces.  If a CONFIGURATION is given, it uses the
-# respective configuration of the imported targets if it exists.  If no
-# CONFIGURATION is given, it uses the first configuration from
-# ${CMAKE_CONFIGURATION_TYPES} if set, otherwise ${CMAKE_BUILD_TYPE}.
-#
-# ::
-#
-#     cmake_expand_imported_targets(expandedLibs
-#       LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
-#       CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}" )
+#[=======================================================================[.rst:
+CMakeExpandImportedTargets
+--------------------------
+
+Deprecated.  Do not use.
+
+This module was once needed to expand imported targets to the underlying
+libraries they reference on disk for use with the :command:`try_compile`
+and :command:`try_run` commands.  These commands now support imported
+libraries in their ``LINK_LIBRARIES`` options (since CMake 2.8.11
+for :command:`try_compile` and since CMake 3.2 for :command:`try_run`).
+
+This module does not support the policy :policy:`CMP0022` ``NEW``
+behavior or use of the :prop_tgt:`INTERFACE_LINK_LIBRARIES` property
+because :manual:`generator expressions <cmake-generator-expressions(7)>`
+cannot be evaluated during configuration.
+
+::
+
+ CMAKE_EXPAND_IMPORTED_TARGETS(<var> LIBRARIES lib1 lib2...libN
+                               [CONFIGURATION <config>])
+
+CMAKE_EXPAND_IMPORTED_TARGETS() takes a list of libraries and replaces
+all imported targets contained in this list with their actual file
+paths of the referenced libraries on disk, including the libraries
+from their link interfaces.  If a CONFIGURATION is given, it uses the
+respective configuration of the imported targets if it exists.  If no
+CONFIGURATION is given, it uses the first configuration from
+${CMAKE_CONFIGURATION_TYPES} if set, otherwise ${CMAKE_BUILD_TYPE}.
+
+::
+
+    cmake_expand_imported_targets(expandedLibs
+      LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
+      CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}" )
+#]=======================================================================]
 
 function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT )
 

+ 10 - 9
Modules/CMakeFindFrameworks.cmake

@@ -1,15 +1,16 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CMakeFindFrameworks
-# -------------------
-#
-# helper module to find OSX frameworks
-#
-# This module reads hints about search locations from variables::
-#
-#   CMAKE_FIND_FRAMEWORK_EXTRA_LOCATIONS - Extra directories
+#[=======================================================================[.rst:
+CMakeFindFrameworks
+-------------------
+
+helper module to find OSX frameworks
+
+This module reads hints about search locations from variables::
+
+  CMAKE_FIND_FRAMEWORK_EXTRA_LOCATIONS - Extra directories
+#]=======================================================================]
 
 if(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
   set(CMAKE_FIND_FRAMEWORKS_INCLUDED 1)

+ 28 - 27
Modules/CMakeFindPackageMode.cmake

@@ -1,33 +1,34 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CMakeFindPackageMode
-# --------------------
-#
-#
-#
-# This file is executed by cmake when invoked with --find-package.  It
-# expects that the following variables are set using -D:
-#
-# ``NAME``
-#   name of the package
-# ``COMPILER_ID``
-#   the CMake compiler ID for which the result is,
-#   i.e. GNU/Intel/Clang/MSVC, etc.
-# ``LANGUAGE``
-#   language for which the result will be used,
-#   i.e. C/CXX/Fortran/ASM
-# ``MODE``
-#   ``EXIST``
-#     only check for existence of the given package
-#   ``COMPILE``
-#     print the flags needed for compiling an object file which uses
-#     the given package
-#   ``LINK``
-#     print the flags needed for linking when using the given package
-# ``QUIET``
-#   if TRUE, don't print anything
+#[=======================================================================[.rst:
+CMakeFindPackageMode
+--------------------
+
+
+
+This file is executed by cmake when invoked with --find-package.  It
+expects that the following variables are set using -D:
+
+``NAME``
+  name of the package
+``COMPILER_ID``
+  the CMake compiler ID for which the result is,
+  i.e. GNU/Intel/Clang/MSVC, etc.
+``LANGUAGE``
+  language for which the result will be used,
+  i.e. C/CXX/Fortran/ASM
+``MODE``
+  ``EXIST``
+    only check for existence of the given package
+  ``COMPILE``
+    print the flags needed for compiling an object file which uses
+    the given package
+  ``LINK``
+    print the flags needed for linking when using the given package
+``QUIET``
+  if TRUE, don't print anything
+#]=======================================================================]
 
 if(NOT NAME)
   message(FATAL_ERROR "Name of the package to be searched not specified. Set the CMake variable NAME, e.g. -DNAME=JPEG .")

+ 64 - 63
Modules/CMakeForceCompiler.cmake

@@ -1,69 +1,70 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CMakeForceCompiler
-# ------------------
-#
-# Deprecated.  Do not use.
-#
-# The macros provided by this module were once intended for use by
-# cross-compiling toolchain files when CMake was not able to automatically
-# detect the compiler identification.  Since the introduction of this module,
-# CMake's compiler identification capabilities have improved and can now be
-# taught to recognize any compiler.  Furthermore, the suite of information
-# CMake detects from a compiler is now too extensive to be provided by
-# toolchain files using these macros.
-#
-# One common use case for this module was to skip CMake's checks for a
-# working compiler when using a cross-compiler that cannot link binaries
-# without special flags or custom linker scripts.  This case is now supported
-# by setting the :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` variable in the
-# toolchain file instead.
-#
-# -------------------------------------------------------------------------
-#
-# Macro CMAKE_FORCE_C_COMPILER has the following signature:
-#
-# ::
-#
-#    CMAKE_FORCE_C_COMPILER(<compiler> <compiler-id>)
-#
-# It sets CMAKE_C_COMPILER to the given compiler and the cmake internal
-# variable CMAKE_C_COMPILER_ID to the given compiler-id.  It also
-# bypasses the check for working compiler and basic compiler information
-# tests.
-#
-# Macro CMAKE_FORCE_CXX_COMPILER has the following signature:
-#
-# ::
-#
-#    CMAKE_FORCE_CXX_COMPILER(<compiler> <compiler-id>)
-#
-# It sets CMAKE_CXX_COMPILER to the given compiler and the cmake
-# internal variable CMAKE_CXX_COMPILER_ID to the given compiler-id.  It
-# also bypasses the check for working compiler and basic compiler
-# information tests.
-#
-# Macro CMAKE_FORCE_Fortran_COMPILER has the following signature:
-#
-# ::
-#
-#    CMAKE_FORCE_Fortran_COMPILER(<compiler> <compiler-id>)
-#
-# It sets CMAKE_Fortran_COMPILER to the given compiler and the cmake
-# internal variable CMAKE_Fortran_COMPILER_ID to the given compiler-id.
-# It also bypasses the check for working compiler and basic compiler
-# information tests.
-#
-# So a simple toolchain file could look like this:
-#
-# ::
-#
-#    include (CMakeForceCompiler)
-#    set(CMAKE_SYSTEM_NAME Generic)
-#    CMAKE_FORCE_C_COMPILER   (chc12 MetrowerksHicross)
-#    CMAKE_FORCE_CXX_COMPILER (chc12 MetrowerksHicross)
+#[=======================================================================[.rst:
+CMakeForceCompiler
+------------------
+
+Deprecated.  Do not use.
+
+The macros provided by this module were once intended for use by
+cross-compiling toolchain files when CMake was not able to automatically
+detect the compiler identification.  Since the introduction of this module,
+CMake's compiler identification capabilities have improved and can now be
+taught to recognize any compiler.  Furthermore, the suite of information
+CMake detects from a compiler is now too extensive to be provided by
+toolchain files using these macros.
+
+One common use case for this module was to skip CMake's checks for a
+working compiler when using a cross-compiler that cannot link binaries
+without special flags or custom linker scripts.  This case is now supported
+by setting the :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` variable in the
+toolchain file instead.
+
+-------------------------------------------------------------------------
+
+Macro CMAKE_FORCE_C_COMPILER has the following signature:
+
+::
+
+   CMAKE_FORCE_C_COMPILER(<compiler> <compiler-id>)
+
+It sets CMAKE_C_COMPILER to the given compiler and the cmake internal
+variable CMAKE_C_COMPILER_ID to the given compiler-id.  It also
+bypasses the check for working compiler and basic compiler information
+tests.
+
+Macro CMAKE_FORCE_CXX_COMPILER has the following signature:
+
+::
+
+   CMAKE_FORCE_CXX_COMPILER(<compiler> <compiler-id>)
+
+It sets CMAKE_CXX_COMPILER to the given compiler and the cmake
+internal variable CMAKE_CXX_COMPILER_ID to the given compiler-id.  It
+also bypasses the check for working compiler and basic compiler
+information tests.
+
+Macro CMAKE_FORCE_Fortran_COMPILER has the following signature:
+
+::
+
+   CMAKE_FORCE_Fortran_COMPILER(<compiler> <compiler-id>)
+
+It sets CMAKE_Fortran_COMPILER to the given compiler and the cmake
+internal variable CMAKE_Fortran_COMPILER_ID to the given compiler-id.
+It also bypasses the check for working compiler and basic compiler
+information tests.
+
+So a simple toolchain file could look like this:
+
+::
+
+   include (CMakeForceCompiler)
+   set(CMAKE_SYSTEM_NAME Generic)
+   CMAKE_FORCE_C_COMPILER   (chc12 MetrowerksHicross)
+   CMAKE_FORCE_CXX_COMPILER (chc12 MetrowerksHicross)
+#]=======================================================================]
 
 macro(CMAKE_FORCE_C_COMPILER compiler id)
   message(DEPRECATION "The CMAKE_FORCE_C_COMPILER macro is deprecated.  "

+ 120 - 119
Modules/CMakeGraphVizOptions.cmake

@@ -1,122 +1,123 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CMakeGraphVizOptions
-# --------------------
-#
-# The builtin graphviz support of CMake.
-#
-# Variables specific to the graphviz support
-# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-#
-# CMake
-# can generate `graphviz <http://www.graphviz.org/>`_ files, showing the dependencies between the
-# targets in a project and also external libraries which are linked
-# against.  When CMake is run with the ``--graphviz=foo.dot`` option, it will
-# produce:
-#
-# * a ``foo.dot`` file showing all dependencies in the project
-# * a ``foo.dot.<target>`` file for each target, file showing on which other targets the respective target depends
-# * a ``foo.dot.<target>.dependers`` file, showing which other targets depend on the respective target
-#
-# The different dependency types ``PUBLIC``, ``PRIVATE`` and ``INTERFACE``
-# are represented as solid, dashed and dotted edges.
-#
-# This can result in huge graphs.  Using the file
-# ``CMakeGraphVizOptions.cmake`` the look and content of the generated
-# graphs can be influenced.  This file is searched first in
-# :variable:`CMAKE_BINARY_DIR` and then in :variable:`CMAKE_SOURCE_DIR`.  If found, it is
-# read and the variables set in it are used to adjust options for the
-# generated graphviz files.
-#
-# .. variable:: GRAPHVIZ_GRAPH_TYPE
-#
-#  The graph type.
-#
-#  * Mandatory : NO
-#  * Default   : "digraph"
-#
-#  Valid graph types are:
-#
-#  * "graph" : Nodes are joined with lines
-#  * "digraph" : Nodes are joined with arrows showing direction
-#  * "strict graph" : Like "graph" but max one line between each node
-#  * "strict digraph" : Like "graph" but max one line between each node in each direction
-#
-# .. variable:: GRAPHVIZ_GRAPH_NAME
-#
-#  The graph name.
-#
-#  * Mandatory : NO
-#  * Default   : "GG"
-#
-# .. variable:: GRAPHVIZ_GRAPH_HEADER
-#
-#  The header written at the top of the graphviz file.
-#
-#  * Mandatory : NO
-#  * Default   : "node [n  fontsize = "12"];"
-#
-# .. variable:: GRAPHVIZ_NODE_PREFIX
-#
-#  The prefix for each node in the graphviz file.
-#
-#  * Mandatory : NO
-#  * Default   : "node"
-#
-# .. variable:: GRAPHVIZ_EXECUTABLES
-#
-#  Set this to FALSE to exclude executables from the generated graphs.
-#
-#  * Mandatory : NO
-#  * Default   : TRUE
-#
-# .. variable:: GRAPHVIZ_STATIC_LIBS
-#
-#  Set this to FALSE to exclude static libraries from the generated graphs.
-#
-#  * Mandatory : NO
-#  * Default   : TRUE
-#
-# .. variable:: GRAPHVIZ_SHARED_LIBS
-#
-#  Set this to FALSE to exclude shared libraries from the generated graphs.
-#
-#  * Mandatory : NO
-#  * Default   : TRUE
-#
-# .. variable:: GRAPHVIZ_MODULE_LIBS
-#
-#  Set this to FALSE to exclude module libraries from the generated graphs.
-#
-#  * Mandatory : NO
-#  * Default   : TRUE
-#
-# .. variable:: GRAPHVIZ_EXTERNAL_LIBS
-#
-#  Set this to FALSE to exclude external libraries from the generated graphs.
-#
-#  * Mandatory : NO
-#  * Default   : TRUE
-#
-# .. variable:: GRAPHVIZ_IGNORE_TARGETS
-#
-#  A list of regular expressions for ignoring targets.
-#
-#  * Mandatory : NO
-#  * Default   : empty
-#
-# .. variable:: GRAPHVIZ_GENERATE_PER_TARGET
-#
-#  Set this to FALSE to exclude per target graphs ``foo.dot.<target>``.
-#
-#  * Mandatory : NO
-#  * Default   : TRUE
-#
-# .. variable:: GRAPHVIZ_GENERATE_DEPENDERS
-#
-#  Set this to FALSE to exclude depender graphs ``foo.dot.<target>.dependers``.
-#
-#  * Mandatory : NO
-#  * Default   : TRUE
+#[=======================================================================[.rst:
+CMakeGraphVizOptions
+--------------------
+
+The builtin graphviz support of CMake.
+
+Variables specific to the graphviz support
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+CMake
+can generate `graphviz <http://www.graphviz.org/>`_ files, showing the dependencies between the
+targets in a project and also external libraries which are linked
+against.  When CMake is run with the ``--graphviz=foo.dot`` option, it will
+produce:
+
+* a ``foo.dot`` file showing all dependencies in the project
+* a ``foo.dot.<target>`` file for each target, file showing on which other targets the respective target depends
+* a ``foo.dot.<target>.dependers`` file, showing which other targets depend on the respective target
+
+The different dependency types ``PUBLIC``, ``PRIVATE`` and ``INTERFACE``
+are represented as solid, dashed and dotted edges.
+
+This can result in huge graphs.  Using the file
+``CMakeGraphVizOptions.cmake`` the look and content of the generated
+graphs can be influenced.  This file is searched first in
+:variable:`CMAKE_BINARY_DIR` and then in :variable:`CMAKE_SOURCE_DIR`.  If found, it is
+read and the variables set in it are used to adjust options for the
+generated graphviz files.
+
+.. variable:: GRAPHVIZ_GRAPH_TYPE
+
+ The graph type.
+
+ * Mandatory : NO
+ * Default   : "digraph"
+
+ Valid graph types are:
+
+ * "graph" : Nodes are joined with lines
+ * "digraph" : Nodes are joined with arrows showing direction
+ * "strict graph" : Like "graph" but max one line between each node
+ * "strict digraph" : Like "graph" but max one line between each node in each direction
+
+.. variable:: GRAPHVIZ_GRAPH_NAME
+
+ The graph name.
+
+ * Mandatory : NO
+ * Default   : "GG"
+
+.. variable:: GRAPHVIZ_GRAPH_HEADER
+
+ The header written at the top of the graphviz file.
+
+ * Mandatory : NO
+ * Default   : "node [n  fontsize = "12"];"
+
+.. variable:: GRAPHVIZ_NODE_PREFIX
+
+ The prefix for each node in the graphviz file.
+
+ * Mandatory : NO
+ * Default   : "node"
+
+.. variable:: GRAPHVIZ_EXECUTABLES
+
+ Set this to FALSE to exclude executables from the generated graphs.
+
+ * Mandatory : NO
+ * Default   : TRUE
+
+.. variable:: GRAPHVIZ_STATIC_LIBS
+
+ Set this to FALSE to exclude static libraries from the generated graphs.
+
+ * Mandatory : NO
+ * Default   : TRUE
+
+.. variable:: GRAPHVIZ_SHARED_LIBS
+
+ Set this to FALSE to exclude shared libraries from the generated graphs.
+
+ * Mandatory : NO
+ * Default   : TRUE
+
+.. variable:: GRAPHVIZ_MODULE_LIBS
+
+ Set this to FALSE to exclude module libraries from the generated graphs.
+
+ * Mandatory : NO
+ * Default   : TRUE
+
+.. variable:: GRAPHVIZ_EXTERNAL_LIBS
+
+ Set this to FALSE to exclude external libraries from the generated graphs.
+
+ * Mandatory : NO
+ * Default   : TRUE
+
+.. variable:: GRAPHVIZ_IGNORE_TARGETS
+
+ A list of regular expressions for ignoring targets.
+
+ * Mandatory : NO
+ * Default   : empty
+
+.. variable:: GRAPHVIZ_GENERATE_PER_TARGET
+
+ Set this to FALSE to exclude per target graphs ``foo.dot.<target>``.
+
+ * Mandatory : NO
+ * Default   : TRUE
+
+.. variable:: GRAPHVIZ_GENERATE_DEPENDERS
+
+ Set this to FALSE to exclude depender graphs ``foo.dot.<target>.dependers``.
+
+ * Mandatory : NO
+ * Default   : TRUE
+#]=======================================================================]

+ 204 - 203
Modules/CMakePackageConfigHelpers.cmake

@@ -1,209 +1,210 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CMakePackageConfigHelpers
-# -------------------------
-#
-# Helpers functions for creating config files that can be included by other
-# projects to find and use a package.
-#
-# Adds the :command:`configure_package_config_file()` and
-# :command:`write_basic_package_version_file()` commands.
-#
-# Generating a Package Configuration File
-# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-#
-# .. command:: configure_package_config_file
-#
-#  Create a config file for a project::
-#
-#    configure_package_config_file(<input> <output>
-#      INSTALL_DESTINATION <path>
-#      [PATH_VARS <var1> <var2> ... <varN>]
-#      [NO_SET_AND_CHECK_MACRO]
-#      [NO_CHECK_REQUIRED_COMPONENTS_MACRO]
-#      [INSTALL_PREFIX <path>]
-#      )
-#
-# ``configure_package_config_file()`` should be used instead of the plain
-# :command:`configure_file()` command when creating the ``<PackageName>Config.cmake``
-# or ``<PackageName>-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.
-#
-# In a ``FooConfig.cmake`` file there may be code like this to make the install
-# destinations know to the using project:
-#
-# .. code-block:: cmake
-#
-#    set(FOO_INCLUDE_DIR   "@CMAKE_INSTALL_FULL_INCLUDEDIR@" )
-#    set(FOO_DATA_DIR   "@CMAKE_INSTALL_PREFIX@/@RELATIVE_DATA_INSTALL_DIR@" )
-#    set(FOO_ICONS_DIR   "@CMAKE_INSTALL_PREFIX@/share/icons" )
-#    #...logic to determine installedPrefix from the own location...
-#    set(FOO_CONFIG_DIR  "${installedPrefix}/@CONFIG_INSTALL_DIR@" )
-#
-# All 4 options shown above are not sufficient, since the first 3 hardcode the
-# absolute directory locations, and the 4th case works only if the logic to
-# determine the ``installedPrefix`` is correct, and if ``CONFIG_INSTALL_DIR``
-# contains a relative path, which in general cannot be guaranteed.  This has the
-# effect that the resulting ``FooConfig.cmake`` file would work poorly under
-# Windows and OSX, where users are used to choose the install location of a
-# binary package at install time, independent from how
-# :variable:`CMAKE_INSTALL_PREFIX` was set at build/cmake time.
-#
-# Using ``configure_package_config_file`` helps.  If used correctly, it makes
-# the resulting ``FooConfig.cmake`` file relocatable.  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@")`` (this must be after the
-#    ``@PACKAGE_INIT@`` line)
-# 4. instead of using the normal :command:`configure_file()`, use
-#    ``configure_package_config_file()``
-#
-#
-#
-# The ``<input>`` and ``<output>`` arguments are the input and output file, the
-# same way as in :command:`configure_file()`.
-#
-# The ``<path>`` given to ``INSTALL_DESTINATION`` must be the destination where
-# the ``FooConfig.cmake`` file will be installed to.  This path can either be
-# absolute, or relative to the ``INSTALL_PREFIX`` path.
-#
-# The variables ``<var1>`` to ``<varN>`` given as ``PATH_VARS`` are the
-# variables which contain install destinations.  For each of them the macro will
-# create a helper variable ``PACKAGE_<var...>``.  These helper variables must be
-# used in the ``FooConfig.cmake.in`` file for setting the installed location.
-# They are calculated by ``configure_package_config_file`` so that they are
-# always relative to the installed location of the package.  This works both for
-# relative and also for absolute locations.  For absolute locations it works
-# only if the absolute location is a subdirectory of ``INSTALL_PREFIX``.
-#
-# If the ``INSTALL_PREFIX`` argument is passed, this is used as base path to
-# calculate all the relative paths.  The ``<path>`` argument must be an absolute
-# path.  If this argument is not passed, the :variable:`CMAKE_INSTALL_PREFIX`
-# variable will be used instead.  The default value is good when generating a
-# FooConfig.cmake file to use your package from the install tree.  When
-# generating a FooConfig.cmake file to use your package from the build tree this
-# option should be used.
-#
-# By default ``configure_package_config_file`` also generates two helper macros,
-# ``set_and_check()`` and ``check_required_components()`` into the
-# ``FooConfig.cmake`` file.
-#
-# ``set_and_check()`` should be used instead of the normal ``set()`` command for
-# setting directories and file locations.  Additionally to setting the variable
-# it also checks that the referenced file or directory actually exists and fails
-# with a ``FATAL_ERROR`` otherwise.  This makes sure that the created
-# ``FooConfig.cmake`` file does not contain wrong references.
-# When using the ``NO_SET_AND_CHECK_MACRO``, this macro is not generated
-# into the ``FooConfig.cmake`` file.
-#
-# ``check_required_components(<PackageName>)`` should be called at the end of
-# the ``FooConfig.cmake`` file. This macro checks whether all requested,
-# non-optional components have been found, and if this is not the case, sets
-# the ``Foo_FOUND`` variable to ``FALSE``, so that the package is considered to
-# be not found.  It does that by testing the ``Foo_<Component>_FOUND``
-# variables for all requested required components.  This macro should be
-# called even if the package doesn't provide any components to make sure
-# users are not specifying components erroneously.  When using the
-# ``NO_CHECK_REQUIRED_COMPONENTS_MACRO`` option, this macro is not generated
-# into the ``FooConfig.cmake`` file.
-#
-# For an example see below the documentation for
-# :command:`write_basic_package_version_file()`.
-#
-# Generating a Package Version File
-# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-#
-# .. command:: write_basic_package_version_file
-#
-#  Create a version file for a project::
-#
-#    write_basic_package_version_file(<filename>
-#      [VERSION <major.minor.patch>]
-#      COMPATIBILITY <AnyNewerVersion|SameMajorVersion|SameMinorVersion|ExactVersion> )
-#
-#
-# Writes a file for use as ``<PackageName>ConfigVersion.cmake`` file to
-# ``<filename>``.  See the documentation of :command:`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.
-#
-# If no ``VERSION`` is given, the :variable:`PROJECT_VERSION` variable is used.
-# If this hasn't been set, it errors out.
-#
-# The ``COMPATIBILITY`` mode ``AnyNewerVersion`` means that the installed
-# package version will be considered compatible if it is newer or exactly the
-# same as the requested version.  This mode should be used for packages which
-# are fully backward compatible, also across major versions.
-# If ``SameMajorVersion`` is used instead, then the behaviour differs from
-# ``AnyNewerVersion`` in that the major version number must be the same as
-# requested, e.g.  version 2.0 will not be considered compatible if 1.0 is
-# requested.  This mode should be used for packages which guarantee backward
-# compatibility within the same major version.
-# If ``SameMinorVersion`` is used, the behaviour is the same as
-# ``SameMajorVersion``, but both major and minor version must be the same as
-# requested, e.g version 0.2 will not be compatible if 0.1 is requested.
-# If ``ExactVersion`` is used, then the package is only considered compatible if
-# the requested version matches exactly its own version number (not considering
-# the tweak version).  For example, version 1.2.3 of a package is only
-# considered compatible to requested version 1.2.3.  This mode is for packages
-# without compatibility guarantees.
-# If your project has more elaborated version matching rules, you will need to
-# write your own custom ``ConfigVersion.cmake`` file instead of using this
-# macro.
-#
-# Internally, this macro executes :command:`configure_file()` to create the
-# resulting version file.  Depending on the ``COMPATIBILITY``, the corresponding
-# ``BasicConfigVersion-<COMPATIBILITY>.cmake.in`` file is used.
-# Please note that these files are internal to CMake and you should not call
-# :command:`configure_file()` on them yourself, but they can be used as starting
-# point to create more sophisticted custom ``ConfigVersion.cmake`` files.
-#
-# Example Generating Package Files
-# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-#
-# Example using both :command:`configure_package_config_file` and
-# ``write_basic_package_version_file()``:
-#
-# ``CMakeLists.txt``:
-#
-# .. code-block:: cmake
-#
-#    set(INCLUDE_INSTALL_DIR include/ ... CACHE )
-#    set(LIB_INSTALL_DIR lib/ ... CACHE )
-#    set(SYSCONFIG_INSTALL_DIR etc/foo/ ... CACHE )
-#    #...
-#    include(CMakePackageConfigHelpers)
-#    configure_package_config_file(FooConfig.cmake.in
-#      ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake
-#      INSTALL_DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake
-#      PATH_VARS INCLUDE_INSTALL_DIR SYSCONFIG_INSTALL_DIR)
-#    write_basic_package_version_file(
-#      ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
-#      VERSION 1.2.3
-#      COMPATIBILITY SameMajorVersion )
-#    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake
-#                  ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
-#            DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake )
-#
-# ``FooConfig.cmake.in``:
-#
-# ::
-#
-#    set(FOO_VERSION x.y.z)
-#    ...
-#    @PACKAGE_INIT@
-#    ...
-#    set_and_check(FOO_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
-#    set_and_check(FOO_SYSCONFIG_DIR "@PACKAGE_SYSCONFIG_INSTALL_DIR@")
-#
-#    check_required_components(Foo)
+#[=======================================================================[.rst:
+CMakePackageConfigHelpers
+-------------------------
+
+Helpers functions for creating config files that can be included by other
+projects to find and use a package.
+
+Adds the :command:`configure_package_config_file()` and
+:command:`write_basic_package_version_file()` commands.
+
+Generating a Package Configuration File
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. command:: configure_package_config_file
+
+ Create a config file for a project::
+
+   configure_package_config_file(<input> <output>
+     INSTALL_DESTINATION <path>
+     [PATH_VARS <var1> <var2> ... <varN>]
+     [NO_SET_AND_CHECK_MACRO]
+     [NO_CHECK_REQUIRED_COMPONENTS_MACRO]
+     [INSTALL_PREFIX <path>]
+     )
+
+``configure_package_config_file()`` should be used instead of the plain
+:command:`configure_file()` command when creating the ``<PackageName>Config.cmake``
+or ``<PackageName>-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.
+
+In a ``FooConfig.cmake`` file there may be code like this to make the install
+destinations know to the using project:
+
+.. code-block:: cmake
+
+   set(FOO_INCLUDE_DIR   "@CMAKE_INSTALL_FULL_INCLUDEDIR@" )
+   set(FOO_DATA_DIR   "@CMAKE_INSTALL_PREFIX@/@RELATIVE_DATA_INSTALL_DIR@" )
+   set(FOO_ICONS_DIR   "@CMAKE_INSTALL_PREFIX@/share/icons" )
+   #...logic to determine installedPrefix from the own location...
+   set(FOO_CONFIG_DIR  "${installedPrefix}/@CONFIG_INSTALL_DIR@" )
+
+All 4 options shown above are not sufficient, since the first 3 hardcode the
+absolute directory locations, and the 4th case works only if the logic to
+determine the ``installedPrefix`` is correct, and if ``CONFIG_INSTALL_DIR``
+contains a relative path, which in general cannot be guaranteed.  This has the
+effect that the resulting ``FooConfig.cmake`` file would work poorly under
+Windows and OSX, where users are used to choose the install location of a
+binary package at install time, independent from how
+:variable:`CMAKE_INSTALL_PREFIX` was set at build/cmake time.
+
+Using ``configure_package_config_file`` helps.  If used correctly, it makes
+the resulting ``FooConfig.cmake`` file relocatable.  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@")`` (this must be after the
+   ``@PACKAGE_INIT@`` line)
+4. instead of using the normal :command:`configure_file()`, use
+   ``configure_package_config_file()``
+
+
+
+The ``<input>`` and ``<output>`` arguments are the input and output file, the
+same way as in :command:`configure_file()`.
+
+The ``<path>`` given to ``INSTALL_DESTINATION`` must be the destination where
+the ``FooConfig.cmake`` file will be installed to.  This path can either be
+absolute, or relative to the ``INSTALL_PREFIX`` path.
+
+The variables ``<var1>`` to ``<varN>`` given as ``PATH_VARS`` are the
+variables which contain install destinations.  For each of them the macro will
+create a helper variable ``PACKAGE_<var...>``.  These helper variables must be
+used in the ``FooConfig.cmake.in`` file for setting the installed location.
+They are calculated by ``configure_package_config_file`` so that they are
+always relative to the installed location of the package.  This works both for
+relative and also for absolute locations.  For absolute locations it works
+only if the absolute location is a subdirectory of ``INSTALL_PREFIX``.
+
+If the ``INSTALL_PREFIX`` argument is passed, this is used as base path to
+calculate all the relative paths.  The ``<path>`` argument must be an absolute
+path.  If this argument is not passed, the :variable:`CMAKE_INSTALL_PREFIX`
+variable will be used instead.  The default value is good when generating a
+FooConfig.cmake file to use your package from the install tree.  When
+generating a FooConfig.cmake file to use your package from the build tree this
+option should be used.
+
+By default ``configure_package_config_file`` also generates two helper macros,
+``set_and_check()`` and ``check_required_components()`` into the
+``FooConfig.cmake`` file.
+
+``set_and_check()`` should be used instead of the normal ``set()`` command for
+setting directories and file locations.  Additionally to setting the variable
+it also checks that the referenced file or directory actually exists and fails
+with a ``FATAL_ERROR`` otherwise.  This makes sure that the created
+``FooConfig.cmake`` file does not contain wrong references.
+When using the ``NO_SET_AND_CHECK_MACRO``, this macro is not generated
+into the ``FooConfig.cmake`` file.
+
+``check_required_components(<PackageName>)`` should be called at the end of
+the ``FooConfig.cmake`` file. This macro checks whether all requested,
+non-optional components have been found, and if this is not the case, sets
+the ``Foo_FOUND`` variable to ``FALSE``, so that the package is considered to
+be not found.  It does that by testing the ``Foo_<Component>_FOUND``
+variables for all requested required components.  This macro should be
+called even if the package doesn't provide any components to make sure
+users are not specifying components erroneously.  When using the
+``NO_CHECK_REQUIRED_COMPONENTS_MACRO`` option, this macro is not generated
+into the ``FooConfig.cmake`` file.
+
+For an example see below the documentation for
+:command:`write_basic_package_version_file()`.
+
+Generating a Package Version File
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. command:: write_basic_package_version_file
+
+ Create a version file for a project::
+
+   write_basic_package_version_file(<filename>
+     [VERSION <major.minor.patch>]
+     COMPATIBILITY <AnyNewerVersion|SameMajorVersion|SameMinorVersion|ExactVersion> )
+
+
+Writes a file for use as ``<PackageName>ConfigVersion.cmake`` file to
+``<filename>``.  See the documentation of :command:`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.
+
+If no ``VERSION`` is given, the :variable:`PROJECT_VERSION` variable is used.
+If this hasn't been set, it errors out.
+
+The ``COMPATIBILITY`` mode ``AnyNewerVersion`` means that the installed
+package version will be considered compatible if it is newer or exactly the
+same as the requested version.  This mode should be used for packages which
+are fully backward compatible, also across major versions.
+If ``SameMajorVersion`` is used instead, then the behaviour differs from
+``AnyNewerVersion`` in that the major version number must be the same as
+requested, e.g.  version 2.0 will not be considered compatible if 1.0 is
+requested.  This mode should be used for packages which guarantee backward
+compatibility within the same major version.
+If ``SameMinorVersion`` is used, the behaviour is the same as
+``SameMajorVersion``, but both major and minor version must be the same as
+requested, e.g version 0.2 will not be compatible if 0.1 is requested.
+If ``ExactVersion`` is used, then the package is only considered compatible if
+the requested version matches exactly its own version number (not considering
+the tweak version).  For example, version 1.2.3 of a package is only
+considered compatible to requested version 1.2.3.  This mode is for packages
+without compatibility guarantees.
+If your project has more elaborated version matching rules, you will need to
+write your own custom ``ConfigVersion.cmake`` file instead of using this
+macro.
+
+Internally, this macro executes :command:`configure_file()` to create the
+resulting version file.  Depending on the ``COMPATIBILITY``, the corresponding
+``BasicConfigVersion-<COMPATIBILITY>.cmake.in`` file is used.
+Please note that these files are internal to CMake and you should not call
+:command:`configure_file()` on them yourself, but they can be used as starting
+point to create more sophisticted custom ``ConfigVersion.cmake`` files.
+
+Example Generating Package Files
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Example using both :command:`configure_package_config_file` and
+``write_basic_package_version_file()``:
+
+``CMakeLists.txt``:
+
+.. code-block:: cmake
+
+   set(INCLUDE_INSTALL_DIR include/ ... CACHE )
+   set(LIB_INSTALL_DIR lib/ ... CACHE )
+   set(SYSCONFIG_INSTALL_DIR etc/foo/ ... CACHE )
+   #...
+   include(CMakePackageConfigHelpers)
+   configure_package_config_file(FooConfig.cmake.in
+     ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake
+     INSTALL_DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake
+     PATH_VARS INCLUDE_INSTALL_DIR SYSCONFIG_INSTALL_DIR)
+   write_basic_package_version_file(
+     ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
+     VERSION 1.2.3
+     COMPATIBILITY SameMajorVersion )
+   install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake
+                 ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
+           DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake )
+
+``FooConfig.cmake.in``:
+
+::
+
+   set(FOO_VERSION x.y.z)
+   ...
+   @PACKAGE_INIT@
+   ...
+   set_and_check(FOO_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
+   set_and_check(FOO_SYSCONFIG_DIR "@PACKAGE_SYSCONFIG_INSTALL_DIR@")
+
+   check_required_components(Foo)
+#]=======================================================================]
 
 include(WriteBasicConfigVersionFile)
 

+ 9 - 8
Modules/CMakeParseArguments.cmake

@@ -1,11 +1,12 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CMakeParseArguments
-# -------------------
-#
-# This module once implemented the :command:`cmake_parse_arguments` command
-# that is now implemented natively by CMake.  It is now an empty placeholder
-# for compatibility with projects that include it to get the command from
-# CMake 3.4 and lower.
+#[=======================================================================[.rst:
+CMakeParseArguments
+-------------------
+
+This module once implemented the :command:`cmake_parse_arguments` command
+that is now implemented natively by CMake.  It is now an empty placeholder
+for compatibility with projects that include it to get the command from
+CMake 3.4 and lower.
+#]=======================================================================]

+ 38 - 37
Modules/CMakePrintHelpers.cmake

@@ -1,43 +1,44 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CMakePrintHelpers
-# -----------------
-#
-# Convenience macros for printing properties and variables, useful e.g. for debugging.
-#
-# ::
-#
-#  CMAKE_PRINT_PROPERTIES([TARGETS target1 ..  targetN]
-#                         [SOURCES source1 .. sourceN]
-#                         [DIRECTORIES dir1 .. dirN]
-#                         [TESTS test1 .. testN]
-#                         [CACHE_ENTRIES entry1 .. entryN]
-#                         PROPERTIES prop1 .. propN )
-#
-# This macro prints the values of the properties of the given targets,
-# source files, directories, tests or cache entries.  Exactly one of the
-# scope keywords must be used.  Example::
-#
-#    cmake_print_properties(TARGETS foo bar PROPERTIES
-#                           LOCATION INTERFACE_INCLUDE_DIRS)
-#
-# This will print the LOCATION and INTERFACE_INCLUDE_DIRS properties for
-# both targets foo and bar.
-#
-#
-#
-# CMAKE_PRINT_VARIABLES(var1 var2 ..  varN)
-#
-# This macro will print the name of each variable followed by its value.
-# Example::
-#
-#   cmake_print_variables(CMAKE_C_COMPILER CMAKE_MAJOR_VERSION DOES_NOT_EXIST)
-#
-# Gives::
-#
-#   -- CMAKE_C_COMPILER="/usr/bin/gcc" ; CMAKE_MAJOR_VERSION="2" ; DOES_NOT_EXIST=""
+#[=======================================================================[.rst:
+CMakePrintHelpers
+-----------------
+
+Convenience macros for printing properties and variables, useful e.g. for debugging.
+
+::
+
+ CMAKE_PRINT_PROPERTIES([TARGETS target1 ..  targetN]
+                        [SOURCES source1 .. sourceN]
+                        [DIRECTORIES dir1 .. dirN]
+                        [TESTS test1 .. testN]
+                        [CACHE_ENTRIES entry1 .. entryN]
+                        PROPERTIES prop1 .. propN )
+
+This macro prints the values of the properties of the given targets,
+source files, directories, tests or cache entries.  Exactly one of the
+scope keywords must be used.  Example::
+
+   cmake_print_properties(TARGETS foo bar PROPERTIES
+                          LOCATION INTERFACE_INCLUDE_DIRS)
+
+This will print the LOCATION and INTERFACE_INCLUDE_DIRS properties for
+both targets foo and bar.
+
+
+
+CMAKE_PRINT_VARIABLES(var1 var2 ..  varN)
+
+This macro will print the name of each variable followed by its value.
+Example::
+
+  cmake_print_variables(CMAKE_C_COMPILER CMAKE_MAJOR_VERSION DOES_NOT_EXIST)
+
+Gives::
+
+  -- CMAKE_C_COMPILER="/usr/bin/gcc" ; CMAKE_MAJOR_VERSION="2" ; DOES_NOT_EXIST=""
+#]=======================================================================]
 
 function(CMAKE_PRINT_VARIABLES)
    set(msg "")

+ 9 - 8
Modules/CMakePrintSystemInformation.cmake

@@ -1,14 +1,15 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CMakePrintSystemInformation
-# ---------------------------
-#
-# print system information
-#
-# This file can be used for diagnostic purposes just include it in a
-# project to see various internal CMake variables.
+#[=======================================================================[.rst:
+CMakePrintSystemInformation
+---------------------------
+
+print system information
+
+This file can be used for diagnostic purposes just include it in a
+project to see various internal CMake variables.
+#]=======================================================================]
 
 message("CMAKE_SYSTEM is ${CMAKE_SYSTEM} ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION}")
 message("CMAKE_SYSTEM file is ${CMAKE_SYSTEM_INFO_FILE}")

+ 35 - 34
Modules/CMakePushCheckState.cmake

@@ -1,40 +1,41 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CMakePushCheckState
-# -------------------
-#
-#
-#
-# This module defines three macros: CMAKE_PUSH_CHECK_STATE()
-# CMAKE_POP_CHECK_STATE() and CMAKE_RESET_CHECK_STATE() These macros can
-# be used to save, restore and reset (i.e., clear contents) the state of
-# the variables CMAKE_REQUIRED_FLAGS, CMAKE_REQUIRED_DEFINITIONS,
-# CMAKE_REQUIRED_LIBRARIES, CMAKE_REQUIRED_INCLUDES and CMAKE_EXTRA_INCLUDE_FILES
-# used by the various Check-files coming with CMake, like e.g.
-# check_function_exists() etc.  The variable contents are pushed on a
-# stack, pushing multiple times is supported.  This is useful e.g.  when
-# executing such tests in a Find-module, where they have to be set, but
-# after the Find-module has been executed they should have the same
-# value as they had before.
-#
-# CMAKE_PUSH_CHECK_STATE() macro receives optional argument RESET.
-# Whether it's specified, CMAKE_PUSH_CHECK_STATE() will set all
-# CMAKE_REQUIRED_* variables to empty values, same as
-# CMAKE_RESET_CHECK_STATE() call will do.
-#
-# Usage:
-#
-# ::
-#
-#    cmake_push_check_state(RESET)
-#    set(CMAKE_REQUIRED_DEFINITIONS -DSOME_MORE_DEF)
-#    check_function_exists(...)
-#    cmake_reset_check_state()
-#    set(CMAKE_REQUIRED_DEFINITIONS -DANOTHER_DEF)
-#    check_function_exists(...)
-#    cmake_pop_check_state()
+#[=======================================================================[.rst:
+CMakePushCheckState
+-------------------
+
+
+
+This module defines three macros: CMAKE_PUSH_CHECK_STATE()
+CMAKE_POP_CHECK_STATE() and CMAKE_RESET_CHECK_STATE() These macros can
+be used to save, restore and reset (i.e., clear contents) the state of
+the variables CMAKE_REQUIRED_FLAGS, CMAKE_REQUIRED_DEFINITIONS,
+CMAKE_REQUIRED_LIBRARIES, CMAKE_REQUIRED_INCLUDES and CMAKE_EXTRA_INCLUDE_FILES
+used by the various Check-files coming with CMake, like e.g.
+check_function_exists() etc.  The variable contents are pushed on a
+stack, pushing multiple times is supported.  This is useful e.g.  when
+executing such tests in a Find-module, where they have to be set, but
+after the Find-module has been executed they should have the same
+value as they had before.
+
+CMAKE_PUSH_CHECK_STATE() macro receives optional argument RESET.
+Whether it's specified, CMAKE_PUSH_CHECK_STATE() will set all
+CMAKE_REQUIRED_* variables to empty values, same as
+CMAKE_RESET_CHECK_STATE() call will do.
+
+Usage:
+
+::
+
+   cmake_push_check_state(RESET)
+   set(CMAKE_REQUIRED_DEFINITIONS -DSOME_MORE_DEF)
+   check_function_exists(...)
+   cmake_reset_check_state()
+   set(CMAKE_REQUIRED_DEFINITIONS -DANOTHER_DEF)
+   check_function_exists(...)
+   cmake_pop_check_state()
+#]=======================================================================]
 
 macro(CMAKE_RESET_CHECK_STATE)
 

+ 17 - 16
Modules/CMakeVerifyManifest.cmake

@@ -1,22 +1,23 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CMakeVerifyManifest
-# -------------------
-#
-#
-#
-# CMakeVerifyManifest.cmake
-#
-# This script is used to verify that embedded manifests and 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, cmake -Dallow_versions=8.0.50608.0
-# -PCmakeVerifyManifest.cmake could be used to allow an embedded manifest
-# of 8.0.50608.0 to be used in a project even if that version was not
-# found in the .manifest file.
+#[=======================================================================[.rst:
+CMakeVerifyManifest
+-------------------
+
+
+
+CMakeVerifyManifest.cmake
+
+This script is used to verify that embedded manifests and 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, cmake -Dallow_versions=8.0.50608.0
+-PCmakeVerifyManifest.cmake could be used to allow an embedded manifest
+of 8.0.50608.0 to be used in a project even if that version was not
+found in the .manifest file.
+#]=======================================================================]
 
 # This script first recursively globs *.manifest files from
 # the current directory.  Then globs *.exe and *.dll.  Each

+ 308 - 307
Modules/CPackComponent.cmake

@@ -1,313 +1,314 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CPackComponent
-# --------------
-#
-# Build binary and source package installers
-#
-# Variables concerning CPack Components
-# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-#
-# The CPackComponent module is the module which handles the component
-# part of CPack.  See CPack module for general information about CPack.
-#
-# For certain kinds of binary installers (including the graphical
-# installers on macOS and Windows), CPack generates installers that
-# allow users to select individual application components to install.
-# The contents of each of the components are identified by the COMPONENT
-# argument of CMake's INSTALL command.  These components can be
-# annotated with user-friendly names and descriptions, inter-component
-# dependencies, etc., and grouped in various ways to customize the
-# resulting installer.  See the cpack_add_* commands, described below,
-# for more information about component-specific installations.
-#
-# Component-specific installation allows users to select specific sets
-# of components to install during the install process.  Installation
-# components are identified by the COMPONENT argument of CMake's INSTALL
-# commands, and should be further described by the following CPack
-# commands:
-#
-# .. variable:: CPACK_COMPONENTS_ALL
-#
-#  The list of component to install.
-#
-#  The default value of this variable is computed by CPack and contains all
-#  components defined by the project.  The user may set it to only include the
-#  specified components.
-#
-#  Instead of specifying all the desired components, it is possible to obtain a
-#  list of all defined components and then remove the unwanted ones from the
-#  list. The :command:`get_cmake_property` command can be used to obtain the
-#  ``COMPONENTS`` property, then the :command:`list(REMOVE_ITEM)` command can be
-#  used to remove the unwanted ones. For example, to use all defined components
-#  except ``foo`` and ``bar``::
-#
-#    get_cmake_property(CPACK_COMPONENTS_ALL COMPONENTS)
-#    list(REMOVE_ITEM CPACK_COMPONENTS_ALL "foo" "bar")
-#
-# .. variable:: CPACK_<GENNAME>_COMPONENT_INSTALL
-#
-#  Enable/Disable component install for CPack generator <GENNAME>.
-#
-#  Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
-#  default behavior.  e.g.  RPM builds monolithic whereas NSIS builds
-#  component.  One can change the default behavior by setting this variable to
-#  0/1 or OFF/ON.
-#
-# .. variable:: CPACK_COMPONENTS_GROUPING
-#
-#  Specify how components are grouped for multi-package component-aware CPack
-#  generators.
-#
-#  Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates
-#  several packages files when asked for component packaging.  They group
-#  the component differently depending on the value of this variable:
-#
-#  * ONE_PER_GROUP (default): creates one package file per component group
-#  * ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) components
-#  * IGNORE : creates one package per component, i.e. IGNORE component group
-#
-#  One can specify different grouping for different CPack generator by
-#  using a CPACK_PROJECT_CONFIG_FILE.
-#
-# .. variable:: CPACK_COMPONENT_<compName>_DISPLAY_NAME
-#
-#  The name to be displayed for a component.
-#
-# .. variable:: CPACK_COMPONENT_<compName>_DESCRIPTION
-#
-#  The description of a component.
-#
-# .. variable:: CPACK_COMPONENT_<compName>_GROUP
-#
-#  The group of a component.
-#
-# .. variable:: CPACK_COMPONENT_<compName>_DEPENDS
-#
-#  The dependencies (list of components) on which this component depends.
-#
-# .. variable:: CPACK_COMPONENT_<compName>_HIDDEN
-#
-#  True if this component is hidden from the user.
-#
-# .. variable:: CPACK_COMPONENT_<compName>_REQUIRED
-#
-#  True if this component is required.
-#
-# .. variable:: CPACK_COMPONENT_<compName>_DISABLED
-#
-#  True if this component is not selected to be installed by default.
-#
-# .. command:: cpack_add_component
-#
-# Describes a CPack installation
-# component named by the COMPONENT argument to a CMake INSTALL command.
-#
-# ::
-#
-#   cpack_add_component(compname
-#                       [DISPLAY_NAME name]
-#                       [DESCRIPTION description]
-#                       [HIDDEN | REQUIRED | DISABLED ]
-#                       [GROUP group]
-#                       [DEPENDS comp1 comp2 ... ]
-#                       [INSTALL_TYPES type1 type2 ... ]
-#                       [DOWNLOADED]
-#                       [ARCHIVE_FILE filename]
-#                       [PLIST filename])
-#
-#
-#
-# The cmake_add_component command describes an installation component,
-# which the user can opt to install or remove as part of the graphical
-# installation process.  compname is the name of the component, as
-# provided to the COMPONENT argument of one or more CMake INSTALL
-# commands.
-#
-# DISPLAY_NAME is the displayed name of the component, used in graphical
-# installers to display the component name.  This value can be any
-# string.
-#
-# DESCRIPTION is an extended description of the component, used in
-# graphical installers to give the user additional information about the
-# component.  Descriptions can span multiple lines using ``\n`` as the
-# line separator.  Typically, these descriptions should be no more than
-# a few lines long.
-#
-# HIDDEN indicates that this component will be hidden in the graphical
-# installer, so that the user cannot directly change whether it is
-# installed or not.
-#
-# REQUIRED indicates that this component is required, and therefore will
-# always be installed.  It will be visible in the graphical installer,
-# but it cannot be unselected.  (Typically, required components are
-# shown greyed out).
-#
-# DISABLED indicates that this component should be disabled (unselected)
-# by default.  The user is free to select this component for
-# installation, unless it is also HIDDEN.
-#
-# DEPENDS lists the components on which this component depends.  If this
-# component is selected, then each of the components listed must also be
-# selected.  The dependency information is encoded within the installer
-# itself, so that users cannot install inconsistent sets of components.
-#
-# GROUP names the component group of which this component is a part.  If
-# not provided, the component will be a standalone component, not part
-# of any component group.  Component groups are described with the
-# cpack_add_component_group command, detailed below.
-#
-# INSTALL_TYPES lists the installation types of which this component is
-# a part.  When one of these installations types is selected, this
-# component will automatically be selected.  Installation types are
-# described with the cpack_add_install_type command, detailed below.
-#
-# DOWNLOADED indicates that this component should be downloaded
-# on-the-fly by the installer, rather than packaged in with the
-# installer itself.  For more information, see the
-# cpack_configure_downloads command.
-#
-# ARCHIVE_FILE provides a name for the archive file created by CPack to
-# be used for downloaded components.  If not supplied, CPack will create
-# a file with some name based on CPACK_PACKAGE_FILE_NAME and the name of
-# the component.  See cpack_configure_downloads for more information.
-#
-# PLIST gives a filename that is passed to pkgbuild with the
-# ``--component-plist`` argument when using the productbuild generator.
-#
-# .. command:: cpack_add_component_group
-#
-# Describes a group of related CPack installation components.
-#
-# ::
-#
-#   cpack_add_component_group(groupname
-#                            [DISPLAY_NAME name]
-#                            [DESCRIPTION description]
-#                            [PARENT_GROUP parent]
-#                            [EXPANDED]
-#                            [BOLD_TITLE])
-#
-#
-#
-# The cpack_add_component_group describes a group of installation
-# components, which will be placed together within the listing of
-# options.  Typically, component groups allow the user to
-# select/deselect all of the components within a single group via a
-# single group-level option.  Use component groups to reduce the
-# complexity of installers with many options.  groupname is an arbitrary
-# name used to identify the group in the GROUP argument of the
-# cpack_add_component command, which is used to place a component in a
-# group.  The name of the group must not conflict with the name of any
-# component.
-#
-# DISPLAY_NAME is the displayed name of the component group, used in
-# graphical installers to display the component group name.  This value
-# can be any string.
-#
-# DESCRIPTION is an extended description of the component group, used in
-# graphical installers to give the user additional information about the
-# components within that group.  Descriptions can span multiple lines
-# using ``\n`` as the line separator.  Typically, these descriptions
-# should be no more than a few lines long.
-#
-# PARENT_GROUP, if supplied, names the parent group of this group.
-# Parent groups are used to establish a hierarchy of groups, providing
-# an arbitrary hierarchy of groups.
-#
-# EXPANDED indicates that, by default, the group should show up as
-# "expanded", so that the user immediately sees all of the components
-# within the group.  Otherwise, the group will initially show up as a
-# single entry.
-#
-# BOLD_TITLE indicates that the group title should appear in bold, to
-# call the user's attention to the group.
-#
-# .. command:: cpack_add_install_type
-#
-# Add a new installation type containing
-# a set of predefined component selections to the graphical installer.
-#
-# ::
-#
-#   cpack_add_install_type(typename
-#                          [DISPLAY_NAME name])
-#
-#
-#
-# The cpack_add_install_type command identifies a set of preselected
-# components that represents a common use case for an application.  For
-# example, a "Developer" install type might include an application along
-# with its header and library files, while an "End user" install type
-# might just include the application's executable.  Each component
-# identifies itself with one or more install types via the INSTALL_TYPES
-# argument to cpack_add_component.
-#
-# DISPLAY_NAME is the displayed name of the install type, which will
-# typically show up in a drop-down box within a graphical installer.
-# This value can be any string.
-#
-# .. command:: cpack_configure_downloads
-#
-# Configure CPack to download
-# selected components on-the-fly as part of the installation process.
-#
-# ::
-#
-#   cpack_configure_downloads(site
-#                             [UPLOAD_DIRECTORY dirname]
-#                             [ALL]
-#                             [ADD_REMOVE|NO_ADD_REMOVE])
-#
-#
-#
-# The cpack_configure_downloads command configures installation-time
-# downloads of selected components.  For each downloadable component,
-# CPack will create an archive containing the contents of that
-# component, which should be uploaded to the given site.  When the user
-# selects that component for installation, the installer will download
-# and extract the component in place.  This feature is useful for
-# creating small installers that only download the requested components,
-# saving bandwidth.  Additionally, the installers are small enough that
-# they will be installed as part of the normal installation process, and
-# the "Change" button in Windows Add/Remove Programs control panel will
-# allow one to add or remove parts of the application after the original
-# installation.  On Windows, the downloaded-components functionality
-# requires the ZipDLL plug-in for NSIS, available at:
-#
-# ::
-#
-#   http://nsis.sourceforge.net/ZipDLL_plug-in
-#
-#
-#
-# On macOS, installers that download components on-the-fly can only
-# be built and installed on system using macOS 10.5 or later.
-#
-# The site argument is a URL where the archives for downloadable
-# components will reside, e.g.,
-# https://cmake.org/files/2.6.1/installer/ All of the archives
-# produced by CPack should be uploaded to that location.
-#
-# UPLOAD_DIRECTORY is the local directory where CPack will create the
-# various archives for each of the components.  The contents of this
-# directory should be uploaded to a location accessible by the URL given
-# in the site argument.  If omitted, CPack will use the directory
-# CPackUploads inside the CMake binary directory to store the generated
-# archives.
-#
-# The ALL flag indicates that all components be downloaded.  Otherwise,
-# only those components explicitly marked as DOWNLOADED or that have a
-# specified ARCHIVE_FILE will be downloaded.  Additionally, the ALL
-# option implies ADD_REMOVE (unless NO_ADD_REMOVE is specified).
-#
-# ADD_REMOVE indicates that CPack should install a copy of the installer
-# that can be called from Windows' Add/Remove Programs dialog (via the
-# "Modify" button) to change the set of installed components.
-# NO_ADD_REMOVE turns off this behavior.  This option is ignored on Mac
-# OS X.
+#[=======================================================================[.rst:
+CPackComponent
+--------------
+
+Build binary and source package installers
+
+Variables concerning CPack Components
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The CPackComponent module is the module which handles the component
+part of CPack.  See CPack module for general information about CPack.
+
+For certain kinds of binary installers (including the graphical
+installers on macOS and Windows), CPack generates installers that
+allow users to select individual application components to install.
+The contents of each of the components are identified by the COMPONENT
+argument of CMake's INSTALL command.  These components can be
+annotated with user-friendly names and descriptions, inter-component
+dependencies, etc., and grouped in various ways to customize the
+resulting installer.  See the cpack_add_* commands, described below,
+for more information about component-specific installations.
+
+Component-specific installation allows users to select specific sets
+of components to install during the install process.  Installation
+components are identified by the COMPONENT argument of CMake's INSTALL
+commands, and should be further described by the following CPack
+commands:
+
+.. variable:: CPACK_COMPONENTS_ALL
+
+ The list of component to install.
+
+ The default value of this variable is computed by CPack and contains all
+ components defined by the project.  The user may set it to only include the
+ specified components.
+
+ Instead of specifying all the desired components, it is possible to obtain a
+ list of all defined components and then remove the unwanted ones from the
+ list. The :command:`get_cmake_property` command can be used to obtain the
+ ``COMPONENTS`` property, then the :command:`list(REMOVE_ITEM)` command can be
+ used to remove the unwanted ones. For example, to use all defined components
+ except ``foo`` and ``bar``::
+
+   get_cmake_property(CPACK_COMPONENTS_ALL COMPONENTS)
+   list(REMOVE_ITEM CPACK_COMPONENTS_ALL "foo" "bar")
+
+.. variable:: CPACK_<GENNAME>_COMPONENT_INSTALL
+
+ Enable/Disable component install for CPack generator <GENNAME>.
+
+ Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
+ default behavior.  e.g.  RPM builds monolithic whereas NSIS builds
+ component.  One can change the default behavior by setting this variable to
+ 0/1 or OFF/ON.
+
+.. variable:: CPACK_COMPONENTS_GROUPING
+
+ Specify how components are grouped for multi-package component-aware CPack
+ generators.
+
+ Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates
+ several packages files when asked for component packaging.  They group
+ the component differently depending on the value of this variable:
+
+ * ONE_PER_GROUP (default): creates one package file per component group
+ * ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) components
+ * IGNORE : creates one package per component, i.e. IGNORE component group
+
+ One can specify different grouping for different CPack generator by
+ using a CPACK_PROJECT_CONFIG_FILE.
+
+.. variable:: CPACK_COMPONENT_<compName>_DISPLAY_NAME
+
+ The name to be displayed for a component.
+
+.. variable:: CPACK_COMPONENT_<compName>_DESCRIPTION
+
+ The description of a component.
+
+.. variable:: CPACK_COMPONENT_<compName>_GROUP
+
+ The group of a component.
+
+.. variable:: CPACK_COMPONENT_<compName>_DEPENDS
+
+ The dependencies (list of components) on which this component depends.
+
+.. variable:: CPACK_COMPONENT_<compName>_HIDDEN
+
+ True if this component is hidden from the user.
+
+.. variable:: CPACK_COMPONENT_<compName>_REQUIRED
+
+ True if this component is required.
+
+.. variable:: CPACK_COMPONENT_<compName>_DISABLED
+
+ True if this component is not selected to be installed by default.
+
+.. command:: cpack_add_component
+
+Describes a CPack installation
+component named by the COMPONENT argument to a CMake INSTALL command.
+
+::
+
+  cpack_add_component(compname
+                      [DISPLAY_NAME name]
+                      [DESCRIPTION description]
+                      [HIDDEN | REQUIRED | DISABLED ]
+                      [GROUP group]
+                      [DEPENDS comp1 comp2 ... ]
+                      [INSTALL_TYPES type1 type2 ... ]
+                      [DOWNLOADED]
+                      [ARCHIVE_FILE filename]
+                      [PLIST filename])
+
+
+
+The cmake_add_component command describes an installation component,
+which the user can opt to install or remove as part of the graphical
+installation process.  compname is the name of the component, as
+provided to the COMPONENT argument of one or more CMake INSTALL
+commands.
+
+DISPLAY_NAME is the displayed name of the component, used in graphical
+installers to display the component name.  This value can be any
+string.
+
+DESCRIPTION is an extended description of the component, used in
+graphical installers to give the user additional information about the
+component.  Descriptions can span multiple lines using ``\n`` as the
+line separator.  Typically, these descriptions should be no more than
+a few lines long.
+
+HIDDEN indicates that this component will be hidden in the graphical
+installer, so that the user cannot directly change whether it is
+installed or not.
+
+REQUIRED indicates that this component is required, and therefore will
+always be installed.  It will be visible in the graphical installer,
+but it cannot be unselected.  (Typically, required components are
+shown greyed out).
+
+DISABLED indicates that this component should be disabled (unselected)
+by default.  The user is free to select this component for
+installation, unless it is also HIDDEN.
+
+DEPENDS lists the components on which this component depends.  If this
+component is selected, then each of the components listed must also be
+selected.  The dependency information is encoded within the installer
+itself, so that users cannot install inconsistent sets of components.
+
+GROUP names the component group of which this component is a part.  If
+not provided, the component will be a standalone component, not part
+of any component group.  Component groups are described with the
+cpack_add_component_group command, detailed below.
+
+INSTALL_TYPES lists the installation types of which this component is
+a part.  When one of these installations types is selected, this
+component will automatically be selected.  Installation types are
+described with the cpack_add_install_type command, detailed below.
+
+DOWNLOADED indicates that this component should be downloaded
+on-the-fly by the installer, rather than packaged in with the
+installer itself.  For more information, see the
+cpack_configure_downloads command.
+
+ARCHIVE_FILE provides a name for the archive file created by CPack to
+be used for downloaded components.  If not supplied, CPack will create
+a file with some name based on CPACK_PACKAGE_FILE_NAME and the name of
+the component.  See cpack_configure_downloads for more information.
+
+PLIST gives a filename that is passed to pkgbuild with the
+``--component-plist`` argument when using the productbuild generator.
+
+.. command:: cpack_add_component_group
+
+Describes a group of related CPack installation components.
+
+::
+
+  cpack_add_component_group(groupname
+                           [DISPLAY_NAME name]
+                           [DESCRIPTION description]
+                           [PARENT_GROUP parent]
+                           [EXPANDED]
+                           [BOLD_TITLE])
+
+
+
+The cpack_add_component_group describes a group of installation
+components, which will be placed together within the listing of
+options.  Typically, component groups allow the user to
+select/deselect all of the components within a single group via a
+single group-level option.  Use component groups to reduce the
+complexity of installers with many options.  groupname is an arbitrary
+name used to identify the group in the GROUP argument of the
+cpack_add_component command, which is used to place a component in a
+group.  The name of the group must not conflict with the name of any
+component.
+
+DISPLAY_NAME is the displayed name of the component group, used in
+graphical installers to display the component group name.  This value
+can be any string.
+
+DESCRIPTION is an extended description of the component group, used in
+graphical installers to give the user additional information about the
+components within that group.  Descriptions can span multiple lines
+using ``\n`` as the line separator.  Typically, these descriptions
+should be no more than a few lines long.
+
+PARENT_GROUP, if supplied, names the parent group of this group.
+Parent groups are used to establish a hierarchy of groups, providing
+an arbitrary hierarchy of groups.
+
+EXPANDED indicates that, by default, the group should show up as
+"expanded", so that the user immediately sees all of the components
+within the group.  Otherwise, the group will initially show up as a
+single entry.
+
+BOLD_TITLE indicates that the group title should appear in bold, to
+call the user's attention to the group.
+
+.. command:: cpack_add_install_type
+
+Add a new installation type containing
+a set of predefined component selections to the graphical installer.
+
+::
+
+  cpack_add_install_type(typename
+                         [DISPLAY_NAME name])
+
+
+
+The cpack_add_install_type command identifies a set of preselected
+components that represents a common use case for an application.  For
+example, a "Developer" install type might include an application along
+with its header and library files, while an "End user" install type
+might just include the application's executable.  Each component
+identifies itself with one or more install types via the INSTALL_TYPES
+argument to cpack_add_component.
+
+DISPLAY_NAME is the displayed name of the install type, which will
+typically show up in a drop-down box within a graphical installer.
+This value can be any string.
+
+.. command:: cpack_configure_downloads
+
+Configure CPack to download
+selected components on-the-fly as part of the installation process.
+
+::
+
+  cpack_configure_downloads(site
+                            [UPLOAD_DIRECTORY dirname]
+                            [ALL]
+                            [ADD_REMOVE|NO_ADD_REMOVE])
+
+
+
+The cpack_configure_downloads command configures installation-time
+downloads of selected components.  For each downloadable component,
+CPack will create an archive containing the contents of that
+component, which should be uploaded to the given site.  When the user
+selects that component for installation, the installer will download
+and extract the component in place.  This feature is useful for
+creating small installers that only download the requested components,
+saving bandwidth.  Additionally, the installers are small enough that
+they will be installed as part of the normal installation process, and
+the "Change" button in Windows Add/Remove Programs control panel will
+allow one to add or remove parts of the application after the original
+installation.  On Windows, the downloaded-components functionality
+requires the ZipDLL plug-in for NSIS, available at:
+
+::
+
+  http://nsis.sourceforge.net/ZipDLL_plug-in
+
+
+
+On macOS, installers that download components on-the-fly can only
+be built and installed on system using macOS 10.5 or later.
+
+The site argument is a URL where the archives for downloadable
+components will reside, e.g.,
+https://cmake.org/files/2.6.1/installer/ All of the archives
+produced by CPack should be uploaded to that location.
+
+UPLOAD_DIRECTORY is the local directory where CPack will create the
+various archives for each of the components.  The contents of this
+directory should be uploaded to a location accessible by the URL given
+in the site argument.  If omitted, CPack will use the directory
+CPackUploads inside the CMake binary directory to store the generated
+archives.
+
+The ALL flag indicates that all components be downloaded.  Otherwise,
+only those components explicitly marked as DOWNLOADED or that have a
+specified ARCHIVE_FILE will be downloaded.  Additionally, the ALL
+option implies ADD_REMOVE (unless NO_ADD_REMOVE is specified).
+
+ADD_REMOVE indicates that CPack should install a copy of the installer
+that can be called from Windows' Add/Remove Programs dialog (via the
+"Modify" button) to change the set of installed components.
+NO_ADD_REMOVE turns off this behavior.  This option is ignored on Mac
+OS X.
+#]=======================================================================]
 
 # Define var in order to avoid multiple inclusion
 if(NOT CPackComponent_CMake_INCLUDED)

+ 27 - 26
Modules/CPackIFWConfigureFile.cmake

@@ -1,32 +1,33 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CPackIFWConfigureFile
-# ---------------------
-#
-# The module defines :command:`configure_file` similar command to
-# configure file templates prepared in QtIFW/SDK/Creator style.
-#
-#
-# Commands
-# ^^^^^^^^
-#
-# The module defines the following commands:
-#
-# .. command:: cpack_ifw_configure_file
-#
-#   Copy a file to another location and modify its contents.
-#
-#   ::
-#
-#     cpack_ifw_configure_file(<input> <output>)
-#
-#   Copies an ``<input>`` file to an ``<output>`` file and substitutes variable
-#   values referenced as ``%{VAR}`` or ``%VAR%`` in the input file content.
-#   Each variable reference will be replaced with the current value of the
-#   variable, or the empty string if the variable is not defined.
-#
+#[=======================================================================[.rst:
+CPackIFWConfigureFile
+---------------------
+
+The module defines :command:`configure_file` similar command to
+configure file templates prepared in QtIFW/SDK/Creator style.
+
+
+Commands
+^^^^^^^^
+
+The module defines the following commands:
+
+.. command:: cpack_ifw_configure_file
+
+  Copy a file to another location and modify its contents.
+
+  ::
+
+    cpack_ifw_configure_file(<input> <output>)
+
+  Copies an ``<input>`` file to an ``<output>`` file and substitutes variable
+  values referenced as ``%{VAR}`` or ``%VAR%`` in the input file content.
+  Each variable reference will be replaced with the current value of the
+  variable, or the empty string if the variable is not defined.
+
+#]=======================================================================]
 
 # NOTE: This file used to himself packaging via CPack IFW generator and
 # should be compatible with minimal CMake version defined in

+ 64 - 63
Modules/CTestCoverageCollectGCOV.cmake

@@ -1,69 +1,70 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CTestCoverageCollectGCOV
-# ------------------------
-#
-# This module provides the ``ctest_coverage_collect_gcov`` function.
-#
-# This function runs gcov on all .gcda files found in the binary tree
-# and packages the resulting .gcov files into a tar file.
-# This tarball also contains the following:
-#
-# * *data.json* defines the source and build directories for use by CDash.
-# * *Labels.json* indicates any :prop_sf:`LABELS` that have been set on the
-#   source files.
-# * The *uncovered* directory holds any uncovered files found by
-#   :variable:`CTEST_EXTRA_COVERAGE_GLOB`.
-#
-# After generating this tar file, it can be sent to CDash for display with the
-# :command:`ctest_submit(CDASH_UPLOAD)` command.
-#
-# .. command:: cdash_coverage_collect_gcov
-#
-#   ::
-#
-#     ctest_coverage_collect_gcov(TARBALL <tarfile>
-#       [SOURCE <source_dir>][BUILD <build_dir>]
-#       [GCOV_COMMAND <gcov_command>]
-#       [GCOV_OPTIONS <options>...]
-#       )
-#
-#   Run gcov and package a tar file for CDash.  The options are:
-#
-#   ``TARBALL <tarfile>``
-#     Specify the location of the ``.tar`` file to be created for later
-#     upload to CDash.  Relative paths will be interpreted with respect
-#     to the top-level build directory.
-#
-#   ``SOURCE <source_dir>``
-#     Specify the top-level source directory for the build.
-#     Default is the value of :variable:`CTEST_SOURCE_DIRECTORY`.
-#
-#   ``BUILD <build_dir>``
-#     Specify the top-level build directory for the build.
-#     Default is the value of :variable:`CTEST_BINARY_DIRECTORY`.
-#
-#   ``GCOV_COMMAND <gcov_command>``
-#     Specify the full path to the ``gcov`` command on the machine.
-#     Default is the value of :variable:`CTEST_COVERAGE_COMMAND`.
-#
-#   ``GCOV_OPTIONS <options>...``
-#     Specify options to be passed to gcov.  The ``gcov`` command
-#     is run as ``gcov <options>... -o <gcov-dir> <file>.gcda``.
-#     If not specified, the default option is just ``-b``.
-#
-#   ``GLOB``
-#     Recursively search for .gcda files in build_dir rather than
-#     determining search locations by reading TargetDirectories.txt.
-#
-#   ``DELETE``
-#     Delete coverage files after they've been packaged into the .tar.
-#
-#   ``QUIET``
-#     Suppress non-error messages that otherwise would have been
-#     printed out by this function.
+#[=======================================================================[.rst:
+CTestCoverageCollectGCOV
+------------------------
+
+This module provides the ``ctest_coverage_collect_gcov`` function.
+
+This function runs gcov on all .gcda files found in the binary tree
+and packages the resulting .gcov files into a tar file.
+This tarball also contains the following:
+
+* *data.json* defines the source and build directories for use by CDash.
+* *Labels.json* indicates any :prop_sf:`LABELS` that have been set on the
+  source files.
+* The *uncovered* directory holds any uncovered files found by
+  :variable:`CTEST_EXTRA_COVERAGE_GLOB`.
+
+After generating this tar file, it can be sent to CDash for display with the
+:command:`ctest_submit(CDASH_UPLOAD)` command.
+
+.. command:: cdash_coverage_collect_gcov
+
+  ::
+
+    ctest_coverage_collect_gcov(TARBALL <tarfile>
+      [SOURCE <source_dir>][BUILD <build_dir>]
+      [GCOV_COMMAND <gcov_command>]
+      [GCOV_OPTIONS <options>...]
+      )
+
+  Run gcov and package a tar file for CDash.  The options are:
+
+  ``TARBALL <tarfile>``
+    Specify the location of the ``.tar`` file to be created for later
+    upload to CDash.  Relative paths will be interpreted with respect
+    to the top-level build directory.
+
+  ``SOURCE <source_dir>``
+    Specify the top-level source directory for the build.
+    Default is the value of :variable:`CTEST_SOURCE_DIRECTORY`.
+
+  ``BUILD <build_dir>``
+    Specify the top-level build directory for the build.
+    Default is the value of :variable:`CTEST_BINARY_DIRECTORY`.
+
+  ``GCOV_COMMAND <gcov_command>``
+    Specify the full path to the ``gcov`` command on the machine.
+    Default is the value of :variable:`CTEST_COVERAGE_COMMAND`.
+
+  ``GCOV_OPTIONS <options>...``
+    Specify options to be passed to gcov.  The ``gcov`` command
+    is run as ``gcov <options>... -o <gcov-dir> <file>.gcda``.
+    If not specified, the default option is just ``-b``.
+
+  ``GLOB``
+    Recursively search for .gcda files in build_dir rather than
+    determining search locations by reading TargetDirectories.txt.
+
+  ``DELETE``
+    Delete coverage files after they've been packaged into the .tar.
+
+  ``QUIET``
+    Suppress non-error messages that otherwise would have been
+    printed out by this function.
+#]=======================================================================]
 
 function(ctest_coverage_collect_gcov)
   set(options QUIET GLOB DELETE)

+ 8 - 7
Modules/CTestScriptMode.cmake

@@ -1,13 +1,14 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CTestScriptMode
-# ---------------
-#
-#
-#
-# This file is read by ctest in script mode (-S)
+#[=======================================================================[.rst:
+CTestScriptMode
+---------------
+
+
+
+This file is read by ctest in script mode (-S)
+#]=======================================================================]
 
 # Determine the current system, so this information can be used
 # in ctest scripts

+ 27 - 26
Modules/CTestUseLaunchers.cmake

@@ -1,32 +1,33 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CTestUseLaunchers
-# -----------------
-#
-# Set the RULE_LAUNCH_* global properties when CTEST_USE_LAUNCHERS is on.
-#
-# CTestUseLaunchers is automatically included when you include(CTest).
-# However, it is split out into its own module file so projects can use
-# the CTEST_USE_LAUNCHERS functionality independently.
-#
-# To use launchers, set CTEST_USE_LAUNCHERS to ON in a ctest -S
-# dashboard script, and then also set it in the cache of the configured
-# project.  Both cmake and ctest need to know the value of it for the
-# launchers to work properly.  CMake needs to know in order to generate
-# proper build rules, and ctest, in order to produce the proper error
-# and warning analysis.
-#
-# For convenience, you may set the ENV variable
-# CTEST_USE_LAUNCHERS_DEFAULT in your ctest -S script, too.  Then, as
-# long as your CMakeLists uses include(CTest) or
-# include(CTestUseLaunchers), it will use the value of the ENV variable
-# to initialize a CTEST_USE_LAUNCHERS cache variable.  This cache
-# variable initialization only occurs if CTEST_USE_LAUNCHERS is not
-# already defined. If CTEST_USE_LAUNCHERS is on in a ctest -S script
-# the ctest_configure command will add -DCTEST_USE_LAUNCHERS:BOOL=TRUE
-# to the cmake command used to configure the project.
+#[=======================================================================[.rst:
+CTestUseLaunchers
+-----------------
+
+Set the RULE_LAUNCH_* global properties when CTEST_USE_LAUNCHERS is on.
+
+CTestUseLaunchers is automatically included when you include(CTest).
+However, it is split out into its own module file so projects can use
+the CTEST_USE_LAUNCHERS functionality independently.
+
+To use launchers, set CTEST_USE_LAUNCHERS to ON in a ctest -S
+dashboard script, and then also set it in the cache of the configured
+project.  Both cmake and ctest need to know the value of it for the
+launchers to work properly.  CMake needs to know in order to generate
+proper build rules, and ctest, in order to produce the proper error
+and warning analysis.
+
+For convenience, you may set the ENV variable
+CTEST_USE_LAUNCHERS_DEFAULT in your ctest -S script, too.  Then, as
+long as your CMakeLists uses include(CTest) or
+include(CTestUseLaunchers), it will use the value of the ENV variable
+to initialize a CTEST_USE_LAUNCHERS cache variable.  This cache
+variable initialization only occurs if CTEST_USE_LAUNCHERS is not
+already defined. If CTEST_USE_LAUNCHERS is on in a ctest -S script
+the ctest_configure command will add -DCTEST_USE_LAUNCHERS:BOOL=TRUE
+to the cmake command used to configure the project.
+#]=======================================================================]
 
 if(NOT DEFINED CTEST_USE_LAUNCHERS AND DEFINED ENV{CTEST_USE_LAUNCHERS_DEFAULT})
   set(CTEST_USE_LAUNCHERS "$ENV{CTEST_USE_LAUNCHERS_DEFAULT}"

+ 36 - 35
Modules/CheckCXXSymbolExists.cmake

@@ -1,41 +1,42 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CheckCXXSymbolExists
-# --------------------
-#
-# Check if a symbol exists as a function, variable, or macro in C++
-#
-# .. code-block:: cmake
-#
-#   CHECK_CXX_SYMBOL_EXISTS(<symbol> <files> <variable>)
-#
-# Check that the ``<symbol>`` is available after including given header
-# ``<files>`` and store the result in a ``<variable>``.  Specify the list of
-# files in one argument as a semicolon-separated list.
-# CHECK_CXX_SYMBOL_EXISTS() can be used to check in C++ files, as
-# opposed to CHECK_SYMBOL_EXISTS(), which works only for C.
-#
-# If the header files define the symbol as a macro it is considered
-# available and assumed to work.  If the header files declare the symbol
-# as a function or variable then the symbol must also be available for
-# linking.  If the symbol is a type or enum value it will not be
-# recognized (consider using CheckTypeSize or CheckCSourceCompiles).
-#
-# The following variables may be set before calling this macro to modify
-# the way the check is run:
-#
-# ``CMAKE_REQUIRED_FLAGS``
-#    string of compile command line flags
-# ``CMAKE_REQUIRED_DEFINITIONS``
-#    list of macros to define (-DFOO=bar)
-# ``CMAKE_REQUIRED_INCLUDES``
-#    list of include directories
-# ``CMAKE_REQUIRED_LIBRARIES``
-#    list of libraries to link
-# ``CMAKE_REQUIRED_QUIET``
-#    execute quietly without messages
+#[=======================================================================[.rst:
+CheckCXXSymbolExists
+--------------------
+
+Check if a symbol exists as a function, variable, or macro in C++
+
+.. code-block:: cmake
+
+  CHECK_CXX_SYMBOL_EXISTS(<symbol> <files> <variable>)
+
+Check that the ``<symbol>`` is available after including given header
+``<files>`` and store the result in a ``<variable>``.  Specify the list of
+files in one argument as a semicolon-separated list.
+CHECK_CXX_SYMBOL_EXISTS() can be used to check in C++ files, as
+opposed to CHECK_SYMBOL_EXISTS(), which works only for C.
+
+If the header files define the symbol as a macro it is considered
+available and assumed to work.  If the header files declare the symbol
+as a function or variable then the symbol must also be available for
+linking.  If the symbol is a type or enum value it will not be
+recognized (consider using CheckTypeSize or CheckCSourceCompiles).
+
+The following variables may be set before calling this macro to modify
+the way the check is run:
+
+``CMAKE_REQUIRED_FLAGS``
+   string of compile command line flags
+``CMAKE_REQUIRED_DEFINITIONS``
+   list of macros to define (-DFOO=bar)
+``CMAKE_REQUIRED_INCLUDES``
+   list of include directories
+``CMAKE_REQUIRED_LIBRARIES``
+   list of libraries to link
+``CMAKE_REQUIRED_QUIET``
+   execute quietly without messages
+#]=======================================================================]
 
 include_guard(GLOBAL)
 include(CheckSymbolExists)

+ 23 - 22
Modules/CheckFortranFunctionExists.cmake

@@ -1,28 +1,29 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CheckFortranFunctionExists
-# --------------------------
-#
-# :command:`Macro <macro>` which checks if a Fortran function exists.
-#
-# .. code-block:: cmake
-#
-#   CHECK_FORTRAN_FUNCTION_EXISTS(<function> <result>)
-#
-# where
-#
-# ``<function>``
-#   the name of the Fortran function
-# ``<result>``
-#   variable to store the result; will be created as an internal cache variable.
-#
-# The following variables may be set before calling this macro to modify
-# the way the check is run:
-#
-# ``CMAKE_REQUIRED_LIBRARIES``
-#   list of libraries to link
+#[=======================================================================[.rst:
+CheckFortranFunctionExists
+--------------------------
+
+:command:`Macro <macro>` which checks if a Fortran function exists.
+
+.. code-block:: cmake
+
+  CHECK_FORTRAN_FUNCTION_EXISTS(<function> <result>)
+
+where
+
+``<function>``
+  the name of the Fortran function
+``<result>``
+  variable to store the result; will be created as an internal cache variable.
+
+The following variables may be set before calling this macro to modify
+the way the check is run:
+
+``CMAKE_REQUIRED_LIBRARIES``
+  list of libraries to link
+#]=======================================================================]
 
 include_guard(GLOBAL)
 

+ 42 - 41
Modules/CheckFunctionExists.cmake

@@ -1,47 +1,48 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CheckFunctionExists
-# -------------------
-#
-# Check if a C function can be linked
-#
-# .. code-block:: cmake
-#
-#   check_function_exists(<function> <variable>)
-#
-# Checks that the ``<function>`` is provided by libraries on the system and store
-# the result in a ``<variable>``, which will be created as an internal
-# cache variable.
-#
-# The following variables may be set before calling this macro to modify the
-# way the check is run:
-#
-# ``CMAKE_REQUIRED_FLAGS``
-#   string of compile command line flags
-# ``CMAKE_REQUIRED_DEFINITIONS``
-#   list of macros to define (-DFOO=bar)
-# ``CMAKE_REQUIRED_INCLUDES``
-#   list of include directories
-# ``CMAKE_REQUIRED_LIBRARIES``
-#   list of libraries to link
-# ``CMAKE_REQUIRED_QUIET``
-#   execute quietly without messages
-#
-# .. note::
-#
-#   Prefer using :Module:`CheckSymbolExists` instead of this module,
-#   for the following reasons:
-#
-#   * ``check_function_exists()`` can't detect functions that are inlined
-#     in headers or specified as a macro.
-#
-#   * ``check_function_exists()`` can't detect anything in the 32-bit
-#     versions of the Win32 API, because of a mismatch in calling conventions.
-#
-#   * ``check_function_exists()`` only verifies linking, it does not verify
-#     that the function is declared in system headers.
+#[=======================================================================[.rst:
+CheckFunctionExists
+-------------------
+
+Check if a C function can be linked
+
+.. code-block:: cmake
+
+  check_function_exists(<function> <variable>)
+
+Checks that the ``<function>`` is provided by libraries on the system and store
+the result in a ``<variable>``, which will be created as an internal
+cache variable.
+
+The following variables may be set before calling this macro to modify the
+way the check is run:
+
+``CMAKE_REQUIRED_FLAGS``
+  string of compile command line flags
+``CMAKE_REQUIRED_DEFINITIONS``
+  list of macros to define (-DFOO=bar)
+``CMAKE_REQUIRED_INCLUDES``
+  list of include directories
+``CMAKE_REQUIRED_LIBRARIES``
+  list of libraries to link
+``CMAKE_REQUIRED_QUIET``
+  execute quietly without messages
+
+.. note::
+
+  Prefer using :Module:`CheckSymbolExists` instead of this module,
+  for the following reasons:
+
+  * ``check_function_exists()`` can't detect functions that are inlined
+    in headers or specified as a macro.
+
+  * ``check_function_exists()`` can't detect anything in the 32-bit
+    versions of the Win32 API, because of a mismatch in calling conventions.
+
+  * ``check_function_exists()`` only verifies linking, it does not verify
+    that the function is declared in system headers.
+#]=======================================================================]
 
 include_guard(GLOBAL)
 

+ 35 - 34
Modules/CheckIncludeFile.cmake

@@ -1,40 +1,41 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CheckIncludeFile
-# ----------------
-#
-# Provides a macro to check if a header file can be included in ``C``.
-#
-# .. command:: CHECK_INCLUDE_FILE
-#
-#   ::
-#
-#     CHECK_INCLUDE_FILE(<include> <variable> [<flags>])
-#
-#   Check if the given ``<include>`` file may be included in a ``C``
-#   source file and store the result in an internal cache entry named
-#   ``<variable>``.  The optional third argument may be used to add
-#   compilation flags to the check (or use ``CMAKE_REQUIRED_FLAGS`` below).
-#
-# The following variables may be set before calling this macro to modify
-# the way the check is run:
-#
-# ``CMAKE_REQUIRED_FLAGS``
-#   string of compile command line flags
-# ``CMAKE_REQUIRED_DEFINITIONS``
-#   list of macros to define (-DFOO=bar)
-# ``CMAKE_REQUIRED_INCLUDES``
-#   list of include directories
-# ``CMAKE_REQUIRED_LIBRARIES``
-#   A list of libraries to link.  See policy :policy:`CMP0075`.
-# ``CMAKE_REQUIRED_QUIET``
-#   execute quietly without messages
-#
-# See the :module:`CheckIncludeFiles` module to check for multiple headers
-# at once.  See the :module:`CheckIncludeFileCXX` module to check for headers
-# using the ``CXX`` language.
+#[=======================================================================[.rst:
+CheckIncludeFile
+----------------
+
+Provides a macro to check if a header file can be included in ``C``.
+
+.. command:: CHECK_INCLUDE_FILE
+
+  ::
+
+    CHECK_INCLUDE_FILE(<include> <variable> [<flags>])
+
+  Check if the given ``<include>`` file may be included in a ``C``
+  source file and store the result in an internal cache entry named
+  ``<variable>``.  The optional third argument may be used to add
+  compilation flags to the check (or use ``CMAKE_REQUIRED_FLAGS`` below).
+
+The following variables may be set before calling this macro to modify
+the way the check is run:
+
+``CMAKE_REQUIRED_FLAGS``
+  string of compile command line flags
+``CMAKE_REQUIRED_DEFINITIONS``
+  list of macros to define (-DFOO=bar)
+``CMAKE_REQUIRED_INCLUDES``
+  list of include directories
+``CMAKE_REQUIRED_LIBRARIES``
+  A list of libraries to link.  See policy :policy:`CMP0075`.
+``CMAKE_REQUIRED_QUIET``
+  execute quietly without messages
+
+See the :module:`CheckIncludeFiles` module to check for multiple headers
+at once.  See the :module:`CheckIncludeFileCXX` module to check for headers
+using the ``CXX`` language.
+#]=======================================================================]
 
 include_guard(GLOBAL)
 

+ 34 - 33
Modules/CheckIncludeFileCXX.cmake

@@ -1,39 +1,40 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CheckIncludeFileCXX
-# -------------------
-#
-# Provides a macro to check if a header file can be included in ``CXX``.
-#
-# .. command:: CHECK_INCLUDE_FILE_CXX
-#
-#   ::
-#
-#     CHECK_INCLUDE_FILE_CXX(<include> <variable> [<flags>])
-#
-#   Check if the given ``<include>`` file may be included in a ``CXX``
-#   source file and store the result in an internal cache entry named
-#   ``<variable>``.  The optional third argument may be used to add
-#   compilation flags to the check (or use ``CMAKE_REQUIRED_FLAGS`` below).
-#
-# The following variables may be set before calling this macro to modify
-# the way the check is run:
-#
-# ``CMAKE_REQUIRED_FLAGS``
-#   string of compile command line flags
-# ``CMAKE_REQUIRED_DEFINITIONS``
-#   list of macros to define (-DFOO=bar)
-# ``CMAKE_REQUIRED_INCLUDES``
-#   list of include directories
-# ``CMAKE_REQUIRED_LIBRARIES``
-#   A list of libraries to link.  See policy :policy:`CMP0075`.
-# ``CMAKE_REQUIRED_QUIET``
-#   execute quietly without messages
-#
-# See modules :module:`CheckIncludeFile` and :module:`CheckIncludeFiles`
-# to check for one or more ``C`` headers.
+#[=======================================================================[.rst:
+CheckIncludeFileCXX
+-------------------
+
+Provides a macro to check if a header file can be included in ``CXX``.
+
+.. command:: CHECK_INCLUDE_FILE_CXX
+
+  ::
+
+    CHECK_INCLUDE_FILE_CXX(<include> <variable> [<flags>])
+
+  Check if the given ``<include>`` file may be included in a ``CXX``
+  source file and store the result in an internal cache entry named
+  ``<variable>``.  The optional third argument may be used to add
+  compilation flags to the check (or use ``CMAKE_REQUIRED_FLAGS`` below).
+
+The following variables may be set before calling this macro to modify
+the way the check is run:
+
+``CMAKE_REQUIRED_FLAGS``
+  string of compile command line flags
+``CMAKE_REQUIRED_DEFINITIONS``
+  list of macros to define (-DFOO=bar)
+``CMAKE_REQUIRED_INCLUDES``
+  list of include directories
+``CMAKE_REQUIRED_LIBRARIES``
+  A list of libraries to link.  See policy :policy:`CMP0075`.
+``CMAKE_REQUIRED_QUIET``
+  execute quietly without messages
+
+See modules :module:`CheckIncludeFile` and :module:`CheckIncludeFiles`
+to check for one or more ``C`` headers.
+#]=======================================================================]
 
 include_guard(GLOBAL)
 

+ 40 - 39
Modules/CheckIncludeFiles.cmake

@@ -1,45 +1,46 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CheckIncludeFiles
-# -----------------
-#
-# Provides a macro to check if a list of one or more header files can
-# be included together.
-#
-# .. command:: CHECK_INCLUDE_FILES
-#
-#   ::
-#
-#     CHECK_INCLUDE_FILES("<includes>" <variable> [LANGUAGE <language>])
-#
-#   Check if the given ``<includes>`` list may be included together
-#   in a source file and store the result in an internal cache
-#   entry named ``<variable>``.  Specify the ``<includes>`` argument
-#   as a :ref:`;-list <CMake Language Lists>` of header file names.
-#
-# If LANGUAGE is set, the specified compiler will be used to perform the
-# check. Acceptable values are ``C`` and ``CXX``. If not set, the C compiler
-# will be used if enabled. If the C compiler is not enabled, the C++
-# compiler will be used if enabled.
-#
-# The following variables may be set before calling this macro to modify
-# the way the check is run:
-#
-# ``CMAKE_REQUIRED_FLAGS``
-#   string of compile command line flags
-# ``CMAKE_REQUIRED_DEFINITIONS``
-#   list of macros to define (-DFOO=bar)
-# ``CMAKE_REQUIRED_INCLUDES``
-#   list of include directories
-# ``CMAKE_REQUIRED_LIBRARIES``
-#   A list of libraries to link.  See policy :policy:`CMP0075`.
-# ``CMAKE_REQUIRED_QUIET``
-#   execute quietly without messages
-#
-# See modules :module:`CheckIncludeFile` and :module:`CheckIncludeFileCXX`
-# to check for a single header file in ``C`` or ``CXX`` languages.
+#[=======================================================================[.rst:
+CheckIncludeFiles
+-----------------
+
+Provides a macro to check if a list of one or more header files can
+be included together.
+
+.. command:: CHECK_INCLUDE_FILES
+
+  ::
+
+    CHECK_INCLUDE_FILES("<includes>" <variable> [LANGUAGE <language>])
+
+  Check if the given ``<includes>`` list may be included together
+  in a source file and store the result in an internal cache
+  entry named ``<variable>``.  Specify the ``<includes>`` argument
+  as a :ref:`;-list <CMake Language Lists>` of header file names.
+
+If LANGUAGE is set, the specified compiler will be used to perform the
+check. Acceptable values are ``C`` and ``CXX``. If not set, the C compiler
+will be used if enabled. If the C compiler is not enabled, the C++
+compiler will be used if enabled.
+
+The following variables may be set before calling this macro to modify
+the way the check is run:
+
+``CMAKE_REQUIRED_FLAGS``
+  string of compile command line flags
+``CMAKE_REQUIRED_DEFINITIONS``
+  list of macros to define (-DFOO=bar)
+``CMAKE_REQUIRED_INCLUDES``
+  list of include directories
+``CMAKE_REQUIRED_LIBRARIES``
+  A list of libraries to link.  See policy :policy:`CMP0075`.
+``CMAKE_REQUIRED_QUIET``
+  execute quietly without messages
+
+See modules :module:`CheckIncludeFile` and :module:`CheckIncludeFileCXX`
+to check for a single header file in ``C`` or ``CXX`` languages.
+#]=======================================================================]
 
 include_guard(GLOBAL)
 

+ 30 - 29
Modules/CheckLanguage.cmake

@@ -1,35 +1,36 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CheckLanguage
-# -------------
-#
-# Check if a language can be enabled
-#
-# Usage:
-#
-# ::
-#
-#   check_language(<lang>)
-#
-# where <lang> is a language that may be passed to enable_language()
-# such as "Fortran".  If CMAKE_<lang>_COMPILER is already defined the
-# check does nothing.  Otherwise it tries enabling the language in a
-# test project.  The result is cached in CMAKE_<lang>_COMPILER as the
-# compiler that was found, or NOTFOUND if the language cannot be
-# enabled.
-#
-# Example:
-#
-# ::
-#
-#   check_language(Fortran)
-#   if(CMAKE_Fortran_COMPILER)
-#     enable_language(Fortran)
-#   else()
-#     message(STATUS "No Fortran support")
-#   endif()
+#[=======================================================================[.rst:
+CheckLanguage
+-------------
+
+Check if a language can be enabled
+
+Usage:
+
+::
+
+  check_language(<lang>)
+
+where <lang> is a language that may be passed to enable_language()
+such as "Fortran".  If CMAKE_<lang>_COMPILER is already defined the
+check does nothing.  Otherwise it tries enabling the language in a
+test project.  The result is cached in CMAKE_<lang>_COMPILER as the
+compiler that was found, or NOTFOUND if the language cannot be
+enabled.
+
+Example:
+
+::
+
+  check_language(Fortran)
+  if(CMAKE_Fortran_COMPILER)
+    enable_language(Fortran)
+  else()
+    message(STATUS "No Fortran support")
+  endif()
+#]=======================================================================]
 
 include_guard(GLOBAL)
 

+ 28 - 27
Modules/CheckLibraryExists.cmake

@@ -1,33 +1,34 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CheckLibraryExists
-# ------------------
-#
-# Check if the function exists.
-#
-# CHECK_LIBRARY_EXISTS (LIBRARY FUNCTION LOCATION VARIABLE)
-#
-# ::
-#
-#   LIBRARY  - the name of the library you are looking for
-#   FUNCTION - the name of the function
-#   LOCATION - location where the library should be found
-#   VARIABLE - variable to store the result
-#              Will be created as an internal cache variable.
-#
-#
-#
-# The following variables may be set before calling this macro to modify
-# the way the check is run:
-#
-# ::
-#
-#   CMAKE_REQUIRED_FLAGS = string of compile command line flags
-#   CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
-#   CMAKE_REQUIRED_LIBRARIES = list of libraries to link
-#   CMAKE_REQUIRED_QUIET = execute quietly without messages
+#[=======================================================================[.rst:
+CheckLibraryExists
+------------------
+
+Check if the function exists.
+
+CHECK_LIBRARY_EXISTS (LIBRARY FUNCTION LOCATION VARIABLE)
+
+::
+
+  LIBRARY  - the name of the library you are looking for
+  FUNCTION - the name of the function
+  LOCATION - location where the library should be found
+  VARIABLE - variable to store the result
+             Will be created as an internal cache variable.
+
+
+
+The following variables may be set before calling this macro to modify
+the way the check is run:
+
+::
+
+  CMAKE_REQUIRED_FLAGS = string of compile command line flags
+  CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+  CMAKE_REQUIRED_LIBRARIES = list of libraries to link
+  CMAKE_REQUIRED_QUIET = execute quietly without messages
+#]=======================================================================]
 
 include_guard(GLOBAL)
 

+ 38 - 37
Modules/CheckPrototypeDefinition.cmake

@@ -1,43 +1,44 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CheckPrototypeDefinition
-# ------------------------
-#
-# Check if the prototype we expect is correct.
-#
-# check_prototype_definition(FUNCTION PROTOTYPE RETURN HEADER VARIABLE)
-#
-# ::
-#
-#   FUNCTION - The name of the function (used to check if prototype exists)
-#   PROTOTYPE- The prototype to check.
-#   RETURN - The return value of the function.
-#   HEADER - The header files required.
-#   VARIABLE - The variable to store the result.
-#              Will be created as an internal cache variable.
-#
-# Example:
-#
-# ::
-#
-#   check_prototype_definition(getpwent_r
-#    "struct passwd *getpwent_r(struct passwd *src, char *buf, int buflen)"
-#    "NULL"
-#    "unistd.h;pwd.h"
-#    SOLARIS_GETPWENT_R)
-#
-# The following variables may be set before calling this macro to modify
-# the way the check is run:
-#
-# ::
-#
-#   CMAKE_REQUIRED_FLAGS = string of compile command line flags
-#   CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
-#   CMAKE_REQUIRED_INCLUDES = list of include directories
-#   CMAKE_REQUIRED_LIBRARIES = list of libraries to link
-#   CMAKE_REQUIRED_QUIET = execute quietly without messages
+#[=======================================================================[.rst:
+CheckPrototypeDefinition
+------------------------
+
+Check if the prototype we expect is correct.
+
+check_prototype_definition(FUNCTION PROTOTYPE RETURN HEADER VARIABLE)
+
+::
+
+  FUNCTION - The name of the function (used to check if prototype exists)
+  PROTOTYPE- The prototype to check.
+  RETURN - The return value of the function.
+  HEADER - The header files required.
+  VARIABLE - The variable to store the result.
+             Will be created as an internal cache variable.
+
+Example:
+
+::
+
+  check_prototype_definition(getpwent_r
+   "struct passwd *getpwent_r(struct passwd *src, char *buf, int buflen)"
+   "NULL"
+   "unistd.h;pwd.h"
+   SOLARIS_GETPWENT_R)
+
+The following variables may be set before calling this macro to modify
+the way the check is run:
+
+::
+
+  CMAKE_REQUIRED_FLAGS = string of compile command line flags
+  CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+  CMAKE_REQUIRED_INCLUDES = list of include directories
+  CMAKE_REQUIRED_LIBRARIES = list of libraries to link
+  CMAKE_REQUIRED_QUIET = execute quietly without messages
+#]=======================================================================]
 
 #
 

+ 37 - 36
Modules/CheckStructHasMember.cmake

@@ -1,42 +1,43 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CheckStructHasMember
-# --------------------
-#
-# Check if the given struct or class has the specified member variable
-#
-# ::
-#
-#  CHECK_STRUCT_HAS_MEMBER(<struct> <member> <header> <variable>
-#                          [LANGUAGE <language>])
-#
-# ::
-#
-#   <struct> - the name of the struct or class you are interested in
-#   <member> - the member which existence you want to check
-#   <header> - the header(s) where the prototype should be declared
-#   <variable> - variable to store the result
-#   <language> - the compiler to use (C or CXX)
-#
-#
-#
-# The following variables may be set before calling this macro to modify
-# the way the check is run:
-#
-# ::
-#
-#   CMAKE_REQUIRED_FLAGS = string of compile command line flags
-#   CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
-#   CMAKE_REQUIRED_INCLUDES = list of include directories
-#   CMAKE_REQUIRED_LIBRARIES = list of libraries to link
-#   CMAKE_REQUIRED_QUIET = execute quietly without messages
-#
-#
-#
-# Example: CHECK_STRUCT_HAS_MEMBER("struct timeval" tv_sec sys/select.h
-# HAVE_TIMEVAL_TV_SEC LANGUAGE C)
+#[=======================================================================[.rst:
+CheckStructHasMember
+--------------------
+
+Check if the given struct or class has the specified member variable
+
+::
+
+ CHECK_STRUCT_HAS_MEMBER(<struct> <member> <header> <variable>
+                         [LANGUAGE <language>])
+
+::
+
+  <struct> - the name of the struct or class you are interested in
+  <member> - the member which existence you want to check
+  <header> - the header(s) where the prototype should be declared
+  <variable> - variable to store the result
+  <language> - the compiler to use (C or CXX)
+
+
+
+The following variables may be set before calling this macro to modify
+the way the check is run:
+
+::
+
+  CMAKE_REQUIRED_FLAGS = string of compile command line flags
+  CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+  CMAKE_REQUIRED_INCLUDES = list of include directories
+  CMAKE_REQUIRED_LIBRARIES = list of libraries to link
+  CMAKE_REQUIRED_QUIET = execute quietly without messages
+
+
+
+Example: CHECK_STRUCT_HAS_MEMBER("struct timeval" tv_sec sys/select.h
+HAVE_TIMEVAL_TV_SEC LANGUAGE C)
+#]=======================================================================]
 
 include_guard(GLOBAL)
 include(CheckCSourceCompiles)

+ 67 - 66
Modules/CheckTypeSize.cmake

@@ -1,72 +1,73 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CheckTypeSize
-# -------------
-#
-# Check sizeof a type
-#
-# ::
-#
-#   CHECK_TYPE_SIZE(TYPE VARIABLE [BUILTIN_TYPES_ONLY]
-#                                 [LANGUAGE <language>])
-#
-# Check if the type exists and determine its size.  On return,
-# "HAVE_${VARIABLE}" holds the existence of the type, and "${VARIABLE}"
-# holds one of the following:
-#
-# ::
-#
-#    <size> = type has non-zero size <size>
-#    "0"    = type has arch-dependent size (see below)
-#    ""     = type does not exist
-#
-# Both ``HAVE_${VARIABLE}`` and ``${VARIABLE}`` will be created as internal
-# cache variables.
-#
-# Furthermore, the variable "${VARIABLE}_CODE" holds C preprocessor code
-# to define the macro "${VARIABLE}" to the size of the type, or leave
-# the macro undefined if the type does not exist.
-#
-# The variable "${VARIABLE}" may be "0" when CMAKE_OSX_ARCHITECTURES has
-# multiple architectures for building OS X universal binaries.  This
-# indicates that the type size varies across architectures.  In this
-# case "${VARIABLE}_CODE" contains C preprocessor tests mapping from
-# each architecture macro to the corresponding type size.  The list of
-# architecture macros is stored in "${VARIABLE}_KEYS", and the value for
-# each key is stored in "${VARIABLE}-${KEY}".
-#
-# If the BUILTIN_TYPES_ONLY option is not given, the macro checks for
-# headers <sys/types.h>, <stdint.h>, and <stddef.h>, and saves results
-# in HAVE_SYS_TYPES_H, HAVE_STDINT_H, and HAVE_STDDEF_H.  The type size
-# check automatically includes the available headers, thus supporting
-# checks of types defined in the headers.
-#
-# If LANGUAGE is set, the specified compiler will be used to perform the
-# check. Acceptable values are C and CXX
-#
-# Despite the name of the macro you may use it to check the size of more
-# complex expressions, too.  To check e.g.  for the size of a struct
-# member you can do something like this:
-#
-# ::
-#
-#   check_type_size("((struct something*)0)->member" SIZEOF_MEMBER)
-#
-#
-#
-# The following variables may be set before calling this macro to modify
-# the way the check is run:
-#
-# ::
-#
-#   CMAKE_REQUIRED_FLAGS = string of compile command line flags
-#   CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
-#   CMAKE_REQUIRED_INCLUDES = list of include directories
-#   CMAKE_REQUIRED_LIBRARIES = list of libraries to link
-#   CMAKE_REQUIRED_QUIET = execute quietly without messages
-#   CMAKE_EXTRA_INCLUDE_FILES = list of extra headers to include
+#[=======================================================================[.rst:
+CheckTypeSize
+-------------
+
+Check sizeof a type
+
+::
+
+  CHECK_TYPE_SIZE(TYPE VARIABLE [BUILTIN_TYPES_ONLY]
+                                [LANGUAGE <language>])
+
+Check if the type exists and determine its size.  On return,
+"HAVE_${VARIABLE}" holds the existence of the type, and "${VARIABLE}"
+holds one of the following:
+
+::
+
+   <size> = type has non-zero size <size>
+   "0"    = type has arch-dependent size (see below)
+   ""     = type does not exist
+
+Both ``HAVE_${VARIABLE}`` and ``${VARIABLE}`` will be created as internal
+cache variables.
+
+Furthermore, the variable "${VARIABLE}_CODE" holds C preprocessor code
+to define the macro "${VARIABLE}" to the size of the type, or leave
+the macro undefined if the type does not exist.
+
+The variable "${VARIABLE}" may be "0" when CMAKE_OSX_ARCHITECTURES has
+multiple architectures for building OS X universal binaries.  This
+indicates that the type size varies across architectures.  In this
+case "${VARIABLE}_CODE" contains C preprocessor tests mapping from
+each architecture macro to the corresponding type size.  The list of
+architecture macros is stored in "${VARIABLE}_KEYS", and the value for
+each key is stored in "${VARIABLE}-${KEY}".
+
+If the BUILTIN_TYPES_ONLY option is not given, the macro checks for
+headers <sys/types.h>, <stdint.h>, and <stddef.h>, and saves results
+in HAVE_SYS_TYPES_H, HAVE_STDINT_H, and HAVE_STDDEF_H.  The type size
+check automatically includes the available headers, thus supporting
+checks of types defined in the headers.
+
+If LANGUAGE is set, the specified compiler will be used to perform the
+check. Acceptable values are C and CXX
+
+Despite the name of the macro you may use it to check the size of more
+complex expressions, too.  To check e.g.  for the size of a struct
+member you can do something like this:
+
+::
+
+  check_type_size("((struct something*)0)->member" SIZEOF_MEMBER)
+
+
+
+The following variables may be set before calling this macro to modify
+the way the check is run:
+
+::
+
+  CMAKE_REQUIRED_FLAGS = string of compile command line flags
+  CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+  CMAKE_REQUIRED_INCLUDES = list of include directories
+  CMAKE_REQUIRED_LIBRARIES = list of libraries to link
+  CMAKE_REQUIRED_QUIET = execute quietly without messages
+  CMAKE_EXTRA_INCLUDE_FILES = list of extra headers to include
+#]=======================================================================]
 
 include(CheckIncludeFile)
 include(CheckIncludeFileCXX)

+ 31 - 30
Modules/CheckVariableExists.cmake

@@ -1,36 +1,37 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# CheckVariableExists
-# -------------------
-#
-# Check if the variable exists.
-#
-# ::
-#
-#   CHECK_VARIABLE_EXISTS(VAR VARIABLE)
-#
-#
-#
-# ::
-#
-#   VAR      - the name of the variable
-#   VARIABLE - variable to store the result
-#              Will be created as an internal cache variable.
-#
-#
-# This macro is only for C variables.
-#
-# The following variables may be set before calling this macro to modify
-# the way the check is run:
-#
-# ::
-#
-#   CMAKE_REQUIRED_FLAGS = string of compile command line flags
-#   CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
-#   CMAKE_REQUIRED_LIBRARIES = list of libraries to link
-#   CMAKE_REQUIRED_QUIET = execute quietly without messages
+#[=======================================================================[.rst:
+CheckVariableExists
+-------------------
+
+Check if the variable exists.
+
+::
+
+  CHECK_VARIABLE_EXISTS(VAR VARIABLE)
+
+
+
+::
+
+  VAR      - the name of the variable
+  VARIABLE - variable to store the result
+             Will be created as an internal cache variable.
+
+
+This macro is only for C variables.
+
+The following variables may be set before calling this macro to modify
+the way the check is run:
+
+::
+
+  CMAKE_REQUIRED_FLAGS = string of compile command line flags
+  CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+  CMAKE_REQUIRED_LIBRARIES = list of libraries to link
+  CMAKE_REQUIRED_QUIET = execute quietly without messages
+#]=======================================================================]
 
 include_guard(GLOBAL)
 

+ 22 - 21
Modules/Dart.cmake

@@ -1,27 +1,28 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# Dart
-# ----
-#
-# Configure a project for testing with CTest or old Dart Tcl Client
-#
-# This file is the backwards-compatibility version of the CTest module.
-# 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)
-#     # ... testing related CMake code ...
-#   endif()
-#
-# The BUILD_TESTING option is created by the Dart module to determine
-# whether testing support should be enabled.  The default is ON.
+#[=======================================================================[.rst:
+Dart
+----
+
+Configure a project for testing with CTest or old Dart Tcl Client
+
+This file is the backwards-compatibility version of the CTest module.
+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)
+    # ... testing related CMake code ...
+  endif()
+
+The BUILD_TESTING option is created by the Dart module to determine
+whether testing support should be enabled.  The default is ON.
+#]=======================================================================]
 
 # This file configures a project to use the Dart testing/dashboard process.
 # It is broken into 3 sections.

+ 9 - 8
Modules/Documentation.cmake

@@ -1,14 +1,15 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# Documentation
-# -------------
-#
-# DocumentationVTK.cmake
-#
-# This file provides support for the VTK documentation framework.  It
-# relies on several tools (Doxygen, Perl, etc).
+#[=======================================================================[.rst:
+Documentation
+-------------
+
+DocumentationVTK.cmake
+
+This file provides support for the VTK documentation framework.  It
+relies on several tools (Doxygen, Perl, etc).
+#]=======================================================================]
 
 #
 # Build the documentation ?

+ 39 - 38
Modules/FindALSA.cmake

@@ -1,44 +1,45 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindALSA
-# --------
-#
-# Find alsa
-#
-# Find the alsa libraries (asound)
-#
-# IMPORTED Targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines :prop_tgt:`IMPORTED` target ``ALSA::ALSA``, if
-# ALSA has been found.
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the following variables:
-#
-# ``ALSA_FOUND``
-#   True if ALSA_INCLUDE_DIR & ALSA_LIBRARY are found
-#
-# ``ALSA_LIBRARIES``
-#   List of libraries when using ALSA.
-#
-# ``ALSA_INCLUDE_DIRS``
-#   Where to find the ALSA headers.
-#
-# Cache variables
-# ^^^^^^^^^^^^^^^
-#
-# The following cache variables may also be set:
-#
-# ``ALSA_INCLUDE_DIR``
-#   the ALSA include directory
-#
-# ``ALSA_LIBRARY``
-#   the absolute path of the asound library
+#[=======================================================================[.rst:
+FindALSA
+--------
+
+Find alsa
+
+Find the alsa libraries (asound)
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines :prop_tgt:`IMPORTED` target ``ALSA::ALSA``, if
+ALSA has been found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``ALSA_FOUND``
+  True if ALSA_INCLUDE_DIR & ALSA_LIBRARY are found
+
+``ALSA_LIBRARIES``
+  List of libraries when using ALSA.
+
+``ALSA_INCLUDE_DIRS``
+  Where to find the ALSA headers.
+
+Cache variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``ALSA_INCLUDE_DIR``
+  the ALSA include directory
+
+``ALSA_LIBRARY``
+  the absolute path of the asound library
+#]=======================================================================]
 
 find_path(ALSA_INCLUDE_DIR NAMES alsa/asoundlib.h
           DOC "The ALSA (asound) include directory"

+ 16 - 15
Modules/FindASPELL.cmake

@@ -1,21 +1,22 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindASPELL
-# ----------
-#
-# Try to find ASPELL
-#
-# Once done this will define
-#
-# ::
-#
-#   ASPELL_FOUND - system has ASPELL
-#   ASPELL_EXECUTABLE - the ASPELL executable
-#   ASPELL_INCLUDE_DIR - the ASPELL include directory
-#   ASPELL_LIBRARIES - The libraries needed to use ASPELL
-#   ASPELL_DEFINITIONS - Compiler switches required for using ASPELL
+#[=======================================================================[.rst:
+FindASPELL
+----------
+
+Try to find ASPELL
+
+Once done this will define
+
+::
+
+  ASPELL_FOUND - system has ASPELL
+  ASPELL_EXECUTABLE - the ASPELL executable
+  ASPELL_INCLUDE_DIR - the ASPELL include directory
+  ASPELL_LIBRARIES - The libraries needed to use ASPELL
+  ASPELL_DEFINITIONS - Compiler switches required for using ASPELL
+#]=======================================================================]
 
 find_path(ASPELL_INCLUDE_DIR aspell.h )
 

+ 18 - 17
Modules/FindAVIFile.cmake

@@ -1,23 +1,24 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindAVIFile
-# -----------
-#
-# Locate AVIFILE library and include paths
-#
-# 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.  This module defines
-#
-# ::
-#
-#   AVIFILE_INCLUDE_DIR, where to find avifile.h , etc.
-#   AVIFILE_LIBRARIES, the libraries to link against
-#   AVIFILE_DEFINITIONS, definitions to use when compiling
-#   AVIFILE_FOUND, If false, don't try to use AVIFILE
+#[=======================================================================[.rst:
+FindAVIFile
+-----------
+
+Locate AVIFILE library and include paths
+
+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.  This module defines
+
+::
+
+  AVIFILE_INCLUDE_DIR, where to find avifile.h , etc.
+  AVIFILE_LIBRARIES, the libraries to link against
+  AVIFILE_DEFINITIONS, definitions to use when compiling
+  AVIFILE_FOUND, If false, don't try to use AVIFILE
+#]=======================================================================]
 
 if (UNIX)
 

+ 30 - 29
Modules/FindArmadillo.cmake

@@ -1,35 +1,36 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindArmadillo
-# -------------
-#
-# Find Armadillo
-#
-# Find the Armadillo C++ library
-#
-# Using Armadillo:
-#
-# ::
-#
-#   find_package(Armadillo REQUIRED)
-#   include_directories(${ARMADILLO_INCLUDE_DIRS})
-#   add_executable(foo foo.cc)
-#   target_link_libraries(foo ${ARMADILLO_LIBRARIES})
-#
-# This module sets the following variables:
-#
-# ::
-#
-#   ARMADILLO_FOUND - set to true if the library is found
-#   ARMADILLO_INCLUDE_DIRS - list of required include directories
-#   ARMADILLO_LIBRARIES - list of libraries to be linked
-#   ARMADILLO_VERSION_MAJOR - major version number
-#   ARMADILLO_VERSION_MINOR - minor version number
-#   ARMADILLO_VERSION_PATCH - patch version number
-#   ARMADILLO_VERSION_STRING - version number as a string (ex: "1.0.4")
-#   ARMADILLO_VERSION_NAME - name of the version (ex: "Antipodean Antileech")
+#[=======================================================================[.rst:
+FindArmadillo
+-------------
+
+Find Armadillo
+
+Find the Armadillo C++ library
+
+Using Armadillo:
+
+::
+
+  find_package(Armadillo REQUIRED)
+  include_directories(${ARMADILLO_INCLUDE_DIRS})
+  add_executable(foo foo.cc)
+  target_link_libraries(foo ${ARMADILLO_LIBRARIES})
+
+This module sets the following variables:
+
+::
+
+  ARMADILLO_FOUND - set to true if the library is found
+  ARMADILLO_INCLUDE_DIRS - list of required include directories
+  ARMADILLO_LIBRARIES - list of libraries to be linked
+  ARMADILLO_VERSION_MAJOR - major version number
+  ARMADILLO_VERSION_MINOR - minor version number
+  ARMADILLO_VERSION_PATCH - patch version number
+  ARMADILLO_VERSION_STRING - version number as a string (ex: "1.0.4")
+  ARMADILLO_VERSION_NAME - name of the version (ex: "Antipodean Antileech")
+#]=======================================================================]
 
 # UNIX paths are standard, no need to write.
 find_library(ARMADILLO_LIBRARY

+ 80 - 79
Modules/FindBISON.cmake

@@ -1,85 +1,86 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindBISON
-# ---------
-#
-# Find ``bison`` executable and provide a macro to generate custom build rules.
-#
-# The module defines the following variables:
-#
-# ``BISON_EXECUTABLE``
-#   path to the ``bison`` program
-#
-# ``BISON_VERSION``
-#   version of ``bison``
-#
-# ``BISON_FOUND``
-#   true if the program was found
-#
-# The minimum required version of ``bison`` can be specified using the
-# standard CMake syntax, e.g.  ``find_package(BISON 2.1.3)``.
-#
-# If ``bison`` is found, the module defines the macro::
-#
-#   BISON_TARGET(<Name> <YaccInput> <CodeOutput>
-#                [COMPILE_FLAGS <flags>]
-#                [DEFINES_FILE <file>]
-#                [VERBOSE [<file>]]
-#                [REPORT_FILE <file>]
-#                )
-#
-# which will create a custom rule to generate a parser.  ``<YaccInput>`` is
-# the path to a yacc file.  ``<CodeOutput>`` is the name of the source file
-# generated by bison.  A header file is also be generated, and contains
-# the token list.
-#
-# The options are:
-#
-# ``COMPILE_FLAGS <flags>``
-#   Specify flags to be added to the ``bison`` command line.
-#
-# ``DEFINES_FILE <file>``
-#   Specify a non-default header ``<file>`` to be generated by ``bison``.
-#
-# ``VERBOSE [<file>]``
-#   Tell ``bison`` to write a report file of the grammar and parser.
-#   If ``<file>`` is given, it specifies path the report file is copied to.
-#   ``[<file>]`` is left for backward compatibility of this module.
-#   Use ``VERBOSE REPORT_FILE <file>``.
-#
-# ``REPORT_FILE <file>``
-#   Specify a non-default report ``<file>``, if generated.
-#
-# The macro defines the following variables:
-#
-# ``BISON_<Name>_DEFINED``
-#   true is the macro ran successfully
-#
-# ``BISON_<Name>_INPUT``
-#   The input source file, an alias for <YaccInput>
-#
-# ``BISON_<Name>_OUTPUT_SOURCE``
-#   The source file generated by bison
-#
-# ``BISON_<Name>_OUTPUT_HEADER``
-#   The header file generated by bison
-#
-# ``BISON_<Name>_OUTPUTS``
-#   All files generated by bison including the source, the header and the report
-#
-# ``BISON_<Name>_COMPILE_FLAGS``
-#   Options used in the ``bison`` command line
-#
-# Example usage:
-#
-# .. code-block:: cmake
-#
-#   find_package(BISON)
-#   BISON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp
-#                DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/parser.h)
-#   add_executable(Foo main.cpp ${BISON_MyParser_OUTPUTS})
+#[=======================================================================[.rst:
+FindBISON
+---------
+
+Find ``bison`` executable and provide a macro to generate custom build rules.
+
+The module defines the following variables:
+
+``BISON_EXECUTABLE``
+  path to the ``bison`` program
+
+``BISON_VERSION``
+  version of ``bison``
+
+``BISON_FOUND``
+  true if the program was found
+
+The minimum required version of ``bison`` can be specified using the
+standard CMake syntax, e.g.  ``find_package(BISON 2.1.3)``.
+
+If ``bison`` is found, the module defines the macro::
+
+  BISON_TARGET(<Name> <YaccInput> <CodeOutput>
+               [COMPILE_FLAGS <flags>]
+               [DEFINES_FILE <file>]
+               [VERBOSE [<file>]]
+               [REPORT_FILE <file>]
+               )
+
+which will create a custom rule to generate a parser.  ``<YaccInput>`` is
+the path to a yacc file.  ``<CodeOutput>`` is the name of the source file
+generated by bison.  A header file is also be generated, and contains
+the token list.
+
+The options are:
+
+``COMPILE_FLAGS <flags>``
+  Specify flags to be added to the ``bison`` command line.
+
+``DEFINES_FILE <file>``
+  Specify a non-default header ``<file>`` to be generated by ``bison``.
+
+``VERBOSE [<file>]``
+  Tell ``bison`` to write a report file of the grammar and parser.
+  If ``<file>`` is given, it specifies path the report file is copied to.
+  ``[<file>]`` is left for backward compatibility of this module.
+  Use ``VERBOSE REPORT_FILE <file>``.
+
+``REPORT_FILE <file>``
+  Specify a non-default report ``<file>``, if generated.
+
+The macro defines the following variables:
+
+``BISON_<Name>_DEFINED``
+  true is the macro ran successfully
+
+``BISON_<Name>_INPUT``
+  The input source file, an alias for <YaccInput>
+
+``BISON_<Name>_OUTPUT_SOURCE``
+  The source file generated by bison
+
+``BISON_<Name>_OUTPUT_HEADER``
+  The header file generated by bison
+
+``BISON_<Name>_OUTPUTS``
+  All files generated by bison including the source, the header and the report
+
+``BISON_<Name>_COMPILE_FLAGS``
+  Options used in the ``bison`` command line
+
+Example usage:
+
+.. code-block:: cmake
+
+  find_package(BISON)
+  BISON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp
+               DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/parser.h)
+  add_executable(Foo main.cpp ${BISON_MyParser_OUTPUTS})
+#]=======================================================================]
 
 find_program(BISON_EXECUTABLE NAMES bison win_bison DOC "path to the bison executable")
 mark_as_advanced(BISON_EXECUTABLE)

+ 69 - 68
Modules/FindBLAS.cmake

@@ -1,74 +1,75 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindBLAS
-# --------
-#
-# Find BLAS library
-#
-# This module finds an installed fortran library that implements the
-# BLAS linear-algebra interface (see http://www.netlib.org/blas/).  The
-# list of libraries searched for is taken from the autoconf macro file,
-# acx_blas.m4 (distributed at
-# http://ac-archive.sourceforge.net/ac-archive/acx_blas.html).
-#
-# This module sets the following variables:
-#
-# ::
-#
-#   BLAS_FOUND - set to true if a library implementing the BLAS interface
-#     is found
-#   BLAS_LINKER_FLAGS - uncached list of required linker flags (excluding -l
-#     and -L).
-#   BLAS_LIBRARIES - uncached list of libraries (using full path name) to
-#     link against to use BLAS (may be empty if compiler implicitly links
-#     BLAS)
-#   BLAS95_LIBRARIES - uncached list of libraries (using full path name)
-#     to link against to use BLAS95 interface
-#   BLAS95_FOUND - set to true if a library implementing the BLAS f95 interface
-#     is found
-#
-# The following variables can be used to control this module:
-#
-# ::
-#
-#   BLA_STATIC  if set on this determines what kind of linkage we do (static)
-#   BLA_VENDOR  if set checks only the specified vendor, if not set checks
-#      all the possibilities
-#   BLA_F95     if set on tries to find the f95 interfaces for BLAS/LAPACK
-#   BLA_PREFER_PKGCONFIG  if set pkg-config will be used to search for a BLAS
-#      library first and if one is found that is preferred
-#
-# List of vendors (BLA_VENDOR) valid in this module:
-#
-# * Goto
-# * OpenBLAS
-# * FLAME
-# * ATLAS PhiPACK
-# * CXML
-# * DXML
-# * SunPerf
-# * SCSL
-# * SGIMATH
-# * IBMESSL
-# * Intel10_32 (intel mkl v10 32 bit)
-# * Intel10_64lp (intel mkl v10+ 64 bit, threaded code, lp64 model)
-# * Intel10_64lp_seq (intel mkl v10+ 64 bit, sequential code, lp64 model)
-# * Intel10_64ilp (intel mkl v10+ 64 bit, threaded code, ilp64 model)
-# * Intel10_64ilp_seq (intel mkl v10+ 64 bit, sequential code, ilp64 model)
-# * Intel (older versions of mkl 32 and 64 bit)
-# * ACML
-# * ACML_MP
-# * ACML_GPU
-# * Apple
-# * NAS
-# * Generic
-#
-# .. note::
-#
-#   C/CXX should be enabled to use Intel mkl
-#
+#[=======================================================================[.rst:
+FindBLAS
+--------
+
+Find BLAS library
+
+This module finds an installed fortran library that implements the
+BLAS linear-algebra interface (see http://www.netlib.org/blas/).  The
+list of libraries searched for is taken from the autoconf macro file,
+acx_blas.m4 (distributed at
+http://ac-archive.sourceforge.net/ac-archive/acx_blas.html).
+
+This module sets the following variables:
+
+::
+
+  BLAS_FOUND - set to true if a library implementing the BLAS interface
+    is found
+  BLAS_LINKER_FLAGS - uncached list of required linker flags (excluding -l
+    and -L).
+  BLAS_LIBRARIES - uncached list of libraries (using full path name) to
+    link against to use BLAS (may be empty if compiler implicitly links
+    BLAS)
+  BLAS95_LIBRARIES - uncached list of libraries (using full path name)
+    to link against to use BLAS95 interface
+  BLAS95_FOUND - set to true if a library implementing the BLAS f95 interface
+    is found
+
+The following variables can be used to control this module:
+
+::
+
+  BLA_STATIC  if set on this determines what kind of linkage we do (static)
+  BLA_VENDOR  if set checks only the specified vendor, if not set checks
+     all the possibilities
+  BLA_F95     if set on tries to find the f95 interfaces for BLAS/LAPACK
+  BLA_PREFER_PKGCONFIG  if set pkg-config will be used to search for a BLAS
+     library first and if one is found that is preferred
+
+List of vendors (BLA_VENDOR) valid in this module:
+
+* Goto
+* OpenBLAS
+* FLAME
+* ATLAS PhiPACK
+* CXML
+* DXML
+* SunPerf
+* SCSL
+* SGIMATH
+* IBMESSL
+* Intel10_32 (intel mkl v10 32 bit)
+* Intel10_64lp (intel mkl v10+ 64 bit, threaded code, lp64 model)
+* Intel10_64lp_seq (intel mkl v10+ 64 bit, sequential code, lp64 model)
+* Intel10_64ilp (intel mkl v10+ 64 bit, threaded code, ilp64 model)
+* Intel10_64ilp_seq (intel mkl v10+ 64 bit, sequential code, ilp64 model)
+* Intel (older versions of mkl 32 and 64 bit)
+* ACML
+* ACML_MP
+* ACML_GPU
+* Apple
+* NAS
+* Generic
+
+.. note::
+
+  C/CXX should be enabled to use Intel mkl
+
+#]=======================================================================]
 
 include(${CMAKE_CURRENT_LIST_DIR}/CheckFunctionExists.cmake)
 include(${CMAKE_CURRENT_LIST_DIR}/CheckFortranFunctionExists.cmake)

+ 36 - 35
Modules/FindBZip2.cmake

@@ -1,41 +1,42 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindBZip2
-# ---------
-#
-# Try to find BZip2
-#
-# IMPORTED Targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines :prop_tgt:`IMPORTED` target ``BZip2::BZip2``, if
-# BZip2 has been found.
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the following variables:
-#
-# ``BZIP2_FOUND``
-#   system has BZip2
-# ``BZIP2_INCLUDE_DIRS``
-#   the BZip2 include directories
-# ``BZIP2_LIBRARIES``
-#   Link these to use BZip2
-# ``BZIP2_NEED_PREFIX``
-#   this is set if the functions are prefixed with ``BZ2_``
-# ``BZIP2_VERSION_STRING``
-#   the version of BZip2 found
-#
-# Cache variables
-# ^^^^^^^^^^^^^^^
-#
-# The following cache variables may also be set:
-#
-# ``BZIP2_INCLUDE_DIR``
-#   the BZip2 include directory
+#[=======================================================================[.rst:
+FindBZip2
+---------
+
+Try to find BZip2
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines :prop_tgt:`IMPORTED` target ``BZip2::BZip2``, if
+BZip2 has been found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``BZIP2_FOUND``
+  system has BZip2
+``BZIP2_INCLUDE_DIRS``
+  the BZip2 include directories
+``BZIP2_LIBRARIES``
+  Link these to use BZip2
+``BZIP2_NEED_PREFIX``
+  this is set if the functions are prefixed with ``BZ2_``
+``BZIP2_VERSION_STRING``
+  the version of BZip2 found
+
+Cache variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``BZIP2_INCLUDE_DIR``
+  the BZip2 include directory
+#]=======================================================================]
 
 set(_BZIP2_PATHS PATHS
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Bzip2;InstallPath]"

+ 36 - 35
Modules/FindBacktrace.cmake

@@ -1,41 +1,42 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindBacktrace
-# -------------
-#
-# Find provider for backtrace(3).
-#
-# Checks if OS supports backtrace(3) via either libc or custom library.
-# This module defines the following variables:
-#
-# ``Backtrace_HEADER``
-#   The header file needed for backtrace(3). Cached.
-#   Could be forcibly set by user.
-# ``Backtrace_INCLUDE_DIRS``
-#   The include directories needed to use backtrace(3) header.
-# ``Backtrace_LIBRARIES``
-#   The libraries (linker flags) needed to use backtrace(3), if any.
-# ``Backtrace_FOUND``
-#   Is set if and only if backtrace(3) support detected.
-#
-# The following cache variables are also available to set or use:
-#
-# ``Backtrace_LIBRARY``
-#   The external library providing backtrace, if any.
-# ``Backtrace_INCLUDE_DIR``
-#   The directory holding the backtrace(3) header.
-#
-# Typical usage is to generate of header file using configure_file() with the
-# contents like the following::
-#
-#  #cmakedefine01 Backtrace_FOUND
-#  #if Backtrace_FOUND
-#  # include <${Backtrace_HEADER}>
-#  #endif
-#
-# And then reference that generated header file in actual source.
+#[=======================================================================[.rst:
+FindBacktrace
+-------------
+
+Find provider for backtrace(3).
+
+Checks if OS supports backtrace(3) via either libc or custom library.
+This module defines the following variables:
+
+``Backtrace_HEADER``
+  The header file needed for backtrace(3). Cached.
+  Could be forcibly set by user.
+``Backtrace_INCLUDE_DIRS``
+  The include directories needed to use backtrace(3) header.
+``Backtrace_LIBRARIES``
+  The libraries (linker flags) needed to use backtrace(3), if any.
+``Backtrace_FOUND``
+  Is set if and only if backtrace(3) support detected.
+
+The following cache variables are also available to set or use:
+
+``Backtrace_LIBRARY``
+  The external library providing backtrace, if any.
+``Backtrace_INCLUDE_DIR``
+  The directory holding the backtrace(3) header.
+
+Typical usage is to generate of header file using configure_file() with the
+contents like the following::
+
+ #cmakedefine01 Backtrace_FOUND
+ #if Backtrace_FOUND
+ # include <${Backtrace_HEADER}>
+ #endif
+
+And then reference that generated header file in actual source.
+#]=======================================================================]
 
 include(CMakePushCheckState)
 include(CheckSymbolExists)

+ 232 - 231
Modules/FindBoost.cmake

@@ -1,237 +1,238 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindBoost
-# ---------
-#
-# Find Boost include dirs and libraries
-#
-# Use this module by invoking find_package with the form::
-#
-#   find_package(Boost
-#     [version] [EXACT]      # Minimum or EXACT version e.g. 1.67.0
-#     [REQUIRED]             # Fail with error if Boost is not found
-#     [COMPONENTS <libs>...] # Boost libraries by their canonical name
-#                            # e.g. "date_time" for "libboost_date_time"
-#     [OPTIONAL_COMPONENTS <libs>...]
-#                            # Optional Boost libraries by their canonical name)
-#     )                      # e.g. "date_time" for "libboost_date_time"
-#
-# This module finds headers and requested component libraries OR a CMake
-# package configuration file provided by a "Boost CMake" build.  For the
-# latter case skip to the "Boost CMake" section below.  For the former
-# case results are reported in variables::
-#
-#   Boost_FOUND            - True if headers and requested libraries were found
-#   Boost_INCLUDE_DIRS     - Boost include directories
-#   Boost_LIBRARY_DIRS     - Link directories for Boost libraries
-#   Boost_LIBRARIES        - Boost component libraries to be linked
-#   Boost_<C>_FOUND        - True if component <C> was found (<C> is upper-case)
-#   Boost_<C>_LIBRARY      - Libraries to link for component <C> (may include
-#                            target_link_libraries debug/optimized keywords)
-#   Boost_VERSION          - BOOST_VERSION value from boost/version.hpp
-#   Boost_LIB_VERSION      - Version string appended to library filenames
-#   Boost_MAJOR_VERSION    - Boost major version number (X in X.y.z)
-#   Boost_MINOR_VERSION    - Boost minor version number (Y in x.Y.z)
-#   Boost_SUBMINOR_VERSION - Boost subminor version number (Z in x.y.Z)
-#   Boost_LIB_DIAGNOSTIC_DEFINITIONS (Windows)
-#                          - Pass to add_definitions() to have diagnostic
-#                            information about Boost's automatic linking
-#                            displayed during compilation
-#
-# Note that Boost Python components require a Python version suffix
-# (Boost 1.67 and later), e.g. ``python36`` or ``python27`` for the
-# versions built against Python 3.6 and 2.7, respectively.  This also
-# applies to additional components using Python including
-# ``mpi_python`` and ``numpy``.  Earlier Boost releases may use
-# distribution-specific suffixes such as ``2``, ``3`` or ``2.7``.
-# These may also be used as suffixes, but note that they are not
-# portable.
-#
-# This module reads hints about search locations from variables::
-#
-#   BOOST_ROOT             - Preferred installation prefix
-#    (or BOOSTROOT)
-#   BOOST_INCLUDEDIR       - Preferred include directory e.g. <prefix>/include
-#   BOOST_LIBRARYDIR       - Preferred library directory e.g. <prefix>/lib
-#   Boost_NO_SYSTEM_PATHS  - Set to ON to disable searching in locations not
-#                            specified by these hint variables. Default is OFF.
-#   Boost_ADDITIONAL_VERSIONS
-#                          - List of Boost versions not known to this module
-#                            (Boost install locations may contain the version)
-#
-# and saves search results persistently in CMake cache entries::
-#
-#   Boost_INCLUDE_DIR         - Directory containing Boost headers
-#   Boost_LIBRARY_DIR_RELEASE - Directory containing release Boost libraries
-#   Boost_LIBRARY_DIR_DEBUG   - Directory containing debug Boost libraries
-#   Boost_<C>_LIBRARY_DEBUG   - Component <C> library debug variant
-#   Boost_<C>_LIBRARY_RELEASE - Component <C> library release variant
-#
-# The following :prop_tgt:`IMPORTED` targets are also defined::
-#
-#   Boost::boost                  - Target for header-only dependencies
-#                                   (Boost include directory)
-#   Boost::<C>                    - Target for specific component dependency
-#                                   (shared or static library); <C> is lower-
-#                                   case
-#   Boost::diagnostic_definitions - interface target to enable diagnostic
-#                                   information about Boost's automatic linking
-#                                   during compilation (adds BOOST_LIB_DIAGNOSTIC)
-#   Boost::disable_autolinking    - interface target to disable automatic
-#                                   linking with MSVC (adds BOOST_ALL_NO_LIB)
-#   Boost::dynamic_linking        - interface target to enable dynamic linking
-#                                   linking with MSVC (adds BOOST_ALL_DYN_LINK)
-#
-# Implicit dependencies such as Boost::filesystem requiring
-# Boost::system will be automatically detected and satisfied, even
-# if system is not specified when using find_package and if
-# Boost::system is not added to target_link_libraries.  If using
-# Boost::thread, then Threads::Threads will also be added automatically.
-#
-# It is important to note that the imported targets behave differently
-# than variables created by this module: multiple calls to
-# find_package(Boost) in the same directory or sub-directories with
-# different options (e.g. static or shared) will not override the
-# values of the targets created by the first call.
-#
-# Users may set these hints or results as cache entries.  Projects
-# should not read these entries directly but instead use the above
-# result variables.  Note that some hint names start in upper-case
-# "BOOST".  One may specify these as environment variables if they are
-# not specified as CMake variables or cache entries.
-#
-# This module first searches for the Boost header files using the above
-# hint variables (excluding BOOST_LIBRARYDIR) and saves the result in
-# Boost_INCLUDE_DIR.  Then it searches for requested component libraries
-# using the above hints (excluding BOOST_INCLUDEDIR and
-# Boost_ADDITIONAL_VERSIONS), "lib" directories near Boost_INCLUDE_DIR,
-# and the library name configuration settings below.  It saves the
-# library directories in Boost_LIBRARY_DIR_DEBUG and
-# Boost_LIBRARY_DIR_RELEASE and individual library
-# locations in Boost_<C>_LIBRARY_DEBUG and Boost_<C>_LIBRARY_RELEASE.
-# When one changes settings used by previous searches in the same build
-# tree (excluding environment variables) this module discards previous
-# search results affected by the changes and searches again.
-#
-# Boost libraries come in many variants encoded in their file name.
-# Users or projects may tell this module which variant to find by
-# setting variables::
-#
-#   Boost_USE_DEBUG_LIBS     - Set to ON or OFF to specify whether to search
-#                              and use the debug libraries.  Default is ON.
-#   Boost_USE_RELEASE_LIBS   - Set to ON or OFF to specify whether to search
-#                              and use the release libraries.  Default is ON.
-#   Boost_USE_MULTITHREADED  - Set to OFF to use the non-multithreaded
-#                              libraries ('mt' tag).  Default is ON.
-#   Boost_USE_STATIC_LIBS    - Set to ON to force the use of the static
-#                              libraries.  Default is OFF.
-#   Boost_USE_STATIC_RUNTIME - Set to ON or OFF to specify whether to use
-#                              libraries linked statically to the C++ runtime
-#                              ('s' tag).  Default is platform dependent.
-#   Boost_USE_DEBUG_RUNTIME  - Set to ON or OFF to specify whether to use
-#                              libraries linked to the MS debug C++ runtime
-#                              ('g' tag).  Default is ON.
-#   Boost_USE_DEBUG_PYTHON   - Set to ON to use libraries compiled with a
-#                              debug Python build ('y' tag). Default is OFF.
-#   Boost_USE_STLPORT        - Set to ON to use libraries compiled with
-#                              STLPort ('p' tag).  Default is OFF.
-#   Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS
-#                            - Set to ON to use libraries compiled with
-#                              STLPort deprecated "native iostreams"
-#                              ('n' tag).  Default is OFF.
-#   Boost_COMPILER           - Set to the compiler-specific library suffix
-#                              (e.g. "-gcc43").  Default is auto-computed
-#                              for the C++ compiler in use.  A list may be
-#                              used if multiple compatible suffixes should
-#                              be tested for, in decreasing order of
-#                              preference.
-#   Boost_THREADAPI          - Suffix for "thread" component library name,
-#                              such as "pthread" or "win32".  Names with
-#                              and without this suffix will both be tried.
-#   Boost_NAMESPACE          - Alternate namespace used to build boost with
-#                              e.g. if set to "myboost", will search for
-#                              myboost_thread instead of boost_thread.
-#
-# Other variables one may set to control this module are::
-#
-#   Boost_DEBUG              - Set to ON to enable debug output from FindBoost.
-#                              Please enable this before filing any bug report.
-#   Boost_DETAILED_FAILURE_MSG
-#                            - Set to ON to add detailed information to the
-#                              failure message even when the REQUIRED option
-#                              is not given to the find_package call.
-#   Boost_REALPATH           - Set to ON to resolve symlinks for discovered
-#                              libraries to assist with packaging.  For example,
-#                              the "system" component library may be resolved to
-#                              "/usr/lib/libboost_system.so.1.67.0" instead of
-#                              "/usr/lib/libboost_system.so".  This does not
-#                              affect linking and should not be enabled unless
-#                              the user needs this information.
-#   Boost_LIBRARY_DIR        - Default value for Boost_LIBRARY_DIR_RELEASE and
-#                              Boost_LIBRARY_DIR_DEBUG.
-#
-# On Visual Studio and Borland compilers Boost headers request automatic
-# linking to corresponding libraries.  This requires matching libraries
-# to be linked explicitly or available in the link library search path.
-# In this case setting Boost_USE_STATIC_LIBS to OFF may not achieve
-# dynamic linking.  Boost automatic linking typically requests static
-# libraries with a few exceptions (such as Boost.Python).  Use::
-#
-#   add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
-#
-# to ask Boost to report information about automatic linking requests.
-#
-# Example to find Boost headers only::
-#
-#   find_package(Boost 1.36.0)
-#   if(Boost_FOUND)
-#     include_directories(${Boost_INCLUDE_DIRS})
-#     add_executable(foo foo.cc)
-#   endif()
-#
-# Example to find Boost libraries and use imported targets::
-#
-#   find_package(Boost 1.56 REQUIRED COMPONENTS
-#                date_time filesystem iostreams)
-#   add_executable(foo foo.cc)
-#   target_link_libraries(foo Boost::date_time Boost::filesystem
-#                             Boost::iostreams)
-#
-# Example to find Boost Python 3.6 libraries and use imported targets::
-#
-#   find_package(Boost 1.67 REQUIRED COMPONENTS
-#                python36 numpy36)
-#   add_executable(foo foo.cc)
-#   target_link_libraries(foo Boost::python36 Boost::numpy36)
-#
-# Example to find Boost headers and some *static* (release only) libraries::
-#
-#   set(Boost_USE_STATIC_LIBS        ON)  # only find static libs
-#   set(Boost_USE_DEBUG_LIBS         OFF) # ignore debug libs and
-#   set(Boost_USE_RELEASE_LIBS       ON)  # only find release libs
-#   set(Boost_USE_MULTITHREADED      ON)
-#   set(Boost_USE_STATIC_RUNTIME    OFF)
-#   find_package(Boost 1.66.0 COMPONENTS date_time filesystem system ...)
-#   if(Boost_FOUND)
-#     include_directories(${Boost_INCLUDE_DIRS})
-#     add_executable(foo foo.cc)
-#     target_link_libraries(foo ${Boost_LIBRARIES})
-#   endif()
-#
-# Boost CMake
-# ^^^^^^^^^^^
-#
-# If Boost was built using the boost-cmake project it provides a package
-# configuration file for use with find_package's Config mode.  This
-# module looks for the package configuration file called
-# BoostConfig.cmake or boost-config.cmake and stores the result in cache
-# entry "Boost_DIR".  If found, the package configuration file is loaded
-# and this module returns with no further action.  See documentation of
-# the Boost CMake package configuration for details on what it provides.
-#
-# Set Boost_NO_BOOST_CMAKE to ON to disable the search for boost-cmake.
+#[=======================================================================[.rst:
+FindBoost
+---------
+
+Find Boost include dirs and libraries
+
+Use this module by invoking find_package with the form::
+
+  find_package(Boost
+    [version] [EXACT]      # Minimum or EXACT version e.g. 1.67.0
+    [REQUIRED]             # Fail with error if Boost is not found
+    [COMPONENTS <libs>...] # Boost libraries by their canonical name
+                           # e.g. "date_time" for "libboost_date_time"
+    [OPTIONAL_COMPONENTS <libs>...]
+                           # Optional Boost libraries by their canonical name)
+    )                      # e.g. "date_time" for "libboost_date_time"
+
+This module finds headers and requested component libraries OR a CMake
+package configuration file provided by a "Boost CMake" build.  For the
+latter case skip to the "Boost CMake" section below.  For the former
+case results are reported in variables::
+
+  Boost_FOUND            - True if headers and requested libraries were found
+  Boost_INCLUDE_DIRS     - Boost include directories
+  Boost_LIBRARY_DIRS     - Link directories for Boost libraries
+  Boost_LIBRARIES        - Boost component libraries to be linked
+  Boost_<C>_FOUND        - True if component <C> was found (<C> is upper-case)
+  Boost_<C>_LIBRARY      - Libraries to link for component <C> (may include
+                           target_link_libraries debug/optimized keywords)
+  Boost_VERSION          - BOOST_VERSION value from boost/version.hpp
+  Boost_LIB_VERSION      - Version string appended to library filenames
+  Boost_MAJOR_VERSION    - Boost major version number (X in X.y.z)
+  Boost_MINOR_VERSION    - Boost minor version number (Y in x.Y.z)
+  Boost_SUBMINOR_VERSION - Boost subminor version number (Z in x.y.Z)
+  Boost_LIB_DIAGNOSTIC_DEFINITIONS (Windows)
+                         - Pass to add_definitions() to have diagnostic
+                           information about Boost's automatic linking
+                           displayed during compilation
+
+Note that Boost Python components require a Python version suffix
+(Boost 1.67 and later), e.g. ``python36`` or ``python27`` for the
+versions built against Python 3.6 and 2.7, respectively.  This also
+applies to additional components using Python including
+``mpi_python`` and ``numpy``.  Earlier Boost releases may use
+distribution-specific suffixes such as ``2``, ``3`` or ``2.7``.
+These may also be used as suffixes, but note that they are not
+portable.
+
+This module reads hints about search locations from variables::
+
+  BOOST_ROOT             - Preferred installation prefix
+   (or BOOSTROOT)
+  BOOST_INCLUDEDIR       - Preferred include directory e.g. <prefix>/include
+  BOOST_LIBRARYDIR       - Preferred library directory e.g. <prefix>/lib
+  Boost_NO_SYSTEM_PATHS  - Set to ON to disable searching in locations not
+                           specified by these hint variables. Default is OFF.
+  Boost_ADDITIONAL_VERSIONS
+                         - List of Boost versions not known to this module
+                           (Boost install locations may contain the version)
+
+and saves search results persistently in CMake cache entries::
+
+  Boost_INCLUDE_DIR         - Directory containing Boost headers
+  Boost_LIBRARY_DIR_RELEASE - Directory containing release Boost libraries
+  Boost_LIBRARY_DIR_DEBUG   - Directory containing debug Boost libraries
+  Boost_<C>_LIBRARY_DEBUG   - Component <C> library debug variant
+  Boost_<C>_LIBRARY_RELEASE - Component <C> library release variant
+
+The following :prop_tgt:`IMPORTED` targets are also defined::
+
+  Boost::boost                  - Target for header-only dependencies
+                                  (Boost include directory)
+  Boost::<C>                    - Target for specific component dependency
+                                  (shared or static library); <C> is lower-
+                                  case
+  Boost::diagnostic_definitions - interface target to enable diagnostic
+                                  information about Boost's automatic linking
+                                  during compilation (adds BOOST_LIB_DIAGNOSTIC)
+  Boost::disable_autolinking    - interface target to disable automatic
+                                  linking with MSVC (adds BOOST_ALL_NO_LIB)
+  Boost::dynamic_linking        - interface target to enable dynamic linking
+                                  linking with MSVC (adds BOOST_ALL_DYN_LINK)
+
+Implicit dependencies such as Boost::filesystem requiring
+Boost::system will be automatically detected and satisfied, even
+if system is not specified when using find_package and if
+Boost::system is not added to target_link_libraries.  If using
+Boost::thread, then Threads::Threads will also be added automatically.
+
+It is important to note that the imported targets behave differently
+than variables created by this module: multiple calls to
+find_package(Boost) in the same directory or sub-directories with
+different options (e.g. static or shared) will not override the
+values of the targets created by the first call.
+
+Users may set these hints or results as cache entries.  Projects
+should not read these entries directly but instead use the above
+result variables.  Note that some hint names start in upper-case
+"BOOST".  One may specify these as environment variables if they are
+not specified as CMake variables or cache entries.
+
+This module first searches for the Boost header files using the above
+hint variables (excluding BOOST_LIBRARYDIR) and saves the result in
+Boost_INCLUDE_DIR.  Then it searches for requested component libraries
+using the above hints (excluding BOOST_INCLUDEDIR and
+Boost_ADDITIONAL_VERSIONS), "lib" directories near Boost_INCLUDE_DIR,
+and the library name configuration settings below.  It saves the
+library directories in Boost_LIBRARY_DIR_DEBUG and
+Boost_LIBRARY_DIR_RELEASE and individual library
+locations in Boost_<C>_LIBRARY_DEBUG and Boost_<C>_LIBRARY_RELEASE.
+When one changes settings used by previous searches in the same build
+tree (excluding environment variables) this module discards previous
+search results affected by the changes and searches again.
+
+Boost libraries come in many variants encoded in their file name.
+Users or projects may tell this module which variant to find by
+setting variables::
+
+  Boost_USE_DEBUG_LIBS     - Set to ON or OFF to specify whether to search
+                             and use the debug libraries.  Default is ON.
+  Boost_USE_RELEASE_LIBS   - Set to ON or OFF to specify whether to search
+                             and use the release libraries.  Default is ON.
+  Boost_USE_MULTITHREADED  - Set to OFF to use the non-multithreaded
+                             libraries ('mt' tag).  Default is ON.
+  Boost_USE_STATIC_LIBS    - Set to ON to force the use of the static
+                             libraries.  Default is OFF.
+  Boost_USE_STATIC_RUNTIME - Set to ON or OFF to specify whether to use
+                             libraries linked statically to the C++ runtime
+                             ('s' tag).  Default is platform dependent.
+  Boost_USE_DEBUG_RUNTIME  - Set to ON or OFF to specify whether to use
+                             libraries linked to the MS debug C++ runtime
+                             ('g' tag).  Default is ON.
+  Boost_USE_DEBUG_PYTHON   - Set to ON to use libraries compiled with a
+                             debug Python build ('y' tag). Default is OFF.
+  Boost_USE_STLPORT        - Set to ON to use libraries compiled with
+                             STLPort ('p' tag).  Default is OFF.
+  Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS
+                           - Set to ON to use libraries compiled with
+                             STLPort deprecated "native iostreams"
+                             ('n' tag).  Default is OFF.
+  Boost_COMPILER           - Set to the compiler-specific library suffix
+                             (e.g. "-gcc43").  Default is auto-computed
+                             for the C++ compiler in use.  A list may be
+                             used if multiple compatible suffixes should
+                             be tested for, in decreasing order of
+                             preference.
+  Boost_THREADAPI          - Suffix for "thread" component library name,
+                             such as "pthread" or "win32".  Names with
+                             and without this suffix will both be tried.
+  Boost_NAMESPACE          - Alternate namespace used to build boost with
+                             e.g. if set to "myboost", will search for
+                             myboost_thread instead of boost_thread.
+
+Other variables one may set to control this module are::
+
+  Boost_DEBUG              - Set to ON to enable debug output from FindBoost.
+                             Please enable this before filing any bug report.
+  Boost_DETAILED_FAILURE_MSG
+                           - Set to ON to add detailed information to the
+                             failure message even when the REQUIRED option
+                             is not given to the find_package call.
+  Boost_REALPATH           - Set to ON to resolve symlinks for discovered
+                             libraries to assist with packaging.  For example,
+                             the "system" component library may be resolved to
+                             "/usr/lib/libboost_system.so.1.67.0" instead of
+                             "/usr/lib/libboost_system.so".  This does not
+                             affect linking and should not be enabled unless
+                             the user needs this information.
+  Boost_LIBRARY_DIR        - Default value for Boost_LIBRARY_DIR_RELEASE and
+                             Boost_LIBRARY_DIR_DEBUG.
+
+On Visual Studio and Borland compilers Boost headers request automatic
+linking to corresponding libraries.  This requires matching libraries
+to be linked explicitly or available in the link library search path.
+In this case setting Boost_USE_STATIC_LIBS to OFF may not achieve
+dynamic linking.  Boost automatic linking typically requests static
+libraries with a few exceptions (such as Boost.Python).  Use::
+
+  add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
+
+to ask Boost to report information about automatic linking requests.
+
+Example to find Boost headers only::
+
+  find_package(Boost 1.36.0)
+  if(Boost_FOUND)
+    include_directories(${Boost_INCLUDE_DIRS})
+    add_executable(foo foo.cc)
+  endif()
+
+Example to find Boost libraries and use imported targets::
+
+  find_package(Boost 1.56 REQUIRED COMPONENTS
+               date_time filesystem iostreams)
+  add_executable(foo foo.cc)
+  target_link_libraries(foo Boost::date_time Boost::filesystem
+                            Boost::iostreams)
+
+Example to find Boost Python 3.6 libraries and use imported targets::
+
+  find_package(Boost 1.67 REQUIRED COMPONENTS
+               python36 numpy36)
+  add_executable(foo foo.cc)
+  target_link_libraries(foo Boost::python36 Boost::numpy36)
+
+Example to find Boost headers and some *static* (release only) libraries::
+
+  set(Boost_USE_STATIC_LIBS        ON)  # only find static libs
+  set(Boost_USE_DEBUG_LIBS         OFF) # ignore debug libs and
+  set(Boost_USE_RELEASE_LIBS       ON)  # only find release libs
+  set(Boost_USE_MULTITHREADED      ON)
+  set(Boost_USE_STATIC_RUNTIME    OFF)
+  find_package(Boost 1.66.0 COMPONENTS date_time filesystem system ...)
+  if(Boost_FOUND)
+    include_directories(${Boost_INCLUDE_DIRS})
+    add_executable(foo foo.cc)
+    target_link_libraries(foo ${Boost_LIBRARIES})
+  endif()
+
+Boost CMake
+^^^^^^^^^^^
+
+If Boost was built using the boost-cmake project it provides a package
+configuration file for use with find_package's Config mode.  This
+module looks for the package configuration file called
+BoostConfig.cmake or boost-config.cmake and stores the result in cache
+entry "Boost_DIR".  If found, the package configuration file is loaded
+and this module returns with no further action.  See documentation of
+the Boost CMake package configuration for details on what it provides.
+
+Set Boost_NO_BOOST_CMAKE to ON to disable the search for boost-cmake.
+#]=======================================================================]
 
 # Save project's policies
 cmake_policy(PUSH)

+ 34 - 33
Modules/FindBullet.cmake

@@ -1,39 +1,40 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindBullet
-# ----------
-#
-# Try to find the Bullet physics engine
-#
-#
-#
-# ::
-#
-#   This module defines the following variables
-#
-#
-#
-# ::
-#
-#   BULLET_FOUND - Was bullet found
-#   BULLET_INCLUDE_DIRS - the Bullet include directories
-#   BULLET_LIBRARIES - Link to this, by default it includes
-#                      all bullet components (Dynamics,
-#                      Collision, LinearMath, & SoftBody)
-#
-#
-#
-# ::
-#
-#   This module accepts the following variables
-#
-#
-#
-# ::
-#
-#   BULLET_ROOT - Can be set to bullet install path or Windows build path
+#[=======================================================================[.rst:
+FindBullet
+----------
+
+Try to find the Bullet physics engine
+
+
+
+::
+
+  This module defines the following variables
+
+
+
+::
+
+  BULLET_FOUND - Was bullet found
+  BULLET_INCLUDE_DIRS - the Bullet include directories
+  BULLET_LIBRARIES - Link to this, by default it includes
+                     all bullet components (Dynamics,
+                     Collision, LinearMath, & SoftBody)
+
+
+
+::
+
+  This module accepts the following variables
+
+
+
+::
+
+  BULLET_ROOT - Can be set to bullet install path or Windows build path
+#]=======================================================================]
 
 macro(_FIND_BULLET_LIBRARY _var)
   find_library(${_var}

+ 22 - 21
Modules/FindCABLE.cmake

@@ -1,27 +1,28 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindCABLE
-# ---------
-#
-# Find CABLE
-#
-# This module finds if CABLE is installed and determines where the
-# include files and libraries are.  This code sets the following
-# variables:
-#
-# ::
-#
-#   CABLE             the path to the cable executable
-#   CABLE_TCL_LIBRARY the path to the Tcl wrapper library
-#   CABLE_INCLUDE_DIR the path to the include directory
-#
-#
-#
-# To build Tcl wrappers, you should add shared library and link it to
-# ${CABLE_TCL_LIBRARY}.  You should also add ${CABLE_INCLUDE_DIR} as an
-# include directory.
+#[=======================================================================[.rst:
+FindCABLE
+---------
+
+Find CABLE
+
+This module finds if CABLE is installed and determines where the
+include files and libraries are.  This code sets the following
+variables:
+
+::
+
+  CABLE             the path to the cable executable
+  CABLE_TCL_LIBRARY the path to the Tcl wrapper library
+  CABLE_INCLUDE_DIR the path to the include directory
+
+
+
+To build Tcl wrappers, you should add shared library and link it to
+${CABLE_TCL_LIBRARY}.  You should also add ${CABLE_INCLUDE_DIR} as an
+include directory.
+#]=======================================================================]
 
 if(NOT CABLE)
   find_path(CABLE_BUILD_DIR cableVersion.h)

+ 376 - 375
Modules/FindCUDA.cmake

@@ -1,378 +1,379 @@
-#.rst:
-# FindCUDA
-# --------
-#
-# .. note::
-#
-#   The FindCUDA module has been superseded by first-class support
-#   for the CUDA language in CMake.  It is no longer necessary to
-#   use this module or call ``find_package(CUDA)``.  This module
-#   now exists only for compatibility with projects that have not
-#   been ported.
-#
-#   Instead, list ``CUDA`` among the languages named in the top-level
-#   call to the :command:`project` command, or call the
-#   :command:`enable_language` command with ``CUDA``.
-#   Then one can add CUDA (``.cu``) sources to programs directly
-#   in calls to :command:`add_library` and :command:`add_executable`.
-#
-# Tools for building CUDA C files: libraries and build dependencies.
-#
-# This script locates the NVIDIA CUDA C tools.  It should work on Linux,
-# Windows, and macOS and should be reasonably up to date with CUDA C
-# releases.
-#
-# This script makes use of the standard :command:`find_package` arguments of
-# ``<VERSION>``, ``REQUIRED`` and ``QUIET``.  ``CUDA_FOUND`` will report if an
-# acceptable version of CUDA was found.
-#
-# The script will prompt the user to specify ``CUDA_TOOLKIT_ROOT_DIR`` if
-# the prefix cannot be determined by the location of nvcc in the system
-# path and ``REQUIRED`` is specified to :command:`find_package`.  To use
-# a different installed version of the toolkit set the environment variable
-# ``CUDA_BIN_PATH`` before running cmake (e.g.
-# ``CUDA_BIN_PATH=/usr/local/cuda1.0`` instead of the default
-# ``/usr/local/cuda``) or set ``CUDA_TOOLKIT_ROOT_DIR`` after configuring.  If
-# you change the value of ``CUDA_TOOLKIT_ROOT_DIR``, various components that
-# depend on the path will be relocated.
-#
-# It might be necessary to set ``CUDA_TOOLKIT_ROOT_DIR`` manually on certain
-# platforms, or to use a CUDA runtime not installed in the default
-# location.  In newer versions of the toolkit the CUDA library is
-# included with the graphics driver -- be sure that the driver version
-# matches what is needed by the CUDA runtime version.
-#
-# The following variables affect the behavior of the macros in the
-# script (in alphabetical order).  Note that any of these flags can be
-# changed multiple times in the same directory before calling
-# ``CUDA_ADD_EXECUTABLE``, ``CUDA_ADD_LIBRARY``, ``CUDA_COMPILE``,
-# ``CUDA_COMPILE_PTX``, ``CUDA_COMPILE_FATBIN``, ``CUDA_COMPILE_CUBIN``
-# or ``CUDA_WRAP_SRCS``::
-#
-#   CUDA_64_BIT_DEVICE_CODE (Default matches host bit size)
-#   -- Set to ON to compile for 64 bit device code, OFF for 32 bit device code.
-#      Note that making this different from the host code when generating object
-#      or C files from CUDA code just won't work, because size_t gets defined by
-#      nvcc in the generated source.  If you compile to PTX and then load the
-#      file yourself, you can mix bit sizes between device and host.
-#
-#   CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE (Default ON)
-#   -- Set to ON if you want the custom build rule to be attached to the source
-#      file in Visual Studio.  Turn OFF if you add the same cuda file to multiple
-#      targets.
-#
-#      This allows the user to build the target from the CUDA file; however, bad
-#      things can happen if the CUDA source file is added to multiple targets.
-#      When performing parallel builds it is possible for the custom build
-#      command to be run more than once and in parallel causing cryptic build
-#      errors.  VS runs the rules for every source file in the target, and a
-#      source can have only one rule no matter how many projects it is added to.
-#      When the rule is run from multiple targets race conditions can occur on
-#      the generated file.  Eventually everything will get built, but if the user
-#      is unaware of this behavior, there may be confusion.  It would be nice if
-#      this script could detect the reuse of source files across multiple targets
-#      and turn the option off for the user, but no good solution could be found.
-#
-#   CUDA_BUILD_CUBIN (Default OFF)
-#   -- Set to ON to enable and extra compilation pass with the -cubin option in
-#      Device mode. The output is parsed and register, shared memory usage is
-#      printed during build.
-#
-#   CUDA_BUILD_EMULATION (Default OFF for device mode)
-#   -- Set to ON for Emulation mode. -D_DEVICEEMU is defined for CUDA C files
-#      when CUDA_BUILD_EMULATION is TRUE.
-#
-#   CUDA_LINK_LIBRARIES_KEYWORD (Default "")
-#    -- The <PRIVATE|PUBLIC|INTERFACE> keyword to use for internal
-#       target_link_libraries calls. The default is to use no keyword which
-#       uses the old "plain" form of target_link_libraries. Note that is matters
-#       because whatever is used inside the FindCUDA module must also be used
-#       outside - the two forms of target_link_libraries cannot be mixed.
-#
-#   CUDA_GENERATED_OUTPUT_DIR (Default CMAKE_CURRENT_BINARY_DIR)
-#   -- Set to the path you wish to have the generated files placed.  If it is
-#      blank output files will be placed in CMAKE_CURRENT_BINARY_DIR.
-#      Intermediate files will always be placed in
-#      CMAKE_CURRENT_BINARY_DIR/CMakeFiles.
-#
-#   CUDA_HOST_COMPILATION_CPP (Default ON)
-#   -- Set to OFF for C compilation of host code.
-#
-#   CUDA_HOST_COMPILER (Default CMAKE_C_COMPILER)
-#   -- Set the host compiler to be used by nvcc.  Ignored if -ccbin or
-#      --compiler-bindir is already present in the CUDA_NVCC_FLAGS or
-#      CUDA_NVCC_FLAGS_<CONFIG> variables.  For Visual Studio targets,
-#      the host compiler is constructed with one or more visual studio macros
-#      such as $(VCInstallDir), that expands out to the path when
-#      the command is run from within VS.
-#      If the CUDAHOSTCXX environment variable is set it will
-#      be used as the default.
-#
-#   CUDA_NVCC_FLAGS
-#   CUDA_NVCC_FLAGS_<CONFIG>
-#   -- Additional NVCC command line arguments.  NOTE: multiple arguments must be
-#      semi-colon delimited (e.g. --compiler-options;-Wall)
-#
-#   CUDA_PROPAGATE_HOST_FLAGS (Default ON)
-#   -- Set to ON to propagate CMAKE_{C,CXX}_FLAGS and their configuration
-#      dependent counterparts (e.g. CMAKE_C_FLAGS_DEBUG) automatically to the
-#      host compiler through nvcc's -Xcompiler flag.  This helps make the
-#      generated host code match the rest of the system better.  Sometimes
-#      certain flags give nvcc problems, and this will help you turn the flag
-#      propagation off.  This does not affect the flags supplied directly to nvcc
-#      via CUDA_NVCC_FLAGS or through the OPTION flags specified through
-#      CUDA_ADD_LIBRARY, CUDA_ADD_EXECUTABLE, or CUDA_WRAP_SRCS.  Flags used for
-#      shared library compilation are not affected by this flag.
-#
-#   CUDA_SEPARABLE_COMPILATION (Default OFF)
-#   -- If set this will enable separable compilation for all CUDA runtime object
-#      files.  If used outside of CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY
-#      (e.g. calling CUDA_WRAP_SRCS directly),
-#      CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and
-#      CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called.
-#
-#   CUDA_SOURCE_PROPERTY_FORMAT
-#   -- If this source file property is set, it can override the format specified
-#      to CUDA_WRAP_SRCS (OBJ, PTX, CUBIN, or FATBIN).  If an input source file
-#      is not a .cu file, setting this file will cause it to be treated as a .cu
-#      file. See documentation for set_source_files_properties on how to set
-#      this property.
-#
-#   CUDA_USE_STATIC_CUDA_RUNTIME (Default ON)
-#   -- When enabled the static version of the CUDA runtime library will be used
-#      in CUDA_LIBRARIES.  If the version of CUDA configured doesn't support
-#      this option, then it will be silently disabled.
-#
-#   CUDA_VERBOSE_BUILD (Default OFF)
-#   -- Set to ON to see all the commands used when building the CUDA file.  When
-#      using a Makefile generator the value defaults to VERBOSE (run make
-#      VERBOSE=1 to see output), although setting CUDA_VERBOSE_BUILD to ON will
-#      always print the output.
-#
-# The script creates the following macros (in alphabetical order)::
-#
-#   CUDA_ADD_CUFFT_TO_TARGET( cuda_target )
-#   -- Adds the cufft library to the target (can be any target).  Handles whether
-#      you are in emulation mode or not.
-#
-#   CUDA_ADD_CUBLAS_TO_TARGET( cuda_target )
-#   -- Adds the cublas library to the target (can be any target).  Handles
-#      whether you are in emulation mode or not.
-#
-#   CUDA_ADD_EXECUTABLE( cuda_target file0 file1 ...
-#                        [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] [OPTIONS ...] )
-#   -- Creates an executable "cuda_target" which is made up of the files
-#      specified.  All of the non CUDA C files are compiled using the standard
-#      build rules specified by CMAKE and the cuda files are compiled to object
-#      files using nvcc and the host compiler.  In addition CUDA_INCLUDE_DIRS is
-#      added automatically to include_directories().  Some standard CMake target
-#      calls can be used on the target after calling this macro
-#      (e.g. set_target_properties and target_link_libraries), but setting
-#      properties that adjust compilation flags will not affect code compiled by
-#      nvcc.  Such flags should be modified before calling CUDA_ADD_EXECUTABLE,
-#      CUDA_ADD_LIBRARY or CUDA_WRAP_SRCS.
-#
-#   CUDA_ADD_LIBRARY( cuda_target file0 file1 ...
-#                     [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] [OPTIONS ...] )
-#   -- Same as CUDA_ADD_EXECUTABLE except that a library is created.
-#
-#   CUDA_BUILD_CLEAN_TARGET()
-#   -- Creates a convenience target that deletes all the dependency files
-#      generated.  You should make clean after running this target to ensure the
-#      dependency files get regenerated.
-#
-#   CUDA_COMPILE( generated_files file0 file1 ... [STATIC | SHARED | MODULE]
-#                 [OPTIONS ...] )
-#   -- Returns a list of generated files from the input source files to be used
-#      with ADD_LIBRARY or ADD_EXECUTABLE.
-#
-#   CUDA_COMPILE_PTX( generated_files file0 file1 ... [OPTIONS ...] )
-#   -- Returns a list of PTX files generated from the input source files.
-#
-#   CUDA_COMPILE_FATBIN( generated_files file0 file1 ... [OPTIONS ...] )
-#   -- Returns a list of FATBIN files generated from the input source files.
-#
-#   CUDA_COMPILE_CUBIN( generated_files file0 file1 ... [OPTIONS ...] )
-#   -- Returns a list of CUBIN files generated from the input source files.
-#
-#   CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME( output_file_var
-#                                                        cuda_target
-#                                                        object_files )
-#   -- Compute the name of the intermediate link file used for separable
-#      compilation.  This file name is typically passed into
-#      CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS.  output_file_var is produced
-#      based on cuda_target the list of objects files that need separable
-#      compilation as specified by object_files.  If the object_files list is
-#      empty, then output_file_var will be empty.  This function is called
-#      automatically for CUDA_ADD_LIBRARY and CUDA_ADD_EXECUTABLE.  Note that
-#      this is a function and not a macro.
-#
-#   CUDA_INCLUDE_DIRECTORIES( path0 path1 ... )
-#   -- Sets the directories that should be passed to nvcc
-#      (e.g. nvcc -Ipath0 -Ipath1 ... ). These paths usually contain other .cu
-#      files.
-#
-#
-#   CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS( output_file_var cuda_target
-#                                            nvcc_flags object_files)
-#   -- Generates the link object required by separable compilation from the given
-#      object files.  This is called automatically for CUDA_ADD_EXECUTABLE and
-#      CUDA_ADD_LIBRARY, but can be called manually when using CUDA_WRAP_SRCS
-#      directly.  When called from CUDA_ADD_LIBRARY or CUDA_ADD_EXECUTABLE the
-#      nvcc_flags passed in are the same as the flags passed in via the OPTIONS
-#      argument.  The only nvcc flag added automatically is the bitness flag as
-#      specified by CUDA_64_BIT_DEVICE_CODE.  Note that this is a function
-#      instead of a macro.
-#
-#   CUDA_SELECT_NVCC_ARCH_FLAGS(out_variable [target_CUDA_architectures])
-#   -- Selects GPU arch flags for nvcc based on target_CUDA_architectures
-#      target_CUDA_architectures : Auto | Common | All | LIST(ARCH_AND_PTX ...)
-#       - "Auto" detects local machine GPU compute arch at runtime.
-#       - "Common" and "All" cover common and entire subsets of architectures
-#      ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX
-#      NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal
-#      NUM: Any number. Only those pairs are currently accepted by NVCC though:
-#            2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2
-#      Returns LIST of flags to be added to CUDA_NVCC_FLAGS in ${out_variable}
-#      Additionally, sets ${out_variable}_readable to the resulting numeric list
-#      Example:
-#       CUDA_SELECT_NVCC_ARCH_FLAGS(ARCH_FLAGS 3.0 3.5+PTX 5.2(5.0) Maxwell)
-#        LIST(APPEND CUDA_NVCC_FLAGS ${ARCH_FLAGS})
-#
-#      More info on CUDA architectures: https://en.wikipedia.org/wiki/CUDA
-#      Note that this is a function instead of a macro.
-#
-#   CUDA_WRAP_SRCS ( cuda_target format generated_files file0 file1 ...
-#                    [STATIC | SHARED | MODULE] [OPTIONS ...] )
-#   -- This is where all the magic happens.  CUDA_ADD_EXECUTABLE,
-#      CUDA_ADD_LIBRARY, CUDA_COMPILE, and CUDA_COMPILE_PTX all call this
-#      function under the hood.
-#
-#      Given the list of files (file0 file1 ... fileN) this macro generates
-#      custom commands that generate either PTX or linkable objects (use "PTX" or
-#      "OBJ" for the format argument to switch).  Files that don't end with .cu
-#      or have the HEADER_FILE_ONLY property are ignored.
-#
-#      The arguments passed in after OPTIONS are extra command line options to
-#      give to nvcc.  You can also specify per configuration options by
-#      specifying the name of the configuration followed by the options.  General
-#      options must precede configuration specific options.  Not all
-#      configurations need to be specified, only the ones provided will be used.
-#
-#         OPTIONS -DFLAG=2 "-DFLAG_OTHER=space in flag"
-#         DEBUG -g
-#         RELEASE --use_fast_math
-#         RELWITHDEBINFO --use_fast_math;-g
-#         MINSIZEREL --use_fast_math
-#
-#      For certain configurations (namely VS generating object files with
-#      CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE set to ON), no generated file will
-#      be produced for the given cuda file.  This is because when you add the
-#      cuda file to Visual Studio it knows that this file produces an object file
-#      and will link in the resulting object file automatically.
-#
-#      This script will also generate a separate cmake script that is used at
-#      build time to invoke nvcc.  This is for several reasons.
-#
-#        1. nvcc can return negative numbers as return values which confuses
-#        Visual Studio into thinking that the command succeeded.  The script now
-#        checks the error codes and produces errors when there was a problem.
-#
-#        2. nvcc has been known to not delete incomplete results when it
-#        encounters problems.  This confuses build systems into thinking the
-#        target was generated when in fact an unusable file exists.  The script
-#        now deletes the output files if there was an error.
-#
-#        3. By putting all the options that affect the build into a file and then
-#        make the build rule dependent on the file, the output files will be
-#        regenerated when the options change.
-#
-#      This script also looks at optional arguments STATIC, SHARED, or MODULE to
-#      determine when to target the object compilation for a shared library.
-#      BUILD_SHARED_LIBS is ignored in CUDA_WRAP_SRCS, but it is respected in
-#      CUDA_ADD_LIBRARY.  On some systems special flags are added for building
-#      objects intended for shared libraries.  A preprocessor macro,
-#      <target_name>_EXPORTS is defined when a shared library compilation is
-#      detected.
-#
-#      Flags passed into add_definitions with -D or /D are passed along to nvcc.
-#
-#
-#
-# The script defines the following variables::
-#
-#   CUDA_VERSION_MAJOR    -- The major version of cuda as reported by nvcc.
-#   CUDA_VERSION_MINOR    -- The minor version.
-#   CUDA_VERSION
-#   CUDA_VERSION_STRING   -- CUDA_VERSION_MAJOR.CUDA_VERSION_MINOR
-#   CUDA_HAS_FP16         -- Whether a short float (float16,fp16) is supported.
-#
-#   CUDA_TOOLKIT_ROOT_DIR -- Path to the CUDA Toolkit (defined if not set).
-#   CUDA_SDK_ROOT_DIR     -- Path to the CUDA SDK.  Use this to find files in the
-#                            SDK.  This script will not directly support finding
-#                            specific libraries or headers, as that isn't
-#                            supported by NVIDIA.  If you want to change
-#                            libraries when the path changes see the
-#                            FindCUDA.cmake script for an example of how to clear
-#                            these variables.  There are also examples of how to
-#                            use the CUDA_SDK_ROOT_DIR to locate headers or
-#                            libraries, if you so choose (at your own risk).
-#   CUDA_INCLUDE_DIRS     -- Include directory for cuda headers.  Added automatically
-#                            for CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY.
-#   CUDA_LIBRARIES        -- Cuda RT library.
-#   CUDA_CUFFT_LIBRARIES  -- Device or emulation library for the Cuda FFT
-#                            implementation (alternative to:
-#                            CUDA_ADD_CUFFT_TO_TARGET macro)
-#   CUDA_CUBLAS_LIBRARIES -- Device or emulation library for the Cuda BLAS
-#                            implementation (alternative to:
-#                            CUDA_ADD_CUBLAS_TO_TARGET macro).
-#   CUDA_cudart_static_LIBRARY -- Statically linkable cuda runtime library.
-#                                 Only available for CUDA version 5.5+
-#   CUDA_cudadevrt_LIBRARY -- Device runtime library.
-#                             Required for separable compilation.
-#   CUDA_cupti_LIBRARY    -- CUDA Profiling Tools Interface library.
-#                            Only available for CUDA version 4.0+.
-#   CUDA_curand_LIBRARY   -- CUDA Random Number Generation library.
-#                            Only available for CUDA version 3.2+.
-#   CUDA_cusolver_LIBRARY -- CUDA Direct Solver library.
-#                            Only available for CUDA version 7.0+.
-#   CUDA_cusparse_LIBRARY -- CUDA Sparse Matrix library.
-#                            Only available for CUDA version 3.2+.
-#   CUDA_npp_LIBRARY      -- NVIDIA Performance Primitives lib.
-#                            Only available for CUDA version 4.0+.
-#   CUDA_nppc_LIBRARY     -- NVIDIA Performance Primitives lib (core).
-#                            Only available for CUDA version 5.5+.
-#   CUDA_nppi_LIBRARY     -- NVIDIA Performance Primitives lib (image processing).
-#                            Only available for CUDA version 5.5 - 8.0.
-#   CUDA_nppial_LIBRARY   -- NVIDIA Performance Primitives lib (image processing).
-#                            Only available for CUDA version 9.0.
-#   CUDA_nppicc_LIBRARY   -- NVIDIA Performance Primitives lib (image processing).
-#                            Only available for CUDA version 9.0.
-#   CUDA_nppicom_LIBRARY  -- NVIDIA Performance Primitives lib (image processing).
-#                            Only available for CUDA version 9.0.
-#   CUDA_nppidei_LIBRARY  -- NVIDIA Performance Primitives lib (image processing).
-#                            Only available for CUDA version 9.0.
-#   CUDA_nppif_LIBRARY    -- NVIDIA Performance Primitives lib (image processing).
-#                            Only available for CUDA version 9.0.
-#   CUDA_nppig_LIBRARY    -- NVIDIA Performance Primitives lib (image processing).
-#                            Only available for CUDA version 9.0.
-#   CUDA_nppim_LIBRARY    -- NVIDIA Performance Primitives lib (image processing).
-#                            Only available for CUDA version 9.0.
-#   CUDA_nppist_LIBRARY   -- NVIDIA Performance Primitives lib (image processing).
-#                            Only available for CUDA version 9.0.
-#   CUDA_nppisu_LIBRARY   -- NVIDIA Performance Primitives lib (image processing).
-#                            Only available for CUDA version 9.0.
-#   CUDA_nppitc_LIBRARY   -- NVIDIA Performance Primitives lib (image processing).
-#                            Only available for CUDA version 9.0.
-#   CUDA_npps_LIBRARY     -- NVIDIA Performance Primitives lib (signal processing).
-#                            Only available for CUDA version 5.5+.
-#   CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library.
-#                            Only available for CUDA version 3.2+.
-#                            Windows only.
-#   CUDA_nvcuvid_LIBRARY  -- CUDA Video Decoder library.
-#                            Only available for CUDA version 3.2+.
-#                            Windows only.
-#
+#[=======================================================================[.rst:
+FindCUDA
+--------
+
+.. note::
+
+  The FindCUDA module has been superseded by first-class support
+  for the CUDA language in CMake.  It is no longer necessary to
+  use this module or call ``find_package(CUDA)``.  This module
+  now exists only for compatibility with projects that have not
+  been ported.
+
+  Instead, list ``CUDA`` among the languages named in the top-level
+  call to the :command:`project` command, or call the
+  :command:`enable_language` command with ``CUDA``.
+  Then one can add CUDA (``.cu``) sources to programs directly
+  in calls to :command:`add_library` and :command:`add_executable`.
+
+Tools for building CUDA C files: libraries and build dependencies.
+
+This script locates the NVIDIA CUDA C tools.  It should work on Linux,
+Windows, and macOS and should be reasonably up to date with CUDA C
+releases.
+
+This script makes use of the standard :command:`find_package` arguments of
+``<VERSION>``, ``REQUIRED`` and ``QUIET``.  ``CUDA_FOUND`` will report if an
+acceptable version of CUDA was found.
+
+The script will prompt the user to specify ``CUDA_TOOLKIT_ROOT_DIR`` if
+the prefix cannot be determined by the location of nvcc in the system
+path and ``REQUIRED`` is specified to :command:`find_package`.  To use
+a different installed version of the toolkit set the environment variable
+``CUDA_BIN_PATH`` before running cmake (e.g.
+``CUDA_BIN_PATH=/usr/local/cuda1.0`` instead of the default
+``/usr/local/cuda``) or set ``CUDA_TOOLKIT_ROOT_DIR`` after configuring.  If
+you change the value of ``CUDA_TOOLKIT_ROOT_DIR``, various components that
+depend on the path will be relocated.
+
+It might be necessary to set ``CUDA_TOOLKIT_ROOT_DIR`` manually on certain
+platforms, or to use a CUDA runtime not installed in the default
+location.  In newer versions of the toolkit the CUDA library is
+included with the graphics driver -- be sure that the driver version
+matches what is needed by the CUDA runtime version.
+
+The following variables affect the behavior of the macros in the
+script (in alphabetical order).  Note that any of these flags can be
+changed multiple times in the same directory before calling
+``CUDA_ADD_EXECUTABLE``, ``CUDA_ADD_LIBRARY``, ``CUDA_COMPILE``,
+``CUDA_COMPILE_PTX``, ``CUDA_COMPILE_FATBIN``, ``CUDA_COMPILE_CUBIN``
+or ``CUDA_WRAP_SRCS``::
+
+  CUDA_64_BIT_DEVICE_CODE (Default matches host bit size)
+  -- Set to ON to compile for 64 bit device code, OFF for 32 bit device code.
+     Note that making this different from the host code when generating object
+     or C files from CUDA code just won't work, because size_t gets defined by
+     nvcc in the generated source.  If you compile to PTX and then load the
+     file yourself, you can mix bit sizes between device and host.
+
+  CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE (Default ON)
+  -- Set to ON if you want the custom build rule to be attached to the source
+     file in Visual Studio.  Turn OFF if you add the same cuda file to multiple
+     targets.
+
+     This allows the user to build the target from the CUDA file; however, bad
+     things can happen if the CUDA source file is added to multiple targets.
+     When performing parallel builds it is possible for the custom build
+     command to be run more than once and in parallel causing cryptic build
+     errors.  VS runs the rules for every source file in the target, and a
+     source can have only one rule no matter how many projects it is added to.
+     When the rule is run from multiple targets race conditions can occur on
+     the generated file.  Eventually everything will get built, but if the user
+     is unaware of this behavior, there may be confusion.  It would be nice if
+     this script could detect the reuse of source files across multiple targets
+     and turn the option off for the user, but no good solution could be found.
+
+  CUDA_BUILD_CUBIN (Default OFF)
+  -- Set to ON to enable and extra compilation pass with the -cubin option in
+     Device mode. The output is parsed and register, shared memory usage is
+     printed during build.
+
+  CUDA_BUILD_EMULATION (Default OFF for device mode)
+  -- Set to ON for Emulation mode. -D_DEVICEEMU is defined for CUDA C files
+     when CUDA_BUILD_EMULATION is TRUE.
+
+  CUDA_LINK_LIBRARIES_KEYWORD (Default "")
+   -- The <PRIVATE|PUBLIC|INTERFACE> keyword to use for internal
+      target_link_libraries calls. The default is to use no keyword which
+      uses the old "plain" form of target_link_libraries. Note that is matters
+      because whatever is used inside the FindCUDA module must also be used
+      outside - the two forms of target_link_libraries cannot be mixed.
+
+  CUDA_GENERATED_OUTPUT_DIR (Default CMAKE_CURRENT_BINARY_DIR)
+  -- Set to the path you wish to have the generated files placed.  If it is
+     blank output files will be placed in CMAKE_CURRENT_BINARY_DIR.
+     Intermediate files will always be placed in
+     CMAKE_CURRENT_BINARY_DIR/CMakeFiles.
+
+  CUDA_HOST_COMPILATION_CPP (Default ON)
+  -- Set to OFF for C compilation of host code.
+
+  CUDA_HOST_COMPILER (Default CMAKE_C_COMPILER)
+  -- Set the host compiler to be used by nvcc.  Ignored if -ccbin or
+     --compiler-bindir is already present in the CUDA_NVCC_FLAGS or
+     CUDA_NVCC_FLAGS_<CONFIG> variables.  For Visual Studio targets,
+     the host compiler is constructed with one or more visual studio macros
+     such as $(VCInstallDir), that expands out to the path when
+     the command is run from within VS.
+     If the CUDAHOSTCXX environment variable is set it will
+     be used as the default.
+
+  CUDA_NVCC_FLAGS
+  CUDA_NVCC_FLAGS_<CONFIG>
+  -- Additional NVCC command line arguments.  NOTE: multiple arguments must be
+     semi-colon delimited (e.g. --compiler-options;-Wall)
+
+  CUDA_PROPAGATE_HOST_FLAGS (Default ON)
+  -- Set to ON to propagate CMAKE_{C,CXX}_FLAGS and their configuration
+     dependent counterparts (e.g. CMAKE_C_FLAGS_DEBUG) automatically to the
+     host compiler through nvcc's -Xcompiler flag.  This helps make the
+     generated host code match the rest of the system better.  Sometimes
+     certain flags give nvcc problems, and this will help you turn the flag
+     propagation off.  This does not affect the flags supplied directly to nvcc
+     via CUDA_NVCC_FLAGS or through the OPTION flags specified through
+     CUDA_ADD_LIBRARY, CUDA_ADD_EXECUTABLE, or CUDA_WRAP_SRCS.  Flags used for
+     shared library compilation are not affected by this flag.
+
+  CUDA_SEPARABLE_COMPILATION (Default OFF)
+  -- If set this will enable separable compilation for all CUDA runtime object
+     files.  If used outside of CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY
+     (e.g. calling CUDA_WRAP_SRCS directly),
+     CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and
+     CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called.
+
+  CUDA_SOURCE_PROPERTY_FORMAT
+  -- If this source file property is set, it can override the format specified
+     to CUDA_WRAP_SRCS (OBJ, PTX, CUBIN, or FATBIN).  If an input source file
+     is not a .cu file, setting this file will cause it to be treated as a .cu
+     file. See documentation for set_source_files_properties on how to set
+     this property.
+
+  CUDA_USE_STATIC_CUDA_RUNTIME (Default ON)
+  -- When enabled the static version of the CUDA runtime library will be used
+     in CUDA_LIBRARIES.  If the version of CUDA configured doesn't support
+     this option, then it will be silently disabled.
+
+  CUDA_VERBOSE_BUILD (Default OFF)
+  -- Set to ON to see all the commands used when building the CUDA file.  When
+     using a Makefile generator the value defaults to VERBOSE (run make
+     VERBOSE=1 to see output), although setting CUDA_VERBOSE_BUILD to ON will
+     always print the output.
+
+The script creates the following macros (in alphabetical order)::
+
+  CUDA_ADD_CUFFT_TO_TARGET( cuda_target )
+  -- Adds the cufft library to the target (can be any target).  Handles whether
+     you are in emulation mode or not.
+
+  CUDA_ADD_CUBLAS_TO_TARGET( cuda_target )
+  -- Adds the cublas library to the target (can be any target).  Handles
+     whether you are in emulation mode or not.
+
+  CUDA_ADD_EXECUTABLE( cuda_target file0 file1 ...
+                       [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] [OPTIONS ...] )
+  -- Creates an executable "cuda_target" which is made up of the files
+     specified.  All of the non CUDA C files are compiled using the standard
+     build rules specified by CMAKE and the cuda files are compiled to object
+     files using nvcc and the host compiler.  In addition CUDA_INCLUDE_DIRS is
+     added automatically to include_directories().  Some standard CMake target
+     calls can be used on the target after calling this macro
+     (e.g. set_target_properties and target_link_libraries), but setting
+     properties that adjust compilation flags will not affect code compiled by
+     nvcc.  Such flags should be modified before calling CUDA_ADD_EXECUTABLE,
+     CUDA_ADD_LIBRARY or CUDA_WRAP_SRCS.
+
+  CUDA_ADD_LIBRARY( cuda_target file0 file1 ...
+                    [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] [OPTIONS ...] )
+  -- Same as CUDA_ADD_EXECUTABLE except that a library is created.
+
+  CUDA_BUILD_CLEAN_TARGET()
+  -- Creates a convenience target that deletes all the dependency files
+     generated.  You should make clean after running this target to ensure the
+     dependency files get regenerated.
+
+  CUDA_COMPILE( generated_files file0 file1 ... [STATIC | SHARED | MODULE]
+                [OPTIONS ...] )
+  -- Returns a list of generated files from the input source files to be used
+     with ADD_LIBRARY or ADD_EXECUTABLE.
+
+  CUDA_COMPILE_PTX( generated_files file0 file1 ... [OPTIONS ...] )
+  -- Returns a list of PTX files generated from the input source files.
+
+  CUDA_COMPILE_FATBIN( generated_files file0 file1 ... [OPTIONS ...] )
+  -- Returns a list of FATBIN files generated from the input source files.
+
+  CUDA_COMPILE_CUBIN( generated_files file0 file1 ... [OPTIONS ...] )
+  -- Returns a list of CUBIN files generated from the input source files.
+
+  CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME( output_file_var
+                                                       cuda_target
+                                                       object_files )
+  -- Compute the name of the intermediate link file used for separable
+     compilation.  This file name is typically passed into
+     CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS.  output_file_var is produced
+     based on cuda_target the list of objects files that need separable
+     compilation as specified by object_files.  If the object_files list is
+     empty, then output_file_var will be empty.  This function is called
+     automatically for CUDA_ADD_LIBRARY and CUDA_ADD_EXECUTABLE.  Note that
+     this is a function and not a macro.
+
+  CUDA_INCLUDE_DIRECTORIES( path0 path1 ... )
+  -- Sets the directories that should be passed to nvcc
+     (e.g. nvcc -Ipath0 -Ipath1 ... ). These paths usually contain other .cu
+     files.
+
+
+  CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS( output_file_var cuda_target
+                                           nvcc_flags object_files)
+  -- Generates the link object required by separable compilation from the given
+     object files.  This is called automatically for CUDA_ADD_EXECUTABLE and
+     CUDA_ADD_LIBRARY, but can be called manually when using CUDA_WRAP_SRCS
+     directly.  When called from CUDA_ADD_LIBRARY or CUDA_ADD_EXECUTABLE the
+     nvcc_flags passed in are the same as the flags passed in via the OPTIONS
+     argument.  The only nvcc flag added automatically is the bitness flag as
+     specified by CUDA_64_BIT_DEVICE_CODE.  Note that this is a function
+     instead of a macro.
+
+  CUDA_SELECT_NVCC_ARCH_FLAGS(out_variable [target_CUDA_architectures])
+  -- Selects GPU arch flags for nvcc based on target_CUDA_architectures
+     target_CUDA_architectures : Auto | Common | All | LIST(ARCH_AND_PTX ...)
+      - "Auto" detects local machine GPU compute arch at runtime.
+      - "Common" and "All" cover common and entire subsets of architectures
+     ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX
+     NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal
+     NUM: Any number. Only those pairs are currently accepted by NVCC though:
+           2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2
+     Returns LIST of flags to be added to CUDA_NVCC_FLAGS in ${out_variable}
+     Additionally, sets ${out_variable}_readable to the resulting numeric list
+     Example:
+      CUDA_SELECT_NVCC_ARCH_FLAGS(ARCH_FLAGS 3.0 3.5+PTX 5.2(5.0) Maxwell)
+       LIST(APPEND CUDA_NVCC_FLAGS ${ARCH_FLAGS})
+
+     More info on CUDA architectures: https://en.wikipedia.org/wiki/CUDA
+     Note that this is a function instead of a macro.
+
+  CUDA_WRAP_SRCS ( cuda_target format generated_files file0 file1 ...
+                   [STATIC | SHARED | MODULE] [OPTIONS ...] )
+  -- This is where all the magic happens.  CUDA_ADD_EXECUTABLE,
+     CUDA_ADD_LIBRARY, CUDA_COMPILE, and CUDA_COMPILE_PTX all call this
+     function under the hood.
+
+     Given the list of files (file0 file1 ... fileN) this macro generates
+     custom commands that generate either PTX or linkable objects (use "PTX" or
+     "OBJ" for the format argument to switch).  Files that don't end with .cu
+     or have the HEADER_FILE_ONLY property are ignored.
+
+     The arguments passed in after OPTIONS are extra command line options to
+     give to nvcc.  You can also specify per configuration options by
+     specifying the name of the configuration followed by the options.  General
+     options must precede configuration specific options.  Not all
+     configurations need to be specified, only the ones provided will be used.
+
+        OPTIONS -DFLAG=2 "-DFLAG_OTHER=space in flag"
+        DEBUG -g
+        RELEASE --use_fast_math
+        RELWITHDEBINFO --use_fast_math;-g
+        MINSIZEREL --use_fast_math
+
+     For certain configurations (namely VS generating object files with
+     CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE set to ON), no generated file will
+     be produced for the given cuda file.  This is because when you add the
+     cuda file to Visual Studio it knows that this file produces an object file
+     and will link in the resulting object file automatically.
+
+     This script will also generate a separate cmake script that is used at
+     build time to invoke nvcc.  This is for several reasons.
+
+       1. nvcc can return negative numbers as return values which confuses
+       Visual Studio into thinking that the command succeeded.  The script now
+       checks the error codes and produces errors when there was a problem.
+
+       2. nvcc has been known to not delete incomplete results when it
+       encounters problems.  This confuses build systems into thinking the
+       target was generated when in fact an unusable file exists.  The script
+       now deletes the output files if there was an error.
+
+       3. By putting all the options that affect the build into a file and then
+       make the build rule dependent on the file, the output files will be
+       regenerated when the options change.
+
+     This script also looks at optional arguments STATIC, SHARED, or MODULE to
+     determine when to target the object compilation for a shared library.
+     BUILD_SHARED_LIBS is ignored in CUDA_WRAP_SRCS, but it is respected in
+     CUDA_ADD_LIBRARY.  On some systems special flags are added for building
+     objects intended for shared libraries.  A preprocessor macro,
+     <target_name>_EXPORTS is defined when a shared library compilation is
+     detected.
+
+     Flags passed into add_definitions with -D or /D are passed along to nvcc.
+
+
+
+The script defines the following variables::
+
+  CUDA_VERSION_MAJOR    -- The major version of cuda as reported by nvcc.
+  CUDA_VERSION_MINOR    -- The minor version.
+  CUDA_VERSION
+  CUDA_VERSION_STRING   -- CUDA_VERSION_MAJOR.CUDA_VERSION_MINOR
+  CUDA_HAS_FP16         -- Whether a short float (float16,fp16) is supported.
+
+  CUDA_TOOLKIT_ROOT_DIR -- Path to the CUDA Toolkit (defined if not set).
+  CUDA_SDK_ROOT_DIR     -- Path to the CUDA SDK.  Use this to find files in the
+                           SDK.  This script will not directly support finding
+                           specific libraries or headers, as that isn't
+                           supported by NVIDIA.  If you want to change
+                           libraries when the path changes see the
+                           FindCUDA.cmake script for an example of how to clear
+                           these variables.  There are also examples of how to
+                           use the CUDA_SDK_ROOT_DIR to locate headers or
+                           libraries, if you so choose (at your own risk).
+  CUDA_INCLUDE_DIRS     -- Include directory for cuda headers.  Added automatically
+                           for CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY.
+  CUDA_LIBRARIES        -- Cuda RT library.
+  CUDA_CUFFT_LIBRARIES  -- Device or emulation library for the Cuda FFT
+                           implementation (alternative to:
+                           CUDA_ADD_CUFFT_TO_TARGET macro)
+  CUDA_CUBLAS_LIBRARIES -- Device or emulation library for the Cuda BLAS
+                           implementation (alternative to:
+                           CUDA_ADD_CUBLAS_TO_TARGET macro).
+  CUDA_cudart_static_LIBRARY -- Statically linkable cuda runtime library.
+                                Only available for CUDA version 5.5+
+  CUDA_cudadevrt_LIBRARY -- Device runtime library.
+                            Required for separable compilation.
+  CUDA_cupti_LIBRARY    -- CUDA Profiling Tools Interface library.
+                           Only available for CUDA version 4.0+.
+  CUDA_curand_LIBRARY   -- CUDA Random Number Generation library.
+                           Only available for CUDA version 3.2+.
+  CUDA_cusolver_LIBRARY -- CUDA Direct Solver library.
+                           Only available for CUDA version 7.0+.
+  CUDA_cusparse_LIBRARY -- CUDA Sparse Matrix library.
+                           Only available for CUDA version 3.2+.
+  CUDA_npp_LIBRARY      -- NVIDIA Performance Primitives lib.
+                           Only available for CUDA version 4.0+.
+  CUDA_nppc_LIBRARY     -- NVIDIA Performance Primitives lib (core).
+                           Only available for CUDA version 5.5+.
+  CUDA_nppi_LIBRARY     -- NVIDIA Performance Primitives lib (image processing).
+                           Only available for CUDA version 5.5 - 8.0.
+  CUDA_nppial_LIBRARY   -- NVIDIA Performance Primitives lib (image processing).
+                           Only available for CUDA version 9.0.
+  CUDA_nppicc_LIBRARY   -- NVIDIA Performance Primitives lib (image processing).
+                           Only available for CUDA version 9.0.
+  CUDA_nppicom_LIBRARY  -- NVIDIA Performance Primitives lib (image processing).
+                           Only available for CUDA version 9.0.
+  CUDA_nppidei_LIBRARY  -- NVIDIA Performance Primitives lib (image processing).
+                           Only available for CUDA version 9.0.
+  CUDA_nppif_LIBRARY    -- NVIDIA Performance Primitives lib (image processing).
+                           Only available for CUDA version 9.0.
+  CUDA_nppig_LIBRARY    -- NVIDIA Performance Primitives lib (image processing).
+                           Only available for CUDA version 9.0.
+  CUDA_nppim_LIBRARY    -- NVIDIA Performance Primitives lib (image processing).
+                           Only available for CUDA version 9.0.
+  CUDA_nppist_LIBRARY   -- NVIDIA Performance Primitives lib (image processing).
+                           Only available for CUDA version 9.0.
+  CUDA_nppisu_LIBRARY   -- NVIDIA Performance Primitives lib (image processing).
+                           Only available for CUDA version 9.0.
+  CUDA_nppitc_LIBRARY   -- NVIDIA Performance Primitives lib (image processing).
+                           Only available for CUDA version 9.0.
+  CUDA_npps_LIBRARY     -- NVIDIA Performance Primitives lib (signal processing).
+                           Only available for CUDA version 5.5+.
+  CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library.
+                           Only available for CUDA version 3.2+.
+                           Windows only.
+  CUDA_nvcuvid_LIBRARY  -- CUDA Video Decoder library.
+                           Only available for CUDA version 3.2+.
+                           Windows only.
+
+#]=======================================================================]
 
 #   James Bigler, NVIDIA Corp (nvidia.com - jbigler)
 #   Abe Stephens, SCI Institute -- http://www.sci.utah.edu/~abe/FindCuda.html

+ 29 - 28
Modules/FindCURL.cmake

@@ -1,34 +1,35 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindCURL
-# --------
-#
-# Find the native CURL headers and libraries.
-#
-# IMPORTED Targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines :prop_tgt:`IMPORTED` target ``CURL::libcurl``, if
-# curl has been found.
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the following variables:
-#
-# ``CURL_FOUND``
-#   True if curl found.
-#
-# ``CURL_INCLUDE_DIRS``
-#   where to find curl/curl.h, etc.
-#
-# ``CURL_LIBRARIES``
-#   List of libraries when using curl.
-#
-# ``CURL_VERSION_STRING``
-#   The version of curl found.
+#[=======================================================================[.rst:
+FindCURL
+--------
+
+Find the native CURL headers and libraries.
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines :prop_tgt:`IMPORTED` target ``CURL::libcurl``, if
+curl has been found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``CURL_FOUND``
+  True if curl found.
+
+``CURL_INCLUDE_DIRS``
+  where to find curl/curl.h, etc.
+
+``CURL_LIBRARIES``
+  List of libraries when using curl.
+
+``CURL_VERSION_STRING``
+  The version of curl found.
+#]=======================================================================]
 
 # Look for the header file.
 find_path(CURL_INCLUDE_DIR NAMES curl/curl.h)

+ 22 - 21
Modules/FindCVS.cmake

@@ -1,27 +1,28 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindCVS
-# -------
-#
-#
-#
-# The module defines the following variables:
-#
-# ::
-#
-#    CVS_EXECUTABLE - path to cvs command line client
-#    CVS_FOUND - true if the command line client was found
-#
-# Example usage:
-#
-# ::
-#
-#    find_package(CVS)
-#    if(CVS_FOUND)
-#      message("CVS found: ${CVS_EXECUTABLE}")
-#    endif()
+#[=======================================================================[.rst:
+FindCVS
+-------
+
+
+
+The module defines the following variables:
+
+::
+
+   CVS_EXECUTABLE - path to cvs command line client
+   CVS_FOUND - true if the command line client was found
+
+Example usage:
+
+::
+
+   find_package(CVS)
+   if(CVS_FOUND)
+     message("CVS found: ${CVS_EXECUTABLE}")
+   endif()
+#]=======================================================================]
 
 # CVSNT
 

+ 17 - 16
Modules/FindCoin3D.cmake

@@ -1,22 +1,23 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindCoin3D
-# ----------
-#
-# Find Coin3D (Open Inventor)
-#
-# Coin3D is an implementation of the Open Inventor API.  It provides
-# data structures and algorithms for 3D visualization.
-#
-# This module defines the following variables
-#
-# ::
-#
-#   COIN3D_FOUND         - system has Coin3D - Open Inventor
-#   COIN3D_INCLUDE_DIRS  - where the Inventor include directory can be found
-#   COIN3D_LIBRARIES     - Link to this to use Coin3D
+#[=======================================================================[.rst:
+FindCoin3D
+----------
+
+Find Coin3D (Open Inventor)
+
+Coin3D is an implementation of the Open Inventor API.  It provides
+data structures and algorithms for 3D visualization.
+
+This module defines the following variables
+
+::
+
+  COIN3D_FOUND         - system has Coin3D - Open Inventor
+  COIN3D_INCLUDE_DIRS  - where the Inventor include directory can be found
+  COIN3D_LIBRARIES     - Link to this to use Coin3D
+#]=======================================================================]
 
 if (WIN32)
   if (CYGWIN)

+ 17 - 16
Modules/FindCups.cmake

@@ -1,22 +1,23 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindCups
-# --------
-#
-# Try to find the Cups printing system
-#
-# Once done this will define
-#
-# ::
-#
-#   CUPS_FOUND - system has Cups
-#   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
-#   features this function (i.e. at least 1.1.19)
+#[=======================================================================[.rst:
+FindCups
+--------
+
+Try to find the Cups printing system
+
+Once done this will define
+
+::
+
+  CUPS_FOUND - system has Cups
+  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
+  features this function (i.e. at least 1.1.19)
+#]=======================================================================]
 
 find_path(CUPS_INCLUDE_DIR cups/cups.h )
 

+ 41 - 40
Modules/FindCurses.cmake

@@ -1,46 +1,47 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindCurses
-# ----------
-#
-# Find the curses or ncurses include file and library.
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the following variables:
-#
-# ``CURSES_FOUND``
-#   True if Curses is found.
-# ``CURSES_INCLUDE_DIRS``
-#   The include directories needed to use Curses.
-# ``CURSES_LIBRARIES``
-#   The libraries needed to use Curses.
-# ``CURSES_HAVE_CURSES_H``
-#   True if curses.h is available.
-# ``CURSES_HAVE_NCURSES_H``
-#   True if ncurses.h is available.
-# ``CURSES_HAVE_NCURSES_NCURSES_H``
-#   True if ``ncurses/ncurses.h`` is available.
-# ``CURSES_HAVE_NCURSES_CURSES_H``
-#   True if ``ncurses/curses.h`` is available.
-#
-# Set ``CURSES_NEED_NCURSES`` to ``TRUE`` before the
-# ``find_package(Curses)`` call if NCurses functionality is required.
-# Set ``CURSES_NEED_WIDE`` to ``TRUE`` before the
-# ``find_package(Curses)`` call if unicode functionality is required.
-#
-# Backward Compatibility
-# ^^^^^^^^^^^^^^^^^^^^^^
-#
-# The following variable are provided for backward compatibility:
-#
-# ``CURSES_INCLUDE_DIR``
-#   Path to Curses include.  Use ``CURSES_INCLUDE_DIRS`` instead.
-# ``CURSES_LIBRARY``
-#   Path to Curses library.  Use ``CURSES_LIBRARIES`` instead.
+#[=======================================================================[.rst:
+FindCurses
+----------
+
+Find the curses or ncurses include file and library.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``CURSES_FOUND``
+  True if Curses is found.
+``CURSES_INCLUDE_DIRS``
+  The include directories needed to use Curses.
+``CURSES_LIBRARIES``
+  The libraries needed to use Curses.
+``CURSES_HAVE_CURSES_H``
+  True if curses.h is available.
+``CURSES_HAVE_NCURSES_H``
+  True if ncurses.h is available.
+``CURSES_HAVE_NCURSES_NCURSES_H``
+  True if ``ncurses/ncurses.h`` is available.
+``CURSES_HAVE_NCURSES_CURSES_H``
+  True if ``ncurses/curses.h`` is available.
+
+Set ``CURSES_NEED_NCURSES`` to ``TRUE`` before the
+``find_package(Curses)`` call if NCurses functionality is required.
+Set ``CURSES_NEED_WIDE`` to ``TRUE`` before the
+``find_package(Curses)`` call if unicode functionality is required.
+
+Backward Compatibility
+^^^^^^^^^^^^^^^^^^^^^^
+
+The following variable are provided for backward compatibility:
+
+``CURSES_INCLUDE_DIR``
+  Path to Curses include.  Use ``CURSES_INCLUDE_DIRS`` instead.
+``CURSES_LIBRARY``
+  Path to Curses library.  Use ``CURSES_LIBRARIES`` instead.
+#]=======================================================================]
 
 include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake)
 

+ 137 - 136
Modules/FindCxxTest.cmake

@@ -1,142 +1,143 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindCxxTest
-# -----------
-#
-# Find CxxTest
-#
-# Find the CxxTest suite and declare a helper macro for creating unit
-# tests and integrating them with CTest.  For more details on CxxTest
-# see http://cxxtest.tigris.org
-#
-# INPUT Variables
-#
-# ::
-#
-#    CXXTEST_USE_PYTHON [deprecated since 1.3]
-#        Only used in the case both Python & Perl
-#        are detected on the system to control
-#        which CxxTest code generator is used.
-#        Valid only for CxxTest version 3.
-#
-#
-#
-# ::
-#
-#        NOTE: In older versions of this Find Module,
-#        this variable controlled if the Python test
-#        generator was used instead of the Perl one,
-#        regardless of which scripting language the
-#        user had installed.
-#
-#
-#
-# ::
-#
-#    CXXTEST_TESTGEN_ARGS (since CMake 2.8.3)
-#        Specify a list of options to pass to the CxxTest code
-#        generator.  If not defined, --error-printer is
-#        passed.
-#
-#
-#
-# OUTPUT Variables
-#
-# ::
-#
-#    CXXTEST_FOUND
-#        True if the CxxTest framework was found
-#    CXXTEST_INCLUDE_DIRS
-#        Where to find the CxxTest include directory
-#    CXXTEST_PERL_TESTGEN_EXECUTABLE
-#        The perl-based test generator
-#    CXXTEST_PYTHON_TESTGEN_EXECUTABLE
-#        The python-based test generator
-#    CXXTEST_TESTGEN_EXECUTABLE (since CMake 2.8.3)
-#        The test generator that is actually used (chosen using user preferences
-#        and interpreters found in the system)
-#    CXXTEST_TESTGEN_INTERPRETER (since CMake 2.8.3)
-#        The full path to the Perl or Python executable on the system, on
-#        platforms where the script cannot be executed using its shebang line.
-#
-#
-#
-# MACROS for optional use by CMake users:
-#
-# ::
-#
-#     CXXTEST_ADD_TEST(<test_name> <gen_source_file> <input_files_to_testgen...>)
-#        Creates a CxxTest runner and adds it to the CTest testing suite
-#        Parameters:
-#            test_name               The name of the test
-#            gen_source_file         The generated source filename to be
-#                                    generated by CxxTest
-#            input_files_to_testgen  The list of header files containing the
-#                                    CxxTest::TestSuite's to be included in
-#                                    this runner
-#
-#
-#
-# ::
-#
-#        #==============
-#        Example Usage:
-#
-#
-#
-# ::
-#
-#            find_package(CxxTest)
-#            if(CXXTEST_FOUND)
-#                include_directories(${CXXTEST_INCLUDE_DIR})
-#                enable_testing()
-#
-#
-#
-# ::
-#
-#                CXXTEST_ADD_TEST(unittest_foo foo_test.cc
-#                                  ${CMAKE_CURRENT_SOURCE_DIR}/foo_test.h)
-#                target_link_libraries(unittest_foo foo) # as needed
-#            endif()
-#
-#
-#
-# ::
-#
-#               This will (if CxxTest is found):
-#               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
-#           {
-#           public:
-#              void testAddition( void )
-#              {
-#                 TS_ASSERT( 1 + 1 > 1 );
-#                 TS_ASSERT_EQUALS( 1 + 1, 2 );
-#              }
-#           };
+#[=======================================================================[.rst:
+FindCxxTest
+-----------
+
+Find CxxTest
+
+Find the CxxTest suite and declare a helper macro for creating unit
+tests and integrating them with CTest.  For more details on CxxTest
+see http://cxxtest.tigris.org
+
+INPUT Variables
+
+::
+
+   CXXTEST_USE_PYTHON [deprecated since 1.3]
+       Only used in the case both Python & Perl
+       are detected on the system to control
+       which CxxTest code generator is used.
+       Valid only for CxxTest version 3.
+
+
+
+::
+
+       NOTE: In older versions of this Find Module,
+       this variable controlled if the Python test
+       generator was used instead of the Perl one,
+       regardless of which scripting language the
+       user had installed.
+
+
+
+::
+
+   CXXTEST_TESTGEN_ARGS (since CMake 2.8.3)
+       Specify a list of options to pass to the CxxTest code
+       generator.  If not defined, --error-printer is
+       passed.
+
+
+
+OUTPUT Variables
+
+::
+
+   CXXTEST_FOUND
+       True if the CxxTest framework was found
+   CXXTEST_INCLUDE_DIRS
+       Where to find the CxxTest include directory
+   CXXTEST_PERL_TESTGEN_EXECUTABLE
+       The perl-based test generator
+   CXXTEST_PYTHON_TESTGEN_EXECUTABLE
+       The python-based test generator
+   CXXTEST_TESTGEN_EXECUTABLE (since CMake 2.8.3)
+       The test generator that is actually used (chosen using user preferences
+       and interpreters found in the system)
+   CXXTEST_TESTGEN_INTERPRETER (since CMake 2.8.3)
+       The full path to the Perl or Python executable on the system, on
+       platforms where the script cannot be executed using its shebang line.
+
+
+
+MACROS for optional use by CMake users:
+
+::
+
+    CXXTEST_ADD_TEST(<test_name> <gen_source_file> <input_files_to_testgen...>)
+       Creates a CxxTest runner and adds it to the CTest testing suite
+       Parameters:
+           test_name               The name of the test
+           gen_source_file         The generated source filename to be
+                                   generated by CxxTest
+           input_files_to_testgen  The list of header files containing the
+                                   CxxTest::TestSuite's to be included in
+                                   this runner
+
+
+
+::
+
+       #==============
+       Example Usage:
+
+
+
+::
+
+           find_package(CxxTest)
+           if(CXXTEST_FOUND)
+               include_directories(${CXXTEST_INCLUDE_DIR})
+               enable_testing()
+
+
+
+::
+
+               CXXTEST_ADD_TEST(unittest_foo foo_test.cc
+                                 ${CMAKE_CURRENT_SOURCE_DIR}/foo_test.h)
+               target_link_libraries(unittest_foo foo) # as needed
+           endif()
+
+
+
+::
+
+              This will (if CxxTest is found):
+              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
+          {
+          public:
+             void testAddition( void )
+             {
+                TS_ASSERT( 1 + 1 > 1 );
+                TS_ASSERT_EQUALS( 1 + 1, 2 );
+             }
+          };
+#]=======================================================================]
 
 # Version 1.4 (11/18/10) (CMake 2.8.4)
 #     Issue 11384: Added support to the CXX_ADD_TEST macro so header

+ 6 - 5
Modules/FindCygwin.cmake

@@ -1,11 +1,12 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindCygwin
-# ----------
-#
-# this module looks for Cygwin
+#[=======================================================================[.rst:
+FindCygwin
+----------
+
+this module looks for Cygwin
+#]=======================================================================]
 
 if (WIN32)
   if(CYGWIN_INSTALL_PATH)

+ 77 - 76
Modules/FindDCMTK.cmake

@@ -1,82 +1,83 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindDCMTK
-# ---------
-#
-# Find DCMTK libraries and applications
-#
-# The module defines the following variables::
-#
-#  DCMTK_INCLUDE_DIRS  - Directories to include to use DCMTK
-#  DCMTK_LIBRARIES     - Files to link against to use DCMTK
-#  DCMTK_FOUND         - If false, don't try to use DCMTK
-#  DCMTK_DIR           - (optional) Source directory for DCMTK
-#
-# Compatibility
-# ^^^^^^^^^^^^^
-#
-# This module is able to find a version of DCMTK that does or does not export
-# a *DCMTKConfig.cmake* file. It applies a two step process:
-#
-# * Step 1:  Attempt to find DCMTK version providing a *DCMTKConfig.cmake* file.
-# * Step 2:  If step 1 failed, rely on *FindDCMTK.cmake* to set `DCMTK_*` variables details below.
-#
-#
-# `Recent DCMTK
-# <http://git.dcmtk.org/web?p=dcmtk.git;a=commit;h=662ae187c493c6b9a73dd5e3875372cebd0c11fe>`_
-# provides a *DCMTKConfig.cmake* :manual:`package configuration file
-# <cmake-packages(7)>`. To exclusively use the package configuration file
-# (recommended when possible), pass the `NO_MODULE` option to
-# :command:`find_package`. For example, `find_package(DCMTK NO_MODULE)`.
-# This requires official DCMTK snapshot *3.6.1_20140617* or newer.
-#
-#
-# Until all clients update to the more recent DCMTK, build systems will need
-# to support different versions of DCMTK.
-#
-# On any given system, the following combinations of DCMTK versions could be
-# considered:
-#
-# +--------+---------------------+-----------------------+-------------------+
-# |        |   SYSTEM DCMTK      |      LOCAL DCMTK      |     Supported ?   |
-# +--------+---------------------+-----------------------+-------------------+
-# | Case A |   NA                |      [ ] DCMTKConfig  |         YES       |
-# +--------+---------------------+-----------------------+-------------------+
-# | Case B |   NA                |      [X] DCMTKConfig  |         YES       |
-# +--------+---------------------+-----------------------+-------------------+
-# | Case C |   [ ] DCMTKConfig   |      NA               |         YES       |
-# +--------+---------------------+-----------------------+-------------------+
-# | Case D |   [X] DCMTKConfig   |      NA               |         YES       |
-# +--------+---------------------+-----------------------+-------------------+
-# | Case E |   [ ] DCMTKConfig   |      [ ] DCMTKConfig  |         YES (*)   |
-# +--------+---------------------+-----------------------+-------------------+
-# | Case F |   [X] DCMTKConfig   |      [ ] DCMTKConfig  |         NO        |
-# +--------+---------------------+-----------------------+-------------------+
-# | Case G |   [ ] DCMTKConfig   |      [X] DCMTKConfig  |         YES       |
-# +--------+---------------------+-----------------------+-------------------+
-# | Case H |   [X] DCMTKConfig   |      [X] DCMTKConfig  |         YES       |
-# +--------+---------------------+-----------------------+-------------------+
-#
-#  (*) See Troubleshooting section.
-#
-# Legend:
-#
-#   NA ...............: Means that no System or Local DCMTK is available
-#
-#   [ ] DCMTKConfig ..: Means that the version of DCMTK does NOT export a DCMTKConfig.cmake file.
-#
-#   [X] DCMTKConfig ..: Means that the version of DCMTK exports a DCMTKConfig.cmake file.
-#
-#
-# Troubleshooting
-# ^^^^^^^^^^^^^^^
-#
-# What to do if my project finds a different version of DCMTK?
-#
-# Remove DCMTK entry from the CMake cache per :command:`find_package`
-# documentation.
+#[=======================================================================[.rst:
+FindDCMTK
+---------
+
+Find DCMTK libraries and applications
+
+The module defines the following variables::
+
+ DCMTK_INCLUDE_DIRS  - Directories to include to use DCMTK
+ DCMTK_LIBRARIES     - Files to link against to use DCMTK
+ DCMTK_FOUND         - If false, don't try to use DCMTK
+ DCMTK_DIR           - (optional) Source directory for DCMTK
+
+Compatibility
+^^^^^^^^^^^^^
+
+This module is able to find a version of DCMTK that does or does not export
+a *DCMTKConfig.cmake* file. It applies a two step process:
+
+* Step 1:  Attempt to find DCMTK version providing a *DCMTKConfig.cmake* file.
+* Step 2:  If step 1 failed, rely on *FindDCMTK.cmake* to set `DCMTK_*` variables details below.
+
+
+`Recent DCMTK
+<http://git.dcmtk.org/web?p=dcmtk.git;a=commit;h=662ae187c493c6b9a73dd5e3875372cebd0c11fe>`_
+provides a *DCMTKConfig.cmake* :manual:`package configuration file
+<cmake-packages(7)>`. To exclusively use the package configuration file
+(recommended when possible), pass the `NO_MODULE` option to
+:command:`find_package`. For example, `find_package(DCMTK NO_MODULE)`.
+This requires official DCMTK snapshot *3.6.1_20140617* or newer.
+
+
+Until all clients update to the more recent DCMTK, build systems will need
+to support different versions of DCMTK.
+
+On any given system, the following combinations of DCMTK versions could be
+considered:
+
++--------+---------------------+-----------------------+-------------------+
+|        |   SYSTEM DCMTK      |      LOCAL DCMTK      |     Supported ?   |
++--------+---------------------+-----------------------+-------------------+
+| Case A |   NA                |      [ ] DCMTKConfig  |         YES       |
++--------+---------------------+-----------------------+-------------------+
+| Case B |   NA                |      [X] DCMTKConfig  |         YES       |
++--------+---------------------+-----------------------+-------------------+
+| Case C |   [ ] DCMTKConfig   |      NA               |         YES       |
++--------+---------------------+-----------------------+-------------------+
+| Case D |   [X] DCMTKConfig   |      NA               |         YES       |
++--------+---------------------+-----------------------+-------------------+
+| Case E |   [ ] DCMTKConfig   |      [ ] DCMTKConfig  |         YES (*)   |
++--------+---------------------+-----------------------+-------------------+
+| Case F |   [X] DCMTKConfig   |      [ ] DCMTKConfig  |         NO        |
++--------+---------------------+-----------------------+-------------------+
+| Case G |   [ ] DCMTKConfig   |      [X] DCMTKConfig  |         YES       |
++--------+---------------------+-----------------------+-------------------+
+| Case H |   [X] DCMTKConfig   |      [X] DCMTKConfig  |         YES       |
++--------+---------------------+-----------------------+-------------------+
+
+ (*) See Troubleshooting section.
+
+Legend:
+
+  NA ...............: Means that no System or Local DCMTK is available
+
+  [ ] DCMTKConfig ..: Means that the version of DCMTK does NOT export a DCMTKConfig.cmake file.
+
+  [X] DCMTKConfig ..: Means that the version of DCMTK exports a DCMTKConfig.cmake file.
+
+
+Troubleshooting
+^^^^^^^^^^^^^^^
+
+What to do if my project finds a different version of DCMTK?
+
+Remove DCMTK entry from the CMake cache per :command:`find_package`
+documentation.
+#]=======================================================================]
 
 #
 # Written for VXL by Amitha Perera.

+ 9 - 8
Modules/FindDart.cmake

@@ -1,14 +1,15 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindDart
-# --------
-#
-# Find DART
-#
-# This module looks for the dart testing software and sets DART_ROOT to
-# point to where it found it.
+#[=======================================================================[.rst:
+FindDart
+--------
+
+Find DART
+
+This module looks for the dart testing software and sets DART_ROOT to
+point to where it found it.
+#]=======================================================================]
 
 find_path(DART_ROOT README.INSTALL
     HINTS

+ 30 - 29
Modules/FindDevIL.cmake

@@ -1,35 +1,36 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindDevIL
-# ---------
-#
-#
-#
-# This module locates the developer's image library.
-# http://openil.sourceforge.net/
-#
-# This module sets:
-#
-# ::
-#
-#    IL_LIBRARIES -   the name of the IL library. These include the full path to
-#                     the core DevIL library. This one has to be linked into the
-#                     application.
-#    ILU_LIBRARIES -  the name of the ILU library. Again, the full path. This
-#                     library is for filters and effects, not actual loading. It
-#                     doesn't have to be linked if the functionality it provides
-#                     is not used.
-#    ILUT_LIBRARIES - the name of the ILUT library. Full path. This part of the
-#                     library interfaces with OpenGL. It is not strictly needed
-#                     in applications.
-#    IL_INCLUDE_DIR - where to find the il.h, ilu.h and ilut.h files.
-#    DevIL_FOUND    - this is set to TRUE if all the above variables were set.
-#                     This will be set to false if ILU or ILUT are not found,
-#                     even if they are not needed. In most systems, if one
-#                     library is found all the others are as well. That's the
-#                     way the DevIL developers release it.
+#[=======================================================================[.rst:
+FindDevIL
+---------
+
+
+
+This module locates the developer's image library.
+http://openil.sourceforge.net/
+
+This module sets:
+
+::
+
+   IL_LIBRARIES -   the name of the IL library. These include the full path to
+                    the core DevIL library. This one has to be linked into the
+                    application.
+   ILU_LIBRARIES -  the name of the ILU library. Again, the full path. This
+                    library is for filters and effects, not actual loading. It
+                    doesn't have to be linked if the functionality it provides
+                    is not used.
+   ILUT_LIBRARIES - the name of the ILUT library. Full path. This part of the
+                    library interfaces with OpenGL. It is not strictly needed
+                    in applications.
+   IL_INCLUDE_DIR - where to find the il.h, ilu.h and ilut.h files.
+   DevIL_FOUND    - this is set to TRUE if all the above variables were set.
+                    This will be set to false if ILU or ILUT are not found,
+                    even if they are not needed. In most systems, if one
+                    library is found all the others are as well. That's the
+                    way the DevIL developers release it.
+#]=======================================================================]
 
 # TODO: Add version support.
 # Tested under Linux and Windows (MSVC)

+ 27 - 26
Modules/FindEXPAT.cmake

@@ -1,32 +1,33 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindEXPAT
-# ---------
-#
-# Find the native Expat headers and library.
-#
-# Imported Targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the following :prop_tgt:`IMPORTED` targets:
-#
-# ``EXPAT::EXPAT``
-#   The Expat ``expat`` library, if found.
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module will set the following variables in your project:
-#
-# ``EXPAT_INCLUDE_DIRS``
-#   where to find expat.h, etc.
-# ``EXPAT_LIBRARIES``
-#   the libraries to link against to use Expat.
-# ``EXPAT_FOUND``
-#   true if the Expat headers and libraries were found.
-#
+#[=======================================================================[.rst:
+FindEXPAT
+---------
+
+Find the native Expat headers and library.
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+This module defines the following :prop_tgt:`IMPORTED` targets:
+
+``EXPAT::EXPAT``
+  The Expat ``expat`` library, if found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
+
+``EXPAT_INCLUDE_DIRS``
+  where to find expat.h, etc.
+``EXPAT_LIBRARIES``
+  the libraries to link against to use Expat.
+``EXPAT_FOUND``
+  true if the Expat headers and libraries were found.
+
+#]=======================================================================]
 
 find_package(PkgConfig QUIET)
 

+ 95 - 94
Modules/FindFLEX.cmake

@@ -1,100 +1,101 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindFLEX
-# --------
-#
-# Find flex executable and provides a macro to generate custom build rules
-#
-#
-#
-# The module defines the following variables:
-#
-# ::
-#
-#   FLEX_FOUND - true is flex executable is found
-#   FLEX_EXECUTABLE - the path to the flex executable
-#   FLEX_VERSION - the version of flex
-#   FLEX_LIBRARIES - The flex libraries
-#   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)
-#
-#
-#
-# If flex is found on the system, the module provides the macro:
-#
-# ::
-#
-#   FLEX_TARGET(Name FlexInput FlexOutput
-#               [COMPILE_FLAGS <string>]
-#               [DEFINES_FILE <string>]
-#               )
-#
-# which creates a custom command to generate the <FlexOutput> file from
-# the <FlexInput> file.  If COMPILE_FLAGS option is specified, the next
-# parameter is added to the flex command line. If flex is configured to
-# output a header file, the DEFINES_FILE option may be used to specify its
-# name. Name is an alias used to get details of this custom command.
-# Indeed the macro defines the following variables:
-#
-# ::
-#
-#   FLEX_${Name}_DEFINED - true is the macro ran successfully
-#   FLEX_${Name}_OUTPUTS - the source file generated by the custom rule, an
-#   alias for FlexOutput
-#   FLEX_${Name}_INPUT - the flex source file, an alias for ${FlexInput}
-#   FLEX_${Name}_OUTPUT_HEADER - the header flex output, if any.
-#
-#
-#
-# Flex scanners often use tokens defined by Bison: the code generated
-# by Flex depends of the header generated by Bison.  This module also
-# defines a macro:
-#
-# ::
-#
-#   ADD_FLEX_BISON_DEPENDENCY(FlexTarget BisonTarget)
-#
-# which adds the required dependency between a scanner and a parser
-# where <FlexTarget> and <BisonTarget> are the first parameters of
-# respectively FLEX_TARGET and BISON_TARGET macros.
-#
-# ::
-#
-#   ====================================================================
-#   Example:
-#
-#
-#
-# ::
-#
-#    find_package(BISON)
-#    find_package(FLEX)
-#
-#
-#
-# ::
-#
-#    BISON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp)
-#    FLEX_TARGET(MyScanner lexer.l  ${CMAKE_CURRENT_BINARY_DIR}/lexer.cpp)
-#    ADD_FLEX_BISON_DEPENDENCY(MyScanner MyParser)
-#
-#
-#
-# ::
-#
-#    include_directories(${CMAKE_CURRENT_BINARY_DIR})
-#    add_executable(Foo
-#       Foo.cc
-#       ${BISON_MyParser_OUTPUTS}
-#       ${FLEX_MyScanner_OUTPUTS}
-#    )
-#   ====================================================================
+#[=======================================================================[.rst:
+FindFLEX
+--------
+
+Find flex executable and provides a macro to generate custom build rules
+
+
+
+The module defines the following variables:
+
+::
+
+  FLEX_FOUND - true is flex executable is found
+  FLEX_EXECUTABLE - the path to the flex executable
+  FLEX_VERSION - the version of flex
+  FLEX_LIBRARIES - The flex libraries
+  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)
+
+
+
+If flex is found on the system, the module provides the macro:
+
+::
+
+  FLEX_TARGET(Name FlexInput FlexOutput
+              [COMPILE_FLAGS <string>]
+              [DEFINES_FILE <string>]
+              )
+
+which creates a custom command to generate the <FlexOutput> file from
+the <FlexInput> file.  If COMPILE_FLAGS option is specified, the next
+parameter is added to the flex command line. If flex is configured to
+output a header file, the DEFINES_FILE option may be used to specify its
+name. Name is an alias used to get details of this custom command.
+Indeed the macro defines the following variables:
+
+::
+
+  FLEX_${Name}_DEFINED - true is the macro ran successfully
+  FLEX_${Name}_OUTPUTS - the source file generated by the custom rule, an
+  alias for FlexOutput
+  FLEX_${Name}_INPUT - the flex source file, an alias for ${FlexInput}
+  FLEX_${Name}_OUTPUT_HEADER - the header flex output, if any.
+
+
+
+Flex scanners often use tokens defined by Bison: the code generated
+by Flex depends of the header generated by Bison.  This module also
+defines a macro:
+
+::
+
+  ADD_FLEX_BISON_DEPENDENCY(FlexTarget BisonTarget)
+
+which adds the required dependency between a scanner and a parser
+where <FlexTarget> and <BisonTarget> are the first parameters of
+respectively FLEX_TARGET and BISON_TARGET macros.
+
+::
+
+  ====================================================================
+  Example:
+
+
+
+::
+
+   find_package(BISON)
+   find_package(FLEX)
+
+
+
+::
+
+   BISON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp)
+   FLEX_TARGET(MyScanner lexer.l  ${CMAKE_CURRENT_BINARY_DIR}/lexer.cpp)
+   ADD_FLEX_BISON_DEPENDENCY(MyScanner MyParser)
+
+
+
+::
+
+   include_directories(${CMAKE_CURRENT_BINARY_DIR})
+   add_executable(Foo
+      Foo.cc
+      ${BISON_MyParser_OUTPUTS}
+      ${FLEX_MyScanner_OUTPUTS}
+   )
+  ====================================================================
+#]=======================================================================]
 
 find_program(FLEX_EXECUTABLE NAMES flex win_flex DOC "path to the flex executable")
 mark_as_advanced(FLEX_EXECUTABLE)

+ 77 - 76
Modules/FindFLTK.cmake

@@ -1,82 +1,83 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindFLTK
-# --------
-#
-# Find the FLTK library
-#
-# Input Variables
-# ^^^^^^^^^^^^^^^
-#
-# By default this module will search for all of the FLTK components and
-# add them to the FLTK_LIBRARIES variable.  You can limit the components
-# which get placed in FLTK_LIBRARIES by defining one or more of the
-# following three options:
-#
-# ``FLTK_SKIP_OPENGL``
-#   Set to true to disable searching for the FLTK GL library
-#
-# ``FLTK_SKIP_FORMS``
-#   Set to true to disable searching for the FLTK Forms library
-#
-# ``FLTK_SKIP_IMAGES``
-#   Set to true to disable searching for the FLTK Images library
-#
-# FLTK is composed also by a binary tool. You can set the following option:
-#
-# ``FLTK_SKIP_FLUID``
-#   Set to true to not look for the FLUID binary
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# The following variables will be defined:
-#
-# ``FLTK_FOUND``
-#   True if all components not skipped were found
-#
-# ``FLTK_INCLUDE_DIR``
-#   Path to the include directory for FLTK header files
-#
-# ``FLTK_LIBRARIES``
-#   List of the FLTK libraries found
-#
-# ``FLTK_FLUID_EXECUTABLE``
-#   Path to the FLUID binary tool
-#
-# ``FLTK_WRAP_UI``
-#   True if FLUID is found, used to enable the FLTK_WRAP_UI command
-#
-# Cache Variables
-# ^^^^^^^^^^^^^^^
-#
-# The following cache variables are also available to set or use:
-#
-# ``FLTK_BASE_LIBRARY_RELEASE``
-#   The FLTK base library (optimized)
-#
-# ``FLTK_BASE_LIBRARY_DEBUG``
-#   The FLTK base library (debug)
-#
-# ``FLTK_GL_LIBRARY_RELEASE``
-#   The FLTK GL library (optimized)
-#
-# ``FLTK_GL_LIBRARY_DEBUG``
-#   The FLTK GL library (debug)
-#
-# ``FLTK_FORMS_LIBRARY_RELEASE``
-#   The FLTK Forms library (optimized)
-#
-# ``FLTK_FORMS_LIBRARY_DEBUG``
-#   The FLTK Forms library (debug)
-#
-# ``FLTK_IMAGES_LIBRARY_RELEASE``
-#   The FLTK Images protobuf library (optimized)
-#
-# ``FLTK_IMAGES_LIBRARY_DEBUG``
-#   The FLTK Images library (debug)
+#[=======================================================================[.rst:
+FindFLTK
+--------
+
+Find the FLTK library
+
+Input Variables
+^^^^^^^^^^^^^^^
+
+By default this module will search for all of the FLTK components and
+add them to the FLTK_LIBRARIES variable.  You can limit the components
+which get placed in FLTK_LIBRARIES by defining one or more of the
+following three options:
+
+``FLTK_SKIP_OPENGL``
+  Set to true to disable searching for the FLTK GL library
+
+``FLTK_SKIP_FORMS``
+  Set to true to disable searching for the FLTK Forms library
+
+``FLTK_SKIP_IMAGES``
+  Set to true to disable searching for the FLTK Images library
+
+FLTK is composed also by a binary tool. You can set the following option:
+
+``FLTK_SKIP_FLUID``
+  Set to true to not look for the FLUID binary
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+The following variables will be defined:
+
+``FLTK_FOUND``
+  True if all components not skipped were found
+
+``FLTK_INCLUDE_DIR``
+  Path to the include directory for FLTK header files
+
+``FLTK_LIBRARIES``
+  List of the FLTK libraries found
+
+``FLTK_FLUID_EXECUTABLE``
+  Path to the FLUID binary tool
+
+``FLTK_WRAP_UI``
+  True if FLUID is found, used to enable the FLTK_WRAP_UI command
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables are also available to set or use:
+
+``FLTK_BASE_LIBRARY_RELEASE``
+  The FLTK base library (optimized)
+
+``FLTK_BASE_LIBRARY_DEBUG``
+  The FLTK base library (debug)
+
+``FLTK_GL_LIBRARY_RELEASE``
+  The FLTK GL library (optimized)
+
+``FLTK_GL_LIBRARY_DEBUG``
+  The FLTK GL library (debug)
+
+``FLTK_FORMS_LIBRARY_RELEASE``
+  The FLTK Forms library (optimized)
+
+``FLTK_FORMS_LIBRARY_DEBUG``
+  The FLTK Forms library (debug)
+
+``FLTK_IMAGES_LIBRARY_RELEASE``
+  The FLTK Images protobuf library (optimized)
+
+``FLTK_IMAGES_LIBRARY_DEBUG``
+  The FLTK Images library (debug)
+#]=======================================================================]
 
 if(NOT FLTK_SKIP_OPENGL)
   find_package(OpenGL)

+ 24 - 23
Modules/FindFLTK2.cmake

@@ -1,29 +1,30 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindFLTK2
-# ---------
-#
-# Find the native FLTK2 includes and library
-#
-# The following settings are defined
-#
-# ::
-#
-#   FLTK2_FLUID_EXECUTABLE, where to find the Fluid tool
-#   FLTK2_WRAP_UI, This enables the FLTK2_WRAP_UI command
-#   FLTK2_INCLUDE_DIR, where to find include files
-#   FLTK2_LIBRARIES, list of fltk2 libraries
-#   FLTK2_FOUND, Don't use FLTK2 if false.
-#
-# The following settings should not be used in general.
-#
-# ::
-#
-#   FLTK2_BASE_LIBRARY   = the full path to fltk2.lib
-#   FLTK2_GL_LIBRARY     = the full path to fltk2_gl.lib
-#   FLTK2_IMAGES_LIBRARY = the full path to fltk2_images.lib
+#[=======================================================================[.rst:
+FindFLTK2
+---------
+
+Find the native FLTK2 includes and library
+
+The following settings are defined
+
+::
+
+  FLTK2_FLUID_EXECUTABLE, where to find the Fluid tool
+  FLTK2_WRAP_UI, This enables the FLTK2_WRAP_UI command
+  FLTK2_INCLUDE_DIR, where to find include files
+  FLTK2_LIBRARIES, list of fltk2 libraries
+  FLTK2_FOUND, Don't use FLTK2 if false.
+
+The following settings should not be used in general.
+
+::
+
+  FLTK2_BASE_LIBRARY   = the full path to fltk2.lib
+  FLTK2_GL_LIBRARY     = the full path to fltk2_gl.lib
+  FLTK2_IMAGES_LIBRARY = the full path to fltk2_images.lib
+#]=======================================================================]
 
 set (FLTK2_DIR $ENV{FLTK2_DIR} )
 

+ 40 - 39
Modules/FindFreetype.cmake

@@ -1,45 +1,46 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindFreetype
-# ------------
-#
-# Find the FreeType font renderer includes and library.
-#
-# Imported Targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the following :prop_tgt:`IMPORTED` target:
-#
-# ``Freetype::Freetype``
-#   The Freetype ``freetype`` library, if found
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module will set the following variables in your project:
-#
-# ``FREETYPE_FOUND``
-#   true if the Freetype headers and libraries were found
-# ``FREETYPE_INCLUDE_DIRS``
-#   directories containing the Freetype headers. This is the
-#   concatenation of the variables:
-#
-#   ``FREETYPE_INCLUDE_DIR_ft2build``
-#     directory holding the main Freetype API configuration header
-#   ``FREETYPE_INCLUDE_DIR_freetype2``
-#     directory holding Freetype public headers
-# ``FREETYPE_LIBRARIES``
-#   the library to link against
-# ``FREETYPE_VERSION_STRING``
-#   the version of freetype found (since CMake 2.8.8)
-#
-# Hints
-# ^^^^^
-#
-# The user may set the environment variable ``FREETYPE_DIR`` to the root
-# directory of a Freetype installation.
+#[=======================================================================[.rst:
+FindFreetype
+------------
+
+Find the FreeType font renderer includes and library.
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+This module defines the following :prop_tgt:`IMPORTED` target:
+
+``Freetype::Freetype``
+  The Freetype ``freetype`` library, if found
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
+
+``FREETYPE_FOUND``
+  true if the Freetype headers and libraries were found
+``FREETYPE_INCLUDE_DIRS``
+  directories containing the Freetype headers. This is the
+  concatenation of the variables:
+
+  ``FREETYPE_INCLUDE_DIR_ft2build``
+    directory holding the main Freetype API configuration header
+  ``FREETYPE_INCLUDE_DIR_freetype2``
+    directory holding Freetype public headers
+``FREETYPE_LIBRARIES``
+  the library to link against
+``FREETYPE_VERSION_STRING``
+  the version of freetype found (since CMake 2.8.8)
+
+Hints
+^^^^^
+
+The user may set the environment variable ``FREETYPE_DIR`` to the root
+directory of a Freetype installation.
+#]=======================================================================]
 
 # Created by Eric Wing.
 # Modifications by Alexander Neundorf.

+ 14 - 13
Modules/FindGCCXML.cmake

@@ -1,19 +1,20 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindGCCXML
-# ----------
-#
-# Find the GCC-XML front-end executable.
-#
-#
-#
-# This module will define the following variables:
-#
-# ::
-#
-#   GCCXML - the GCC-XML front-end executable.
+#[=======================================================================[.rst:
+FindGCCXML
+----------
+
+Find the GCC-XML front-end executable.
+
+
+
+This module will define the following variables:
+
+::
+
+  GCCXML - the GCC-XML front-end executable.
+#]=======================================================================]
 
 find_program(GCCXML
   NAMES gccxml

+ 24 - 23
Modules/FindGDAL.cmake

@@ -1,29 +1,30 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindGDAL
-# --------
-#
-#
-#
-# Locate gdal
-#
-# This module accepts the following environment variables:
-#
-# ::
-#
-#     GDAL_DIR or GDAL_ROOT - Specify the location of GDAL
-#
-#
-#
-# This module defines the following CMake variables:
-#
-# ::
-#
-#     GDAL_FOUND - True if libgdal is found
-#     GDAL_LIBRARY - A variable pointing to the GDAL library
-#     GDAL_INCLUDE_DIR - Where to find the headers
+#[=======================================================================[.rst:
+FindGDAL
+--------
+
+
+
+Locate gdal
+
+This module accepts the following environment variables:
+
+::
+
+    GDAL_DIR or GDAL_ROOT - Specify the location of GDAL
+
+
+
+This module defines the following CMake variables:
+
+::
+
+    GDAL_FOUND - True if libgdal is found
+    GDAL_LIBRARY - A variable pointing to the GDAL library
+    GDAL_INCLUDE_DIR - Where to find the headers
+#]=======================================================================]
 
 #
 # $GDALDIR is an environment variable that would

+ 23 - 22
Modules/FindGIF.cmake

@@ -1,28 +1,29 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindGIF
-# -------
-#
-# This finds the GIF library (giflib)
-#
-# The module defines the following variables:
-#
-# ``GIF_FOUND``
-#   True if giflib was found
-# ``GIF_LIBRARIES``
-#   Libraries to link to in order to use giflib
-# ``GIF_INCLUDE_DIR``
-#   where to find the headers
-# ``GIF_VERSION``
-#   3, 4 or a full version string (eg 5.1.4) for versions >= 4.1.6
-#
-# The minimum required version of giflib can be specified using the
-# standard syntax, e.g.  find_package(GIF 4)
-#
-# $GIF_DIR is an environment variable that would correspond to the
-# ./configure --prefix=$GIF_DIR
+#[=======================================================================[.rst:
+FindGIF
+-------
+
+This finds the GIF library (giflib)
+
+The module defines the following variables:
+
+``GIF_FOUND``
+  True if giflib was found
+``GIF_LIBRARIES``
+  Libraries to link to in order to use giflib
+``GIF_INCLUDE_DIR``
+  where to find the headers
+``GIF_VERSION``
+  3, 4 or a full version string (eg 5.1.4) for versions >= 4.1.6
+
+The minimum required version of giflib can be specified using the
+standard syntax, e.g.  find_package(GIF 4)
+
+$GIF_DIR is an environment variable that would correspond to the
+./configure --prefix=$GIF_DIR
+#]=======================================================================]
 
 # Created by Eric Wing.
 # Modifications by Alexander Neundorf, Ben Campbell

+ 23 - 22
Modules/FindGLEW.cmake

@@ -1,28 +1,29 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindGLEW
-# --------
-#
-# Find the OpenGL Extension Wrangler Library (GLEW)
-#
-# IMPORTED Targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the :prop_tgt:`IMPORTED` target ``GLEW::GLEW``,
-# if GLEW has been found.
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the following variables:
-#
-# ::
-#
-#   GLEW_INCLUDE_DIRS - include directories for GLEW
-#   GLEW_LIBRARIES - libraries to link against GLEW
-#   GLEW_FOUND - true if GLEW has been found and can be used
+#[=======================================================================[.rst:
+FindGLEW
+--------
+
+Find the OpenGL Extension Wrangler Library (GLEW)
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines the :prop_tgt:`IMPORTED` target ``GLEW::GLEW``,
+if GLEW has been found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+::
+
+  GLEW_INCLUDE_DIRS - include directories for GLEW
+  GLEW_LIBRARIES - libraries to link against GLEW
+  GLEW_FOUND - true if GLEW has been found and can be used
+#]=======================================================================]
 
 find_path(GLEW_INCLUDE_DIR GL/glew.h)
 

+ 33 - 32
Modules/FindGLUT.cmake

@@ -1,38 +1,39 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindGLUT
-# --------
-#
-# try to find glut library and include files.
-#
-# IMPORTED Targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the :prop_tgt:`IMPORTED` targets:
-#
-# ``GLUT::GLUT``
-#  Defined if the system has GLUT.
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module sets the following variables:
-#
-# ::
-#
-#   GLUT_INCLUDE_DIR, where to find GL/glut.h, etc.
-#   GLUT_LIBRARIES, the libraries to link against
-#   GLUT_FOUND, If false, do not try to use GLUT.
-#
-# Also defined, but not for general use are:
-#
-# ::
-#
-#   GLUT_glut_LIBRARY = the full path to the glut library.
-#   GLUT_Xmu_LIBRARY  = the full path to the Xmu library.
-#   GLUT_Xi_LIBRARY   = the full path to the Xi Library.
+#[=======================================================================[.rst:
+FindGLUT
+--------
+
+try to find glut library and include files.
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines the :prop_tgt:`IMPORTED` targets:
+
+``GLUT::GLUT``
+ Defined if the system has GLUT.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module sets the following variables:
+
+::
+
+  GLUT_INCLUDE_DIR, where to find GL/glut.h, etc.
+  GLUT_LIBRARIES, the libraries to link against
+  GLUT_FOUND, If false, do not try to use GLUT.
+
+Also defined, but not for general use are:
+
+::
+
+  GLUT_glut_LIBRARY = the full path to the glut library.
+  GLUT_Xmu_LIBRARY  = the full path to the Xmu library.
+  GLUT_Xi_LIBRARY   = the full path to the Xi Library.
+#]=======================================================================]
 
 include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
 

+ 55 - 54
Modules/FindGSL.cmake

@@ -1,60 +1,61 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindGSL
-# --------
-#
-# Find the native GSL includes and libraries.
-#
-# The GNU Scientific Library (GSL) is a numerical library for C and C++
-# programmers. It is free software under the GNU General Public
-# License.
-#
-# Imported Targets
-# ^^^^^^^^^^^^^^^^
-#
-# If GSL is found, this module defines the following :prop_tgt:`IMPORTED`
-# targets::
-#
-#  GSL::gsl      - The main GSL library.
-#  GSL::gslcblas - The CBLAS support library used by GSL.
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module will set the following variables in your project::
-#
-#  GSL_FOUND          - True if GSL found on the local system
-#  GSL_INCLUDE_DIRS   - Location of GSL header files.
-#  GSL_LIBRARIES      - The GSL libraries.
-#  GSL_VERSION        - The version of the discovered GSL install.
-#
-# Hints
-# ^^^^^
-#
-# Set ``GSL_ROOT_DIR`` to a directory that contains a GSL installation.
-#
-# This script expects to find libraries at ``$GSL_ROOT_DIR/lib`` and the GSL
-# headers at ``$GSL_ROOT_DIR/include/gsl``.  The library directory may
-# optionally provide Release and Debug folders. If available, the libraries
-# named ``gsld``, ``gslblasd`` or ``cblasd`` are recognized as debug libraries.
-# For Unix-like systems, this script will use ``$GSL_ROOT_DIR/bin/gsl-config``
-# (if found) to aid in the discovery of GSL.
-#
-# Cache Variables
-# ^^^^^^^^^^^^^^^
-#
-# This module may set the following variables depending on platform and type
-# of GSL installation discovered.  These variables may optionally be set to
-# help this module find the correct files::
-#
-#  GSL_CBLAS_LIBRARY       - Location of the GSL CBLAS library.
-#  GSL_CBLAS_LIBRARY_DEBUG - Location of the debug GSL CBLAS library (if any).
-#  GSL_CONFIG_EXECUTABLE   - Location of the ``gsl-config`` script (if any).
-#  GSL_LIBRARY             - Location of the GSL library.
-#  GSL_LIBRARY_DEBUG       - Location of the debug GSL library (if any).
-#
+#[=======================================================================[.rst:
+FindGSL
+--------
+
+Find the native GSL includes and libraries.
+
+The GNU Scientific Library (GSL) is a numerical library for C and C++
+programmers. It is free software under the GNU General Public
+License.
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+If GSL is found, this module defines the following :prop_tgt:`IMPORTED`
+targets::
+
+ GSL::gsl      - The main GSL library.
+ GSL::gslcblas - The CBLAS support library used by GSL.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project::
+
+ GSL_FOUND          - True if GSL found on the local system
+ GSL_INCLUDE_DIRS   - Location of GSL header files.
+ GSL_LIBRARIES      - The GSL libraries.
+ GSL_VERSION        - The version of the discovered GSL install.
+
+Hints
+^^^^^
+
+Set ``GSL_ROOT_DIR`` to a directory that contains a GSL installation.
+
+This script expects to find libraries at ``$GSL_ROOT_DIR/lib`` and the GSL
+headers at ``$GSL_ROOT_DIR/include/gsl``.  The library directory may
+optionally provide Release and Debug folders. If available, the libraries
+named ``gsld``, ``gslblasd`` or ``cblasd`` are recognized as debug libraries.
+For Unix-like systems, this script will use ``$GSL_ROOT_DIR/bin/gsl-config``
+(if found) to aid in the discovery of GSL.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+This module may set the following variables depending on platform and type
+of GSL installation discovered.  These variables may optionally be set to
+help this module find the correct files::
+
+ GSL_CBLAS_LIBRARY       - Location of the GSL CBLAS library.
+ GSL_CBLAS_LIBRARY_DEBUG - Location of the debug GSL CBLAS library (if any).
+ GSL_CONFIG_EXECUTABLE   - Location of the ``gsl-config`` script (if any).
+ GSL_LIBRARY             - Location of the GSL library.
+ GSL_LIBRARY_DEBUG       - Location of the debug GSL library (if any).
+
+#]=======================================================================]
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 

+ 13 - 12
Modules/FindGTK.cmake

@@ -1,18 +1,19 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindGTK
-# -------
-#
-# try to find GTK (and glib) and GTKGLArea
-#
-# ::
-#
-#   GTK_INCLUDE_DIR   - Directories to include to use GTK
-#   GTK_LIBRARIES     - Files to link against to use GTK
-#   GTK_FOUND         - GTK was found
-#   GTK_GL_FOUND      - GTK's GL features were found
+#[=======================================================================[.rst:
+FindGTK
+-------
+
+try to find GTK (and glib) and GTKGLArea
+
+::
+
+  GTK_INCLUDE_DIR   - Directories to include to use GTK
+  GTK_LIBRARIES     - Files to link against to use GTK
+  GTK_FOUND         - GTK was found
+  GTK_GL_FOUND      - GTK's GL features were found
+#]=======================================================================]
 
 # don't even bother under WIN32
 if(UNIX)

+ 97 - 96
Modules/FindGTK2.cmake

@@ -1,102 +1,103 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindGTK2
-# --------
-#
-# FindGTK2.cmake
-#
-# This module can find the GTK2 widget libraries and several of its
-# other optional components like gtkmm, glade, and glademm.
-#
-# NOTE: If you intend to use version checking, CMake 2.6.2 or later is
-#
-# ::
-#
-#        required.
-#
-#
-#
-# Specify one or more of the following components as you call this find
-# module.  See example below.
-#
-# ::
-#
-#    gtk
-#    gtkmm
-#    glade
-#    glademm
-#
-#
-#
-# The following variables will be defined for your use
-#
-# ::
-#
-#    GTK2_FOUND - Were all of your specified components found?
-#    GTK2_INCLUDE_DIRS - All include directories
-#    GTK2_LIBRARIES - All libraries
-#    GTK2_TARGETS - All imported targets
-#    GTK2_DEFINITIONS - Additional compiler flags
-#
-#
-#
-# ::
-#
-#    GTK2_VERSION - The version of GTK2 found (x.y.z)
-#    GTK2_MAJOR_VERSION - The major version of GTK2
-#    GTK2_MINOR_VERSION - The minor version of GTK2
-#    GTK2_PATCH_VERSION - The patch version of GTK2
-#
-#
-#
-# Optional variables you can define prior to calling this module:
-#
-# ::
-#
-#    GTK2_DEBUG - Enables verbose debugging of the module
-#    GTK2_ADDITIONAL_SUFFIXES - Allows defining additional directories to
-#                               search for include files
-#
-#
-#
-# ================= Example Usage:
-#
-# ::
-#
-#    Call find_package() once, here are some examples to pick from:
-#
-#
-#
-# ::
-#
-#    Require GTK 2.6 or later
-#        find_package(GTK2 2.6 REQUIRED gtk)
-#
-#
-#
-# ::
-#
-#    Require GTK 2.10 or later and Glade
-#        find_package(GTK2 2.10 REQUIRED gtk glade)
-#
-#
-#
-# ::
-#
-#    Search for GTK/GTKMM 2.8 or later
-#        find_package(GTK2 2.8 COMPONENTS gtk gtkmm)
-#
-#
-#
-# ::
-#
-#    if(GTK2_FOUND)
-#       include_directories(${GTK2_INCLUDE_DIRS})
-#       add_executable(mygui mygui.cc)
-#       target_link_libraries(mygui ${GTK2_LIBRARIES})
-#    endif()
+#[=======================================================================[.rst:
+FindGTK2
+--------
+
+FindGTK2.cmake
+
+This module can find the GTK2 widget libraries and several of its
+other optional components like gtkmm, glade, and glademm.
+
+NOTE: If you intend to use version checking, CMake 2.6.2 or later is
+
+::
+
+       required.
+
+
+
+Specify one or more of the following components as you call this find
+module.  See example below.
+
+::
+
+   gtk
+   gtkmm
+   glade
+   glademm
+
+
+
+The following variables will be defined for your use
+
+::
+
+   GTK2_FOUND - Were all of your specified components found?
+   GTK2_INCLUDE_DIRS - All include directories
+   GTK2_LIBRARIES - All libraries
+   GTK2_TARGETS - All imported targets
+   GTK2_DEFINITIONS - Additional compiler flags
+
+
+
+::
+
+   GTK2_VERSION - The version of GTK2 found (x.y.z)
+   GTK2_MAJOR_VERSION - The major version of GTK2
+   GTK2_MINOR_VERSION - The minor version of GTK2
+   GTK2_PATCH_VERSION - The patch version of GTK2
+
+
+
+Optional variables you can define prior to calling this module:
+
+::
+
+   GTK2_DEBUG - Enables verbose debugging of the module
+   GTK2_ADDITIONAL_SUFFIXES - Allows defining additional directories to
+                              search for include files
+
+
+
+================= Example Usage:
+
+::
+
+   Call find_package() once, here are some examples to pick from:
+
+
+
+::
+
+   Require GTK 2.6 or later
+       find_package(GTK2 2.6 REQUIRED gtk)
+
+
+
+::
+
+   Require GTK 2.10 or later and Glade
+       find_package(GTK2 2.10 REQUIRED gtk glade)
+
+
+
+::
+
+   Search for GTK/GTKMM 2.8 or later
+       find_package(GTK2 2.8 COMPONENTS gtk gtkmm)
+
+
+
+::
+
+   if(GTK2_FOUND)
+      include_directories(${GTK2_INCLUDE_DIRS})
+      add_executable(mygui mygui.cc)
+      target_link_libraries(mygui ${GTK2_LIBRARIES})
+   endif()
+#]=======================================================================]
 
 # Version 1.6 (CMake 3.0)
 #   * Create targets for each library

+ 72 - 71
Modules/FindGTest.cmake

@@ -1,77 +1,78 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindGTest
-# ---------
-#
-# Locate the Google C++ Testing Framework.
-#
-# Imported targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the following :prop_tgt:`IMPORTED` targets:
-#
-# ``GTest::GTest``
-#   The Google Test ``gtest`` library, if found; adds Thread::Thread
-#   automatically
-# ``GTest::Main``
-#   The Google Test ``gtest_main`` library, if found
-#
-#
-# Result variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module will set the following variables in your project:
-#
-# ``GTEST_FOUND``
-#   Found the Google Testing framework
-# ``GTEST_INCLUDE_DIRS``
-#   the directory containing the Google Test headers
-#
-# The library variables below are set as normal variables.  These
-# contain debug/optimized keywords when a debugging library is found.
-#
-# ``GTEST_LIBRARIES``
-#   The Google Test ``gtest`` library; note it also requires linking
-#   with an appropriate thread library
-# ``GTEST_MAIN_LIBRARIES``
-#   The Google Test ``gtest_main`` library
-# ``GTEST_BOTH_LIBRARIES``
-#   Both ``gtest`` and ``gtest_main``
-#
-# Cache variables
-# ^^^^^^^^^^^^^^^
-#
-# The following cache variables may also be set:
-#
-# ``GTEST_ROOT``
-#   The root directory of the Google Test installation (may also be
-#   set as an environment variable)
-# ``GTEST_MSVC_SEARCH``
-#   If compiling with MSVC, this variable can be set to ``MT`` or
-#   ``MD`` (the default) to enable searching a GTest build tree
-#
-#
-# Example usage
-# ^^^^^^^^^^^^^
-#
-# ::
-#
-#     enable_testing()
-#     find_package(GTest REQUIRED)
-#
-#     add_executable(foo foo.cc)
-#     target_link_libraries(foo GTest::GTest GTest::Main)
-#
-#     add_test(AllTestsInFoo foo)
-#
-#
-# Deeper integration with CTest
-# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-#
-# See :module:`GoogleTest` for information on the :command:`gtest_add_tests`
-# and :command:`gtest_discover_tests` commands.
+#[=======================================================================[.rst:
+FindGTest
+---------
+
+Locate the Google C++ Testing Framework.
+
+Imported targets
+^^^^^^^^^^^^^^^^
+
+This module defines the following :prop_tgt:`IMPORTED` targets:
+
+``GTest::GTest``
+  The Google Test ``gtest`` library, if found; adds Thread::Thread
+  automatically
+``GTest::Main``
+  The Google Test ``gtest_main`` library, if found
+
+
+Result variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
+
+``GTEST_FOUND``
+  Found the Google Testing framework
+``GTEST_INCLUDE_DIRS``
+  the directory containing the Google Test headers
+
+The library variables below are set as normal variables.  These
+contain debug/optimized keywords when a debugging library is found.
+
+``GTEST_LIBRARIES``
+  The Google Test ``gtest`` library; note it also requires linking
+  with an appropriate thread library
+``GTEST_MAIN_LIBRARIES``
+  The Google Test ``gtest_main`` library
+``GTEST_BOTH_LIBRARIES``
+  Both ``gtest`` and ``gtest_main``
+
+Cache variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``GTEST_ROOT``
+  The root directory of the Google Test installation (may also be
+  set as an environment variable)
+``GTEST_MSVC_SEARCH``
+  If compiling with MSVC, this variable can be set to ``MT`` or
+  ``MD`` (the default) to enable searching a GTest build tree
+
+
+Example usage
+^^^^^^^^^^^^^
+
+::
+
+    enable_testing()
+    find_package(GTest REQUIRED)
+
+    add_executable(foo foo.cc)
+    target_link_libraries(foo GTest::GTest GTest::Main)
+
+    add_test(AllTestsInFoo foo)
+
+
+Deeper integration with CTest
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+See :module:`GoogleTest` for information on the :command:`gtest_add_tests`
+and :command:`gtest_discover_tests` commands.
+#]=======================================================================]
 
 include(${CMAKE_CURRENT_LIST_DIR}/GoogleTest.cmake)
 

+ 56 - 55
Modules/FindGettext.cmake

@@ -1,61 +1,62 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindGettext
-# -----------
-#
-# Find GNU gettext tools
-#
-# This module looks for the GNU gettext tools.  This module defines the
-# following values:
-#
-# ::
-#
-#   GETTEXT_MSGMERGE_EXECUTABLE: the full path to the msgmerge tool.
-#   GETTEXT_MSGFMT_EXECUTABLE: the full path to the msgfmt tool.
-#   GETTEXT_FOUND: True if gettext has been found.
-#   GETTEXT_VERSION_STRING: the version of gettext found (since CMake 2.8.8)
-#
-#
-#
-# Additionally it provides the following macros:
-#
-# GETTEXT_CREATE_TRANSLATIONS ( outputFile [ALL] file1 ...  fileN )
-#
-# ::
-#
-#     This will create a target "translations" which will convert the
-#     given input po files into the binary output mo file. If the
-#     ALL option is used, the translations will also be created when
-#     building the default target.
-#
-# GETTEXT_PROCESS_POT_FILE( <potfile> [ALL] [INSTALL_DESTINATION <destdir>]
-# LANGUAGES <lang1> <lang2> ...  )
-#
-# ::
-#
-#      Process the given pot file to mo files.
-#      If INSTALL_DESTINATION is given then automatically install rules will
-#      be created, the language subdirectory will be taken into account
-#      (by default use share/locale/).
-#      If ALL is specified, the pot file is processed when building the all traget.
-#      It creates a custom target "potfile".
-#
-# GETTEXT_PROCESS_PO_FILES( <lang> [ALL] [INSTALL_DESTINATION <dir>]
-# PO_FILES <po1> <po2> ...  )
-#
-# ::
-#
-#      Process the given po files to mo files for the given language.
-#      If INSTALL_DESTINATION is given then automatically install rules will
-#      be created, the language subdirectory will be taken into account
-#      (by default use share/locale/).
-#      If ALL is specified, the po files are processed when building the all traget.
-#      It creates a custom target "pofiles".
-#
-# .. note::
-#   If you wish to use the Gettext library (libintl), use :module:`FindIntl`.
+#[=======================================================================[.rst:
+FindGettext
+-----------
+
+Find GNU gettext tools
+
+This module looks for the GNU gettext tools.  This module defines the
+following values:
+
+::
+
+  GETTEXT_MSGMERGE_EXECUTABLE: the full path to the msgmerge tool.
+  GETTEXT_MSGFMT_EXECUTABLE: the full path to the msgfmt tool.
+  GETTEXT_FOUND: True if gettext has been found.
+  GETTEXT_VERSION_STRING: the version of gettext found (since CMake 2.8.8)
+
+
+
+Additionally it provides the following macros:
+
+GETTEXT_CREATE_TRANSLATIONS ( outputFile [ALL] file1 ...  fileN )
+
+::
+
+    This will create a target "translations" which will convert the
+    given input po files into the binary output mo file. If the
+    ALL option is used, the translations will also be created when
+    building the default target.
+
+GETTEXT_PROCESS_POT_FILE( <potfile> [ALL] [INSTALL_DESTINATION <destdir>]
+LANGUAGES <lang1> <lang2> ...  )
+
+::
+
+     Process the given pot file to mo files.
+     If INSTALL_DESTINATION is given then automatically install rules will
+     be created, the language subdirectory will be taken into account
+     (by default use share/locale/).
+     If ALL is specified, the pot file is processed when building the all traget.
+     It creates a custom target "potfile".
+
+GETTEXT_PROCESS_PO_FILES( <lang> [ALL] [INSTALL_DESTINATION <dir>]
+PO_FILES <po1> <po2> ...  )
+
+::
+
+     Process the given po files to mo files for the given language.
+     If INSTALL_DESTINATION is given then automatically install rules will
+     be created, the language subdirectory will be taken into account
+     (by default use share/locale/).
+     If ALL is specified, the po files are processed when building the all traget.
+     It creates a custom target "pofiles".
+
+.. note::
+  If you wish to use the Gettext library (libintl), use :module:`FindIntl`.
+#]=======================================================================]
 
 find_program(GETTEXT_MSGMERGE_EXECUTABLE msgmerge)
 

+ 22 - 21
Modules/FindGit.cmake

@@ -1,27 +1,28 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindGit
-# -------
-#
-# The module defines the following variables:
-#
-# ``GIT_EXECUTABLE``
-#   Path to Git command-line client.
-# ``Git_FOUND``, ``GIT_FOUND``
-#   True if the Git command-line client was found.
-# ``GIT_VERSION_STRING``
-#   The version of Git found.
-#
-# Example usage:
-#
-# .. code-block:: cmake
-#
-#    find_package(Git)
-#    if(Git_FOUND)
-#      message("Git found: ${GIT_EXECUTABLE}")
-#    endif()
+#[=======================================================================[.rst:
+FindGit
+-------
+
+The module defines the following variables:
+
+``GIT_EXECUTABLE``
+  Path to Git command-line client.
+``Git_FOUND``, ``GIT_FOUND``
+  True if the Git command-line client was found.
+``GIT_VERSION_STRING``
+  The version of Git found.
+
+Example usage:
+
+.. code-block:: cmake
+
+   find_package(Git)
+   if(Git_FOUND)
+     message("Git found: ${GIT_EXECUTABLE}")
+   endif()
+#]=======================================================================]
 
 # Look for 'git' or 'eg' (easy git)
 #

+ 17 - 16
Modules/FindGnuTLS.cmake

@@ -1,22 +1,23 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindGnuTLS
-# ----------
-#
-# Try to find the GNU Transport Layer Security library (gnutls)
-#
-#
-#
-# Once done this will define
-#
-# ::
-#
-#   GNUTLS_FOUND - System has gnutls
-#   GNUTLS_INCLUDE_DIR - The gnutls include directory
-#   GNUTLS_LIBRARIES - The libraries needed to use gnutls
-#   GNUTLS_DEFINITIONS - Compiler switches required for using gnutls
+#[=======================================================================[.rst:
+FindGnuTLS
+----------
+
+Try to find the GNU Transport Layer Security library (gnutls)
+
+
+
+Once done this will define
+
+::
+
+  GNUTLS_FOUND - System has gnutls
+  GNUTLS_INCLUDE_DIR - The gnutls include directory
+  GNUTLS_LIBRARIES - The libraries needed to use gnutls
+  GNUTLS_DEFINITIONS - Compiler switches required for using gnutls
+#]=======================================================================]
 
 # Note that this doesn't try to find the gnutls-extra package.
 

+ 20 - 19
Modules/FindGnuplot.cmake

@@ -1,25 +1,26 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindGnuplot
-# -----------
-#
-# this module looks for gnuplot
-#
-#
-#
-# Once done this will define
-#
-# ::
-#
-#   GNUPLOT_FOUND - system has Gnuplot
-#   GNUPLOT_EXECUTABLE - the Gnuplot executable
-#   GNUPLOT_VERSION_STRING - the version of Gnuplot found (since CMake 2.8.8)
-#
-#
-#
-# GNUPLOT_VERSION_STRING will not work for old versions like 3.7.1.
+#[=======================================================================[.rst:
+FindGnuplot
+-----------
+
+this module looks for gnuplot
+
+
+
+Once done this will define
+
+::
+
+  GNUPLOT_FOUND - system has Gnuplot
+  GNUPLOT_EXECUTABLE - the Gnuplot executable
+  GNUPLOT_VERSION_STRING - the version of Gnuplot found (since CMake 2.8.8)
+
+
+
+GNUPLOT_VERSION_STRING will not work for old versions like 3.7.1.
+#]=======================================================================]
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindCygwin.cmake)
 

+ 104 - 103
Modules/FindHDF5.cmake

@@ -1,109 +1,110 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindHDF5
-# --------
-#
-# Find HDF5, a library for reading and writing self describing array data.
-#
-#
-#
-# This module invokes the HDF5 wrapper compiler that should be installed
-# alongside HDF5.  Depending upon the HDF5 Configuration, the wrapper
-# compiler is called either h5cc or h5pcc.  If this succeeds, the module
-# will then call the compiler with the -show argument to see what flags
-# are used when compiling an HDF5 client application.
-#
-# The module will optionally accept the COMPONENTS argument.  If no
-# COMPONENTS are specified, then the find module will default to finding
-# only the HDF5 C library.  If one or more COMPONENTS are specified, the
-# module will attempt to find the language bindings for the specified
-# components.  The only valid components are C, CXX, Fortran, HL, and
-# Fortran_HL.  If the COMPONENTS argument is not given, the module will
-# attempt to find only the C bindings.
-#
-# This module will read the variable
-# HDF5_USE_STATIC_LIBRARIES to determine whether or not to prefer a
-# static link to a dynamic link for HDF5 and all of it's dependencies.
-# To use this feature, make sure that the HDF5_USE_STATIC_LIBRARIES
-# variable is set before the call to find_package.
-#
-# To provide the module with a hint about where to find your HDF5
-# installation, you can set the environment variable HDF5_ROOT.  The
-# Find module will then look in this path when searching for HDF5
-# executables, paths, and libraries.
-#
-# Both the serial and parallel HDF5 wrappers are considered and the first
-# directory to contain either one will be used.  In the event that both appear
-# in the same directory the serial version is preferentially selected. This
-# behavior can be reversed by setting the variable HDF5_PREFER_PARALLEL to
-# true.
-#
-# In addition to finding the includes and libraries required to compile
-# an HDF5 client application, this module also makes an effort to find
-# tools that come with the HDF5 distribution that may be useful for
-# regression testing.
-#
-# This module will define the following variables:
-#
-# ::
-#
-#   HDF5_FOUND - true if HDF5 was found on the system
-#   HDF5_VERSION - HDF5 version in format Major.Minor.Release
-#   HDF5_INCLUDE_DIRS - Location of the hdf5 includes
-#   HDF5_INCLUDE_DIR - Location of the hdf5 includes (deprecated)
-#   HDF5_DEFINITIONS - Required compiler definitions for HDF5
-#   HDF5_LIBRARIES - Required libraries for all requested bindings
-#   HDF5_HL_LIBRARIES - Required libraries for the HDF5 high level API for all
-#                       bindings, if the HL component is enabled
-#
-# Available components are: C CXX Fortran and HL.  For each enabled language
-# binding, a corresponding HDF5_${LANG}_LIBRARIES variable, and potentially
-# HDF5_${LANG}_DEFINITIONS, will be defined.
-# If the HL component is enabled, then an HDF5_${LANG}_HL_LIBRARIES will
-# also be defined.  With all components enabled, the following variables will be defined:
-#
-# ::
-#
-#   HDF5_C_DEFINITIONS -- Required compiler definitions for HDF5 C bindings
-#   HDF5_CXX_DEFINITIONS -- Required compiler definitions for HDF5 C++ bindings
-#   HDF5_Fortran_DEFINITIONS -- Required compiler definitions for HDF5 Fortran bindings
-#   HDF5_C_INCLUDE_DIRS -- Required include directories for HDF5 C bindings
-#   HDF5_CXX_INCLUDE_DIRS -- Required include directories for HDF5 C++ bindings
-#   HDF5_Fortran_INCLUDE_DIRS -- Required include directories for HDF5 Fortran bindings
-#   HDF5_C_LIBRARIES - Required libraries for the HDF5 C bindings
-#   HDF5_CXX_LIBRARIES - Required libraries for the HDF5 C++ bindings
-#   HDF5_Fortran_LIBRARIES - Required libraries for the HDF5 Fortran bindings
-#   HDF5_C_HL_LIBRARIES - Required libraries for the high level C bindings
-#   HDF5_CXX_HL_LIBRARIES - Required libraries for the high level C++ bindings
-#   HDF5_Fortran_HL_LIBRARIES - Required libraries for the high level Fortran
-#                               bindings.
-#
-#   HDF5_IS_PARALLEL - Whether or not HDF5 was found with parallel IO support
-#   HDF5_C_COMPILER_EXECUTABLE - the path to the HDF5 C wrapper compiler
-#   HDF5_CXX_COMPILER_EXECUTABLE - the path to the HDF5 C++ wrapper compiler
-#   HDF5_Fortran_COMPILER_EXECUTABLE - the path to the HDF5 Fortran wrapper compiler
-#   HDF5_C_COMPILER_EXECUTABLE_NO_INTERROGATE - path to the primary C compiler
-#                                               which is also the HDF5 wrapper
-#   HDF5_CXX_COMPILER_EXECUTABLE_NO_INTERROGATE - path to the primary C++
-#                                                 compiler which is also
-#                                                 the HDF5 wrapper
-#   HDF5_Fortran_COMPILER_EXECUTABLE_NO_INTERROGATE - path to the primary
-#                                                     Fortran compiler which
-#                                                     is also the HDF5 wrapper
-#   HDF5_DIFF_EXECUTABLE - the path to the HDF5 dataset comparison tool
-#
-# The following variable can be set to guide the search for HDF5 libraries and includes:
-#
-# ``HDF5_ROOT``
-#   Specify the path to the HDF5 installation to use.
-#
-# ``HDF5_FIND_DEBUG``
-#   Set to a true value to get some extra debugging output.
-#
-# ``HDF5_NO_FIND_PACKAGE_CONFIG_FILE``
-#   Set to a true value to skip trying to find ``hdf5-config.cmake``.
+#[=======================================================================[.rst:
+FindHDF5
+--------
+
+Find HDF5, a library for reading and writing self describing array data.
+
+
+
+This module invokes the HDF5 wrapper compiler that should be installed
+alongside HDF5.  Depending upon the HDF5 Configuration, the wrapper
+compiler is called either h5cc or h5pcc.  If this succeeds, the module
+will then call the compiler with the -show argument to see what flags
+are used when compiling an HDF5 client application.
+
+The module will optionally accept the COMPONENTS argument.  If no
+COMPONENTS are specified, then the find module will default to finding
+only the HDF5 C library.  If one or more COMPONENTS are specified, the
+module will attempt to find the language bindings for the specified
+components.  The only valid components are C, CXX, Fortran, HL, and
+Fortran_HL.  If the COMPONENTS argument is not given, the module will
+attempt to find only the C bindings.
+
+This module will read the variable
+HDF5_USE_STATIC_LIBRARIES to determine whether or not to prefer a
+static link to a dynamic link for HDF5 and all of it's dependencies.
+To use this feature, make sure that the HDF5_USE_STATIC_LIBRARIES
+variable is set before the call to find_package.
+
+To provide the module with a hint about where to find your HDF5
+installation, you can set the environment variable HDF5_ROOT.  The
+Find module will then look in this path when searching for HDF5
+executables, paths, and libraries.
+
+Both the serial and parallel HDF5 wrappers are considered and the first
+directory to contain either one will be used.  In the event that both appear
+in the same directory the serial version is preferentially selected. This
+behavior can be reversed by setting the variable HDF5_PREFER_PARALLEL to
+true.
+
+In addition to finding the includes and libraries required to compile
+an HDF5 client application, this module also makes an effort to find
+tools that come with the HDF5 distribution that may be useful for
+regression testing.
+
+This module will define the following variables:
+
+::
+
+  HDF5_FOUND - true if HDF5 was found on the system
+  HDF5_VERSION - HDF5 version in format Major.Minor.Release
+  HDF5_INCLUDE_DIRS - Location of the hdf5 includes
+  HDF5_INCLUDE_DIR - Location of the hdf5 includes (deprecated)
+  HDF5_DEFINITIONS - Required compiler definitions for HDF5
+  HDF5_LIBRARIES - Required libraries for all requested bindings
+  HDF5_HL_LIBRARIES - Required libraries for the HDF5 high level API for all
+                      bindings, if the HL component is enabled
+
+Available components are: C CXX Fortran and HL.  For each enabled language
+binding, a corresponding HDF5_${LANG}_LIBRARIES variable, and potentially
+HDF5_${LANG}_DEFINITIONS, will be defined.
+If the HL component is enabled, then an HDF5_${LANG}_HL_LIBRARIES will
+also be defined.  With all components enabled, the following variables will be defined:
+
+::
+
+  HDF5_C_DEFINITIONS -- Required compiler definitions for HDF5 C bindings
+  HDF5_CXX_DEFINITIONS -- Required compiler definitions for HDF5 C++ bindings
+  HDF5_Fortran_DEFINITIONS -- Required compiler definitions for HDF5 Fortran bindings
+  HDF5_C_INCLUDE_DIRS -- Required include directories for HDF5 C bindings
+  HDF5_CXX_INCLUDE_DIRS -- Required include directories for HDF5 C++ bindings
+  HDF5_Fortran_INCLUDE_DIRS -- Required include directories for HDF5 Fortran bindings
+  HDF5_C_LIBRARIES - Required libraries for the HDF5 C bindings
+  HDF5_CXX_LIBRARIES - Required libraries for the HDF5 C++ bindings
+  HDF5_Fortran_LIBRARIES - Required libraries for the HDF5 Fortran bindings
+  HDF5_C_HL_LIBRARIES - Required libraries for the high level C bindings
+  HDF5_CXX_HL_LIBRARIES - Required libraries for the high level C++ bindings
+  HDF5_Fortran_HL_LIBRARIES - Required libraries for the high level Fortran
+                              bindings.
+
+  HDF5_IS_PARALLEL - Whether or not HDF5 was found with parallel IO support
+  HDF5_C_COMPILER_EXECUTABLE - the path to the HDF5 C wrapper compiler
+  HDF5_CXX_COMPILER_EXECUTABLE - the path to the HDF5 C++ wrapper compiler
+  HDF5_Fortran_COMPILER_EXECUTABLE - the path to the HDF5 Fortran wrapper compiler
+  HDF5_C_COMPILER_EXECUTABLE_NO_INTERROGATE - path to the primary C compiler
+                                              which is also the HDF5 wrapper
+  HDF5_CXX_COMPILER_EXECUTABLE_NO_INTERROGATE - path to the primary C++
+                                                compiler which is also
+                                                the HDF5 wrapper
+  HDF5_Fortran_COMPILER_EXECUTABLE_NO_INTERROGATE - path to the primary
+                                                    Fortran compiler which
+                                                    is also the HDF5 wrapper
+  HDF5_DIFF_EXECUTABLE - the path to the HDF5 dataset comparison tool
+
+The following variable can be set to guide the search for HDF5 libraries and includes:
+
+``HDF5_ROOT``
+  Specify the path to the HDF5 installation to use.
+
+``HDF5_FIND_DEBUG``
+  Set to a true value to get some extra debugging output.
+
+``HDF5_NO_FIND_PACKAGE_CONFIG_FILE``
+  Set to a true value to skip trying to find ``hdf5-config.cmake``.
+#]=======================================================================]
 
 # This module is maintained by Will Dicharry <[email protected]>.
 

+ 23 - 22
Modules/FindHSPELL.cmake

@@ -1,28 +1,29 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindHSPELL
-# ----------
-#
-# Try to find Hspell
-#
-# Once done this will define
-#
-# ::
-#
-#   HSPELL_FOUND - system has Hspell
-#   HSPELL_INCLUDE_DIR - the Hspell include directory
-#   HSPELL_LIBRARIES - The libraries needed to use Hspell
-#   HSPELL_DEFINITIONS - Compiler switches required for using Hspell
-#
-#
-#
-# ::
-#
-#   HSPELL_VERSION_STRING - The version of Hspell found (x.y)
-#   HSPELL_MAJOR_VERSION  - the major version of Hspell
-#   HSPELL_MINOR_VERSION  - The minor version of Hspell
+#[=======================================================================[.rst:
+FindHSPELL
+----------
+
+Try to find Hspell
+
+Once done this will define
+
+::
+
+  HSPELL_FOUND - system has Hspell
+  HSPELL_INCLUDE_DIR - the Hspell include directory
+  HSPELL_LIBRARIES - The libraries needed to use Hspell
+  HSPELL_DEFINITIONS - Compiler switches required for using Hspell
+
+
+
+::
+
+  HSPELL_VERSION_STRING - The version of Hspell found (x.y)
+  HSPELL_MAJOR_VERSION  - the major version of Hspell
+  HSPELL_MINOR_VERSION  - The minor version of Hspell
+#]=======================================================================]
 
 find_path(HSPELL_INCLUDE_DIR hspell.h)
 

+ 14 - 13
Modules/FindHTMLHelp.cmake

@@ -1,19 +1,20 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindHTMLHelp
-# ------------
-#
-# This module looks for Microsoft HTML Help Compiler
-#
-# It defines:
-#
-# ::
-#
-#    HTML_HELP_COMPILER     : full path to the Compiler (hhc.exe)
-#    HTML_HELP_INCLUDE_PATH : include path to the API (htmlhelp.h)
-#    HTML_HELP_LIBRARY      : full path to the library (htmlhelp.lib)
+#[=======================================================================[.rst:
+FindHTMLHelp
+------------
+
+This module looks for Microsoft HTML Help Compiler
+
+It defines:
+
+::
+
+   HTML_HELP_COMPILER     : full path to the Compiler (hhc.exe)
+   HTML_HELP_INCLUDE_PATH : include path to the API (htmlhelp.h)
+   HTML_HELP_LIBRARY      : full path to the library (htmlhelp.lib)
+#]=======================================================================]
 
 if(WIN32)
 

+ 40 - 39
Modules/FindHg.cmake

@@ -1,45 +1,46 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindHg
-# ------
-#
-# Extract information from a mercurial working copy.
-#
-# The module defines the following variables:
-#
-# ::
-#
-#    HG_EXECUTABLE - path to mercurial command line client (hg)
-#    HG_FOUND - true if the command line client was found
-#    HG_VERSION_STRING - the version of mercurial found
-#
-# If the command line client executable is found the following macro is defined:
-#
-# ::
-#
-#   HG_WC_INFO(<dir> <var-prefix>)
-#
-# Hg_WC_INFO extracts information of a mercurial working copy
-# at a given location.  This macro defines the following variables:
-#
-# ::
-#
-#   <var-prefix>_WC_CHANGESET - current changeset
-#   <var-prefix>_WC_REVISION - current revision
-#
-# Example usage:
-#
-# ::
-#
-#    find_package(Hg)
-#    if(HG_FOUND)
-#      message("hg found: ${HG_EXECUTABLE}")
-#      HG_WC_INFO(${PROJECT_SOURCE_DIR} Project)
-#      message("Current revision is ${Project_WC_REVISION}")
-#      message("Current changeset is ${Project_WC_CHANGESET}")
-#    endif()
+#[=======================================================================[.rst:
+FindHg
+------
+
+Extract information from a mercurial working copy.
+
+The module defines the following variables:
+
+::
+
+   HG_EXECUTABLE - path to mercurial command line client (hg)
+   HG_FOUND - true if the command line client was found
+   HG_VERSION_STRING - the version of mercurial found
+
+If the command line client executable is found the following macro is defined:
+
+::
+
+  HG_WC_INFO(<dir> <var-prefix>)
+
+Hg_WC_INFO extracts information of a mercurial working copy
+at a given location.  This macro defines the following variables:
+
+::
+
+  <var-prefix>_WC_CHANGESET - current changeset
+  <var-prefix>_WC_REVISION - current revision
+
+Example usage:
+
+::
+
+   find_package(Hg)
+   if(HG_FOUND)
+     message("hg found: ${HG_EXECUTABLE}")
+     HG_WC_INFO(${PROJECT_SOURCE_DIR} Project)
+     message("Current revision is ${Project_WC_REVISION}")
+     message("Current changeset is ${Project_WC_CHANGESET}")
+   endif()
+#]=======================================================================]
 
 find_program(HG_EXECUTABLE
   NAMES hg

+ 84 - 83
Modules/FindICU.cmake

@@ -1,89 +1,90 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindICU
-# -------
-#
-# Find the International Components for Unicode (ICU) libraries and
-# programs.
-#
-# This module supports multiple components.
-# Components can include any of: ``data``, ``i18n``, ``io``, ``le``,
-# ``lx``, ``test``, ``tu`` and ``uc``.
-#
-# Note that on Windows ``data`` is named ``dt`` and ``i18n`` is named
-# ``in``; any of the names may be used, and the appropriate
-# platform-specific library name will be automatically selected.
-#
-# This module reports information about the ICU installation in
-# several variables.  General variables::
-#
-#   ICU_VERSION - ICU release version
-#   ICU_FOUND - true if the main programs and libraries were found
-#   ICU_LIBRARIES - component libraries to be linked
-#   ICU_INCLUDE_DIRS - the directories containing the ICU headers
-#
-# Imported targets::
-#
-#   ICU::<C>
-#
-# Where ``<C>`` is the name of an ICU component, for example
-# ``ICU::i18n``.
-#
-# ICU programs are reported in::
-#
-#   ICU_GENCNVAL_EXECUTABLE - path to gencnval executable
-#   ICU_ICUINFO_EXECUTABLE - path to icuinfo executable
-#   ICU_GENBRK_EXECUTABLE - path to genbrk executable
-#   ICU_ICU-CONFIG_EXECUTABLE - path to icu-config executable
-#   ICU_GENRB_EXECUTABLE - path to genrb executable
-#   ICU_GENDICT_EXECUTABLE - path to gendict executable
-#   ICU_DERB_EXECUTABLE - path to derb executable
-#   ICU_PKGDATA_EXECUTABLE - path to pkgdata executable
-#   ICU_UCONV_EXECUTABLE - path to uconv executable
-#   ICU_GENCFU_EXECUTABLE - path to gencfu executable
-#   ICU_MAKECONV_EXECUTABLE - path to makeconv executable
-#   ICU_GENNORM2_EXECUTABLE - path to gennorm2 executable
-#   ICU_GENCCODE_EXECUTABLE - path to genccode executable
-#   ICU_GENSPREP_EXECUTABLE - path to gensprep executable
-#   ICU_ICUPKG_EXECUTABLE - path to icupkg executable
-#   ICU_GENCMN_EXECUTABLE - path to gencmn executable
-#
-# ICU component libraries are reported in::
-#
-#   ICU_<C>_FOUND - ON if component was found
-#   ICU_<C>_LIBRARIES - libraries for component
-#
-# ICU datafiles are reported in::
-#
-#   ICU_MAKEFILE_INC - Makefile.inc
-#   ICU_PKGDATA_INC - pkgdata.inc
-#
-# Note that ``<C>`` is the uppercased name of the component.
-#
-# This module reads hints about search results from::
-#
-#   ICU_ROOT - the root of the ICU installation
-#
-# The environment variable ``ICU_ROOT`` may also be used; the
-# ICU_ROOT variable takes precedence.
-#
-# The following cache variables may also be set::
-#
-#   ICU_<P>_EXECUTABLE - the path to executable <P>
-#   ICU_INCLUDE_DIR - the directory containing the ICU headers
-#   ICU_<C>_LIBRARY - the library for component <C>
-#
-# .. note::
-#
-#   In most cases none of the above variables will require setting,
-#   unless multiple ICU versions are available and a specific version
-#   is required.
-#
-# Other variables one may set to control this module are::
-#
-#   ICU_DEBUG - Set to ON to enable debug output from FindICU.
+#[=======================================================================[.rst:
+FindICU
+-------
+
+Find the International Components for Unicode (ICU) libraries and
+programs.
+
+This module supports multiple components.
+Components can include any of: ``data``, ``i18n``, ``io``, ``le``,
+``lx``, ``test``, ``tu`` and ``uc``.
+
+Note that on Windows ``data`` is named ``dt`` and ``i18n`` is named
+``in``; any of the names may be used, and the appropriate
+platform-specific library name will be automatically selected.
+
+This module reports information about the ICU installation in
+several variables.  General variables::
+
+  ICU_VERSION - ICU release version
+  ICU_FOUND - true if the main programs and libraries were found
+  ICU_LIBRARIES - component libraries to be linked
+  ICU_INCLUDE_DIRS - the directories containing the ICU headers
+
+Imported targets::
+
+  ICU::<C>
+
+Where ``<C>`` is the name of an ICU component, for example
+``ICU::i18n``.
+
+ICU programs are reported in::
+
+  ICU_GENCNVAL_EXECUTABLE - path to gencnval executable
+  ICU_ICUINFO_EXECUTABLE - path to icuinfo executable
+  ICU_GENBRK_EXECUTABLE - path to genbrk executable
+  ICU_ICU-CONFIG_EXECUTABLE - path to icu-config executable
+  ICU_GENRB_EXECUTABLE - path to genrb executable
+  ICU_GENDICT_EXECUTABLE - path to gendict executable
+  ICU_DERB_EXECUTABLE - path to derb executable
+  ICU_PKGDATA_EXECUTABLE - path to pkgdata executable
+  ICU_UCONV_EXECUTABLE - path to uconv executable
+  ICU_GENCFU_EXECUTABLE - path to gencfu executable
+  ICU_MAKECONV_EXECUTABLE - path to makeconv executable
+  ICU_GENNORM2_EXECUTABLE - path to gennorm2 executable
+  ICU_GENCCODE_EXECUTABLE - path to genccode executable
+  ICU_GENSPREP_EXECUTABLE - path to gensprep executable
+  ICU_ICUPKG_EXECUTABLE - path to icupkg executable
+  ICU_GENCMN_EXECUTABLE - path to gencmn executable
+
+ICU component libraries are reported in::
+
+  ICU_<C>_FOUND - ON if component was found
+  ICU_<C>_LIBRARIES - libraries for component
+
+ICU datafiles are reported in::
+
+  ICU_MAKEFILE_INC - Makefile.inc
+  ICU_PKGDATA_INC - pkgdata.inc
+
+Note that ``<C>`` is the uppercased name of the component.
+
+This module reads hints about search results from::
+
+  ICU_ROOT - the root of the ICU installation
+
+The environment variable ``ICU_ROOT`` may also be used; the
+ICU_ROOT variable takes precedence.
+
+The following cache variables may also be set::
+
+  ICU_<P>_EXECUTABLE - the path to executable <P>
+  ICU_INCLUDE_DIR - the directory containing the ICU headers
+  ICU_<C>_LIBRARY - the library for component <C>
+
+.. note::
+
+  In most cases none of the above variables will require setting,
+  unless multiple ICU versions are available and a specific version
+  is required.
+
+Other variables one may set to control this module are::
+
+  ICU_DEBUG - Set to ON to enable debug output from FindICU.
+#]=======================================================================]
 
 # Written by Roger Leigh <[email protected]>
 

+ 141 - 140
Modules/FindIce.cmake

@@ -1,146 +1,147 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindIce
-# -------
-#
-# Find the ZeroC Internet Communication Engine (ICE) programs,
-# libraries and datafiles.
-#
-# This module supports multiple components.
-# Components can include any of: ``Freeze``, ``Glacier2``, ``Ice``,
-# ``IceBox``, ``IceDB``, ``IceDiscovery``, ``IceGrid``,
-# ``IceLocatorDiscovery``, ``IcePatch``, ``IceSSL``, ``IceStorm``,
-# ``IceUtil``, ``IceXML``, or ``Slice``.
-#
-# Ice 3.7 and later also include C++11-specific components:
-# ``Glacier2++11``, ``Ice++11``, ``IceBox++11``, ``IceDiscovery++11``
-# ``IceGrid``, ``IceLocatorDiscovery++11``, ``IceSSL++11``,
-# ``IceStorm++11``
-#
-# Note that the set of supported components is Ice version-specific.
-#
-# This module reports information about the Ice installation in
-# several variables.  General variables::
-#
-#   Ice_VERSION - Ice release version
-#   Ice_FOUND - true if the main programs and libraries were found
-#   Ice_LIBRARIES - component libraries to be linked
-#   Ice_INCLUDE_DIRS - the directories containing the Ice headers
-#   Ice_SLICE_DIRS - the directories containing the Ice slice interface
-#                    definitions
-#
-# Imported targets::
-#
-#   Ice::<C>
-#
-# Where ``<C>`` is the name of an Ice component, for example
-# ``Ice::Glacier2`` or ``Ice++11``.
-#
-# Ice slice programs are reported in::
-#
-#   Ice_SLICE2CPP_EXECUTABLE - path to slice2cpp executable
-#   Ice_SLICE2CS_EXECUTABLE - path to slice2cs executable
-#   Ice_SLICE2FREEZEJ_EXECUTABLE - path to slice2freezej executable
-#   Ice_SLICE2FREEZE_EXECUTABLE - path to slice2freeze executable
-#   Ice_SLICE2HTML_EXECUTABLE - path to slice2html executable
-#   Ice_SLICE2JAVA_EXECUTABLE - path to slice2java executable
-#   Ice_SLICE2JS_EXECUTABLE - path to slice2js executable
-#   Ice_SLICE2OBJC_EXECUTABLE - path to slice2objc executable
-#   Ice_SLICE2PHP_EXECUTABLE - path to slice2php executable
-#   Ice_SLICE2PY_EXECUTABLE - path to slice2py executable
-#   Ice_SLICE2RB_EXECUTABLE - path to slice2rb executable
-#
-# Ice programs are reported in::
-#
-#   Ice_GLACIER2ROUTER_EXECUTABLE - path to glacier2router executable
-#   Ice_ICEBOX_EXECUTABLE - path to icebox executable
-#   Ice_ICEBOXXX11_EXECUTABLE - path to icebox++11 executable
-#   Ice_ICEBOXADMIN_EXECUTABLE - path to iceboxadmin executable
-#   Ice_ICEBOXD_EXECUTABLE - path to iceboxd executable
-#   Ice_ICEBOXNET_EXECUTABLE - path to iceboxnet executable
-#   Ice_ICEBRIDGE_EXECUTABLE - path to icebridge executable
-#   Ice_ICEGRIDADMIN_EXECUTABLE - path to icegridadmin executable
-#   Ice_ICEGRIDDB_EXECUTABLE - path to icegriddb executable
-#   Ice_ICEGRIDNODE_EXECUTABLE - path to icegridnode executable
-#   Ice_ICEGRIDNODED_EXECUTABLE - path to icegridnoded executable
-#   Ice_ICEGRIDREGISTRY_EXECUTABLE - path to icegridregistry executable
-#   Ice_ICEGRIDREGISTRYD_EXECUTABLE - path to icegridregistryd executable
-#   Ice_ICEPATCH2CALC_EXECUTABLE - path to icepatch2calc executable
-#   Ice_ICEPATCH2CLIENT_EXECUTABLE - path to icepatch2client executable
-#   Ice_ICEPATCH2SERVER_EXECUTABLE - path to icepatch2server executable
-#   Ice_ICESERVICEINSTALL_EXECUTABLE - path to iceserviceinstall executable
-#   Ice_ICESTORMADMIN_EXECUTABLE - path to icestormadmin executable
-#   Ice_ICESTORMDB_EXECUTABLE - path to icestormdb executable
-#   Ice_ICESTORMMIGRATE_EXECUTABLE - path to icestormmigrate executable
-#
-# Ice db programs (Windows only; standard system versions on all other
-# platforms) are reported in::
-#
-#   Ice_DB_ARCHIVE_EXECUTABLE - path to db_archive executable
-#   Ice_DB_CHECKPOINT_EXECUTABLE - path to db_checkpoint executable
-#   Ice_DB_DEADLOCK_EXECUTABLE - path to db_deadlock executable
-#   Ice_DB_DUMP_EXECUTABLE - path to db_dump executable
-#   Ice_DB_HOTBACKUP_EXECUTABLE - path to db_hotbackup executable
-#   Ice_DB_LOAD_EXECUTABLE - path to db_load executable
-#   Ice_DB_LOG_VERIFY_EXECUTABLE - path to db_log_verify executable
-#   Ice_DB_PRINTLOG_EXECUTABLE - path to db_printlog executable
-#   Ice_DB_RECOVER_EXECUTABLE - path to db_recover executable
-#   Ice_DB_STAT_EXECUTABLE - path to db_stat executable
-#   Ice_DB_TUNER_EXECUTABLE - path to db_tuner executable
-#   Ice_DB_UPGRADE_EXECUTABLE - path to db_upgrade executable
-#   Ice_DB_VERIFY_EXECUTABLE - path to db_verify executable
-#   Ice_DUMPDB_EXECUTABLE - path to dumpdb executable
-#   Ice_TRANSFORMDB_EXECUTABLE - path to transformdb executable
-#
-# Ice component libraries are reported in::
-#
-#   Ice_<C>_FOUND - ON if component was found
-#   Ice_<C>_LIBRARIES - libraries for component
-#
-# Note that ``<C>`` is the uppercased name of the component.
-#
-# This module reads hints about search results from::
-#
-#   Ice_HOME - the root of the Ice installation
-#
-# The environment variable ``ICE_HOME`` may also be used; the
-# Ice_HOME variable takes precedence.
-#
-# .. note::
-#   On Windows, Ice 3.7.0 and later provide libraries via the NuGet
-#   package manager.  Appropriate NuGet packages will be searched for
-#   using ``CMAKE_PREFIX_PATH``, or alternatively ``Ice_HOME`` may be
-#   set to the location of a specific NuGet package to restrict the
-#   search.
-#
-# The following cache variables may also be set::
-#
-#   Ice_<P>_EXECUTABLE - the path to executable <P>
-#   Ice_INCLUDE_DIR - the directory containing the Ice headers
-#   Ice_SLICE_DIR - the directory containing the Ice slice interface
-#                   definitions
-#   Ice_<C>_LIBRARY - the library for component <C>
-#
-# .. note::
-#
-#   In most cases none of the above variables will require setting,
-#   unless multiple Ice versions are available and a specific version
-#   is required.  On Windows, the most recent version of Ice will be
-#   found through the registry.  On Unix, the programs, headers and
-#   libraries will usually be in standard locations, but Ice_SLICE_DIRS
-#   might not be automatically detected (commonly known locations are
-#   searched).  All the other variables are defaulted using Ice_HOME,
-#   if set.  It's possible to set Ice_HOME and selectively specify
-#   alternative locations for the other components; this might be
-#   required for e.g. newer versions of Visual Studio if the
-#   heuristics are not sufficient to identify the correct programs and
-#   libraries for the specific Visual Studio version.
-#
-# Other variables one may set to control this module are::
-#
-#   Ice_DEBUG - Set to ON to enable debug output from FindIce.
+#[=======================================================================[.rst:
+FindIce
+-------
+
+Find the ZeroC Internet Communication Engine (ICE) programs,
+libraries and datafiles.
+
+This module supports multiple components.
+Components can include any of: ``Freeze``, ``Glacier2``, ``Ice``,
+``IceBox``, ``IceDB``, ``IceDiscovery``, ``IceGrid``,
+``IceLocatorDiscovery``, ``IcePatch``, ``IceSSL``, ``IceStorm``,
+``IceUtil``, ``IceXML``, or ``Slice``.
+
+Ice 3.7 and later also include C++11-specific components:
+``Glacier2++11``, ``Ice++11``, ``IceBox++11``, ``IceDiscovery++11``
+``IceGrid``, ``IceLocatorDiscovery++11``, ``IceSSL++11``,
+``IceStorm++11``
+
+Note that the set of supported components is Ice version-specific.
+
+This module reports information about the Ice installation in
+several variables.  General variables::
+
+  Ice_VERSION - Ice release version
+  Ice_FOUND - true if the main programs and libraries were found
+  Ice_LIBRARIES - component libraries to be linked
+  Ice_INCLUDE_DIRS - the directories containing the Ice headers
+  Ice_SLICE_DIRS - the directories containing the Ice slice interface
+                   definitions
+
+Imported targets::
+
+  Ice::<C>
+
+Where ``<C>`` is the name of an Ice component, for example
+``Ice::Glacier2`` or ``Ice++11``.
+
+Ice slice programs are reported in::
+
+  Ice_SLICE2CPP_EXECUTABLE - path to slice2cpp executable
+  Ice_SLICE2CS_EXECUTABLE - path to slice2cs executable
+  Ice_SLICE2FREEZEJ_EXECUTABLE - path to slice2freezej executable
+  Ice_SLICE2FREEZE_EXECUTABLE - path to slice2freeze executable
+  Ice_SLICE2HTML_EXECUTABLE - path to slice2html executable
+  Ice_SLICE2JAVA_EXECUTABLE - path to slice2java executable
+  Ice_SLICE2JS_EXECUTABLE - path to slice2js executable
+  Ice_SLICE2OBJC_EXECUTABLE - path to slice2objc executable
+  Ice_SLICE2PHP_EXECUTABLE - path to slice2php executable
+  Ice_SLICE2PY_EXECUTABLE - path to slice2py executable
+  Ice_SLICE2RB_EXECUTABLE - path to slice2rb executable
+
+Ice programs are reported in::
+
+  Ice_GLACIER2ROUTER_EXECUTABLE - path to glacier2router executable
+  Ice_ICEBOX_EXECUTABLE - path to icebox executable
+  Ice_ICEBOXXX11_EXECUTABLE - path to icebox++11 executable
+  Ice_ICEBOXADMIN_EXECUTABLE - path to iceboxadmin executable
+  Ice_ICEBOXD_EXECUTABLE - path to iceboxd executable
+  Ice_ICEBOXNET_EXECUTABLE - path to iceboxnet executable
+  Ice_ICEBRIDGE_EXECUTABLE - path to icebridge executable
+  Ice_ICEGRIDADMIN_EXECUTABLE - path to icegridadmin executable
+  Ice_ICEGRIDDB_EXECUTABLE - path to icegriddb executable
+  Ice_ICEGRIDNODE_EXECUTABLE - path to icegridnode executable
+  Ice_ICEGRIDNODED_EXECUTABLE - path to icegridnoded executable
+  Ice_ICEGRIDREGISTRY_EXECUTABLE - path to icegridregistry executable
+  Ice_ICEGRIDREGISTRYD_EXECUTABLE - path to icegridregistryd executable
+  Ice_ICEPATCH2CALC_EXECUTABLE - path to icepatch2calc executable
+  Ice_ICEPATCH2CLIENT_EXECUTABLE - path to icepatch2client executable
+  Ice_ICEPATCH2SERVER_EXECUTABLE - path to icepatch2server executable
+  Ice_ICESERVICEINSTALL_EXECUTABLE - path to iceserviceinstall executable
+  Ice_ICESTORMADMIN_EXECUTABLE - path to icestormadmin executable
+  Ice_ICESTORMDB_EXECUTABLE - path to icestormdb executable
+  Ice_ICESTORMMIGRATE_EXECUTABLE - path to icestormmigrate executable
+
+Ice db programs (Windows only; standard system versions on all other
+platforms) are reported in::
+
+  Ice_DB_ARCHIVE_EXECUTABLE - path to db_archive executable
+  Ice_DB_CHECKPOINT_EXECUTABLE - path to db_checkpoint executable
+  Ice_DB_DEADLOCK_EXECUTABLE - path to db_deadlock executable
+  Ice_DB_DUMP_EXECUTABLE - path to db_dump executable
+  Ice_DB_HOTBACKUP_EXECUTABLE - path to db_hotbackup executable
+  Ice_DB_LOAD_EXECUTABLE - path to db_load executable
+  Ice_DB_LOG_VERIFY_EXECUTABLE - path to db_log_verify executable
+  Ice_DB_PRINTLOG_EXECUTABLE - path to db_printlog executable
+  Ice_DB_RECOVER_EXECUTABLE - path to db_recover executable
+  Ice_DB_STAT_EXECUTABLE - path to db_stat executable
+  Ice_DB_TUNER_EXECUTABLE - path to db_tuner executable
+  Ice_DB_UPGRADE_EXECUTABLE - path to db_upgrade executable
+  Ice_DB_VERIFY_EXECUTABLE - path to db_verify executable
+  Ice_DUMPDB_EXECUTABLE - path to dumpdb executable
+  Ice_TRANSFORMDB_EXECUTABLE - path to transformdb executable
+
+Ice component libraries are reported in::
+
+  Ice_<C>_FOUND - ON if component was found
+  Ice_<C>_LIBRARIES - libraries for component
+
+Note that ``<C>`` is the uppercased name of the component.
+
+This module reads hints about search results from::
+
+  Ice_HOME - the root of the Ice installation
+
+The environment variable ``ICE_HOME`` may also be used; the
+Ice_HOME variable takes precedence.
+
+.. note::
+  On Windows, Ice 3.7.0 and later provide libraries via the NuGet
+  package manager.  Appropriate NuGet packages will be searched for
+  using ``CMAKE_PREFIX_PATH``, or alternatively ``Ice_HOME`` may be
+  set to the location of a specific NuGet package to restrict the
+  search.
+
+The following cache variables may also be set::
+
+  Ice_<P>_EXECUTABLE - the path to executable <P>
+  Ice_INCLUDE_DIR - the directory containing the Ice headers
+  Ice_SLICE_DIR - the directory containing the Ice slice interface
+                  definitions
+  Ice_<C>_LIBRARY - the library for component <C>
+
+.. note::
+
+  In most cases none of the above variables will require setting,
+  unless multiple Ice versions are available and a specific version
+  is required.  On Windows, the most recent version of Ice will be
+  found through the registry.  On Unix, the programs, headers and
+  libraries will usually be in standard locations, but Ice_SLICE_DIRS
+  might not be automatically detected (commonly known locations are
+  searched).  All the other variables are defaulted using Ice_HOME,
+  if set.  It's possible to set Ice_HOME and selectively specify
+  alternative locations for the other components; this might be
+  required for e.g. newer versions of Visual Studio if the
+  heuristics are not sufficient to identify the correct programs and
+  libraries for the specific Visual Studio version.
+
+Other variables one may set to control this module are::
+
+  Ice_DEBUG - Set to ON to enable debug output from FindIce.
+#]=======================================================================]
 
 # Written by Roger Leigh <[email protected]>
 

+ 15 - 14
Modules/FindIcotool.cmake

@@ -1,20 +1,21 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindIcotool
-# -----------
-#
-# Find icotool
-#
-# This module looks for icotool.  This module defines the following
-# values:
-#
-# ::
-#
-#   ICOTOOL_EXECUTABLE: the full path to the icotool tool.
-#   ICOTOOL_FOUND: True if icotool has been found.
-#   ICOTOOL_VERSION_STRING: the version of icotool found.
+#[=======================================================================[.rst:
+FindIcotool
+-----------
+
+Find icotool
+
+This module looks for icotool.  This module defines the following
+values:
+
+::
+
+  ICOTOOL_EXECUTABLE: the full path to the icotool tool.
+  ICOTOOL_FOUND: True if icotool has been found.
+  ICOTOOL_VERSION_STRING: the version of icotool found.
+#]=======================================================================]
 
 find_program(ICOTOOL_EXECUTABLE
   icotool

+ 82 - 81
Modules/FindImageMagick.cmake

@@ -1,87 +1,88 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindImageMagick
-# ---------------
-#
-# Find the ImageMagick binary suite.
-#
-# This module will search for a set of ImageMagick tools specified as
-# components in the FIND_PACKAGE call.  Typical components include, but
-# are not limited to (future versions of ImageMagick might have
-# additional components not listed here):
-#
-# ::
-#
-#   animate
-#   compare
-#   composite
-#   conjure
-#   convert
-#   display
-#   identify
-#   import
-#   mogrify
-#   montage
-#   stream
-#
-#
-#
-# If no component is specified in the FIND_PACKAGE call, then it only
-# searches for the ImageMagick executable directory.  This code defines
-# the following variables:
-#
-# ::
-#
-#   ImageMagick_FOUND                  - TRUE if all components are found.
-#   ImageMagick_EXECUTABLE_DIR         - Full path to executables directory.
-#   ImageMagick_<component>_FOUND      - TRUE if <component> is found.
-#   ImageMagick_<component>_EXECUTABLE - Full path to <component> executable.
-#   ImageMagick_VERSION_STRING         - the version of ImageMagick found
-#                                        (since CMake 2.8.8)
-#
-#
-#
-# ImageMagick_VERSION_STRING will not work for old versions like 5.2.3.
-#
-# There are also components for the following ImageMagick APIs:
-#
-# ::
-#
-#   Magick++
-#   MagickWand
-#   MagickCore
-#
-#
-#
-# For these components the following variables are set:
-#
-# ::
-#
-#   ImageMagick_FOUND                    - TRUE if all components are found.
-#   ImageMagick_INCLUDE_DIRS             - Full paths to all include dirs.
-#   ImageMagick_LIBRARIES                - Full paths to all libraries.
-#   ImageMagick_<component>_FOUND        - TRUE if <component> is found.
-#   ImageMagick_<component>_INCLUDE_DIRS - Full path to <component> include dirs.
-#   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)
-#
-#
-#
-# Note that the standard FIND_PACKAGE features are supported (i.e.,
-# QUIET, REQUIRED, etc.).
+#[=======================================================================[.rst:
+FindImageMagick
+---------------
+
+Find the ImageMagick binary suite.
+
+This module will search for a set of ImageMagick tools specified as
+components in the FIND_PACKAGE call.  Typical components include, but
+are not limited to (future versions of ImageMagick might have
+additional components not listed here):
+
+::
+
+  animate
+  compare
+  composite
+  conjure
+  convert
+  display
+  identify
+  import
+  mogrify
+  montage
+  stream
+
+
+
+If no component is specified in the FIND_PACKAGE call, then it only
+searches for the ImageMagick executable directory.  This code defines
+the following variables:
+
+::
+
+  ImageMagick_FOUND                  - TRUE if all components are found.
+  ImageMagick_EXECUTABLE_DIR         - Full path to executables directory.
+  ImageMagick_<component>_FOUND      - TRUE if <component> is found.
+  ImageMagick_<component>_EXECUTABLE - Full path to <component> executable.
+  ImageMagick_VERSION_STRING         - the version of ImageMagick found
+                                       (since CMake 2.8.8)
+
+
+
+ImageMagick_VERSION_STRING will not work for old versions like 5.2.3.
+
+There are also components for the following ImageMagick APIs:
+
+::
+
+  Magick++
+  MagickWand
+  MagickCore
+
+
+
+For these components the following variables are set:
+
+::
+
+  ImageMagick_FOUND                    - TRUE if all components are found.
+  ImageMagick_INCLUDE_DIRS             - Full paths to all include dirs.
+  ImageMagick_LIBRARIES                - Full paths to all libraries.
+  ImageMagick_<component>_FOUND        - TRUE if <component> is found.
+  ImageMagick_<component>_INCLUDE_DIRS - Full path to <component> include dirs.
+  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)
+
+
+
+Note that the standard FIND_PACKAGE features are supported (i.e.,
+QUIET, REQUIRED, etc.).
+#]=======================================================================]
 
 find_package(PkgConfig QUIET)
 

+ 28 - 27
Modules/FindIntl.cmake

@@ -1,33 +1,34 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindIntl
-# --------
-#
-# Find the Gettext libintl headers and libraries.
-#
-# This module reports information about the Gettext libintl
-# installation in several variables.  General variables::
-#
-#   Intl_FOUND - true if the libintl headers and libraries were found
-#   Intl_INCLUDE_DIRS - the directory containing the libintl headers
-#   Intl_LIBRARIES - libintl libraries to be linked
-#
-# The following cache variables may also be set::
-#
-#   Intl_INCLUDE_DIR - the directory containing the libintl headers
-#   Intl_LIBRARY - the libintl library (if any)
-#
-# .. note::
-#   On some platforms, such as Linux with GNU libc, the gettext
-#   functions are present in the C standard library and libintl
-#   is not required.  ``Intl_LIBRARIES`` will be empty in this
-#   case.
-#
-# .. note::
-#   If you wish to use the Gettext tools (``msgmerge``,
-#   ``msgfmt``, etc.), use :module:`FindGettext`.
+#[=======================================================================[.rst:
+FindIntl
+--------
+
+Find the Gettext libintl headers and libraries.
+
+This module reports information about the Gettext libintl
+installation in several variables.  General variables::
+
+  Intl_FOUND - true if the libintl headers and libraries were found
+  Intl_INCLUDE_DIRS - the directory containing the libintl headers
+  Intl_LIBRARIES - libintl libraries to be linked
+
+The following cache variables may also be set::
+
+  Intl_INCLUDE_DIR - the directory containing the libintl headers
+  Intl_LIBRARY - the libintl library (if any)
+
+.. note::
+  On some platforms, such as Linux with GNU libc, the gettext
+  functions are present in the C standard library and libintl
+  is not required.  ``Intl_LIBRARIES`` will be empty in this
+  case.
+
+.. note::
+  If you wish to use the Gettext tools (``msgmerge``,
+  ``msgfmt``, etc.), use :module:`FindGettext`.
+#]=======================================================================]
 
 
 # Written by Roger Leigh <[email protected]>

+ 48 - 47
Modules/FindJPEG.cmake

@@ -1,53 +1,54 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindJPEG
-# --------
-#
-# Find the JPEG library (libjpeg)
-#
-# Imported targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the following :prop_tgt:`IMPORTED` targets:
-#
-# ``JPEG::JPEG``
-#   The JPEG library, if found.
-#
-# Result variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module will set the following variables in your project:
-#
-# ``JPEG_FOUND``
-#   If false, do not try to use JPEG.
-# ``JPEG_INCLUDE_DIRS``
-#   where to find jpeglib.h, etc.
-# ``JPEG_LIBRARIES``
-#   the libraries needed to use JPEG.
-# ``JPEG_VERSION``
-#   the version of the JPEG library found
-#
-# Cache variables
-# ^^^^^^^^^^^^^^^
-#
-# The following cache variables may also be set:
-#
-# ``JPEG_INCLUDE_DIRS``
-#   where to find jpeglib.h, etc.
-# ``JPEG_LIBRARY_RELEASE``
-#   where to find the JPEG library (optimized).
-# ``JPEG_LIBRARY_DEBUG``
-#   where to find the JPEG library (debug).
-#
-# Obsolete variables
-# ^^^^^^^^^^^^^^^^^^
-#
-# ``JPEG_INCLUDE_DIR``
-#   where to find jpeglib.h, etc. (same as JPEG_INCLUDE_DIRS)
-# ``JPEG_LIBRARY``
-#   where to find the JPEG library.
+#[=======================================================================[.rst:
+FindJPEG
+--------
+
+Find the JPEG library (libjpeg)
+
+Imported targets
+^^^^^^^^^^^^^^^^
+
+This module defines the following :prop_tgt:`IMPORTED` targets:
+
+``JPEG::JPEG``
+  The JPEG library, if found.
+
+Result variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
+
+``JPEG_FOUND``
+  If false, do not try to use JPEG.
+``JPEG_INCLUDE_DIRS``
+  where to find jpeglib.h, etc.
+``JPEG_LIBRARIES``
+  the libraries needed to use JPEG.
+``JPEG_VERSION``
+  the version of the JPEG library found
+
+Cache variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``JPEG_INCLUDE_DIRS``
+  where to find jpeglib.h, etc.
+``JPEG_LIBRARY_RELEASE``
+  where to find the JPEG library (optimized).
+``JPEG_LIBRARY_DEBUG``
+  where to find the JPEG library (debug).
+
+Obsolete variables
+^^^^^^^^^^^^^^^^^^
+
+``JPEG_INCLUDE_DIR``
+  where to find jpeglib.h, etc. (same as JPEG_INCLUDE_DIRS)
+``JPEG_LIBRARY``
+  where to find the JPEG library.
+#]=======================================================================]
 
 find_path(JPEG_INCLUDE_DIR jpeglib.h)
 

+ 15 - 14
Modules/FindJasper.cmake

@@ -1,20 +1,21 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindJasper
-# ----------
-#
-# Try to find the Jasper JPEG2000 library
-#
-# Once done this will define
-#
-# ::
-#
-#   JASPER_FOUND - system has Jasper
-#   JASPER_INCLUDE_DIR - the Jasper include directory
-#   JASPER_LIBRARIES - the libraries needed to use Jasper
-#   JASPER_VERSION_STRING - the version of Jasper found (since CMake 2.8.8)
+#[=======================================================================[.rst:
+FindJasper
+----------
+
+Try to find the Jasper JPEG2000 library
+
+Once done this will define
+
+::
+
+  JASPER_FOUND - system has Jasper
+  JASPER_INCLUDE_DIR - the Jasper include directory
+  JASPER_LIBRARIES - the libraries needed to use Jasper
+  JASPER_VERSION_STRING - the version of Jasper found (since CMake 2.8.8)
+#]=======================================================================]
 
 find_path(JASPER_INCLUDE_DIR jasper/jasper.h)
 

+ 74 - 73
Modules/FindJava.cmake

@@ -1,79 +1,80 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindJava
-# --------
-#
-# Find Java
-#
-# This module finds if Java is installed and determines where the
-# include files and libraries are.  The caller may set variable ``JAVA_HOME``
-# to specify a Java installation prefix explicitly.
-#
-# See also the :module:`FindJNI` module to find Java Native Interface (JNI).
-#
-# Specify one or more of the following components as you call this find module. See example below.
-#
-# ::
-#
-#   Runtime     = Java Runtime Environment used to execute Java byte-compiled applications
-#   Development = Development tools (java, javac, javah, jar and javadoc), includes Runtime component
-#   IdlJ        = Interface Description Language (IDL) to Java compiler
-#   JarSigner   = Signer and verifier tool for Java Archive (JAR) files
-#
-#
-# This module sets the following result variables:
-#
-# ::
-#
-#   Java_JAVA_EXECUTABLE      = the full path to the Java runtime
-#   Java_JAVAC_EXECUTABLE     = the full path to the Java compiler
-#   Java_JAVAH_EXECUTABLE     = the full path to the Java header generator
-#   Java_JAVADOC_EXECUTABLE   = the full path to the Java documentation generator
-#   Java_IDLJ_EXECUTABLE      = the full path to the Java idl compiler
-#   Java_JAR_EXECUTABLE       = the full path to the Java archiver
-#   Java_JARSIGNER_EXECUTABLE = the full path to the Java jar signer
-#   Java_VERSION_STRING       = Version of java found, eg. 1.6.0_12
-#   Java_VERSION_MAJOR        = The major version of the package found.
-#   Java_VERSION_MINOR        = The minor version of the package found.
-#   Java_VERSION_PATCH        = The patch version of the package found.
-#   Java_VERSION_TWEAK        = The tweak version of the package found (after '_')
-#   Java_VERSION              = This is set to: $major[.$minor[.$patch[.$tweak]]]
-#
-#
-#
-# The minimum required version of Java can be specified using the
-# :command:`find_package` syntax, e.g.
-#
-# .. code-block:: cmake
-#
-#   find_package(Java 1.8)
-#
-# NOTE: ``${Java_VERSION}`` and ``${Java_VERSION_STRING}`` are not guaranteed to
-# be identical.  For example some java version may return:
-# ``Java_VERSION_STRING = 1.8.0_17`` and ``Java_VERSION = 1.8.0.17``
-#
-# another example is the Java OEM, with: ``Java_VERSION_STRING = 1.8.0-oem``
-# and ``Java_VERSION = 1.8.0``
-#
-# For these components the following variables are set:
-#
-# ::
-#
-#   Java_FOUND                    - TRUE if all components are found.
-#   Java_<component>_FOUND        - TRUE if <component> is found.
-#
-#
-#
-# Example Usages:
-#
-# ::
-#
-#   find_package(Java)
-#   find_package(Java 1.8 REQUIRED)
-#   find_package(Java COMPONENTS Runtime)
-#   find_package(Java COMPONENTS Development)
+#[=======================================================================[.rst:
+FindJava
+--------
+
+Find Java
+
+This module finds if Java is installed and determines where the
+include files and libraries are.  The caller may set variable ``JAVA_HOME``
+to specify a Java installation prefix explicitly.
+
+See also the :module:`FindJNI` module to find Java Native Interface (JNI).
+
+Specify one or more of the following components as you call this find module. See example below.
+
+::
+
+  Runtime     = Java Runtime Environment used to execute Java byte-compiled applications
+  Development = Development tools (java, javac, javah, jar and javadoc), includes Runtime component
+  IdlJ        = Interface Description Language (IDL) to Java compiler
+  JarSigner   = Signer and verifier tool for Java Archive (JAR) files
+
+
+This module sets the following result variables:
+
+::
+
+  Java_JAVA_EXECUTABLE      = the full path to the Java runtime
+  Java_JAVAC_EXECUTABLE     = the full path to the Java compiler
+  Java_JAVAH_EXECUTABLE     = the full path to the Java header generator
+  Java_JAVADOC_EXECUTABLE   = the full path to the Java documentation generator
+  Java_IDLJ_EXECUTABLE      = the full path to the Java idl compiler
+  Java_JAR_EXECUTABLE       = the full path to the Java archiver
+  Java_JARSIGNER_EXECUTABLE = the full path to the Java jar signer
+  Java_VERSION_STRING       = Version of java found, eg. 1.6.0_12
+  Java_VERSION_MAJOR        = The major version of the package found.
+  Java_VERSION_MINOR        = The minor version of the package found.
+  Java_VERSION_PATCH        = The patch version of the package found.
+  Java_VERSION_TWEAK        = The tweak version of the package found (after '_')
+  Java_VERSION              = This is set to: $major[.$minor[.$patch[.$tweak]]]
+
+
+
+The minimum required version of Java can be specified using the
+:command:`find_package` syntax, e.g.
+
+.. code-block:: cmake
+
+  find_package(Java 1.8)
+
+NOTE: ``${Java_VERSION}`` and ``${Java_VERSION_STRING}`` are not guaranteed to
+be identical.  For example some java version may return:
+``Java_VERSION_STRING = 1.8.0_17`` and ``Java_VERSION = 1.8.0.17``
+
+another example is the Java OEM, with: ``Java_VERSION_STRING = 1.8.0-oem``
+and ``Java_VERSION = 1.8.0``
+
+For these components the following variables are set:
+
+::
+
+  Java_FOUND                    - TRUE if all components are found.
+  Java_<component>_FOUND        - TRUE if <component> is found.
+
+
+
+Example Usages:
+
+::
+
+  find_package(Java)
+  find_package(Java 1.8 REQUIRED)
+  find_package(Java COMPONENTS Runtime)
+  find_package(Java COMPONENTS Development)
+#]=======================================================================]
 
 include(${CMAKE_CURRENT_LIST_DIR}/CMakeFindJavaCommon.cmake)
 

+ 136 - 135
Modules/FindKDE3.cmake

@@ -1,141 +1,142 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindKDE3
-# --------
-#
-# Find the KDE3 include and library dirs, KDE preprocessors and define a some macros
-#
-#
-#
-# 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()
-# ``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
-# ``KDE3_KCFGC_EXECUTABLE``
-#   the kconfig_compiler executable
-# ``KDE3_FOUND``
-#   set to TRUE if all of the above has been found
-#
-# The following user adjustable options are provided:
-#
-# ``KDE3_BUILD_TESTS``
-#   enable this to build KDE testcases
-#
-# It also adds the following macros (from KDE3Macros.cmake) SRCS_VAR is
-# always the variable which contains the list of source files for your
-# application or library.
-#
-# KDE3_AUTOMOC(file1 ...  fileN)
-#
-# ::
-#
-#     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()
-#     to exclude some files in the list from being processed.
-#
-#
-#
-# KDE3_ADD_MOC_FILES(SRCS_VAR file1 ...  fileN )
-#
-# ::
-#
-#     If you don't use the KDE3_AUTOMOC() macro, for the files
-#     listed here moc files will be created (named "foo.moc.cpp")
-#
-#
-#
-# KDE3_ADD_DCOP_SKELS(SRCS_VAR header1.h ...  headerN.h )
-#
-# ::
-#
-#     Use this to generate DCOP skeletions from the listed headers.
-#
-#
-#
-# KDE3_ADD_DCOP_STUBS(SRCS_VAR header1.h ...  headerN.h )
-#
-# ::
-#
-#      Use this to generate DCOP stubs from the listed headers.
-#
-#
-#
-# KDE3_ADD_UI_FILES(SRCS_VAR file1.ui ...  fileN.ui )
-#
-# ::
-#
-#     Use this to add the Qt designer ui files to your application/library.
-#
-#
-#
-# KDE3_ADD_KCFG_FILES(SRCS_VAR file1.kcfgc ...  fileN.kcfgc )
-#
-# ::
-#
-#     Use this to add KDE kconfig compiler files to your application/library.
-#
-#
-#
-# KDE3_INSTALL_LIBTOOL_FILE(target)
-#
-# ::
-#
-#     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.
-#
-#
-#
-# KDE3_ADD_KPART(name [WITH_PREFIX] file1 ...  fileN )
-#
-# ::
-#
-#     Create a KDE plugin (KPart, kioslave, etc.) from the given source files.
-#     If WITH_PREFIX is given, the resulting plugin will have the prefix "lib",
-#     otherwise it won't.
-#     It creates and installs an appropriate libtool la-file.
-#
-#
-#
-# KDE3_ADD_KDEINIT_EXECUTABLE(name file1 ...  fileN )
-#
-# ::
-#
-#     Create a KDE application in the form of a module loadable via kdeinit.
-#     A library named kdeinit_<name> will be created and a small executable
-#     which links to it.
-#
-#
-#
-# The option KDE3_ENABLE_FINAL to enable all-in-one compilation is no
-# longer supported.
-#
-#
-#
-# Author: Alexander Neundorf <[email protected]>
+#[=======================================================================[.rst:
+FindKDE3
+--------
+
+Find the KDE3 include and library dirs, KDE preprocessors and define a some macros
+
+
+
+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()
+``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
+``KDE3_KCFGC_EXECUTABLE``
+  the kconfig_compiler executable
+``KDE3_FOUND``
+  set to TRUE if all of the above has been found
+
+The following user adjustable options are provided:
+
+``KDE3_BUILD_TESTS``
+  enable this to build KDE testcases
+
+It also adds the following macros (from KDE3Macros.cmake) SRCS_VAR is
+always the variable which contains the list of source files for your
+application or library.
+
+KDE3_AUTOMOC(file1 ...  fileN)
+
+::
+
+    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()
+    to exclude some files in the list from being processed.
+
+
+
+KDE3_ADD_MOC_FILES(SRCS_VAR file1 ...  fileN )
+
+::
+
+    If you don't use the KDE3_AUTOMOC() macro, for the files
+    listed here moc files will be created (named "foo.moc.cpp")
+
+
+
+KDE3_ADD_DCOP_SKELS(SRCS_VAR header1.h ...  headerN.h )
+
+::
+
+    Use this to generate DCOP skeletions from the listed headers.
+
+
+
+KDE3_ADD_DCOP_STUBS(SRCS_VAR header1.h ...  headerN.h )
+
+::
+
+     Use this to generate DCOP stubs from the listed headers.
+
+
+
+KDE3_ADD_UI_FILES(SRCS_VAR file1.ui ...  fileN.ui )
+
+::
+
+    Use this to add the Qt designer ui files to your application/library.
+
+
+
+KDE3_ADD_KCFG_FILES(SRCS_VAR file1.kcfgc ...  fileN.kcfgc )
+
+::
+
+    Use this to add KDE kconfig compiler files to your application/library.
+
+
+
+KDE3_INSTALL_LIBTOOL_FILE(target)
+
+::
+
+    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.
+
+
+
+KDE3_ADD_KPART(name [WITH_PREFIX] file1 ...  fileN )
+
+::
+
+    Create a KDE plugin (KPart, kioslave, etc.) from the given source files.
+    If WITH_PREFIX is given, the resulting plugin will have the prefix "lib",
+    otherwise it won't.
+    It creates and installs an appropriate libtool la-file.
+
+
+
+KDE3_ADD_KDEINIT_EXECUTABLE(name file1 ...  fileN )
+
+::
+
+    Create a KDE application in the form of a module loadable via kdeinit.
+    A library named kdeinit_<name> will be created and a small executable
+    which links to it.
+
+
+
+The option KDE3_ENABLE_FINAL to enable all-in-one compilation is no
+longer supported.
+
+
+
+Author: Alexander Neundorf <[email protected]>
+#]=======================================================================]
 
 if(NOT UNIX AND KDE3_FIND_REQUIRED)
    message(FATAL_ERROR "Compiling KDE3 applications and libraries under Windows is not supported")

+ 24 - 23
Modules/FindKDE4.cmake

@@ -1,29 +1,30 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindKDE4
-# --------
-#
-#
-#
-# Find KDE4 and provide all necessary variables and macros to compile
-# software for it.  It looks for KDE 4 in the following directories in
-# the given order:
-#
-# ::
-#
-#   CMAKE_INSTALL_PREFIX
-#   KDEDIRS
-#   /opt/kde4
-#
-#
-#
-# Please look in FindKDE4Internal.cmake and KDE4Macros.cmake for more
-# information.  They are installed with the KDE 4 libraries in
-# $KDEDIRS/share/apps/cmake/modules/.
-#
-# Author: Alexander Neundorf <[email protected]>
+#[=======================================================================[.rst:
+FindKDE4
+--------
+
+
+
+Find KDE4 and provide all necessary variables and macros to compile
+software for it.  It looks for KDE 4 in the following directories in
+the given order:
+
+::
+
+  CMAKE_INSTALL_PREFIX
+  KDEDIRS
+  /opt/kde4
+
+
+
+Please look in FindKDE4Internal.cmake and KDE4Macros.cmake for more
+information.  They are installed with the KDE 4 libraries in
+$KDEDIRS/share/apps/cmake/modules/.
+
+Author: Alexander Neundorf <[email protected]>
+#]=======================================================================]
 
 # If Qt3 has already been found, fail.
 if(QT_QT_LIBRARY)

+ 43 - 42
Modules/FindLAPACK.cmake

@@ -1,48 +1,49 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindLAPACK
-# ----------
-#
-# Find LAPACK library
-#
-# This module finds an installed fortran library that implements the
-# LAPACK linear-algebra interface (see http://www.netlib.org/lapack/).
-#
-# The approach follows that taken for the autoconf macro file,
-# acx_lapack.m4 (distributed at
-# http://ac-archive.sourceforge.net/ac-archive/acx_lapack.html).
-#
-# This module sets the following variables:
-#
-# ::
-#
-#   LAPACK_FOUND - set to true if a library implementing the LAPACK interface
-#     is found
-#   LAPACK_LINKER_FLAGS - uncached list of required linker flags (excluding -l
-#     and -L).
-#   LAPACK_LIBRARIES - uncached list of libraries (using full path name) to
-#     link against to use LAPACK
-#   LAPACK95_LIBRARIES - uncached list of libraries (using full path name) to
-#     link against to use LAPACK95
-#   LAPACK95_FOUND - set to true if a library implementing the LAPACK f95
-#     interface is found
-#   BLA_STATIC  if set on this determines what kind of linkage we do (static)
-#   BLA_VENDOR  if set checks only the specified vendor, if not set checks
-#      all the possibilities
-#   BLA_F95     if set on tries to find the f95 interfaces for BLAS/LAPACK
-#
-# List of vendors (BLA_VENDOR) valid in this module:
-#
-# * Intel(mkl)
-# * OpenBLAS
-# * FLAME
-# * ACML
-# * Apple
-# * NAS
-# * Generic
-#
+#[=======================================================================[.rst:
+FindLAPACK
+----------
+
+Find LAPACK library
+
+This module finds an installed fortran library that implements the
+LAPACK linear-algebra interface (see http://www.netlib.org/lapack/).
+
+The approach follows that taken for the autoconf macro file,
+acx_lapack.m4 (distributed at
+http://ac-archive.sourceforge.net/ac-archive/acx_lapack.html).
+
+This module sets the following variables:
+
+::
+
+  LAPACK_FOUND - set to true if a library implementing the LAPACK interface
+    is found
+  LAPACK_LINKER_FLAGS - uncached list of required linker flags (excluding -l
+    and -L).
+  LAPACK_LIBRARIES - uncached list of libraries (using full path name) to
+    link against to use LAPACK
+  LAPACK95_LIBRARIES - uncached list of libraries (using full path name) to
+    link against to use LAPACK95
+  LAPACK95_FOUND - set to true if a library implementing the LAPACK f95
+    interface is found
+  BLA_STATIC  if set on this determines what kind of linkage we do (static)
+  BLA_VENDOR  if set checks only the specified vendor, if not set checks
+     all the possibilities
+  BLA_F95     if set on tries to find the f95 interfaces for BLAS/LAPACK
+
+List of vendors (BLA_VENDOR) valid in this module:
+
+* Intel(mkl)
+* OpenBLAS
+* FLAME
+* ACML
+* Apple
+* NAS
+* Generic
+
+#]=======================================================================]
 
 set(_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
 

+ 51 - 50
Modules/FindLATEX.cmake

@@ -1,56 +1,57 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindLATEX
-# ---------
-#
-# Find Latex
-#
-# This module finds an installed Latex and determines the location
-# of the compiler.  Additionally the module looks for Latex-related
-# software like BibTeX.
-#
-# This module sets the following result variables::
-#
-#   LATEX_FOUND:          whether found Latex and requested components
-#   LATEX_<component>_FOUND:  whether found <component>
-#   LATEX_COMPILER:       path to the LaTeX compiler
-#   PDFLATEX_COMPILER:    path to the PdfLaTeX compiler
-#   XELATEX_COMPILER:     path to the XeLaTeX compiler
-#   LUALATEX_COMPILER:    path to the LuaLaTeX compiler
-#   BIBTEX_COMPILER:      path to the BibTeX compiler
-#   BIBER_COMPILER:       path to the Biber compiler
-#   MAKEINDEX_COMPILER:   path to the MakeIndex compiler
-#   XINDY_COMPILER:       path to the xindy compiler
-#   DVIPS_CONVERTER:      path to the DVIPS converter
-#   DVIPDF_CONVERTER:     path to the DVIPDF converter
-#   PS2PDF_CONVERTER:     path to the PS2PDF converter
-#   PDFTOPS_CONVERTER:    path to the pdftops converter
-#   LATEX2HTML_CONVERTER: path to the LaTeX2Html converter
-#   HTLATEX_COMPILER:     path to the htlatex compiler
-#
-# Possible components are::
-#
-#   PDFLATEX
-#   XELATEX
-#   LUALATEX
-#   BIBTEX
-#   BIBER
-#   MAKEINDEX
-#   XINDY
-#   DVIPS
-#   DVIPDF
-#   PS2PDF
-#   PDFTOPS
-#   LATEX2HTML
-#   HTLATEX
-#
-# Example Usages::
-#
-#   find_package(LATEX)
-#   find_package(LATEX COMPONENTS PDFLATEX)
-#   find_package(LATEX COMPONENTS BIBTEX PS2PDF)
+#[=======================================================================[.rst:
+FindLATEX
+---------
+
+Find Latex
+
+This module finds an installed Latex and determines the location
+of the compiler.  Additionally the module looks for Latex-related
+software like BibTeX.
+
+This module sets the following result variables::
+
+  LATEX_FOUND:          whether found Latex and requested components
+  LATEX_<component>_FOUND:  whether found <component>
+  LATEX_COMPILER:       path to the LaTeX compiler
+  PDFLATEX_COMPILER:    path to the PdfLaTeX compiler
+  XELATEX_COMPILER:     path to the XeLaTeX compiler
+  LUALATEX_COMPILER:    path to the LuaLaTeX compiler
+  BIBTEX_COMPILER:      path to the BibTeX compiler
+  BIBER_COMPILER:       path to the Biber compiler
+  MAKEINDEX_COMPILER:   path to the MakeIndex compiler
+  XINDY_COMPILER:       path to the xindy compiler
+  DVIPS_CONVERTER:      path to the DVIPS converter
+  DVIPDF_CONVERTER:     path to the DVIPDF converter
+  PS2PDF_CONVERTER:     path to the PS2PDF converter
+  PDFTOPS_CONVERTER:    path to the pdftops converter
+  LATEX2HTML_CONVERTER: path to the LaTeX2Html converter
+  HTLATEX_COMPILER:     path to the htlatex compiler
+
+Possible components are::
+
+  PDFLATEX
+  XELATEX
+  LUALATEX
+  BIBTEX
+  BIBER
+  MAKEINDEX
+  XINDY
+  DVIPS
+  DVIPDF
+  PS2PDF
+  PDFTOPS
+  LATEX2HTML
+  HTLATEX
+
+Example Usages::
+
+  find_package(LATEX)
+  find_package(LATEX COMPONENTS PDFLATEX)
+  find_package(LATEX COMPONENTS BIBTEX PS2PDF)
+#]=======================================================================]
 
 if (WIN32)
   # Try to find the MikTex binary path (look for its package manager).

+ 32 - 31
Modules/FindLTTngUST.cmake

@@ -1,37 +1,38 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindLTTngUST
-# ------------
-#
-# This module finds the `LTTng-UST <http://lttng.org/>`__ library.
-#
-# Imported target
-# ^^^^^^^^^^^^^^^
-#
-# This module defines the following :prop_tgt:`IMPORTED` target:
-#
-# ``LTTng::UST``
-#   The LTTng-UST library, if found
-#
-# Result variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module sets the following
-#
-# ``LTTNGUST_FOUND``
-#   ``TRUE`` if system has LTTng-UST
-# ``LTTNGUST_INCLUDE_DIRS``
-#   The LTTng-UST include directories
-# ``LTTNGUST_LIBRARIES``
-#   The libraries needed to use LTTng-UST
-# ``LTTNGUST_VERSION_STRING``
-#   The LTTng-UST version
-# ``LTTNGUST_HAS_TRACEF``
-#   ``TRUE`` if the ``tracef()`` API is available in the system's LTTng-UST
-# ``LTTNGUST_HAS_TRACELOG``
-#   ``TRUE`` if the ``tracelog()`` API is available in the system's LTTng-UST
+#[=======================================================================[.rst:
+FindLTTngUST
+------------
+
+This module finds the `LTTng-UST <http://lttng.org/>`__ library.
+
+Imported target
+^^^^^^^^^^^^^^^
+
+This module defines the following :prop_tgt:`IMPORTED` target:
+
+``LTTng::UST``
+  The LTTng-UST library, if found
+
+Result variables
+^^^^^^^^^^^^^^^^
+
+This module sets the following
+
+``LTTNGUST_FOUND``
+  ``TRUE`` if system has LTTng-UST
+``LTTNGUST_INCLUDE_DIRS``
+  The LTTng-UST include directories
+``LTTNGUST_LIBRARIES``
+  The libraries needed to use LTTng-UST
+``LTTNGUST_VERSION_STRING``
+  The LTTng-UST version
+``LTTNGUST_HAS_TRACEF``
+  ``TRUE`` if the ``tracef()`` API is available in the system's LTTng-UST
+``LTTNGUST_HAS_TRACELOG``
+  ``TRUE`` if the ``tracelog()`` API is available in the system's LTTng-UST
+#]=======================================================================]
 
 find_path(LTTNGUST_INCLUDE_DIRS NAMES lttng/tracepoint.h)
 find_library(LTTNGUST_LIBRARIES NAMES lttng-ust)

+ 15 - 14
Modules/FindLibArchive.cmake

@@ -1,20 +1,21 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindLibArchive
-# --------------
-#
-# Find libarchive library and headers
-#
-# The module defines the following variables:
-#
-# ::
-#
-#   LibArchive_FOUND        - true if libarchive was found
-#   LibArchive_INCLUDE_DIRS - include search path
-#   LibArchive_LIBRARIES    - libraries to link
-#   LibArchive_VERSION      - libarchive 3-component version number
+#[=======================================================================[.rst:
+FindLibArchive
+--------------
+
+Find libarchive library and headers
+
+The module defines the following variables:
+
+::
+
+  LibArchive_FOUND        - true if libarchive was found
+  LibArchive_INCLUDE_DIRS - include search path
+  LibArchive_LIBRARIES    - libraries to link
+  LibArchive_VERSION      - libarchive 3-component version number
+#]=======================================================================]
 
 find_path(LibArchive_INCLUDE_DIR
   NAMES archive.h

+ 21 - 20
Modules/FindLibLZMA.cmake

@@ -1,26 +1,27 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindLibLZMA
-# -----------
-#
-# Find LibLZMA
-#
-# Find LibLZMA headers and library
-#
-# ::
-#
-#   LIBLZMA_FOUND             - True if liblzma is found.
-#   LIBLZMA_INCLUDE_DIRS      - Directory where liblzma headers are located.
-#   LIBLZMA_LIBRARIES         - Lzma libraries to link against.
-#   LIBLZMA_HAS_AUTO_DECODER  - True if lzma_auto_decoder() is found (required).
-#   LIBLZMA_HAS_EASY_ENCODER  - True if lzma_easy_encoder() is found (required).
-#   LIBLZMA_HAS_LZMA_PRESET   - True if lzma_lzma_preset() is found (required).
-#   LIBLZMA_VERSION_MAJOR     - The major version of lzma
-#   LIBLZMA_VERSION_MINOR     - The minor version of lzma
-#   LIBLZMA_VERSION_PATCH     - The patch version of lzma
-#   LIBLZMA_VERSION_STRING    - version number as a string (ex: "5.0.3")
+#[=======================================================================[.rst:
+FindLibLZMA
+-----------
+
+Find LibLZMA
+
+Find LibLZMA headers and library
+
+::
+
+  LIBLZMA_FOUND             - True if liblzma is found.
+  LIBLZMA_INCLUDE_DIRS      - Directory where liblzma headers are located.
+  LIBLZMA_LIBRARIES         - Lzma libraries to link against.
+  LIBLZMA_HAS_AUTO_DECODER  - True if lzma_auto_decoder() is found (required).
+  LIBLZMA_HAS_EASY_ENCODER  - True if lzma_easy_encoder() is found (required).
+  LIBLZMA_HAS_LZMA_PRESET   - True if lzma_lzma_preset() is found (required).
+  LIBLZMA_VERSION_MAJOR     - The major version of lzma
+  LIBLZMA_VERSION_MINOR     - The minor version of lzma
+  LIBLZMA_VERSION_PATCH     - The patch version of lzma
+  LIBLZMA_VERSION_STRING    - version number as a string (ex: "5.0.3")
+#]=======================================================================]
 
 find_path(LIBLZMA_INCLUDE_DIR lzma.h )
 find_library(LIBLZMA_LIBRARY NAMES lzma liblzma)

+ 42 - 41
Modules/FindLibXml2.cmake

@@ -1,47 +1,48 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindLibXml2
-# -----------
-#
-# Find the XML processing library (libxml2).
-#
-# IMPORTED Targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines :prop_tgt:`IMPORTED` target ``LibXml2::LibXml2``, if
-# libxml2 has been found.
-#
-# Result variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module will set the following variables in your project:
-#
-# ``LIBXML2_FOUND``
-#   true if libxml2 headers and libraries were found
-# ``LIBXML2_INCLUDE_DIR``
-#   the directory containing LibXml2 headers
-# ``LIBXML2_INCLUDE_DIRS``
-#   list of the include directories needed to use LibXml2
-# ``LIBXML2_LIBRARIES``
-#   LibXml2 libraries to be linked
-# ``LIBXML2_DEFINITIONS``
-#   the compiler switches required for using LibXml2
-# ``LIBXML2_XMLLINT_EXECUTABLE``
-#   path to the XML checking tool xmllint coming with LibXml2
-# ``LIBXML2_VERSION_STRING``
-#   the version of LibXml2 found (since CMake 2.8.8)
-#
-# Cache variables
-# ^^^^^^^^^^^^^^^
-#
-# The following cache variables may also be set:
-#
-# ``LIBXML2_INCLUDE_DIR``
-#   the directory containing LibXml2 headers
-# ``LIBXML2_LIBRARY``
-#   path to the LibXml2 library
+#[=======================================================================[.rst:
+FindLibXml2
+-----------
+
+Find the XML processing library (libxml2).
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines :prop_tgt:`IMPORTED` target ``LibXml2::LibXml2``, if
+libxml2 has been found.
+
+Result variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
+
+``LIBXML2_FOUND``
+  true if libxml2 headers and libraries were found
+``LIBXML2_INCLUDE_DIR``
+  the directory containing LibXml2 headers
+``LIBXML2_INCLUDE_DIRS``
+  list of the include directories needed to use LibXml2
+``LIBXML2_LIBRARIES``
+  LibXml2 libraries to be linked
+``LIBXML2_DEFINITIONS``
+  the compiler switches required for using LibXml2
+``LIBXML2_XMLLINT_EXECUTABLE``
+  path to the XML checking tool xmllint coming with LibXml2
+``LIBXML2_VERSION_STRING``
+  the version of LibXml2 found (since CMake 2.8.8)
+
+Cache variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``LIBXML2_INCLUDE_DIR``
+  the directory containing LibXml2 headers
+``LIBXML2_LIBRARY``
+  path to the LibXml2 library
+#]=======================================================================]
 
 # use pkg-config to get the directories and then use these values
 # in the find_path() and find_library() calls

+ 24 - 23
Modules/FindLibXslt.cmake

@@ -1,29 +1,30 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindLibXslt
-# -----------
-#
-# Try to find the LibXslt library
-#
-# Once done this will define
-#
-# ::
-#
-#   LIBXSLT_FOUND - system has LibXslt
-#   LIBXSLT_INCLUDE_DIR - the LibXslt include directory
-#   LIBXSLT_LIBRARIES - Link these to LibXslt
-#   LIBXSLT_DEFINITIONS - Compiler switches required for using LibXslt
-#   LIBXSLT_VERSION_STRING - version of LibXslt found (since CMake 2.8.8)
-#
-# Additionally, the following two variables are set (but not required
-# for using xslt):
-#
-# ``LIBXSLT_EXSLT_LIBRARIES``
-#   Link to these if you need to link against the exslt library.
-# ``LIBXSLT_XSLTPROC_EXECUTABLE``
-#   Contains the full path to the xsltproc executable if found.
+#[=======================================================================[.rst:
+FindLibXslt
+-----------
+
+Try to find the LibXslt library
+
+Once done this will define
+
+::
+
+  LIBXSLT_FOUND - system has LibXslt
+  LIBXSLT_INCLUDE_DIR - the LibXslt include directory
+  LIBXSLT_LIBRARIES - Link these to LibXslt
+  LIBXSLT_DEFINITIONS - Compiler switches required for using LibXslt
+  LIBXSLT_VERSION_STRING - version of LibXslt found (since CMake 2.8.8)
+
+Additionally, the following two variables are set (but not required
+for using xslt):
+
+``LIBXSLT_EXSLT_LIBRARIES``
+  Link to these if you need to link against the exslt library.
+``LIBXSLT_XSLTPROC_EXECUTABLE``
+  Contains the full path to the xsltproc executable if found.
+#]=======================================================================]
 
 # use pkg-config to get the directories and then use these values
 # in the find_path() and find_library() calls

+ 35 - 34
Modules/FindLua.cmake

@@ -1,40 +1,41 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindLua
-# -------
-#
-#
-#
-# Locate Lua library This module defines
-#
-# ::
-#
-#   LUA_FOUND          - if false, do not try to link to Lua
-#   LUA_LIBRARIES      - both lua and lualib
-#   LUA_INCLUDE_DIR    - where to find lua.h
-#   LUA_VERSION_STRING - the version of Lua found
-#   LUA_VERSION_MAJOR  - the major version of Lua
-#   LUA_VERSION_MINOR  - the minor version of Lua
-#   LUA_VERSION_PATCH  - the patch version of Lua
-#
-#
-#
-# Note that the expected include convention is
-#
-# ::
-#
-#   #include "lua.h"
-#
-# and not
-#
-# ::
-#
-#   #include <lua/lua.h>
-#
-# This is because, the lua location is not standardized and may exist in
-# locations other than lua/
+#[=======================================================================[.rst:
+FindLua
+-------
+
+
+
+Locate Lua library This module defines
+
+::
+
+  LUA_FOUND          - if false, do not try to link to Lua
+  LUA_LIBRARIES      - both lua and lualib
+  LUA_INCLUDE_DIR    - where to find lua.h
+  LUA_VERSION_STRING - the version of Lua found
+  LUA_VERSION_MAJOR  - the major version of Lua
+  LUA_VERSION_MINOR  - the minor version of Lua
+  LUA_VERSION_PATCH  - the patch version of Lua
+
+
+
+Note that the expected include convention is
+
+::
+
+  #include "lua.h"
+
+and not
+
+::
+
+  #include <lua/lua.h>
+
+This is because, the lua location is not standardized and may exist in
+locations other than lua/
+#]=======================================================================]
 
 cmake_policy(PUSH)  # Policies apply to functions at definition-time
 cmake_policy(SET CMP0012 NEW)  # For while(TRUE)

+ 31 - 30
Modules/FindLua50.cmake

@@ -1,36 +1,37 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindLua50
-# ---------
-#
-#
-#
-# Locate Lua library This module defines
-#
-# ::
-#
-#   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)
-#
-#
-#
-# Note that the expected include convention is
-#
-# ::
-#
-#   #include "lua.h"
-#
-# and not
-#
-# ::
-#
-#   #include <lua/lua.h>
-#
-# This is because, the lua location is not standardized and may exist in
-# locations other than lua/
+#[=======================================================================[.rst:
+FindLua50
+---------
+
+
+
+Locate Lua library This module defines
+
+::
+
+  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)
+
+
+
+Note that the expected include convention is
+
+::
+
+  #include "lua.h"
+
+and not
+
+::
+
+  #include <lua/lua.h>
+
+This is because, the lua location is not standardized and may exist in
+locations other than lua/
+#]=======================================================================]
 
 find_path(LUA_INCLUDE_DIR lua.h
   HINTS

+ 32 - 31
Modules/FindLua51.cmake

@@ -1,37 +1,38 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindLua51
-# ---------
-#
-#
-#
-# Locate Lua library This module defines
-#
-# ::
-#
-#   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)
-#
-#
-#
-# Note that the expected include convention is
-#
-# ::
-#
-#   #include "lua.h"
-#
-# and not
-#
-# ::
-#
-#   #include <lua/lua.h>
-#
-# This is because, the lua location is not standardized and may exist in
-# locations other than lua/
+#[=======================================================================[.rst:
+FindLua51
+---------
+
+
+
+Locate Lua library This module defines
+
+::
+
+  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)
+
+
+
+Note that the expected include convention is
+
+::
+
+  #include "lua.h"
+
+and not
+
+::
+
+  #include <lua/lua.h>
+
+This is because, the lua location is not standardized and may exist in
+locations other than lua/
+#]=======================================================================]
 
 find_path(LUA_INCLUDE_DIR lua.h
   HINTS

+ 15 - 14
Modules/FindMFC.cmake

@@ -1,20 +1,21 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-#.rst:
-# FindMFC
-# -------
-#
-# Find MFC on Windows
-#
-# Find the native MFC - i.e.  decide if an application can link to the
-# MFC libraries.
-#
-# ::
-#
-#   MFC_FOUND - Was MFC support found
-#
-# You don't need to include anything or link anything to use it.
+#[=======================================================================[.rst:
+FindMFC
+-------
+
+Find MFC on Windows
+
+Find the native MFC - i.e.  decide if an application can link to the
+MFC libraries.
+
+::
+
+  MFC_FOUND - Was MFC support found
+
+You don't need to include anything or link anything to use it.
+#]=======================================================================]
 
 # Assume no MFC support
 set(MFC_FOUND "NO")

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.