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 19 20
set(IMPORT_PADDLE_STRING "")
set(IMPORT_PADDLEV2_STRING "")

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

26
sphinx_add_target(paddle_v2_docs
Z
zhangjinchao01 已提交
27
                  html
L
liaogang 已提交
28 29
                  ${BINARY_BUILD_DIR_EN}
                  ${SPHINX_CACHE_DIR_EN}
Z
zhangjinchao01 已提交
30
                  ${CMAKE_CURRENT_SOURCE_DIR}
L
liaogang 已提交
31
                  ${SPHINX_HTML_DIR_EN})
Z
zhangjinchao01 已提交
32

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

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

add_subdirectory(api)