# BEGINNER: command line option is not working on deps \[SOLVED\]

**URL:** https://discourse.cmake.org/t/beginner-command-line-option-is-not-working-on-deps-solved/12844
**Category:** Code
**Created:** [October 26, 2024, 11:45am UTC](https://discourse.cmake.org/t/beginner-command-line-option-is-not-working-on-deps-solved/12844 "2024-10-26T11:45:02Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![bugblatterbeast](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ec9cab/32.png) [@bugblatterbeast](https://discourse.cmake.org/u/bugblatterbeast)
#### Post date: [October 26, 2024, 11:45am UTC](https://discourse.cmake.org/t/beginner-command-line-option-is-not-working-on-deps-solved/12844/1 "2024-10-26T11:45:02Z")

</div>

I have a very large project with modules that each have their own repository. The projects are using FetchContent like this:

```auto
FetchContent_Declare(
    ModuleA
    GIT_REPOSITORY git@URL:ModuleA.git
    GIT_TAG HEAD
    GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(ModuleA)

```

The main CMake configuration as well as the configuration of the modules are using this way to switch on/off the creation of unit tests.

```auto
option(BUILD_TESTS "Build unit tests" ON)
if(BUILD_TESTS)
enable_testing()
...
endif(BUILD_TESTS)

```

When creating the project like this: `cmake -G "Unix Makefiles" -DBUILD_TESTS=OFF ... PROJECT_PATH`, the tests for the main project are deactivated as expected, but the tests for all the modules are still created.

How can I configure my project in a way, that calling cmake with a command line option will switch of the creation of the unit tests for the modules as well?

---

<div class="post-metadata">

### Author: ![bugblatterbeast](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ec9cab/32.png) [@bugblatterbeast](https://discourse.cmake.org/u/bugblatterbeast)
#### Post date: [October 26, 2024, 12:45pm UTC](https://discourse.cmake.org/t/beginner-command-line-option-is-not-working-on-deps-solved/12844/2 "2024-10-26T12:45:33Z")

</div>

Sorry, my mistake. It is working on the \_deps!

It just wasn’t enough to delete only the cache and the other created files in the main directory and expect the \_deps to reconfigure. After deleting the \_deps folder and having it recreated, it worked as expected.
