diff options
Diffstat (limited to 'Utilities')
-rw-r--r-- | Utilities/Doxygen/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Utilities/Release/create-cmake-release.cmake | 2 | ||||
-rw-r--r-- | Utilities/Release/linux64_release.cmake | 6 | ||||
-rw-r--r-- | Utilities/Release/upload_release.cmake | 2 | ||||
-rw-r--r-- | Utilities/Sphinx/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Utilities/Sphinx/cmake.py | 53 | ||||
-rw-r--r-- | Utilities/Sphinx/colors.py | 29 | ||||
-rw-r--r-- | Utilities/Sphinx/conf.py.in | 1 |
8 files changed, 84 insertions, 13 deletions
diff --git a/Utilities/Doxygen/CMakeLists.txt b/Utilities/Doxygen/CMakeLists.txt index 6a90c84..2cdd767 100644 --- a/Utilities/Doxygen/CMakeLists.txt +++ b/Utilities/Doxygen/CMakeLists.txt @@ -3,7 +3,7 @@ if(NOT CMake_SOURCE_DIR) set(CMakeDeveloperReference_STANDALONE 1) - cmake_minimum_required(VERSION 3.1 FATAL_ERROR) + cmake_minimum_required(VERSION 3.1...3.12 FATAL_ERROR) get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH) get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH) include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake) diff --git a/Utilities/Release/create-cmake-release.cmake b/Utilities/Release/create-cmake-release.cmake index 3af1b03..b3cc352 100644 --- a/Utilities/Release/create-cmake-release.cmake +++ b/Utilities/Release/create-cmake-release.cmake @@ -54,7 +54,7 @@ cd \${name}-build && -DCMAKE_INSTALL_PREFIX=\"\$inst/\" \\ -DCMAKE_DOC_DIR=doc/cmake \\ -DSPHINX_EXECUTABLE=\"${SPHINX_EXECUTABLE}\" \\ - -DSPHINX_HTML=ON -DSPHINX_MAN=ON && + -DSPHINX_HTML=ON -DSPHINX_MAN=ON -DSPHINX_QTHELP=ON && make install && cd .. && tar czf \${name}.tar.gz \${name} || diff --git a/Utilities/Release/linux64_release.cmake b/Utilities/Release/linux64_release.cmake index dc34120..fa585d7 100644 --- a/Utilities/Release/linux64_release.cmake +++ b/Utilities/Release/linux64_release.cmake @@ -29,9 +29,9 @@ CURSES_LIBRARY:FILEPATH=/home/kitware/ncurses-5.9/lib/libncurses.a CURSES_INCLUDE_PATH:PATH=/home/kitware/ncurses-5.9/include FORM_LIBRARY:FILEPATH=/home/kitware/ncurses-5.9/lib/libform.a CMAKE_USE_OPENSSL:BOOL=ON -OPENSSL_CRYPTO_LIBRARY:STRING=/home/kitware/openssl-1.1.0h/lib/libcrypto.a;-pthread -OPENSSL_INCLUDE_DIR:PATH=/home/kitware/openssl-1.1.0h/include -OPENSSL_SSL_LIBRARY:FILEPATH=/home/kitware/openssl-1.1.0h/lib/libssl.a +OPENSSL_CRYPTO_LIBRARY:STRING=/home/kitware/openssl-1.1.1/lib/libcrypto.a;-pthread +OPENSSL_INCLUDE_DIR:PATH=/home/kitware/openssl-1.1.1/include +OPENSSL_SSL_LIBRARY:FILEPATH=/home/kitware/openssl-1.1.1/lib/libssl.a PYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 CPACK_SYSTEM_NAME:STRING=Linux-x86_64 BUILD_CursesDialog:BOOL=ON diff --git a/Utilities/Release/upload_release.cmake b/Utilities/Release/upload_release.cmake index 1edcd65..bbc7437 100644 --- a/Utilities/Release/upload_release.cmake +++ b/Utilities/Release/upload_release.cmake @@ -1,6 +1,6 @@ set(CTEST_RUN_CURRENT_SCRIPT 0) if(NOT VERSION) - set(VERSION 3.12) + set(VERSION 3.13) endif() if(NOT DEFINED PROJECT_PREFIX) set(PROJECT_PREFIX cmake-${VERSION}) diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt index 1cbc463..15204d6 100644 --- a/Utilities/Sphinx/CMakeLists.txt +++ b/Utilities/Sphinx/CMakeLists.txt @@ -3,7 +3,7 @@ if(NOT CMake_SOURCE_DIR) set(CMakeHelp_STANDALONE 1) - cmake_minimum_required(VERSION 3.1 FATAL_ERROR) + cmake_minimum_required(VERSION 3.1...3.12 FATAL_ERROR) get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH) get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH) include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake) diff --git a/Utilities/Sphinx/cmake.py b/Utilities/Sphinx/cmake.py index ebf44da..882cdc1 100644 --- a/Utilities/Sphinx/cmake.py +++ b/Utilities/Sphinx/cmake.py @@ -4,14 +4,55 @@ import os import re -# Monkey patch for pygments reporting an error when generator expressions are -# used. -# https://bitbucket.org/birkenfeld/pygments-main/issue/942/cmake-generator-expressions-not-handled +# Override much of pygments' CMakeLexer. +# We need to parse CMake syntax definitions, not CMake code. + +# For hard test cases that use much of the syntax below, see +# - module/FindPkgConfig.html (with "glib-2.0>=2.10 gtk+-2.0" and similar) +# - module/ExternalProject.html (with http:// https:// git@; also has command options -E --build) +# - manual/cmake-buildsystem.7.html (with nested $<..>; relative and absolute paths, "::") + from pygments.lexers import CMakeLexer -from pygments.token import Name, Operator +from pygments.token import Name, Operator, Punctuation, String, Text, Comment, Generic, Whitespace, Number from pygments.lexer import bygroups -CMakeLexer.tokens["args"].append(('(\\$<)(.+?)(>)', - bygroups(Operator, Name.Variable, Operator))) + +# Notes on regular expressions below: +# - [\.\+-] are needed for string constants like gtk+-2.0 +# - Unix paths are recognized by '/'; support for Windows paths may be added if needed +# - (\\.) allows for \-escapes (used in manual/cmake-language.7) +# - $<..$<..$>..> nested occurence in cmake-buildsystem + +CMakeLexer.tokens["root"] = [ + (r'\b(\w+)([ \t]*)(\()', bygroups(Name.Function, Text, Name.Function), '#push'), # fctn( + (r'\(', Name.Function, '#push'), + (r'\)', Name.Function, '#pop'), + (r'\[', Punctuation, '#push'), + (r'\]', Punctuation, '#pop'), + (r'[|;,.=*\-]', Punctuation), + (r'\\\\', Punctuation), # used in commands/source_group + (r'[:]', Operator), + (r'[<>]=', Punctuation), # used in FindPkgConfig.cmake + (r'\$<', Operator, '#push'), # $<...> + (r'<[^<|]+?>(\w*\.\.\.)?', Name.Variable), # <expr> + (r'(\$\w*\{)(.+?)(\})', bygroups(Operator, Name.Tag, Operator)), # ${..} $ENV{..} + (r'([A-Z]+\{)(.+?)(\})', bygroups(Operator, Name.Tag, Operator)), # DATA{ ...} + (r'[a-z]+(@|(://))((\\.)|[\w.+-:/\\])+', Name.Attribute), # URL, git@, ... + (r'/\w[\w\.\+-/\\]*', Name.Attribute), # absolute path + (r'/', Name.Attribute), + (r'\w[\w\.\+-]*/[\w.+-/\\]*', Name.Attribute), # relative path + (r'[A-Z]((\\.)|[\w.+-])*[a-z]((\\.)|[\w.+-])*', Name.Builtin), # initial A-Z, contains a-z + (r'@?[A-Z][A-Z0-9_]*', Name.Constant), + (r'[a-z_]((\\;)|(\\ )|[\w.+-])*', Name.Builtin), + (r'[0-9][0-9\.]*', Number), + (r'(?s)"(\\"|[^"])*"', String), # "string" + (r'\.\.\.', Name.Variable), + (r'<', Operator, '#push'), # <..|..> is different from <expr> + (r'>', Operator, '#pop'), + (r'\n', Whitespace), + (r'[ \t]+', Whitespace), + (r'#.*\n', Comment), + # (r'[^<>\])\}\|$"# \t\n]+', Name.Exception), # fallback, for debugging only +] # Monkey patch for sphinx generating invalid content for qcollectiongenerator # https://bitbucket.org/birkenfeld/sphinx/issue/1435/qthelp-builder-should-htmlescape-keywords diff --git a/Utilities/Sphinx/colors.py b/Utilities/Sphinx/colors.py new file mode 100644 index 0000000..f98a483 --- /dev/null +++ b/Utilities/Sphinx/colors.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- + +from pygments.style import Style +from pygments.token import Name, Comment, String, Number, Operator, Whitespace + +class CMakeTemplateStyle(Style): + """ + for more token names, see pygments/styles.default + """ + + background_color = "#f8f8f8" + default_style = "" + + styles = { + Whitespace: "#bbbbbb", + Comment: "italic #408080", + Operator: "bold #000000", + String: "#217A21", + Number: "#105030", + Name.Builtin: "#400080", # anything lowercase + Name.Function: "bold #1010A0", # function + Name.Variable: "#1080B0", # <..> + Name.Tag: "#19177C", # ${..} + Name.Constant: "#6020E0", # uppercase only + Name.Entity: "italic #70A020", # @..@ + Name.Attribute: "#906060", # paths, URLs + Name.Label: "#A0A000", # anything left over + Name.Exception: "bold #FF0000", # for debugging only + } diff --git a/Utilities/Sphinx/conf.py.in b/Utilities/Sphinx/conf.py.in index f52ccd1..70ba080 100644 --- a/Utilities/Sphinx/conf.py.in +++ b/Utilities/Sphinx/conf.py.in @@ -15,6 +15,7 @@ project = 'CMake' copyright = '@conf_copyright@' version = '@conf_version@' # feature version release = '@conf_release@' # full version string +pygments_style = 'colors.CMakeTemplateStyle' primary_domain = 'cmake' highlight_language = 'none' |