d7910d366dade7af7c2e6612a76978ba6c0c585a
[alexxy/gromacs.git] / docs / doxygen / RunDoxygen.cmake.cmakein
1 #
2 # This file is part of the GROMACS molecular simulation package.
3 #
4 # Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
5 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 # and including many others, as listed in the AUTHORS file in the
7 # top-level source directory and at http://www.gromacs.org.
8 #
9 # GROMACS is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU Lesser General Public License
11 # as published by the Free Software Foundation; either version 2.1
12 # of the License, or (at your option) any later version.
13 #
14 # GROMACS is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 # Lesser General Public License for more details.
18 #
19 # You should have received a copy of the GNU Lesser General Public
20 # License along with GROMACS; if not, see
21 # http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
23 #
24 # If you want to redistribute modifications to GROMACS, please
25 # consider that scientific software is very special. Version
26 # control is crucial - bugs must be traceable. We will be happy to
27 # consider code for inclusion in the official distribution, but
28 # derived work must not be called official GROMACS. Details are found
29 # in the README & COPYING files - if they are missing, get the
30 # official version at http://www.gromacs.org.
31 #
32 # To help us fund GROMACS development, we humbly ask that you cite
33 # the research papers on the package. Check out http://www.gromacs.org.
34
35 set(DOXYGEN_EXECUTABLE   "@DOXYGEN_EXECUTABLE@")
36 set(DOXYGEN_VERSION      "@DOXYGEN_VERSION@")
37 set(DOXYGEN_MSCGEN_FOUND @DOXYGEN_MSCGEN_FOUND@)
38
39 set(EXPECTED_VERSION     "@EXPECTED_DOXYGEN_VERSION@")
40
41 if (NOT DOXYGEN_VERSION VERSION_EQUAL EXPECTED_VERSION)
42     message("NOTE: You are using Doxygen version ${DOXYGEN_VERSION}. "
43             "The documentation is designed for ${EXPECTED_VERSION}. "
44             "Other versions may or may not work, but very likely produce extra warnings.")
45 endif()
46
47 message("Running Doxygen...")
48 # The standard output shows a lot of progress information, but obscures errors
49 # that may appear.  CMake-introduced buffering also makes it appear sluggish,
50 # so disable it.
51 execute_process(COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile-${DOCTYPE}
52                 OUTPUT_QUIET RESULT_VARIABLE result)
53 if (result)
54     message(FATAL_ERROR "Doxygen failed. "
55             "Please run '${DOXYGEN_EXECUTABLE} Doxyfile-${DOCTYPE}' "
56             "in the docs/doxygen/ subdirectory in the build tree to see the details.")
57 endif()
58
59 file(READ doxygen-${DOCTYPE}.log DOXYGEN_WARNINGS)
60 if (DOXYGEN_WARNINGS)
61     string(STRIP "${DOXYGEN_WARNINGS}" STRIPPED_WARNINGS)
62     message("The following warnings were produced by Doxygen:")
63     message("${STRIPPED_WARNINGS}")
64     # Remove some useless/hard-to-suppress warnings from the file to avoid
65     # Jenkins complaining.
66     string(REGEX REPLACE
67            "warning:[^\n]*Consider increasing DOT_GRAPH_MAX_NODES.\n" ""
68            DOXYGEN_WARNINGS "${DOXYGEN_WARNINGS}")
69     # Add a note to the warnings that identify the documentation type that
70     # produces them.  This makes it easier to see in Jenkins if a warning type
71     # is produced only from some documentation types.
72     string(REGEX REPLACE "\n" " (in doxygen-${DOCTYPE})\n"
73            DOXYGEN_WARNINGS "${DOXYGEN_WARNINGS}")
74     file(WRITE doxygen-${DOCTYPE}.log "${DOXYGEN_WARNINGS}")
75 endif ()
76 if (NOT DOXYGEN_MSCGEN_FOUND)
77     message("NOTE: mscgen was not available. "
78             "Please install it to produce graphs in the documentation.")
79 endif ()