From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Enge Subject: bug#18926: cmake-build-system should set CMAKE_INSTALL_LIBDIR and CMAKE_PREFIX_PATH Date: Sun, 1 Mar 2015 21:11:25 +0100 Message-ID: <20150301201125.GA9166@debian> References: <877fzdu45q.fsf@gmail.com> <87d295i556.fsf@gnu.org> <87sii02yax.fsf@gmail.com> <874mugp6oj.fsf@gnu.org> <871tpjb0hk.fsf@gmail.com> <87wq52327h.fsf@gnu.org> <87vbjcp8xx.fsf@gnu.org> <20150301095847.GA28759@debian> <87r3t8g4zc.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSADe-0006OW-1i for bug-guix@gnu.org; Sun, 01 Mar 2015 15:12:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YSADa-0006mV-Qj for bug-guix@gnu.org; Sun, 01 Mar 2015 15:12:05 -0500 Received: from debbugs.gnu.org ([140.186.70.43]:58182) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSADa-0006mN-NR for bug-guix@gnu.org; Sun, 01 Mar 2015 15:12:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YSADa-0003hZ-8S for bug-guix@gnu.org; Sun, 01 Mar 2015 15:12:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: Content-Disposition: inline In-Reply-To: <87r3t8g4zc.fsf@gnu.org> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 18926@debbugs.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