2010-08-19 23:59:24 +08:00
|
|
|
# find doxygen
|
2023-02-12 12:49:05 +08:00
|
|
|
if(SFML_OS_MACOS)
|
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
|
|
|
|
2022-02-17 08:36:34 +08:00
|
|
|
list(APPEND CMAKE_PROGRAM_PATH ${ADDITIONAL_PATHS})
|
2010-11-26 06:06:17 +08:00
|
|
|
endif()
|
2012-06-17 02:00:18 +08:00
|
|
|
|
2010-08-19 23:59:24 +08:00
|
|
|
find_package(Doxygen REQUIRED)
|
|
|
|
|
|
|
|
# see if we can generate the CHM documentation
|
2024-09-11 06:06:50 +08:00
|
|
|
set(DOXYGEN_HHC_PROGRAM)
|
|
|
|
set(DOXYGEN_GENERATE_HTMLHELP NO)
|
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)
|
2024-05-08 02:50:12 +08:00
|
|
|
if(DOXYGEN_VERSION VERSION_LESS "1.10.0")
|
|
|
|
set(DOXYGEN_GENERATE_HTMLHELP YES)
|
|
|
|
else()
|
|
|
|
message("Due to conflicts with the HTML output settings in Doxygen ${DOXYGEN_VERSION}, the HTML Help generation will be disabled")
|
|
|
|
endif()
|
2010-08-19 23:59:24 +08:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# configure the source Doxyfile by copying it and replacing all @variables@
|
2024-09-01 05:44:01 +08:00
|
|
|
configure_file(doxyfile.in doxyfile @ONLY)
|
|
|
|
configure_file(header.html.in header.html @ONLY)
|
2010-08-19 23:59:24 +08:00
|
|
|
|
|
|
|
# copy the files needed by the documentation
|
2024-09-01 05:44:01 +08:00
|
|
|
configure_file(doxygen.css html/doxygen.css COPYONLY)
|
|
|
|
configure_file(searchOverrides.css html/searchOverrides.css COPYONLY)
|
2010-08-19 23:59:24 +08:00
|
|
|
|
|
|
|
# target setup
|
2023-03-23 12:08:43 +08:00
|
|
|
add_custom_target(doc
|
2010-08-19 23:59:24 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo_append "Building API Documentation..."
|
2024-09-01 05:44:01 +08:00
|
|
|
COMMAND Doxygen::doxygen ${CMAKE_CURRENT_BINARY_DIR}/doxyfile
|
2010-08-19 23:59:24 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo "Done."
|
2024-09-01 05:44:01 +08:00
|
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
|
2010-08-19 23:59:24 +08:00
|
|
|
|
|
|
|
# setup install rules
|
2024-09-01 05:44:01 +08:00
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/SFML.tag
|
2019-11-15 03:45:09 +08:00
|
|
|
DESTINATION ${CMAKE_INSTALL_DOCDIR}
|
|
|
|
COMPONENT doc)
|
2024-09-01 05:44:01 +08:00
|
|
|
install(DIRECTORY ${CMAKE_CURRENT_BINARY_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)
|
2024-09-01 05:44:01 +08:00
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_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()
|