# Is there a cmake module FindpreCICE.cmake?

**URL:** <https://precice.discourse.group/t/is-there-a-cmake-module-findprecice-cmake/37>\
**Category:** Installing preCICE\
**Tags:** cmake, faq\
**Created:** [October 8, 2019, 7:51am UTC](https://precice.discourse.group/t/is-there-a-cmake-module-findprecice-cmake/37 "2019-10-08T07:51:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![uekerman](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/uekerman/32/2199_2.png) [@uekerman](https://precice.discourse.group/u/uekerman)\
**Post date:** [October 8, 2019, 7:51am UTC](https://precice.discourse.group/t/is-there-a-cmake-module-findprecice-cmake/37/1 "2019-10-08T07:51:03Z")

</div>

Let’s say a group builds their in-house code with cmake and they link all their external dependencies via cmake modules, a natural question would be: is there also such a thing for preCICE?

---

<div class="post-metadata">

**Author:** ![fsimonis](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/fsimonis/32/6_2.png) [@fsimonis](https://precice.discourse.group/u/fsimonis)\
**Post date:** [October 8, 2019, 10:04am UTC](https://precice.discourse.group/t/is-there-a-cmake-module-findprecice-cmake/37/2 "2019-10-08T10:04:58Z")

</div>

Being a CMake project, preCICE generates a `preciceCongfig.cmake` file instead of providing a `Findprecice.cmake` module.

This file is available

- after configuration in the directory `CMAKE_BINARY_DIR`,
- after installation in the `CMAKE_INSTALL_PREFIX/lib/cmake/precice` and
- after installing the Debian package in `/usr/lib/cmake/precice`.

To use preCICE from another CMake project, you simply have to:

1. find the package

2. link to the library to your target

3. for locations not searched by CMake: tell CMake where to find the config when configuring the dependant

This allows you to easily handle multiple installations in parallel such as:

1. Debian package (works without passing the `-Dprecice_DIR=dir` option
2. Custom release build
3. Custom debug build

This is especially useful when benchmarking cases or debugging adapters.

---

<div class="post-metadata">

**Author:** ![fsimonis](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/fsimonis/32/6_2.png) [@fsimonis](https://precice.discourse.group/u/fsimonis)\
**Post date:** [January 15, 2024, 11:45am UTC](https://precice.discourse.group/t/is-there-a-cmake-module-findprecice-cmake/37/4 "2024-01-15T11:45:18Z")

</div>

Closed on January 15, 2024, 11:45am UTC


