[OpenIndiana-discuss] CMake can't find LLVM

Peter Tribble peter.tribble at gmail.com
Wed Jul 31 09:22:25 UTC 2024


On Wed, Jul 31, 2024 at 1:02 AM scavenger via openindiana-discuss <
openindiana-discuss at openindiana.org> wrote:

> This is the error message:
>
> >   By not providing "FindLLVM.cmake" in CMAKE_MODULE_PATH this project has
> >   asked CMake to find a package configuration file provided by "LLVM",
> but
> >   CMake did not find one.
> >
> >   Could not find a package configuration file provided by "LLVM" with
> any of
> >   the following names:
> >
> >     LLVMConfig.cmake
> >     llvm-config.cmake
> >
> >   Add the installation prefix of "LLVM" to CMAKE_PREFIX_PATH or set
> >   "LLVM_DIR" to a directory containing one of the above files.  If "LLVM"
> >   provides a separate development package or SDK, be sure it has been
> >   installed.
>
> I have installed build-essential and I have llvm-config.
>

Follow the instructions; something like (depending on which version of llvm
is installed and/or you wish to use)

cmake ... -DCMAKE_PREFIX_PATH=/usr/clang/18.1/lib/cmake

In general handling multiple versions of a package is a tricky problem for
cmake,
not helped by cmake's inconsistencies in searching for the cmake
configuration
files. I guess it would be possible to link the cmake files into the
default locations
using a mediator to select the "default" version, which would at least give
an answer
most of the time.

-- 
-Peter Tribble
http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/


More information about the openindiana-discuss mailing list