diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 76cd4ba4d3..a088fb64c8 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -28,6 +28,7 @@ The following individuals and institutions are among the contributors: * `Eran Ifrah `_ * Esben Mose Hansen, Ange Optimization ApS * `Geoffrey Viola `_ +* `Georg Brandl `_ * `Google Inc `_ * Gregor Jasny * `Helio Chissini de Castro `_ diff --git a/Modules/CheckCSourceCompiles.cmake b/Modules/CheckCSourceCompiles.cmake index 83672060ea..4681ef0cee 100644 --- a/Modules/CheckCSourceCompiles.cmake +++ b/Modules/CheckCSourceCompiles.cmake @@ -77,7 +77,7 @@ and linked: include(CheckCSourceCompiles) - check_c_source_compiles(" + check_c_source_compiles([[ #include int main(void) { @@ -85,7 +85,7 @@ and linked: (void)a; return 0; } - " PROJECT_HAVE_SSE2_INTRINSICS) + ]] PROJECT_HAVE_SSE2_INTRINSICS) See Also ^^^^^^^^ diff --git a/Modules/CheckCSourceRuns.cmake b/Modules/CheckCSourceRuns.cmake index f1188a3c18..e4e27c311d 100644 --- a/Modules/CheckCSourceRuns.cmake +++ b/Modules/CheckCSourceRuns.cmake @@ -65,12 +65,12 @@ the check is stored in the internal cache variable ``HAVE_NORETURN``. include(CheckCSourceRuns) - check_c_source_runs(" + check_c_source_runs([[ #include #include noreturn void f(){ exit(0); } int main(void) { f(); return 1; } - " HAVE_NORETURN) + ]] HAVE_NORETURN) See Also ^^^^^^^^ diff --git a/Modules/CheckCXXSourceCompiles.cmake b/Modules/CheckCXXSourceCompiles.cmake index 2da6ef2a2b..134782ac7f 100644 --- a/Modules/CheckCXXSourceCompiles.cmake +++ b/Modules/CheckCXXSourceCompiles.cmake @@ -79,13 +79,13 @@ in the internal cache variable ``HAVE_CXX11_LAMBDAS``: include(CheckCXXSourceCompiles) - check_cxx_source_compiles(" + check_cxx_source_compiles([[ int main() { auto lambda = []() { return 42; }; return lambda(); } - " HAVE_CXX11_LAMBDAS) + ]] HAVE_CXX11_LAMBDAS) See Also ^^^^^^^^ diff --git a/Modules/CheckSourceCompiles.cmake b/Modules/CheckSourceCompiles.cmake index 96246da37d..7984296dab 100644 --- a/Modules/CheckSourceCompiles.cmake +++ b/Modules/CheckSourceCompiles.cmake @@ -111,13 +111,13 @@ result is stored in the internal cache variable ``HAVE_CXX11_LAMBDAS``: include(CheckSourceCompiles) - check_source_compiles(CXX " + check_source_compiles(CXX [[ int main() { auto lambda = []() { return 42; }; return lambda(); } - " HAVE_CXX11_LAMBDAS) + ]] HAVE_CXX11_LAMBDAS) Example: Checking Code With Bracket Argument """""""""""""""""""""""""""""""""""""""""""" @@ -179,7 +179,7 @@ checking whether the PostgreSQL ``PGVerbosity`` enum contains cmake_push_check_state(RESET) set(CMAKE_REQUIRED_LIBRARIES PostgreSQL::PostgreSQL) - check_source_compiles(C " + check_source_compiles(C [[ #include int main(void) { @@ -187,7 +187,7 @@ checking whether the PostgreSQL ``PGVerbosity`` enum contains (void)e; return 0; } - " HAVE_PQERRORS_SQLSTATE) + ]] HAVE_PQERRORS_SQLSTATE) cmake_pop_check_state() endif() diff --git a/Modules/CheckSourceRuns.cmake b/Modules/CheckSourceRuns.cmake index 0874a1f43e..97e1eb5074 100644 --- a/Modules/CheckSourceRuns.cmake +++ b/Modules/CheckSourceRuns.cmake @@ -96,12 +96,12 @@ the check is stored in the internal cache variable ``HAVE_NORETURN``. include(CheckSourceRuns) - check_source_runs(C " + check_source_runs(C [[ #include #include noreturn void f(){ exit(0); } int main(void) { f(); return 1; } - " HAVE_NORETURN) + ]] HAVE_NORETURN) Example: Checking Fortran Code """""""""""""""""""""""""""""" @@ -112,12 +112,12 @@ Checking if Fortran source code runs successfully: include(CheckSourceRuns) - check_source_runs(Fortran " + check_source_runs(Fortran [[ program test real :: x[*] call co_sum(x) end program - " HAVE_COARRAY) + ]] HAVE_COARRAY) Example: Checking C++ Code With Bracket Argument """""""""""""""""""""""""""""""""""""""""""""""" @@ -171,7 +171,7 @@ successfully and stores a boolean result in the internal cache variable set(CMAKE_REQUIRED_LIBRARIES gnu) endif() - check_source_runs(C " + check_source_runs(C [[ #include int main(void) { @@ -180,7 +180,7 @@ successfully and stores a boolean result in the internal cache variable } return 0; } - " HAVE_SCHED_GETCPU) + ]] HAVE_SCHED_GETCPU) cmake_pop_check_state() See Also diff --git a/Utilities/Sphinx/cmake.py b/Utilities/Sphinx/cmake.py index cfe114a355..483f2e75d6 100644 --- a/Utilities/Sphinx/cmake.py +++ b/Utilities/Sphinx/cmake.py @@ -62,6 +62,9 @@ from pygments.token import (Comment, Name, Number, Operator, Punctuation, # be present. CMakeLexer.tokens["root"] = [ + # [[string]] + (r'\[\[(?:\W[\w\W]*?)?\]\]', String.Multiline), + (r'\[(?P=+)\[[\w\W]*?\](?P=level)\]', String.Multiline), # fctn( (r'\b(\w+)([ \t]*)(\()', bygroups(Name.Function, Text, Name.Function), '#push'),