# CMake template for using stdlib

**URL:** <https://fortran-lang.discourse.group/t/cmake-template-for-using-stdlib/545>\
**Category:** Announcements\
**Created:** [January 5, 2021, 6:03pm UTC](https://fortran-lang.discourse.group/t/cmake-template-for-using-stdlib/545 "2021-01-05T18:03:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![awvwgk](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/awvwgk/32/154_2.png) [@awvwgk](https://fortran-lang.discourse.group/u/awvwgk)\
**Post date:** [January 5, 2021, 6:03pm UTC](https://fortran-lang.discourse.group/t/cmake-template-for-using-stdlib/545/1 "2021-01-05T18:03:09Z")

</div>

I created an example how to integrate the Fortran standard library ([stdlib](https://github.com/fortran-lang/stdlib)) in CMake projects at

> **[fortran-lang/stdlib-cmake-example](https://github.com/fortran-lang/stdlib-cmake-example)**
>
> Integration of the Fortran standard library in CMake projects

This example should jump start you from zero to production with minimal effort, you can even use it directly as template to create a new repository on GitHub including a full CI setup.

The aim was to have a robust and readable CMake style, which generally stays out of the way and allows customization with minimal exposure to CMake (as much as this is possible with CMake).

Let me know what you think, feedback to improve stdlib’s usability and/or the CMake example is very welcome.

---

<div class="post-metadata">

**Author:** ![certik](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/certik/32/4_2.png) [@certik](https://fortran-lang.discourse.group/u/certik)\
**Post date:** [January 5, 2021, 6:30pm UTC](https://fortran-lang.discourse.group/t/cmake-template-for-using-stdlib/545/2 "2021-01-05T18:30:48Z")

</div>

Thanks for doing that. Down the road I hope to port stdlib to fpm, and write cmake backend for fpm, so that fpm itself could generate such a cmake template.

---

<div class="post-metadata">

**Author:** ![awvwgk](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/awvwgk/32/154_2.png) [@awvwgk](https://fortran-lang.discourse.group/u/awvwgk)\
**Post date:** [January 5, 2021, 6:41pm UTC](https://fortran-lang.discourse.group/t/cmake-template-for-using-stdlib/545/3 "2021-01-05T18:41:58Z")

</div>

Being free of ever having to write CMake again sounds very appealing to me.
