-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathCMakeLists.txt
29 lines (22 loc) · 1007 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
cmake_minimum_required(VERSION 2.8)
project(Test)
set(CMAKE_VERBOSE_MAKEFILE on)
set(CMAKE_C_COMPILER "gcc")
file(GLOB_RECURSE source_files "${CMAKE_CURRENT_SOURCE_DIR}/src/*.c")
add_executable(test ${source_files})
FIND_PACKAGE(Doxygen)
OPTION(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" ${DOXYGEN_FOUND})
IF(BUILD_DOCUMENTATION)
IF(NOT DOXYGEN_FOUND)
MESSAGE(FATAL_ERROR "Doxygen is needed to build the documentation.")
ENDIF()
SET(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
SET(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
CONFIGURE_FILE(${doxyfile_in} ${doxyfile} @ONLY)
ADD_CUSTOM_TARGET(doc
COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM)
INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc)
ENDIF()