Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / mkl-dnn / cmake / Doxygen.cmake
1 #===============================================================================
2 # Copyright 2016-2018 Intel Corporation
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #===============================================================================
16
17 # Locates Doxygen and configures documentation generation
18 #===============================================================================
19
20 if(Doxygen_cmake_included)
21     return()
22 endif()
23 set(Doxygen_cmake_included true)
24
25 find_package(Doxygen)
26 if(DOXYGEN_FOUND)
27     set(DOXYGEN_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/reference)
28     set(DOXYGEN_STAMP_FILE ${CMAKE_CURRENT_BINARY_DIR}/doc.stamp)
29     configure_file(
30         ${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in
31         ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
32         @ONLY)
33     configure_file(
34         ${CMAKE_CURRENT_SOURCE_DIR}/doc/header.html.in
35         ${CMAKE_CURRENT_BINARY_DIR}/header.html
36         @ONLY)
37     file(GLOB_RECURSE HEADERS
38         ${PROJECT_SOURCE_DIR}/include/*.h
39         ${PROJECT_SOURCE_DIR}/include/*.hpp
40         )
41     file(GLOB_RECURSE DOX
42         ${PROJECT_SOURCE_DIR}/doc/*
43         )
44     add_custom_command(
45         OUTPUT ${DOXYGEN_STAMP_FILE}
46         DEPENDS ${HEADERS} ${DOX}
47         COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
48         COMMAND cmake -E touch ${DOXYGEN_STAMP_FILE}
49         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
50         COMMENT "Generating API documentation with Doxygen" VERBATIM)
51     add_custom_target(doc DEPENDS ${DOXYGEN_STAMP_FILE})
52     install(
53         DIRECTORY ${DOXYGEN_OUTPUT_DIR}
54         DESTINATION share/doc/${LIB_NAME} OPTIONAL)
55 endif(DOXYGEN_FOUND)
56
57