# Using Root 6-30-02 with CMake: Vdt connot be found

**URL:** <https://root-forum.cern.ch/t/using-root-6-30-02-with-cmake-vdt-connot-be-found/57484>\
**Category:** Newbie\
**Created:** [December 10, 2023, 4:04pm UTC](https://root-forum.cern.ch/t/using-root-6-30-02-with-cmake-vdt-connot-be-found/57484 "2023-12-10T16:04:42Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![NikkieD](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/6de8d8/32.png) [@NikkieD](https://root-forum.cern.ch/u/NikkieD)\
**Post date:** [December 10, 2023, 4:04pm UTC](https://root-forum.cern.ch/t/using-root-6-30-02-with-cmake-vdt-connot-be-found/57484/1 "2023-12-10T16:04:42Z")

</div>

Dear All,

I’m using homebrew to install Root 6 on my Mac, and today I updated all my packages, and when I now want to recompile a script that uses root, that was working fine with the previous root version, I use CMake, I get the following error:

```auto
CMake Error at /opt/homebrew/Cellar/cmake/3.28.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Vdt (missing: VDT_INCLUDE_DIR VDT_LIBRARY)
Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.28.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /opt/homebrew/Cellar/root/6.30.02/share/root/cmake/modules/FindVdt.cmake:63 (find_package_handle_standard_args)
  /opt/homebrew/Cellar/cmake/3.28.0/share/cmake/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)
  /opt/homebrew/share/root/cmake/ROOTConfig.cmake:132 (find_dependency)
  CMakeLists.txt:46 (find_package)

```

I did a google search and I find that this VDT package is included in root for a long time already, but previously I had no problems with my cmake. I can’t install VDT with homebrew, so I don’t really know how to fix this issue.

Any ideas?

My CMake file looks like this:

```auto
# find rat-models library
find_package(RatModels 2.016.3 REQUIRED)
# find_package(Vdt REQUIRED)
find_package(ROOT 6.30 REQUIRED)
include_directories(${ROOT_INCLUDE_DIRS})

# set the model
add_executable(magdem magdem.cpp)
target_link_libraries(magdem Rat::Models ${ROOT_LIBRARIES})

```

* * *

\_ROOT Version: 6.30  
\_Platform: MacOS  
\_Compiler: HomeBrew / CMake

* * *

---

<div class="post-metadata">

**Author:** ![ferhue](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ferhue/32/29462_2.png) [@ferhue](https://root-forum.cern.ch/u/ferhue)\
**Post date:** [December 11, 2023, 7:52am UTC](https://root-forum.cern.ch/t/using-root-6-30-02-with-cmake-vdt-connot-be-found/57484/2 "2023-12-11T07:52:01Z")

</div>

This bug was solved a couple of days ago on master: [VDT Finding Fix, master branch (2023.12.05.) by krasznaa · Pull Request #14178 · root-project/root · GitHub](https://github.com/root-project/root/pull/14178)

---

<div class="post-metadata">

**Author:** ![NikkieD](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/6de8d8/32.png) [@NikkieD](https://root-forum.cern.ch/u/NikkieD)\
**Post date:** [December 11, 2023, 2:16pm UTC](https://root-forum.cern.ch/t/using-root-6-30-02-with-cmake-vdt-connot-be-found/57484/3 "2023-12-11T14:16:40Z")

</div>

Thanks! In that case I probably have to wait until homebrew updates Root as well…

Cheers,  
Nikkie

---

<div class="post-metadata">

**Author:** ![kneupane1](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/kneupane1/32/23250_2.png) [@kneupane1](https://root-forum.cern.ch/u/kneupane1)\
**Post date:** [January 29, 2024, 1:02pm UTC](https://root-forum.cern.ch/t/using-root-6-30-02-with-cmake-vdt-connot-be-found/57484/4 "2024-01-29T13:02:14Z")

</div>

Hi NikkieD,  
Are you able to resolve the issue now? If so please let me know how you did it, I am having the same issue now. Thanks!

---

<div class="post-metadata">

**Author:** ![ferhue](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ferhue/32/29462_2.png) [@ferhue](https://root-forum.cern.ch/u/ferhue)\
**Post date:** [January 29, 2024, 1:13pm UTC](https://root-forum.cern.ch/t/using-root-6-30-02-with-cmake-vdt-connot-be-found/57484/5 "2024-01-29T13:13:45Z")

</div>

see also [Fix `find_package(root)` with Homebrew. Fixes #14113 by bellenot · Pull Request #14474 · root-project/root · GitHub](https://github.com/root-project/root/pull/14474)

---

<div class="post-metadata">

**Author:** ![kneupane1](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/kneupane1/32/23250_2.png) [@kneupane1](https://root-forum.cern.ch/u/kneupane1)\
**Post date:** [January 29, 2024, 1:52pm UTC](https://root-forum.cern.ch/t/using-root-6-30-02-with-cmake-vdt-connot-be-found/57484/6 "2024-01-29T13:52:44Z")

</div>

Thanks for quick reply, I saw it but not sure which file I should modify to resolve the issue. My CMakeList.txt looks like this:

```auto
cmake_minimum_required(VERSION 3.5)
project(hipoio C CXX Fortran)
set(VERSION 1.0.0)

option(BUILD_FPIC "Build with -fPIC" ON)
option(BUILD_HIPOPY "Build python" OFF)
option(BUILD_EXAMPLES "Build examples programs" OFF)

if(BUILD_FPIC)
  set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()

# Add modules to find find packages
set(CMAKE_MODULE_PATH
   ${CMAKE_MODULE_PATH}
   ${PROJECT_SOURCE_DIR}/cmake)

# Add root support
list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})
find_package(ROOT REQUIRED COMPONENTS RIO Net)

include(${ROOT_USE_FILE})
set(CMAKE_C_FLAGS "-O3")
set(CMAKE_CXX_FLAGS "-O3 ${ROOT_CXX_FLAGS}")

```

---

<div class="post-metadata">

**Author:** ![ferhue](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ferhue/32/29462_2.png) [@ferhue](https://root-forum.cern.ch/u/ferhue)\
**Post date:** [January 29, 2024, 2:05pm UTC](https://root-forum.cern.ch/t/using-root-6-30-02-with-cmake-vdt-connot-be-found/57484/7 "2024-01-29T14:05:11Z")

</div>

The workaround is to modify a file called ROOTConfig.cmake, first you need to find where it is located in your system.

---

<div class="post-metadata">

**Author:** ![kneupane1](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/kneupane1/32/23250_2.png) [@kneupane1](https://root-forum.cern.ch/u/kneupane1)\
**Post date:** [January 29, 2024, 2:32pm UTC](https://root-forum.cern.ch/t/using-root-6-30-02-with-cmake-vdt-connot-be-found/57484/8 "2024-01-29T14:32:48Z")

</div>

Thanks modifying /root/6.30.02/share/root/cmake/ROOTConfig.cmake fixed my issue. Much appreciated!

---

<div class="post-metadata">

**Author:** ![ferhue](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ferhue/32/29462_2.png) [@ferhue](https://root-forum.cern.ch/u/ferhue)\
**Post date:** [August 6, 2024, 12:58pm UTC](https://root-forum.cern.ch/t/using-root-6-30-02-with-cmake-vdt-connot-be-found/57484/9 "2024-08-06T12:58:12Z")

</div>

If you find this bug with Ubuntu 24 and ROOT 6.32 downloaded from binary release, then the solution is to apt install libvdt-dev
