# cmake 3.28 CMAKE\_CXX\_COMPILER\_CLANG\_SCAN\_DEPS-NOTFOUND: not found

**URL:** https://discourse.cmake.org/t/cmake-3-28-cmake-cxx-compiler-clang-scan-deps-notfound-not-found/9244
**Category:** Code
**Created:** [October 23, 2023, 5:01am UTC](https://discourse.cmake.org/t/cmake-3-28-cmake-cxx-compiler-clang-scan-deps-notfound-not-found/9244 "2023-10-23T05:01:27Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![cooper](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/c/50afbb/32.png) [@cooper](https://discourse.cmake.org/u/cooper)
#### Post date: [October 23, 2023, 5:01am UTC](https://discourse.cmake.org/t/cmake-3-28-cmake-cxx-compiler-clang-scan-deps-notfound-not-found/9244/1 "2023-10-23T05:01:27Z")

</div>

I’m writing code in docker and my dockerfile is as below.

```plaintext
# Add the LLVM repository
RUN apt-get update && \
    apt-get install -y software-properties-common wget jq sudo curl gnupg2 && \
    wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor -o /etc/apt/trusted.gpg.d/llvm-archive-keyring.gpg && \
    echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main" > /etc/apt/sources.list.d/llvm.list && \
    echo "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy main" >> /etc/apt/sources.list.d/llvm.list

# Install development tools, utilities, and zsh
RUN apt-get update && \
    apt-get install -y \
    clang \
    lldb \
    libstdc++-11-dev \
    git \
    unzip \
    zsh && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

```

when I upgraded to cmake 3.28 I had the issues like below, when switching back to 3.27 it compiles successfully.

```auto
[1/4] Scanning /home/Dev/CPU_Sched/src/user_scheduler.cpp for CXX dependencies
FAILED: CMakeFiles/Scheduler.dir/src/user_scheduler.cpp.o.ddi 
"CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS-NOTFOUND" -format=p1689 -- /usr/bin/c++ -DSPDLOG_COMPILED_LIB -I/home/Dev/CPU_Sched/build/_deps/spdlog-src/include -I/home/Dev/CPU_Sched/build/_deps/argparse-src/include -O3 -DNDEBUG -std=c++20 -x c++ /home/Dev/CPU_Sched/src/user_scheduler.cpp -c -o CMakeFiles/Scheduler.dir/src/user_scheduler.cpp.o -MT CMakeFiles/Scheduler.dir/src/user_scheduler.cpp.o.ddi -MD -MF CMakeFiles/Scheduler.dir/src/user_scheduler.cpp.o.ddi.d > CMakeFiles/Scheduler.dir/src/user_scheduler.cpp.o.ddi
/bin/sh: 1: CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS-NOTFOUND: not found
ninja: build stopped: subcommand failed.

```

---

<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: [October 23, 2023, 6:18pm UTC](https://discourse.cmake.org/t/cmake-3-28-cmake-cxx-compiler-clang-scan-deps-notfound-not-found/9244/2 "2023-10-23T18:18:11Z")

</div>

What is the `cmake_minimum_required` call for the project you’re building? Is it setting the C++ standard to 20 or newer?

---

<div class="post-metadata">

### Author: ![cooper](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/c/50afbb/32.png) [@cooper](https://discourse.cmake.org/u/cooper)
#### Post date: [October 23, 2023, 7:36pm UTC](https://discourse.cmake.org/t/cmake-3-28-cmake-cxx-compiler-clang-scan-deps-notfound-not-found/9244/3 "2023-10-23T19:36:28Z")

</div>

I have set the version checker

```auto
cmake_minimum_required(VERSION 3.28)
project(Foo LANGUAGES CXX)

# Set the C++ standard to C++20
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wextra -Wpedantic -Werror")

# Export compile commands for use with clangd
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

```

---

<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: [October 24, 2023, 1:00am UTC](https://discourse.cmake.org/t/cmake-3-28-cmake-cxx-compiler-clang-scan-deps-notfound-not-found/9244/4 "2023-10-24T01:00:42Z")

</div>

> [@cooper](#):
>
> `cmake_minimum_required(VERSION 3.28)`

A minimum version of 3.28 and C++20 will default to scanning all such sources. If you’re not using modules, `set(CMAKE_CXX_SCAN_FOR_MODULES 0)` to initialize the “this target does not need any module dependency scanning” property.

If you do need scanning, you’ll need to install `clang-scan-deps` as well. I’m not sure what package that might be in. `clang-tools-extra` would probably be the Fedora name, but you seem to have Debian/Ubuntu.

---

<div class="post-metadata">

### Author: ![cooper](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/c/50afbb/32.png) [@cooper](https://discourse.cmake.org/u/cooper)
#### Post date: [October 24, 2023, 2:49am UTC](https://discourse.cmake.org/t/cmake-3-28-cmake-cxx-compiler-clang-scan-deps-notfound-not-found/9244/5 "2023-10-24T02:49:37Z")

</div>

After install clang-tidy, everything is work. But the clangd doesn’t recognize the module I defined

---

<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: [October 24, 2023, 11:17am UTC](https://discourse.cmake.org/t/cmake-3-28-cmake-cxx-compiler-clang-scan-deps-notfound-not-found/9244/6 "2023-10-24T11:17:32Z")

</div>

> [@cooper](#):
>
> After install clang-tidy, everything is work

I would guess that `clang-tidy` lives in the same package as `clang-scan-deps`.

> [@cooper](#):
>
> But the clangd doesn’t recognize the module I defined

`clangd` doesn’t know how to build modules yet. You’ll need to have CMake build the modules before `clangd` will understand them.
