Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/particles/doc/api/CMakeLists.txt @ 2853

Last change on this file since 2853 was 2710, checked in by rgrieder, 16 years ago

Merged buildsystem3 containing buildsystem2 containing Adi's buildsystem branch back to the trunk.
Please update the media directory if you were not using buildsystem3 before.

  • Property svn:eol-style set to native
File size: 3.2 KB
Line 
1# 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  SET(DOXY_INPUT_DIR  ${CMAKE_CURRENT_SOURCE_DIR})
33  SET(DOXY_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
34 
35  # we need latex for doxygen because of the formulas
36  # Orxonox doesn't
37  #FIND_PACKAGE(LATEX)
38  #IF    (NOT LATEX_COMPILER)
39  #  MESSAGE(STATUS "latex command LATEX_COMPILER not found but usually required. You will probably get warnings and user inetraction on doxy run.")
40  #ENDIF (NOT LATEX_COMPILER)
41  #IF    (NOT MAKEINDEX_COMPILER)
42  #  MESSAGE(STATUS "makeindex command MAKEINDEX_COMPILER not found but usually required.")
43  #ENDIF (NOT MAKEINDEX_COMPILER)
44  #IF    (NOT DVIPS_CONVERTER)
45  #  MESSAGE(STATUS "dvips command DVIPS_CONVERTER not found but usually required.")
46  #ENDIF (NOT DVIPS_CONVERTER)
47 
48  IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/doxy.config.in)
49    CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/doxy.config.in ${CMAKE_CURRENT_BINARY_DIR}/doxy.config @ONLY)
50    # use (configured) doxy.config from (out of place) BUILD tree:
51    SET(DOXY_CONFIG ${CMAKE_CURRENT_BINARY_DIR}/doxy.config)
52  ELSE()
53    MESSAGE(STATUS "Warning: Could not find dox.config.in in the root directory.")
54  ENDIF()
55 
56  ADD_CUSTOM_TARGET(doc ${DOXYGEN_EXECUTABLE} ${DOXY_CONFIG})
57 
58  # create a windows help .chm file using hhc.exe
59  # HTMLHelp DLL must be in path!
60  # fallback: use hhw.exe interactively
61  IF(WIN32)
62    FIND_PACKAGE(HTMLHelp)
63    IF(HTML_HELP_COMPILER)     
64      SET(TMP ${DOXY_OUTPUT_DIR}/html/index.hhp)
65      STRING(REGEX REPLACE "/" "\\\\" HHP_FILE ${TMP})
66      ADD_CUSTOM_TARGET(chmdoc ${HTML_HELP_COMPILER} ${HHP_FILE})
67      ADD_DEPENDENCIES(chmdoc doc)
68      # Adding a dependency somehow adds doc target as default build target
69      SET_TARGET_PROPERTIES(doc chmdoc PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD TRUE)
70    ENDIF(HTML_HELP_COMPILER)
71  ENDIF (WIN32)
72
73
74  # Installation
75  INSTALL(
76    FILES ${DOXY_CONFIG} ${CMAKE_CURRENT_BINARY_DIR}/doxy.log
77    DESTINATION ${ORXONOX_DOC_INSTALL_PATH}/api
78    OPTIONAL
79  )
80  # Install command always needs the directory to work
81  IF(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/html)
82    FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html)
83  ENDIF()
84  INSTALL(
85    DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html
86    DESTINATION ${ORXONOX_DOC_INSTALL_PATH}/api
87  )
88ENDIF(DOXYGEN_FOUND)
Note: See TracBrowser for help on using the repository browser.