Welcome to mirror list, hosted at ThFree Co, Russian Federation.

CMakeLists.txt « doc - github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: dbca98a7d8681a1bf22365f747d0c7496f02ec36 (plain)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
if(SPHINX_FOUND)

    # Sphinx cache with pickled ReST documents
    set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees")
    # HTML output directory
    set(SPHINX_HTML_DIR     "${CMAKE_CURRENT_BINARY_DIR}/html")
    set(SPHINX_MAN_DIR      "${CMAKE_CURRENT_BINARY_DIR}/man1")
    set(SPHINX_PDF_DIR      "${CMAKE_CURRENT_BINARY_DIR}/latex")
    set(SPHINX_QCH_DIR      "${CMAKE_CURRENT_BINARY_DIR}/qthelp")
    set(SPHINX_HTMLHELP_DIR "${CMAKE_CURRENT_BINARY_DIR}/htmlhelp")
    set(MSHTML_COMPILER     wine 'C:\\Program Files\\HTML Help Workshop\\hhc.exe')
    # assets
    set(LATEX_LOGO          "${CMAKE_CURRENT_SOURCE_DIR}/logo-blue.pdf")

    install(DIRECTORY ${SPHINX_HTML_DIR} DESTINATION ${CMAKE_INSTALL_DOCDIR} OPTIONAL)
    install(DIRECTORY ${SPHINX_MAN_DIR} DESTINATION ${CMAKE_INSTALL_MANDIR} OPTIONAL)
    install(DIRECTORY ${SPHINX_PDF_DIR} DESTINATION ${CMAKE_INSTALL_DOCDIR} OPTIONAL)
    install(DIRECTORY ${SPHINX_QCH_DIR} DESTINATION ${CMAKE_INSTALL_DOCDIR} OPTIONAL)

    configure_file("${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in" conf.py @ONLY)

    if(WITH_DOC)
       add_custom_target(doc ALL DEPENDS doc-html doc-man COMMENT "Building documentation...")
    else(WITH_DOC)
       add_custom_target(doc DEPENDS doc-html doc-man COMMENT "Building documentation...")
    endif(WITH_DOC)

    if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ocdoc/_shared_assets")
       add_dependencies(doc doc-html-org)
       add_dependencies(doc doc-html-com)
    endif()

    if(PDFLATEX_FOUND)
        # if this still fails on Debian/Ubuntu, run
        # apt-get install texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
        add_custom_target(doc-latex  ${SPHINX_EXECUTABLE}
		                     -q -c . -b latex
				     -d ${SPHINX_CACHE_DIR}/latex
				     -D latex_logo=${LATEX_LOGO}
				     ${CMAKE_CURRENT_SOURCE_DIR}
				     ${SPHINX_PDF_DIR} )
        add_custom_target(doc-pdf $(MAKE) -C ${SPHINX_PDF_DIR} all-pdf
		                  DEPENDS doc-latex )
        add_dependencies(doc doc-pdf)
    endif(PDFLATEX_FOUND)
    if (EXISTS ${QT_QCOLLECTIONGENERATOR_EXECUTABLE})
        add_custom_target( doc-qch-sphinx ${SPHINX_EXECUTABLE}
		                          -q -c . -b qthelp
				          -d ${SPHINX_CACHE_DIR}/qthelp
					  ${CMAKE_CURRENT_SOURCE_DIR}
					  ${SPHINX_QCH_DIR} )
        add_custom_target( doc-qch ${QT_QCOLLECTIONGENERATOR_EXECUTABLE}
		                   ${SPHINX_QCH_DIR}/*.qhcp
				   DEPENDS doc-qch-sphinx )
        add_dependencies(doc doc-qch)
    endif()
    add_custom_target( doc-html ${SPHINX_EXECUTABLE}
	                        -q -c . -b html
				-d ${SPHINX_CACHE_DIR}/html
				${CMAKE_CURRENT_SOURCE_DIR}
				${SPHINX_HTML_DIR}/unthemed )
    add_custom_target( doc-html-org ${SPHINX_EXECUTABLE}
	                        -q -c . -b html
				-d ${SPHINX_CACHE_DIR}/html
                                -D html_theme=owncloud_org
				${CMAKE_CURRENT_SOURCE_DIR}
				${SPHINX_HTML_DIR}/org )
    add_custom_target( doc-html-com ${SPHINX_EXECUTABLE}
	                        -q -c . -b html
				-d ${SPHINX_CACHE_DIR}/html
                                -D html_theme=owncloud_com
				${CMAKE_CURRENT_SOURCE_DIR}
				${SPHINX_HTML_DIR}/com )
    add_custom_target( doc-man  ${SPHINX_EXECUTABLE}
	                        -q -c . -b man
				-d ${SPHINX_CACHE_DIR}/man
				${CMAKE_CURRENT_SOURCE_DIR}
				${SPHINX_MAN_DIR} )

    ## Building CHM files requires HTML Help Workshop. Since it requires wine
    ## with special dependencies, it's impossible to write a cmake check for it.
    ## This is why doc-chm is not a dependency for doc. Instead, run
    ## doc/scripts/htmlhelp.exe to install them and run this target
    ## explicitly.
    add_custom_target( doc-chm-sphinx  ${SPHINX_EXECUTABLE}
	                               -q -c . -b htmlhelp
	                               -D html_theme=basic
                                       -d ${SPHINX_CACHE_DIR}/htmlhelp
                                       ${CMAKE_CURRENT_SOURCE_DIR}
                                       ${SPHINX_HTMLHELP_DIR} )
    add_custom_target( doc-chm pushd ${SPHINX_HTMLHELP_DIR}; ${MSHTML_COMPILER} *.hhp; popd
				   DEPENDS doc-chm-sphinx )
endif(SPHINX_FOUND)