From: Andreas Enge <andreas@enge.fr>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 18926@debbugs.gnu.org
Subject: bug#18926: cmake-build-system should set CMAKE_INSTALL_LIBDIR and CMAKE_PREFIX_PATH
Date: Sun, 1 Mar 2015 21:11:25 +0100 [thread overview]
Message-ID: <20150301201125.GA9166@debian> (raw)
In-Reply-To: <87r3t8g4zc.fsf@gnu.org>
On Sun, Mar 01, 2015 at 03:35:51PM +0100, Ludovic Courtès wrote:
> That’s not currently possible using the search path mechanism (and I
> can’t imagine such weird semantics.)
I think the semantics is relatively clear: Match file names with a regular
expression and, if there is a match, add the result to a search path.
It is much like search-replace with regular expressions.
But of course, the search path could become very long: Essentially each
package built with cmake would contribute an entry.
> I can imagine two solutions, in order of preference:
> 1. Find CMAKE_ environment variables that can be set using the search
> path mechanism. Many environment variables are documented, is
> there really none that we can use?
The problem here is that the .cmake files are in a subdirectory which is
named after the package. I think our current search path specification
cannot handle this, since we can only use it with fixed prefixes of a full
file location. One possibility would be to use CMAKE_PREFIX_PATH, which
should contain the install location of input packages. So the code proposed
in a previous message:
(search-path-specification
(variable "CMAKE_PREFIX_PATH")
(directories '("")))
should work. In practice, in a user profile, it would amount to only the
profile root, which makes sense: This is the install location from a user
point of view. In the build environment, it would add one entry for each
input, but I do not see a way of singling out only the packages built with
cmake.
> 2. Add custom code to cmake-build-system.scm instead of using the
> search path mechanism.
One could try to emulate the "trivial" search path above by adding each input
to CMAKE_PREFIX_PATH. But it would not solve the problem that a user install-
ing a library built with cmake (like libqtxdg) into his profile would not be
able to compile another package (like liblxqt) requiring it.
I also thought about searching for package-config.cmake files and defining
an environment variable PACKAGE_DIR if one is found. The problem is
capitalisation: Here we find
/gnu/store/...-libqtxdg-1.1.0/share/cmake/qt5xdg/qt5xdg-config.cmake
and need to set the environment variable
Qt5Xdg_DIR .
It is impossible to guess this!
All in all, I am in favour of using the trivial search path with the ""
directory. It would be activated only if cmake is an input, or a user
installs cmake into his profile.
Andreas
next prev parent reply other threads:[~2015-03-01 20:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-02 13:24 bug#18926: cmake-build-system should set CMAKE_INSTALL_LIBDIR and CMAKE_PREFIX_PATH 宋文武
2014-11-02 22:55 ` Ludovic Courtès
2014-11-03 13:44 ` 宋文武
2014-11-03 16:53 ` Ludovic Courtès
2014-11-04 12:42 ` 宋文武
2015-01-04 17:06 ` Ludovic Courtès
2015-02-08 18:14 ` Ludovic Courtès
2015-03-01 9:58 ` Andreas Enge
2015-03-01 14:35 ` Ludovic Courtès
2015-03-01 20:11 ` Andreas Enge [this message]
2015-03-14 15:11 ` Andreas Enge
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150301201125.GA9166@debian \
--to=andreas@enge.fr \
--cc=18926@debbugs.gnu.org \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.