Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 696000 - sci-physics/root cannot be found by cmake because the its `.cmake` files are in a non-standard location
Summary: sci-physics/root cannot be found by cmake because the its `.cmake` files are ...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Guilherme Amadio
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-01 16:39 UTC by Christopher Schwan
Modified: 2019-10-08 15:06 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Schwan 2019-10-01 16:39:22 UTC
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
Comment 1 Guilherme Amadio gentoo-dev 2019-10-03 09:24:10 UTC
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
Comment 2 Christopher Schwan 2019-10-08 13:10:38 UTC
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!