<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/54875>54875</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Unknown CMake command `add_clang_executable`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          rdwnsjjd
      </td>
    </tr>
</table>

<pre>
    I'm reading [this](https://clang.llvm.org/docs/RAVFrontendAction.html) and I'm trying to build it step-by-step.
my directory is:
```
root
  |----- FindClassDecls.cpp
  |----- CMakeLists.txt
```
all files are exactly the same as original.
but when I run `cmake CMakeLists.txt` I give `Unknown CMake command add_clang_executable` error.
why? How to fix it?


(CMakeLists.txt content:
```
set(LLVM_LINK_COMPONENTS
  Support
)

add_clang_executable(find-class-decls FindClassDecls.cpp)

target_link_libraries(
  clangAST
  clangBasic
  clangFrontend
  clangSerialization
  clangTooling
)

cmake_minimum_required(VERSION 3.18)
project("safeC")
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx1VNFyojAU_Rp4ychAUIEHHqzWWWet3andvjohuULakLhJqLpfvwlVt-5ahiHk5uaek3MPVIody0WAsxZpIIzLGgWjO9twE4xmAc4ba3cmSCcBnrubCiLrSIj3NlK6dgGmqHHD0-RlrpW0INmEWq5k1NhWBLhARDL0Ud7qo69uFao6LhjiFhkLu0F1HPgxCuJZEE_aI2JcA7VKHxHvkft4MI5Pdz_VStmPN4SCbDrwF5pzyaaCGDMDKkxEd7v_UqYP5A2W3FgT2YO9WZoIgbZcgEFEA4IDoVYckW0AGdICIgYpzWsuiThRrjqL9g1ItEC6k8gVoq1D-RdrHLuEmr-Dz_gp36Tay48cRFXbeqEIY5te4g0cgHaWVAL8PtBa6RPavjkG6Rx9U3sv5ZYfnJAucDrK5yfOrxk4GN8h-5WmBqzbs1y-PGyWi9X3zfTx4cfj6n71vD7LuO52O6XPsuHiM9xN7jjfup4MqG_KgPmu3GrSdSFLdA12I7h8c49KE83BeSw_k-hBJuvnq_kdMZxeRc5-vAquQXMi-G_iPXq18qyUQ6xvHq1v56blkrddu9Hwq3MOZY7Sy_3TevG4QmmU5Jc9O61enX89Y4wN2cLUjX8rnjUPWZmyIi1IaLkVUN52hEv8whRhp0V5_XXW3DZdFbm9buI_0tMwuFCac2M6r-Z8NMyzUdiUNElgnOJqnGVFgnFOszgeb2EIeFgNkywOBalAmNL9FNwxJOxRX8IfaTQLeYljjONhgpM8zZJRVBCgBRSsKBIypBULhjG0hIvLPyPUZU-p6mrjFkVvzsuiswWvJUAP5-qTzjZKl5rtpXl9ZWGPXfbc_wDDt3ZJ">