forked from itas109/CSerialPort
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
54 lines (47 loc) · 2.15 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#***************************************************************************
# @file CMakeLists.txt
# @author itas109 ([email protected]) \n\n
# Blog : https://blog.csdn.net/itas109 \n
# Github : https://github.com/itas109 \n
# Gitee : https://gitee.com/itas109 \n
# QQ Group : 129518033
# @brief Lightweight cross-platform serial port library based on C++
# @copyright The CSerialPort is Copyright (C) 2014 itas109 <[email protected]>.
# You may use, copy, modify, and distribute the CSerialPort, under the terms
# of the LICENSE file.
############################################################################
cmake_minimum_required(VERSION 2.8.12)
project(doc)
find_package(Doxygen)
if (DOXYGEN_FOUND)
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
set(DOXYGEN_OUT_CN ${CMAKE_CURRENT_BINARY_DIR}/DoxyfileCN)
set(DOXYGEN_OUT_EN ${CMAKE_CURRENT_BINARY_DIR}/DoxyfileEN)
file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/../include/CSerialPort/SerialPort_version.h VERSION_CONTENTS REGEX "#define CSERIALPORT_VERSION")
string(REGEX MATCH "#define CSERIALPORT_VERSION \"[^\"]*" CSERIALPORT_VERSION ${VERSION_CONTENTS})
string(REGEX REPLACE "[^\"]+\"" "" CSERIALPORT_VERSION ${CSERIALPORT_VERSION})
set(INPUT ${CMAKE_CURRENT_SOURCE_DIR}/../include/CSerialPort)
set(OUTPUT ${CMAKE_BINARY_DIR}/bin)
set(OUTPUT_LANGUAGE "Chinese")
set(MDFILE ${CMAKE_CURRENT_SOURCE_DIR}/../README_zh_CN.md)
set(CHM_FILE "CSerialPort_doc_cn.chm")
set(CHM_INDEX_ENCODING "GB2312")
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT_CN} @ONLY)
add_custom_target( doc_cn ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT_CN}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
set(OUTPUT_LANGUAGE "English")
set(MDFILE ${CMAKE_CURRENT_SOURCE_DIR}/../README.md)
set(CHM_FILE "CSerialPort_doc_en.chm")
set(CHM_INDEX_ENCODING "")
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT_EN} @ONLY)
add_custom_target(doc_en ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT_EN}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
# doc_cn first
add_dependencies(doc_en doc_cn)
else ()
message(FATAL_ERROR "Doxygen not found")
endif ()