Hi, I have a program (not in the Gentoo tree) that depends on `sci-physics/root` and is using CMake to discover it. CMake, however, can't find root, because the its `.cmake` files are in a non-standard location. A quick way to fix this issue could be to add something similar to following line to the environment file at `/etc/env.d/9981root-6.18`: CMAKE_PREFIX_PATH=/usr/lib/root/6.18/cmake I am not completely sure this will work in general (were multiple env.d files define CMAKE_PREFIX_PATH), because this environment variable needs its items separated by a *semicolon* (see https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html). Reproducible: Always
That's strange because I also have programs outside of Gentoo and they find ROOT without problems. Can you show what the CMakeLists.txt below gives you? $ cat CMakeLists.txt cmake_minimum_required(VERSION 3.10 FATAL_ERROR) project(TestFindROOT) find_package(ROOT 6.18 EXACT REQUIRED) message(STATUS " ROOT:" " VERSION: ${ROOT_VERSION}" " INCLUDES: ${ROOT_INCLUDE_DIRS}" " LIBRARIES: ${ROOT_LIBRARIES}") Without EXACT, I get: CMake Error at CMakeLists.txt:5 (find_package): Could not find a configuration file for package "ROOT" that exactly matches requested version "6.18". The following configuration files were considered but not accepted: /usr/lib/root/9999/cmake/ROOTConfig.cmake, version: 6.19.01 /usr/lib/root/6.18/cmake/ROOTConfig.cmake, version: 6.18.04 But if I remove it or change 6.18 to 6.18.04, then ROOT is found without problems: -- ROOT: VERSION: 6.18.04 INCLUDES: /usr/lib/root/6.18/include LIBRARIES: /usr/lib/root/6.18/lib/libCore.so;/usr/lib/root/6.18/lib/libImt.so;/usr/lib/root/6.18/lib/libRIO.so;/usr/lib/root/6.18/lib/libNet.so;/usr/lib/root/6.18/lib/libHist.so;/usr/lib/root/6.18/lib/libGraf.so;/usr/lib/root/6.18/lib/libGraf3d.so;/usr/lib/root/6.18/lib/libGpad.so;/usr/lib/root/6.18/lib/libROOTDataFrame.so;/usr/lib/root/6.18/lib/libTree.so;/usr/lib/root/6.18/lib/libTreePlayer.so;/usr/lib/root/6.18/lib/libRint.so;/usr/lib/root/6.18/lib/libPostscript.so;/usr/lib/root/6.18/lib/libMatrix.so;/usr/lib/root/6.18/lib/libPhysics.so;/usr/lib/root/6.18/lib/libMathCore.so;/usr/lib/root/6.18/lib/libThread.so;/usr/lib/root/6.18/lib/libMultiProc.so
No, you are right; when I removed CMAKE_PREFIX_PATH from my environment and also with it, I get a similar output as you posted above; also when I removed 'EXACT' it did find 6.18.04, which is the version I've installed. I suppose I made wrong assumption somewhere, so this bug can be closed. Thank you!