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