1 #===============================================================================
2 # Copyright 2016-2018 Intel Corporation
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
8 # http://www.apache.org/licenses/LICENSE-2.0
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 #===============================================================================
17 # Locates Doxygen and configures documentation generation
18 #===============================================================================
20 if(Doxygen_cmake_included)
23 set(Doxygen_cmake_included true)
27 set(DOXYGEN_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/reference)
28 set(DOXYGEN_STAMP_FILE ${CMAKE_CURRENT_BINARY_DIR}/doc.stamp)
30 ${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in
31 ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
34 ${CMAKE_CURRENT_SOURCE_DIR}/doc/header.html.in
35 ${CMAKE_CURRENT_BINARY_DIR}/header.html
37 file(GLOB_RECURSE HEADERS
38 ${PROJECT_SOURCE_DIR}/include/*.h
39 ${PROJECT_SOURCE_DIR}/include/*.hpp
42 ${PROJECT_SOURCE_DIR}/doc/*
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})
53 DIRECTORY ${DOXYGEN_OUTPUT_DIR}
54 DESTINATION share/doc/${LIB_NAME} OPTIONAL)