# Getting CMake error regarding add\_subdirectory()

**URL:** https://discourse.cmake.org/t/getting-cmake-error-regarding-add-subdirectory/13610
**Category:** Code
**Created:** [February 20, 2025, 8:45am UTC](https://discourse.cmake.org/t/getting-cmake-error-regarding-add-subdirectory/13610 "2025-02-20T08:45:36Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![nishantrana](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/n/a183cd/32.png) [@nishantrana](https://discourse.cmake.org/u/nishantrana)
#### Post date: [February 20, 2025, 8:45am UTC](https://discourse.cmake.org/t/getting-cmake-error-regarding-add-subdirectory/13610/1 "2025-02-20T08:45:36Z")

</div>

Getting the following error when trying to bazel build jpegli using CMake. I can see that after downloading via http\_archive, **tools** folder is there in the downloaded folder but not present in the sandbox folder. Not sure why is it not getting copied to sandbox coz of which getting the following error. Please help here.

CMake Error at CMakeLists.txt:475 (add\_subdirectory):  
add\_subdirectory given source “tools” which is not an existing directory.

---

<div class="post-metadata">

### Author: ![retif](https://discourse.cmake.org/user_avatar/discourse.cmake.org/retif/32/1776_2.png) [@retif](https://discourse.cmake.org/u/retif)
#### Post date: [February 20, 2025, 9:11am UTC](https://discourse.cmake.org/t/getting-cmake-error-regarding-add-subdirectory/13610/2 "2025-02-20T09:11:41Z")

</div>

Those who don’t know what “bazel” or “jpegli” things are would probably want to get a repository URL or at least the full `CMakeLists.txt`.

---

<div class="post-metadata">

### Author: ![nishantrana](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/n/a183cd/32.png) [@nishantrana](https://discourse.cmake.org/u/nishantrana)
#### Post date: [February 20, 2025, 9:28am UTC](https://discourse.cmake.org/t/getting-cmake-error-regarding-add-subdirectory/13610/3 "2025-02-20T09:28:20Z")

</div>

Here is the JPEGLi repo link. You can find the CMakeLists.txt file in it.

> **[GitHub - google/jpegli](https://github.com/google/jpegli/tree/main)**
>
> main
