Commit Graph

23 Commits

Author SHA1 Message Date
Kitware Robot
0b96ae1f6a Revise C++ coding style using clang-format with "east const"
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`, now with "east const" enforcement.
Use `clang-format` version 18.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.

Issue: #26123
2025-01-23 13:09:50 -05:00
betsy.mcphail
a94a4c12e1 Tutorial: Fix-up typos and inconsistencies
* Fix typo in Step 2
* Fix incorrect code referenced in Step 3, TODO 7. Update comments in
MathFunctions/CMakeLists.txt to unique strings.
* Resolve inconsistencies between steps in MathFunctions/CMakeLists.txt
2023-09-07 10:57:19 -04:00
Markus Ferrell
e1f2b35723 Tutorial: Refactor MakeTable commands into MakeTable.cmake 2023-03-07 11:43:26 -05:00
Markus Ferrell
8ddf32196c Tutorial: Refactor MathFunctions code
Propagate the refactor in Step 10 MathFunctions through all of the
steps. Use MathFunctions/MathFunctions.cxx instead of Tutorial.cxx
to determine which sqrt library is called. Adds .h files which
correspond to their .cxx files by name.
2023-02-23 09:42:10 -05:00
Markus Ferrell
6e58a01f4e Tutorial: Update step 6 style 2022-10-25 11:54:05 -04:00
Markus Ferrell
92edbce342 Tutorial: Update step 5 style 2022-10-06 12:08:43 -04:00
Markus Ferrell
37fceb6fd3 Tutorial: Update step 4 style 2022-09-28 11:38:28 -04:00
Markus Ferrell
ccba87b05b Tutorial: Move step 10 to step 4
Shifts steps 4-9 to 5-10.
2022-08-08 17:15:48 -04:00
Markus Ferrell
6c77ccec51 Tutorial: Move step 8 to step 5. Shift steps 5-7 to 6-8. 2022-07-19 15:32:42 -04:00
Brad King
5c84eca210 Tutorial: Simplify logic checking for cmath functions
Since commit 07223c5c27 (Tutorial: Update Step 5 to work on Windows,
2020-02-18, v3.18.0-rc1~655^2) the logic does not work on non-Windows
platforms when cmake is re-run on an existing build tree.  It is also
more complicated than we'd like for a tutorial example.  Avoid the need
to consider the `m` library case by performing the check as C++.

Since `check_cxx_symbol_exists` cannot handle overloaded functions
like `exp` and `log`, check with `check_cxx_source_compiles` instead.
This also presents a more general-purpose example in the tutorial.

Fixes: #23524
2022-06-01 13:57:47 -04:00
Joseph Snyder
5a86ce5428 Tutorial: Step 4 improvements
Small changes to the text and CMake code for the fourth step of the
tutorial:

* Remove parameter from endfunction call
* Standardize on "binary directory" for test location
* Add additional information about a Release build.

Issue: #22663
2021-10-07 11:53:51 -04:00
Christophe Bernard
0f17b37b96 Tutorial: Fix regexps in sample CMakeLists.txt files
Replace original regexp `[-nan|nan|0]` with `(-nan|nan|0)`
which is what the author most likely intended to write in the
first place.
2021-09-30 08:55:41 -04:00
Brad King
dd62ee376e Tutorial: Restore MakeTable.cxx in step 6
In commit c754a3d4b7 (Tutorial: Remove MakeTable.cxx from Steps 5 and 6,
2020-04-23) it was incorrect to remove the file from step 6.  The
instructions for that step show the addition of a reference to it from
the `CMakeLists.txt` file.  Each step shows the addition of content to
lead to the next step, so removing the file from step 6 was an
off-by-one error.

Issue: #20618
2020-04-27 08:30:10 -04:00
Betsy McPhail
c754a3d4b7 Tutorial: Remove MakeTable.cxx from Steps 5 and 6
This file is not referenced until Step 6 and, therefore, should be added to
the source code at Step 7.

Fixes: #20618
2020-04-23 11:57:34 -04:00
Betsy McPhail
07223c5c27 Tutorial: Update Step 5 to work on Windows
`log` and `exp` should be found on Windows systems now, as expected.

Update tests to be more specific in looking for the expected outcome of
the tutorial.
2020-02-27 14:58:24 -05:00
Kitware Robot
ed98209ddc Revise include order using clang-format-6.0
Run the `clang-format.bash` script to update our C and C++ code to a new
include order `.clang-format`.  Use `clang-format` version 6.0.
2019-10-01 12:26:36 -04:00
Betsy McPhail
df9cdf629c Tutorial: Improve Step 5
* Updated output message
* Use 'target_compile_definitions' for HAVE_LOG and HAVE_EXP

Previously, the change from using TutorialConfig.h to
target_compile_definitions happened without explanation as part of Step 8.
2019-08-19 11:49:05 -04:00
Betsy McPhail
bc64401c3d Tutorial: Improve Step 3
* Move `option(USE_MYMATH...` to the same location in all CMakeLists files
2019-08-19 11:49:05 -04:00
Betsy McPhail
49ce4d6ff4 Tutorial: Improve Step 2
* Fix typo in #include
* Remove CMakeLists file that users should create
* Clarify which files users are expected to create
* Highlight the importance of configuring TutorialConfig.h.in after
  the MY_MATH option has been set
2019-08-19 11:49:05 -04:00
Betsy McPhail
82332f81bb Tutorial: Improve Step 1
* Update minimum required version to 3.10
* Use VERSION argument to project command rather than separate variables
* Replace `endif(USE_MYMATH)` with  more modern `endif()`
* Simplify the call to 'configure_file()'
* Add comments to tutorial.cxx to use as anchors in documentation
* Remove CMakeLists and TutorialConfig.h.in files that users should
  create. Consequently, remove Step1 from CMake tests.
2019-08-19 11:48:58 -04:00
Brad King
161b33f12b Help/guide/tutorial: Revert "require C++14 for the Tutorial"
Revert the changes from commit a2a90f41e3 (Tests: require C++14 for the
Tutorial, 2019-03-21, v3.15.0-rc1~41^2~2) for the content in its new
home.  In commit d50b31be35 (Clang: For MSVC ABI do not use modes older
than C++14, 2019-07-23) we fixed the C++ standard selection for GNU-like
Clang with the MSVC ABI so the test code itself no longer needs to do
it.  In particular, changing the tests in this way broke the tutorial's
narrative.
2019-07-24 08:04:20 -04:00
Betsy McPhail
eef3e020c2 Help: Populate tutorial guide text
Migrate tutorial text from individual `directions.txt` files to the main
tutorial document.  Add some comments to source code to provide anchors
for inclusion.
2019-06-19 08:57:12 -04:00
Kitware Robot
862cfc0e6c Help/guide/tutorial: Adopt tutorial code 2019-06-18 10:36:16 -04:00