# FetchContent error

**URL:** https://discourse.cmake.org/t/fetchcontent-error/8109
**Category:** Usage
**Tags:** os:windows, gen:vs
**Created:** [May 12, 2023, 9:36pm UTC](https://discourse.cmake.org/t/fetchcontent-error/8109 "2023-05-12T21:36:29Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Nitr0-G](https://discourse.cmake.org/user_avatar/discourse.cmake.org/nitr0-g/32/3431_2.png) [@Nitr0-G](https://discourse.cmake.org/u/Nitr0-G)
#### Post date: [May 12, 2023, 9:36pm UTC](https://discourse.cmake.org/t/fetchcontent-error/8109/1 "2023-05-12T21:36:29Z")

</div>

Hello everyone. When I try to run my cmake, I get an error message (it started after I decided to reinstall my system, the same cmake used to work without any problems (I tried Googling, but I didn’t find anything sane except the advice “include(FetchContent)”))

It’s my code(It is fully operational…)

```auto
cmake_minimum_required(VERSION 3.15)
include(FetchContent)
project("DynamicRetDec")

FetchContent_Declare(
  Zydis
  GIT_REPOSITORY https://github.com/zyantific/zydis.git
  GIT_TAG master
)
set(ZYDIS_BUILD_TOOLS OFF CACHE BOOL "" FORCE)
set(ZYDIS_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(Zydis)

FetchContent_Declare(
  unicorn
  GIT_REPOSITORY https://github.com/unicorn-engine/unicorn.git
  GIT_TAG master
)
FetchContent_MakeAvailable(unicorn)

# Add our project executable
add_executable(${PROJECT_NAME}
    "src/dynamic-retdec-decompiler/Emu.cpp"
    "src/dynamic-retdec-decompiler/Emu.hpp"
    "src/dynamic-retdec-decompiler/Dynamic-retdec-decompiler.cpp"
    "src/dynamic-retdec-decompiler/PeLoaderEmu/Work with PE file.cpp"
    "src/dynamic-retdec-decompiler/PeLoaderEmu/Work with DLL.cpp"
    "src/dynamic-retdec-decompiler/PeLoaderEmu/PeLoaderEmu.hpp"
    "src/dynamic-retdec-decompiler/Hooks/HooksFromEmu.cpp"
    "src/dynamic-retdec-decompiler/Hooks/HooksFromEmu.hpp"
    "src/dynamic-retdec-decompiler/Hooks/FirstPhase/FirstPhase.cpp"
    "src/dynamic-retdec-decompiler/Hooks/FirstPhase/FirstPhase.hpp"
    "src/dynamic-retdec-decompiler/z3/z3states.hpp"
    "src/dynamic-retdec-decompiler/z3/z3ASMx64Instructions.hpp"
    "src/dynamic-retdec-decompiler/z3/z3ASMx64Instructions.cpp")

# Have CMake link our project executable against Zydis.
target_link_libraries(${PROJECT_NAME} PRIVATE Zydis 
     PRIVATE unicorn)

target_include_directories(${PROJECT_NAME} PRIVATE Zydis PRIVATE unicorn)

target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)

```

I get this error after trying “cmake …”

```auto
D:\Programs\Soft\Coding\C\VisualStudio\Coders\DynamicRetDecWinServ2022\bld2>cmake ..
CMake Error at C:/Program Files/CMake/share/cmake-3.26/Modules/ExternalProject.cmake:2806 (message):
  error: could not find git for clone of zydis-populate
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.26/Modules/ExternalProject.cmake:4208 (_ep_add_download_command)
  CMakeLists.txt:23 (ExternalProject_Add)

-- Configuring incomplete, errors occurred!

CMake Error at C:/Program Files/CMake/share/cmake-3.26/Modules/FetchContent.cmake:1610 (message):
  CMake step for zydis failed: 1
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.26/Modules/FetchContent.cmake:1762:EVAL:2 (__FetchContent_directPopulate)
  C:/Program Files/CMake/share/cmake-3.26/Modules/FetchContent.cmake:1762 (cmake_language)
  C:/Program Files/CMake/share/cmake-3.26/Modules/FetchContent.cmake:1976 (FetchContent_Populate)
  CMakeLists.txt:12 (FetchContent_MakeAvailable)

-- Configuring incomplete, errors occurred!

```

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [May 12, 2023, 9:58pm UTC](https://discourse.cmake.org/t/fetchcontent-error/8109/2 "2023-05-12T21:58:08Z")

</div>

> [@Nitr0-G](#):
>
> `error: could not find git for clone of zydis-populate`

Looks to me like you don’t have git installed. You probably forgot to reinstall that after reinstalling your system.

---

<div class="post-metadata">

### Author: ![Nitr0-G](https://discourse.cmake.org/user_avatar/discourse.cmake.org/nitr0-g/32/3431_2.png) [@Nitr0-G](https://discourse.cmake.org/u/Nitr0-G)
#### Post date: [May 12, 2023, 10:09pm UTC](https://discourse.cmake.org/t/fetchcontent-error/8109/3 "2023-05-12T22:09:11Z")

</div>

> Looks to me like you don’t have git installed. You probably forgot to reinstall that after reinstalling your system.

Yes, I’m an idiot. Thank you very much! I forgot about it!
