Repository: root-project/root

Issue #14163: cmake find_package ROOT broken with 6.30, nlohmann and vdt are builtin but not found
Created: 2023-12-02T16:34:53Z
Check duplicate issues.

 Checked for duplicates

Description
CMake find_package(ROOT) worked well with 6.28.
Now it fails with 6.30 on Ubuntu 22.04 with the binary release.
First error was related to not finding the builtin nlohmann even if it's there.
CMake Error at /usr/share/cmake-3.25/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
  By not providing "Findnlohmann_json.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "nlohmann_json", but CMake did not find one.

  Could not find a package configuration file provided by "nlohmann_json"
  (requested version 3.10.5) with any of the following names:

    nlohmann_jsonConfig.cmake
    nlohmann_json-config.cmake

  Add the installation prefix of "nlohmann_json" to CMAKE_PREFIX_PATH or set
  "nlohmann_json_DIR" to a directory containing one of the above files.  If
  "nlohmann_json" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  /tmp/newroot/cmake/ROOTConfig.cmake:122 (find_dependency)
  gui/CMakeLists.txt:28 (find_package)

A hack workaround is using sudo apt install nlohmann-json3-dev
Next error is:
cmake ../testroot/
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found nlohmann_json: /usr/lib/cmake/nlohmann_json/nlohmann_jsonConfig.cmake (found suitable version "3.10.5", minimum required is "3.10.5") 
CMake Error at /usr/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Vdt (missing: VDT_INCLUDE_DIR VDT_LIBRARY)
Call Stack (most recent call first):
  /usr/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /opt/root/cmake/modules/FindVdt.cmake:63 (find_package_handle_standard_args)
  /usr/share/cmake-3.25/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
  /opt/root/cmake/ROOTConfig.cmake:132 (find_dependency)
  CMakeLists.txt:5 (find_package)

And not sure how to solve it.
Reproducer
cmake_minimum_required(VERSION 3.25)

project(ProjectName)

find_package(ROOT 6.30 CONFIG REQUIRED)

ROOT version
 ------------------------------------------------------------------
 | Welcome to ROOT 6.30/02                        https://root.cern |
 | (c) 1995-2023, The ROOT Team; conception: R. Brun, F. Rademakers |
 | Built for linuxx8664gcc on Nov 27 2023, 19:50:38                 |
 | From tags/v6-30-02@                                              |
 | With c++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0                   |
 | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q'  |
  ------------------------------------------------------------------

Installation method
Binary Release
Operating system
Ubuntu 22.04
Additional context
No response

Duplicate issue #14195: cmake find_package `VDT not found` in root docker container
Created: 2023-12-07T16:10:46Z
Check duplicate issues.

 Checked for duplicates

Description
Hello,
I have used the latest version of ROOT through docker container.
The VDT related variables are not found in cmake although it is built internally.
-- Found nlohmann_json: /usr/lib/cmake/nlohmann_json/nlohmann_jsonConfig.cmake (found suitable version "3.10.5", minimum required is "3.10.5") 
CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Vdt (missing: VDT_INCLUDE_DIR VDT_LIBRARY)
Call Stack (most recent call first):
  /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /opt/root/cmake/modules/FindVdt.cmake:63 (find_package_handle_standard_args)
  /usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
  /opt/root/cmake/ROOTConfig.cmake:132 (find_dependency)
  cmake/Req/LoadROOT.cmake:5 (find_package)
  CMakeLists.txt:83 (include)
-- Configuring incomplete, errors occurred!

Reproducer
docker run -it rootproject/root:latest
Then run a cmake using: find_package(ROOT REQUIRED)
ROOT version
6.30
Installation method
docker
Operating system
ubuntu
Additional context
No response

Closing comment (2023-12-07T21:08:42Z): This is a duplicate of #14163, and it was fixed yesterday by #14178 (you'll need to wait for 6.30.04 or .06 release I guess)