Skip to content
Snippets Groups Projects
Commit 8fb83e81 authored by Stefan's avatar Stefan
Browse files

Merge branch 'develop'

parents 9cce62c5 ef7fe681
Branches
Tags 0.1.0
No related merge requests found
Showing
with 2733 additions and 4 deletions
junk.py junk.py
stage/
\.AppleDouble
\.DS_Store
Changes in Release 0.1
--------------------------------------------------------------------------------
* initial setup of the CMake build system
* first idea of the documentation system
* meld included from SMNG as first module (to be modified/ renamed)
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Author: Stefan Bienert # Author: Bienchen
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Options to CMake:
# DISABLE_DOCUMENTATION: Don't build documentation, don't search for Sphinx
cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR) cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake_support)
project(PROMOD2) project(PROMOD3 CXX C)
set (PROMOD2_VERSION_MAJOR 0) include(PROMOD3)
set (PROMOD2_VERSION_MINOR 0)
set(PROMOD3_VERSION_MAJOR 0)
set(PROMOD3_VERSION_MINOR 1)
set(PROMOD3_VERSION_PATCH 0)
set(PROMOD3_VERSION_STRING ${PROMOD3_VERSION_MAJOR}.${PROMOD3_VERSION_MINOR}.${PROMOD3_VERSION_PATCH})
if (CMAKE_COMPILER_IS_GNUCXX)
exec_program(gcc ARGS --version OUTPUT_VARIABLE CMAKE_C_COMPILER_VERSION)
if(CMAKE_C_COMPILER_VERSION MATCHES ".*4\\.[5-9].*")
set(PROMOD_GCC_45 true)
else()
set(PROMOD_GCC_45 false)
endif()
endif()
if (OPTIMIZE)
set(CMAKE_BUILD_TYPE Release)
set(_OPT ON)
else()
set(CMAKE_BUILD_TYPE Debug)
set(_OPT OFF)
endif()
setup_stage()
file(MAKE_DIRECTORY ${STAGE_DIR}
${EXECUTABLE_OUTPUT_PATH}
${HEADER_STAGE_PATH}
${LIB_STAGE_PATH}
${LIBEXEC_STAGE_PATH})
setup_compiler_flags()
setup_boost()
find_package(Python 2.7 REQUIRED)
if(NOT DISABLE_DOCUMENTATION)
find_package(Sphinx ${PYTHON_VERSION} REQUIRED)
set(PYTHON_DOC_URL "http://docs.python.org/${PYTHON_VERSION}")
endif()
find_package(OPENSTRUCTURE 1.4 REQUIRED
COMPONENTS io mol seq seq_alg mol_alg conop)
if (CMAKE_COMPILER_IS_GNUCXX)
# do not write back into cache, otherwise the compile command line gets
# expanded with multiple -fno-strict-aliasing flags, triggering a complete
# rebuild whenever cmake is run
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-strict-aliasing")
if("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER "4.6")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes")
endif("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER "4.6")
endif()
# basic environment
include_directories(${Boost_INCLUDE_DIRS}
${OST_INCLUDE_DIR})
set(FILES_TO_BE_REMOVED ${PROJECT_BINARY_DIR}/stage)
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
"${FILES_TO_BE_REMOVED}")
## sub dirs to be recognised by CMake
## e.g. add_subdirectory(src), subdirs have thier own CMakeLists.txt
add_subdirectory(config)
add_subdirectory(core)
add_subdirectory(meld)
add_subdirectory(scripts)
add_subdirectory(doc)
## report setup
message(STATUS "PROMOD3 will be built with the following options:\n"
" OpenStructure (-DOST_ROOT) : ${OST_ROOT}\n"
" Optimized (-DOPTIMIZE) : ${_OPT}\n"
" Python : ${PYTHON_BINARY}\n")
This diff is collapsed.
#-------------------------------------------------------------------------------
# Check for OpenStructure Libraries
#
# OST_ROOT Prefix for OpenStructure libraries
# OST_MIN_VERSION minimal OPenStructure version required
#
# When OpenStructure is found, the result is placed in the following variables:
#
# OST_LIBRARIES is set to the library and linker flags used to
# link against python
# OST_VERSION is set to the version of OpenStructure
# OST_INCLUDE_DIR is set to the path that contains base.hh
#
# Author: Valerio Mariani, Marco Biasini
#-------------------------------------------------------------------------------
macro(find_OPENSTRUCTURE OST_ROOT NAMES HEADER_NAMES)
if (NOT OPENSTRUCTURE_FIND_COMPONENTS)
message(FATAL_ERROR "Please specify which modules of OpenStructure you "
"would like to use after the COMPONENTS keyword.")
endif()
list(APPEND OPENSTRUCTURE_FIND_COMPONENTS base geom)
list(REMOVE_DUPLICATES OPENSTRUCTURE_FIND_COMPONENTS)
foreach (LIB ${OPENSTRUCTURE_FIND_COMPONENTS})
set(FOUND_LIB FOUND_LIB-NOTFOUND)
find_library(FOUND_LIB
NAMES ost_${LIB}
HINTS "${PYTHON_ROOT}"
PATH ${OST_ROOT}
PATH_SUFFIXES lib lib64
NO_SYSTEM_ENVIRONMENT_PATH NO_DEFAULT_PATH
)
if (NOT FOUND_LIB)
if (OPENSTRUCTURE_FIND_REQUIRED)
message(FATAL_ERROR "Could not find library ost_${LIB}. Please specify"
" the location of your OpenStructure installation with"
" OST_ROOT")
endif()
else()
set(OST_LIBRARIES ${OST_LIBRARIES} ${FOUND_LIB})
endif()
endforeach()
find_path(OST_INCLUDE_DIR
NAMES "${HEADER_NAMES}"
HINTS "${OST_ROOT}/include"
NO_SYSTEM_ENVIRONMENT_PATH NO_DEFAULT_PATH
)
set(OPENSTRUCTURE_FOUND 1)
endmacro()
#-------------------------------------------------------------------------------
SET(LIBNAMES
ost_base
ost_gfx
ost_info
ost_qa
ost_conop
ost_gui
ost_io
ost_seq
ost_db
ost_img
ost_mol
ost_seq
ost_seq_alg
ost_geom
ost_img_alg
ost_mol_alg
)
find_OPENSTRUCTURE("${OST_ROOT}" "${LIBNAMES}" "ost/config.hh")
mark_as_advanced(
OST_LIBRARIES
OST_INCLUDE_DIR
OST_VERSION
)
if (OPENSTRUCTURE_FOUND)
if (NOT OPENSTRUCTURE_FIND_QUIETLY)
endif ()
else (OPENSTRUCTURE_FOUND)
if (OPENSTRUCTURE_FIND_REQUIRED)
message(FATAL_ERROR "Could not find OpenStructure")
endif ()
endif ()
\ No newline at end of file
#-------------------------------------------------------------------------------
# Check for Python Libraries
#
# PYTHON_IGNORE_FRAMEWORKS if set, do not check for python frameworks.
# has meaning on MacOS X only
# PYTHON_ROOT Prefix for python libraries
# PYTHON_MIN_VERSION minimal python version required
#
# When Python is found, the result is placed in the following variables:
#
# PYTHON_LIBRARIES is set to the library and linker flags used to
# link against python
# PYTHON_VERSION is set to the version of python
# PYTHON_INCLUDE_PATH is set to the path that contains Python.h
# PYTHON_BINARY is set to the path to the python executable
#
# Author: Marco Biasini
#-------------------------------------------------------------------------------
set(PYTHON_VERSIONS 2.7)
set(PYTHON_MIN_VERSION 2.7)
#-------------------------------------------------------------------------------
# check for python framework
# this macro honours the values of PYTHON_ROOT
#-------------------------------------------------------------------------------
macro(check_for_python_framework)
set(_FRAMEWORK_SEARCH_PATHS /Library/Frameworks/ /System/Library/Frameworks)
if(PYTHON_ROOT)
set(_FRAMEWORK_SEARCH_PATHS ${PYTHON_ROOT}/Library/Frameworks)
endif()
foreach(_PATH ${_FRAMEWORK_SEARCH_PATHS})
set(_FULL_FRAMEWORK_NAME "${_PATH}/Python.framework")
if(EXISTS ${_FULL_FRAMEWORK_NAME})
set(PYTHON_FRAMEWORK ON)
set(PYTHON_INCLUDE_PATH "${_FULL_FRAMEWORK_NAME}/Headers")
set(PYTHON_FRAMEWORK_PATH "${_FULL_FRAMEWORK_NAME}/Python")
endif()
endforeach()
endmacro()
macro(_find_python PYTHON_ROOT VERSION)
string(REPLACE "." "" _VERSION_NO_DOTS "${VERSION}")
if(PYTHON_ROOT)
find_library(PYTHON_LIBRARIES
NAMES "python${_VERSION_NO_DOTS}" "python${VERSION}"
HINTS "${PYTHON_ROOT}"
PATH_SUFFIXES lib libs
NO_SYSTEM_ENVIRONMENT_PATH NO_DEFAULT_PATH
)
find_path(PYTHON_INCLUDE_PATH
NAMES Python.h
HINTS "${PYTHON_ROOT}/include"
PATH_SUFFIXES include "python${_VERSION_NO_DOTS}" "python${VERSION}"
NO_SYSTEM_ENVIRONMENT_PATH NO_DEFAULT_PATH
)
else()
find_library(PYTHON_LIBRARIES
NAMES "python${_VERSION_NO_DOTS}" "python${VERSION}"
PATH_SUFFIXES lib
)
find_path(PYTHON_INCLUDE_PATH
NAMES Python.h
PATH_SUFFIXES include "python${_VERSION_NO_DOTS}" "python${VERSION}"
)
endif()
endmacro()
macro(_find_python_bin PYTHON_ROOT VERSION)
string(REPLACE "." "" _VERSION_NO_DOTS "${VERSION}")
if(PYTHON_ROOT)
find_program(PYTHON_BINARY
NAMES "python${_VERSION_NO_DOTS}" "python${VERSION}" python.exe
HINTS "${PYTHON_ROOT}"
PATH_SUFFIXES bin
NO_SYSTEM_ENVIRONMENT_PATH NO_DEFAULT_PATH
)
else()
find_program(PYTHON_BINARY
NAMES "python${_VERSION_NO_DOTS}" "python${VERSION}"
HINTS "${CMAKE_PREFIX_PATH}"
PATH_SUFFIXES bin
)
endif()
endmacro()
#-------------------------------------------------------------------------------
# check for python lib
#
# this macro honours the values of PYTHON_ROOT and PYTHON_VERSION
#-------------------------------------------------------------------------------
macro(check_for_python_lib)
if(PYTHON_VERSION)
_find_python("${PYTHON_ROOT}" "${PYTHON_VERSION}")
else()
foreach(_VERSION ${PYTHON_VERSIONS})
if((${PYTHON_MIN_VERSION} VERSION_LESS ${_VERSION}) OR
(${PYTHON_MIN_VERSION} VERSION_EQUAL ${_VERSION}))
_find_python("${PYTHON_ROOT}" "${_VERSION}")
if(PYTHON_LIBRARIES)
set(PYTHON_VERSION "${_VERSION}")
break()
endif()
endif()
endforeach()
endif()
# fallback to non-versioned naming scheme
if (NOT $PYTHON_LIBRARIES)
_find_python("${PYTHON_ROOT}" "")
endif()
endmacro()
macro(check_for_python_binary)
if(PYTHON_VERSION)
_find_python_bin("${PYTHON_ROOT}" "${PYTHON_VERSION}")
else()
foreach(_VERSION ${PYTHON_VERSIONS})
if((${PYTHON_MIN_VERSION} VERSION_LESS ${_VERSION}) OR
(${PYTHON_MIN_VERSION} VERSION_EQUAL ${_VERSION}))
_find_python_bin("${PYTHON_ROOT}" "${_VERSION}")
if(PYTHON_BINARY)
set(PYTHON_VERSION "${_VERSION}")
# disallow all versions except for the one we just found. This makes
# sure we don't mismatch the python binary and the libraries.
set(PYTHON_VERSIONS "${_VERSION}")
break()
endif()
endif()
endforeach()
endif()
if (NOT PYTHON_BINARY)
_find_python("${PYTHON_ROOT}" "")
endif()
endmacro()
if(NOT PYTHON_ROOT)
if(WIN32)
set(PYTHON_ROOT "${CMAKE_PREFIX_PATH}")
else()
set(PYTHON_ROOT "/usr")
endif()
endif()
if(APPLE AND NOT PYTHON_IGNORE_FRAMEWORKS)
check_for_python_framework()
endif()
# first check for python binary.
check_for_python_binary()
if(NOT PYTHON_FRAMEWORK_FOUND)
check_for_python_lib()
endif()
mark_as_advanced(
PYTHON_LIBRARIES
PYTHON_INCLUDE_PATH
PYTHON_VERSION
PYTHON_BINARY
)
if(PYTHON_LIBRARIES)
if(PYTHON_FRAMEWORK)
set(PYTHON_LIBRARIES "${PYTHON_FRAMEWORK_PATH}"
CACHE FILEPATH "Python Libraries" FORCE)
else()
set(PYTHON_LIBRARIES "${PYTHON_LIBRARIES}"
CACHE FILEPATH "Python Libraries" FORCE)
endif()
set(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_PATH}"
CACHE FILEPATH "Python Include Path" FORCE)
endif()
if (PYTHON_BINARY)
set(PYTHON_VERSION "${PYTHON_VERSION}"
CACHE STRING "Python Version" FORCE)
set(PYTHON_BINARY "${PYTHON_BINARY}"
CACHE FILEPATH "Python Binary" FORCE)
endif()
#-------------------------------------------------------------------------------
# Check for Sphinx binary
#
# SPHINX_BINARY is set to the path to the sphinx-build executable,
# preferably sphinx-build-${Sphinx_FIND_VERSION} if
# provided. Also admires PYTHON_ROOT if available.
#
# Author: Bienchen
#-------------------------------------------------------------------------------
if(Sphinx_FIND_VERSION)
set(ADD_SPHINX_NAMES "sphinx-build-${Sphinx_FIND_VERSION}")
endif()
if(PYTHON_ROOT)
find_program(SPHINX_BINARY NAMES sphinx-build ${ADD_SPHINX_NAMES}
HINTS ${PYTHON_ROOT}
PATH_SUFFIXES bin
DOC "Sphinx documentation generator"
)
else()
find_program(SPHINX_BINARY NAMES sphinx-build ${ADD_SPHINX_NAMES}
PATH_SUFFIXES bin
DOC "Sphinx documentation generator"
)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Sphinx DEFAULT_MSG
SPHINX_BINARY
)
mark_as_advanced(
SPHINX_BINARY
)
This diff is collapsed.
configure_file(${INPUT_FILE} ${OUT_FILE} @ONLY)
\ No newline at end of file
#!/bin/sh
# This script is aware of out-of-source builds. Just call it from within the
# build directory.
function usage
{
echo 'usage:'
echo ' fedora-19-conf <OST_ROOT> [OPTIONS]'
echo ' OST_ROOT is the staging directory of OST.'
echo ' Valid options are anything that CMake accepts.'
exit
}
NUM_PARAMS=$#
if [[ "$NUM_PARAMS" -lt "1" ]] ; then
echo 'You must specify the location of promod3 and OST (in that order).';
usage
fi
OST_ROOT=$(cd $1; pwd)
shift
PROMOD3_SRC=$(cd `dirname $0`; pwd)
PROMOD3_SRC=${PROMOD3_SRC}/..
cmake $PROMOD3_SRC -DOST_ROOT=$OST_ROOT \
-DBOOST_ROOT=/import/bc2/soft/app/boost/1.47.0/Linux/ \
-DPYTHON_ROOT=/import/bc2/soft/app/Python/2.7.5/Linux \
$@
## Emacs magic
# Local Variables:
# mode: shell-script
# End:
# LocalWords: OSX MacPorts uname SRC OST promod CMake NUM PARAMS lt fi cd
# LocalWords: pwd dirname cmake DPYTHON DBOOST conf
#!/bin/sh
# To find out your version of Fedora, run 'cat /etc/issue'.
# This script is aware of out-of-source builds. Just call it from within the
# build directory.
function usage
{
echo 'usage:'
echo ' fedora-19-conf <OST_ROOT> [OPTIONS]'
echo ' OST_ROOT is the staging directory of OST.'
echo ' Valid options are anything that CMake accepts.'
exit
}
NUM_PARAMS=$#
if [[ "$NUM_PARAMS" -lt "1" ]] ; then
echo 'You must specify the location of promod3 and OST (in that order).';
usage
fi
OST_ROOT=$(cd $1; pwd)
shift
PROMOD3_SRC=$(cd `dirname $0`; pwd)
PROMOD3_SRC=${PROMOD3_SRC}/..
cmake $PROMOD3_SRC -DOST_ROOT=$OST_ROOT \
-DPYTHON_ROOT=/usr \
$@
## Emacs magic
# Local Variables:
# mode: shell-script
# End:
# LocalWords: OSX MacPorts uname SRC OST promod CMake NUM PARAMS lt fi cd
# LocalWords: pwd dirname cmake DPYTHON DBOOST conf
#!/bin/sh
# For OSX we assume that all missing dependencies are built with MacPorts
# and are located in '/opt/local'.
# To find out your version of OSX, run 'uname -r'.
# This script is aware of out-of-source builds. Just call it from within the
# build directory.
function usage
{
echo 'usage:'
echo ' osx-11.4.2-conf <OST_ROOT> [OPTIONS]'
echo ' OST_ROOT is the staging directory of OST.'
echo ' Valid options are anything that CMake accepts.'
exit
}
NUM_PARAMS=$#
if [[ "$NUM_PARAMS" -lt "1" ]] ; then
echo 'You must specify the location of promod3 and OST (in that order).';
usage
fi
OST_ROOT=$(cd $1; pwd)
shift
PROMOD3_SRC=$(cd `dirname $0`; pwd)
PROMOD3_SRC=${PROMOD3_SRC}/..
cmake $PROMOD3_SRC -DOST_ROOT=$OST_ROOT \
-DPYTHON_ROOT=/opt/local \
-DBOOST_ROOT=/opt/local \
-DPYTHON_INCLUDE_PATH=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/ \
-DPYTHON_LIBRARIES=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib \
$@
## Emacs magic
# Local Variables:
# mode: shell-script
# End:
# LocalWords: OSX MacPorts uname SRC OST promod CMake NUM PARAMS lt fi cd
# LocalWords: pwd dirname cmake DPYTHON DBOOST
add_subdirectory(src)
# if we need more than one configurational header, add path in front of every
# file via loop!
set(CONFIG_HH_FILE "config.hh")
configure_file(config.hh.in ${CONFIG_HH_FILE})
add_custom_target(config_header ALL)
copy_if_different("${CMAKE_CURRENT_BINARY_DIR}" "${HEADER_STAGE_PATH}/promod3"
"${CONFIG_HH_FILE}" "config_headers" config_header)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_HH_FILE} DESTINATION "include/promod3/")
#ifndef PROMOD3_CONFIG_HH
#define PROMOD3_CONFIG_HH
/*
DO NOT EDIT the '.hh' file, it is processed from a template '.hh.in' by CMake.
*/
/* fetch version from top level CMakeLists.txt */
#define PROMOD3_VERSION_MAJOR @PROMOD3_VERSION_MAJOR@
#define PROMOD3_VERSION_MINOR @PROMOD3_VERSION_MINOR@
#define PROMOD3_VERSION_STRING "@PROMOD3_VERSION_STRING@"
#endif
add_subdirectory(pymod)
set(PROMOD3_CORE_FILES __init__.py)
pymod(NAME core PY ${PROMOD3_CORE_FILES} OUTPUT_DIR "promod3")
# preparing sphinx build
# - setup directories: sources go to BUILD/doc/source
# - every module gets its own directory
# - rst files are copied to this spot
# - compiled documentation goes to STAGE/share/promod3
# set up commands for the rst source files
# take care of Sphinx config, conf.py; will be created from conf.py.in since
# some values from CMake have to be substituted
set(_RST_DEPS)
set(_RST_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/source")
file(MAKE_DIRECTORY ${_RST_SOURCE_DIR})
set(_SPHINX_CONF_PY "${_RST_SOURCE_DIR}/conf.py")
set(_SPHINX_CONF_SUBST_DICT PROMOD3_VERSION_MAJOR="${PROMOD3_VERSION_MAJOR}"
PROMOD3_VERSION_MINOR="${PROMOD3_VERSION_MINOR}"
PROMOD3_VERSION_PATCH="${PROMOD3_VERSION_PATCH}"
PYTHON_DOC_URL="${PYTHON_DOC_URL}")
set(_CONF_SUBST_DICT -DINPUT_FILE=${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in -DOUT_FILE=${_SPHINX_CONF_PY})
foreach(_subst ${_SPHINX_CONF_SUBST_DICT})
list(APPEND _CONF_SUBST_DICT -D${_subst})
endforeach()
message(STATUS "FOO ${CMAKE_COMMAND} ${_CONF_SUBST_DICT} -P ${CMAKE_SOURCE_DIR}/cmake_support/substitute.cmake")
add_custom_command(OUTPUT ${_SPHINX_CONF_PY}
MAIN_DEPENDENCY "${CMAKE_SOURCE_DIR}/CMakeLists.txt"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in"
COMMAND ${CMAKE_COMMAND} ${_CONF_SUBST_DICT}
-P ${CMAKE_SOURCE_DIR}/cmake_support/substitute.cmake)
# we need to copy index.rst from the doc dir, to have everything together in
# the build dir as 'source'; conf.py may stay where it is, may be pulled by '-c'
set(_SPHINX_INDEX_RST "${_RST_SOURCE_DIR}/index.rst")
add_custom_command(OUTPUT "${_SPHINX_INDEX_RST}"
MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/index.rst"
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/index.rst" ${_SPHINX_INDEX_RST})
set(_RST_DEPS ${_RST_DEPS} ${_SPHINX_INDEX_RST})
# iterate list of ALL modules registered by pymod()/ add_doc_source()
foreach(mod ${PM3_MODULES})
# only modules with dedicated rst files are considered for documentation, so
# we check if a list PM3_RST_{module name} exists (filled by add_doc_source()
if(DEFINED PM3_RST_${mod})
# this is a list of rst files, of which everyone becomes a Make target
foreach(rst ${PM3_RST_${mod}})
# the list come swith full path, the targets point towards the build dir
# so we need to extract the filename
get_filename_component(rst_name ${rst} NAME)
set(_RST_SOURCE_MOD_DIR "${_RST_SOURCE_DIR}/${mod}")
# create directory, since it does not come with any CMake file, it will
# not be created by CMake
file(MAKE_DIRECTORY ${_RST_SOURCE_MOD_DIR})
set(_RST_OUTPUT "${_RST_SOURCE_MOD_DIR}/${rst_name}")
add_custom_command(OUTPUT "${_RST_OUTPUT}"
MAIN_DEPENDENCY "${rst}"
DEPENDS ${PM3_DOC_DEPS_${mod}}
COMMAND ${CMAKE_COMMAND} -E copy ${rst} ${_RST_OUTPUT})
# we need a list of dependencies to create the effective targets, since
# in our custom_commands we are dealing with file targets
set(_RST_DEPS ${_RST_DEPS} ${_RST_OUTPUT})
endforeach()
endif()
endforeach()
# create targets for sphinx
# for the html target, we make everything depend on index.html
set(_SPHINX_HTML_DIR "${SHARED_DATA_PATH}/html")
file(MAKE_DIRECTORY ${_SPHINX_HTML_DIR})
set(_SPHINX_INDEX_HTML "${_SPHINX_HTML_DIR}/index.html")
add_custom_command(OUTPUT ${_SPHINX_INDEX_HTML}
MAIN_DEPENDENCY "${_SPHINX_CONF_PY}"
DEPENDS ${_RST_DEPS}
COMMAND ${SPHINX_BINARY} -b html -c "${_RST_SOURCE_DIR}" "${_RST_SOURCE_DIR}" "${_SPHINX_HTML_DIR}")
add_custom_target(html DEPENDS ${_SPHINX_INDEX_HTML})
# man target
set(_SPHINX_MAN_DIR "${SHARED_DATA_PATH}/man")
file(MAKE_DIRECTORY ${_SPHINX_MAN_DIR})
set(_SPHINX_MAN "${_SPHINX_MAN_DIR}/promod3.1")
add_custom_command(OUTPUT ${_SPHINX_MAN}
MAIN_DEPENDENCY "${_SPHINX_CONF_PY}"
DEPENDS ${_RST_DEPS}
COMMAND ${SPHINX_BINARY} -b man -c "${_RST_SOURCE_DIR}" "${_RST_SOURCE_DIR}" "${_SPHINX_MAN_DIR}")
add_custom_target(man DEPENDS ${_SPHINX_MAN})
# doc target, registered with all
add_custom_target(doc ALL)
add_dependencies(doc html)
add_dependencies(doc man)
# installing: Since shared data goes to our own sub directory, it is assumed
# save to just copy over whole directories. This saves us from
# keeping track of all output files of a html doc tree
# We install FROM the stage dir tree, since Sphinx will build the
# documentation right there.
# install html documentation
install(DIRECTORY ${_SPHINX_HTML_DIR} DESTINATION "share/promod3")
# install man pages
install(DIRECTORY ${_SPHINX_MAN_DIR} DESTINATION "share/promod3")
# doctest & linkcheck goes into check, once its created
# what about extratcting stuff from code?
# -*- coding: utf-8 -*-
#
# DO NOT EDIT conf.py! GO FOR conf.py.in, THERE IS VARIABLE SUBSTITUTION
# INVOLVED
#
# ProMod3 documentation build configuration file, originally created by
# sphinx-quickstart on Thu Oct 10 23:17:00 2013, then modified.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General configuration -----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.pngmath', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'ProMod3'
copyright = u'2013, Bienchen'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '@PROMOD3_VERSION_MAJOR@.@PROMOD3_VERSION_MINOR@'
# The full version, including alpha/beta/rc tags.
release = '@PROMOD3_VERSION_PATCH@'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
today_fmt = '%B %d %H:%M, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = []
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = list()
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
html_last_updated_fmt = '%b %d %H:%M, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'ProMod3doc'
# -- Options for LaTeX output --------------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'ProMod3.tex', u'ProMod3 Documentation',
u'Bienchen', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_domain_indices = True
# -- Options for manual page output --------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'promod3', u'ProMod3 Documentation',
[u'Bienchen'], 1)
]
# If true, show URL addresses after external links.
#man_show_urls = False
# -- Options for Texinfo output ------------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'ProMod3', u'ProMod3 Documentation',
u'Bienchen', 'ProMod3', 'One line description of project.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
#texinfo_appendices = []
# If false, no module index is generated.
#texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'python': ('@PYTHON_DOC_URL@', None)}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment