From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?Llu=EDs?= Batlle i Rossell Subject: Re: CMAKE_LIBRARY_PATH & co. Date: Mon, 14 Oct 2013 09:23:05 +0200 Message-ID: <20131014072305.GA1965@vicerveza.homeunix.net> References: <87mwmc9vci.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58798) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVcUp-0000dV-P1 for guix-devel@gnu.org; Mon, 14 Oct 2013 03:23:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VVcUj-0007z5-J5 for guix-devel@gnu.org; Mon, 14 Oct 2013 03:23:19 -0400 Content-Disposition: inline In-Reply-To: <87mwmc9vci.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ludovic =?iso-8859-1?Q?Court=E8s?= Cc: guix-devel@gnu.org On Mon, Oct 14, 2013 at 09:15:25AM +0200, Ludovic Court=C3=A8s wrote: > Andreas Enge skribis: >=20 > > commit e78fd4ca636a19bc286747f8d91bda22cd8f08fd > > Author: Andreas Enge > > Date: Sun Oct 13 18:02:49 2013 +0200 > > > > guix: Make cmake build system aware of usual paths. > > =20 > > * guix/build/cmake-build-system.scm (configure): Set CMAKE_LIBRA= RY_PATH to > > LIBRARY_PATH and CMAKE_INCLUDE_PATH to CPATH. >=20 > I think this was discussed on IRC yesterday, but I=E2=80=99m not sure I= got it: > are these needed because CMake explicitly looks for files in these > directories instead of just running the compiler? >=20 > That would be a serious flaw of CMake. Right; for what I understand, FIND_LIBRARY, and FIND_PATH, look for files= in specific directories. Then cmake takes a decision based in what it finds.= A shared object, a static lib, ... For header files, you can do: FIND_PATH(HEADERS file.h) # Finds the directory having that file INCLUDE_DIRECTORIES(${HEADERS}) # Adds the respective -I flag in compila= tion It may be related to cmake being able to tune very narrowly the -I/-L fla= gs per project target. I'm not that anti-cmake; I find the approach of "look for files" quite ea= sy to understand. :)