diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f91967..406713f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,7 @@ project(gio-qt) cmake_minimum_required(VERSION 3.9.5) option(BUILD_UTILS "Build utilities" ON) +option(BUILD_DOCS "Build documentation" OFF) # Version if (NOT PROJECT_VERSION) @@ -29,7 +30,8 @@ include(GNUInstallDirs) # Find the QtWidgets library find_package(Qt5 ${QT_MINIMUM_VERSION} CONFIG REQUIRED Core) -find_package(PkgConfig) +find_package(PkgConfig REQUIRED) +find_package(Doxygen) pkg_check_modules(GIOMM giomm-2.4) # look into FindPkgConfig.cmake @@ -38,3 +40,32 @@ add_subdirectory (gio-qt) if (BUILD_UTILS) add_subdirectory(qgio-tools) endif() + +if (BUILD_DOCS) + if (NOT DOXYGEN_FOUND) + message(FATAL_ERROR "Doxygen is required to build the documentation.") + endif () + + set (DOXYGEN_GENERATE_HTML YES) + set (DOXYGEN_GENERATE_QHP YES) + set (DOXYGEN_OUTPUT_DIRECTORY "./docs/") + set (DOXYGEN_EXCLUDE_SYMBOLS "*Private;*Test") + set (DOXYGEN_QHG_LOCATION "qhelpgenerator") + set (DOXYGEN_QHP_NAMESPACE "org.deepin.gio-qt") + set (DOXYGEN_QCH_FILE "../gio-qt.qch") + set (DOXYGEN_QHP_VIRTUAL_FOLDER "gio-qt") + + doxygen_add_docs(doxygen + ${CMAKE_CURRENT_SOURCE_DIR}/gio-qt + ALL + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/gio-qt + COMMENT "Generate documentation via Doxygen" + ) + + install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc) + +else () + message (STATUS "") + message (STATUS "To build docs, please use -DBUILD_DOCS=Yes") + message (STATUS "") +endif() diff --git a/gio-qt/dgiomountoperation.h b/gio-qt/dgiomountoperation.h index dc1f583..02db02b 100644 --- a/gio-qt/dgiomountoperation.h +++ b/gio-qt/dgiomountoperation.h @@ -13,11 +13,15 @@ enum DGioAskPasswordFlag }; Q_DECLARE_FLAGS(DGioAskPasswordFlags, DGioAskPasswordFlag) +//! Indicated the mount operation result +/*! + * Wrapper of GMountOperationResult. + */ enum DGioMountOperationResult { - MOUNT_OPERATION_HANDLED, - MOUNT_OPERATION_ABORTED, - MOUNT_OPERATION_UNHANDLED + MOUNT_OPERATION_HANDLED, /*!< The request was fulfilled and the user specified data is now available */ + MOUNT_OPERATION_ABORTED, /*!< The user requested the mount operation to be aborted */ + MOUNT_OPERATION_UNHANDLED /*!< The request was unhandled (i.e. not implemented) */ }; Q_ENUMS(DGioMountOperationResult);