Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

add a doxygen flag #91

Closed
headupinclouds opened this issue Jul 13, 2016 · 3 comments
Closed

add a doxygen flag #91

headupinclouds opened this issue Jul 13, 2016 · 3 comments

Comments

@headupinclouds
Copy link
Contributor

headupinclouds commented Jul 13, 2016

Add a --doxygen flag assuming CMakeLists.txt contains something like the following example:

Doxygen example

${CMAKE_ROOT_DIR}/CMakeLists.txt

find_package(Doxygen)
option(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" ${DOXYGEN_FOUND})

get_cmake_property(_variableNames VARIABLES)
foreach (_variableName ${_variableNames})
  message(STATUS "VARIABLE: ${_variableName}=${${_variableName}}")
endforeach()

if(BUILD_DOCUMENTATION)
  if(NOT DOXYGEN_FOUND)
    message(FATAL_ERROR "Doxygen is needed to build the documentation.")
  endif()
  set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in)
  set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
  configure_file(${doxyfile_in} ${doxyfile} @ONLY)
  add_custom_target(doc
    COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
    COMMENT "Generating API documentation with Doxygen"
    VERBATIM
    )
  install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc)
  message("Generating doxygen comments")
endif()

${CMAKE_ROOT_DIR}/doc/Doxyfile.in

PROJECT_NAME           = "@CMAKE_PROJECT_NAME@"
PROJECT_NUMBER         = @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@
STRIP_FROM_PATH        = @PROJECT_SOURCE_DIR@ \
                         @PROJECT_BINARY_DIR@
INPUT                  = @doxy_main_page@ \
                         @PROJECT_SOURCE_DIR@ \
                         @PROJECT_BINARY_DIR@

EXCLUDE_PATTERNS       = */.svn/* \
                         */.git/* \
                         */doc/* \
                         */src/3rdparty/*

FILE_PATTERNS          = *.h \
                         *.hpp \
                         *.cc \
                         *.cpp \
                         *.c \

ENABLE_PREPROCESSING   = YES
MACRO_EXPANSION        = YES
EXPAND_ONLY_PREDEF     = NO

RECURSIVE              = YES
USE_MDFILE_AS_MAINPAGE = @doxy_main_page@

I can add this if there are no objections.

@ruslo
Copy link
Owner

ruslo commented Jul 13, 2016

Add a --doxygen flag

What exactly this flag do?

@headupinclouds
Copy link
Contributor Author

It would simply support calling a make doc target. I see there is already a generic --target option, so I guess this could be called through polly after building. This is probably better since there is no CMake specific convention regarding documentation targets. Going to close this.

@ruslo
Copy link
Owner

ruslo commented Jul 14, 2016

It would simply support calling a make doc target

Ok, just for your info: ruslo/CGold#1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants