[PATCH] Install cmake files to lib/cmake/llvm

Niels Ole Salscheider via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 23 02:28:21 PST 2016


Takumi (or someone else who knows CMake), can I please get an opinion on that?

On Tuesday, 12 January 2016, 13:16:55 CET, Chris Bieneman wrote:
> Let’s go with lib/cmake/* then, since that seems to be the more recent
> guidance.
> 
> -Chris
> 
> > On Jan 12, 2016, at 1:05 PM, Niels Ole Salscheider
> > <niels_ole at salscheider-online.de> wrote:> 
> > On Tuesday, 12 January 2016, 10:57:44 CET, Chris Bieneman wrote:
> >> Can you point me at the packaging guide you’re reading?
> >> 
> >> I was reading https://cmake.org/Wiki/CMake/Tutorials/Packaging
> >> <https://cmake.org/Wiki/CMake/Tutorials/Packaging>, which seems to
> >> suggest
> >> lib/project-version/, but that may be out of date.
> >> 
> >> If CMake’s guidance is lib/cmake/project, that’s fine with me.
> > 
> > I admit it's not as clear as I remembered. The page you linked only
> > states:
> > 
> > "Note: If your project does not already have a <prefix>/lib/Foo*/
> > directory you may prefer to put the package file in
> > <prefix>/lib/cmake/Foo*/ to keep the lib directory clean. However, CMake
> > 2.6.2 and lower do not search there. CMake 2.6.3 and above do."
> > 
> > However, a more recent version of that text is probably https://cmake.org/
> > cmake/help/v3.2/manual/cmake-packages.7.html#package-configuration-file
> > which only mentions lib/cmake/project explicitly.
> > 
> >> -Chris
> >> 
> >>> On Jan 11, 2016, at 11:39 PM, Niels Ole Salscheider
> >>> <niels_ole at salscheider-online.de> wrote:>
> >>> 
> >>> On Monday, 11 January 2016, 13:33:40 CET, Chris Bieneman wrote:
> >>>> + Takumi
> >>>> 
> >>>> I’m curious if Takumi has any thoughts here. I primarily work on Darwin
> >>>> where we address multiple architectures by using fat binaries, so we
> >>>> don’t
> >>>> really have this problem.
> >>>> 
> >>>> I’m a little concerned about this patch because it is a universal
> >>>> behavior
> >>>> change across all CMake users.I honestly just don’t know enough about
> >>>> how
> >>>> the CMake out-of-tree builds work to evaluate if this is safe, but from
> >>>> the
> >>>> limited research I’ve done I think it is probably mostly right.
> >>>> 
> >>>> The only thing I really didn’t like is that instead of lib/cmake/llvm
> >>>> I’d
> >>>> rather the directory was just lib/llvm/. Mostly because 5 years from
> >>>> now
> >>>> when I ls lib and want to delete some old LLVM install you’ll know that
> >>>> the
> >>>> llvm directory is part of LLVM instead of part of CMake.
> >>> 
> >>> I chose lib/cmake/llvm because it is what the packaging guide recommends
> >>> and where most projects install their cmake files (98.7% of all 909
> >>> cmake
> >>> files on my system). But lib/llvm would also work for CMake.
> >>> 
> >>>> Takumi any thoughts?
> >>>> 
> >>>> -Chris
> >>>> 
> >>>>> On Jan 9, 2016, at 5:26 AM, Niels Ole Salscheider
> >>>>> <niels_ole at salscheider-online.de> wrote:
> >>>>> 
> >>>>> Ping.
> >>>>> 
> >>>>> On Monday, 21 December 2015, 00:17:47 CET, Niels Ole Salscheider via
> >>>>> llvm-
> >>>>> 
> >>>>> commits wrote:
> >>>>>> On Monday 21 December 2015, 00:09:29 CET, Niels Ole Salscheider 
wrote:
> >>>>>>> This is the right location for platform-specific files.
> >>>>>>> 
> >>>>>>> On some distributions (e. g. Exherbo), a package can be installed
> >>>>>>> for
> >>>>>>> several architectures in parallel, but the architecture-independent
> >>>>>>> files
> >>>>>>> are shared. Therefore, we must not install architecture-dependent
> >>>>>>> files
> >>>>>>> (like the CMake config and export files) to share/.
> >>>>>> 
> >>>>>> The corresponding Clang patch can be found at
> >>>>>> http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20151214/1455
> >>>>>> 37
> >>>>>> .h
> >>>>>> tm
> >>>>>> l.
> >>>>>> 
> >>>>>>> ---
> >>>>>>> 
> >>>>>>> cmake/modules/CMakeLists.txt | 2 +-
> >>>>>>> docs/CMake.rst               | 8 ++++----
> >>>>>>> 2 files changed, 5 insertions(+), 5 deletions(-)
> >>>>>>> 
> >>>>>>> diff --git a/cmake/modules/CMakeLists.txt
> >>>>>>> b/cmake/modules/CMakeLists.txt
> >>>>>>> index 5f3f255..47ae903 100644
> >>>>>>> --- a/cmake/modules/CMakeLists.txt
> >>>>>>> +++ b/cmake/modules/CMakeLists.txt
> >>>>>>> @@ -1,4 +1,4 @@
> >>>>>>> -set(LLVM_INSTALL_PACKAGE_DIR share/llvm/cmake)
> >>>>>>> +set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm)
> >>>>>>> 
> >>>>>>> set(llvm_cmake_builddir
> >>>>>>> "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}")
> >>>>>>> 
> >>>>>>> get_property(LLVM_EXPORTS GLOBAL PROPERTY LLVM_EXPORTS)
> >>>>>>> 
> >>>>>>> diff --git a/docs/CMake.rst b/docs/CMake.rst
> >>>>>>> index 38199e5..204b5aa 100644
> >>>>>>> --- a/docs/CMake.rst
> >>>>>>> +++ b/docs/CMake.rst
> >>>>>>> @@ -511,16 +511,16 @@ The ``find_package(...)`` directive when used
> >>>>>>> in
> >>>>>>> CONFIG mode (as in the above example) will look for the
> >>>>>>> ``LLVMConfig.cmake`` file in various locations (see cmake manual for
> >>>>>>> details).  It creates a ``LLVM_DIR`` cache entry to save the
> >>>>>>> directory
> >>>>>>> where ``LLVMConfig.cmake`` is found or allows the user to specify
> >>>>>>> the
> >>>>>>> -directory (e.g. by passing ``-DLLVM_DIR=/usr/share/llvm/cmake`` to
> >>>>>>> +directory (e.g. by passing ``-DLLVM_DIR=/usr/lib/cmake/llvm`` to
> >>>>>>> 
> >>>>>>> the ``cmake`` command or by setting it directly in ``ccmake`` or
> >>>>>>> 
> >>>>>>> ``cmake-gui``).
> >>>>>>> 
> >>>>>>> This file is available in two different locations.
> >>>>>>> 
> >>>>>>> -* ``<INSTALL_PREFIX>/share/llvm/cmake/LLVMConfig.cmake`` where
> >>>>>>> +* ``<INSTALL_PREFIX>/lib/cmake/llvm/LLVMConfig.cmake`` where
> >>>>>>> 
> >>>>>>> ``<INSTALL_PREFIX>`` is the install prefix of an installed version
> >>>>>>> of
> >>>>>>> 
> >>>>>>> LLVM. -  On Linux typically this is
> >>>>>>> ``/usr/share/llvm/cmake/LLVMConfig.cmake``. +  On Linux typically
> >>>>>>> this
> >>>>>>> is
> >>>>>>> ``/usr/lib/cmake/llvm/LLVMConfig.cmake``.
> >>>>>>> 
> >>>>>>> -* ``<LLVM_BUILD_ROOT>/share/llvm/cmake/LLVMConfig.cmake`` where
> >>>>>>> +* ``<LLVM_BUILD_ROOT>/lib/cmake/llvm/LLVMConfig.cmake`` where
> >>>>>>> 
> >>>>>>> ``<LLVM_BUILD_ROOT>`` is the root of the LLVM build tree. **Note:
> >>>>>>> this
> >>>>>>> is
> >>>>>>> 
> >>>>>>> only available when building LLVM with CMake.**




More information about the llvm-commits mailing list