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
liaogang 已提交
19 20
    "${CMAKE_CURRENT_SOURCE_DIR}/conf.py.en.in"
    "${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
Luo Tao 已提交
30 31
add_dependencies(paddle_docs
  gen_proto_py)
L
liaogang 已提交
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56


# 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(
    "${CMAKE_CURRENT_SOURCE_DIR}/conf.py.cn.in"
    "${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})

add_dependencies(paddle_docs_cn
  gen_proto_py)