> For the complete documentation index, see [llms.txt](https://wiki.hanzheteng.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.hanzheteng.com/development/cmake.md).

# CMake

#### References

* [CMake Documentation](https://cmake.org/cmake/help/latest/index.html) (official, latest, top-level)
* [CMake Tutorial](https://cmake.org/cmake/help/latest/guide/tutorial/index.html) (official, latest)
* [CMake Practice](https://github.com/Akagi201/learning-cmake/blob/master/docs/cmake-practice.pdf) (tutorial from users)
* [CMake 3.0.2 Documentation](https://cmake.org/cmake/help/v3.0/index.html) (top level, minimum requirement in Ubuntu 18)
  * [CMake Variables](https://cmake.org/cmake/help/v3.0/manual/cmake-variables.7.html)
  * [CMake Commands](https://cmake.org/cmake/help/v3.0/manual/cmake-commands.7.html)
  * [CMake Build System](https://cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html)
    * build target and library, set property
  * [CMake Packages](https://cmake.org/cmake/help/v3.0/manual/cmake-packages.7.html)
    * about find\_package(), etc.
  * [CMake Modules](https://cmake.org/cmake/help/v3.0/manual/cmake-modules.7.html)
    * [ExternalProject](https://cmake.org/cmake/help/v3.0/module/ExternalProject.html)

#### Notes

* `std::min` and `std::max`
  * `min` and `max` are defined as macros on some systems. `std::min` and `std::max` may not be used. Use `cmMinimum` and `cmMaximum` instead.
* `size_t`
  * Various implementations have differing implementation of `size_t`. When assigning the result of `.size()` on a container for example, the result should not be assigned to an `unsigned int` or similar. `std::size_t` must not be used.
