# Suggestion for changes in documentation of tutorial Step 2

**URL:** https://discourse.cmake.org/t/suggestion-for-changes-in-documentation-of-tutorial-step-2/14344
**Category:** Development
**Created:** [July 11, 2025, 9:09am UTC](https://discourse.cmake.org/t/suggestion-for-changes-in-documentation-of-tutorial-step-2/14344 "2025-07-11T09:09:35Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![scar027](https://discourse.cmake.org/user_avatar/discourse.cmake.org/scar027/32/5662_2.png) [@scar027](https://discourse.cmake.org/u/scar027)
#### Post date: [July 11, 2025, 9:09am UTC](https://discourse.cmake.org/t/suggestion-for-changes-in-documentation-of-tutorial-step-2/14344/1 "2025-07-11T09:09:35Z")

</div>

Hi,

I was recently following along the documentation for the tutorial and in [Step 2, Exercise 2](https://cmake.org/cmake/help/latest/guide/tutorial/Adding%20a%20Library.html#id6), I found this part rather confusing because of how it is put forth.

 ![step_2_ex_2](https://discourse.cmake.org/uploads/default/original/2X/7/704db59bb77760f4daedb2ef4a25c90771bc7251.png)  
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:

```auto
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](https://github.com/Kitware/CMake/blob/master/Help/guide/tutorial/Adding%20a%20Library.rst) if you guys agree.

---

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [July 11, 2025, 5:05pm UTC](https://discourse.cmake.org/t/suggestion-for-changes-in-documentation-of-tutorial-step-2/14344/2 "2025-07-11T17:05:49Z")

</div>

see [https://gitlab.kitware.com/cmake/cmake/-/issues/26914](https://gitlab.kitware.com/cmake/cmake/-/issues/26914)

and [https://gitlab.kitware.com/cmake/cmake/-/issues/26105](https://gitlab.kitware.com/cmake/cmake/-/issues/26105)

[all tutorial doc issues](https://gitlab.kitware.com/cmake/cmake/-/issues/?sort=updated_desc&state=opened&label_name%5B%5D=area%3Adoc&in=TITLE&search=tutorial&first_page_size=20)
