CMakeLists.txt 1.6 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
    @ONLY)

23
sphinx_add_target(paddle_v2_docs
Z
zhangjinchao01 已提交
24
                  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

_青葱's avatar
_青葱 已提交
30 31
add_dependencies(paddle_v2_docs gen_proto_py)

L
liaogang 已提交
32 33 34 35 36 37 38 39 40 41
# 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 已提交
42
    "${CMAKE_CURRENT_SOURCE_DIR}/../templates/conf.py.cn.in"
L
liaogang 已提交
43 44 45
    "${BINARY_BUILD_DIR_CN}/conf.py"
    @ONLY)

46
sphinx_add_target(paddle_v2_docs_cn
L
liaogang 已提交
47 48 49 50 51
                  html
                  ${BINARY_BUILD_DIR_CN}
                  ${SPHINX_CACHE_DIR_CN}
                  ${CMAKE_CURRENT_SOURCE_DIR}
                  ${SPHINX_HTML_DIR_CN})
L
Luo Tao 已提交
52

_青葱's avatar
_青葱 已提交
53 54
add_dependencies(paddle_v2_docs_cn gen_proto_py)

L
Luo Tao 已提交
55
add_subdirectory(api)