1# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2# file Copyright.txt or https://cmake.org/licensing for details.
3
4#[=======================================================================[.rst:
5Documentation
6-------------
7
8.. deprecated:: 3.18
9  This module does nothing, unless policy :policy:`CMP0106` is set to ``OLD``.
10
11This module provides support for the VTK documentation framework.  It
12relies on several tools (Doxygen, Perl, etc).
13#]=======================================================================]
14
15cmake_policy(GET CMP0106 _Documentation_policy)
16
17if (_Documentation_policy STREQUAL "NEW")
18  message(FATAL_ERROR
19    "Documentation.cmake is VTK-specific code and should not be used in "
20    "non-VTK projects. This logic in this module is best shipped with the "
21    "project using it rather than with CMake. This is now an error according "
22    "to policy CMP0106.")
23else ()
24
25if (_Documentation_policy STREQUAL "")
26  # Ignore the warning if the project is detected as VTK itself.
27  if (NOT CMAKE_PROJECT_NAME STREQUAL "VTK" AND
28      NOT PROJECT_NAME STREQUAL "VTK")
29    cmake_policy(GET_WARNING CMP0106 _Documentation_policy_warning)
30    message(AUTHOR_WARNING
31      "${_Documentation_policy_warning}\n"
32      "Documentation.cmake is VTK-specific code and should not be used in "
33      "non-VTK projects. This logic in this module is best shipped with the "
34      "project using it rather than with CMake.")
35  endif ()
36  unset(_Documentation_policy_warning)
37endif ()
38
39#
40# Build the documentation ?
41#
42option(BUILD_DOCUMENTATION "Build the documentation (Doxygen)." OFF)
43mark_as_advanced(BUILD_DOCUMENTATION)
44
45if (BUILD_DOCUMENTATION)
46
47  #
48  # Check for the tools
49  #
50  find_package(UnixCommands)
51  find_package(Doxygen)
52  find_package(Gnuplot)
53  find_package(HTMLHelp)
54  find_package(Perl)
55  find_package(Wget)
56
57  option(DOCUMENTATION_HTML_HELP
58    "Build the HTML Help file (CHM)." OFF)
59
60  option(DOCUMENTATION_HTML_TARZ
61    "Build a compressed tar archive of the HTML doc." OFF)
62
63  mark_as_advanced(
64    DOCUMENTATION_HTML_HELP
65    DOCUMENTATION_HTML_TARZ
66    )
67
68  #
69  # The documentation process is controlled by a batch file.
70  # We will probably need bash to create the custom target
71  #
72
73endif ()
74
75endif ()
76
77unset(_Documentation_policy)
78