# FetchContent\_MakeAvailable could not find header generated by configure\_file

**URL:** https://discourse.cmake.org/t/fetchcontent-makeavailable-could-not-find-header-generated-by-configure-file/10191
**Category:** Usage
**Tags:** os:linux
**Created:** [February 26, 2024, 7:54am UTC](https://discourse.cmake.org/t/fetchcontent-makeavailable-could-not-find-header-generated-by-configure-file/10191 "2024-02-26T07:54:31Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![miaodi](https://discourse.cmake.org/user_avatar/discourse.cmake.org/miaodi/32/4345_2.png) [@miaodi](https://discourse.cmake.org/u/miaodi)
#### Post date: [February 26, 2024, 7:54am UTC](https://discourse.cmake.org/t/fetchcontent-makeavailable-could-not-find-header-generated-by-configure-file/10191/1 "2024-02-26T07:54:31Z")

</div>

I am trying to add a lib called taco to my own project. I use cmake’s FetchContent to add it:

```
FetchContent_Declare(
 taco
 GIT_REPOSITORY https://github.com/tensor-compiler/taco.git
 GIT_TAG master
)
FetchContent_MakeAvailable(taco)

```

Then I got the following error during compilation:

```
_deps/taco-src/tools/taco.cpp:35:10: fatal error: taco/version.h: No such file or directory
   35 | #include "taco/version.h"

```

version.h is generated by configure\_file and is in \_deps/taco-build/include/taco/. However, in taco’s tools/CMakeList.txt, the include searching path is set to “${CMAKE\_BINARY\_DIR}/include”. The compilation error is cause by the fact that ${CMAKE\_BINARY\_DIR} is the binary folder of my project instead of \_deps/taco-build generated by FetchContent.

Now, what I did is manually replacing CMAKE\_BINARY\_DIR by \_deps/taco-build after a failed cmake run and I am looking for a better solution.

Thank you!

---

<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: [February 27, 2024, 2:26pm UTC](https://discourse.cmake.org/t/fetchcontent-makeavailable-could-not-find-header-generated-by-configure-file/10191/2 "2024-02-27T14:26:56Z")

</div>

`taco` doesn’t seem ready to be vendored like this. It should probably use `CMAKE_CURRENT_BINARY_DIR` instead.
