Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/buildsystem2/cmake/DocumentationTarget.cmake @ 2648

Last change on this file since 2648 was 2637, checked in by rgrieder, 16 years ago

Adjustments to DocumentationTarget.cmake

  • Property svn:eol-style set to native
File size: 2.7 KB
Line 
1# -helper macro to add a "doc" target with CMake build system.
2# and configure doxy.config.in to doxy.config
3#
4# target "doc" allows building the documentation with doxygen/dot on WIN32 and Linux
5# Creates .chm windows help file if MS HTML help workshop
6# (available from http://msdn.microsoft.com/workshop/author/htmlhelp)
7# is installed with its DLLs in PATH.
8#
9#
10# Please note, that the tools, e.g.:
11# doxygen, dot, latex, dvips, makeindex, gswin32, etc.
12# must be in path.
13#
14# Note about Visual Studio Projects:
15# MSVS hast its own path environment which may differ from the shell.
16# See "Menu Tools/Options/Projects/VC++ Directories" in VS 7.1
17#
18# author Jan Woetzel 2004-2006
19# www.mip.informatik.uni-kiel.de/~jw
20# Adjustments for Orxonox by Reto Grieder
21
22FIND_PACKAGE(Doxygen QUIET)
23
24IF (DOXYGEN_FOUND)
25  # click+jump in Emacs and Visual Studio (for doxy.config) (jw)
26  IF(CMAKE_BUILD_TOOL MATCHES "msdev|devenv")
27    SET(DOXY_WARN_FORMAT "\"$file($line) : $text \"")
28  ELSE()
29    SET(DOXY_WARN_FORMAT "\"$file:$line: $text \"")
30  ENDIF()
31 
32  # we need latex for doxygen because of the formulas
33  # Orxonox doesn't
34  #FIND_PACKAGE(LATEX)
35  #IF    (NOT LATEX_COMPILER)
36  #  MESSAGE(STATUS "latex command LATEX_COMPILER not found but usually required. You will probably get warnings and user inetraction on doxy run.")
37  #ENDIF (NOT LATEX_COMPILER)
38  #IF    (NOT MAKEINDEX_COMPILER)
39  #  MESSAGE(STATUS "makeindex command MAKEINDEX_COMPILER not found but usually required.")
40  #ENDIF (NOT MAKEINDEX_COMPILER)
41  #IF    (NOT DVIPS_CONVERTER)
42  #  MESSAGE(STATUS "dvips command DVIPS_CONVERTER not found but usually required.")
43  #ENDIF (NOT DVIPS_CONVERTER)
44 
45  IF(EXISTS ${CMAKE_SOURCE_DIR}/doxy.config.in)
46    CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/doxy.config.in ${CMAKE_BINARY_DIR}/doxy.config @ONLY)
47    # use (configured) doxy.config from (out of place) BUILD tree:
48    SET(DOXY_CONFIG ${CMAKE_BINARY_DIR}/doxy.config)
49  ELSE()
50    MESSAGE(STATUS "Warning: Could not find dox.config.in in the root directory.")
51  ENDIF()
52 
53  ADD_CUSTOM_TARGET(doc ${DOXYGEN_EXECUTABLE} ${DOXY_CONFIG})
54 
55  # create a windows help .chm file using hhc.exe
56  # HTMLHelp DLL must be in path!
57  # fallback: use hhw.exe interactively
58  IF(WIN32)
59    FIND_PACKAGE(HTMLHelp)
60    IF(HTML_HELP_COMPILER)     
61      SET(TMP ${CMAKE_CURRENT_BINARY_DIR}/doc/html/index.hhp)
62      STRING(REGEX REPLACE "/" "\\\\" HHP_FILE ${TMP})
63      ADD_CUSTOM_TARGET(chmdoc ${HTML_HELP_COMPILER} ${HHP_FILE})
64      IF(NOT MSVC)
65        ADD_DEPENDENCIES(chmdoc doc)
66      ELSE(NOT MSVC)
67        # Do not add the dependency because msvc will then always build
68        # Doxygen, which is not very comforting.
69      ENDIF(NOT MSVC)
70    ENDIF(HTML_HELP_COMPILER)
71  ENDIF (WIN32) 
72ENDIF(DOXYGEN_FOUND)
Note: See TracBrowser for help on using the repository browser.