From bdc5b11e4896f8a4200bfabdb74bbb91fa810d74 Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Fri, 26 Dec 2014 22:49:41 +0300 Subject: [PATCH] Call doxygen from cmake Among other things, this allows to substitude project version into Doxyfile --- CMakeLists.txt | 12 ++++++++++++ Doxyfile => Doxyfile.in | 8 ++++---- 2 files changed, 16 insertions(+), 4 deletions(-) rename Doxyfile => Doxyfile.in (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3dd5887..9c9c940 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,8 @@ ELSE(SDL2PP_WITH_IMAGE) MESSAGE(STATUS "SDL2_image support disabled") ENDIF(SDL2PP_WITH_IMAGE) +FIND_PACKAGE(Doxygen) + # compiler flags & definitions IF(MSVC) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") @@ -75,6 +77,16 @@ CONFIGURE_FILE( INCLUDE_DIRECTORIES(BEFORE ${PROJECT_BINARY_DIR}) +# doxygen +IF(DOXYGEN_FOUND) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) + ADD_CUSTOM_TARGET(doxygen + ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Generating API documentation with Doxygen" VERBATIM + ) +ENDIF(DOXYGEN_FOUND) + # sources SET(LIBRARY_SOURCES SDL2pp/AudioDevice.cc diff --git a/Doxyfile b/Doxyfile.in similarity index 99% rename from Doxyfile rename to Doxyfile.in index 0bc337b..8fde4b8 100644 --- a/Doxyfile +++ b/Doxyfile.in @@ -38,7 +38,7 @@ PROJECT_NAME = "libSDL2pp" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 0.6.0 +PROJECT_NUMBER = @SDL2PP_VERSION@ # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -753,7 +753,7 @@ WARN_LOGFILE = # spaces. # Note: If this tag is empty the current directory is searched. -INPUT = SDL2pp +INPUT = @CMAKE_CURRENT_SOURCE_DIR@/SDL2pp # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -788,7 +788,7 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = SDL2pp/external +EXCLUDE = @CMAKE_CURRENT_SOURCE_DIR@/SDL2pp/external # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -821,7 +821,7 @@ EXCLUDE_SYMBOLS = # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = demos +EXAMPLE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/examples # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and