2010-08-19 23:59:24 +08:00
|
|
|
|
|
|
|
# find doxygen
|
2013-10-09 14:01:10 +08:00
|
|
|
if(SFML_OS_MACOSX)
|
2010-11-26 06:06:17 +08:00
|
|
|
# Add some path to search doxygen in more directories.
|
2015-04-01 10:08:23 +08:00
|
|
|
set(ADDITIONAL_PATHS
|
|
|
|
/Developer/Applications/Doxygen.app/Contents/Resources
|
|
|
|
/Developer/Applications/Doxygen.app/Contents/MacOS
|
|
|
|
$ENV{HOME}/Applications/Doxygen.app/Contents/Resources
|
|
|
|
$ENV{HOME}/Applications/Doxygen.app/Contents/MacOS
|
|
|
|
$ENV{HOME}/Applications/Developer/Doxygen.app/Contents/Resources
|
2010-11-26 06:06:17 +08:00
|
|
|
$ENV{HOME}/Applications/Developer/Doxygen.app/Contents/MacOS)
|
2015-04-01 10:08:23 +08:00
|
|
|
|
2010-11-26 06:06:17 +08:00
|
|
|
set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} ${ADDITIONAL_PATHS})
|
|
|
|
endif()
|
2012-06-17 02:00:18 +08:00
|
|
|
|
2010-08-19 23:59:24 +08:00
|
|
|
find_package(Doxygen REQUIRED)
|
|
|
|
|
|
|
|
# set the input and output documentation paths
|
2011-08-07 21:33:42 +08:00
|
|
|
set(DOXYGEN_INPUT_DIR ${PROJECT_SOURCE_DIR})
|
|
|
|
set(DOXYGEN_OUTPUT_DIR ${PROJECT_BINARY_DIR}/doc)
|
2010-08-19 23:59:24 +08:00
|
|
|
|
|
|
|
# see if we can generate the CHM documentation
|
2013-10-09 14:01:10 +08:00
|
|
|
if(SFML_OS_WINDOWS)
|
2010-08-19 23:59:24 +08:00
|
|
|
# if HHC is found, we can generate the CHM (compressed HTML) output
|
|
|
|
find_program(DOXYGEN_HHC_PROGRAM
|
|
|
|
NAMES hhc.exe
|
2015-02-24 20:59:06 +08:00
|
|
|
PATHS "C:/Program Files/HTML Help Workshop" "C:/Program Files (x86)/HTML Help Workshop"
|
2010-08-19 23:59:24 +08:00
|
|
|
DOC "HTML Help Compiler program")
|
|
|
|
if(DOXYGEN_HHC_PROGRAM)
|
|
|
|
set(DOXYGEN_GENERATE_HTMLHELP YES)
|
|
|
|
else()
|
|
|
|
set(DOXYGEN_GENERATE_HTMLHELP NO)
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
set(DOXYGEN_HHC_PROGRAM)
|
|
|
|
set(DOXYGEN_GENERATE_HTMLHELP NO)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# configure the source Doxyfile by copying it and replacing all @variables@
|
|
|
|
set(DOXYGEN_CONFIGURED_INPUT ${DOXYGEN_OUTPUT_DIR}/doxyfile)
|
|
|
|
configure_file(${DOXYGEN_INPUT_DIR}/doc/doxyfile.in ${DOXYGEN_CONFIGURED_INPUT} @ONLY)
|
2014-12-23 05:19:38 +08:00
|
|
|
configure_file(${DOXYGEN_INPUT_DIR}/doc/header.html.in ${DOXYGEN_OUTPUT_DIR}/header.html @ONLY)
|
2010-08-19 23:59:24 +08:00
|
|
|
|
|
|
|
# copy the files needed by the documentation
|
|
|
|
configure_file(${DOXYGEN_INPUT_DIR}/doc/doxygen.css ${DOXYGEN_OUTPUT_DIR}/html/doxygen.css COPYONLY)
|
2023-03-29 04:04:50 +08:00
|
|
|
configure_file(${DOXYGEN_INPUT_DIR}/doc/searchOverrides.css ${DOXYGEN_OUTPUT_DIR}/html/searchOverrides.css COPYONLY)
|
2010-08-19 23:59:24 +08:00
|
|
|
|
|
|
|
# target setup
|
2012-04-07 04:49:11 +08:00
|
|
|
add_custom_target(doc ALL
|
2010-08-19 23:59:24 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo_append "Building API Documentation..."
|
|
|
|
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_CONFIGURED_INPUT}
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo "Done."
|
|
|
|
WORKING_DIRECTORY ${DOXYGEN_INPUT_DIR})
|
|
|
|
|
|
|
|
# setup install rules
|
2019-11-15 03:45:09 +08:00
|
|
|
install(FILES ${DOXYGEN_OUTPUT_DIR}/SFML.tag
|
|
|
|
DESTINATION ${CMAKE_INSTALL_DOCDIR}
|
|
|
|
COMPONENT doc)
|
2010-08-19 23:59:24 +08:00
|
|
|
install(DIRECTORY ${DOXYGEN_OUTPUT_DIR}/html
|
2019-04-09 18:02:17 +08:00
|
|
|
DESTINATION ${CMAKE_INSTALL_DOCDIR}
|
2010-08-19 23:59:24 +08:00
|
|
|
COMPONENT doc)
|
|
|
|
if(DOXYGEN_HHC_PROGRAM)
|
|
|
|
install(FILES ${DOXYGEN_OUTPUT_DIR}/sfml.chm
|
2019-04-09 18:02:17 +08:00
|
|
|
DESTINATION ${CMAKE_INSTALL_DOCDIR}
|
2010-08-19 23:59:24 +08:00
|
|
|
COMPONENT doc)
|
|
|
|
endif()
|