# Cross project cmake utils structure/export/import

**URL:** <https://discourse.cmake.org/t/cross-project-cmake-utils-structure-export-import/9985>\
**Category:** Code\
**Created:** [February 1, 2024, 9:53am UTC](https://discourse.cmake.org/t/cross-project-cmake-utils-structure-export-import/9985 "2024-02-01T09:53:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![McMill](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/3be4f8/32.png) [@McMill](https://discourse.cmake.org/u/McMill)\
**Post date:** [February 1, 2024, 9:53am UTC](https://discourse.cmake.org/t/cross-project-cmake-utils-structure-export-import/9985/1 "2024-02-01T09:53:50Z")

</div>

Hi,  
We need some way to share various cmake functions, macros and maybe targets between multiple other cmake based projects that each reside in their own git repo. I was thinking making a cmake-utility project/git repo that can be used by these other projects. For starters it will just have to contain functionality for setting common compilerflags on targets, but in the future I think it could also be a place for shared cross compiler configuration.

So what is the best way to structure, export and import a cmake helper utility library/git repo ?  
For starters I would like to be able to share a couple of cmake functions and macros.

---

<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:** [February 1, 2024, 10:23am UTC](https://discourse.cmake.org/t/cross-project-cmake-utils-structure-export-import/9985/2 "2024-02-01T10:23:02Z")

</div>

As a verry good example see [project\_options](https://aminya.github.io/project_options/html/index.html)

---

<div class="post-metadata">

**Author:** ![McMill](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/3be4f8/32.png) [@McMill](https://discourse.cmake.org/u/McMill)\
**Post date:** [February 3, 2024, 12:05pm UTC](https://discourse.cmake.org/t/cross-project-cmake-utils-structure-export-import/9985/3 "2024-02-03T12:05:50Z")

</div>

Thanks a lot 🙂
