CMakeLists.txt 1.5 KB
Newer Older
Z
zhangjinchao01 已提交
1 2 3 4 5 6 7 8 9
if(NOT DEFINED SPHINX_THEME)
    set(SPHINX_THEME default)
endif()

if(NOT DEFINED SPHINX_THEME_DIR)
    set(SPHINX_THEME_DIR)
endif()

# configured documentation tools and intermediate build results
L
liaogang 已提交
10
set(BINARY_BUILD_DIR_EN "${CMAKE_CURRENT_BINARY_DIR}/en/_build")
Z
zhangjinchao01 已提交
11 12

# Sphinx cache with pickled ReST documents
L
liaogang 已提交
13
set(SPHINX_CACHE_DIR_EN "${CMAKE_CURRENT_BINARY_DIR}/en/_doctrees")
Z
zhangjinchao01 已提交
14

L
liaogang 已提交
15 16
# HTML output director
set(SPHINX_HTML_DIR_EN "${CMAKE_CURRENT_BINARY_DIR}/en/html")
Z
zhangjinchao01 已提交
17 18

configure_file(
L
Luo Tao 已提交
19
    "${CMAKE_CURRENT_SOURCE_DIR}/../templates/conf.py.en.in"
L
liaogang 已提交
20
    "${BINARY_BUILD_DIR_EN}/conf.py"
Z
zhangjinchao01 已提交
21 22 23 24
    @ONLY)

sphinx_add_target(paddle_docs
                  html
L
liaogang 已提交
25 26
                  ${BINARY_BUILD_DIR_EN}
                  ${SPHINX_CACHE_DIR_EN}
Z
zhangjinchao01 已提交
27
                  ${CMAKE_CURRENT_SOURCE_DIR}
L
liaogang 已提交
28
                  ${SPHINX_HTML_DIR_EN})
Z
zhangjinchao01 已提交
29

L
liaogang 已提交
30 31 32 33 34 35 36 37 38 39
# configured documentation tools and intermediate build results
set(BINARY_BUILD_DIR_CN "${CMAKE_CURRENT_BINARY_DIR}/cn/_build")

# Sphinx cache with pickled ReST documents
set(SPHINX_CACHE_DIR_CN "${CMAKE_CURRENT_BINARY_DIR}/cn/_doctrees")

# HTML output directory
set(SPHINX_HTML_DIR_CN "${CMAKE_CURRENT_BINARY_DIR}/cn/html")

configure_file(
L
Luo Tao 已提交
40
    "${CMAKE_CURRENT_SOURCE_DIR}/../templates/conf.py.cn.in"
L
liaogang 已提交
41 42 43 44 45 46 47 48 49
    "${BINARY_BUILD_DIR_CN}/conf.py"
    @ONLY)

sphinx_add_target(paddle_docs_cn
                  html
                  ${BINARY_BUILD_DIR_CN}
                  ${SPHINX_CACHE_DIR_CN}
                  ${CMAKE_CURRENT_SOURCE_DIR}
                  ${SPHINX_HTML_DIR_CN})
L
Luo Tao 已提交
50 51

add_subdirectory(api)