Fix out-of-tree documentation build (#177)

This commit is contained in:
vitaut 2015-06-22 06:40:21 -07:00
parent a0ed6bfe4f
commit dd6a3bbc7c
2 changed files with 8 additions and 7 deletions

View File

@ -5,7 +5,8 @@ if (NOT DOXYGEN)
endif ()
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)
add_custom_target(doc COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build.py

View File

@ -23,7 +23,7 @@ def pip_install(package, commit=None):
def build_docs():
# Create virtualenv.
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])
activate_this_file = os.path.join(virtualenv_dir, 'bin', 'activate_this.py')
execfile(activate_this_file, dict(__file__=activate_this_file))
@ -32,7 +32,7 @@ def build_docs():
pip_install('michaeljones/breathe', '511b0887293e7c6b12310bb61b3659068f48f0f4')
# Build docs.
cmd = ['doxygen', '-']
p = Popen(cmd, stdin=PIPE, cwd=doc_dir)
p = Popen(cmd, stdin=PIPE)
p.communicate(input=r'''
PROJECT_NAME = C++ Format
GENERATE_LATEX = NO
@ -57,10 +57,10 @@ def build_docs():
if p.returncode != 0:
raise CalledProcessError(p.returncode, cmd)
check_call(['sphinx-build', '-D', 'breathe_projects.format=doxyxml',
'-b', 'html', '.', 'html'], cwd=doc_dir)
check_call(['lessc', '--clean-css', '--include-path=bootstrap', 'cppformat.less',
'html/_static/cppformat.css'], cwd=doc_dir)
return os.path.join(doc_dir, 'html')
'-b', 'html', doc_dir, 'html'])
#check_call(['lessc', '--clean-css', '--include-path=bootstrap', 'cppformat.less',
# 'html/_static/cppformat.css'], cwd=doc_dir)
return 'html'
if __name__ == '__main__':
build_docs()