From fcf5e1b5bd0fb6755d274aee42b3e5e6413fdb1a Mon Sep 17 00:00:00 2001 From: Hugues Delorme Date: Thu, 28 May 2015 09:36:24 +0200 Subject: [PATCH] cmake: add doc target --- CMakeLists.txt | 13 +++++++++++++ doc/{Doxyfile => Doxyfile.cmake} | 16 +++++++++------- src/gmio_stl/stl_io_options.h | 4 ++-- src/gmio_support/stream_qt.h | 8 +++++++- 4 files changed, 31 insertions(+), 10 deletions(-) rename doc/{Doxyfile => Doxyfile.cmake} (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 769a326..3c2d9fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -231,6 +231,19 @@ install(TARGETS gmio LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) +# Add a target to generate API documentation with Doxygen +find_package(Doxygen) +if(DOXYGEN_FOUND) + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.cmake + ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile @ONLY) + add_custom_target( + doc + ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc + COMMENT "Generating API documentation with Doxygen" VERBATIM) +endif(DOXYGEN_FOUND) + # Examples: # cmake ../.. -DCMAKE_INSTALL_PREFIX=../../gcc-linux64 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_DEBUG_POSTFIX=.debug # cmake ../.. -DCMAKE_INSTALL_PREFIX=../../gcc-linux64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_RELEASE_POSTFIX=.release diff --git a/doc/Doxyfile b/doc/Doxyfile.cmake similarity index 99% rename from doc/Doxyfile rename to doc/Doxyfile.cmake index aaa28d0..5ecd23f 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile.cmake @@ -26,13 +26,13 @@ DOXYFILE_ENCODING = UTF-8 # identify the project. Note that if you do not use Doxywizard you need # to put quotes around the project name if it contains spaces. -PROJECT_NAME = GeomIO (Geometry Input/Output) Library +PROJECT_NAME = gmio # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 0.1.0 +PROJECT_NUMBER = @GMIO_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 @@ -128,7 +128,7 @@ FULL_PATH_NAMES = YES # If left blank the directory from which doxygen is run is used as the # path to strip. -STRIP_FROM_PATH = ../src +STRIP_FROM_PATH = @CMAKE_CURRENT_SOURCE_DIR@/src # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells @@ -249,7 +249,7 @@ EXTENSION_MAPPING = MARKDOWN_SUPPORT = YES -USE_MDFILE_AS_MAINPAGE = ../README.md +USE_MDFILE_AS_MAINPAGE = @CMAKE_CURRENT_SOURCE_DIR@/README.md # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should @@ -641,8 +641,8 @@ WARN_LOGFILE = # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = ../README.md \ - ../src +INPUT = @CMAKE_CURRENT_SOURCE_DIR@/README.md \ + @CMAKE_CURRENT_SOURCE_DIR@/src # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is @@ -675,7 +675,7 @@ RECURSIVE = YES # run. EXCLUDE = \ - ../src/gmio_support/support_global.h \ + @CMAKE_CURRENT_SOURCE_DIR@/src/gmio_support/support_global.h \ # 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 @@ -1484,6 +1484,8 @@ PREDEFINED = GMIO_LIB_EXPORT= \ GMIO_HAVE_STDINT_H=1 \ GMIO_C_LINKAGE_BEGIN= \ GMIO_C_LINKAGE_END= \ + QT_BEGIN_NAMESPACE= \ + QT_END_NAMESPACE= \ DOXYGEN # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then diff --git a/src/gmio_stl/stl_io_options.h b/src/gmio_stl/stl_io_options.h index ee193b5..0b1a982 100644 --- a/src/gmio_stl/stl_io_options.h +++ b/src/gmio_stl/stl_io_options.h @@ -33,12 +33,12 @@ struct gmio_stl_write_options * If set to \c GMIO_TRUE then : * \li for STL ASCII format, "solid " and * "endsolid" will no be written to output stream - * \li for STL binary format, the 80 bytes header followed bt the mesh + * \li for STL binary format, the 80 bytes header followed by the mesh * facet count (4bytes) will no be written to output stream */ gmio_bool_t stl_write_triangles_only; - /*! Name of the solid to appear in "solid \n facet normal ..." + /*! Name of the solid to appear in solid facet normal ... * * Option useful only with STL ascii format (GMIO_STL_FORMAT_ASCII). * diff --git a/src/gmio_support/stream_qt.h b/src/gmio_support/stream_qt.h index 1043790..edded96 100644 --- a/src/gmio_support/stream_qt.h +++ b/src/gmio_support/stream_qt.h @@ -30,6 +30,12 @@ QT_END_NAMESPACE /*! Returns a gmio_stream for \c QIODevice* (cookie will hold \p device) */ GMIO_LIBSUPPORT_EXPORT -gmio_stream_t gmio_stream_qiodevice(QT_PREPEND_NAMESPACE(QIODevice)* device); +gmio_stream_t gmio_stream_qiodevice( +#ifndef DOXYGEN + QT_PREPEND_NAMESPACE(QIODevice)* device +#else + QIODevice* device +#endif /* !DOXYGEN */ + ); #endif /* GMIO_SUPPORT_STREAM_QT_H */