Skip to content

Commit

Permalink
Using CMake to run Doxygen
Browse files Browse the repository at this point in the history
  • Loading branch information
vinipsmaker committed Aug 22, 2012
1 parent 932a5cd commit 9aad478
Show file tree
Hide file tree
Showing 6 changed files with 1,861 additions and 301 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
build
doc/*
*.pro.user
CMakeLists.txt.user
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ cmake_minimum_required(VERSION 2.8)
find_package(Qt4 4.6 REQUIRED QtCore QtNetwork)

# Configure options
option(GENERATE_DOC
"Use Doxygen to generate the project documentation" OFF
)

set(BUFFER_SIZE 128 CACHE STRING
"The default buffer size (in bytes) used by Tufão")
add_definitions(-DBUFFER_SIZE=${BUFFER_SIZE})
Expand All @@ -21,6 +25,10 @@ add_subdirectory(src)
add_subdirectory(include)
add_subdirectory(pkg)

if (GENERATE_DOC)
add_subdirectory(doc)
endif()

# uninstall target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
Expand Down
300 changes: 0 additions & 300 deletions Doxyfile

This file was deleted.

1 change: 1 addition & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ OPTIONS can be null or have a combination of the following values:
* -DCMAKE_BUILD_TYPE=Release
* -DCMAKE_BUILD_TYPE=RelWithDebInfo
* -DCMAKE_BUILD_TYPE=MinSizeRel
* -DGENERATE_DOC=YES generate documentation using Doxygen

OPTIONS available on Windows:
* -G"MinGW Makefiles" to generate Makefiles for use with MinGW environment
Expand Down
33 changes: 33 additions & 0 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
find_package(Doxygen REQUIRED)

# Configure info
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
@ONLY
)

# Build info
add_custom_target(doc ALL
"${DOXYGEN_EXECUTABLE}" "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
COMMENT "Generating API documentation with Doxygen"
)
add_custom_target(pdfdoc ALL
make
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/latex"
COMMENT "Running make to generate PDF output"
DEPENDS doc
)

# Install info
# html an qch
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html" "${CMAKE_CURRENT_BINARY_DIR}/qch"
DESTINATION "share/doc/tufao"
COMPONENT doc
PATTERN index.qhp EXCLUDE
)
# pdf
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/latex/refman.pdf"
DESTINATION "share/doc/tufao/pdf"
COMPONENT doc
)
Loading

0 comments on commit 9aad478

Please sign in to comment.