Skip to content

Commit

Permalink
Fix out-of-tree documentation build (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Jun 22, 2015
1 parent a0ed6bf commit dd6a3bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions doc/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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
Expand All @@ -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()

0 comments on commit dd6a3bb

Please sign in to comment.