2013-10-15 15:17:36 +00:00
|
|
|
#.rst:
|
|
|
|
# FindDoxygen
|
|
|
|
# -----------
|
|
|
|
#
|
|
|
|
# This module looks for Doxygen and the path to Graphviz's dot
|
|
|
|
#
|
2009-01-29 03:56:38 +00:00
|
|
|
# Doxygen is a documentation generation tool. Please see
|
|
|
|
# http://www.doxygen.org
|
2009-01-20 03:28:09 +00:00
|
|
|
#
|
|
|
|
# This module accepts the following optional variables:
|
|
|
|
#
|
2013-10-15 15:17:36 +00:00
|
|
|
# ::
|
|
|
|
#
|
|
|
|
# DOXYGEN_SKIP_DOT = If true this module will skip trying to find Dot
|
|
|
|
# (an optional component often used by Doxygen)
|
|
|
|
#
|
|
|
|
#
|
2009-01-20 03:28:09 +00:00
|
|
|
#
|
|
|
|
# This modules defines the following variables:
|
|
|
|
#
|
2013-10-15 15:17:36 +00:00
|
|
|
# ::
|
|
|
|
#
|
|
|
|
# DOXYGEN_EXECUTABLE = The path to the doxygen command.
|
|
|
|
# DOXYGEN_FOUND = Was Doxygen found or not?
|
|
|
|
# DOXYGEN_VERSION = The version reported by doxygen --version
|
|
|
|
#
|
2009-01-20 03:28:09 +00:00
|
|
|
#
|
|
|
|
#
|
2013-10-15 15:17:36 +00:00
|
|
|
# ::
|
2009-01-29 03:56:38 +00:00
|
|
|
#
|
2013-10-15 15:17:36 +00:00
|
|
|
# DOXYGEN_DOT_EXECUTABLE = The path to the dot program used by doxygen.
|
|
|
|
# DOXYGEN_DOT_FOUND = Was Dot found or not?
|
2014-05-27 20:33:37 +00:00
|
|
|
#
|
|
|
|
# For compatibility with older versions of CMake, the now-deprecated
|
|
|
|
# variable ``DOXYGEN_DOT_PATH`` is set to the path to the directory
|
|
|
|
# containing ``dot`` as reported in ``DOXYGEN_DOT_EXECUTABLE``.
|
|
|
|
# The path may have forward slashes even on Windows and is not
|
|
|
|
# suitable for direct substitution into a ``Doxyfile.in`` template.
|
|
|
|
# If you need this value, use :command:`get_filename_component`
|
|
|
|
# to compute it from ``DOXYGEN_DOT_EXECUTABLE`` directly, and
|
|
|
|
# perhaps the :command:`file(TO_NATIVE_PATH)` command to prepare
|
|
|
|
# the path for a Doxygen configuration file.
|
2009-01-29 03:56:38 +00:00
|
|
|
|
2009-09-28 15:45:50 +00:00
|
|
|
#=============================================================================
|
|
|
|
# Copyright 2001-2009 Kitware, Inc.
|
|
|
|
#
|
|
|
|
# Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
# see accompanying file Copyright.txt for details.
|
|
|
|
#
|
|
|
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
# See the License for more information.
|
|
|
|
#=============================================================================
|
2010-08-07 00:48:47 +00:00
|
|
|
# (To distribute this file outside of CMake, substitute the full
|
2009-09-28 15:45:50 +00:00
|
|
|
# License text for the above reference.)
|
|
|
|
|
2009-01-29 03:56:38 +00:00
|
|
|
# For backwards compatibility support
|
2012-08-13 17:47:32 +00:00
|
|
|
if(Doxygen_FIND_QUIETLY)
|
|
|
|
set(DOXYGEN_FIND_QUIETLY TRUE)
|
2012-08-13 17:50:14 +00:00
|
|
|
endif()
|
2009-01-29 03:56:38 +00:00
|
|
|
|
|
|
|
# ===== Rationale for OS X AppBundle mods below =====
|
|
|
|
# With the OS X GUI version, Doxygen likes to be installed to /Applications and
|
2012-08-13 17:42:58 +00:00
|
|
|
# it contains the doxygen executable in the bundle. In the versions I've
|
|
|
|
# seen, it is located in Resources, but in general, more often binaries are
|
2009-01-20 03:28:09 +00:00
|
|
|
# located in MacOS.
|
|
|
|
#
|
2012-08-13 17:42:58 +00:00
|
|
|
# NOTE: The official Doxygen.app that is distributed for OS X uses non-standard
|
2009-01-29 03:56:38 +00:00
|
|
|
# conventions. Instead of the command-line "doxygen" tool being placed in
|
2012-08-13 17:42:58 +00:00
|
|
|
# Doxygen.app/Contents/MacOS, "Doxywizard" is placed there instead and
|
2009-01-29 03:56:38 +00:00
|
|
|
# "doxygen" is placed in Contents/Resources. This is most likely done
|
|
|
|
# so that something happens when people double-click on the Doxygen.app
|
|
|
|
# package. Unfortunately, CMake gets confused by this as when it sees the
|
|
|
|
# bundle it uses "Doxywizard" as the executable to use instead of
|
|
|
|
# "doxygen". Therefore to work-around this issue we temporarily disable
|
|
|
|
# the app-bundle feature, just for this CMake module:
|
2009-01-20 03:28:09 +00:00
|
|
|
if(APPLE)
|
|
|
|
# Save the old setting
|
2012-08-13 17:47:32 +00:00
|
|
|
set(TEMP_DOXYGEN_SAVE_CMAKE_FIND_APPBUNDLE ${CMAKE_FIND_APPBUNDLE})
|
2009-01-20 03:28:09 +00:00
|
|
|
# Disable the App-bundle detection feature
|
2012-08-13 17:47:32 +00:00
|
|
|
set(CMAKE_FIND_APPBUNDLE "NEVER")
|
2009-01-20 03:28:09 +00:00
|
|
|
endif()
|
|
|
|
# FYI:
|
2012-08-13 17:42:58 +00:00
|
|
|
# In the older versions of OS X Doxygen, dot was included with the
|
2009-01-29 03:56:38 +00:00
|
|
|
# Doxygen bundle. But the new versions require you to download
|
|
|
|
# Graphviz.app which contains "dot" in it's bundle.
|
2009-01-20 03:28:09 +00:00
|
|
|
# ============== End OSX stuff ================
|
|
|
|
|
|
|
|
#
|
|
|
|
# Find Doxygen...
|
|
|
|
#
|
2006-10-04 15:04:26 +00:00
|
|
|
|
2012-08-13 17:47:32 +00:00
|
|
|
find_program(DOXYGEN_EXECUTABLE
|
2006-10-04 15:04:26 +00:00
|
|
|
NAMES doxygen
|
2009-01-20 03:28:09 +00:00
|
|
|
PATHS
|
|
|
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\doxygen_is1;Inno Setup: App Path]/bin"
|
|
|
|
/Applications/Doxygen.app/Contents/Resources
|
|
|
|
/Applications/Doxygen.app/Contents/MacOS
|
2006-10-04 15:04:26 +00:00
|
|
|
DOC "Doxygen documentation generation tool (http://www.doxygen.org)"
|
2001-10-23 21:06:19 +00:00
|
|
|
)
|
2001-10-23 21:47:32 +00:00
|
|
|
|
2012-08-13 17:47:32 +00:00
|
|
|
if(DOXYGEN_EXECUTABLE)
|
|
|
|
execute_process(COMMAND ${DOXYGEN_EXECUTABLE} "--version" OUTPUT_VARIABLE DOXYGEN_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
endif()
|
2012-01-02 17:47:19 +00:00
|
|
|
|
Modules: Include builtin FindPackageHandleStandardArgs directly
The FindPackageHandleStandardArgs module was originally created outside
of CMake. It was added for CMake 2.6.0 by commit e118a627 (add a macro
FIND_PACKAGE_HANDLE_STANDARD_ARGS..., 2007-07-18). However, it also
proliferated into a number of other projects that at the time required
only CMake 2.4 and thus could not depend on CMake to provide the module.
CMake's own find modules started using the module in commit b5f656e0
(use the new FIND_PACKAGE_HANDLE_STANDARD_ARGS in some of the FindXXX
modules..., 2007-07-18).
Then commit d358cf5c (add 2nd, more powerful mode to
find_package_handle_standard_args, 2010-07-29) added a new feature to
the interface of the module that was fully optional and backward
compatible with all existing users of the module. Later commit 5f183caa
(FindZLIB: use the FPHSA version mode, 2010-08-04) and others shortly
thereafter started using the new interface in CMake's own find modules.
This change was also backward compatible because it was only an
implementation detail within each module.
Unforutnately these changes introduced a problem for projects that still
have an old copy of FindPackageHandleStandardArgs in CMAKE_MODULE_PATH.
When any such project uses one of CMake's builtin find modules the line
include(FindPackageHandleStandardArgs)
loads the copy from the project which does not have the new interface!
Then the including find module tries to use the new interface with the
old module and fails.
Whether this breakage can be considered a backward incompatible change
in CMake is debatable. The situation is analagous to copying a standard
library header from one version of a compiler into a project and then
observing problems when the next version of the compiler reports errors
in its other headers that depend on its new version of the original
header. Nevertheless it is a change to CMake that causes problems for
projects that worked with previous versions.
This problem was discovered during the 2.8.3 release candidate cycle.
It is an instance of a more general problem with projects that provide
their own versions of CMake modules when other CMake modules depend on
them. At the time we resolved this instance of the problem with commit
b0118402 (Use absolute path to FindPackageHandleStandardArgs.cmake
everywhere, 2010-09-28) for the 2.8.3 release.
In order to address the more general problem we introduced policy
CMP0017 in commit db44848f (Prefer files from CMAKE_ROOT when including
from CMAKE_ROOT, 2010-11-17). That change was followed by commit
ce28737c (Remove usage of CMAKE_CURRENT_LIST_DIR now that we have
CMP0017, 2010-12-20) which reverted the original workaround in favor of
using the policy. However, existing project releases do not set the
policy behavior to NEW and therefore still exhibit the problem.
We introduced in commit a364daf1 (Allow users to specify defaults for
unset policies, 2011-01-03) an option for users to build existing
projects by adding -DCMAKE_POLICY_DEFAULT_CMP0017=NEW to the command
line. Unfortunately this solution still does not allow such projects to
build out of the box, and there is no good way to suggest the use of the
new option.
The only remaining solution to keep existing projects that exhibit this
problem building is to restore the change originally made in commit
b0118402 (Use absolute path to FindPackageHandleStandardArgs.cmake
everywhere, 2010-09-28). This also avoids policy CMP0017 warnings for
this particular instance of the problem the policy addresses.
2011-01-20 15:56:49 +00:00
|
|
|
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
2012-01-02 17:47:19 +00:00
|
|
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Doxygen REQUIRED_VARS DOXYGEN_EXECUTABLE VERSION_VAR DOXYGEN_VERSION)
|
2006-10-04 15:04:26 +00:00
|
|
|
|
2009-01-20 03:28:09 +00:00
|
|
|
#
|
|
|
|
# Find Dot...
|
|
|
|
#
|
2005-07-13 13:08:47 +00:00
|
|
|
|
2014-05-27 20:34:18 +00:00
|
|
|
set(_x86 "(x86)")
|
|
|
|
file(GLOB _Doxygen_GRAPHVIZ_BIN_DIRS
|
|
|
|
"$ENV{ProgramFiles}/Graphviz*/bin"
|
|
|
|
"$ENV{ProgramFiles${_x86}}/Graphviz*/bin"
|
|
|
|
)
|
|
|
|
unset(_x86)
|
|
|
|
|
2012-08-13 17:47:32 +00:00
|
|
|
if(NOT DOXYGEN_SKIP_DOT)
|
|
|
|
find_program(DOXYGEN_DOT_EXECUTABLE
|
2009-01-20 03:28:09 +00:00
|
|
|
NAMES dot
|
2012-08-13 17:42:58 +00:00
|
|
|
PATHS
|
2014-05-27 20:34:18 +00:00
|
|
|
${_Doxygen_GRAPHVIZ_BIN_DIRS}
|
2009-01-20 03:28:09 +00:00
|
|
|
"$ENV{ProgramFiles}/ATT/Graphviz/bin"
|
|
|
|
"C:/Program Files/ATT/Graphviz/bin"
|
|
|
|
[HKEY_LOCAL_MACHINE\\SOFTWARE\\ATT\\Graphviz;InstallPath]/bin
|
|
|
|
/Applications/Graphviz.app/Contents/MacOS
|
|
|
|
/Applications/Doxygen.app/Contents/Resources
|
|
|
|
/Applications/Doxygen.app/Contents/MacOS
|
|
|
|
DOC "Graphviz Dot tool for using Doxygen"
|
|
|
|
)
|
2012-08-13 17:42:58 +00:00
|
|
|
|
2009-01-20 03:28:09 +00:00
|
|
|
if(DOXYGEN_DOT_EXECUTABLE)
|
2009-01-30 20:13:07 +00:00
|
|
|
set(DOXYGEN_DOT_FOUND TRUE)
|
2006-10-24 14:03:58 +00:00
|
|
|
# The Doxyfile wants the path to Dot, not the entire path and executable
|
2014-05-27 20:33:37 +00:00
|
|
|
get_filename_component(DOXYGEN_DOT_PATH "${DOXYGEN_DOT_EXECUTABLE}" PATH)
|
2009-01-20 03:28:09 +00:00
|
|
|
endif()
|
2012-08-13 17:42:58 +00:00
|
|
|
|
2012-08-13 17:50:14 +00:00
|
|
|
endif()
|
2009-01-20 03:28:09 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Backwards compatibility...
|
|
|
|
#
|
2006-10-04 15:04:26 +00:00
|
|
|
|
2009-01-20 03:28:09 +00:00
|
|
|
if(APPLE)
|
|
|
|
# Restore the old app-bundle setting setting
|
2012-08-13 17:47:32 +00:00
|
|
|
set(CMAKE_FIND_APPBUNDLE ${TEMP_DOXYGEN_SAVE_CMAKE_FIND_APPBUNDLE})
|
2009-01-20 03:28:09 +00:00
|
|
|
endif()
|
2006-10-04 15:04:26 +00:00
|
|
|
|
2009-01-20 03:28:09 +00:00
|
|
|
# Maintain the _FOUND variables as "YES" or "NO" for backwards compatibility
|
|
|
|
# (allows people to stuff them directly into Doxyfile with configure_file())
|
|
|
|
if(DOXYGEN_FOUND)
|
|
|
|
set(DOXYGEN_FOUND "YES")
|
|
|
|
else()
|
|
|
|
set(DOXYGEN_FOUND "NO")
|
|
|
|
endif()
|
|
|
|
if(DOXYGEN_DOT_FOUND)
|
|
|
|
set(DOXYGEN_DOT_FOUND "YES")
|
|
|
|
else()
|
|
|
|
set(DOXYGEN_DOT_FOUND "NO")
|
|
|
|
endif()
|
2006-10-16 14:47:18 +00:00
|
|
|
|
2009-01-29 03:56:38 +00:00
|
|
|
# For backwards compatibility support
|
2012-08-13 17:47:32 +00:00
|
|
|
set (DOXYGEN ${DOXYGEN_EXECUTABLE} )
|
|
|
|
set (DOT ${DOXYGEN_DOT_EXECUTABLE} )
|
2006-10-23 18:51:56 +00:00
|
|
|
|
2012-08-13 17:47:32 +00:00
|
|
|
mark_as_advanced(
|
2006-10-23 18:51:56 +00:00
|
|
|
DOXYGEN_EXECUTABLE
|
|
|
|
DOXYGEN_DOT_EXECUTABLE
|
2006-10-04 15:04:26 +00:00
|
|
|
)
|