mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-31 11:17:35 +02:00
Fix out-of-tree documentation build (#177)
This commit is contained in:
@ -5,7 +5,8 @@ if (NOT DOXYGEN)
|
|||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
add_custom_command(OUTPUT html/_static/cppformat.css
|
add_custom_command(OUTPUT html/_static/cppformat.css
|
||||||
COMMAND lessc --clean-css --include-path=bootstrap cppformat.less html/_static/cppformat.css
|
COMMAND lessc --clean-css --include-path=${CMAKE_CURRENT_SOURCE_DIR}/bootstrap
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/cppformat.less html/_static/cppformat.css
|
||||||
DEPENDS cppformat.less)
|
DEPENDS cppformat.less)
|
||||||
|
|
||||||
add_custom_target(doc COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build.py
|
add_custom_target(doc COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build.py
|
||||||
|
12
doc/build.py
12
doc/build.py
@ -23,7 +23,7 @@ def pip_install(package, commit=None):
|
|||||||
def build_docs():
|
def build_docs():
|
||||||
# Create virtualenv.
|
# Create virtualenv.
|
||||||
doc_dir = os.path.dirname(os.path.realpath(__file__))
|
doc_dir = os.path.dirname(os.path.realpath(__file__))
|
||||||
virtualenv_dir = os.path.join(doc_dir, 'virtualenv')
|
virtualenv_dir = 'virtualenv'
|
||||||
check_call(['virtualenv', virtualenv_dir])
|
check_call(['virtualenv', virtualenv_dir])
|
||||||
activate_this_file = os.path.join(virtualenv_dir, 'bin', 'activate_this.py')
|
activate_this_file = os.path.join(virtualenv_dir, 'bin', 'activate_this.py')
|
||||||
execfile(activate_this_file, dict(__file__=activate_this_file))
|
execfile(activate_this_file, dict(__file__=activate_this_file))
|
||||||
@ -32,7 +32,7 @@ def build_docs():
|
|||||||
pip_install('michaeljones/breathe', '511b0887293e7c6b12310bb61b3659068f48f0f4')
|
pip_install('michaeljones/breathe', '511b0887293e7c6b12310bb61b3659068f48f0f4')
|
||||||
# Build docs.
|
# Build docs.
|
||||||
cmd = ['doxygen', '-']
|
cmd = ['doxygen', '-']
|
||||||
p = Popen(cmd, stdin=PIPE, cwd=doc_dir)
|
p = Popen(cmd, stdin=PIPE)
|
||||||
p.communicate(input=r'''
|
p.communicate(input=r'''
|
||||||
PROJECT_NAME = C++ Format
|
PROJECT_NAME = C++ Format
|
||||||
GENERATE_LATEX = NO
|
GENERATE_LATEX = NO
|
||||||
@ -57,10 +57,10 @@ def build_docs():
|
|||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
raise CalledProcessError(p.returncode, cmd)
|
raise CalledProcessError(p.returncode, cmd)
|
||||||
check_call(['sphinx-build', '-D', 'breathe_projects.format=doxyxml',
|
check_call(['sphinx-build', '-D', 'breathe_projects.format=doxyxml',
|
||||||
'-b', 'html', '.', 'html'], cwd=doc_dir)
|
'-b', 'html', doc_dir, 'html'])
|
||||||
check_call(['lessc', '--clean-css', '--include-path=bootstrap', 'cppformat.less',
|
#check_call(['lessc', '--clean-css', '--include-path=bootstrap', 'cppformat.less',
|
||||||
'html/_static/cppformat.css'], cwd=doc_dir)
|
# 'html/_static/cppformat.css'], cwd=doc_dir)
|
||||||
return os.path.join(doc_dir, 'html')
|
return 'html'
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
build_docs()
|
build_docs()
|
||||||
|
Reference in New Issue
Block a user