Skip to content

Commit

Permalink
WIP cmake script to generate HTML doc
Browse files Browse the repository at this point in the history
  • Loading branch information
baylej committed Feb 5, 2019
1 parent dc32af8 commit 27c60f4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ set(BUILD_VERSION "${PROJECT_VERSION}")
option(WANT_ZLIB "use zlib (ability to decompress layers data) ?" on)
option(BUILD_SHARED_LIBS "Build shared libraries (dll / so)" off)

add_subdirectory(doc)

#-----------#
# Env
#-----------#
Expand Down
10 changes: 8 additions & 2 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,21 @@ option(DOC_HTML "Build html help with Sphinx" Off)
option(DOC_SINGLEHTML "Build html single page help with Sphinx" Off)
find_program(SPHINX_EXECUTABLE NAMES sphinx-build DOC "Sphinx Documentation Builder (sphinx-doc.org)")

set(HTML_THEME "default" CACHE STRING "HTML Theme to use eg: sphinx_rtd_theme")
mark_as_advanced(HTML_THEME)
set(DOC_HTML_THEME "default" CACHE STRING "HTML Theme to use eg: sphinx_rtd_theme")
mark_as_advanced(DOC_HTML_THEME)
set(DOC_CODESTYLE "sphinx" CACHE STRING "The name of the Pygments (syntax highlighting) style to use")
mark_as_advanced(DOC_CODESTYLE)

if(NOT DOC_HTML AND NOT DOC_SINGLEHTML)
return()
elseif(NOT SPHINX_EXECUTABLE)
message(FATAL_ERROR "SPHINX_EXECUTABLE (sphinx-build) is not found!")
endif()

set(DOC_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
set(DOC_RELEASE "${PROJECT_VERSION}")
string(TIMESTAMP DOC_COPYRIGHT "2019-%Y, libTMX documentation authors" UTC)

configure_file(conf.py.in conf.py @ONLY)

# -- BUILD --
Expand Down
18 changes: 5 additions & 13 deletions doc/conf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,11 @@ source_suffix = '.rst'
master_doc = 'index'

project = u'libTMX'
copyright = u'2018, baylej'
author = u'baylej'
version = '1.1'
release = '1.1.0'
copyright = u'@DOC_COPYRIGHT@'
version = '@DOC_VERSION@'
release = '@DOC_RELEASE@'

language = None

exclude_patterns = ['build']

pygments_style = 'sphinx'

pygments_style = '@DOC_CODESTYLE@'
todo_include_todos = False

html_theme = '@HTML_THEME@'
html_static_path = ['_static']
htmlhelp_basename = 'libTMXdoc'
html_theme = '@DOC_HTML_THEME@'

0 comments on commit 27c60f4

Please sign in to comment.