From 2cd1a9384fdb6e310f2d21611b33589b5fd9ba65 Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Fri, 1 Jun 2018 09:38:03 -0400 Subject: [PATCH] [cmake] app4triqs version detection via git, some cleaning in conf.py.in --- CMakeLists.txt | 18 ++++++++++++------ doc/conf.py.in | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 552985bf..2347786f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,3 @@ -# Version number from the latest annotated git tag -execute_process(COMMAND git describe --abbrev=0 OUTPUT_VARIABLE APP4TRIQS_VERSION) - # Start configuration cmake_minimum_required(VERSION 2.8.12) project(app4triqs CXX) @@ -28,9 +25,18 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR (NOT IS_ABSOLUTE ${CMAKE_INSTA endif() message(STATUS "-------- INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX} --------") -# Fetch the git hash of app4triqs +# Use git to detect App4Triqs version and git hash +execute_process(COMMAND bash "-c" "${TRIQS_GIT_EXECUTABLE} describe | sed \"s/-\\([0-9]*\\)-.*/.\\1/g\"" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + OUTPUT_VARIABLE APP4TRIQS_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE +) +if(NOT APP4TRIQS_VERSION) + set(APP4TRIQS_VERSION 1.5) +endif() triqs_get_git_hash_of_source_dir(APP4TRIQS_GIT_HASH) -message(STATUS "app4triqs git hash: ${APP4TRIQS_GIT_HASH}") +MESSAGE(STATUS "app4triqs version : ${APP4TRIQS_VERSION}") +message(STATUS "Git hash: ${APP4TRIQS_GIT_HASH}") # Build and install the app4triqs library add_subdirectory(c++/app4triqs) @@ -65,6 +71,6 @@ if(BUILD_DEBIAN_PACKAGE) SET(CPACK_PACKAGE_VERSION ${APP4TRIQS_VERSION}) SET(CPACK_PACKAGE_CONTACT "https://github.com/TRIQS/app4triqs") EXECUTE_PROCESS(COMMAND dpkg --print-architecture OUTPUT_VARIABLE CMAKE_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE) - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.23), libgcc1 (>= 1:6), libstdc++6, python, libpython2.7, libopenmpi1.10, libhdf5-10, libgmp10, libfftw3-double3, libibverbs1, libgfortran3, zlib1g, libsz2, libhwloc5, libquadmath0, libaec0, libnuma1, libltdl7, libblas3, liblapack3, python-numpy, python-h5py, python-jinja2, python-mako, python-mpi4py, python-matplotlib, python-scipy, cpp2py (= ${APP4TRIQS_VERSION}), triqs (= ${APP4TRIQS_VERSION})") + SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.23), libgcc1 (>= 1:6), libstdc++6, python, libpython2.7, libopenmpi1.10, libhdf5-10, libgmp10, libfftw3-double3, libibverbs1, libgfortran3, zlib1g, libsz2, libhwloc5, libquadmath0, libaec0, libnuma1, libltdl7, libblas3, liblapack3, python-numpy, python-h5py, python-jinja2, python-mako, python-mpi4py, python-matplotlib, python-scipy, cpp2py (>= 1.5), triqs (>= 1.5)") INCLUDE(CPack) endif() diff --git a/doc/conf.py.in b/doc/conf.py.in index cc68de4d..195e871d 100644 --- a/doc/conf.py.in +++ b/doc/conf.py.in @@ -2,15 +2,25 @@ # # TRIQS documentation build configuration file +import sys +sys.path.insert(0, "@TRIQS_SPHINXEXT_PATH@/numpydoc") + extensions = ['sphinx.ext.autodoc', 'sphinx.ext.mathjax', 'sphinx.ext.intersphinx', + 'sphinx.ext.doctest', + 'sphinx.ext.todo', + 'sphinx.ext.viewcode', + 'sphinx.ext.autosummary', + 'plot_directive', + 'numpydoc', 'matplotlib.sphinxext.plot_directive'] source_suffix = '.rst' project = u'APP4TRIQS - An example triqs application' copyright = u'2018 - The TRIQS Developers' +version = '@APP4TRIQS_VERSION' mathjax_path = "@TRIQS_MATHJAX_PATH@/MathJax.js?config=default" templates_path = ['@CMAKE_SOURCE_DIR@/doc/_templates'] @@ -27,6 +37,6 @@ html_context = {'header_title': 'app4triqs', html_static_path = ['@CMAKE_SOURCE_DIR@/doc/_static'] html_sidebars = {'index': ['sideb.html', 'searchbox.html']} -htmlhelp_basename = 'TRIQSIntdoc' +htmlhelp_basename = 'APP4TRIQSdoc' -intersphinx_mapping = {'python': ('http://docs.python.org/2.7', None), 'triqslibs': ('https://triqs.ipht.cnrs.fr/unstable', None)} +intersphinx_mapping = {'python': ('http://docs.python.org/2.7', None), 'triqslibs': ('https://triqs.github.io/triqs', None)}