Suggestion for changes in documentation of tutorial Step 2

Hi,

I was recently following along the documentation for the tutorial and in Step 2, Exercise 2, I found this part rather confusing because of how it is put forth.


There are a couple of issues that I have with this.

  1. Firstly, the TODO 6 is misleading as it is not a part of this step.
  2. Secondly, the second last line in the first code block i.e target_link_libraries(MathFunctions PRIVATE SqrtLibrary) is actually a part of the following TODO13 which adds to the confusion.

I feel it would be better if the code block for TODO12 only contained the lines:

add_library(SqrtLibrary STATIC
            mysqrt.cxx
            )

with a mention in the text above it that it needs to be inserted in the if (USE_MYMATH) ... endif() block.
A similar mention would also make things clearer for TODO13 since it also needs to be inserted in the same block.

I would like to open a pull request for this with changes in the Adding a library.rst if you guys agree.

see https://gitlab.kitware.com/cmake/cmake/-/issues/26914

and https://gitlab.kitware.com/cmake/cmake/-/issues/26105

all tutorial doc issues

1 Like