guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CMAKE_LIBRARY_PATH & co.


From: Lluís Batlle i Rossell
Subject: Re: CMAKE_LIBRARY_PATH & co.
Date: Mon, 14 Oct 2013 09:23:05 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Oct 14, 2013 at 09:15:25AM +0200, Ludovic Courtès wrote:
> Andreas Enge <address@hidden> skribis:
> 
> > commit e78fd4ca636a19bc286747f8d91bda22cd8f08fd
> > Author: Andreas Enge <address@hidden>
> > Date:   Sun Oct 13 18:02:49 2013 +0200
> >
> >     guix: Make cmake build system aware of usual paths.
> >     
> >     *  guix/build/cmake-build-system.scm (configure): Set 
> > CMAKE_LIBRARY_PATH to
> >          LIBRARY_PATH and CMAKE_INCLUDE_PATH to CPATH.
> 
> I think this was discussed on IRC yesterday, but I’m not sure I got it:
> are these needed because CMake explicitly looks for files in these
> directories instead of just running the compiler?
> 
> 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 compilation

It may be related to cmake being able to tune very narrowly the -I/-L flags per
project target.

I'm not that anti-cmake; I find the approach of "look for files" quite easy to
understand. :)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]