# CMake 3.28.0, FetchContent filed to resolve dependency target

**URL:** https://discourse.cmake.org/t/cmake-3-28-0-fetchcontent-filed-to-resolve-dependency-target/9583
**Category:** Usage
**Tags:** gen:makefiles
**Created:** [December 8, 2023, 6:31am UTC](https://discourse.cmake.org/t/cmake-3-28-0-fetchcontent-filed-to-resolve-dependency-target/9583 "2023-12-08T06:31:18Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mc-nv](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mc-nv/32/4063_2.png) [@mc-nv](https://discourse.cmake.org/u/mc-nv)
#### Post date: [December 8, 2023, 6:31am UTC](https://discourse.cmake.org/t/cmake-3-28-0-fetchcontent-filed-to-resolve-dependency-target/9583/1 "2023-12-08T06:31:19Z")

</div>

I’m trying to use `FetchContent_Declare()` with CMake 3.28.0 as following:

```auto
FetchContent_Declare(
  repo-backend
  GIT_REPOSITORY https://github.com/triton-inference-server/backend.git
  GIT_TAG main
  GIT_SHALLOW ON)
FetchContent_MakeAvailable(repo-backend)

```

But getting error during the generation step against this block [https://github.com/triton-inference-server/backend/blob/main/CMakeLists.txt#L211-L216:](https://github.com/triton-inference-server/backend/blob/main/CMakeLists.txt#L211-L216:)

```auto
CMake Error at /tmp/tritonbuild/tensorrtllm/build/_deps/repo-backend-src/CMakeLists.txt:212 (target_link_libraries):
  Target "triton-backend-utils" links to:

    CUDA::cupti

  but the target was not found. Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

```

I had tried to set following options but without luck including use `EXCLUDE_FROM_ALL` as given in documentation

```auto
+cmake_policy(SET CMP0154 OLD)
+cmake_policy(SET CMP0146 OLD)
+enable_language(CUDA)
+find_package(CUDAToolkit)
+
+set(FETCHCONTENT_TRY_FIND_PACKAGE_MODE ALWAYS)

```

* * *

Can you advise what need to be considered in order to keep up with latest CMake version?

---

<div class="post-metadata">

### Author: ![mc-nv](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mc-nv/32/4063_2.png) [@mc-nv](https://discourse.cmake.org/u/mc-nv)
#### Post date: [December 8, 2023, 3:48pm UTC](https://discourse.cmake.org/t/cmake-3-28-0-fetchcontent-filed-to-resolve-dependency-target/9583/2 "2023-12-08T15:48:45Z")

</div>

I have raised an issue for the same:  
[https://gitlab.kitware.com/cmake/cmake/-/issues/25484](https://gitlab.kitware.com/cmake/cmake/-/issues/25484)
