# Doing a version of tutorial using zlib. Questions about provided CMakeLists.txt

**URL:** <https://discourse.cmake.org/t/doing-a-version-of-tutorial-using-zlib-questions-about-provided-cmakelists-txt/6329>\
**Category:** Code\
**Created:** [August 24, 2022, 1:27pm UTC](https://discourse.cmake.org/t/doing-a-version-of-tutorial-using-zlib-questions-about-provided-cmakelists-txt/6329 "2022-08-24T13:27:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![EricGT](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/e/f1d935/32.png) [@EricGT](https://discourse.cmake.org/u/EricGT)\
**Post date:** [August 24, 2022, 1:27pm UTC](https://discourse.cmake.org/t/doing-a-version-of-tutorial-using-zlib-questions-about-provided-cmakelists-txt/6329/1 "2022-08-24T13:27:59Z")

</div>

Having completed the [CMake tutorial](https://cmake.org/cmake/help/latest/guide/tutorial/index.html) decided to do it again but with a different dance partner, instead of a simple square root function will be using zlib ([Home page](https://zlib.net/), [GitHub](https://github.com/madler/zlib), [Wikipedia](https://en.wikipedia.org/wiki/Zlib))

The code on GitHub provides a [CMakeLists.txt](https://github.com/madler/zlib/blob/master/CMakeLists.txt).

Being a CMake newbie am not sure if the CMakeLists.txt can be improved.

One of the first questions that pops to mind is that

```auto
cmake_minimum_required(VERSION 2.4.4)

```

is at `2.4.4`.

That could be good or bad. Good in that it is low enough that other code including this in a build would not need to upgrade CMake, bad in that it is not requiring Modern CMake practices.

Feedback desired.

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)\
**Post date:** [August 24, 2022, 1:32pm UTC](https://discourse.cmake.org/t/doing-a-version-of-tutorial-using-zlib-questions-about-provided-cmakelists-txt/6329/2 "2022-08-24T13:32:43Z")

</div>

I would not use zlib as a paragon of CMake code (it’s not _horrible_, but it’s not something I’d use as a template either). If you look at some of [my PRs](https://github.com/madler/zlib/pulls/mathstuf), that can point you at where improvements can be made at least.
